hedgewars/uGearsUtils.pas
changeset 7625 5c0ad64afc8d
parent 7614 3ae60c8a15f2
child 7627 e1e112687fd6
equal deleted inserted replaced
7624:03d662ff9c41 7625:5c0ad64afc8d
   106                 gtExplosives,
   106                 gtExplosives,
   107                 gtStructure: begin
   107                 gtStructure: begin
   108 // Run the calcs only once we know we have a type that will need damage
   108 // Run the calcs only once we know we have a type that will need damage
   109                         tdX:= Gear^.X-fX;
   109                         tdX:= Gear^.X-fX;
   110                         tdY:= Gear^.Y-fY;
   110                         tdY:= Gear^.Y-fY;
   111                         if hwRound(hwAbs(tdX)+hwAbs(tdY)) < dmgBase then
   111                         if (tdX.Round + tdY.Round + 2) < dmgBase then
   112                             dmg:= dmgBase - hwRound(Distance(tdX, tdY));
   112                             dmg:= dmgBase - hwRound(Distance(tdX, tdY));
   113                         if dmg > 1 then
   113                         if dmg > 1 then
   114                             begin
   114                             begin
   115                             dmg:= ModifyDamage(min(dmg div 2, Radius), Gear);
   115                             dmg:= ModifyDamage(min(dmg div 2, Radius), Gear);
   116                             //AddFileLog('Damage: ' + inttostr(dmg));
   116                             //AddFileLog('Damage: ' + inttostr(dmg));