3 static const string CHARGING_SOUND =
"defibrillator_charge_SoundSet";
4 static const string CHARGED_AND_READY_SOUND =
"defibrillator_ready_SoundSet";
5 static const string SHOCK_SOUND =
"defibrillator_shock_SoundSet";
7 bool m_IsCharged =
false;
9 static float m_ChargeTime = 5;
10 static float m_EnergyNeededToCharge = 20;
38 return GetGame().ConfigGetFloat(
cfg_path +
"defibEnergyNeededPerCharge");
43 if (!
GetGame().IsDedicatedServer())
52 if (!m_ChargingTimer.IsRunning())
53 m_ChargingTimer.Run(m_ChargeTime,
this,
"OnIsCharged",
NULL,
false);
58 GetCompEM().SwitchOff();
59 GetCompEM().ResetEnergyUsage();
69 if (GetCompEM().IsWorking())
77 GetCompEM().ResetEnergyUsage();
88 m_ChargedAlarm =
NULL;
102 m_ChargingTimer.Stop();
103 m_ChargingTimer =
NULL;
133 victim.SetHealth(
"",
"Shock", 0);
135 GetCompEM().SwitchOff();
eBleedingSourceType GetType()
void AddAction(typename actionName)
Wrapper class for managing sound through SEffectManager.
void SoundStop()
Stops sound.
float GetEnergyNeededToCharge()
override void OnWorkStart()
void DischargeClient(PlayerBase victim)
override void SetActions()
void DischargeServer(PlayerBase victim)
EffectSound m_ChargingSound
EffectSound m_ChargedAlarm
ref Timer m_ChargingTimer
override void OnWorkStop()
float GetTimeNeededToCharge()
static float m_ChargeTime
Manager class for managing Effect (EffectParticle, EffectSound)
static EffectSound PlaySoundOnObject(string sound_set, Object parent_object, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
proto native CGame GetGame()