1
0
mirror of https://github.com/veden/Rampant.git synced 2025-02-05 13:14:51 +02:00

poison, only spawner and wasp

This commit is contained in:
Aaron Veden 2019-11-12 21:21:55 -08:00
parent 1a0bb856a7
commit af99d18d3f
5 changed files with 90 additions and 264 deletions

View File

@ -1,6 +1,6 @@
---------------------------------------------------------------------------------------------------
Version: 0.17.29
Date: 10. 13. 2019
Date: 11. 12. 2019
Improvements:
- Pathfinding now looks two steps ahead
- Squad formation now has a gathering delay to allow all members to make the initial group
@ -15,6 +15,7 @@ Date: 10. 13. 2019
- Added blood color to match new enemy color
- Added blood explosions to each new enemy
- Nuclear biters have more visual explosions
- Changed poison biter death cloud to be generated using dying_trigger_effect
Optimizations:
- Better object reuse for squad and pending attack, creating less garbage
- Trimmed table creation where possible

View File

@ -76,7 +76,7 @@ local DEFINES_WIRE_TYPE_GREEN = defines.wire_type.green
local ENERGY_THIEF_CONVERSION_TABLE = constants.ENERGY_THIEF_CONVERSION_TABLE
local ENERGY_THIEF_LOOKUP = constants.ENERGY_THIEF_LOOKUP
local POISON_LOOKUP = constants.POISON_LOOKUP
-- local POISON_LOOKUP = constants.POISON_LOOKUP
-- imported functions
@ -675,12 +675,12 @@ local function onDeath(event)
end
end
local cloudName = POISON_LOOKUP[entity.name]
-- local cloudName = POISON_LOOKUP[entity.name]
if cloudName then
surface.create_entity({position=entity.position,
name=cloudName})
end
-- if cloudName then
-- surface.create_entity({position=entity.position,
-- name=cloudName})
-- end
elseif event.force and (event.force.name ~= "enemy") and ((entityType == "unit-spawner") or (entityType == "turret")) then

View File

@ -618,16 +618,16 @@ for tier=1, 10 do
end
end
constants.POISON_LOOKUP = {}
-- constants.POISON_LOOKUP = {}
for tier=1, 10 do
local effectiveLevel = constants.TIER_UPGRADE_SET_10[tier]
for i=1,variations do
constants.POISON_LOOKUP["poison-biter-v" .. i .. "-t" .. tier .. "-rampant"] = "poison-cloud-v" .. effectiveLevel .. "-cloud-rampant"
end
end
-- for tier=1, 10 do
-- local effectiveLevel = constants.TIER_UPGRADE_SET_10[tier]
-- for i=1,variations do
-- constants.POISON_LOOKUP["poison-biter-v" .. i .. "-t" .. tier .. "-rampant"] = "poison-cloud-v" .. effectiveLevel .. "-cloud-rampant"
-- end
-- end
constants.SPAWNER_EGG_TIMEOUT = constants.TICKS_A_SECOND * 5
-- constants.SPAWNER_EGG_TIMEOUT = constants.TICKS_A_SECOND * 5
constants.FACTION_SET = {}
@ -1095,6 +1095,51 @@ if settings.startup["rampant-trollEnemy"].value then
}
end
if settings.startup["rampant-poisonEnemy"].value then
constants.FACTION_SET[#constants.FACTION_SET+1] = {
type = "poison",
tint = {r=0.4, g=0.6, b=0.5, a=1},
tint2 = {r=0, g=0.7, b=0, a=1},
evo = 0.17,
units = {
{
type = "biter",
attackAttributes = {"melee"},
name = "biter",
minorResistances = {"fire"},
majorResistances = {"poison"},
minorWeaknesses = {"electric", "explosion", "laser"},
attributes = {"poisonDeathCloud"},
drops = {"greenArtifact"}
}
},
buildings = {
{
type = "biter-spawner",
name = "biter-spawner",
minorResistances = {"fire"},
majorResistances = {"poison"},
minorWeaknesses = {"electric", "explosion", "laser"},
attributes = {"poisonDeathCloud"},
drops = {"greenArtifact"},
buildSets = {
{"biter", 1, 10}
}
},
{
type = "turret",
name = "worm",
minorResistances = {"fire"},
majorResistances = {"poison"},
minorWeaknesses = {"electric", "explosion", "laser"},
attackAttributes = {"spit", "poison"},
attributes = {"poisonDeathCloud"},
drops = {"greenArtifact"}
}
}
}
end
if settings.startup["rampant-suicideEnemy"].value then
constants.FACTION_SET[#constants.FACTION_SET+1] = {
type = "suicide",

View File

@ -1,11 +1,6 @@
-- imports
local physicalBall = require("utils/AttackBall")
local biterUtils = require("utils/BiterUtils")
local smokeUtils = require("utils/SmokeUtils")
local swarmUtils = require("SwarmUtils")
local constants = require("__Rampant__/libs/Constants")
local particleUtils = require("utils/ParticleUtils")
-- constants
@ -13,60 +8,10 @@ local poison = {}
-- imported functions
local makeBloodFountains = particleUtils.makeBloodFountains
local buildUnitSpawner = swarmUtils.buildUnitSpawner
local buildWorm = swarmUtils.buildWorm
local createAttackBall = physicalBall.createAttackBall
local createRangedAttack = biterUtils.createRangedAttack
local createMeleeAttack = biterUtils.createMeleeAttack
local makeCloud = smokeUtils.makeCloud
local makeUnitAlienLootTable = biterUtils.makeUnitAlienLootTable
local makeSpawnerAlienLootTable = biterUtils.makeSpawnerAlienLootTable
local makeWormAlienLootTable = biterUtils.makeWormAlienLootTable
local function evolutionFunction(tier)
if (tier == 0) then
return 0
else
return 0.15 + ((tier - 2) * 0.10)
end
end
function poison.addFaction()
local biterLoot = makeUnitAlienLootTable("green")
local spawnerLoot = makeSpawnerAlienLootTable("green")
local wormLoot = makeWormAlienLootTable("green")
data:extend({
{
type = "damage-type",
name = "healing"
}
})
local bloodFountains = {
type = "attribute",
mapping = "explosion",
[1] = "poison-blood-explosion-small-rampant",
[2] = "poison-blood-explosion-small-rampant",
[3] = "poison-blood-explosion-small-rampant",
[4] = "poison-blood-explosion-small-rampant",
[5] = "poison-blood-explosion-big-rampant",
[6] = "poison-blood-explosion-big-rampant",
[7] = "poison-blood-explosion-big-rampant",
[8] = "poison-blood-explosion-huge-rampant",
[9] = "poison-blood-explosion-huge-rampant",
[10] = "poison-blood-explosion-huge-rampant",
}
makeBloodFountains({
name = "poison",
tint = {r=0, g=0.7, b=0, a=1}
})
function poison.addFactionAddon()
for i=1,10 do
makeCloud(
{
@ -122,196 +67,7 @@ function poison.addFaction()
}
)
end
-- data:extend({
-- {
-- type = "explosion",
-- name = "poisonTester",
-- flags = {"not-on-map"},
-- animations =
-- {
-- {
-- filename = "__core__/graphics/empty.png",
-- priority = "high",
-- width = 1,
-- height = 1,
-- frame_count = 1
-- }
-- },
-- created_effect =
-- {
-- type = "direct",
-- action_delivery =
-- {
-- type = "instant",
-- target_effects =
-- {
-- {
-- type = "create-entity",
-- entity_name = "assembling-machine-1"
-- }
-- }
-- }
-- }
-- }
-- })
-- poison biters
buildUnitSpawner(
{
unit = {
name = "poison-biter",
loot = biterLoot,
attributes = {
},
attack = {
damageType = "poison"
},
resistances = {},
type = "biter",
tint = {r=0.4, g=0.6, b=0.5, a=1},
tint2 = {r=0, g=0.7, b=0, a=1}
},
unitSpawner = {
name = "poison-biter-spawner",
loot = spawnerLoot,
attributes = {},
resistances = {},
tint = {r=0.4, g=0.6, b=0.5, a=1},
tint2 = {r=0, g=0.7, b=0, a=1}
}
},
{
unit = {
bloodFountains,
{
type = "majorResistances",
entries = {"poison"}
},
{
type = "minorResistances",
entries = {"fire"}
},
{
type = "minorWeaknesses",
entries = {"electric", "explosion", "laser"}
}
},
unitSpawner = {
bloodFountains,
{
type = "attribute",
name = "evolutionRequirement",
formula = evolutionFunction
},
{
type = "majorResistances",
entries = {"poison"}
},
{
type = "minorResistances",
entries = {"fire"}
},
{
type = "minorWeaknesses",
entries = {"electric", "explosion", "laser"}
}
}
},
createMeleeAttack
)
-- poison worms
buildWorm(
{
name = "poison-worm",
loot = wormLoot,
attributes = {
},
attack = {
type = "projectile",
damageType = "poison",
pointEffects = function(attributes)
return
{
{
type="create-entity",
entity_name = attributes.cloud
}
}
end
},
resistances = {},
attackName = "poison-worm",
tint = {r=0.4, g=0.6, b=0.5, a=1},
tint2 = {r=0, g=0.7, b=0, a=1}
},
{
bloodFountains,
{
type = "attack",
mapping = "cloud",
[1] = "poison-cloud-v1-cloud-rampant",
[2] = "poison-cloud-v2-cloud-rampant",
[3] = "poison-cloud-v3-cloud-rampant",
[4] = "poison-cloud-v4-cloud-rampant",
[5] = "poison-cloud-v5-cloud-rampant",
[6] = "poison-cloud-v6-cloud-rampant",
[7] = "poison-cloud-v7-cloud-rampant",
[8] = "poison-cloud-v8-cloud-rampant",
[9] = "poison-cloud-v9-cloud-rampant",
[10] = "poison-cloud-v10-cloud-rampant"
},
{
type = "attribute",
name = "evolutionRequirement",
formula = evolutionFunction
},
{
type = "majorResistances",
entries = {"poison"}
},
{
type = "minorResistances",
entries = {"fire"}
},
{
type = "minorWeaknesses",
entries = {"electric", "explosion", "laser"}
}
},
function (attack, attributes, tier)
return createRangedAttack(attack,
createAttackBall(attack))
end
)
end
return poison

View File

@ -3,7 +3,8 @@ local swarmUtils = {}
local bombUtils = require("utils/BombUtils")
local attackFlame = require("utils/AttackFlame")
local energyThief = require("EnergyThief")
local energyThiefFaction = require("EnergyThief")
local poisonFaction = require("Poison")
local beamUtils = require("utils/BeamUtils")
local acidBall = require("utils/AttackBall")
local droneUtils = require("utils/DroneUtils")
@ -16,7 +17,8 @@ local mathUtils = require("__Rampant__/libs/MathUtils")
-- imported functions
local addFactionAddon = energyThief.addFactionAddon
local addFactionAddon = energyThiefFaction.addFactionAddon
local addFactionAddon = poisonFaction.addFactionAddon
local roundToNearest = mathUtils.roundToNearest
@ -517,6 +519,11 @@ local function fillEntityTemplate(entity)
entity["scale"] = entity["scale"] * 1.35
elseif (attribute == "highHealth") then
entity["health"] = entity["health"] * 1.20
elseif (attribute == "poisonDeathCloud") then
entity.dyingEffect = {
type = "create-entity",
entity_name = "poison-cloud-v" .. tier .. "-cloud-rampant"
}
elseif (attribute == "highestHealth") then
entity["health"] = entity["health"] * 1.35
else
@ -801,6 +808,15 @@ local function buildAttack(faction, template)
template.damageType = "poison"
template.fireDamagePerTickType = "poison"
template.stickerDamagePerTickType = "poison"
template.attackPointEffects = function(attributes)
return
{
{
type="create-entity",
entity_name = "poison-cloud-v" .. attributes.effectiveLevel .. "-cloud-rampant"
}
}
end
elseif (attack == "stream") then
template.addon[#template.addon+1] = streamAttackNumeric
template.attackGenerator = function (attack)
@ -1083,7 +1099,15 @@ function swarmUtils.processFactions()
local faction = constants.FACTION_SET[i]
if (faction.type == "energy-thief") then
energyThief.addFactionAddon()
energyThiefFaction.addFactionAddon()
elseif (faction.type == "poison") then
data:extend({
{
type = "damage-type",
name = "healing"
}
})
poisonFaction.addFactionAddon()
end
makeBloodFountains({