Move max. number of crate spawns into variable
authorWuzzy <Wuzzy2@mail.ru>
Tue, 07 Aug 2018 10:29:01 +0200
changeset 13627 605767bbd022
parent 13626 2bdbef3f534c
child 13628 d5e029b84e16
Move max. number of crate spawns into variable
ChangeLog.txt
hedgewars/uGearsUtils.pas
hedgewars/uScript.pas
hedgewars/uVariables.pas
--- a/ChangeLog.txt	Tue Aug 07 03:24:54 2018 +0200
+++ b/ChangeLog.txt	Tue Aug 07 10:29:01 2018 +0200
@@ -87,6 +87,7 @@
  + New parameter: ShowMission: 6th param. forceDisplay: Set to true to prevent this particular mission panel to be hidden manually by player
  + New Lua library: Achievements
  + Can enable infinite fly time for jetpack/Birdy by setting health to JETPACK_FUEL_INFINITE or BIRDY_ENERGY_INFINITE, respectively
+ + New global game variable: MaxCaseDrops. Max. number of crats which can be in game by crate drops
  + New global: NoPointX. Value of CursorX and CursorY if cursor is inactive
  + New global: AMMO_INFINITE. Value for infinite ammo count for AddAmmo and other functions
  + New global: cMaxHogHealth. Maximum possible hedgehog health
--- a/hedgewars/uGearsUtils.pas	Tue Aug 07 03:24:54 2018 +0200
+++ b/hedgewars/uGearsUtils.pas	Tue Aug 07 10:29:01 2018 +0200
@@ -1536,7 +1536,7 @@
 begin
 if (PlacingHogs) or
     (cCaseFactor = 0)
-    or (CountGears(gtCase) >= 5)
+    or (CountGears(gtCase) >= cMaxCaseDrops)
     or (GetRandom(cCaseFactor) <> 0) then
        exit;
 
--- a/hedgewars/uScript.pas	Tue Aug 07 03:24:54 2018 +0200
+++ b/hedgewars/uScript.pas	Tue Aug 07 10:29:01 2018 +0200
@@ -3376,6 +3376,7 @@
 ScriptSetInteger('ScreenWidth', cScreenWidth);
 ScriptSetInteger('TurnTime', cHedgehogTurnTime);
 ScriptSetInteger('CaseFreq', cCaseFactor);
+ScriptSetInteger('MaxCaseDrops', cMaxCaseDrops);
 ScriptSetInteger('HealthCaseProb', cHealthCaseProb);
 ScriptSetInteger('HealthCaseAmount', cHealthCaseAmount);
 ScriptSetInteger('DamagePercent', cDamagePercent);
@@ -3408,6 +3409,7 @@
 WorldEdge        := TWorldEdge(ScriptGetInteger('WorldEdge'));
 cHedgehogTurnTime:= ScriptGetInteger('TurnTime');
 cCaseFactor      := ScriptGetInteger('CaseFreq');
+cMaxCaseDrops    := ScriptGetInteger('MaxCaseDrops');
 cHealthCaseProb  := ScriptGetInteger('HealthCaseProb');
 cHealthCaseAmount:= ScriptGetInteger('HealthCaseAmount');
 cDamagePercent   := ScriptGetInteger('DamagePercent');
--- a/hedgewars/uVariables.pas	Tue Aug 07 03:24:54 2018 +0200
+++ b/hedgewars/uVariables.pas	Tue Aug 07 10:29:01 2018 +0200
@@ -161,6 +161,7 @@
     cScreenSpace          : Longword;
 
     cCaseFactor     : Longword;
+    cMaxCaseDrops   : Longword; // Max. number of crates which can be in the game when dropping
     cLandMines      : Longword;
     cAirMines       : Longword;
     cExplosives     : Longword;
@@ -2839,6 +2840,7 @@
     RealTicks       := 0;
     AttackBar       := 0; // 0 - none, 1 - just bar at the right-down corner, 2 - from weapon
     cCaseFactor     := 5;  {0..9}
+    cMaxCaseDrops   := 5;
     cLandMines      := 4;
     cAirMines       := 0;
     cExplosives     := 2;