hedgewars/uGearsUtils.pas
changeset 15710 7383256f8535
parent 15709 6b04399c84a7
child 15740 0a172cfe8840
equal deleted inserted replaced
15709:6b04399c84a7 15710:7383256f8535
   147                 gtAirMine,
   147                 gtAirMine,
   148                 gtCase,
   148                 gtCase,
   149                 gtTarget,
   149                 gtTarget,
   150                 gtFlame,
   150                 gtFlame,
   151                 gtKnife,
   151                 gtKnife,
   152                 gtExplosives: begin
   152                 gtExplosives,
       
   153                 gtSentry: begin
   153 // Run the calcs only once we know we have a type that will need damage
   154 // Run the calcs only once we know we have a type that will need damage
   154                         tdX:= Gear^.X-fX;
   155                         tdX:= Gear^.X-fX;
   155                         tdY:= Gear^.Y-fY;
   156                         tdY:= Gear^.Y-fY;
   156                         if LongInt(tdX.Round + tdY.Round + 2) < dmgBase then
   157                         if LongInt(tdX.Round + tdY.Round + 2) < dmgBase then
   157                             dmg:= dmgBase - hwRound(Distance(tdX, tdY));
   158                             dmg:= dmgBase - hwRound(Distance(tdX, tdY));
  1258             gtSMine,
  1259             gtSMine,
  1259             gtAirMine,
  1260             gtAirMine,
  1260             gtKnife,
  1261             gtKnife,
  1261             gtCase,
  1262             gtCase,
  1262             gtTarget,
  1263             gtTarget,
  1263             gtExplosives: begin
  1264             gtExplosives,
       
  1265             gtSentry: begin
  1264 //addFileLog('ShotgunShot radius: ' + inttostr(Gear^.Radius) + ', t^.Radius = ' + inttostr(t^.Radius) + ', distance = ' + inttostr(dist) + ', dmg = ' + inttostr(dmg));
  1266 //addFileLog('ShotgunShot radius: ' + inttostr(Gear^.Radius) + ', t^.Radius = ' + inttostr(t^.Radius) + ', distance = ' + inttostr(dist) + ', dmg = ' + inttostr(dmg));
  1265                     dmg:= 0;
  1267                     dmg:= 0;
  1266                     r:= Gear^.Radius + t^.Radius;
  1268                     r:= Gear^.Radius + t^.Radius;
  1267                     dx:= Gear^.X-t^.X;
  1269                     dx:= Gear^.X-t^.X;
  1268                     dx.isNegative:= false;
  1270                     dx.isNegative:= false;
  1399             gtAirMine,
  1401             gtAirMine,
  1400             gtSMine,
  1402             gtSMine,
  1401             gtKnife,
  1403             gtKnife,
  1402             gtTarget,
  1404             gtTarget,
  1403             gtCase,
  1405             gtCase,
  1404             gtExplosives:
  1406             gtExplosives,
       
  1407             gtSentry:
  1405             begin
  1408             begin
  1406             if (Ammo^.Kind in [gtFirePunch, gtKamikaze]) and (Gear^.Kind <> gtSMine) then
  1409             if (Ammo^.Kind in [gtFirePunch, gtKamikaze]) and (Gear^.Kind <> gtSMine) then
  1407                 PlaySound(sndFirePunchHit);
  1410                 PlaySound(sndFirePunchHit);
  1408 
  1411 
  1409             if Ammo^.Kind in [gtDEagleShot, gtSniperRifleShot, gtMinigunBullet] then
  1412             if Ammo^.Kind in [gtDEagleShot, gtSniperRifleShot, gtMinigunBullet] then