hedgewars/uGearsHandlersMess.pas
changeset 12751 e1395ba033e8
parent 12750 c162995831d8
child 12769 272fcd3833d2
equal deleted inserted replaced
12750:c162995831d8 12751:e1395ba033e8
  3241         //fY:= Gear^.Y;
  3241         //fY:= Gear^.Y;
  3242         //fX.QWordValue:= fX.QWordValue and $FFFFFFFF00000000;
  3242         //fX.QWordValue:= fX.QWordValue and $FFFFFFFF00000000;
  3243         //fY.QWordValue:= fY.QWordValue and $FFFFFFFF00000000;
  3243         //fY.QWordValue:= fY.QWordValue and $FFFFFFFF00000000;
  3244         fX:= int2hwFloat(hwRound(Gear^.X));
  3244         fX:= int2hwFloat(hwRound(Gear^.X));
  3245         fY:= int2hwFloat(hwRound(Gear^.Y));
  3245         fY:= int2hwFloat(hwRound(Gear^.Y));
  3246         dmgBase:= cakeDmg shl 1 + cHHRadius div 2;
  3246         dmgBase:= Gear^.Boom shl 1 + cHHRadius div 2;
  3247         partyEpicness:= 0;
  3247         partyEpicness:= 0;
  3248         gi := GearsList;
  3248         gi := GearsList;
  3249         while gi <> nil do
  3249         while gi <> nil do
  3250             begin
  3250             begin
  3251             if gi^.Kind = gtHedgehog then
  3251             if gi^.Kind = gtHedgehog then
  3252                 begin
  3252                 begin
  3253                 dmg:= 0;
  3253                 dmg:= 0;
  3254                 if hwRound(PointDistance(gi^.X, fX, gi^.Y, fY, true)) < dmgBase then
  3254                 if hwRound(PointDistance(gi^.X, fX, gi^.Y, fY, true)) < dmgBase then
  3255                     dmg:= dmgBase - max(hwRound(PointDistance(gi^.X, fX, gi^.Y, fY, true)), gi^.Radius);
  3255                     dmg:= dmgBase - max(hwRound(PointDistance(gi^.X, fX, gi^.Y, fY, true)), gi^.Radius);
  3256                 if (dmg > 1) then dmg:= ModifyDamage(min(dmg div 2, cakeDmg), gi);
  3256                 if (dmg > 1) then dmg:= ModifyDamage(min(dmg div 2, Gear^.Boom), gi);
  3257                 if (dmg > 1) then
  3257                 if (dmg > 1) then
  3258                     if (CurrentHedgehog^.Gear = gi) and (gi^.Hedgehog^.Effects[heInvulnerable] = 0) then
  3258                     if (CurrentHedgehog^.Gear = gi) and (gi^.Hedgehog^.Effects[heInvulnerable] = 0) then
  3259                         begin
  3259                         begin
  3260                         gi^.State := gi^.State or gstLoser;
  3260                         gi^.State := gi^.State or gstLoser;
  3261                         // probably not too epic if hitting self too...
  3261                         // probably not too epic if hitting self too...