# HG changeset patch # User alfadur # Date 1593295578 -10800 # Node ID fb1f47e382d0e56883efbd9e794c6277b1f592d3 # Parent 3997d85b3d2e6f0778096e948761cefd35e6953f place sentries on start diff -r 3997d85b3d2e -r fb1f47e382d0 hedgewars/uCommandHandlers.pas --- a/hedgewars/uCommandHandlers.pas Sun Jun 28 00:47:43 2020 +0300 +++ b/hedgewars/uCommandHandlers.pas Sun Jun 28 01:06:18 2020 +0300 @@ -856,6 +856,11 @@ cAirMines:= StrToInt(s) end; +procedure chSentries(var s: shortstring); +begin +cSentries:= StrToInt(s) +end; + procedure chExplosives(var s: shortstring); begin cExplosives:= StrToInt(s) @@ -980,6 +985,7 @@ RegisterVariable('minedudpct',@chMineDudPercent, false); RegisterVariable('minesnum', @chLandMines , false); RegisterVariable('airmines', @chAirMines , false); + RegisterVariable('sentries', @chSentries , false); RegisterVariable('explosives',@chExplosives , false); RegisterVariable('gmflags' , @chGameFlags , false); RegisterVariable('turntime', @chHedgehogTurnTime, false); diff -r 3997d85b3d2e -r fb1f47e382d0 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Sun Jun 28 00:47:43 2020 +0300 +++ b/hedgewars/uGears.pas Sun Jun 28 01:06:18 2020 +0300 @@ -863,6 +863,21 @@ end; if p <> 0 then DeleteGear(Gear); +i:= 0; +unplaced:= 0; +while (i < cSentries) and (unplaced < 4) do + begin + Gear:= AddGear(0, 0, gtSentry, 0, _0, _0, 0); + FindPlace(Gear, false, 0, LAND_WIDTH); + + if Gear = nil then + inc(unplaced) + else + unplaced:= 0; + + inc(i) + end; + if (GameFlags and gfLowGravity) <> 0 then begin cGravity:= cMaxWindSpeed; diff -r 3997d85b3d2e -r fb1f47e382d0 hedgewars/uVariables.pas --- a/hedgewars/uVariables.pas Sun Jun 28 00:47:43 2020 +0300 +++ b/hedgewars/uVariables.pas Sun Jun 28 01:06:18 2020 +0300 @@ -177,6 +177,7 @@ cLandMines : Longword; cAirMines : Longword; + cSentries : Longword; cExplosives : Longword; cScriptName : shortstring; @@ -2959,6 +2960,7 @@ cMaxCaseDrops := 5; cLandMines := 4; cAirMines := 0; + cSentries := 0; cExplosives := 2; GameState := Low(TGameState);