Suggestion of sheepluva's - disable timebox in crates after SD, and set to disabled in Ammo. Also disable switch hedgehog for teams of 1 hedgehog in size, and try and correct what appears to be a bug in reserved hats.
authornemo
Wed, 07 Dec 2011 11:35:03 -0500
changeset 6515 74a04089bb56
parent 6514 8ba891d34eba
child 6516 addaeb1b9539
Suggestion of sheepluva's - disable timebox in crates after SD, and set to disabled in Ammo. Also disable switch hedgehog for teams of 1 hedgehog in size, and try and correct what appears to be a bug in reserved hats.
hedgewars/uAmmos.pas
hedgewars/uGears.pas
hedgewars/uGearsHedgehog.pas
hedgewars/uStore.pas
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/FrontendDataUtils.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/GameMode.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Grave.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Map.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Scheme.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Team.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Weapon.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/UserInput/TouchInterface.java
share/hedgewars/Data/Scripts/plist/Racer.plist
--- a/hedgewars/uAmmos.pas	Wed Dec 07 17:55:23 2011 +0400
+++ b/hedgewars/uAmmos.pas	Wed Dec 07 11:35:03 2011 -0500
@@ -428,11 +428,10 @@
 for t:= 0 to Pred(TeamsCount) do
    with TeamsArray[t]^ do
       for i:= 0 to cMaxHHIndex do
-          if Hedgehogs[i].Gear <> nil then
-             begin
-             FillAmmoStore(Hedgehogs[i].Ammo, InitialCounts[Hedgehogs[i].AmmoStore]);
-             Hedgehogs[i].CurAmmoType:= amNothing
-             end;
+         begin
+         FillAmmoStore(Hedgehogs[i].Ammo, InitialCounts[Hedgehogs[i].AmmoStore]);
+         Hedgehogs[i].CurAmmoType:= amNothing
+         end;
 
 for a:= Low(TAmmoType) to High(TAmmoType) do
     if Ammoz[a].SkipTurns >= 10000 then dec(Ammoz[a].SkipTurns,10000)
--- a/hedgewars/uGears.pas	Wed Dec 07 17:55:23 2011 +0400
+++ b/hedgewars/uGears.pas	Wed Dec 07 11:35:03 2011 -0500
@@ -39,8 +39,14 @@
 procedure freeModule;
 function  SpawnCustomCrateAt(x, y: LongInt; crate: TCrateType; content: Longword ): PGear;
 function  SpawnFakeCrateAt(x, y: LongInt; crate: TCrateType; explode: boolean; poison: boolean ): PGear;
+<<<<<<< local
 function  GetAmmo: TAmmoType;
 function  GetUtility: TAmmoType;
+=======
+function  GetAmmo(Hedgehog: PHedgehog): TAmmoType;
+function  GetUtility(Hedgehog: PHedgehog): TAmmoType;
+procedure ResurrectHedgehog(gear: PGear);
+>>>>>>> other
 procedure HideHog(HH: PHedgehog);
 procedure RestoreHog(HH: PHedgehog);
 procedure ProcessGears;
@@ -350,6 +356,8 @@
                         ChangeToSDClouds;
                         ChangeToSDFlakes;
                         glClearColor(SDSkyColor.r * (SDTint/255) / 255, SDSkyColor.g * (SDTint/255) / 255, SDSkyColor.b * (SDTint/255) / 255, 0.99);
+                        Ammoz[amTardis].SkipTurns:= 9999;
+                        Ammoz[amTardis].Probability:= 0;
                         end;
                     AddCaption(trmsg[sidSuddenDeath], cWhiteColor, capgrpGameState);
                     playSound(sndSuddenDeath);
@@ -1104,7 +1112,7 @@
     SpawnFakeCrateAt := FollowGear;
 end;
 
-function GetAmmo: TAmmoType;
+function GetAmmo(Hedgehog: PHedgehog): TAmmoType;
 var t, aTot: LongInt;
     i: TAmmoType;
 begin
@@ -1129,14 +1137,14 @@
 GetAmmo:= i
 end;
 
-function GetUtility: TAmmoType;
+function GetUtility(Hedgehog: PHedgehog): TAmmoType;
 var t, uTot: LongInt;
     i: TAmmoType;
 begin
 
 uTot:= 0;
 for i:= Low(TAmmoType) to High(TAmmoType) do
-    if (Ammoz[i].Ammo.Propz and ammoprop_Utility) <> 0 then
+    if ((Ammoz[i].Ammo.Propz and ammoprop_Utility) <> 0) and ((Hedgehog^.Team^.HedgehogsNumber > 1) or (Ammoz[i].Ammo.AmmoType <> amSwitch)) then
         inc(uTot, Ammoz[i].Probability);
 
 t:= uTot;
@@ -1147,7 +1155,7 @@
     while t >= 0 do
       begin
       inc(i);
-      if (Ammoz[i].Ammo.Propz and ammoprop_Utility) <> 0 then
+      if ((Ammoz[i].Ammo.Propz and ammoprop_Utility) <> 0) and ((Hedgehog^.Team^.HedgehogsNumber > 1) or (Ammoz[i].Ammo.AmmoType <> amSwitch)) then
           dec(t, Ammoz[i].Probability)
       end
     end;
--- a/hedgewars/uGearsHedgehog.pas	Wed Dec 07 17:55:23 2011 +0400
+++ b/hedgewars/uGearsHedgehog.pas	Wed Dec 07 11:35:03 2011 -0500
@@ -551,8 +551,8 @@
                     else
                         begin
                         for i:= 0 to GameTicks and $7F do GetRandom(2); // Burn some random numbers
-                        if Gear^.Pos = posCaseUtility then a:= GetUtility
-                        else a:= GetAmmo
+                        if Gear^.Pos = posCaseUtility then a:= GetUtility(HH^.Hedgehog)
+                        else a:= GetAmmo(HH^.Hedgehog)
                         end;
                     AddAmmo(HH^.Hedgehog^, a);
 // Possibly needs to check shared clan ammo game flag once added.
--- a/hedgewars/uStore.pas	Wed Dec 07 17:55:23 2011 +0400
+++ b/hedgewars/uStore.pas	Wed Dec 07 11:35:03 2011 -0500
@@ -199,7 +199,7 @@
                     if Hat <> 'NoHat' then
                         begin
                         if (Length(Hat) > 39) and (Copy(Hat,1,8) = 'Reserved') and (Copy(Hat,9,32) = PlayerHash) then
-                            LoadHedgehogHat(Gear, 'Reserved/' + Copy(Hat,9,Length(s)-8))
+                            LoadHedgehogHat(Gear, 'Reserved/' + Copy(Hat,9,Length(Hat)-8))
                         else
                             LoadHedgehogHat(Gear, Hat);
                         end