Alter distribution of probabilities from frontend, allow utility crates in shoppa if probabilities permit (still ban health crates)
authornemo
Fri, 02 Apr 2010 15:41:39 +0000
changeset 3255 6d6f4241debe
parent 3254 eb1382353361
child 3256 b4fd1d197621
Alter distribution of probabilities from frontend, allow utility crates in shoppa if probabilities permit (still ban health crates)
hedgewars/uAmmos.pas
hedgewars/uGears.pas
--- a/hedgewars/uAmmos.pas	Fri Apr 02 15:33:11 2010 +0000
+++ b/hedgewars/uAmmos.pas	Fri Apr 02 15:41:39 2010 +0000
@@ -82,7 +82,7 @@
 end;
 
 procedure AddAmmoStore(s: shortstring);
-const probability: array [0..8] of LongWord = (0,20,30,60,100,150,200,400,600);
+const probability: array [0..8] of LongWord = (0,20,30,60,100,200,400,600,800);
 var cnt: Longword;
     a: TAmmoType;
     ammos: TAmmoCounts;
--- a/hedgewars/uGears.pas	Fri Apr 02 15:33:11 2010 +0000
+++ b/hedgewars/uGears.pas	Fri Apr 02 15:41:39 2010 +0000
@@ -2161,13 +2161,11 @@
 
 FollowGear:= nil;
 
-if shoppa then  // FIXME -  TEMPORARY  REMOVE WHEN CRATE PROBABILITY IS ADDED, INCLUDING DISABLING OF HEALTH CRATES
-    t:= 7
-else
-    t:= getrandom(20);
+t:= getrandom(20);
 
-// avoid health crates if all hogs are invulnerable
-if (t < 13) and ((GameFlags and gfInvulnerable) <> 0) then t:= t * 13 div 20 + 7;
+// FIXME - shoppa is TEMPORARY REMOVE WHEN CRATE PROBABILITY ALLOWS DISABLING OF HEALTH CRATES                               
+// avoid health crates if all hogs are invulnerable                                                                          
+if (t < 13) and (shoppa or ((GameFlags and gfInvulnerable) <> 0)) then t:= t * 13 div 20 + 7;                                
     
 //case getrandom(20) of
 case t of