From 92ee7c8f9c1979340b7ef4ba092c637492e3656b Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Tue, 31 Jul 2018 22:04:28 -0700 Subject: [PATCH] missing surface check and raid ai toggle --- changelog.txt | 9 +++++++++ control.lua | 3 ++- libs/AIPlanning.lua | 2 +- locale/en/locale.cfg | 6 +++++- settings.lua | 12 +++++++++++- 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index d9b9f20..c6e3fcd 100755 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,12 @@ +--------------------------------------------------------------------------------------------------- +Version: 0.16.32 +Date: 7. 19. 2018 + Improvements: + - Raiding AI Toggle - toggles the ai raiding parties from outside your pollution cloud + Bugfixes: + - Invalid surface index for creative mode blueprinted tiles + + --------------------------------------------------------------------------------------------------- Version: 0.16.31 Date: 7. 19. 2018 diff --git a/control.lua b/control.lua index b29ff22..4fc88f4 100755 --- a/control.lua +++ b/control.lua @@ -280,6 +280,7 @@ local function onModSettingsChange(event) upgrade.compareTable(natives, "attackUsePollution", settings.global["rampant-attackWaveGenerationUsePollution"].value) upgrade.compareTable(natives, "deadZoneFrequency", settings.global["rampant-deadZoneFrequency"].value) + upgrade.compareTable(natives, "raidAIToggle", settings.global["rampant-raidAIToggle"].value) upgrade.compareTable(natives, "attackThresholdMin", settings.global["rampant-attackWaveGenerationThresholdMin"].value) upgrade.compareTable(natives, "attackThresholdMax", settings.global["rampant-attackWaveGenerationThresholdMax"].value) @@ -510,7 +511,7 @@ local function onEnemyBaseBuild(event) end local function onSurfaceTileChange(event) - local surfaceIndex = event.surface_index or (event.robot and event.robot.surface.index) + local surfaceIndex = event.surface_index or (event.robot and event.robot.surface and event.robot.surface.index) if event.item and (event.item.name == "landfill") and (surfaceIndex == 1) then local surface = game.surfaces[natives.activeSurface] local chunks = {} diff --git a/libs/AIPlanning.lua b/libs/AIPlanning.lua index 502af17..b03f30f 100755 --- a/libs/AIPlanning.lua +++ b/libs/AIPlanning.lua @@ -115,7 +115,7 @@ function aiPlanning.planning(natives, evolution_factor, tick, surface, connected natives.state = AI_STATE_MIGRATING elseif (roll < 0.80) then natives.state = AI_STATE_SIEGE - elseif (evolution_factor >= 0.04) then + elseif ((natives.raidAIToggle) and (evolution_factor >= 0.04)) then natives.state = AI_STATE_RAIDING natives.points = natives.points + 1000 diff --git a/locale/en/locale.cfg b/locale/en/locale.cfg index 56a21f9..fb83c2c 100755 --- a/locale/en/locale.cfg +++ b/locale/en/locale.cfg @@ -11265,6 +11265,8 @@ rampant-unitSpawnerOwnedScaler=Unit Spawner Owned Count Scaler rampant-unitSpawnerSpawnScaler=Unit Spawner Spawn Count Scaler rampant-unitSpawnerRespawnScaler=Unit Spawner Respawn Rate Scaler +rampant-raidAIToggle=AI: Enable Raiding AI + [mod-setting-description] rampant-useDumbProjectiles=Turns off homing projectiles for worms and spitters rampant-useNEUnitLaunchers=ONLY FOR USE WITH NATURAL EVOLUTION ENEMIES use the NE unit launchers with medium and big worms. if set to false this will still allow the dumb projectiles but without the unit spawning. A side effect of the dumb projectiles cause the units to be spawned as if two shots were fired @@ -11326,4 +11328,6 @@ rampant-unitWormRangeScaler=Scales by a percentage all new enemy worm range rampant-unitSpawnerHealthScaler=Scales by a percentage all new enemy nest health rampant-unitSpawnerOwnedScaler=Scales by a percentage all new enemy nest max number of units controlled per spawner rampant-unitSpawnerSpawnScaler=Scales by a percentage all new enemy nest number of units spawned at any one time -rampant-unitSpawnerRespawnScaler=Scales by a percentage all new enemy nest time to spawn new units \ No newline at end of file +rampant-unitSpawnerRespawnScaler=Scales by a percentage all new enemy nest time to spawn new units + +rampant-raidAIToggle=Toggles the ai raiding parties from outside your pollution cloud \ No newline at end of file diff --git a/settings.lua b/settings.lua index 32cdf53..ea4f1b7 100755 --- a/settings.lua +++ b/settings.lua @@ -36,7 +36,7 @@ data:extend({ order = "b[modifier]-a[trigger]", per_user = false }, - + { type = "bool-setting", name = "rampant-attackWaveGenerationUsePlayerProximity", @@ -375,6 +375,15 @@ data:extend({ per_user = false }, + { + type = "bool-setting", + name = "rampant-raidAIToggle", + setting_type = "runtime-global", + default_value = true, + order = "m[total]-c[ai]", + per_user = false + }, + { type = "bool-setting", name = "rampant-removeBloodParticles", @@ -624,4 +633,5 @@ data:extend({ order = "p[modifier]-r[unit]", per_user = false } + })