hedgewars/uGears.pas
changeset 295 8834f3cb620e
parent 294 92a7ccd67bb9
child 300 be94799f33d2
--- a/hedgewars/uGears.pas	Sun Dec 10 12:09:32 2006 +0000
+++ b/hedgewars/uGears.pas	Sun Dec 10 15:55:53 2006 +0000
@@ -67,7 +67,7 @@
 
 implementation
 uses uWorld, uMisc, uStore, uConsole, uSound, uTeams, uRandom, uCollisions,
-     uLand, uIO, uLandGraphics, uAIMisc, uLocale, uAI;
+     uLand, uIO, uLandGraphics, uAIMisc, uLocale, uAI, uAmmos;
 var RopePoints: record
                 Count: Longword;
                 HookAngle: integer;
@@ -779,10 +779,18 @@
 
 procedure SpawnBoxOfSmth;
 begin
-if (CountGears(gtCase) > 2) or (getrandom(3) <> 0) then exit;
+if (CountGears(gtCase) >= 5) or (getrandom(cCaseFactor) <> 0) then exit;
 FollowGear:= AddGear(0, 0, gtCase, 0);
-FollowGear.Health:= 25;
-FollowGear.Pos:= posCaseHealth;
+case getrandom(2) of
+     0: begin
+        FollowGear.Health:= 25;
+        FollowGear.Pos:= posCaseHealth
+        end;
+     1: begin
+        FollowGear.Pos:= posCaseAmmo;
+        FollowGear.State:= Longword(amMineStrike)
+        end;
+     end;
 FindPlace(FollowGear, true, 0, 2048)
 end;