From 721b458777617f6a978dfe55961302be9543ae34 Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Sat, 27 Feb 2021 14:50:26 -0800 Subject: [PATCH] see changelog --- .luacheckrc | 5 +- changelog.txt | 8 +- control.lua | 97 ++++--------------------- data-updates.lua | 4 +- libs/AIPlanning.lua | 4 +- libs/ChunkUtils.lua | 2 - libs/Constants.lua | 4 +- libs/SquadAttack.lua | 2 +- locale/en/locale.cfg | 6 +- prototypes/Poison.lua | 4 +- prototypes/buildings/UpdatesVanilla.lua | 41 ++++++++--- prototypes/utils/AttackBall.lua | 6 +- prototypes/utils/AttackFlame.lua | 6 +- prototypes/utils/BeamUtils.lua | 12 +-- prototypes/utils/BiterUtils.lua | 3 +- prototypes/utils/ColorUtils.lua | 2 +- prototypes/utils/FireUtils.lua | 66 ++++++++--------- prototypes/utils/ImageUtils.lua | 42 +++++------ prototypes/utils/ParticleUtils.lua | 14 ---- prototypes/utils/ProjectileUtils.lua | 2 +- prototypes/utils/StickerUtils.lua | 12 +-- prototypes/utils/StreamUtils.lua | 20 ++--- prototypes/utils/WormUtils.lua | 4 +- settings.lua | 61 +++++++++------- 24 files changed, 189 insertions(+), 238 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index ae88110..de99294 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -1,5 +1,6 @@ globals = { "game", + "util", "data", "remote", "settings", @@ -29,4 +30,6 @@ globals = { "unitGroupUtilsG", "unitUtilsG", "baseUtilsG" -} \ No newline at end of file +} + +max_line_length = false \ No newline at end of file diff --git a/changelog.txt b/changelog.txt index 1d116b0..4ae30c7 100755 --- a/changelog.txt +++ b/changelog.txt @@ -5,7 +5,9 @@ Date: 06. 02. 2021 - AI temperament logic now will calm down after you destroy enough units and/or nests - Rampant now functions on all surfaces - Rampant no longer clears surface information on mod changes + - Added a temperament modifer setting to adjust how quickly the ai will reach extremes in attacking and expansion. Tweaks: + - Increased minimum points the AI can work with to 200 - Reduced spitter range by 2 across all new enemy tiers - Increased spitter projectile collision box by 5x - Decreased movement debuff from spitter acid puddle by roughly 70% @@ -13,7 +15,7 @@ Date: 06. 02. 2021 - Decreased suicide biter damage 90% and radius by roughly 50% - Decreased nuclear biter damage 90% - Decreased default max wave size to 75 units - - Increased evolution requirement for suicide and nuclear biters to 35% and 45% + - Increased evolution requirement for suicide and nuclear biters to 20% and 45% - Decreased squad size ramp up to evolution_factor^1.4 - Increased unit lost temperament contribution to 0.03 - Decreased active spawner temperament contribution to 0.25 @@ -21,15 +23,17 @@ Date: 06. 02. 2021 - Decreased siege ai state chance to 15% at peak temperament - Halved AI temperament rate of change - Increased ai state duration minimum to 10 and maximum to 25 minutes + - Changed default enemy seed to non-zero Bugfixes: - Fixed suicide and nuclear enemies explosion centered on target instead self - - Fixed process spawners reading missing globals + - Fixed process spawners function reading missing globals - Fixed potential desync in squad attack movement - Fixed potential desync in unit group creation event - Fixed potential desync in building native tables - Fixed find entity upgrade incorrectly calculating evolution - Fixed bug with the mod new game+ - Fixed existing spawner upgrading in place over time + - Fixed add wall acid resistance setting would overwrite higher resistance and not effect gates --------------------------------------------------------------------------------------------------- Version: 1.0.2 diff --git a/control.lua b/control.lua index 4810297..9e45e25 100755 --- a/control.lua +++ b/control.lua @@ -201,6 +201,10 @@ local function onModSettingsChange(event) universe.safeEntities["lighted-big-electric-pole"] = newValue end + upgrade.compareTable(universe, + "temperamentRateModifier", + settings.global["rampant--temperamentRateModifier"].value) + upgrade.compareTable(universe, "deadZoneFrequency", settings.global["rampant--deadZoneFrequency"].value) @@ -373,80 +377,10 @@ local function onConfigChanged() if not universe then universe = global.universe end - - upgrade.compareTable(universe, - "safeBuildings", - settings.global["rampant--safeBuildings"].value) - upgrade.compareTable(universe.safeEntities, - "curved-rail", - settings.global["rampant--safeBuildings-curvedRail"].value) - upgrade.compareTable(universe.safeEntities, - "straight-rail", - settings.global["rampant--safeBuildings-straightRail"].value) - upgrade.compareTable(universe.safeEntities, - "rail-signal", - settings.global["rampant--safeBuildings-railSignals"].value) - upgrade.compareTable(universe.safeEntities, - "rail-chain-signal", - settings.global["rampant--safeBuildings-railChainSignals"].value) - upgrade.compareTable(universe.safeEntities, - "train-stop", - settings.global["rampant--safeBuildings-trainStops"].value) - upgrade.compareTable(universe.safeEntities, - "lamp", - settings.global["rampant--safeBuildings-lamps"].value) - - local changed, newValue = upgrade.compareTable(universe.safeEntities, - "big-electric-pole", - settings.global["rampant--safeBuildings-bigElectricPole"].value) - if changed then - universe.safeEntities["big-electric-pole"] = newValue - universe.safeEntities["big-electric-pole-2"] = newValue - universe.safeEntities["big-electric-pole-3"] = newValue - universe.safeEntities["big-electric-pole-4"] = newValue - universe.safeEntities["lighted-big-electric-pole-4"] = newValue - universe.safeEntities["lighted-big-electric-pole-3"] = newValue - universe.safeEntities["lighted-big-electric-pole-2"] = newValue - universe.safeEntities["lighted-big-electric-pole"] = newValue - end - - upgrade.compareTable(universe, - "deadZoneFrequency", - settings.global["rampant--deadZoneFrequency"].value) - upgrade.compareTable(universe, - "raidAIToggle", - settings.global["rampant--raidAIToggle"].value) - upgrade.compareTable(universe, - "siegeAIToggle", - settings.global["rampant--siegeAIToggle"].value) - - upgrade.compareTable(universe, - "attackPlayerThreshold", - settings.global["rampant--attackPlayerThreshold"].value) - upgrade.compareTable(universe, - "attackUsePlayer", - settings.global["rampant--attackWaveGenerationUsePlayerProximity"].value) - - upgrade.compareTable(universe, - "attackWaveMaxSize", - settings.global["rampant--attackWaveMaxSize"].value) - upgrade.compareTable(universe, - "aiNocturnalMode", - settings.global["rampant--permanentNocturnal"].value) - upgrade.compareTable(universe, - "aiPointsScaler", - settings.global["rampant--aiPointsScaler"].value) - - universe.enabledMigration = universe.expansion and settings.global["rampant--enableMigration"].value - - upgrade.compareTable(universe, - "AI_MAX_SQUAD_COUNT", - settings.global["rampant--maxNumberOfSquads"].value) - upgrade.compareTable(universe, - "AI_MAX_BUILDER_COUNT", - settings.global["rampant--maxNumberOfBuilders"].value) end + onModSettingsChange({setting="rampant--"}) + upgrade.compareTable(universe, "ENEMY_SEED", settings.startup["rampant--enemySeed"].value) @@ -772,10 +706,12 @@ local function onUsedCapsule(event) local surface = game.players[event.player_index].surface local map = universe.maps[surface.index] if (event.item.name == "cliff-explosives") then - map.position2Top.x = event.position.x-0.75 - map.position2Top.y = event.position.y-0.75 - map.position2Bottom.x = event.position.x+0.75 - map.position2Bottom.y = event.position.y+0.75 + local position2Top = universe.position2Top + local position2Bottom = universe.position2Bottom + position2Top.x = event.position.x-0.75 + position2Top.y = event.position.y-0.75 + position2Bottom.x = event.position.x+0.75 + position2Bottom.y = event.position.y+0.75 local cliffs = surface.find_entities_filtered(universe.cliffQuery) for i=1,#cliffs do entityForPassScan(map, cliffs[i]) @@ -902,20 +838,19 @@ end local function onGroupFinishedGathering(event) local group = event.group if group.valid and (group.force.name == "enemy") then - local unitNumber = group.group_number local map = universe.maps[group.surface.index] - local squad = map.groupNumberToSquad[unitNumber] + local squad = map.groupNumberToSquad[group.group_number] if squad then if squad.settler then if (universe.builderCount < universe.AI_MAX_BUILDER_COUNT) then - squadDispatch(map, squad, unitNumber) + squadDispatch(map, squad) else group.destroy() map.points = map.points + AI_SETTLER_COST end else if (universe.squadCount < universe.AI_MAX_SQUAD_COUNT) then - squadDispatch(map, squad, unitNumber) + squadDispatch(map, squad) else group.destroy() map.points = map.points + AI_SQUAD_COST @@ -939,7 +874,7 @@ local function onGroupFinishedGathering(event) else universe.squadCount = universe.squadCount + 1 end - squadDispatch(map, squad, unitNumber) + squadDispatch(map, squad) end end end diff --git a/data-updates.lua b/data-updates.lua index 3eaab4b..8d955c3 100755 --- a/data-updates.lua +++ b/data-updates.lua @@ -31,7 +31,7 @@ for _, robot in pairs(data.raw["construction-robot"]) do -- robot.collision_mask[#robot.collision_mask+1] = "layer-13" if (settings.startup["rampant--unkillableConstructionRobots"].value) then - robot.resistances = {} + robot.resistances = {} for damageType, _ in pairs(data.raw["damage-type"]) do robot.resistances[damageType] = { type = damageType, @@ -66,5 +66,3 @@ mapSettings.unit_group.max_group_slowdown_factor = constants.UNIT_GROUP_SLOWDOWN data.raw["utility-constants"]["default"].unit_group_pathfinding_resolution = -5 - - diff --git a/libs/AIPlanning.lua b/libs/AIPlanning.lua index af52a36..7dfcdcc 100755 --- a/libs/AIPlanning.lua +++ b/libs/AIPlanning.lua @@ -21,9 +21,6 @@ local AI_STATE_MIGRATING = constants.AI_STATE_MIGRATING local AI_STATE_ONSLAUGHT = constants.AI_STATE_ONSLAUGHT local AI_STATE_SIEGE = constants.AI_STATE_SIEGE -local AGGRESSIVE_CAN_ATTACK_WAIT_MAX_DURATION = constants.AGGRESSIVE_CAN_ATTACK_WAIT_MAX_DURATION -local AGGRESSIVE_CAN_ATTACK_WAIT_MIN_DURATION = constants.AGGRESSIVE_CAN_ATTACK_WAIT_MIN_DURATION - local AI_UNIT_REFUND = constants.AI_UNIT_REFUND local AI_MAX_POINTS = constants.AI_MAX_POINTS @@ -327,6 +324,7 @@ function aiPlanning.temperamentPlanner(map) delta = delta + val end + delta = delta * map.universe.temperamentRateModifier map.temperamentScore = mMin(10000, mMax(-10000, currentTemperament + delta)) map.temperament = ((map.temperamentScore + 10000) * 0.00005) diff --git a/libs/ChunkUtils.lua b/libs/ChunkUtils.lua index 35f9512..db6abbe 100755 --- a/libs/ChunkUtils.lua +++ b/libs/ChunkUtils.lua @@ -5,7 +5,6 @@ local chunkUtils = {} -- imports -local stringUtils = require("StringUtils") local baseUtils = require("BaseUtils") local constants = require("Constants") local mapUtils = require("MapUtils") @@ -47,7 +46,6 @@ local GENERATOR_PHEROMONE_LEVEL_6 = constants.GENERATOR_PHEROMONE_LEVEL_6 -- imported functions -local isRampant = stringUtils.isRampant local setNestCount = chunkPropertyUtils.setNestCount local setPlayerBaseGenerator = chunkPropertyUtils.setPlayerBaseGenerator local addPlayerBaseGenerator = chunkPropertyUtils.addPlayerBaseGenerator diff --git a/libs/Constants.lua b/libs/Constants.lua index b05a6e2..ec0d3fa 100755 --- a/libs/Constants.lua +++ b/libs/Constants.lua @@ -115,7 +115,7 @@ constants.MAX_TICKS_BEFORE_SORT_CHUNKS = 60 * 60 * 30 -- 1 tick = 1/60 sec * 60 constants.RESOURCE_MINIMUM_FORMATION_DELTA = 15 -constants.MINIMUM_AI_POINTS = 100 +constants.MINIMUM_AI_POINTS = 200 constants.AI_POINT_GENERATOR_AMOUNT = 0.688863 constants.AI_SQUAD_COST = 175 constants.RECOVER_NEST_COST = constants.AI_SQUAD_COST @@ -1227,7 +1227,7 @@ if settings.startup["rampant--suicideEnemy"].value then type = "suicide", tint = {r=0.8, g=0.8, b=0.8, a=1}, tint2 = {r=0.95, g=0.95, b=0, a=1}, - acceptRate = {3, 10, 0.05, 0.15}, + acceptRate = {2, 10, 0.05, 0.15}, evo = 0.35, units = { { diff --git a/libs/SquadAttack.lua b/libs/SquadAttack.lua index 2084f82..4868de4 100755 --- a/libs/SquadAttack.lua +++ b/libs/SquadAttack.lua @@ -348,7 +348,7 @@ function squadAttack.cleanSquads(map) squads[k] = nil k = nextK elseif (group.state == 4) then - squadAttack.squadDispatch(map, squad, squad.groupNumber) + squadAttack.squadDispatch(map, squad) end end map.squadIterator = k diff --git a/locale/en/locale.cfg b/locale/en/locale.cfg index 2a75efa..81ea5b6 100755 --- a/locale/en/locale.cfg +++ b/locale/en/locale.cfg @@ -18705,8 +18705,8 @@ rampant--safeBuildings-bigElectricPole=Safety: Make big electric poles safe from rampant--safeBuildings-railChainSignals=Safety: Make rail chain signals safe from biters rampant--safeBuildings-railSignals=Safety: Make rail signals safe from biters rampant--safeBuildings-trainStops=Safety: Make train stops safe from biters -rampant--permanentNocturnal=Attack Wave: Nocturnal Mode -rampant--aiPointsScaler=Attack Wave: Difficulty Scaling +rampant--permanentNocturnal=AI: Nocturnal Mode +rampant--aiPointsScaler=AI: Difficulty Scaling rampant--addWallResistanceAcid=Safety; Increase wall resistance to spitters rampant--safeBuildings-lamps=Safety: Make lamps safe from biters rampant--removeBloodParticles=Optimization: Remove blood particles (Reduces lag spikes) @@ -18788,6 +18788,7 @@ rampant--disableCollidingProjectiles=Projectiles: Non biter force colliding proj rampant--enableFullMapScan=Compatibility: Enable full map scanning rampant--unitAndSpawnerFadeTime=Biter, Spitter, Worm, Spawners, and Hive Corpse Fade Time rampant--enableFadeTime=Enable corpse fade time +rampant--temperamentRateModifier=AI: Temperament Rate Modifier [mod-setting-description] rampant--unitAndSpawnerFadeTime=The time in seconds for how long biter corpses stay around @@ -18888,6 +18889,7 @@ rampant--enableFadeTime=Enable the fade time to reduce or increase biter, spitte rampant--maxNumberOfBuilders=More builders requires more UPS. rampant--maxNumberOfSquads=More squads requires more UPS. +rampant--temperamentRateModifier=Change how quickly Rampant will hit extremes in the ai temperament stat which control attacking and expanding. This is a percentage increase or decrease with 1 being equal to 100%. [description] rampant-bobs-nee-newEnemies=Bobs enemies or NEE has been detected with Rampants new enemies,\nthe artifacts from each of these mods will still work with Rampants new enemies.\nThe generation of bobs or NEE unit spawners explicitly by Rampant is\nno longer supported when the Rampants new enemies are active. diff --git a/prototypes/Poison.lua b/prototypes/Poison.lua index 9bd4071..58fa118 100755 --- a/prototypes/Poison.lua +++ b/prototypes/Poison.lua @@ -11,7 +11,7 @@ local poison = {} local makeCloud = smokeUtils.makeCloud function poison.addFactionAddon() - + for i=1,10 do makeCloud( { @@ -67,7 +67,7 @@ function poison.addFactionAddon() } ) end - + end return poison diff --git a/prototypes/buildings/UpdatesVanilla.lua b/prototypes/buildings/UpdatesVanilla.lua index 7a113cd..8b2937e 100755 --- a/prototypes/buildings/UpdatesVanilla.lua +++ b/prototypes/buildings/UpdatesVanilla.lua @@ -4,17 +4,36 @@ function vanillaUpdates.addWallAcidResistance() local walls = data.raw["wall"] for _,wall in pairs(walls) do - local foundAcid = false - for _,resistance in pairs(wall.resistances) do - if resistance.type == "acid" then - resistance.percent = 60 - foundAcid = true - break - end - end - if not foundAcid then - wall.resistances[#wall.resistances+1] = {type="acid",percent=60} - end + local foundAcid = false + for _,resistance in pairs(wall.resistances) do + if resistance.type == "acid" then + if resistance.percent < 60 then + resistance.percent = 60 + end + foundAcid = true + break + end + end + if not foundAcid then + wall.resistances[#wall.resistances+1] = {type="acid",percent=60} + end + end + + walls = data.raw["gate"] + for _,wall in pairs(walls) do + local foundAcid = false + for _,resistance in pairs(wall.resistances) do + if resistance.type == "acid" then + if resistance.percent < 60 then + resistance.percent = 60 + end + foundAcid = true + break + end + end + if not foundAcid then + wall.resistances[#wall.resistances+1] = {type="acid",percent=60} + end end end diff --git a/prototypes/utils/AttackBall.lua b/prototypes/utils/AttackBall.lua index 0c0964e..ed4e035 100755 --- a/prototypes/utils/AttackBall.lua +++ b/prototypes/utils/AttackBall.lua @@ -47,7 +47,7 @@ function AttackBall.createAttackBall(attributes) if attributes.attackPointEffects then targetEffects = (attributes.attackPointEffects and attributes.attackPointEffects(attributes)) else - local rec = { + local rec = { { type = "damage", damage = templateDirectDamage @@ -91,7 +91,7 @@ function AttackBall.createAttackBall(attributes) end targetEffects = rec end - + local templateActions = { templateArea, { @@ -104,7 +104,7 @@ function AttackBall.createAttackBall(attributes) } local name - local template + -- local template if (attributes.attackType == "stream") then -- template = { -- name = attributes.name, diff --git a/prototypes/utils/AttackFlame.lua b/prototypes/utils/AttackFlame.lua index a6c58d7..0cc0dd0 100755 --- a/prototypes/utils/AttackFlame.lua +++ b/prototypes/utils/AttackFlame.lua @@ -3,7 +3,6 @@ local attackFlame = {} -- imported local streamUtils = require("StreamUtils") -local colorUtils = require("ColorUtils") local fireUtils = require("FireUtils") local stickerUtils = require("StickerUtils") @@ -13,7 +12,6 @@ local DISALLOW_FRIENDLY_FIRE = settings.startup["rampant--disallowFriendlyFire"] -- imported functions -local makeColor = colorUtils.makeColor local makeStream = streamUtils.makeStream local makeFire = fireUtils.makeFire local makeSticker = stickerUtils.makeSticker @@ -22,7 +20,7 @@ local makeSpreadEffect = fireUtils.makeSpreadEffect -- module code function attackFlame.createAttackFlame(attributes) - + local spawnEntityName = makeSpreadEffect({ name = attributes.name, tint2 = attributes.tint2, @@ -49,7 +47,7 @@ function attackFlame.createAttackFlame(attributes) tint2 = attributes.tint2, fireSpreadRadius = attributes.fireSpreadRadius }) - + return makeStream({ name = attributes.name, tint2 = attributes.tint2 or {r=0, g=1, b=1, a=0.5}, diff --git a/prototypes/utils/BeamUtils.lua b/prototypes/utils/BeamUtils.lua index 1e0bd23..f249467 100755 --- a/prototypes/utils/BeamUtils.lua +++ b/prototypes/utils/BeamUtils.lua @@ -92,8 +92,8 @@ function beamUtils.makeBeam(attributes) } } }, - start = - { + start = + { filename = "__base__/graphics/entity/beam/tileable-beam-START.png", line_length = 4, width = 52, @@ -114,8 +114,8 @@ function beamUtils.makeBeam(attributes) scale = 0.5, } }, - ending = - { + ending = + { filename = "__base__/graphics/entity/beam/tileable-beam-END.png", line_length = 4, width = 49, @@ -124,7 +124,7 @@ function beamUtils.makeBeam(attributes) axially_symmetrical = false, direction_count = 1, shift = {-0.046875, 0}, - hr_version = { + hr_version = { filename = "__base__/graphics/entity/beam/hr-tileable-beam-END.png", line_length = 4, width = 91, @@ -134,7 +134,7 @@ function beamUtils.makeBeam(attributes) direction_count = 1, shift = {-0.078125, -0.046875}, scale = 0.5, - } + } }, head = { diff --git a/prototypes/utils/BiterUtils.lua b/prototypes/utils/BiterUtils.lua index 4ccda65..a2220b0 100755 --- a/prototypes/utils/BiterUtils.lua +++ b/prototypes/utils/BiterUtils.lua @@ -487,7 +487,7 @@ function biterFunctions.makeWorm(attributes) subgroup="enemies", max_health = attributes.health, loot = attributes.loot, - shooting_cursor_size = 3.5 * attributes.scale, + -- shooting_cursor_size = 3.5 * attributes.scale, resistances = resistances, healing_per_tick = attributes.healing or 0.01, collision_box = {{-1.1 * attributes.scale, -1.0 * attributes.scale}, {1.1 * attributes.scale, 1.0 * attributes.scale}}, @@ -1264,7 +1264,6 @@ function biterFunctions.createStreamAttack(attributes, fireAttack, animation) type = "stream", ammo_category = "biological", cooldown = attributes.cooldown, - warmup = attributes.warmup, range = attributes.range, min_range = attributes.minRange, cooldown_deviation = 0.15, diff --git a/prototypes/utils/ColorUtils.lua b/prototypes/utils/ColorUtils.lua index 74a2173..504f584 100755 --- a/prototypes/utils/ColorUtils.lua +++ b/prototypes/utils/ColorUtils.lua @@ -3,7 +3,7 @@ local colorUtils = {} -- module code function colorUtils.makeColor(r_,g_,b_,a_) - return { r = r_ * a_, g = g_ * a_, b = b_ * a_, a = a_ } + return { r = r_ * a_, g = g_ * a_, b = b_ * a_, a = a_ } end return colorUtils diff --git a/prototypes/utils/FireUtils.lua b/prototypes/utils/FireUtils.lua index 183d7ce..38b56ab 100755 --- a/prototypes/utils/FireUtils.lua +++ b/prototypes/utils/FireUtils.lua @@ -25,31 +25,31 @@ function fireUtils.makeSpreadEffect(attributes) flags = {"placeable-off-grid", "not-on-map"}, damage_per_tick = { amount = attributes.fireDamagePerTick or 45/60, type = attributes.fireDamagePerTickType or "fire" }, - + spawn_entity = name, maximum_spread_count = 100, - + spread_delay = 300, spread_delay_deviation = 180, flame_alpha = 0.35, flame_alpha_deviation = 0.05, - + tree_dying_factor = 0.8, emissions_per_second = 0.005, - + fade_in_duration = 120, fade_out_duration = 100, smoke_fade_in_duration = 100, smoke_fade_out_duration = 130, delay_between_initial_flames = 20, - + small_tree_fire_pictures = create_small_tree_flame_animations({ blend_mode = "additive", animation_speed = 0.5, scale = 0.7 * 0.75, tint2 = attributes.tint2 }), - + pictures = create_fire_pictures({ blend_mode = "additive", animation_speed = 1, scale = 0.5 * 1.25, tint2 = attributes.tint2}), - - smoke_source_pictures = + + smoke_source_pictures = { - { + { filename = "__base__/graphics/entity/fire-flame/fire-smoke-source-1.png", line_length = 8, width = 101, @@ -62,7 +62,7 @@ function fireUtils.makeSpreadEffect(attributes) animation_speed = 0.5, tint = makeColor(0,1,0, 0.75), }, - { + { filename = "__base__/graphics/entity/fire-flame/fire-smoke-source-2.png", line_length = 8, width = 99, @@ -76,7 +76,7 @@ function fireUtils.makeSpreadEffect(attributes) tint = makeColor(0,1,0, 0.75), }, }, - + trivial_smoke = { { @@ -90,14 +90,14 @@ function fireUtils.makeSpreadEffect(attributes) height = -0.5, } }, - + light = {intensity = 1, size = 20}, working_sound = { sound = { filename = "__base__/sound/furnace.ogg" }, max_sounds_per_type = 3 - }, + }, }}) return name end @@ -117,22 +117,22 @@ function fireUtils.makeFire(attributes) maximum_damage_multiplier = attributes.damageMaxMultipler or 6, damage_multiplier_increase_per_added_fuel = attributes.mutliplerIncrease or 1, damage_multiplier_decrease_per_tick = attributes.mutliplerDecrease or 0.005, - + spawn_entity = spawnEntityName, - + spread_delay = 300, spread_delay_deviation = 180, maximum_spread_count = 100, - + flame_alpha = 0.35, flame_alpha_deviation = 0.05, - + emissions_per_second = 0.005, - + add_fuel_cooldown = 10, fade_in_duration = 30, fade_out_duration = 30, - + initial_lifetime = 120, lifetime_increase_by = 150, lifetime_increase_cooldown = 1, @@ -140,7 +140,7 @@ function fireUtils.makeFire(attributes) delay_between_initial_flames = 10, --initial_flame_count = 1, burnt_patch_lifetime = 1800, - + on_fuel_added_action = { type = "direct", @@ -161,12 +161,12 @@ function fireUtils.makeFire(attributes) } } }, - + pictures = create_fire_pictures({ blend_mode = "normal", animation_speed = 1, scale = 0.5, tint2 = attributes.tint2}), - - smoke_source_pictures = + + smoke_source_pictures = { - { + { filename = "__base__/graphics/entity/fire-flame/fire-smoke-source-1.png", line_length = 8, width = 101, @@ -177,7 +177,7 @@ function fireUtils.makeFire(attributes) shift = {-0.109375, -1.1875}, animation_speed = 0.5, }, - { + { filename = "__base__/graphics/entity/fire-flame/fire-smoke-source-2.png", line_length = 8, width = 99, @@ -189,7 +189,7 @@ function fireUtils.makeFire(attributes) animation_speed = 0.5, }, }, - + burnt_patch_pictures = create_burnt_patch_pictures(attributes), burnt_patch_alpha_default = 0.4, burnt_patch_alpha_variations = { @@ -218,15 +218,15 @@ function fireUtils.makeFire(attributes) height = -0.5, } }, - + light = {intensity = 1, size = 20}, - + working_sound = { sound = { filename = "__base__/sound/furnace.ogg" }, max_sounds_per_type = 3 - }, - + }, + } } ) @@ -236,7 +236,7 @@ end function fireUtils.makeAcidSplashFire(attributes, stickerName) local name = attributes.name .. "-acid-fire-rampant" - + local acidFire = { type = "fire", name = name, @@ -284,8 +284,8 @@ function fireUtils.makeAcidSplashFire(attributes, stickerName) { sound = { filename = "__base__/sound/furnace.ogg" }, max_sounds_per_type = 3 - }, - + }, + on_damage_tick_effect = { type = "area", diff --git a/prototypes/utils/ImageUtils.lua b/prototypes/utils/ImageUtils.lua index d6695fc..9a28846 100755 --- a/prototypes/utils/ImageUtils.lua +++ b/prototypes/utils/ImageUtils.lua @@ -19,13 +19,13 @@ function imageUtils.create_burnt_patch_pictures(attributes) direction_count = 1, shift = {-0.09375, 0.125}, } - + local variations = {} - + for y=1,(base.frame_count / base.line_length) do for x=1,base.line_length do - table.insert(variations, - { + table.insert(variations, + { filename = base.filename, width = base.width, height = base.height, @@ -93,7 +93,7 @@ function imageUtils.create_small_tree_flame_animations(opts) tint = fire_tint, flags = fire_flags }, - { + { filename = "__base__/graphics/entity/fire-flame/tree-fire-flame-03-a.png", line_length = 8, width = 38, @@ -108,7 +108,7 @@ function imageUtils.create_small_tree_flame_animations(opts) tint = fire_tint, flags = fire_flags }, - { + { filename = "__base__/graphics/entity/fire-flame/tree-fire-flame-03-b.png", line_length = 8, width = 34, @@ -123,7 +123,7 @@ function imageUtils.create_small_tree_flame_animations(opts) tint = fire_tint, flags = fire_flags }, - { + { filename = "__base__/graphics/entity/fire-flame/tree-fire-flame-03-c.png", line_length = 8, width = 39, @@ -139,7 +139,7 @@ function imageUtils.create_small_tree_flame_animations(opts) flags = fire_flags } } - + return foreach(retval, function(tab) if tab.shift and tab.scale then tab.shift = { tab.shift[1] * tab.scale, tab.shift[2] * tab.scale } end end) @@ -152,7 +152,7 @@ function imageUtils.create_fire_pictures(opts) local fire_tint = opts.tint2 local fire_flags = { "compressed" } local retval = { - { + { filename = "__base__/graphics/entity/fire-flame/fire-flame-13.png", line_length = 8, width = 60, @@ -167,7 +167,7 @@ function imageUtils.create_fire_pictures(opts) flags = fire_flags, shift = { -0.0390625, -0.90625 } }, - { + { filename = "__base__/graphics/entity/fire-flame/fire-flame-12.png", line_length = 8, width = 63, @@ -182,7 +182,7 @@ function imageUtils.create_fire_pictures(opts) flags = fire_flags, shift = { -0.015625, -0.914065 } }, - { + { filename = "__base__/graphics/entity/fire-flame/fire-flame-11.png", line_length = 8, width = 61, @@ -197,7 +197,7 @@ function imageUtils.create_fire_pictures(opts) flags = fire_flags, shift = { -0.0078125, -0.90625 } }, - { + { filename = "__base__/graphics/entity/fire-flame/fire-flame-10.png", line_length = 8, width = 65, @@ -212,7 +212,7 @@ function imageUtils.create_fire_pictures(opts) flags = fire_flags, shift = { -0.0625, -0.64844 } }, - { + { filename = "__base__/graphics/entity/fire-flame/fire-flame-09.png", line_length = 8, width = 64, @@ -227,7 +227,7 @@ function imageUtils.create_fire_pictures(opts) flags = fire_flags, shift = { -0.03125, -0.695315 } }, - { + { filename = "__base__/graphics/entity/fire-flame/fire-flame-08.png", line_length = 8, width = 50, @@ -242,7 +242,7 @@ function imageUtils.create_fire_pictures(opts) flags = fire_flags, shift = { -0.0546875, -0.77344 } }, - { + { filename = "__base__/graphics/entity/fire-flame/fire-flame-07.png", line_length = 8, width = 54, @@ -257,7 +257,7 @@ function imageUtils.create_fire_pictures(opts) flags = fire_flags, shift = { 0.015625, -0.640625 } }, - { + { filename = "__base__/graphics/entity/fire-flame/fire-flame-06.png", line_length = 8, width = 65, @@ -272,7 +272,7 @@ function imageUtils.create_fire_pictures(opts) flags = fire_flags, shift = { 0, -0.83594 } }, - { + { filename = "__base__/graphics/entity/fire-flame/fire-flame-05.png", line_length = 8, width = 59, @@ -287,7 +287,7 @@ function imageUtils.create_fire_pictures(opts) flags = fire_flags, shift = { 0.03125, -0.882815 } }, - { + { filename = "__base__/graphics/entity/fire-flame/fire-flame-04.png", line_length = 8, width = 67, @@ -302,7 +302,7 @@ function imageUtils.create_fire_pictures(opts) flags = fire_flags, shift = { 0.015625, -1.109375 } }, - { + { filename = "__base__/graphics/entity/fire-flame/fire-flame-03.png", line_length = 8, width = 74, @@ -317,7 +317,7 @@ function imageUtils.create_fire_pictures(opts) flags = fire_flags, shift = { 0.046875, -0.984375 } }, - { + { filename = "__base__/graphics/entity/fire-flame/fire-flame-02.png", line_length = 8, width = 74, @@ -332,7 +332,7 @@ function imageUtils.create_fire_pictures(opts) flags = fire_flags, shift = { 0.0078125, -0.96875 } }, - { + { filename = "__base__/graphics/entity/fire-flame/fire-flame-01.png", line_length = 8, width = 66, diff --git a/prototypes/utils/ParticleUtils.lua b/prototypes/utils/ParticleUtils.lua index 2ac7467..8e693dd 100755 --- a/prototypes/utils/ParticleUtils.lua +++ b/prototypes/utils/ParticleUtils.lua @@ -97,7 +97,6 @@ local function makeBloodParticle(attributes) hr_version = { filename = "__base__/graphics/particle/blood-particle/hr-blood-particle-02.png", - line_length = 6, width = 8, height = 6, line_length = 6, @@ -120,7 +119,6 @@ local function makeBloodParticle(attributes) hr_version = { filename = "__base__/graphics/particle/blood-particle/hr-blood-particle-03.png", - line_length = 6, width = 6, height = 6, line_length = 6, @@ -143,7 +141,6 @@ local function makeBloodParticle(attributes) hr_version = { filename = "__base__/graphics/particle/blood-particle/hr-blood-particle-04.png", - line_length = 6, width = 6, height = 6, line_length = 6, @@ -166,7 +163,6 @@ local function makeBloodParticle(attributes) hr_version = { filename = "__base__/graphics/particle/blood-particle/hr-blood-particle-05.png", - line_length = 6, width = 6, height = 4, line_length = 6, @@ -189,7 +185,6 @@ local function makeBloodParticle(attributes) hr_version = { filename = "__base__/graphics/particle/blood-particle/hr-blood-particle-06.png", - line_length = 6, width = 6, height = 6, line_length = 6, @@ -212,7 +207,6 @@ local function makeBloodParticle(attributes) hr_version = { filename = "__base__/graphics/particle/blood-particle/hr-blood-particle-07.png", - line_length = 6, width = 6, height = 6, line_length = 6, @@ -235,7 +229,6 @@ local function makeBloodParticle(attributes) hr_version = { filename = "__base__/graphics/particle/blood-particle/hr-blood-particle-08.png", - line_length = 6, width = 10, height = 8, line_length = 6, @@ -324,7 +317,6 @@ local function makeBloodParticle(attributes) hr_version = { filename = "__base__/graphics/particle/blood-particle/hr-blood-particle-12.png", - line_length = 6, width = 8, height = 8, line_length = 6, @@ -372,7 +364,6 @@ local function makeBloodParticle(attributes) hr_version = { filename = "__base__/graphics/particle/blood-particle/hr-blood-particle-02.png", - line_length = 6, width = 8, height = 6, line_length = 6, @@ -395,7 +386,6 @@ local function makeBloodParticle(attributes) hr_version = { filename = "__base__/graphics/particle/blood-particle/hr-blood-particle-03.png", - line_length = 6, width = 6, height = 6, line_length = 6, @@ -418,7 +408,6 @@ local function makeBloodParticle(attributes) hr_version = { filename = "__base__/graphics/particle/blood-particle/hr-blood-particle-04.png", - line_length = 6, width = 6, height = 6, line_length = 6, @@ -441,7 +430,6 @@ local function makeBloodParticle(attributes) hr_version = { filename = "__base__/graphics/particle/blood-particle/hr-blood-particle-05.png", - line_length = 6, width = 6, height = 4, line_length = 6, @@ -508,7 +496,6 @@ local function makeBloodParticle(attributes) hr_version = { filename = "__base__/graphics/particle/blood-particle/hr-blood-particle-08.png", - line_length = 6, width = 10, height = 8, line_length = 6, @@ -597,7 +584,6 @@ local function makeBloodParticle(attributes) hr_version = { filename = "__base__/graphics/particle/blood-particle/hr-blood-particle-12.png", - line_length = 6, width = 8, height = 8, line_length = 6, diff --git a/prototypes/utils/ProjectileUtils.lua b/prototypes/utils/ProjectileUtils.lua index 479e368..8efa25b 100755 --- a/prototypes/utils/ProjectileUtils.lua +++ b/prototypes/utils/ProjectileUtils.lua @@ -2,7 +2,7 @@ local projectileUtils = {} function projectileUtils.makeProjectile(attributes, attack) local n = attributes.name .. "-projectile-rampant" - + data:extend({{ type = "projectile", name = n, diff --git a/prototypes/utils/StickerUtils.lua b/prototypes/utils/StickerUtils.lua index e1ab8ad..4d6649b 100755 --- a/prototypes/utils/StickerUtils.lua +++ b/prototypes/utils/StickerUtils.lua @@ -14,9 +14,9 @@ function stickerUtils.makeSticker(attributes) type = "sticker", name = name, flags = {"not-on-map"}, - + animation = attributes.stickerAnimation or - { + { filename = "__base__/graphics/entity/fire-flame/fire-flame-13.png", line_length = 8, width = 60, @@ -30,7 +30,7 @@ function stickerUtils.makeSticker(attributes) tint = attributes.tint2 or { r = 1, g = 1, b = 1, a = 0.35 }, shift = math3d.vector2.mul({-0.078125, -1.8125}, 0.1), }, - + duration_in_ticks = attributes.stickerDuration or (30 * 60), target_movement_modifier_from = attributes.stickerMovementModifier or 1, target_movement_modifier_to = 1, @@ -40,14 +40,14 @@ function stickerUtils.makeSticker(attributes) -- vehicle_friction_modifier_from = 1.5, -- vehicle_friction_modifier_from = 1, -- vehicle_friction_modifier_to = 1, - + damage_per_tick = attributes.stickerDamagePerTick and { amount = attributes.stickerDamagePerTick or 100 / 60, type = attributes.stickerDamagePerTickType or "fire" }, - spread_fire_entity = attributes.spawnEntityName, + spread_fire_entity = attributes.spawnEntityName, fire_spread_cooldown = attributes.fireSpreadCooldown, fire_spread_radius = attributes.fireSpreadRadius } - + data:extend({o}) return name end diff --git a/prototypes/utils/StreamUtils.lua b/prototypes/utils/StreamUtils.lua index 3d8b783..22c62aa 100755 --- a/prototypes/utils/StreamUtils.lua +++ b/prototypes/utils/StreamUtils.lua @@ -13,7 +13,7 @@ function streamUtils.makeStream(attributes) flags = {"not-on-map"}, stream_light = {intensity = 1, size = 4}, ground_light = {intensity = 0.8, size = 4}, - + smoke_sources = { { @@ -35,10 +35,10 @@ function streamUtils.makeStream(attributes) particle_loop_frame_count = 3, particle_fade_out_threshold = 0.9, particle_loop_exit_threshold = 0.25, - action = attributes.actions, - - spine_animation = - { + action = attributes.actions, + + spine_animation = + { filename = "__base__/graphics/entity/flamethrower-fire-stream/flamethrower-fire-stream-spine.png", blend_mode = "additive", tint = attributes.tint2, @@ -51,7 +51,7 @@ function streamUtils.makeStream(attributes) animation_speed = 2, shift = {0, 0}, }, - + shadow = { filename = "__Rampant__/graphics/acid-projectile-purple/acid-projectile-purple-shadow.png", @@ -62,7 +62,7 @@ function streamUtils.makeStream(attributes) priority = "high", shift = {-0.09, 0.395} }, - + particle = { filename = "__base__/graphics/entity/flamethrower-fire-stream/flamethrower-explosion.png", @@ -75,8 +75,8 @@ function streamUtils.makeStream(attributes) }, oriented_particle = true, shadow_scale_enabled = true - } - } + } + } ) return name end @@ -96,7 +96,7 @@ function streamUtils.makeAcidStream(info) particle_spawn_timeout = attributes.particleTimeout or 6, particle_vertical_acceleration = attributes.particleVerticalAcceleration or 0.01, particle_horizontal_speed = attributes.particleHoizontalSpeed or 0.6, - particle_horizontal_speed_deviation = attributes.particleHoizontalSpeedDeviation or 0.0025, + particle_horizontal_speed_deviation = attributes.particleHoizontalSpeedDeviation or 0.0025, particle_spawn_interval = 1, -- particle_spawn_timeout = attributes.particle_spawn_timeout, -- particle_vertical_acceleration = 0.005 * 0.60 *1.5, --x diff --git a/prototypes/utils/WormUtils.lua b/prototypes/utils/WormUtils.lua index 8010883..c35bc29 100755 --- a/prototypes/utils/WormUtils.lua +++ b/prototypes/utils/WormUtils.lua @@ -198,7 +198,7 @@ function wormUtils.wormPreparedAnimation(scale, tint, tint2) frame_count = 9, scale = 0.5 * scale, direction_count = 1, - tint = tint, + tint = tint, shift = util.mul_shift(util.by_pixel(-3, -41), scale), } }, @@ -860,7 +860,7 @@ function wormUtils.wormDieAnimation(scale, tint, tint2) frame_count = 24, shift = util.mul_shift(util.by_pixel(16, -48), scale), direction_count = 1, - tint = tint, + tint = tint, scale = 0.5 * scale, } }, diff --git a/settings.lua b/settings.lua index bd124eb..ff8708a 100755 --- a/settings.lua +++ b/settings.lua @@ -90,16 +90,6 @@ data:extend({ per_user = false }, - { - type = "bool-setting", - name = "rampant--permanentNocturnal", - description = "rampant--permanentNocturnal", - setting_type = "runtime-global", - default_value = false, - order = "b[modifier]-g[ai]", - per_user = false - }, - -- { -- type = "bool-setting", -- name = "rampant--liteMode", @@ -109,18 +99,6 @@ data:extend({ -- per_user = false -- }, - { - type = "double-setting", - name = "rampant--aiPointsScaler", - description = "rampant--aiPointsScaler", - setting_type = "runtime-global", - default_value = 1.0, - minimum_value = 0.0, - maximum_value = 100.0, - order = "b[modifier]-h[ai]", - per_user = false - }, - { type = "bool-setting", name = "rampant--enableSwarm", @@ -260,8 +238,8 @@ data:extend({ name = "rampant--enemySeed", description = "rampant--enemySeed", setting_type = "startup", - minimum_value = 0, - default_value = 0, + minimum_value = 1, + default_value = 1024567, order = "l[modifer]-b[unit]", per_user = false }, @@ -451,7 +429,7 @@ data:extend({ description = "rampant--enableMigration", setting_type = 'runtime-global', default_value = true, - order = "m[total]-b[ai]", + order = "m[total]-c[ai]", per_user = false }, @@ -473,6 +451,39 @@ data:extend({ per_user = false }, + { + type = "bool-setting", + name = "rampant--permanentNocturnal", + description = "rampant--permanentNocturnal", + setting_type = "runtime-global", + default_value = false, + order = "m[total]-a[ai]", + per_user = false + }, + + { + type = "double-setting", + name = "rampant--aiPointsScaler", + description = "rampant--aiPointsScaler", + setting_type = "runtime-global", + default_value = 1.0, + minimum_value = 0.0, + maximum_value = 100.0, + order = "m[total]-b[ai]", + per_user = false + }, + + { + type = "double-setting", + name = "rampant--temperamentRateModifier", + setting_type = "runtime-global", + default_value = 1, + minimum_value = 0.001, + maximum_value = 100.0, + order = "m[total]-b[ai]", + per_user = false + }, + { type = "bool-setting", name = "rampant--removeBloodParticles",