hedgewars/uGearsUtils.pas
changeset 11477 c55b3e09a04e
parent 11197 283b6e6cf7ea
child 11482 e425a6eb9da3
equal deleted inserted replaced
11476:458d90012c22 11477:c55b3e09a04e
  1072                     dy:= Gear^.Y-t^.Y;
  1072                     dy:= Gear^.Y-t^.Y;
  1073                     dy.isNegative:= false;
  1073                     dy.isNegative:= false;
  1074                     if r-hwRound(dx+dy) > 0 then
  1074                     if r-hwRound(dx+dy) > 0 then
  1075                         begin
  1075                         begin
  1076                         dist:= hwRound(Distance(dx, dy));
  1076                         dist:= hwRound(Distance(dx, dy));
  1077                         dmg:= ModifyDamage(min(r - dist, 25), t);
  1077                         dmg:= ModifyDamage(min(r - dist, Gear^.Boom), t);
  1078                         end;
  1078                         end;
  1079                     if dmg > 0 then
  1079                     if dmg > 0 then
  1080                         begin
  1080                         begin
  1081                         if (t^.Kind <> gtHedgehog) or (t^.Hedgehog^.Effects[heInvulnerable] = 0) then
  1081                         if (t^.Kind <> gtHedgehog) or (t^.Hedgehog^.Effects[heInvulnerable] = 0) then
  1082                             ApplyDamage(t, Gear^.Hedgehog, dmg, dsBullet)
  1082                             ApplyDamage(t, Gear^.Hedgehog, dmg, dsBullet)
  1100                     dy:= Gear^.Y-t^.Y;
  1100                     dy:= Gear^.Y-t^.Y;
  1101                     dy.isNegative:= false;
  1101                     dy.isNegative:= false;
  1102                     if r-hwRound(dx+dy) > 0 then
  1102                     if r-hwRound(dx+dy) > 0 then
  1103                         begin
  1103                         begin
  1104                         dist:= hwRound(Distance(dx, dy));
  1104                         dist:= hwRound(Distance(dx, dy));
  1105                         dmg:= ModifyDamage(min(r - dist, 25), t);
  1105                         dmg:= ModifyDamage(min(r - dist, Gear^.Boom), t);
  1106                         end;
  1106                         end;
  1107                     if dmg > 0 then
  1107                     if dmg > 0 then
  1108                         begin
  1108                         begin
  1109                         t^.dY:= - _0_1;
  1109                         t^.dY:= - _0_1;
  1110                         t^.Active:= true
  1110                         t^.Active:= true