hedgewars/uGearsUtils.pas
changeset 8161 0b8beacff8a5
parent 8007 b07ce9dfc6bb
child 8199 886ed135665b
equal deleted inserted replaced
8159:e226be871b6e 8161:0b8beacff8a5
   104                 gtSMine,
   104                 gtSMine,
   105                 gtCase,
   105                 gtCase,
   106                 gtTarget,
   106                 gtTarget,
   107                 gtFlame,
   107                 gtFlame,
   108                 gtKnife,
   108                 gtKnife,
   109                 gtExplosives,
   109                 gtExplosives: begin //,
   110                 gtStructure: begin
   110                 //gtStructure: begin
   111 // Run the calcs only once we know we have a type that will need damage
   111 // Run the calcs only once we know we have a type that will need damage
   112                         tdX:= Gear^.X-fX;
   112                         tdX:= Gear^.X-fX;
   113                         tdY:= Gear^.Y-fY;
   113                         tdY:= Gear^.Y-fY;
   114                         if LongInt(tdX.Round + tdY.Round + 2) < dmgBase then
   114                         if LongInt(tdX.Round + tdY.Round + 2) < dmgBase then
   115                             dmg:= dmgBase - hwRound(Distance(tdX, tdY));
   115                             dmg:= dmgBase - hwRound(Distance(tdX, tdY));
   241             CurrentHedgehog^.Gear^.LastDamage := CurrentHedgehog;
   241             CurrentHedgehog^.Gear^.LastDamage := CurrentHedgehog;
   242             spawnHealthTagForHH(CurrentHedgehog^.Gear, tmpDmg);
   242             spawnHealthTagForHH(CurrentHedgehog^.Gear, tmpDmg);
   243             end;
   243             end;
   244         uStats.HedgehogDamaged(Gear, AttackerHog, Damage, false);    
   244         uStats.HedgehogDamaged(Gear, AttackerHog, Damage, false);    
   245         end;
   245         end;
   246     end
   246     end;
   247     else if Gear^.Kind <> gtStructure then // not gtHedgehog nor gtStructure
   247     //else if Gear^.Kind <> gtStructure then // not gtHedgehog nor gtStructure
   248         Gear^.Hedgehog:= AttackerHog;
   248         Gear^.Hedgehog:= AttackerHog;
   249     inc(Gear^.Damage, Damage);
   249     inc(Gear^.Damage, Damage);
   250     
   250     
   251     ScriptCall('onGearDamage', Gear^.UID, Damage);
   251     ScriptCall('onGearDamage', Gear^.UID, Damage);
   252 end;
   252 end;