hedgewars/uGearsUtils.pas
changeset 12293 6383323fdd2c
parent 12289 c20fbf96b853
child 12342 ad09d733fdb0
equal deleted inserted replaced
12292:93434ab299a0 12293:6383323fdd2c
   259 else
   259 else
   260     ModifyDamage:= hwRound(cDamageModifier * dmg * i * cDamagePercent * _0_01);
   260     ModifyDamage:= hwRound(cDamageModifier * dmg * i * cDamagePercent * _0_01);
   261 end;
   261 end;
   262 
   262 
   263 procedure ApplyDamage(Gear: PGear; AttackerHog: PHedgehog; Damage: Longword; Source: TDamageSource);
   263 procedure ApplyDamage(Gear: PGear; AttackerHog: PHedgehog; Damage: Longword; Source: TDamageSource);
   264 var s: shortstring;
   264 var s: ansistring;
   265     vampDmg, tmpDmg, i: Longword;
   265     vampDmg, tmpDmg, i: Longword;
   266     vg: PVisualGear;
   266     vg: PVisualGear;
   267 begin
   267 begin
   268     if Damage = 0 then
   268     if Damage = 0 then
   269         exit; // nothing to apply
   269         exit; // nothing to apply
   284                 if vampDmg >= 1 then
   284                 if vampDmg >= 1 then
   285                     begin
   285                     begin
   286                     // was considering pulsing on attack, Tiy thinks it should be permanent while in play
   286                     // was considering pulsing on attack, Tiy thinks it should be permanent while in play
   287                     //CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State or gstVampiric;
   287                     //CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State or gstVampiric;
   288                     inc(CurrentHedgehog^.Gear^.Health,vampDmg);
   288                     inc(CurrentHedgehog^.Gear^.Health,vampDmg);
   289                     s:= '+' + IntToStr(vampDmg);
   289                     s:= IntToStr(vampDmg);
   290                     AddCaption(ansistring(s), CurrentHedgehog^.Team^.Clan^.Color, capgrpAmmoinfo);
   290                     AddCaption(FormatA(trmsg[sidHealthGain], s), CurrentHedgehog^.Team^.Clan^.Color, capgrpAmmoinfo);
   291                     RenderHealth(CurrentHedgehog^);
   291                     RenderHealth(CurrentHedgehog^);
   292                     RecountTeamHealth(CurrentHedgehog^.Team);
   292                     RecountTeamHealth(CurrentHedgehog^.Team);
   293                     i:= 0;
   293                     i:= 0;
   294                     while (i < vampDmg) and (i < 1000) do
   294                     while (i < vampDmg) and (i < 1000) do
   295                         begin
   295                         begin