hedgewars/GSHandlers.inc
branchwebgl
changeset 8096 453917e94e55
parent 8026 4a4f21070479
parent 8061 c08e9c3e0737
child 8105 d088be5ecdcb
equal deleted inserted replaced
8053:2e836bebb518 8096:453917e94e55
  1690         if Gear^.Health <= 0 then
  1690         if Gear^.Health <= 0 then
  1691             exBoom := true;
  1691             exBoom := true;
  1692         end
  1692         end
  1693     else
  1693     else
  1694         begin 
  1694         begin 
  1695         if (Gear^.Pos <> posCaseHealth) and (GameTicks and $3FF = 0) then // stir it up every second or so
  1695         if (Gear^.Pos <> posCaseHealth) and (GameTicks and $1FFF = 0) then // stir 'em up periodically
  1696             begin
  1696             begin
  1697             gi := GearsList;
  1697             gi := GearsList;
  1698             while gi <> nil do
  1698             while gi <> nil do
  1699                 begin
  1699                 begin
  1700                 if gi^.Kind = gtGenericFaller then
  1700                 if gi^.Kind = gtGenericFaller then
  2455     hasWishes:= ((Gear^.Message and (gmPrecise or gmSwitch)) = (gmPrecise or gmSwitch));
  2455     hasWishes:= ((Gear^.Message and (gmPrecise or gmSwitch)) = (gmPrecise or gmSwitch));
  2456     if hasWishes then
  2456     if hasWishes then
  2457         Gear^.AdvBounce:= 1;
  2457         Gear^.AdvBounce:= 1;
  2458 
  2458 
  2459     HHGear := Gear^.Hedgehog^.Gear;
  2459     HHGear := Gear^.Hedgehog^.Gear;
       
  2460     if HHGear = nil then
       
  2461         begin
       
  2462         DeleteGear(Gear);
       
  2463         exit
       
  2464         end;
       
  2465 
  2460     HHGear^.State := HHGear^.State or gstNoDamage;
  2466     HHGear^.State := HHGear^.State or gstNoDamage;
  2461     DeleteCI(HHGear);
  2467     DeleteCI(HHGear);
  2462 
  2468 
  2463     Gear^.X := HHGear^.X;
  2469     Gear^.X := HHGear^.X;
  2464     Gear^.Y := HHGear^.Y;
  2470     Gear^.Y := HHGear^.Y;
  5149     gi := GearsList;
  5155     gi := GearsList;
  5150     while gi <> nil do
  5156     while gi <> nil do
  5151         begin
  5157         begin
  5152         with gi^ do CheckSum:= CheckSum xor X.round xor X.frac xor dX.round xor dX.frac xor Y.round xor Y.frac xor dY.round xor dY.frac;
  5158         with gi^ do CheckSum:= CheckSum xor X.round xor X.frac xor dX.round xor dX.frac xor Y.round xor Y.frac xor dY.round xor dY.frac;
  5153         AddRandomness(CheckSum);
  5159         AddRandomness(CheckSum);
       
  5160         if gi^.Kind = gtGenericFaller then gi^.State:= gi^.State and not gstTmpFlag;
  5154         gi := gi^.NextGear
  5161         gi := gi^.NextGear
  5155         end;
  5162         end;
  5156     AddPickup(Gear^.Hedgehog^, a, Gear^.Power, hwRound(Gear^.X), hwRound(Gear^.Y));
  5163     AddPickup(Gear^.Hedgehog^, a, Gear^.Power, hwRound(Gear^.X), hwRound(Gear^.Y));
  5157     DeleteGear(Gear)
  5164     DeleteGear(Gear)
  5158     end;
  5165     end;
  5166     else
  5173     else
  5167         begin
  5174         begin
  5168         DeleteGear(Gear);
  5175         DeleteGear(Gear);
  5169         exit
  5176         exit
  5170         end;
  5177         end;
  5171     
  5178 if (Gear^.State and gstTmpFlag <> 0) or (GameTicks and $7 = 0) then
  5172 doStepFallingGear(Gear);
  5179     begin
       
  5180     doStepFallingGear(Gear);
       
  5181     if (Gear^.State and gstInvisible <> 0) and (GameTicks and $FF = 0) and ((hwRound(Gear^.X) < leftX) or (hwRound(Gear^.X) > rightX) or (hwRound(Gear^.Y) < topY)) then
       
  5182         begin
       
  5183         Gear^.X:= int2hwFloat(GetRandom(rightX-leftX)+leftX);
       
  5184         Gear^.Y:= int2hwFloat(GetRandom(LAND_HEIGHT-topY)+topY);
       
  5185         Gear^.dX:= _90-(GetRandomf*_360);
       
  5186         Gear^.dY:= _90-(GetRandomf*_360)
       
  5187         end;
       
  5188     end
  5173 end;
  5189 end;
  5174 
  5190 
  5175 procedure doStepCreeper(Gear: PGear);
  5191 procedure doStepCreeper(Gear: PGear);
  5176 var hogs: PGearArrayS;
  5192 var hogs: PGearArrayS;
  5177     HHGear: PGear;
  5193     HHGear: PGear;