6 Class.CastTo(defib, item);
8 return CanDefibrillate(defib);
11 bool CanDefibrillate(Defibrillator defib)
13 if ( defib.IsCharged() )
23 void DefibrillateClient(
PlayerBase player, Defibrillator defib)
25 defib.DischargeClient(player);
28 void DefibrillateServer(
PlayerBase player, Defibrillator defib)
30 if ( defib.IsCharged() )
32 defib.DischargeServer(player);
35 float regain_energy = player.GetSoftSkillsManager().SubtractSpecialtyBonus( defib.GetEnergyNeededToCharge(),
this.GetSpecialtyWeight() );
36 regain_energy = defib.GetEnergyNeededToCharge() - regain_energy;
40 if (
Class.CastTo(battery, defib.GetCompEM().GetEnergySource()))
42 battery.GetCompEM().AddEnergy( regain_energy );
46 DPrint(
"ERROR! Defibrillator has no battery! Defibrillator softskill bonus can't be applied!");