hedgewars/uGearsUtils.pas
changeset 7272 71df899c4163
parent 7190 aa8d68817c32
child 7357 06454899d0d2
equal deleted inserted replaced
7270:93e92e82d5c8 7272:71df899c4163
   105                 gtStructure: begin
   105                 gtStructure: begin
   106 // Run the calcs only once we know we have a type that will need damage
   106 // Run the calcs only once we know we have a type that will need damage
   107                         tdX:= Gear^.X-fX;
   107                         tdX:= Gear^.X-fX;
   108                         tdY:= Gear^.Y-fY;
   108                         tdY:= Gear^.Y-fY;
   109                         if hwRound(hwAbs(tdX)+hwAbs(tdY)) < dmgBase then
   109                         if hwRound(hwAbs(tdX)+hwAbs(tdY)) < dmgBase then
   110                             dmg:= dmgBase - max(hwRound(Distance(tdX, tdY)),Gear^.Radius);
   110                             dmg:= dmgBase - hwRound(Distance(tdX, tdY));
   111                         if dmg > 1 then
   111                         if dmg > 1 then
   112                             begin
   112                             begin
   113                             dmg:= ModifyDamage(min(dmg div 2, Radius), Gear);
   113                             dmg:= ModifyDamage(min(dmg div 2, Radius), Gear);
   114                             //AddFileLog('Damage: ' + inttostr(dmg));
   114                             //AddFileLog('Damage: ' + inttostr(dmg));
   115                             if (Mask and EXPLNoDamage) = 0 then
   115                             if (Mask and EXPLNoDamage) = 0 then