From 46af0626679c1cb324374395b89d13627fc06728 Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Tue, 6 Feb 2018 00:01:20 -0800 Subject: [PATCH] almost there --- data-final-fixes.lua | 12 +- data-updates.lua | 4 +- locale/en/locale.cfg | 4 +- prototypes/Acid.lua | 12 +- prototypes/Electric.lua | 5 +- prototypes/Fast.lua | 12 +- prototypes/Fire.lua | 12 +- prototypes/Inferno.lua | 12 +- prototypes/Laser.lua | 13 +- prototypes/Neutral.lua | 14 +- prototypes/Nuclear.lua | 6 +- prototypes/Physical.lua | 6 +- prototypes/Spawner.lua | 22 +- prototypes/Suicide.lua | 5 +- prototypes/Troll.lua | 11 +- prototypes/Wasp.lua | 8 +- prototypes/utils/AttackBall.lua | 61 ++- prototypes/utils/AttackBobs.lua | 643 ++++++++++++--------------- prototypes/utils/AttackNE.lua | 312 ++++++------- prototypes/utils/BiterUtils.lua | 51 ++- prototypes/utils/ProjectileUtils.lua | 42 ++ prototypes/utils/UpdatesBobs.lua | 287 ++++++------ prototypes/utils/UpdatesNE.lua | 46 +- prototypes/utils/UpdatesVanilla.lua | 59 ++- settings.lua | 9 + 25 files changed, 890 insertions(+), 778 deletions(-) create mode 100755 prototypes/utils/ProjectileUtils.lua diff --git a/data-final-fixes.lua b/data-final-fixes.lua index 0955ab7..c4b51d2 100755 --- a/data-final-fixes.lua +++ b/data-final-fixes.lua @@ -20,16 +20,24 @@ if settings.startup["rampant-newEnemies"].value then for _, unitSpawner in pairs(data.raw["unit-spawner"]) do if (unitSpawner.name ~= "biter-spawner") then - unitSpawner.autoplace = nil + unitSpawner.autoplace = nil end end for _, unitSpawner in pairs(data.raw["turret"]) do if (unitSpawner.name ~= "small-worm-turret") then - unitSpawner.autoplace = nil + unitSpawner.autoplace = nil end end end +-- for k, wall in pairs(data.raw["wall"]) do +-- if not wall.collision_mask then +-- wall.collision_mask = {"player-layer", "item-layer", "object-layer" } +-- end +-- wall.collision_mask[#wall.collision_mask+1] = "layer-11" +-- print(serpent.dump(wall.collision_mask)) +-- end + if settings.startup["rampant-enableSwarm"] then for k, unit in pairs(data.raw["unit"]) do if (string.find(k, "biter") or string.find(k, "spitter")) and unit.collision_box then diff --git a/data-updates.lua b/data-updates.lua index a1a05be..e6561ac 100755 --- a/data-updates.lua +++ b/data-updates.lua @@ -13,8 +13,10 @@ end if settings.startup["rampant-useDumbProjectiles"].value then vanillaUpdates.useDumbProjectiles() + local option = settings.startup["bobmods-enemies-enableartifacts"] if option and option.value then + require("prototypes/utils/AttackBobs") bobsUpdates.useDumbProjectiles() end @@ -22,7 +24,7 @@ if settings.startup["rampant-useDumbProjectiles"].value then option = settings.startup["NE_Difficulty"] if option and option.value then require("prototypes/utils/AttackNE") - NEUpdates.useDumbProjectiles() + NEUpdates.useDumbProjectiles() if settings.startup["rampant-useNEUnitLaunchers"].value then NEUpdates.useNEUnitLaunchers() end diff --git a/locale/en/locale.cfg b/locale/en/locale.cfg index d3359cf..2b93c2a 100755 --- a/locale/en/locale.cfg +++ b/locale/en/locale.cfg @@ -10841,6 +10841,7 @@ rampant-enableNEUnits=World: Enable NE as a faction rampant-disallowFriendlyFire=Safety: Disallow Friendly Fire Splash Damage rampant-tierStart=World: Beginning enemy level rampant-tierEnd=World: Ending enemy level +rampant-forceOldProjectiles=Force non-blockable projectiles [mod-setting-description] rampant-useDumbProjectiles=Turns off homing projectiles for worms and spitters @@ -10880,4 +10881,5 @@ rampant-enableBobsUnits=Adds bobs spawners, units, and worms to the base upgrade rampant-enableNEUnits=Adds NE spawners, units, and worms to the base upgrade and placement list rampant-disallowFriendlyFire=Prevents enemy spitters and worms from damaging units or buildings from the same force through splash damage rampant-tierStart=This is the starting tier level and increases linearly to the end tier for as many tiers selected. min 1, max 10 -rampant-tierEnd=This is the ending tier level that is reached after increasing linearly from the start tier for as many tiers selected. min 1, max 10 \ No newline at end of file +rampant-tierEnd=This is the ending tier level that is reached after increasing linearly from the start tier for as many tiers selected. min 1, max 10 +rampant-forceOldProjectiles=This causes projectiles to no longer impact into other entities \ No newline at end of file diff --git a/prototypes/Acid.lua b/prototypes/Acid.lua index 2a4528e..509b279 100755 --- a/prototypes/Acid.lua +++ b/prototypes/Acid.lua @@ -23,7 +23,7 @@ local buildUnitSpawner = swarmUtils.buildUnitSpawner local buildWorm = swarmUtils.buildWorm local createAttackBall = acidBall.createAttackBall -local createStreamAttack = biterUtils.createStreamAttack +local createRangedAttack = biterUtils.createRangedAttack local createMeleeAttack = biterUtils.createMeleeAttack local softSmoke = "the-soft-smoke-rampant" @@ -577,6 +577,7 @@ buildUnitSpawner( explosion = "blood-explosion-small" }, attack = { + type = "projectile", softSmokeName = softSmoke }, resistances = {}, @@ -1173,7 +1174,10 @@ buildUnitSpawner( }, function (attributes) - return createStreamAttack(attributes, createAttackBall(attributes)) + return createRangedAttack(attributes, + createAttackBall(attributes), + spitterattackanimation(attributes.scale, + attributes.tint)) end, { @@ -1195,6 +1199,7 @@ buildWorm( loot = wormLoot, attributes = {}, attack = { + type = "projectile", softSmokeName = softSmoke }, resistances = {}, @@ -1524,7 +1529,8 @@ buildWorm( }, function (attributes) - return createStreamAttack(attributes, createAttackBall(attributes)) + return createRangedAttack(attributes, + createAttackBall(attributes)) end, ACID_WORM_VARIATIONS, diff --git a/prototypes/Electric.lua b/prototypes/Electric.lua index 098bcb5..e56f6dc 100755 --- a/prototypes/Electric.lua +++ b/prototypes/Electric.lua @@ -25,7 +25,7 @@ local buildWorm = swarmUtils.buildWorm local createElectricAttack = biterUtils.createElectricAttack local createAttackBall = attackBall.createAttackBall local makeLaser = beamUtils.makeLaser -local createStreamAttack = biterUtils.createStreamAttack +local createRangedAttack = biterUtils.createRangedAttack local makeBeam = beamUtils.makeBeam local makeBubble = beamUtils.makeBubble @@ -633,6 +633,7 @@ buildWorm( loot = wormLoot, attributes = {}, attack = { + type = "projectile", bubble = electricBubble, damageType = "electric", softSmokeName = softSmoke, @@ -1033,7 +1034,7 @@ buildWorm( function (attributes) attributes.laserName = makeLaser(attributes) - return createStreamAttack(attributes, + return createRangedAttack(attributes, createAttackBall(attributes)) end, diff --git a/prototypes/Fast.lua b/prototypes/Fast.lua index 560cf99..34151c6 100755 --- a/prototypes/Fast.lua +++ b/prototypes/Fast.lua @@ -22,7 +22,7 @@ local FAST_WORM_VARIATIONS = constants.FAST_WORM_VARIATIONS local buildUnitSpawner = swarmUtils.buildUnitSpawner local buildWorm = swarmUtils.buildWorm local createAttackBall = acidBall.createAttackBall -local createStreamAttack = biterUtils.createStreamAttack +local createRangedAttack = biterUtils.createRangedAttack local createMeleeAttack = biterUtils.createMeleeAttack local softSmoke = "the-soft-smoke-rampant" @@ -542,6 +542,7 @@ buildUnitSpawner( explosion = "blood-explosion-small" }, attack = { + type = "projectile", softSmokeName = softSmoke }, resistances = {}, @@ -1033,7 +1034,10 @@ buildUnitSpawner( }, function (attributes) - return createStreamAttack(attributes, createAttackBall(attributes)) + return createRangedAttack(attributes, + createAttackBall(attributes), + spitterattackanimation(attributes.scale, + attributes.tint)) end, { @@ -1055,6 +1059,7 @@ buildWorm( loot = wormLoot, attributes = {}, attack = { + type = "projectile", softSmokeName = softSmoke }, resistances = {}, @@ -1350,7 +1355,8 @@ buildWorm( }, function (attributes) - return createStreamAttack(attributes, createAttackBall(attributes)) + return createRangedAttack(attributes, + createAttackBall(attributes)) end, FAST_WORM_VARIATIONS, diff --git a/prototypes/Fire.lua b/prototypes/Fire.lua index 723e96f..2ec3d99 100755 --- a/prototypes/Fire.lua +++ b/prototypes/Fire.lua @@ -22,7 +22,7 @@ local FIRE_WORM_VARIATIONS = constants.FIRE_WORM_VARIATIONS local buildUnitSpawner = swarmUtils.buildUnitSpawner local buildWorm = swarmUtils.buildWorm local createAttackBall = acidBall.createAttackBall -local createStreamAttack = biterUtils.createStreamAttack +local createRangedAttack = biterUtils.createRangedAttack local createMeleeAttack = biterUtils.createMeleeAttack local softSmoke = "the-soft-smoke-rampant" @@ -605,6 +605,7 @@ buildUnitSpawner( }, loot = biterLoot, attack = { + type = "projectile", damageType = "acid", softSmokeName = softSmoke }, @@ -1190,7 +1191,10 @@ buildUnitSpawner( }, function (attributes) - return createStreamAttack(attributes, createAttackBall(attributes)) + return createRangedAttack(attributes, + createAttackBall(attributes), + spitterattackanimation(attributes.scale, + attributes.tint)) end, { @@ -1212,6 +1216,7 @@ buildWorm( attributes = {}, loot = wormLoot, attack = { + type = "projectile", damageType = "acid", softSmokeName = softSmoke }, @@ -1539,7 +1544,8 @@ buildWorm( }, function (attributes) - return createStreamAttack(attributes, createAttackBall(attributes)) + return createRangedAttack(attributes, + createAttackBall(attributes)) end, FIRE_WORM_VARIATIONS, diff --git a/prototypes/Inferno.lua b/prototypes/Inferno.lua index c899304..5f874f2 100755 --- a/prototypes/Inferno.lua +++ b/prototypes/Inferno.lua @@ -23,7 +23,7 @@ local INFERNO_WORM_VARIATIONS = constants.INFERNO_WORM_VARIATIONS local buildUnitSpawner = swarmUtils.buildUnitSpawner local buildWorm = swarmUtils.buildWorm local createAttackFlame = attackFlame.createAttackFlame -local createStreamAttack = biterUtils.createStreamAttack +local createRangedAttack = biterUtils.createRangedAttack local softSmoke = "the-soft-smoke-rampant" local smokeGlow = "the-glow-smoke-rampant" @@ -51,6 +51,7 @@ buildUnitSpawner( explosion = "blood-explosion-small" }, attack = { + type = "stream", damageType = "acid", fireDamagePerTickType = "acid", softSmokeName = softSmoke, @@ -690,7 +691,10 @@ buildUnitSpawner( }, function (attributes) - return createStreamAttack(attributes, createAttackFlame(attributes)) + return createRangedAttack(attributes, + createAttackFlame(attributes), + spitterattackanimation(attributes.scale, + attributes.tint)) end, { @@ -712,6 +716,7 @@ buildWorm( loot = wormLoot, attributes = {}, attack = { + type = "stream", damageType = "acid", fireDamagePerTickType = "acid", softSmokeName = softSmoke, @@ -1147,7 +1152,8 @@ buildWorm( }, function (attributes) - return createStreamAttack(attributes, createAttackFlame(attributes)) + return createRangedAttack(attributes, + createAttackFlame(attributes)) end, INFERNO_WORM_VARIATIONS, diff --git a/prototypes/Laser.lua b/prototypes/Laser.lua index d6ba8a4..a932bbe 100755 --- a/prototypes/Laser.lua +++ b/prototypes/Laser.lua @@ -24,8 +24,7 @@ local buildUnitSpawner = swarmUtils.buildUnitSpawner local buildWorm = swarmUtils.buildWorm local createAttackBall = acidBall.createAttackBall local makeLaser = beamUtils.makeLaser -local createStreamAttack = biterUtils.createStreamAttack -local makeBeam = beamUtils.makeBeam +local createRangedAttack = biterUtils.createRangedAttack local makeBubble = beamUtils.makeBubble local createMeleeAttack = biterUtils.createMeleeAttack @@ -590,6 +589,7 @@ buildUnitSpawner( explosion = "blood-explosion-small" }, attack = { + type = "projectile", bubble = laserBubble, softSmokeName = softSmoke, damageType = "laser", @@ -1192,8 +1192,10 @@ buildUnitSpawner( function (attributes) attributes.laserName = makeLaser(attributes) - return createStreamAttack(attributes, - createAttackBall(attributes)) + return createRangedAttack(attributes, + createAttackBall(attributes), + spitterattackanimation(attributes.scale, + attributes.tint)) end, { @@ -1215,6 +1217,7 @@ buildWorm( loot = wormLoot, attributes = {}, attack = { + type = "projectile", bubble = laserBubble, softSmokeName = softSmoke, damageType = "laser", @@ -1615,7 +1618,7 @@ buildWorm( function (attributes) attributes.laserName = makeLaser(attributes) - return createStreamAttack(attributes, + return createRangedAttack(attributes, createAttackBall(attributes)) end, diff --git a/prototypes/Neutral.lua b/prototypes/Neutral.lua index d88bfa4..321c400 100755 --- a/prototypes/Neutral.lua +++ b/prototypes/Neutral.lua @@ -22,7 +22,9 @@ local NEUTRAL_WORM_VARIATIONS = constants.NEUTRAL_WORM_VARIATIONS local buildUnitSpawner = swarmUtils.buildUnitSpawner local buildWorm = swarmUtils.buildWorm local createAttackBall = acidBall.createAttackBall -local createStreamAttack = biterUtils.createStreamAttack + +local createRangedAttack = biterUtils.createRangedAttack + local createMeleeAttack = biterUtils.createMeleeAttack local softSmoke = "the-soft-smoke-rampant" @@ -518,6 +520,7 @@ buildUnitSpawner( explosion = "blood-explosion-small" }, attack = { + type = "projectile", softSmokeName = softSmoke }, resistances = {}, @@ -988,7 +991,10 @@ buildUnitSpawner( function (attributes) - return createStreamAttack(attributes, createAttackBall(attributes)) + return createRangedAttack(attributes, + createAttackBall(attributes), + spitterattackanimation(attributes.scale, + attributes.tint)) end, { @@ -1010,6 +1016,7 @@ buildWorm( loot = wormLoot, attributes = {}, attack = { + type = "projectile", softSmokeName = softSmoke }, resistances = {}, @@ -1305,7 +1312,8 @@ buildWorm( }, function (attributes) - return createStreamAttack(attributes, createAttackBall(attributes)) + return createRangedAttack(attributes, + createAttackBall(attributes)) end, NEUTRAL_WORM_VARIATIONS, diff --git a/prototypes/Nuclear.lua b/prototypes/Nuclear.lua index 1588b79..1cc8c2d 100755 --- a/prototypes/Nuclear.lua +++ b/prototypes/Nuclear.lua @@ -24,7 +24,7 @@ local makeSticker = stickerUtils.makeSticker local buildUnitSpawner = swarmUtils.buildUnitSpawner local buildWorm = swarmUtils.buildWorm local createAttackBall = acidBall.createAttackBall -local createStreamAttack = biterUtils.createStreamAttack +local createRangedAttack = biterUtils.createRangedAttack local createSuicideAttack = biterUtils.createSuicideAttack local softSmoke = "the-soft-smoke-rampant" @@ -571,6 +571,7 @@ buildWorm( loot = wormLoot, attributes = {}, attack = { + type = "projectile", stickerAnimation = { filename = "__base__/graphics/entity/slowdown-sticker/slowdown-sticker.png", priority = "extra-high", @@ -917,7 +918,8 @@ buildWorm( function (attributes) makeSticker(attributes) - return createStreamAttack(attributes, createAttackBall(attributes)) + return createRangedAttack(attributes, + createAttackBall(attributes)) end, NUCLEAR_WORM_VARIATIONS, diff --git a/prototypes/Physical.lua b/prototypes/Physical.lua index 71f1584..b6a564d 100755 --- a/prototypes/Physical.lua +++ b/prototypes/Physical.lua @@ -22,7 +22,7 @@ local PHYSICAL_WORM_VARIATIONS = constants.PHYSICAL_WORM_VARIATIONS local buildUnitSpawner = swarmUtils.buildUnitSpawner local buildWorm = swarmUtils.buildWorm local createAttackBall = physicalBall.createAttackBall -local createStreamAttack = biterUtils.createStreamAttack +local createRangedAttack = biterUtils.createRangedAttack local createMeleeAttack = biterUtils.createMeleeAttack local softSmoke = "the-soft-smoke-rampant" @@ -519,6 +519,7 @@ buildWorm( attributes = { }, attack = { + type = "projectile", damageType = "physical", pointEffects = function (attributes) return { @@ -853,7 +854,8 @@ buildWorm( }, function (attributes) - return createStreamAttack(attributes, createAttackBall(attributes)) + return createRangedAttack(attributes, + createAttackBall(attributes)) end, PHYSICAL_WORM_VARIATIONS, diff --git a/prototypes/Spawner.lua b/prototypes/Spawner.lua index 8fbab4e..739788e 100755 --- a/prototypes/Spawner.lua +++ b/prototypes/Spawner.lua @@ -25,7 +25,7 @@ local buildWorm = swarmUtils.buildWorm local buildUnits = swarmUtils.buildUnits local createAttackBall = acidBall.createAttackBall local createMeleeAttack = biterUtils.createMeleeAttack -local createCapsuleAttack = biterUtils.createCapsuleAttack +local createProjectileAttack = biterUtils.createProjectileAttack local biterAttackSounds = biterUtils.biterAttackSounds @@ -134,7 +134,7 @@ buildUnits( [10] = 140 }, -{ + { type = "attack", name = "startingSpeed", [1] = 0.25, @@ -1073,11 +1073,11 @@ buildUnitSpawner( }, function (attributes) - return createCapsuleAttack(attributes, - createCapsuleProjectile(attributes.name, - attributes, - attributes.name .. "-drone-rampant"), - spitterattackanimation(attributes.scale, attributes.tint)) + return createProjectileAttack(attributes, + createCapsuleProjectile(attributes.name, + attributes, + attributes.name .. "-drone-rampant"), + spitterattackanimation(attributes.scale, attributes.tint)) end, { @@ -1395,10 +1395,10 @@ buildWorm( }, function (attributes) - return createCapsuleAttack(attributes, - createCapsuleProjectile(attributes.name, - attributes, - attributes.name .. "-drone-rampant")) + return createProjectileAttack(attributes, + createCapsuleProjectile(attributes.name, + attributes, + attributes.name .. "-drone-rampant")) end, SPAWNER_WORM_VARIATIONS, diff --git a/prototypes/Suicide.lua b/prototypes/Suicide.lua index 2756735..dc1cad9 100755 --- a/prototypes/Suicide.lua +++ b/prototypes/Suicide.lua @@ -24,7 +24,7 @@ local makeSticker = stickerUtils.makeSticker local buildUnitSpawner = swarmUtils.buildUnitSpawner local buildWorm = swarmUtils.buildWorm local createAttackBall = acidBall.createAttackBall -local createStreamAttack = biterUtils.createStreamAttack +local createRangedAttack = biterUtils.createRangedAttack local createSuicideAttack = biterUtils.createSuicideAttack local softSmoke = "the-soft-smoke-rampant" @@ -600,6 +600,7 @@ buildWorm( loot = wormLoot, attributes = {}, attack = { + type = "projectile", stickerAnimation = { filename = "__base__/graphics/entity/slowdown-sticker/slowdown-sticker.png", priority = "extra-high", @@ -946,7 +947,7 @@ buildWorm( function (attributes) makeSticker(attributes) - return createStreamAttack(attributes, createAttackBall(attributes)) + return createRangedAttack(attributes, createAttackBall(attributes)) end, SUICIDE_WORM_VARIATIONS, diff --git a/prototypes/Troll.lua b/prototypes/Troll.lua index 27b4278..eb01d33 100755 --- a/prototypes/Troll.lua +++ b/prototypes/Troll.lua @@ -22,7 +22,7 @@ local TROLL_WORM_VARIATIONS = constants.TROLL_WORM_VARIATIONS local buildUnitSpawner = swarmUtils.buildUnitSpawner local buildWorm = swarmUtils.buildWorm local createAttackBall = acidBall.createAttackBall -local createStreamAttack = biterUtils.createStreamAttack +local createRangedAttack = biterUtils.createRangedAttack local createMeleeAttack = biterUtils.createMeleeAttack local softSmoke = "the-soft-smoke-rampant" @@ -549,6 +549,7 @@ buildUnitSpawner( explosion = "blood-explosion-small" }, attack = { + type = "projectile", softSmokeName = softSmoke }, resistances = {}, @@ -1050,7 +1051,10 @@ buildUnitSpawner( function (attributes) - return createStreamAttack(attributes, createAttackBall(attributes)) + return createRangedAttack(attributes, + createAttackBall(attributes), + spitterattackanimation(attributes.scale, + attributes.tint)) end, { @@ -1072,6 +1076,7 @@ buildWorm( loot = wormLoot, attributes = {}, attack = { + type = "projectile", softSmokeName = softSmoke }, resistances = {}, @@ -1367,7 +1372,7 @@ buildWorm( }, function (attributes) - return createStreamAttack(attributes, createAttackBall(attributes)) + return createRangedAttack(attributes, createAttackBall(attributes)) end, TROLL_WORM_VARIATIONS, diff --git a/prototypes/Wasp.lua b/prototypes/Wasp.lua index 73c75af..cc964bb 100755 --- a/prototypes/Wasp.lua +++ b/prototypes/Wasp.lua @@ -24,7 +24,7 @@ local buildUnitSpawner = swarmUtils.buildUnitSpawner local buildWorm = swarmUtils.buildWorm local buildUnits = swarmUtils.buildUnits local createAttackBall = acidBall.createAttackBall -local createCapsuleAttack = biterUtils.createCapsuleAttack +local createProjectileAttack = biterUtils.createProjectileAttack local biterAttackSounds = biterUtils.biterAttackSounds @@ -49,6 +49,7 @@ buildUnits( followsPlayer = true }, attack = { + type = "stream", softSmokeName = softSmoke }, death = function (attributes) @@ -318,6 +319,7 @@ buildUnits( attributes = { }, attack = { + type = "stream", softSmokeName = softSmoke }, death = function (attributes) @@ -1061,7 +1063,7 @@ buildUnitSpawner( }, function (attributes) - return createCapsuleAttack(attributes, + return createProjectileAttack(attributes, createCapsuleProjectile(attributes.name, attributes, attributes.name .. "-drone-rampant"), @@ -1383,7 +1385,7 @@ buildWorm( }, function (attributes) - return createCapsuleAttack(attributes, + return createProjectileAttack(attributes, createCapsuleProjectile(attributes.name, attributes, attributes.name .. "-drone-rampant")) diff --git a/prototypes/utils/AttackBall.lua b/prototypes/utils/AttackBall.lua index 732a11b..453ed19 100755 --- a/prototypes/utils/AttackBall.lua +++ b/prototypes/utils/AttackBall.lua @@ -1,14 +1,17 @@ -- import local streamUtils = require("StreamUtils") +local projectileUtils = require("ProjectileUtils") -- constants +local FORCE_OLD_PROJECTILES = settings.startup["rampant-forceOldProjectiles"].value local DISALLOW_FRIENDLY_FIRE = settings.startup["rampant-disallowFriendlyFire"].value -- imported functions local makeStream = streamUtils.makeStream +local makeProjectile = projectileUtils.makeProjectile -- dumb acid projectiles local AttackBall = {} @@ -50,30 +53,46 @@ function AttackBall.createAttackBall(attributes) } } - local template = { - name = attributes.name, - particleTint = attributes.pTint, - spineAnimationTint = attributes.sTint, - softSmokeTint = attributes.smTint, - softSmokeName = attributes.softSmokeName, - particleVertialAcceleration = attributes.particleVertialAcceleration, - particleHoizontalSpeed = attributes.particleHoizontalSpeed, - particleHoizontalSpeedDeviation = attributes.particleHoizontalSpeedDeviation, - actions = templateActions - } - - return makeStream(template) + local name + local template + if (attributes.type == "stream") or FORCE_OLD_PROJECTILES then + template = { + name = attributes.name, + particleTint = attributes.pTint, + spineAnimationTint = attributes.sTint, + softSmokeName = attributes.softSmokeName, + particleVertialAcceleration = attributes.particleVertialAcceleration, + particleHoizontalSpeed = attributes.particleHoizontalSpeed, + particleHoizontalSpeedDeviation = attributes.particleHoizontalSpeedDeviation, + actions = templateActions + } + name = makeStream(template) + elseif (attributes.type == "projectile") then + template = { + aTint = attributes.pTint, + collisionMask = attributes.collisionMask, + directionOnly = true, + acceleration = attributes.acceleration, + piercingDamage = attributes.piercingDamage + } + name = makeProjectile(attributes.name, + template, + templateActions) + end + + return name end function AttackBall.generateLegacy() - AttackBall.createAttackBall({name="acid-ball", pTint={r=0, g=1, b=1, a=0.5}, sTint={r=0, g=1, b=1, a=0.5}, softSmokeName="the-soft-smoke-rampant", damage=4, radius=1.2}) - AttackBall.createAttackBall({name="acid-ball-1", pTint={r=0, g=1, b=1, a=0.5}, sTint={r=0, g=1, b=1, a=0.5}, softSmokeName="the-soft-smoke-rampant", damage=9, radius=1.3}) - AttackBall.createAttackBall({name="acid-ball-2", pTint={r=0, g=1, b=1, a=0.5}, sTint={r=0, g=1, b=1, a=0.5}, softSmokeName="the-soft-smoke-rampant", damage=14, radius=1.4}) - AttackBall.createAttackBall({name="acid-ball-3", pTint={r=0, g=1, b=1, a=0.5}, sTint={r=0, g=1, b=1, a=0.5}, softSmokeName="the-soft-smoke-rampant", damage=23, radius=1.5}) - AttackBall.createAttackBall({name="wide-acid-ball", pTint={r=0, g=1, b=1, a=0.5}, sTint={r=0, g=1, b=1, a=0.5}, softSmokeName="the-soft-smoke-rampant", damage=18, radius=3}) - AttackBall.createAttackBall({name="acid-ball-4", pTint={r=0, g=1, b=1, a=0.5}, sTint={r=0, g=1, b=1, a=0.5}, softSmokeName="the-soft-smoke-rampant", damage=25, radius=1.75}) - AttackBall.createAttackBall({name="acid-ball-5", pTint={r=0, g=1, b=1, a=0.5}, sTint={r=0, g=1, b=1, a=0.5}, softSmokeName="the-soft-smoke-rampant", damage=50, radius=2}) - AttackBall.createAttackBall({name="acid-ball-6", pTint={r=0, g=1, b=1, a=0.5}, sTint={r=0, g=1, b=1, a=0.5}, softSmokeName="the-soft-smoke-rampant", damage=70, radius=2.5}) + + AttackBall.createAttackBall({name="acid-ball", type="projectile", pTint={r=0, g=1, b=1, a=0.5}, sTint={r=0, g=1, b=1, a=0.5}, softSmokeName="the-soft-smoke-rampant", damage=4, radius=1.2}) + AttackBall.createAttackBall({name="acid-ball-1", type="projectile", pTint={r=0, g=1, b=1, a=0.5}, sTint={r=0, g=1, b=1, a=0.5}, softSmokeName="the-soft-smoke-rampant", damage=9, radius=1.3}) + AttackBall.createAttackBall({name="acid-ball-2", type="projectile", pTint={r=0, g=1, b=1, a=0.5}, sTint={r=0, g=1, b=1, a=0.5}, softSmokeName="the-soft-smoke-rampant", damage=14, radius=1.4}) + AttackBall.createAttackBall({name="acid-ball-3", type="projectile", pTint={r=0, g=1, b=1, a=0.5}, sTint={r=0, g=1, b=1, a=0.5}, softSmokeName="the-soft-smoke-rampant", damage=23, radius=1.5}) + AttackBall.createAttackBall({name="wide-acid-ball", type="projectile", pTint={r=0, g=1, b=1, a=0.5}, sTint={r=0, g=1, b=1, a=0.5}, softSmokeName="the-soft-smoke-rampant", damage=18, radius=3}) + AttackBall.createAttackBall({name="acid-ball-4", type="projectile", pTint={r=0, g=1, b=1, a=0.5}, sTint={r=0, g=1, b=1, a=0.5}, softSmokeName="the-soft-smoke-rampant", damage=25, radius=1.75}) + AttackBall.createAttackBall({name="acid-ball-5", type="projectile", pTint={r=0, g=1, b=1, a=0.5}, sTint={r=0, g=1, b=1, a=0.5}, softSmokeName="the-soft-smoke-rampant", damage=50, radius=2}) + AttackBall.createAttackBall({name="acid-ball-6", type="projectile", pTint={r=0, g=1, b=1, a=0.5}, sTint={r=0, g=1, b=1, a=0.5}, softSmokeName="the-soft-smoke-rampant", damage=70, radius=2.5}) end return AttackBall diff --git a/prototypes/utils/AttackBobs.lua b/prototypes/utils/AttackBobs.lua index 0dfc78a..9962ba1 100755 --- a/prototypes/utils/AttackBobs.lua +++ b/prototypes/utils/AttackBobs.lua @@ -2,9 +2,9 @@ -- import -local streamUtils = require("StreamUtils") local fireUtils = require("FireUtils") local stickerUtils = require("StickerUtils") +local attackBall = require("AttackBall") -- constants @@ -12,11 +12,12 @@ local DISALLOW_FRIENDLY_FIRE = settings.startup["rampant-disallowFriendlyFire"]. -- imported functions -local makeStream = streamUtils.makeStream local makeSpreadEffect = fireUtils.makeSpreadEffect local makeFire = fireUtils.makeFire local makeSticker = stickerUtils.makeSticker +local createAttackBall = attackBall.createAttackBall + -- module code local softSmoke = "the-soft-smoke-rampant" @@ -24,54 +25,44 @@ local smokeGlow = "the-glow-smoke-rampant" local smokeWithoutGlow = "the-without-glow-smoke-rampant" local smokeFuel = "the-adding-fuel-rampant" -makeStream({ + +createAttackBall( + { name = "bob-explosive-ball", - particleTint = {r=1, g=0.97, b=0.34, a=0.5}, - spineAnimationTint = {r=1, g=0.97, b=0.34, a=0.5}, + pTint = {r=1, g=0.97, b=0.34, a=0.5}, + sTint = {r=1, g=0.97, b=0.34, a=0.5}, softSmokeName = softSmoke, - actions = { - { - type = "direct", - action_delivery = - { - type = "instant", - target_effects = - { - { - type = "create-entity", - entity_name = "small-scorchmark", - check_buildability = true - }, - { - type = "create-entity", - entity_name = "big-explosion", - check_buildability = true - }, - { - type = "create-entity", - entity_name = "small-fire-cloud" - } - } - } - }, - { - type = "area", - radius = 3, - force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil, - action_delivery = - { - type = "instant", - target_effects = - { - { - type = "damage", - damage = { amount = 25, type = "explosion" } - } - } - } + type = "projectile", + pointEffects = function (attributes) + return { + { + type = "create-entity", + entity_name = "small-scorchmark", + check_buildability = true + }, + { + type = "create-entity", + entity_name = "big-explosion", + check_buildability = true + }, + { + type = "create-entity", + entity_name = "small-fire-cloud" + } } - } -}) + end, + radius = 3, + areaEffects = function (attributes) + return + { + { + type = "damage", + damage = { amount = 25, type = "explosion" } + } + } + end + } +) -- @@ -91,89 +82,67 @@ local stickerName = makeSticker({ name = name, spawnEntityName = spawnEntityName }) -makeStream({ +createAttackBall( + { name = name, - particleTint = {r=1, g=0.17, b=0.17, a=0.5}, - spineAnimationTint = {r=1, g=0.43, b=0.17, a=0.5}, + pTint = {r=1, g=0.17, b=0.17, a=0.5}, + sTint = {r=1, g=0.43, b=0.17, a=0.5}, softSmokeName = softSmoke, - actions = { - { - type = "direct", - action_delivery = - { - type = "instant", - target_effects = - { - { - type = "create-fire", - entity_name = fireName - } - } - } - }, - { - type = "area", - radius = 2, - force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil, - action_delivery = - { - type = "instant", - target_effects = - { - { - type = "create-sticker", - sticker = stickerName, - }, - { - type = "damage", - damage = { amount = 20, type = "fire" } - } - } - } + type = "projectile", + pointEffects = function (attributes) + return { + { + type = "create-fire", + entity_name = fireName + } } - } -}) + end, + radius = 2, + areaEffects = function (attributes) + return + { + { + type = "create-sticker", + sticker = stickerName, + }, + { + type = "damage", + damage = { amount = 20, type = "fire" } + } + } + end + } +) -- -makeStream({ +createAttackBall( + { name = "bob-poison-ball", - particleTint = {r=0.1, g=0.5, b=1, a=0.5}, - spineAnimationTint = {r=0, g=0, b=1, a=0.5}, + pTint = {r=0.1, g=0.5, b=1, a=0.5}, + sTint = {r=0, g=0, b=1, a=0.5}, softSmokeName = softSmoke, - actions = { - { - type = "direct", - action_delivery = - { - type = "instant", - target_effects = - { - { - type = "create-entity", - entity_name = "small-poison-cloud" - } - } - } - }, - { - type = "area", - radius = 2, - force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil, - action_delivery = - { - type = "instant", - target_effects = - { - { - type = "damage", - damage = { amount = 20, type = "poison" } - } - } - } + type = "projectile", + pointEffects = function (attributes) + return { + { + type = "create-entity", + entity_name = "small-poison-cloud" + } } - } -}) + end, + radius = 2, + areaEffects = function (attributes) + return + { + { + type = "damage", + damage = { amount = 20, type = "poison" } + } + } + end + } +) -- piercing @@ -209,44 +178,45 @@ data:extend({ } }) -makeStream({ +createAttackBall( + { name = "bob-piercing-ball", - particleTint = {r=0.1, g=0.1, b=0.1, a=0.8}, - spineAnimationTint = {r=0.1, g=0.1, b=0.1, a=0.8}, + pTint = {r=0.1, g=0.1, b=0.1, a=0.8}, + sTint = {r=0.1, g=0.1, b=0.1, a=0.8}, softSmokeName = softSmoke, - actions = { - { - type = "cluster", - cluster_count = 10, - distance = 4, - distance_deviation = 3, - action_delivery = - { - type = "projectile", - projectile = "piercing-spike-rampant", - direction_deviation = 0.6, - starting_speed = 1, - starting_speed_deviation = 0.0 - } - }, - { - type = "area", - radius = 3, - force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil, - action_delivery = - { - type = "instant", - target_effects = + type = "projectile", + pointEffects = function (attributes) + return + { + type = "nested-result", + action = { + type = "cluster", + cluster_count = 10, + distance = 4, + distance_deviation = 3, + action_delivery = { - { - type = "damage", - damage = { amount = 30, type = "bob-pierce" } - } + type = "projectile", + projectile = "piercing-spike-rampant", + direction_deviation = 0.6, + starting_speed = 1, + starting_speed_deviation = 0.0 } } - } - } -}) + } + end, + radius = 3, + areaEffects = function (attributes) + return + { + { + type = "damage", + damage = { amount = 30, type = "bob-pierce" } + } + } + end + } +) -- @@ -292,232 +262,199 @@ data:extend({ } }) - -makeStream({ +createAttackBall( + { name = "bob-electric-ball", - particleTint = {r=0, g=0.1, b=1, a=1}, - spineAnimationTint = {r=0, g=0.1, b=1, a=1}, + pTint = {r=0, g=0.1, b=1, a=1}, + sTint = {r=0, g=0.1, b=1, a=1}, softSmokeName = softSmoke, - actions = { - { - type = "cluster", - cluster_count = 5, - distance = 2, - distance_deviation = 2, - action_delivery = - { - type = "projectile", - projectile = "electric-spike-rampant", - direction_deviation = 0.6, - starting_speed = 0.65, - starting_speed_deviation = 0.0 - } - }, - { - type = "area", - radius = 3, - force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil, - action_delivery = - { - type = "instant", - target_effects = + type = "projectile", + pointEffects = function (attributes) + return + { + type = "nested-result", + action = { + type = "cluster", + cluster_count = 5, + distance = 2, + distance_deviation = 2, + action_delivery = { - { - type = "damage", - damage = { amount = 25, type = "electric" } - } + type = "projectile", + projectile = "electric-spike-rampant", + direction_deviation = 0.6, + starting_speed = 0.65, + starting_speed_deviation = 0.0 } } - } - } -}) + } + end, + radius = 3, + areaEffects = function (attributes) + return + { + { + type = "damage", + damage = { amount = 25, type = "electric" } + } + } + end + } +) -- -makeStream({ +createAttackBall( + { name = "bob-titan-ball", - particleTint = {r=0, g=0.1, b=1, a=1}, - spineAnimationTint = {r=0, g=0.1, b=1, a=1}, + pTint = {r=0, g=0.1, b=1, a=1}, + sTint = {r=0, g=0.1, b=1, a=1}, softSmokeName = softSmoke, - actions = { - { - type = "direct", - action_delivery = + type = "projectile", + pointEffects = function (attributes) + return + { { - type = "instant", - target_effects = - { - { - type = "create-entity", - entity_name = "small-fire-cloud" - }, - { - type = "create-entity", - entity_name = "big-explosion" - } - } - } - }, - { - type = "area", - radius = 3, - force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil, - action_delivery = + type = "create-entity", + entity_name = "small-fire-cloud" + }, { - type = "instant", - target_effects = - { - { - type = "damage", - damage = { amount = 10, type = "electric" } - }, - { - type = "damage", - damage = { amount = 10, type = "explosion" } - }, - { - type = "damage", - damage = { amount = 10, type = "fire" } - } - } + type = "create-entity", + entity_name = "big-explosion" } - } - } -}) + } + end, + radius = 3, + areaEffects = function (attributes) + return + { + { + type = "damage", + damage = { amount = 10, type = "electric" } + }, + { + type = "damage", + damage = { amount = 10, type = "explosion" } + }, + { + type = "damage", + damage = { amount = 10, type = "fire" } + } + } + end + } +) -- -makeStream({ +createAttackBall( + { name = "bob-behemoth-ball", - particleTint = {r=0, g=0.1, b=1, a=1}, - spineAnimationTint = {r=0, g=0.1, b=1, a=1}, + pTint = {r=0, g=0.1, b=1, a=1}, + sTint = {r=0, g=0.1, b=1, a=1}, softSmokeName = softSmoke, - actions = { - { - type = "direct", - action_delivery = + type = "projectile", + pointEffects = function (attributes) + return + { { - type = "instant", - target_effects = - { - { - type = "create-entity", - entity_name = "small-poison-cloud" - }, - { - type = "create-entity", - entity_name = "big-explosion" - } - } - } - }, - { - type = "area", - radius = 3, - force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil, - action_delivery = + type = "create-entity", + entity_name = "small-poison-cloud" + }, { - type = "instant", - target_effects = - { - { - type = "damage", - damage = { amount = 15, type = "electric" } - }, - { - type = "damage", - damage = { amount = 15, type = "explosion" } - }, - { - type = "damage", - damage = { amount = 15, type = "fire" } - }, - { - type = "damage", - damage = { amount = 15, type = "poison" } - } - } + type = "create-entity", + entity_name = "big-explosion" } - } - } -}) + } + end, + radius = 3, + areaEffects = function (attributes) + return + { + { + type = "damage", + damage = { amount = 15, type = "electric" } + }, + { + type = "damage", + damage = { amount = 15, type = "explosion" } + }, + { + type = "damage", + damage = { amount = 15, type = "fire" } + }, + { + type = "damage", + damage = { amount = 15, type = "poison" } + } + } + end + } +) -- -makeStream({ +createAttackBall( + { name = "bob-leviathan-ball", - particleTint = {r=0, g=0.1, b=1, a=1}, - spineAnimationTint = {r=0, g=0.1, b=1, a=1}, + pTint = {r=0, g=0.1, b=1, a=1}, + sTint = {r=0, g=0.1, b=1, a=1}, softSmokeName = softSmoke, - actions = { - { - type = "cluster", - cluster_count = 4, - distance = 3, - distance_deviation = 1, - action_delivery ={ - type = "instant", - target_effects = { + type = "projectile", + pointEffects = function (attributes) + return + { + type = "nested-result", + action = { - type = "create-entity", - entity_name = "big-explosion", - direction_deviation = 0.6, - starting_speed = 1, - starting_speed_deviation = 0.0 - } - } - } - }, - { - type = "direct", - action_delivery = { - type = "instant", - target_effects = { - { - type = "create-entity", - entity_name = "big-explosion", - direction_deviation = 0.6, - starting_speed = 1, - starting_speed_deviation = 0.0 - } - } - } - }, - { - type = "area", - radius = 3, - force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil, - action_delivery = - { - type = "instant", - target_effects = - { - { - type = "damage", - damage = { amount = 15, type = "electric" } - }, - { - type = "damage", - damage = { amount = 15, type = "explosion" } - }, - { - type = "damage", - damage = { amount = 15, type = "fire" } - }, - { - type = "damage", - damage = { amount = 15, type = "poison" } - }, - { - type = "damage", - damage = { amount = 15, type = "bob-pierce" } - }, - { - type = "damage", - damage = { amount = 15, type = "acid" } + type = "cluster", + cluster_count = 4, + distance = 3, + distance_deviation = 1, + action_delivery ={ + type = "instant", + target_effects = { + { + type = "create-entity", + entity_name = "big-explosion", + direction_deviation = 0.6, + starting_speed = 1, + starting_speed_deviation = 0.0 + } } } + } + } + end, + radius = 3, + areaEffects = function (attributes) + return + { + { + type = "damage", + damage = { amount = 15, type = "electric" } + }, + { + type = "damage", + damage = { amount = 15, type = "explosion" } + }, + { + type = "damage", + damage = { amount = 15, type = "fire" } + }, + { + type = "damage", + damage = { amount = 15, type = "poison" } + }, + { + type = "damage", + damage = { amount = 15, type = "bob-pierce" } + }, + { + type = "damage", + damage = { amount = 15, type = "acid" } } - } - } -}) + } + end + } +) diff --git a/prototypes/utils/AttackNE.lua b/prototypes/utils/AttackNE.lua index 1f62ab8..018a765 100755 --- a/prototypes/utils/AttackNE.lua +++ b/prototypes/utils/AttackNE.lua @@ -1,203 +1,165 @@ -- import -local streamUtils = require("StreamUtils") - --- constants - -local DISALLOW_FRIENDLY_FIRE = settings.startup["rampant-disallowFriendlyFire"].value - --- imported functions - -local makeStream = streamUtils.makeStream +local attackBall = require("AttackBall") -- module code local softSmoke = "the-soft-smoke-rampant" +local createAttackBall = attackBall.createAttackBall -makeStream({ + +createAttackBall( + { name = "ne-infected-unit-ball", - particleTint = {r=0, g=0.97, b=0.34, a=0.5}, - spineAnimationTint = {r=0, g=0.1, b=1, a=1}, + pTint = {r=0, g=0.97, b=0.34, a=0.5}, + sTint = {r=0, g=0.1, b=1, a=1}, softSmokeName = softSmoke, - actions = { - { - type = "direct", - action_delivery = - { - type = "instant", - target_effects = - { - { - type = "create-entity", - entity_name = "unit-cluster", - trigger_created_entity = "true" - }, - { - type = "create-sticker", - sticker = "slowdown-sticker", - }, - { - type = "create-entity", - entity_name = "Infected-Poison-Cloud" - }, - { - type = "damage", - damage = {amount = 10, type = "explosion"} - }, - { - type = "damage", - damage = {amount = 24, type = "poison"} - } - } - } + type = "projectile", + pointEffects = function (attributes) + return { + { + type = "create-entity", + entity_name = "unit-cluster", + trigger_created_entity = "true" + }, + { + type = "create-sticker", + sticker = "slowdown-sticker", + }, + { + type = "create-entity", + entity_name = "Infected-Poison-Cloud" + }, + { + type = "damage", + damage = {amount = 10, type = "explosion"} + }, + { + type = "damage", + damage = {amount = 24, type = "poison"} + } } - } -}) + end, + radius = 1, + areaEffects = function (attributes) + return + { + { + type = "damage", + damage = { amount = 0, type = "explosion" } + } + } + end + } +) -- -makeStream({ +createAttackBall( + { name = "ne-mutated-unit-ball", - particleTint = {r=0.5, g=0.7, b=0.34, a=0.5}, - spineAnimationTint = {r=0.5, g=0.97, b=0.34, a=0.5}, + pTint = {r=0.5, g=0.7, b=0.34, a=0.5}, + sTint = {r=0.5, g=0.97, b=0.34, a=0.5}, softSmokeName = softSmoke, - actions = { - { - type = "direct", - action_delivery = - { - type = "instant", - target_effects = - { - { - type = "create-entity", - entity_name = "unit-cluster", - trigger_created_entity = "true" - }, - { - type = "create-sticker", - sticker = "slowdown-sticker", - }, - { - type = "create-entity", - entity_name = "acid-splash-purple" - } - } - } - }, - { - type = "area", - radius = 2, - force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil, - action_delivery = - { - type = "instant", - target_effects = - { - { - type = "damage", - damage = { amount = 8, type = "explosion" } - }, - { - type = "damage", - damage = { amount = 18, type = "acid" } - } - } - } + type = "projectile", + pointEffects = function (attributes) + return { + { + type = "create-entity", + entity_name = "unit-cluster", + trigger_created_entity = "true" + }, + { + type = "create-sticker", + sticker = "slowdown-sticker", + }, + { + type = "create-entity", + entity_name = "acid-splash-purple" + } } - } -}) + end, + radius = 2, + areaEffects = function (attributes) + return + { + { + type = "damage", + damage = { amount = 8, type = "explosion" } + }, + { + type = "damage", + damage = { amount = 18, type = "acid" } + } + } + end + } +) -- -makeStream({ +createAttackBall( + { name = "ne-infected-ball", - particleTint = {r=0.5, g=0.7, b=0.34, a=0.5}, - spineAnimationTint = {r=0.5, g=0.97, b=0.34, a=0.5}, + pTint = {r=0.5, g=0.7, b=0.34, a=0.5}, + sTint = {r=0.5, g=0.97, b=0.34, a=0.5}, softSmokeName = softSmoke, - actions = { - { - type = "direct", - action_delivery = - { - type = "instant", - target_effects = - { - { - type = "create-entity", - entity_name = "Infected-Poison-Cloud" - } - } - } - }, - { - type = "area", - radius = 1.5, - force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil, - action_delivery = - { - type = "instant", - target_effects = - { - { - type = "damage", - damage = { amount = 5, type = "explosion" } - }, - { - type = "damage", - damage = { amount = 12, type = "poison" } - } - } - } + type = "projectile", + pointEffects = function (attributes) + return { + { + type = "create-entity", + entity_name = "Infected-Poison-Cloud" + } } - } -}) + end, + radius = 1.5, + areaEffects = function (attributes) + return + { + { + type = "damage", + damage = { amount = 5, type = "explosion" } + }, + { + type = "damage", + damage = { amount = 12, type = "poison" } + } + } + end + } +) -- -makeStream({ +createAttackBall( + { name = "ne-mutated-ball", - particleTint = {r=0.5, g=0.7, b=0.34, a=0.5}, - spineAnimationTint = {r=0.5, g=0.97, b=0.34, a=0.5}, + pTint = {r=0.5, g=0.7, b=0.34, a=0.5}, + sTint = {r=0.5, g=0.97, b=0.34, a=0.5}, softSmokeName = softSmoke, - actions = { - { - type = "direct", - action_delivery = - { - type = "instant", - target_effects = - { - { - type = "create-entity", - entity_name = "acid-splash-purple" - }, - { - type = "create-entity", - entity_name = "acid-splash-mutated" - } - } - } - }, - { - type = "area", - radius = 2, - force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil, - action_delivery = - { - type = "instant", - target_effects = - { - { - type = "damage", - damage = { amount = 5, type = "explosion" } - }, - { - type = "damage", - damage = { amount = 12, type = "acid" } - } - } - } + type = "projectile", + pointEffects = function (attributes) + return { + { + type = "create-entity", + entity_name = "acid-splash-purple" + } } - } -}) + end, + radius = 1.5, + areaEffects = function (attributes) + return + { + { + type = "damage", + damage = { amount = 5, type = "explosion" } + }, + { + type = "damage", + damage = { amount = 12, type = "acid" } + } + } + end + } +) diff --git a/prototypes/utils/BiterUtils.lua b/prototypes/utils/BiterUtils.lua index 0f8b0ed..73d6af0 100755 --- a/prototypes/utils/BiterUtils.lua +++ b/prototypes/utils/BiterUtils.lua @@ -1,5 +1,7 @@ local biterFunctions = {} +local FORCE_OLD_PROJECTILES = settings.startup["rampant-forceOldProjectiles"].value + function biterFunctions.makeSpitterCorpse(attributes) local name = attributes.name .. "-corpse-rampant" data:extend( @@ -603,6 +605,31 @@ function biterFunctions.findTint(entity) return entity.run_animation.layers[2].tint end +function biterFunctions.acidSplashSounds() + return { + type = "play-sound", + sound = + { + { + filename = "__base__/sound/creatures/projectile-acid-burn-1.ogg", + volume = 0.8 + }, + { + filename = "__base__/sound/creatures/projectile-acid-burn-2.ogg", + volume = 0.8 + }, + { + filename = "__base__/sound/creatures/projectile-acid-burn-long-1.ogg", + volume = 0.8 + }, + { + filename = "__base__/sound/creatures/projectile-acid-burn-long-2.ogg", + volume = 0.8 + } + } + } +end + function biterFunctions.createElectricAttack(attributes, electricBeam, animation) return { @@ -631,7 +658,7 @@ function biterFunctions.createElectricAttack(attributes, electricBeam, animation } end -function biterFunctions.createCapsuleAttack(attributes, capsule, animation) +function biterFunctions.createProjectileAttack(attributes, projectile, animation) return { type = "projectile", ammo_category = "capsule", @@ -645,10 +672,12 @@ function biterFunctions.createCapsuleAttack(attributes, capsule, animation) action = { type = "direct", + entity_flags = { "player-creation" }, action_delivery = { type = "projectile", - projectile = capsule or "defender-capsule", + projectile = projectile or "defender-capsule", + entity_flags = { "player-creation" }, starting_speed = attributes.startingSpeed or 0.3, max_range = attributes.maxRange or 20 } @@ -724,7 +753,15 @@ function biterFunctions.biterAttackSounds() } end -function biterFunctions.createStreamAttack(attributes, fireAttack) +function biterFunctions.createRangedAttack(attributes, attack, animation) + if (attributes.type == "stream") or FORCE_OLD_PROJECTILES then + return biterFunctions.createStreamAttack(attributes, attack, animation) + elseif (attributes.type == "projectile") then + return biterFunctions.createProjectileAttack(attributes, attack, animation) + end +end + +function biterFunctions.createStreamAttack(attributes, fireAttack, animation) local attack = { type = "stream", ammo_category = "flamethrower", @@ -778,14 +815,10 @@ function biterFunctions.createStreamAttack(attributes, fireAttack) volume = 0.5 } } - } + }, + animation = animation } - if (attributes.tint ~= nil) then - attack.animation = spitterattackanimation(attributes.scale, - attributes.tint) - end - return attack end diff --git a/prototypes/utils/ProjectileUtils.lua b/prototypes/utils/ProjectileUtils.lua new file mode 100755 index 0000000..97ec070 --- /dev/null +++ b/prototypes/utils/ProjectileUtils.lua @@ -0,0 +1,42 @@ +local projectileUtils = {} + +function projectileUtils.makeProjectile(name, attributes, attack) + local n = name .. "-projectile-rampant" + + data:extend({{ + type = "projectile", + name = n, + flags = {"not-on-map"}, + collision_box = {{-0.3, -1.1}, {0.3, 1.1}}, + collision_mask = attributes.collisionMask or { "water-tile" }, + direction_only = attributes.directionOnly, + piercing_damage = attributes.piercingDamage or 0, + acceleration = attributes.acceleration or 0.005, + action = attack, + animation = + { + filename = "__base__/graphics/entity/acid-projectile-purple/acid-projectile-purple.png", + line_length = 5, + tint = attributes.aTint, + width = 16, + height = 18, + frame_count = 33, + priority = "high" + }, + shadow = + { + filename = "__base__/graphics/entity/acid-projectile-purple/acid-projectile-purple-shadow.png", + line_length = 5, + tint = attributes.aTint, + width = 28, + height = 16, + frame_count = 33, + priority = "high", + shift = {-0.09, 0.395} + }, + rotatable = false + }}) + return n +end + +return projectileUtils diff --git a/prototypes/utils/UpdatesBobs.lua b/prototypes/utils/UpdatesBobs.lua index ee35823..3555028 100755 --- a/prototypes/utils/UpdatesBobs.lua +++ b/prototypes/utils/UpdatesBobs.lua @@ -1,217 +1,246 @@ local bobsUpdates = {} +local FORCE_OLD_PROJECTILES = settings.startup["rampant-forceOldProjectiles"].value + local biterUtils = require("BiterUtils") function bobsUpdates.useDumbProjectiles() local turrets = data.raw["turret"]; - turrets["bob-big-explosive-worm-turret"]["attack_parameters"] = biterUtils.createStreamAttack( - { - cooldown = 60, - range = 26, - min_range = 3, - turn_range = 1, - fire_penalty = 0, - scale = 1.2 - }, - "bob-explosive-ball-stream-rampant") - - turrets["bob-big-fire-worm-turret"]["attack_parameters"] = biterUtils.createStreamAttack( - { - cooldown = 60, - range = 26, - min_range = 3, - turn_range = 1, - fire_penalty = 0, - scale = 1.2 - }, - "bob-fire-ball-stream-rampant") - - turrets["bob-big-poison-worm-turret"]["attack_parameters"] = biterUtils.createStreamAttack( - { - cooldown = 60, - range = 26, - min_range = 3, - turn_range = 1, - fire_penalty = 0, - scale = 1.2 - }, - "bob-poison-ball-stream-rampant") - - turrets["bob-big-piercing-worm-turret"]["attack_parameters"] = biterUtils.createStreamAttack( - { - cooldown = 60, - range = 26, - min_range = 3, - turn_range = 1, - fire_penalty = 0, - scale = 1.2 - }, - "bob-piercing-ball-stream-rampant") + local attackType = (FORCE_OLD_PROJECTILES and "stream") or "projectile" - turrets["bob-big-electric-worm-turret"]["attack_parameters"] = biterUtils.createStreamAttack( + turrets["bob-big-explosive-worm-turret"]["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 60, range = 26, min_range = 3, turn_range = 1, fire_penalty = 0, + type = "projectile", scale = 1.2 }, - "bob-electric-ball-stream-rampant") + "bob-explosive-ball-" .. attackType .. "-rampant") - turrets["bob-giant-worm-turret"]["attack_parameters"] = biterUtils.createStreamAttack( + turrets["bob-big-fire-worm-turret"]["attack_parameters"] = biterUtils.createRangedAttack( + { + cooldown = 60, + range = 26, + min_range = 3, + turn_range = 1, + fire_penalty = 0, + type = "projectile", + scale = 1.2 + }, + "bob-fire-ball-" .. attackType .. "-rampant") + + turrets["bob-big-poison-worm-turret"]["attack_parameters"] = biterUtils.createRangedAttack( + { + cooldown = 60, + range = 26, + min_range = 3, + turn_range = 1, + fire_penalty = 0, + type = "projectile", + scale = 1.2 + }, + "bob-poison-ball-" .. attackType .. "-rampant") + + turrets["bob-big-piercing-worm-turret"]["attack_parameters"] = biterUtils.createRangedAttack( + { + cooldown = 60, + range = 26, + min_range = 3, + turn_range = 1, + fire_penalty = 0, + type = "projectile", + scale = 1.2 + }, + "bob-piercing-ball-" .. attackType .. "-rampant") + + turrets["bob-big-electric-worm-turret"]["attack_parameters"] = biterUtils.createRangedAttack( + { + cooldown = 60, + range = 26, + min_range = 3, + turn_range = 1, + fire_penalty = 0, + type = "projectile", + scale = 1.2 + }, + "bob-electric-ball-" .. attackType .. "-rampant") + + turrets["bob-giant-worm-turret"]["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 60, range = 28, min_range = 3, turn_range = 1, fire_penalty = 0, + type = "projectile", scale = 1.6 }, - "acid-ball-5-stream-rampant") + "acid-ball-5-" .. attackType .. "-rampant") - turrets["bob-behemoth-worm-turret"]["attack_parameters"] = biterUtils.createStreamAttack( + turrets["bob-behemoth-worm-turret"]["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 60, range = 30, min_range = 3, turn_range = 1, fire_penalty = 0, + type = "projectile", scale = 2 }, - "acid-ball-6-stream-rampant") + "acid-ball-6-" .. attackType .. "-rampant") local units = data.raw["unit"] local unit = units["behemoth-spitter"] - unit["attack_parameters"] = biterUtils.createStreamAttack( + unit["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 90, range = 16, min_range = 3, turn_range = 1, warmup = 30, + type = "projectile", fire_penalty = 15, - scale = biterUtils.findRunScale(unit), - tint = biterUtils.findTint(unit) + scale = biterUtils.findRunScale(unit) }, - "acid-ball-3-stream-rampant") + "acid-ball-3-" .. attackType .. "-rampant", + spitterattackanimation(biterUtils.findRunScale(unit), + biterUtils.findTint(unit))) unit = units["bob-big-electric-spitter"] - unit["attack_parameters"] = biterUtils.createStreamAttack( + unit["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 90, range = 15, min_range = 3, turn_range = 1, damageModifier = 0.6, + type = "projectile", warmup = 30, fire_penalty = 0, - scale = biterUtils.findRunScale(unit), - tint = biterUtils.findTint(unit) + scale = biterUtils.findRunScale(unit) }, - "bob-electric-ball-stream-rampant") + "bob-electric-ball-" .. attackType .. "-rampant", + spitterattackanimation(biterUtils.findRunScale(unit), + biterUtils.findTint(unit))) unit = units["bob-huge-explosive-spitter"] - unit["attack_parameters"] = biterUtils.createStreamAttack( + unit["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 90, range = 16, min_range = 3, + type = "projectile", warmup = 30, turn_range = 1, damageModifier = 0.8, fire_penalty = 15, - scale = biterUtils.findRunScale(unit), - tint = biterUtils.findTint(unit) + scale = biterUtils.findRunScale(unit) }, - "bob-explosive-ball-stream-rampant") + "bob-explosive-ball-" .. attackType .. "-rampant", + spitterattackanimation(biterUtils.findRunScale(unit), + biterUtils.findTint(unit))) unit = units["bob-huge-acid-spitter"] - unit["attack_parameters"] = biterUtils.createStreamAttack( - { - cooldown = 90, - range = 16, - min_range = 3, - turn_range = 1, + unit["attack_parameters"] = biterUtils.createRangedAttack( + { + cooldown = 90, + range = 16, + min_range = 3, + type = "projectile", + turn_range = 1, warmup = 30, - fire_penalty = 15, - scale = biterUtils.findRunScale(unit), - tint = biterUtils.findTint(unit) - }, - "wide-acid-ball-stream-rampant") + fire_penalty = 15, + scale = biterUtils.findRunScale(unit) + }, + "wide-acid-ball-" .. attackType .. "-rampant", + spitterattackanimation(biterUtils.findRunScale(unit), + biterUtils.findTint(unit))) unit = units["bob-giant-fire-spitter"] - unit["attack_parameters"] = biterUtils.createStreamAttack( - { - cooldown = 90, - range = 16, - min_range = 3, - turn_range = 1, + unit["attack_parameters"] = biterUtils.createRangedAttack( + { + cooldown = 90, + range = 16, + type = "projectile", + min_range = 3, + turn_range = 1, warmup = 30, - fire_penalty = 15, - scale = biterUtils.findRunScale(unit), - tint = biterUtils.findTint(unit) - }, - "bob-fire-ball-stream-rampant") + fire_penalty = 15, + scale = biterUtils.findRunScale(unit) + }, + "bob-fire-ball-" .. attackType .. "-rampant", + spitterattackanimation(biterUtils.findRunScale(unit), + biterUtils.findTint(unit))) unit = units["bob-giant-poison-spitter"] - unit["attack_parameters"] = biterUtils.createStreamAttack( - { - cooldown = 90, - range = 16, - min_range = 3, - turn_range = 1, + unit["attack_parameters"] = biterUtils.createRangedAttack( + { + cooldown = 90, + range = 16, + type = "projectile", + min_range = 3, + turn_range = 1, warmup = 30, - fire_penalty = 15, - scale = biterUtils.findRunScale(unit), - tint = biterUtils.findTint(unit) - }, - "bob-poison-ball-stream-rampant") - + fire_penalty = 15, + scale = biterUtils.findRunScale(unit) + }, + "bob-poison-ball-" .. attackType .. "-rampant", + spitterattackanimation(biterUtils.findRunScale(unit), + biterUtils.findTint(unit))) + unit = units["bob-titan-spitter"] - unit["attack_parameters"] = biterUtils.createStreamAttack( - { - cooldown = 90, - range = 16, - min_range = 3, - turn_range = 1, + unit["attack_parameters"] = biterUtils.createRangedAttack( + { + cooldown = 90, + range = 16, + type = "projectile", + min_range = 3, + turn_range = 1, warmup = 30, - fire_penalty = 15, - scale = biterUtils.findRunScale(unit), - tint = biterUtils.findTint(unit) - }, - "bob-titan-ball-stream-rampant") + fire_penalty = 15, + scale = biterUtils.findRunScale(unit) + }, + "bob-titan-ball-" .. attackType .. "-rampant", + spitterattackanimation(biterUtils.findRunScale(unit), + biterUtils.findTint(unit))) unit = units["bob-behemoth-spitter"] - unit["attack_parameters"] = biterUtils.createStreamAttack( - { - cooldown = 90, - range = 16, - min_range = 3, - turn_range = 1, + unit["attack_parameters"] = biterUtils.createRangedAttack( + { + cooldown = 90, + range = 16, + type = "projectile", + min_range = 3, + turn_range = 1, warmup = 30, - fire_penalty = 15, - scale = biterUtils.findRunScale(unit), - tint = biterUtils.findTint(unit) - }, - "bob-behemoth-ball-stream-rampant") + fire_penalty = 15, + scale = biterUtils.findRunScale(unit) + }, + "bob-behemoth-ball-" .. attackType .. "-rampant", + spitterattackanimation(biterUtils.findRunScale(unit), + biterUtils.findTint(unit))) + - unit = units["bob-leviathan-spitter"] - unit["attack_parameters"] = biterUtils.createStreamAttack( - { - cooldown = 90, - range = 17, - min_range = 3, + unit["attack_parameters"] = biterUtils.createRangedAttack( + { + cooldown = 90, + type = "projectile", + range = 17, + min_range = 3, warmup = 30, - turn_range = 1, - fire_penalty = 15, - scale = biterUtils.findRunScale(unit), - tint = biterUtils.findTint(unit) - }, - "bob-leviathan-ball-stream-rampant") + turn_range = 1, + fire_penalty = 15, + scale = biterUtils.findRunScale(unit) + }, + "bob-leviathan-ball-" .. attackType .. "-rampant", + spitterattackanimation(biterUtils.findRunScale(unit), + biterUtils.findTint(unit))) end return bobsUpdates diff --git a/prototypes/utils/UpdatesNE.lua b/prototypes/utils/UpdatesNE.lua index 36c5a02..93a0d79 100755 --- a/prototypes/utils/UpdatesNE.lua +++ b/prototypes/utils/UpdatesNE.lua @@ -1,11 +1,15 @@ local NEUpdates = {} +local FORCE_OLD_PROJECTILES = settings.startup["rampant-forceOldProjectiles"].value + local biterUtils = require("BiterUtils") function NEUpdates.useNEUnitLaunchers () local turrets = data.raw["turret"]; + + local attackType = (FORCE_OLD_PROJECTILES and "stream") or "projectile" - turrets["medium-worm-turret"]["attack_parameters"] = biterUtils.createStreamAttack( + turrets["medium-worm-turret"]["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 60, range = 25, @@ -15,9 +19,9 @@ function NEUpdates.useNEUnitLaunchers () damageModifier = 2.5, scale = 1.2 }, - "ne-infected-unit-ball-stream-rampant") + "ne-infected-unit-ball-" .. attackType .. "-rampant") - turrets["big-worm-turret"]["attack_parameters"] = biterUtils.createStreamAttack( + turrets["big-worm-turret"]["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 60, range = 30, @@ -27,18 +31,20 @@ function NEUpdates.useNEUnitLaunchers () damageModifier = 3, scale = 1.6 }, - "ne-mutated-unit-ball-stream-rampant") + "ne-mutated-unit-ball-" .. attackType .. "-rampant") end function NEUpdates.useDumbProjectiles() local turrets = data.raw["turret"]; + local attackType = (FORCE_OLD_PROJECTILES and "stream") or "projectile" + local turret = turrets["small-worm-turret"] turret["attack_parameters"].range = 19 turret = turrets["medium-worm-turret"] turret["attack_parameters"].range = 22 - turret["attack_parameters"] = biterUtils.createStreamAttack( + turret["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 60, range = 25, @@ -48,11 +54,11 @@ function NEUpdates.useDumbProjectiles() damageModifier = 4.5, scale = 1.2 }, - "ne-infected-ball-stream-rampant") + "ne-infected-ball-" .. attackType .. "-rampant") turret = turrets["big-worm-turret"] turret["attack_parameters"].range = 27 - turret["attack_parameters"] = biterUtils.createStreamAttack( + turret["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 60, range = 30, @@ -62,12 +68,12 @@ function NEUpdates.useDumbProjectiles() damageModifier = 5.5, scale = 1.6 }, - "ne-mutated-ball-stream-rampant") + "ne-mutated-ball-" .. attackType .. "-rampant") local units = data.raw["unit"] local unit = units["small-spitter-Mk2"] - unit["attack_parameters"] = biterUtils.createStreamAttack( + unit["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 100, range = 13, @@ -79,10 +85,10 @@ function NEUpdates.useDumbProjectiles() scale = biterUtils.findRunScale(unit), tint = biterUtils.findTint(unit) }, - "ne-infected-ball-stream-rampant") + "ne-infected-ball-" .. attackType .. "-rampant") unit = units["small-spitter-Mk3"] - unit["attack_parameters"] = biterUtils.createStreamAttack( + unit["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 100, range = 13, @@ -94,11 +100,11 @@ function NEUpdates.useDumbProjectiles() scale = biterUtils.findRunScale(unit), tint = biterUtils.findTint(unit) }, - "ne-mutated-ball-stream-rampant") + "ne-mutated-ball-" .. attackType .. "-rampant") unit = units["medium-spitter-Mk2"] - unit["attack_parameters"] = biterUtils.createStreamAttack( + unit["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 100, range = 14, @@ -110,10 +116,10 @@ function NEUpdates.useDumbProjectiles() scale = biterUtils.findRunScale(unit), tint = biterUtils.findTint(unit) }, - "ne-infected-ball-stream-rampant") + "ne-infected-ball-" .. attackType .. "-rampant") unit = units["medium-spitter-Mk3"] - unit["attack_parameters"] = biterUtils.createStreamAttack( + unit["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 100, range = 14, @@ -125,10 +131,10 @@ function NEUpdates.useDumbProjectiles() scale = biterUtils.findRunScale(unit), tint = biterUtils.findTint(unit) }, - "ne-mutated-ball-stream-rampant") + "ne-mutated-ball-" .. attackType .. "-rampant") unit = units["big-spitter-Mk2"] - unit["attack_parameters"] = biterUtils.createStreamAttack( + unit["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 100, range = 15, @@ -140,11 +146,11 @@ function NEUpdates.useDumbProjectiles() scale = biterUtils.findRunScale(unit), tint = biterUtils.findTint(unit) }, - "ne-infected-ball-stream-rampant") + "ne-infected-ball-" .. attackType .. "-rampant") unit = units["big-spitter-Mk3"] - unit["attack_parameters"] = biterUtils.createStreamAttack( + unit["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 100, range = 15, @@ -156,7 +162,7 @@ function NEUpdates.useDumbProjectiles() scale = biterUtils.findRunScale(unit), tint = biterUtils.findTint(unit) }, - "ne-mutated-ball-stream-rampant") + "ne-mutated-ball-" .. attackType .. "-rampant") end diff --git a/prototypes/utils/UpdatesVanilla.lua b/prototypes/utils/UpdatesVanilla.lua index f05d8ec..8fe424b 100755 --- a/prototypes/utils/UpdatesVanilla.lua +++ b/prototypes/utils/UpdatesVanilla.lua @@ -1,103 +1,118 @@ local vanillaUpdates = {} +local FORCE_OLD_PROJECTILES = settings.startup["rampant-forceOldProjectiles"].value + local biterUtils = require("BiterUtils") function vanillaUpdates.useDumbProjectiles() local turrets = data.raw["turret"]; - turrets["small-worm-turret"]["attack_parameters"] = biterUtils.createStreamAttack( + local attackType = (FORCE_OLD_PROJECTILES and "stream") or "projectile" + + turrets["small-worm-turret"]["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 60, range = 21, min_range = 5, turn_range = 1, + type = "projectile", fire_penalty = 0, damageModifier = 0.9, scale = 0.8 }, - "acid-ball-2-stream-rampant") + "acid-ball-2-" .. attackType .. "-rampant") - turrets["medium-worm-turret"]["attack_parameters"] = biterUtils.createStreamAttack( + turrets["medium-worm-turret"]["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 60, range = 25, min_range = 3, turn_range = 1, + type = "projectile", fire_penalty = 0, damageModifier = 0.87, scale = 1 }, - "acid-ball-3-stream-rampant") + "acid-ball-3-" .. attackType .. "-rampant") - turrets["big-worm-turret"]["attack_parameters"] = biterUtils.createStreamAttack( + turrets["big-worm-turret"]["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 60, range = 26, min_range = 3, + type = "projectile", turn_range = 1, fire_penalty = 0, scale = 1.2 }, - "acid-ball-4-stream-rampant") + "acid-ball-4-" .. attackType .. "-rampant") local units = data.raw["unit"]; local unit = units["small-spitter"] - unit["attack_parameters"] = biterUtils.createStreamAttack( + unit["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 100, range = 13, warmup = 30, min_range = 3, turn_range = 1, + type = "projectile", fire_penalty = 15, - scale = biterUtils.findRunScale(unit), - tint = biterUtils.findTint(unit) + scale = biterUtils.findRunScale(unit) }, - "acid-ball-stream-rampant") + "acid-ball-" .. attackType .. "-rampant", + spitterattackanimation(biterUtils.findRunScale(unit), + biterUtils.findTint(unit))) unit = units["medium-spitter"] - unit["attack_parameters"] = biterUtils.createStreamAttack( + unit["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 95, range = 14, min_range = 3, + type = "projectile", warmup = 30, turn_range = 1, fire_penalty = 15, - scale = biterUtils.findRunScale(unit), - tint = biterUtils.findTint(unit) + scale = biterUtils.findRunScale(unit) }, - "acid-ball-1-stream-rampant") + "acid-ball-1-" .. attackType .. "-rampant", + spitterattackanimation(biterUtils.findRunScale(unit), + biterUtils.findTint(unit))) unit = units["big-spitter"] - unit["attack_parameters"] = biterUtils.createStreamAttack( + unit["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 90, range = 15, min_range = 3, + type = "projectile", warmup = 30, turn_range = 1, fire_penalty = 15, - scale = biterUtils.findRunScale(unit), - tint = biterUtils.findTint(unit) + scale = biterUtils.findRunScale(unit) }, - "acid-ball-2-stream-rampant") + "acid-ball-2-" .. attackType .. "-rampant", + spitterattackanimation(biterUtils.findRunScale(unit), + biterUtils.findTint(unit))) unit = units["behemoth-spitter"] - unit["attack_parameters"] = biterUtils.createStreamAttack( + unit["attack_parameters"] = biterUtils.createRangedAttack( { cooldown = 90, range = 16, min_range = 3, warmup = 30, + type = "projectile", turn_range = 1, fire_penalty = 15, - scale = biterUtils.findRunScale(unit), - tint = biterUtils.findTint(unit) + scale = biterUtils.findRunScale(unit) }, - "acid-ball-3-stream-rampant") + "acid-ball-3-" .. attackType .. "-rampant", + spitterattackanimation(biterUtils.findRunScale(unit), + biterUtils.findTint(unit))) end return vanillaUpdates diff --git a/settings.lua b/settings.lua index 858595a..9a5e29f 100755 --- a/settings.lua +++ b/settings.lua @@ -18,6 +18,15 @@ data:extend({ order = "a[modifier]-b[projectiles]", per_user = false }, + + { + type = "bool-setting", + name = "rampant-forceOldProjectiles", + setting_type = "startup", + default_value = false, + order = "a[modifier]-b[projectiles]", + per_user = false + }, { type = "bool-setting",