diff --git a/changelog.txt b/changelog.txt index d7e0180..29c7af3 100755 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,16 @@ +--------------------------------------------------------------------------------------------------- +Version: 0.18.2 +Date: 1. 2. 2019 + Contributions: + - RuZZone - Updated to 18.2 fixing engine breaking changes + Improvements: + - Added blood effects on damaged for new enemies + - Added water reflections for new biters and spitters + Bugfixes: + - Fixed blood fountains not finding updated particles + - removed water effect from blood particles + - Reduced pollution to attack for vanilla AI on Rampant New Enemies + --------------------------------------------------------------------------------------------------- Version: 0.17.32 Date: 24. 12. 2019 diff --git a/info.json b/info.json index 834a0ae..525f652 100755 --- a/info.json +++ b/info.json @@ -1,10 +1,10 @@ { "name" : "Rampant", "factorio_version" : "0.18", - "version" : "0.18.1", + "version" : "0.18.2", "title" : "Rampant", "author" : "Veden", "homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445", "description" : "Improves the enemies tactics by using potential fields/pheromones allowing probing of defenses, retreats, reinforcements, counterattacking, breaching, raids, rallying death cry, and player hunting. Uses blockable biter projectiles. Adds new Enemies (disabled by default). Can completely replace the vanilla AI. Difficulty setting in mod options menu.", - "dependencies" : ["base >= 0.18.1", "? bobenemies", "? Natural_Evolution_Enemies >= 0.17.0", "? Clockwork", "? Orbital Ion Cannon", "? RampantArsenal", "? ArmouredBiters"] + "dependencies" : ["base >= 0.18.3", "? bobenemies", "? Natural_Evolution_Enemies >= 0.17.0", "? Clockwork", "? Orbital Ion Cannon", "? RampantArsenal", "? ArmouredBiters"] } diff --git a/make.rkt b/make.rkt index 94e33aa..ca7f9f9 100755 --- a/make.rkt +++ b/make.rkt @@ -84,6 +84,9 @@ (copyDirectory "prototypes" modFolder))) (define (copy) + (set! configuration (call-with-input-file "info.json" + (lambda (port) + (string->jsexpr (port->string port))))) (set! packageName (string-append (string-replace (hash-ref configuration 'name) " " "_") "_" (hash-ref configuration 'version))) @@ -91,6 +94,9 @@ (copyFiles modFolder)) (define (zipIt) + (set! configuration (call-with-input-file "info.json" + (lambda (port) + (string->jsexpr (port->string port))))) (set! packageName (string-append (string-replace (hash-ref configuration 'name) " " "_") "_" (hash-ref configuration 'version))) @@ -98,6 +104,9 @@ (makeZip modFolder)) (define (runStart) + (set! configuration (call-with-input-file "info.json" + (lambda (port) + (string->jsexpr (port->string port))))) (set! packageName (string-append (string-replace (hash-ref configuration 'name) " " "_") "_" (hash-ref configuration 'version))) diff --git a/prototypes/SwarmUtils.lua b/prototypes/SwarmUtils.lua index baa3518..b96a92f 100755 --- a/prototypes/SwarmUtils.lua +++ b/prototypes/SwarmUtils.lua @@ -166,7 +166,7 @@ local biterAttributeNumeric = { ["distancePerFrame"] = { 0.08, 0.10, 0.125, 0.15, 0.18, 0.195, 0.2, 0.2, 0.2, 0.2 }, ["movement"] = { 0.2, 0.19, 0.185, 0.18, 0.175, 0.17, 0.17, 0.17, 0.17, 0.17 }, ["health"] = { 15, 75, 150, 250, 1000, 2000, 3500, 7500, 15000, 30000 }, - ["pollutionToAttack"] = { 200, 750, 1200, 1750, 2500, 5000, 10000, 12500, 15000, 20000 }, + ["pollutionToAttack"] = { 10, 40, 80, 120, 200, 300, 450, 550, 650, 750 }, ["spawningTimeModifer"] = { 1, 1, 1, 2, 3, 7, 10, 10, 12, 12 } } @@ -196,7 +196,7 @@ local spitterAttributeNumeric = { ["distancePerFrame"] = { 0.04, 0.045, 0.050, 0.055, 0.060, 0.065, 0.067, 0.069, 0.071, 0.073 }, ["movement"] = { 0.185, 0.18, 0.18, 0.17, 0.17, 0.16, 0.16, 0.15, 0.15, 0.14 }, ["health"] = { 10, 50, 200, 350, 1250, 2250, 3250, 6500, 12500, 25000 }, - ["pollutionToAttack"] = { 200, 750, 1200, 1750, 2500, 5000, 10000, 12500, 15000, 20000 }, + ["pollutionToAttack"] = { 10, 40, 80, 120, 200, 300, 450, 550, 650, 750 }, ["spawningTimeModifer"] = { 1, 1, 1, 2, 2, 5, 8, 8, 10, 10 }, } @@ -508,7 +508,8 @@ local function fillEntityTemplate(entity) if (entity.type == "drone") then ti = 1 end - entity[key] = entity[key] .. "-" .. bloodFountains[ti] + entity["hitSprayName"] = entity[key] .. "-" .. "damaged-fountain-rampant" + entity[key] = entity[key] .. "-" .. bloodFountains[ti] elseif (key == "evolutionFunction") then entity["evolutionRequirement"] = distort(xorRandom, value(tier)) elseif (key == "majorResistances") then diff --git a/prototypes/buildings/ChunkScanner.lua b/prototypes/buildings/ChunkScanner.lua index 3fd03b1..0a982c6 100755 --- a/prototypes/buildings/ChunkScanner.lua +++ b/prototypes/buildings/ChunkScanner.lua @@ -8,6 +8,7 @@ data:extend({ movement=1, effectiveLevel=1, resistances = {}, + hitSprayName = "blood-fountain-hit-spray", attack = biterFunctions.createMeleeAttack({ radius=1, damage=1, @@ -22,6 +23,7 @@ data:extend({ movement=1, effectiveLevel=1, resistances = {}, + hitSprayName = "blood-fountain-hit-spray", attack = biterFunctions.createMeleeAttack({ radius=1, damage=1, diff --git a/prototypes/utils/BiterUtils.lua b/prototypes/utils/BiterUtils.lua index 4aaf086..6549df0 100755 --- a/prototypes/utils/BiterUtils.lua +++ b/prototypes/utils/BiterUtils.lua @@ -1,12 +1,11 @@ -local sounds = require("__base__.prototypes.entity.demo-sounds") local biterFunctions = {} +local sounds = require("__base__.prototypes.entity.demo-sounds") +local particleUtils = require("ParticleUtils") local unitSpawnerUtils = require("UnitSpawnerUtils") local unitUtils = require("UnitUtils") local wormUtils = require("WormUtils") --- local FORCE_OLD_PROJECTILES = settings.startup["rampant-forceOldProjectiles"].value - local biterdieanimation = unitUtils.biterdieanimation local biterattackanimation = unitUtils.biterattackanimation local biterrunanimation = unitUtils.biterrunanimation @@ -21,7 +20,9 @@ local wormPreparedAlternativeAnimation = wormUtils.wormPreparedAlternativeAnimat local wormStartAttackAnimation = wormUtils.wormStartAttackAnimation local wormEndAttackAnimation = wormUtils.wormEndAttackAnimation local wormDieAnimation = wormUtils.wormDieAnimation - +local makeDamagedParticle = particleUtils.makeDamagedParticle +local biter_water_reflection = unitUtils.biter_water_reflection +local spitter_water_reflection = unitUtils.spitter_water_reflection local function makeSpitterCorpse(attributes) local name = attributes.name .. "-corpse-rampant" @@ -228,6 +229,8 @@ function biterFunctions.makeBiter(attributes) order = "b-b-a", subgroup="enemies", healing_per_tick = attributes.healing, + damaged_trigger_effect = ((not settings.startup["rampant-removeBloodParticles"].value) and makeDamagedParticle(attributes)) or nil, + water_reflection = biter_water_reflection(attributes.scale), resistances = resistances, collision_box = { {-0.4 * attributes.scale, -0.4 * attributes.scale}, @@ -256,6 +259,7 @@ function biterFunctions.makeBiter(attributes) affected_by_tiles = true, dying_sound = sounds.biter_dying(0.3 + (0.05 * attributes.effectiveLevel)), working_sound = sounds.biter_calls(0.2 + (0.05 * attributes.effectiveLevel)), + running_sound_animation_positions = {2,}, run_animation = biterrunanimation(attributes.scale, attributes.tint, attributes.tint2 or attributes.tint, attributes.altBiter), ai_settings = { destroy_when_commands_fail = false, allow_try_return_to_spawner = true, path_resolution_modifier = -5, do_seperation = true } } @@ -293,7 +297,7 @@ function biterFunctions.makeSpitter(attributes) loot = attributes.loot, vision_distance = attributes.vision or 30, movement_speed = attributes.movement, - spawning_time_modifier = attributes.spawningTimeModifer or nil, + spawning_time_modifier = attributes.spawningTimeModifer or nil, distance_per_frame = attributes.distancePerFrame or 0.1, pollution_to_join_attack = attributes.pollutionToAttack or 200, distraction_cooldown = attributes.distractionCooldown or 300, @@ -304,6 +308,9 @@ function biterFunctions.makeSpitter(attributes) dying_trigger_effect = attributes.dyingEffect, dying_sound = sounds.spitter_dying(0.3 + (0.05 * attributes.effectiveLevel)), working_sound = sounds.biter_calls(0.2 + (0.05 * attributes.effectiveLevel)), + running_sound_animation_positions = {2,}, + water_reflection = spitter_water_reflection(attributes.scale), + damaged_trigger_effect = ((not settings.startup["rampant-removeBloodParticles"].value) and makeDamagedParticle(attributes)) or nil, affected_by_tiles = true, run_animation = spitterrunanimation(attributes.scale, attributes.tint, attributes.tint2 or attributes.tint), ai_settings = { destroy_when_commands_fail = false, allow_try_return_to_spawner = true, path_resolution_modifier = -5, do_seperation = true } @@ -333,16 +340,16 @@ function biterFunctions.makeUnitSpawner(attributes) loot = attributes.loot, resistances = resistances, working_sound = - { - sound = - { + { + sound = { - filename = "__base__/sound/creatures/spawner.ogg", - volume = 0.2 + (0.05 * attributes.effectiveLevel) - } - }, - apparent_volume = 0.4 + (0.1 * attributes.effectiveLevel) - }, + { + filename = "__base__/sound/creatures/spawner.ogg", + volume = 0.2 + (0.05 * attributes.effectiveLevel) + } + }, + apparent_volume = 0.4 + (0.1 * attributes.effectiveLevel) + }, dying_sound = { { @@ -354,6 +361,7 @@ function biterFunctions.makeUnitSpawner(attributes) volume = 0.4 + (0.05 * attributes.effectiveLevel) } }, + damaged_trigger_effect = ((not settings.startup["rampant-removeBloodParticles"].value) and makeDamagedParticle(attributes)) or nil, healing_per_tick = attributes.healing or 0.02, collision_box = {{-3.0 * attributes.scale, -2.0 * attributes.scale}, {2.0 * attributes.scale, 2.0 * attributes.scale}}, selection_box = {{-3.5 * attributes.scale, -2.5 * attributes.scale}, {2.5 * attributes.scale, 2.5 * attributes.scale}}, @@ -439,6 +447,8 @@ function biterFunctions.makeWorm(attributes) prepared_alternative_animation = wormPreparedAlternativeAnimation(attributes.scale, attributes.tint, attributes.tint2 or attributes.tint), prepared_alternative_sound = sounds.worm_roar_alternative(0.2 + (0.05 * attributes.effectiveLevel)), + damaged_trigger_effect = ((not settings.startup["rampant-removeBloodParticles"].value) and makeDamagedParticle(attributes)) or nil, + starting_attack_speed = 0.034, starting_attack_animation = wormStartAttackAnimation(attributes.scale, attributes.tint, attributes.tint2 or attributes.tint), starting_attack_sound = sounds.worm_roars(0.2 + (0.05 * attributes.effectiveLevel)), diff --git a/prototypes/utils/ParticleUtils.lua b/prototypes/utils/ParticleUtils.lua index 3407f53..c0a8a0b 100755 --- a/prototypes/utils/ParticleUtils.lua +++ b/prototypes/utils/ParticleUtils.lua @@ -2,6 +2,50 @@ local particleUtils = {} -- module code +function particleUtils.makeDamagedParticle(attributes) + local name = attributes.name .. "-damaged-particle-rampant" + + data:extend({ + { + type = "explosion", + name = name, + flags = {"not-on-map"}, + subgroup = "hit-effects", + icon = "__core__/graphics/icons/mip/trash.png", + height = 0.3, + icon_size = 32, + animations = + { + util.empty_sprite() + }, + created_effect = + { + type = "direct", + action_delivery = + { + type = "instant", + target_effects = + { + { + type = "create-entity", + entity_name = attributes.hitSprayName, + repeat_count = 1, + } + } + } + } + } + }) + + return { + type = "create-entity", + entity_name = name, + offset_deviation = {{-0.5, -0.5}, {0.5, 0.5}}, + offsets = {{0,0}} + } +end + + local function makeBloodParticle(attributes) local name = attributes.name .. "-blood-particle-rampant" local tint = attributes.tint2 @@ -11,6 +55,8 @@ local function makeBloodParticle(attributes) type = "optimized-particle", name = name, flags = {"not-on-map"}, + render_layer = "higher-object-under", + render_layer_when_on_ground = "corpse", movement_modifier_when_on_ground = 0.2, life_time = 240, pictures = @@ -562,10 +608,11 @@ local function makeBloodParticle(attributes) } }, ended_in_water_trigger_effect = - { - type = "create-entity", - entity_name = "water-splash" - } + -- { + -- type = "create-entity", + -- entity_name = "water-splash" + -- } + nil } }) @@ -581,18 +628,33 @@ function particleUtils.makeBloodFountains(attributes) data:extend({ { type = "particle-source", - name = attributes.name .. "-blood-fountain-rampant", + name = attributes.name .. "-damaged-fountain-rampant", particle = bloodParticle, time_to_live = 10, time_to_live_deviation = 5, time_before_start = 0, time_before_start_deviation = 3, - height = 0.4, + height = 0.3, + height_deviation = 0.1, + vertical_speed = 0.02, + vertical_speed_deviation = 0.08, + horizontal_speed = 0.07, + horizontal_speed_deviation = 0.04 + }, + { + type = "particle-source", + name = attributes.name .. "-blood-fountain-rampant", + particle = bloodParticle, + time_to_live = 15, + time_to_live_deviation = 5, + time_before_start = 0, + time_before_start_deviation = 3, + height = 0.5, height_deviation = 0.1, vertical_speed = 0.05, - vertical_speed_deviation = 0.03, - horizontal_speed = 0.025, - horizontal_speed_deviation = 0.025 + vertical_speed_deviation = 0.08, + horizontal_speed = 0.05, + horizontal_speed_deviation = 0.04 }, { type = "particle-source", @@ -601,12 +663,12 @@ function particleUtils.makeBloodFountains(attributes) time_to_live = 30, time_to_live_deviation = 5, time_before_start = 0, - time_before_start_deviation = 10, - height = 0.4, + time_before_start_deviation = 5, + height = 1, height_deviation = 0.1, - vertical_speed = 0.15, - vertical_speed_deviation = 0.05, - horizontal_speed = 0.04, + vertical_speed = 0.05, + vertical_speed_deviation = 0.08, + horizontal_speed = 0.05, horizontal_speed_deviation = 0.04 }, { @@ -664,7 +726,7 @@ function particleUtils.makeBloodFountains(attributes) { type = "create-particle", repeat_count = 150, - entity_name = bloodParticle, + particle_name = bloodParticle, initial_height = 0.5, speed_from_center = 0.08, speed_from_center_deviation = 0.05, @@ -708,7 +770,7 @@ function particleUtils.makeBloodFountains(attributes) { type = "create-particle", repeat_count = 150, - entity_name = bloodParticle, + particle_name = bloodParticle, initial_height = 0.5, speed_from_center = 0.08, speed_from_center_deviation = 0.05, @@ -727,7 +789,6 @@ function particleUtils.makeBloodFountains(attributes) } } }) - end return particleUtils diff --git a/prototypes/utils/UnitUtils.lua b/prototypes/utils/UnitUtils.lua index e949323..32e0bf8 100755 --- a/prototypes/utils/UnitUtils.lua +++ b/prototypes/utils/UnitUtils.lua @@ -1,5 +1,42 @@ local unitUtils = {} +function unitUtils.spitter_water_reflection(scale) + return + { + pictures = + { + filename = "__base__/graphics/entity/spitter/spitter-reflection.png", + priority = "extra-high", + width = 20, + height = 32, + shift = util.by_pixel(5, 15), + scale = 5 * scale, + variation_count = 1, + }, + rotate = true, + orientation_to_variation = false + } +end + +function unitUtils.biter_water_reflection(scale) + return + { + pictures = + { + filename = "__base__/graphics/entity/biter/biter-reflection.png", + priority = "extra-high", + width = 20, + height = 28, + shift = util.by_pixel(5, 15), + scale = 5 * scale, + variation_count = 1, + }, + rotate = true, + orientation_to_variation = false + } +end + + function unitUtils.spitter_alternative_attacking_animation_sequence() return { warmup_frame_sequence = { 1, 2, 3, 4, 5, 6 },