From 8a6a010bbc556911ade11845088cfd5f8b2c6e0c Mon Sep 17 00:00:00 2001 From: elexis Date: Mon, 21 Nov 2016 17:28:21 +0000 Subject: [PATCH] Disable all unusable structures on survival of the fittest, refs #3102. Prohibit gathering of wood by removing storehouses and the worker elephant. Keep the roman army camp allowed for now because it isn't a dropsite. Always spawn at least one attacker in the first wave. git-svn-id: http://svn.wildfiregames.com/public/ps/trunk@18976 3db68df2-c116-0410-a063-a993310a9797 --- .../maps/random/survivalofthefittest_triggers.js | 38 ++++++++++++++++------ 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/binaries/data/mods/public/maps/random/survivalofthefittest_triggers.js b/binaries/data/mods/public/maps/random/survivalofthefittest_triggers.js index 7d18ae86cf..f028edb844 100644 --- a/binaries/data/mods/public/maps/random/survivalofthefittest_triggers.js +++ b/binaries/data/mods/public/maps/random/survivalofthefittest_triggers.js @@ -1,3 +1,28 @@ +var disabledTemplates = (civ) => [ + // Economic structures + "structures/" + civ + "_corral", + "structures/" + civ + "_farmstead", + "structures/" + civ + "_field", + "structures/" + civ + "_storehouse", + "structures/brit_rotarymill", + "units/maur_support_elephant", + + // Expansions + "structures/" + civ + "_civil_centre", + "structures/" + civ + "_military_colony", + + // Walls + "structures/" + civ + "_wallset_stone", + "structures/rome_wallset_siege", + "other/wallset_palisade", + + // Shoreline + "structures/" + civ + "_dock", + "structures/brit_crannog", + "structures/cart_super_dock", + "structures/ptol_lighthouse" +]; + var treasures = [ "gaia/special_treasure_food_barrel", @@ -10,6 +35,7 @@ var treasures = "gaia/special_treasure_wood", "gaia/special_treasure_wood" ]; + var attackerEntityTemplates = [ [ @@ -91,7 +117,7 @@ Trigger.prototype.StartAnEnemyWave = function() let attackerTemplates = attackerEntityTemplates[Math.floor(Math.random() * attackerEntityTemplates.length)]; // A soldier for each 2-3 minutes of the game. Should be waves of 20 soldiers after an hour let nextTime = Math.round(120000 + Math.random() * 60000); - let attackersPerTemplate = Math.round(cmpTimer.GetTime() / nextTime / attackerTemplates.length); + let attackersPerTemplate = Math.ceil(cmpTimer.GetTime() / nextTime / attackerTemplates.length); let spawned = false; for (let point of this.GetTriggerPoints("A")) @@ -158,19 +184,11 @@ Trigger.prototype.InitGame = function() this.PlaceTreasures(); - // Disable farms, civic centers and walls for all players for (let i = 1; i < numberOfPlayers; ++i) { let cmpPlayer = QueryPlayerIDInterface(i); let civ = cmpPlayer.GetCiv(); - cmpPlayer.SetDisabledTemplates([ - "structures/" + civ + "_field", - "structures/" + civ + "_corral", - "structures/" + civ + "_civil_centre", - "structures/" + civ + "_military_colony", - "structures/" + civ + "_wallset_stone", - "other/wallset_palisade" - ]); + cmpPlayer.SetDisabledTemplates(disabledTemplates(civ)); } }; -- 2.11.4.GIT