1
0
mirror of https://github.com/veden/Rampant.git synced 2025-03-11 14:49:32 +02:00

finish infernos, trolls, fast, laser, wasp, decaying, undying

This commit is contained in:
Aaron Veden 2018-01-21 23:13:18 -08:00
parent 326e7c1df0
commit d6685f3cb6
25 changed files with 13249 additions and 4720 deletions

View File

@ -169,6 +169,8 @@ function upgrade.attempt(natives)
squad.chunk = nil
end
natives.evolutionTableUnitSpawner = {}
natives.evolutionTableWorm = {}
natives.bases = {}
natives.baseIndex = 1
natives.baseIncrement = 0

View File

@ -160,8 +160,6 @@ local function rebuildMap()
map.chunkToResource = {}
map.chunkToPassScan = {}
map.chunkToSquad = {}
natives.bases = {}
-- preallocating memory to be used in code, making it fast by reducing garbage generated.
map.neighbors = { SENTINEL_IMPASSABLE_CHUNK,
@ -187,7 +185,8 @@ local function rebuildMap()
map.countResourcesQuery = { area=map.area, type="resource" }
map.filteredEntitiesEnemyQuery = { area=map.area, force="enemy" }
map.filteredEntitiesEnemyUnitQuery = { area=map.area, force="enemy", type="unit", limit=301 }
map.filteredEntitiesEnemyTypeQuery = { area=map.area, force="enemy", type="unit-spawner" }
map.filteredEntitiesUnitSpawnereQuery = { area=map.area, force="enemy", type="unit-spawner" }
map.filteredEntitiesWormQuery = { area=map.area, force="enemy", type="turret" }
map.filteredEntitiesSpawnerQueryLimited = { area=map.area2, force="enemy", type="unit-spawner" }
map.filteredEntitiesWormQueryLimited = { area=map.area2, force="enemy", type="turret" }
map.filteredEntitiesPlayerQuery = { area=map.area, force="player" }
@ -266,9 +265,8 @@ local function onModSettingsChange(event)
upgrade.compareTable(natives, "aiNocturnalMode", settings.global["rampant-permanentNocturnal"].value)
upgrade.compareTable(natives, "aiPointsScaler", settings.global["rampant-aiPointsScaler"].value)
if upgrade.compareTable(natives, "enemySeed", settings.startup["rampant-enemySeed"].value) then
rebuildNativeTables()
end
upgrade.compareTable(natives, "enemySeed", settings.startup["rampant-enemySeed"].value)
-- RE-ENABLE WHEN COMPLETE
natives.useCustomAI = constants.DEV_CUSTOM_AI
-- changed, newValue = upgrade.compareTable(natives, "useCustomAI", settings.startup["rampant-useCustomAI"].value)
@ -289,7 +287,7 @@ local function onConfigChanged()
upgraded, natives = upgrade.attempt(natives)
if upgraded and onModSettingsChange(nil) then
rebuildMap()
rebuildNativeTables()
rebuildNativeTables(natives, game.surfaces[1])
end
end

View File

@ -4,17 +4,21 @@ if settings.startup["rampant-useDumbProjectiles"].value then
acidBall.generateLegacy()
end
-- require("prototypes/enemies/AttackAcidFlame")
-- require("prototypes/buildings/tunnel")
require("prototypes/buildings/ChunkScanner")
-- require("prototypes/tile/fillableDirt")
if settings.startup["rampant-newEnemies"].value then
require("prototypes/Neutral")
require("prototypes/Acid")
require("prototypes/Physical")
require("prototypes/Suicide")
require("prototypes/Fire")
require("prototypes/Inferno")
require("prototypes/Nuclear")
-- require("prototypes/Fast")
-- require("prototypes/Troll")
-- require("prototypes/Decaying")
-- require("prototypes/Undying")
-- require("prototypes/Wasp")
-- require("prototypes/Laser")
require("prototypes/Electric")
end
-- require("prototypes/enemies/UnitSuicideBiters")
-- require("prototypes/enemies/UnitFireSpitters")
-- require("prototypes/enemies/UnitTendril")

View File

@ -15,17 +15,38 @@ local NEUTRAL_WORM_VARIATIONS = constants.NEUTRAL_WORM_VARIATIONS
local NEUTRAL_NEST_TIERS = constants.NEUTRAL_NEST_TIERS
local NEUTRAL_NEST_VARIATIONS = constants.NEUTRAL_NEST_VARIATIONS
local PHYSICAL_WORM_TIERS = constants.PHYSICAL_WORM_TIERS
local PHYSICAL_WORM_VARIATIONS = constants.PHYSICAL_WORM_VARIATIONS
local PHYSICAL_NEST_TIERS = constants.PHYSICAL_NEST_TIERS
local PHYSICAL_NEST_VARIATIONS = constants.PHYSICAL_NEST_VARIATIONS
local ELECTRIC_WORM_TIERS = constants.ELECTRIC_WORM_TIERS
local ELECTRIC_WORM_VARIATIONS = constants.ELECTRIC_WORM_VARIATIONS
local ELECTRIC_NEST_TIERS = constants.ELECTRIC_NEST_TIERS
local ELECTRIC_NEST_VARIATIONS = constants.ELECTRIC_NEST_VARIATIONS
local ACID_WORM_TIERS = constants.ACID_WORM_TIERS
local ACID_WORM_VARIATIONS = constants.ACID_WORM_VARIATIONS
local ACID_NEST_TIERS = constants.ACID_NEST_TIERS
local ACID_NEST_VARIATIONS = constants.ACID_NEST_VARIATIONS
local SUICIDE_BITER_NEST_TIERS = constants.SUICIDE_BITER_NEST_TIERS
local SUICIDE_BITER_NEST_VARIATIONS = constants.SUICIDE_BITER_NEST_VARIATIONS
local SUICIDE_WORM_TIERS = constants.SUICIDE_WORM_TIERS
local SUICIDE_WORM_VARIATIONS = constants.SUICIDE_WORM_VARIATIONS
local SUICIDE_NEST_TIERS = constants.SUICIDE_NEST_TIERS
local SUICIDE_NEST_VARIATIONS = constants.SUICIDE_NEST_VARIATIONS
local NUCLEAR_WORM_TIERS = constants.NUCLEAR_WORM_TIERS
local NUCLEAR_WORM_VARIATIONS = constants.NUCLEAR_WORM_VARIATIONS
local NUCLEAR_NEST_TIERS = constants.NUCLEAR_NEST_TIERS
local NUCLEAR_NEST_VARIATIONS = constants.NUCLEAR_NEST_VARIATIONS
local BASE_ALIGNMENT_NEUTRAL = constants.BASE_ALIGNMENT_NEUTRAL
local BASE_ALIGNMENT_ACID = constants.BASE_ALIGNMENT_ACID
local BASE_ALIGNMENT_ELECTRIC = constants.BASE_ALIGNMENT_ELECTRIC
local BASE_ALIGNMENT_PHYSICAL = constants.BASE_ALIGNMENT_PHYSICAL
local BASE_ALIGNMENT_SUICIDE = constants.BASE_ALIGNMENT_SUICIDE
local BASE_ALIGNMENT_NUCLEAR = constants.BASE_ALIGNMENT_NUCLEAR
local BASE_WORM_UPGRADE = constants.BASE_WORM_UPGRADE
local BASE_SPAWNER_UPGRADE = constants.BASE_SPAWNER_UPGRADE
@ -115,9 +136,13 @@ local function findUpgrade(base, evoIndex, natives, evolutionTable)
-- while alignmentPick do
-- used[alignmentPick] = true
if not evolutionTable then
print(alignmentPick)
end
for evo=evoIndex, 0, -EVOLUTION_INCREMENTS do
local entitySet = evolutionTable[alignmentPick][evo]
if (#entitySet > 0) then
if entitySet and (#entitySet > 0) then
return entitySet[mRandom(#entitySet)]
end
end
@ -135,28 +160,26 @@ local function findUpgrade(base, evoIndex, natives, evolutionTable)
end
function baseUtils.upgradeEntity(map, entity, surface, natives, evolutionFactor, tick)
if not isRampant(entity.name) then
local position = entity.position
local entityType = entity.type
entity.destroy()
local chunk = getChunkByPosition(map, position)
local base = getChunkBase(map, chunk)
local position = entity.position
local entityType = entity.type
entity.destroy()
local chunk = getChunkByPosition(map, position)
local base = getChunkBase(map, chunk)
if not base then
base = baseUtils.createBase(map, natives, evolutionFactor, chunk, surface, tick)
end
if not base then
base = baseUtils.createBase(map, natives, evolutionFactor, chunk, surface, tick)
end
local distance = roundToFloor(mMin(1,
euclideanDistancePoints(position.x, position.y, 0, 0) * BASE_DISTANCE_TO_EVO_INDEX),
EVOLUTION_INCREMENTS)
local evoIndex = mMax(distance, roundToFloor(evolutionFactor, EVOLUTION_INCREMENTS))
local distance = roundToFloor(mMin(1,
euclideanDistancePoints(position.x, position.y, 0, 0) * BASE_DISTANCE_TO_EVO_INDEX),
EVOLUTION_INCREMENTS)
local evoIndex = mMax(distance, roundToFloor(evolutionFactor, EVOLUTION_INCREMENTS))
local spawnerName = findUpgrade(base, evoIndex, natives, ((entityType == "unit-spawner") and natives.evolutionTableUnitSpawner) or natives.evolutionTableWorm)
if spawnerName then
local newPosition = surface.find_non_colliding_position(spawnerName, position, CHUNK_SIZE, 4)
if newPosition then
entity = surface.create_entity({name = spawnerName, position = newPosition})
end
local spawnerName = findUpgrade(base, evoIndex, natives, ((entityType == "unit-spawner") and natives.evolutionTableUnitSpawner) or natives.evolutionTableWorm)
if spawnerName then
local newPosition = surface.find_non_colliding_position(spawnerName, position, CHUNK_SIZE, 4)
if newPosition then
entity = surface.create_entity({name = spawnerName, position = newPosition})
end
end
@ -213,7 +236,7 @@ function baseUtils.processBase(map, surface, natives, tick, base, evolutionFacto
base.tick = tick
end
function baseUtils.createBase(map, natives, evolutionFactor, chunk, surface, tick, expansion)
function baseUtils.createBase(map, natives, evolutionFactor, chunk, surface, tick)
local x = chunk.x
local y = chunk.y
local distance = euclideanDistancePoints(x, y, 0, 0)
@ -323,8 +346,8 @@ function baseUtils.rebuildNativeTables(natives, surface)
processUnitClass(PHYSICAL_NEST_VARIATIONS,
PHYSICAL_NEST_TIERS,
PHYSICAL_NEST_VARIATIONS,
PHYSICAL_NEST_TIERS,
0,
0,
PHYSICAL_WORM_VARIATIONS,
PHYSICAL_WORM_TIERS,
surface,
@ -332,27 +355,137 @@ function baseUtils.rebuildNativeTables(natives, surface)
BASE_ALIGNMENT_PHYSICAL,
"physical")
processUnitClass(FIRE_NEST_VARIATIONS,
FIRE_NEST_TIERS,
FIRE_NEST_VARIATIONS,
FIRE_NEST_TIERS,
FIRE_WORM_VARIATIONS,
FIRE_WORM_TIERS,
surface,
natives,
BASE_ALIGNMENT_FIRE,
"fire")
-- processUnitClass(FIRE_NEST_VARIATIONS,
-- FIRE_NEST_TIERS,
-- FIRE_NEST_VARIATIONS,
-- FIRE_NEST_TIERS,
-- FIRE_WORM_VARIATIONS,
-- FIRE_WORM_TIERS,
-- surface,
-- natives,
-- BASE_ALIGNMENT_FIRE,
-- "fire")
processUnitClass(ELECTRIC_NEST_VARIATIONS,
ELECTRIC_NEST_TIERS,
ELECTRIC_NEST_VARIATIONS,
ELECTRIC_NEST_TIERS,
0,
0,
ELECTRIC_WORM_VARIATIONS,
ELECTRIC_WORM_TIERS,
surface,
natives,
BASE_ALIGNMENT_ELECTRIC,
"electric")
processUnitClass(SUICIDE_NEST_VARIATIONS,
SUICIDE_NEST_TIERS,
0,
0,
SUICIDE_WORM_VARIATIONS,
SUICIDE_WORM_TIERS,
surface,
natives,
BASE_ALIGNMENT_SUICIDE,
"suicide")
processUnitClass(NUCLEAR_NEST_VARIATIONS,
NUCLEAR_NEST_TIERS,
0,
0,
NUCLEAR_WORM_VARIATIONS,
NUCLEAR_WORM_TIERS,
surface,
natives,
BASE_ALIGNMENT_NUCLEAR,
"nuclear")
-- processUnitClass(TROLL_NEST_VARIATIONS,
-- TROLL_NEST_TIERS,
-- TROLL_NEST_VARIATIONS,
-- TROLL_NEST_TIERS,
-- TROLL_WORM_VARIATIONS,
-- TROLL_WORM_TIERS,
-- surface,
-- natives,
-- BASE_ALIGNMENT_TROLL,
-- "troll")
-- processUnitClass(INFERNO_NEST_VARIATIONS,
-- INFERNO_NEST_TIERS,
-- INFERNO_NEST_VARIATIONS,
-- INFERNO_NEST_TIERS,
-- INFERNO_WORM_VARIATIONS,
-- INFERNO_WORM_TIERS,
-- surface,
-- natives,
-- BASE_ALIGNMENT_INFERNO,
-- "inferno")
-- processUnitClass(FAST_NEST_VARIATIONS,
-- FAST_NEST_TIERS,
-- FAST_NEST_VARIATIONS,
-- FAST_NEST_TIERS,
-- FAST_WORM_VARIATIONS,
-- FAST_WORM_TIERS,
-- surface,
-- natives,
-- BASE_ALIGNMENT_FAST,
-- "fast")
-- processUnitClass(DECAYING_NEST_VARIATIONS,
-- DECAYING_NEST_TIERS,
-- DECAYING_NEST_VARIATIONS,
-- DECAYING_NEST_TIERS,
-- DECAYING_WORM_VARIATIONS,
-- DECAYING_WORM_TIERS,
-- surface,
-- natives,
-- BASE_ALIGNMENT_DECAYING,
-- "decaying")
-- processUnitClass(UNDYING_NEST_VARIATIONS,
-- UNDYING_NEST_TIERS,
-- UNDYING_NEST_VARIATIONS,
-- UNDYING_NEST_TIERS,
-- UNDYING_WORM_VARIATIONS,
-- UNDYING_WORM_TIERS,
-- surface,
-- natives,
-- BASE_ALIGNMENT_UNDYING,
-- "undying")
-- processUnitClass(POSION_NEST_VARIATIONS,
-- POSION_NEST_TIERS,
-- POSION_NEST_VARIATIONS,
-- POSION_NEST_TIERS,
-- POSION_WORM_VARIATIONS,
-- POSION_WORM_TIERS,
-- surface,
-- natives,
-- BASE_ALIGNMENT_POSION,
-- "posion")
-- processUnitClass(LASER_NEST_VARIATIONS,
-- LASER_NEST_TIERS,
-- LASER_NEST_VARIATIONS,
-- LASER_NEST_TIERS,
-- LASER_WORM_VARIATIONS,
-- LASER_WORM_TIERS,
-- surface,
-- natives,
-- BASE_ALIGNMENT_LASER,
-- "laser")
-- processUnitClass(WASP_NEST_VARIATIONS,
-- WASP_NEST_TIERS,
-- WASP_NEST_VARIATIONS,
-- WASP_NEST_TIERS,
-- WASP_WORM_VARIATIONS,
-- WASP_WORM_TIERS,
-- surface,
-- natives,
-- BASE_ALIGNMENT_WASP,
-- "wasp")
end
return baseUtils

View File

@ -53,6 +53,8 @@ local getNestCount = chunkPropertyUtils.getNestCount
local findNearbyBase = baseUtils.findNearbyBase
local createBase = baseUtils.createBase
local upgradeEntity = baseUtils.upgradeEntity
local setChunkBase = chunkPropertyUtils.setChunkBase
local getEnemyStructureCount = chunkPropertyUtils.getEnemyStructureCount
@ -253,13 +255,8 @@ function chunkUtils.scorePlayerBuildings(surface, map, natives)
end
function chunkUtils.scoreEnemyBuildings(surface, map)
local query = map.filteredEntitiesEnemyTypeQuery
query.type = "unit-spawner"
local nests = surface.count_entities_filtered(map.filteredEntitiesEnemyTypeQuery)
query.type = "turret"
local worms = surface.count_entities_filtered(map.filteredEntitiesEnemyTypeQuery)
local nests = surface.find_entities_filtered(map.filteredEntitiesUnitSpawnereQuery)
local worms = surface.find_entities_filtered(map.filteredEntitiesWormQuery)
return nests, worms
end
@ -276,23 +273,33 @@ function chunkUtils.initialScan(chunk, natives, surface, map, tick, evolutionFac
local resources = surface.count_entities_filtered(map.countResourcesQuery) * 0.001
if ((playerObjects > 0) or (nests > 0)) and (pass == CHUNK_IMPASSABLE) then
if ((playerObjects > 0) or (#nests > 0)) and (pass == CHUNK_IMPASSABLE) then
pass = CHUNK_ALL_DIRECTIONS
end
if (nests > 0) or (worms > 0) then
if (#nests > 0) or (#worms > 0) then
local base = findNearbyBase(map, chunk, BASE_SEARCH_RADIUS)
if base then
setChunkBase(map, chunk, base)
else
createBase(map, natives, evolutionFactor, chunk, surface, tick)
end
if (#nests > 0) then
for i = 1, #nests do
upgradeEntity(map, nests[i], surface, natives, evolutionFactor, tick)
end
end
if (#worms > 0) then
for i = 1, #worms do
upgradeEntity(map, worms[i], surface, natives, evolutionFactor, tick)
end
end
end
setNestCount(map, chunk, nests)
setNestCount(map, chunk, #nests)
setPlayerBaseGenerator(map, chunk, playerObjects)
setResourceGenerator(map, chunk, resources)
setWormCount(map, chunk, worms)
setWormCount(map, chunk, #worms)
chunk[PASSABLE] = pass
chunk[PATH_RATING] = passScore

View File

@ -98,7 +98,7 @@ constants.AI_MAX_TEMPERAMENT_DURATION = 15
-- ai base
constants.BASE_DISTANCE_TO_EVO_INDEX = 1 / 2048
constants.BASE_DISTANCE_TO_EVO_INDEX = 1 / 20480
constants.BASE_SPAWNER_UPGRADE = 300
constants.BASE_WORM_UPGRADE = 250
@ -109,7 +109,7 @@ constants.BASE_DISTANCE_LEVEL_BONUS = 300
constants.BASE_ALIGNMENT_NEUTRAL = 1
constants.BASE_ALIGNMENT_FIRE = 2
constants.BASE_ALIGNMENT_BURROW = 3
constants.BASE_ALIGNMENT_NUCLEAR = 3
constants.BASE_ALIGNMENT_SUICIDE = 4
constants.BASE_ALIGNMENT_INFEST = 5
constants.BASE_ALIGNMENT_ACID = 6
@ -123,9 +123,10 @@ constants.BASE_ALIGNMENT_FAST = 13
constants.BASE_ALIGNMENT_WEB = 14
constants.BASE_ALIGNMENT_DECAYING = 15
constants.BASE_ALIGNMENT_UNDYING = 16
constants.BASE_ALIGNMENT_NEUTRAL_ADVANCED = 17
constants.BASE_ALIGNMENT_ENERGY_THIEF = 18
constants.BASE_ALIGNMENT_ELECTRIC = 19
constants.BASE_ALIGNMENT_ENERGY_THIEF = 17
constants.BASE_ALIGNMENT_ELECTRIC = 18
constants.BASE_ALIGNMENT_WASP = 19
-- constants.BASE_ALIGNMENT_BURROW = 3
constants.BASE_PROCESS_INTERVAL = constants.TICKS_A_SECOND * 5
@ -134,9 +135,37 @@ neutralPath[constants.BASE_ALIGNMENT_ACID] = true
neutralPath[constants.BASE_ALIGNMENT_FIRE] = true
neutralPath[constants.BASE_ALIGNMENT_PHYSICAL] = true
neutralPath[constants.BASE_ALIGNMENT_ELECTRIC] = true
neutralPath[constants.BASE_ALIGNMENT_DECAYING] = true
neutralPath[constants.BASE_ALIGNMENT_SUICIDE] = true
-- neutralPath[constants.BASE_ALIGNMENT_WEB] = true
neutralPath[constants.BASE_ALIGNMENT_TROLL] = true
neutralPath[constants.BASE_ALIGNMENT_FAST] = true
neutralPath[constants.BASE_ALIGNMENT_WASP] = true
local suicidePath = {}
suicidePath[constants.BASE_ALIGNMENT_NUCLEAR] = true
local firePath = {}
firePath[constants.BASE_ALIGNMENT_INFERNO] = true
local acidPath = {}
acidPath[constants.BASE_ALIGNMENT_POSION] = true
-- acidPath[constants.BASE_ALIGNMENT_INFEST] = true
local decayingPath = {}
decayingPath[constants.BASE_ALIGNMENT_UNDYING] = true
local electricPath = {}
-- electricPath[constants.BASE_ALIGNMENT_ENERGY_THIEF] = true
electricPath[constants.BASE_ALIGNMENT_LASER] = true
constants.BASE_ALIGNMENT_PATHS = {}
constants.BASE_ALIGNMENT_PATHS[constants.BASE_ALIGNMENT_NEUTRAL] = neutralPath
constants.BASE_ALIGNMENT_PATHS[constants.BASE_ALIGNMENT_FIRE] = firePath
constants.BASE_ALIGNMENT_PATHS[constants.BASE_ALIGNMENT_SUICIDE] = suicidePath
constants.BASE_ALIGNMENT_PATHS[constants.BASE_ALIGNMENT_ACID] = acidPath
constants.BASE_ALIGNMENT_PATHS[constants.BASE_ALIGNMENT_DECAYING] = decayingPath
constants.BASE_ALIGNMENT_PATHS[constants.BASE_ALIGNMENT_ELECTRIC] = electricPath
-- ai retreat
@ -261,9 +290,6 @@ constants.SENTINEL_IMPASSABLE_CHUNK.y = -1
-- unit spawners
constants.SUICIDE_BITER_NEST_TIERS = 10
constants.SUICIDE_BITER_NEST_VARIATIONS = 5
constants.NEUTRAL_NEST_TIERS = 10
constants.NEUTRAL_NEST_VARIATIONS = 20
constants.NEUTRAL_WORM_TIERS = 10
@ -274,6 +300,69 @@ constants.ACID_NEST_VARIATIONS = 20
constants.ACID_WORM_TIERS = 10
constants.ACID_WORM_VARIATIONS = 20
constants.FIRE_NEST_TIERS = 10
constants.FIRE_NEST_VARIATIONS = 20
constants.FIRE_WORM_TIERS = 10
constants.FIRE_WORM_VARIATIONS = 20
constants.PHYSICAL_NEST_TIERS = 10
constants.PHYSICAL_NEST_VARIATIONS = 20
constants.PHYSICAL_WORM_TIERS = 10
constants.PHYSICAL_WORM_VARIATIONS = 20
constants.TROLL_NEST_TIERS = 10
constants.TROLL_NEST_VARIATIONS = 20
constants.TROLL_WORM_TIERS = 10
constants.TROLL_WORM_VARIATIONS = 20
constants.FAST_NEST_TIERS = 10
constants.FAST_NEST_VARIATIONS = 20
constants.FAST_WORM_TIERS = 10
constants.FAST_WORM_VARIATIONS = 20
constants.SUICIDE_NEST_TIERS = 10
constants.SUICIDE_NEST_VARIATIONS = 20
constants.SUICIDE_WORM_TIERS = 10
constants.SUICIDE_WORM_VARIATIONS = 20
constants.WASP_NEST_TIERS = 10
constants.WASP_NEST_VARIATIONS = 20
constants.WASP_WORM_TIERS = 10
constants.WASP_WORM_VARIATIONS = 20
constants.POISON_NEST_TIERS = 10
constants.POISON_NEST_VARIATIONS = 20
constants.POISON_WORM_TIERS = 10
constants.POISON_WORM_VARIATIONS = 20
constants.DECAYING_NEST_TIERS = 10
constants.DECAYING_NEST_VARIATIONS = 20
constants.DECAYING_WORM_TIERS = 10
constants.DECAYING_WORM_VARIATIONS = 20
constants.UNDYING_NEST_TIERS = 10
constants.UNDYING_NEST_VARIATIONS = 20
constants.UNDYING_WORM_TIERS = 10
constants.UNDYING_WORM_VARIATIONS = 20
constants.ELECTRIC_NEST_TIERS = 10
constants.ELECTRIC_NEST_VARIATIONS = 20
constants.ELECTRIC_WORM_TIERS = 10
constants.ELECTRIC_WORM_VARIATIONS = 20
constants.LASER_NEST_TIERS = 10
constants.LASER_NEST_VARIATIONS = 20
constants.LASER_WORM_TIERS = 10
constants.LASER_WORM_VARIATIONS = 20
constants.INFERNO_NEST_TIERS = 10
constants.INFERNO_NEST_VARIATIONS = 20
constants.INFERNO_WORM_TIERS = 10
constants.INFERNO_WORM_VARIATIONS = 20
constants.NUCLEAR_NEST_TIERS = 10
constants.NUCLEAR_NEST_VARIATIONS = 20
constants.NUCLEAR_WORM_TIERS = 10
constants.NUCLEAR_WORM_VARIATIONS = 20
return constants

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

925
prototypes/Electric.lua Executable file
View File

@ -0,0 +1,925 @@
-- imports
local biterUtils = require("utils/BiterUtils")
local beamUtils = require("utils/BeamUtils")
local swarmUtils = require("SwarmUtils")
package.path = "../libs/?.lua;" .. package.path
local constants = require("Constants")
-- constants
local ELECTRIC_NEST_TIERS = constants.ELECTRIC_NEST_TIERS
local ELECTRIC_NEST_VARIATIONS = constants.ELECTRIC_NEST_VARIATIONS
local ELECTRIC_WORM_TIERS = constants.ELECTRIC_WORM_TIERS
local ELECTRIC_WORM_VARIATIONS = constants.ELECTRIC_WORM_VARIATIONS
-- imported functions
local buildUnitSpawner = swarmUtils.buildUnitSpawner
local buildWorm = swarmUtils.buildWorm
local createElectricAttack = biterUtils.createElectricAttack
local makeBeam = beamUtils.makeBeam
-- electric biters
buildUnitSpawner(
{
unit = {
name = "electric-biter",
attributes = {
explosion = "blood-explosion-small"
},
attack = {
damageType = "electric"
},
resistances = {},
type = "biter",
scales = {
[1] = 0.5,
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
attackName = "biter-electric",
tint1 = {r=0, g=0.25, b=0.83, a=0.65},
tint2 = {r=0, g=0.25, b=0.63, a=0.65}
},
unitSpawner = {
name = "electric-biter-nest",
attributes = {},
resistances = {},
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
},
tint = {r=0, g=0.25, b=0.83, a=0.65}
}
},
{
unit = {
{
type = "attribute",
name = "health",
[1] = 15,
[2] = 75,
[3] = 150,
[4] = 250,
[5] = 400,
[6] = 750,
[7] = 1500,
[8] = 3000,
[9] = 5000,
[10] = 10000
},
{
type = "attack",
name = "cooldown",
[1] = 35,
[2] = 35,
[3] = 35,
[4] = 35,
[5] = 35,
[6] = 35,
[7] = 50,
[8] = 50,
[9] = 55,
[10] = 57
},
{
type = "attack",
name = "width",
[1] = 1.5,
[2] = 1.5,
[3] = 1.6,
[4] = 1.6,
[5] = 1.7,
[6] = 1.7,
[7] = 1.8,
[8] = 1.8,
[9] = 1.9,
[10] = 1.9
},
{
type = "attack",
name = "damageInterval",
[1] = 20,
[2] = 20,
[3] = 21,
[4] = 21,
[5] = 22,
[6] = 22,
[7] = 23,
[8] = 23,
[9] = 24,
[10] = 24
},
{
type = "attack",
name = "duration",
[1] = 20,
[2] = 20,
[3] = 21,
[4] = 21,
[5] = 22,
[6] = 22,
[7] = 23,
[8] = 23,
[9] = 24,
[10] = 24
},
{
type = "attribute",
name = "spawningTimeModifer",
[1] = 0,
[2] = 0,
[3] = 1,
[4] = 2,
[5] = 3,
[6] = 7,
[7] = 10,
[8] = 10,
[9] = 12,
[10] = 12
},
{
type = "attribute",
name = "pollutionToAttack",
[1] = 200,
[2] = 750,
[3] = 1750,
[4] = 3500,
[5] = 5000,
[6] = 10000,
[7] = 20000,
[8] = 25000,
[9] = 30000,
[10] = 40000
},
{
type = "attack",
name = "damage",
[1] = 7,
[2] = 15,
[3] = 22.5,
[4] = 35,
[5] = 45,
[6] = 60,
[7] = 75,
[8] = 90,
[9] = 150,
[10] = 200
},
{
type = "attribute",
name = "healing",
[1] = 0.01,
[2] = 0.01,
[3] = 0.015,
[4] = 0.02,
[5] = 0.05,
[6] = 0.075,
[7] = 0.1,
[8] = 0.12,
[9] = 0.14,
[10] = 0.16
},
{
type = "attribute",
name = "movement",
[1] = 0.2,
[2] = 0.19,
[3] = 0.185,
[4] = 0.18,
[5] = 0.175,
[6] = 0.17,
[7] = 0.17,
[8] = 0.17,
[9] = 0.17,
[10] = 0.17
},
{
type = "attribute",
name = "distancePerFrame",
[1] = 0.1,
[2] = 0.125,
[3] = 0.15,
[4] = 0.19,
[5] = 0.195,
[6] = 0.2,
[7] = 0.2,
[8] = 0.2,
[9] = 0.2,
[10] = 0.2
},
{
type = "resistance",
name = "physical",
decrease = {
[1] = 0,
[2] = 0,
[3] = 4,
[4] = 5,
[5] = 6,
[6] = 8,
[7] = 10,
[8] = 12,
[9] = 14,
[10] = 15
},
percent = {
[1] = 0,
[2] = 0,
[3] = 0,
[4] = 10,
[5] = 12,
[6] = 12,
[7] = 13,
[8] = 13,
[9] = 14,
[10] = 15
}
},
{
type = "resistance",
name = "explosion",
decrease = {
[1] = 0,
[2] = 0,
[3] = 0,
[4] = 0,
[5] = 0,
[6] = 0,
[7] = 10,
[8] = 12,
[9] = 14,
[10] = 15
},
percent = {
[1] = 0,
[2] = 0,
[3] = 0,
[4] = 10,
[5] = 12,
[6] = 12,
[7] = 13,
[8] = 13,
[9] = 14,
[10] = 15
}
},
{
type = "resistance",
name = "electric",
decrease = {
[1] = 7,
[2] = 7,
[3] = 10,
[4] = 10,
[5] = 13,
[6] = 13,
[7] = 16,
[8] = 16,
[9] = 19,
[10] = 23
},
percent = {
[1] = 65,
[2] = 65,
[3] = 70,
[4] = 75,
[5] = 75,
[6] = 80,
[7] = 85,
[8] = 85,
[9] = 90,
[10] = 90
}
},
{
type = "attack",
name = "range",
[1] = 7,
[2] = 7,
[3] = 8,
[4] = 8,
[5] = 9,
[6] = 9,
[7] = 10,
[8] = 10,
[9] = 11,
[10] = 11
}
},
unitSpawner = {
{
type = "attribute",
name = "health",
[1] = 350,
[2] = 500,
[3] = 750,
[4] = 1500,
[5] = 2500,
[6] = 3500,
[7] = 5000,
[8] = 7000,
[9] = 10000,
[10] = 15000
},
{
type = "attribute",
name = "healing",
[1] = 0.02,
[2] = 0.02,
[3] = 0.022,
[4] = 0.024,
[5] = 0.026,
[6] = 0.028,
[7] = 0.03,
[8] = 0.032,
[9] = 0.034,
[10] = 0.036
},
{
type = "attribute",
name = "spawingCooldownStart",
[1] = 360,
[2] = 360,
[3] = 355,
[4] = 355,
[5] = 350,
[6] = 350,
[7] = 345,
[8] = 345,
[9] = 340,
[10] = 340
},
{
type = "attribute",
name = "spawingCooldownEnd",
[1] = 150,
[2] = 150,
[3] = 145,
[4] = 145,
[5] = 140,
[6] = 140,
[7] = 135,
[8] = 135,
[9] = 130,
[10] = 130
},
{
type = "attribute",
name = "evolutionRequirement",
[1] = 0,
[2] = 0.1,
[3] = 0.2,
[4] = 0.3,
[5] = 0.4,
[6] = 0.5,
[7] = 0.6,
[8] = 0.7,
[9] = 0.8,
[10] = 0.9
},
{
type = "attribute",
name = "unitsOwned",
[1] = 7,
[2] = 7,
[3] = 8,
[4] = 8,
[5] = 9,
[6] = 9,
[7] = 10,
[8] = 10,
[9] = 11,
[10] = 11
},
{
type = "attribute",
name = "unitsToSpawn",
[1] = 5,
[2] = 5,
[3] = 6,
[4] = 6,
[5] = 7,
[6] = 7,
[7] = 8,
[8] = 8,
[9] = 9,
[10] = 9
},
{
type = "resistance",
name = "physical",
decrease = {
[1] = 2,
[2] = 2,
[3] = 4,
[4] = 4,
[5] = 6,
[6] = 6,
[7] = 10,
[8] = 12,
[9] = 12,
[10] = 14
},
percent = {
[1] = 15,
[2] = 15,
[3] = 17,
[4] = 17,
[5] = 18,
[6] = 18,
[7] = 19,
[8] = 19,
[9] = 20,
[10] = 20
}
},
{
type = "resistance",
name = "explosion",
decrease = {
[1] = 5,
[2] = 5,
[3] = 6,
[4] = 6,
[5] = 7,
[6] = 7,
[7] = 8,
[8] = 8,
[9] = 9,
[10] = 9
},
percent = {
[1] = 15,
[2] = 15,
[3] = 17,
[4] = 17,
[5] = 18,
[6] = 18,
[7] = 19,
[8] = 19,
[9] = 20,
[10] = 20
}
},
{
type = "resistance",
name = "fire",
decrease = {
[1] = 3,
[2] = 3,
[3] = 4,
[4] = 4,
[5] = 6,
[6] = 6,
[7] = 6,
[8] = 6,
[9] = 7,
[10] = 7
},
percent = {
[1] = 60,
[2] = 60,
[3] = 62,
[4] = 62,
[5] = 63,
[6] = 63,
[7] = 64,
[8] = 64,
[9] = 65,
[10] = 65
}
},
{
type = "resistance",
name = "electric",
decrease = {
[1] = 7,
[2] = 7,
[3] = 10,
[4] = 10,
[5] = 13,
[6] = 13,
[7] = 16,
[8] = 16,
[9] = 19,
[10] = 23
},
percent = {
[1] = 65,
[2] = 65,
[3] = 70,
[4] = 75,
[5] = 75,
[6] = 80,
[7] = 85,
[8] = 85,
[9] = 90,
[10] = 90
}
}
},
probabilityTable = {
[1] = 1,
[2] = 1,
[3] = 1,
[4] = 1,
[5] = 1,
[6] = 1,
[7] = 1,
[8] = 1,
[9] = 1,
[10] = 1,
}
},
function (attributes)
makeBeam(attributes)
return createElectricAttack(attributes,
attributes.name .. "-beam-rampant",
biterattackanimation(attributes.scale, attributes.tint1, attributes.tint2))
end,
{
unit = 10,
unitSpawner = ELECTRIC_NEST_VARIATIONS
},
{
unit = 10,
unitSpawner = ELECTRIC_NEST_TIERS
}
)
-- electric worms
buildWorm(
{
name = "electric-worm",
attributes = {},
attack = {
damageType = "electric"
},
resistances = {},
scales = {
[1] = 0.5,
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
attackName = "worm-beam",
tint = {r=0, g=0.25, b=0.83, a=0.65}
},
{
{
type = "attribute",
name = "health",
[1] = 200,
[2] = 350,
[3] = 500,
[4] = 750,
[5] = 900,
[6] = 1000,
[7] = 1500,
[8] = 1500,
[9] = 2500,
[10] = 4500
},
{
type = "attack",
name = "cooldown",
[1] = 50,
[2] = 50,
[3] = 45,
[4] = 45,
[5] = 40,
[6] = 40,
[7] = 35,
[8] = 35,
[9] = 30,
[10] = 30
},
{
type = "attribute",
name = "evolutionRequirement",
[1] = 0,
[2] = 0.1,
[3] = 0.2,
[4] = 0.3,
[5] = 0.4,
[6] = 0.5,
[7] = 0.6,
[8] = 0.7,
[9] = 0.8,
[10] = 0.9
},
{
type = "attack",
name = "damage",
[1] = 12,
[2] = 20,
[3] = 25,
[4] = 30,
[5] = 35,
[6] = 40,
[7] = 50,
[8] = 60,
[9] = 70,
[10] = 80
},
{
type = "attribute",
name = "healing",
[1] = 0.01,
[2] = 0.01,
[3] = 0.015,
[4] = 0.02,
[5] = 0.05,
[6] = 0.075,
[7] = 0.1,
[8] = 0.12,
[9] = 0.14,
[10] = 0.16
},
{
type = "attribute",
name = "prepareRange",
[1] = 30,
[2] = 30,
[3] = 31,
[4] = 31,
[5] = 32,
[6] = 32,
[7] = 33,
[8] = 33,
[9] = 34,
[10] = 34
},
{
type = "attribute",
name = "foldingSpeed",
[1] = 0.15,
[2] = 0.15,
[3] = 0.16,
[4] = 0.16,
[5] = 0.16,
[6] = 0.17,
[7] = 0.17,
[8] = 0.18,
[9] = 0.18,
[10] = 0.19
},
{
type = "attribute",
name = "preparingSpeed",
[1] = 0.025,
[2] = 0.025,
[3] = 0.026,
[4] = 0.026,
[5] = 0.027,
[6] = 0.027,
[7] = 0.028,
[8] = 0.028,
[9] = 0.029,
[10] = 0.029
},
{
type = "resistance",
name = "physical",
decrease = {
[1] = 0,
[2] = 0,
[3] = 5,
[4] = 5,
[5] = 8,
[6] = 8,
[7] = 10,
[8] = 10,
[9] = 12,
[10] = 12
}
},
{
type = "resistance",
name = "explosion",
decrease = {
[1] = 0,
[2] = 0,
[3] = 5,
[4] = 5,
[5] = 8,
[6] = 8,
[7] = 10,
[8] = 10,
[9] = 12,
[10] = 12
},
percent = {
[1] = 0,
[2] = 0,
[3] = 10,
[4] = 10,
[5] = 20,
[6] = 20,
[7] = 30,
[8] = 30,
[9] = 40,
[10] = 40
}
},
{
type = "resistance",
name = "electric",
decrease = {
[1] = 7,
[2] = 7,
[3] = 10,
[4] = 10,
[5] = 13,
[6] = 13,
[7] = 16,
[8] = 16,
[9] = 19,
[10] = 23
},
percent = {
[1] = 65,
[2] = 65,
[3] = 70,
[4] = 75,
[5] = 75,
[6] = 80,
[7] = 85,
[8] = 85,
[9] = 90,
[10] = 90
}
},
{
type = "resistance",
name = "fire",
decrease = {
[1] = 3,
[2] = 3,
[3] = 4,
[4] = 4,
[5] = 6,
[6] = 6,
[7] = 6,
[8] = 6,
[9] = 7,
[10] = 7
},
percent = {
[1] = 70,
[2] = 70,
[3] = 72,
[4] = 72,
[5] = 73,
[6] = 73,
[7] = 74,
[8] = 74,
[9] = 75,
[10] = 75
}
},
{
type = "attack",
name = "range",
[1] = 21,
[2] = 22,
[3] = 23,
[4] = 23,
[5] = 24,
[6] = 26,
[7] = 26,
[8] = 28,
[9] = 30,
[10] = 32
},
{
type = "attack",
name = "width",
[1] = 0.5,
[2] = 0.5,
[3] = 0.6,
[4] = 0.6,
[5] = 0.7,
[6] = 0.7,
[7] = 0.8,
[8] = 0.8,
[9] = 0.9,
[10] = 0.9
},
{
type = "attack",
name = "damageInterval",
[1] = 20,
[2] = 20,
[3] = 21,
[4] = 21,
[5] = 22,
[6] = 22,
[7] = 23,
[8] = 23,
[9] = 24,
[10] = 24
},
{
type = "attack",
name = "duration",
[1] = 20,
[2] = 20,
[3] = 21,
[4] = 21,
[5] = 22,
[6] = 22,
[7] = 23,
[8] = 23,
[9] = 24,
[10] = 24
}
},
function (attributes)
makeBeam(attributes)
return createElectricAttack(attributes,
attributes.name .. "-beam-rampant")
end,
ELECTRIC_WORM_VARIATIONS,
ELECTRIC_WORM_TIERS
)

1415
prototypes/Fire.lua Executable file

File diff suppressed because it is too large Load Diff

1414
prototypes/Inferno.lua Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

918
prototypes/Nuclear.lua Executable file
View File

@ -0,0 +1,918 @@
-- imports
local acidBall = require("utils/AttackAcidBall")
local biterUtils = require("utils/BiterUtils")
local stickerUtils = require("utils/StickerUtils")
local smokeUtils = require("utils/SmokeUtils")
local swarmUtils = require("SwarmUtils")
local colorUtils = require("utils/ColorUtils")
package.path = "../libs/?.lua;" .. package.path
local constants = require("Constants")
-- constants
local NUCLEAR_NEST_TIERS = constants.NUCLEAR_NEST_TIERS
local NUCLEAR_NEST_VARIATIONS = constants.NUCLEAR_NEST_VARIATIONS
local NUCLEAR_WORM_TIERS = constants.NUCLEAR_WORM_TIERS
local NUCLEAR_WORM_VARIATIONS = constants.NUCLEAR_WORM_VARIATIONS
-- imported functions
local makeColor = colorUtils.makeColor
local makeSmokeSoft = smokeUtils.makeSmokeSoft
local makeSticker = stickerUtils.makeSticker
local buildUnitSpawner = swarmUtils.buildUnitSpawner
local buildWorm = swarmUtils.buildWorm
local createAcidBall = acidBall.createAcidBall
local createFireAttack = biterUtils.createFireAttack
local createSuicideAttack = biterUtils.createSuicideAttack
makeSmokeSoft({name="nuclear", softSmokeTint=makeColor(0.3, 0.75, 0.3, 0.1)})
-- nuclear biters
buildUnitSpawner(
{
unit = {
name = "nuclear-biter",
attributes = {
explosion = "blood-explosion-small"
},
attack = {
nuclear = true,
scorchmark = "small-scorchmark"
},
resistances = {},
type = "biter",
scales = {
[1] = 0.5,
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
tint1 = {r=0.56, g=0.46, b=0.42, a=0.65},
tint2 = {r=1, g=0.63, b=0, a=0.4}
},
unitSpawner = {
name = "nuclear-biter-nest",
attributes = {},
resistances = {},
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
},
tint = {r=1.0, g=1.0, b=1.0, a=1.0}
}
},
{
unit = {
{
type = "attribute",
name = "health",
[1] = 7,
[2] = 42,
[3] = 75,
[4] = 125,
[5] = 200,
[6] = 350,
[7] = 750,
[8] = 1500,
[9] = 3000,
[10] = 5000
},
{
type = "attack",
name = "cooldown",
[1] = 35,
[2] = 35,
[3] = 35,
[4] = 35,
[5] = 35,
[6] = 35,
[7] = 50,
[8] = 50,
[9] = 55,
[10] = 57
},
{
type = "attribute",
name = "spawningTimeModifer",
[1] = 0,
[2] = 0,
[3] = 1,
[4] = 2,
[5] = 3,
[6] = 5,
[7] = 6,
[8] = 6,
[9] = 8,
[10] = 8
},
{
type = "attribute",
name = "pollutionToAttack",
[1] = 200,
[2] = 750,
[3] = 1750,
[4] = 3500,
[5] = 5000,
[6] = 10000,
[7] = 20000,
[8] = 25000,
[9] = 30000,
[10] = 40000
},
{
type = "attack",
mapping = "explosion",
[1] = "explosion",
[2] = "explosion",
[3] = "big-explosion",
[4] = "big-explosion",
[5] = "big-explosion",
[6] = "big-explosion",
[7] = "massive-explosion",
[8] = "massive-explosion",
[9] = "massive-explosion",
[10] = "massive-explosion"
},
{
type = "attack",
name = "radius",
[1] = 5,
[2] = 10,
[3] = 10,
[4] = 12,
[5] = 14,
[6] = 16,
[7] = 16,
[8] = 18,
[9] = 18,
[10] = 20
},
{
type = "attack",
name = "repeatCount",
[1] = 150,
[2] = 175,
[3] = 200,
[4] = 200,
[5] = 250,
[6] = 250,
[7] = 300,
[8] = 300,
[9] = 350,
[10] = 350
},
{
type = "attack",
name = "damage",
[1] = 50,
[2] = 60,
[3] = 80,
[4] = 100,
[5] = 120,
[6] = 130,
[7] = 140,
[8] = 150,
[9] = 180,
[10] = 200
},
{
type = "attribute",
name = "healing",
[1] = 0.01,
[2] = 0.01,
[3] = 0.015,
[4] = 0.02,
[5] = 0.05,
[6] = 0.075,
[7] = 0.1,
[8] = 0.12,
[9] = 0.14,
[10] = 0.16
},
{
type = "attribute",
name = "movement",
[1] = 0.23,
[2] = 0.23,
[3] = 0.22,
[4] = 0.22,
[5] = 0.21,
[6] = 0.21,
[7] = 0.2,
[8] = 0.2,
[9] = 0.19,
[10] = 0.19
},
{
type = "attribute",
name = "distancePerFrame",
[1] = 0.12,
[2] = 0.145,
[3] = 0.17,
[4] = 0.21,
[5] = 0.21,
[6] = 0.22,
[7] = 0.22,
[8] = 0.23,
[9] = 0.23,
[10] = 0.24
},
{
type = "resistance",
name = "physical",
decrease = {
[1] = 0,
[2] = 0,
[3] = 4,
[4] = 5,
[5] = 6,
[6] = 8,
[7] = 9,
[8] = 9,
[9] = 10,
[10] = 10
},
percent = {
[1] = 0,
[2] = 0,
[3] = 0,
[4] = 10,
[5] = 12,
[6] = 12,
[7] = 13,
[8] = 13,
[9] = 14,
[10] = 15
}
},
{
type = "resistance",
name = "explosion",
decrease = {
[1] = -7,
[2] = -7,
[3] = -10,
[4] = -10,
[5] = -13,
[6] = -13,
[7] = -16,
[8] = -16,
[9] = -19,
[10] = -23
},
percent = {
[1] = -65,
[2] = -65,
[3] = -70,
[4] = -75,
[5] = -75,
[6] = -80,
[7] = -85,
[8] = -85,
[9] = -90,
[10] = -90
}
},
{
type = "attack",
name = "range",
[1] = 0.5,
[2] = 0.5,
[3] = 0.75,
[4] = 0.75,
[5] = 1.0,
[6] = 1.0,
[7] = 1.25,
[8] = 1.50,
[9] = 1.75,
[10] = 2.0
}
},
unitSpawner = {
{
type = "attribute",
name = "health",
[1] = 350,
[2] = 500,
[3] = 750,
[4] = 1500,
[5] = 2500,
[6] = 3500,
[7] = 5000,
[8] = 7000,
[9] = 10000,
[10] = 15000
},
{
type = "attribute",
name = "healing",
[1] = 0.02,
[2] = 0.02,
[3] = 0.022,
[4] = 0.024,
[5] = 0.026,
[6] = 0.028,
[7] = 0.03,
[8] = 0.032,
[9] = 0.034,
[10] = 0.036
},
{
type = "attribute",
name = "spawingCooldownStart",
[1] = 330,
[2] = 330,
[3] = 325,
[4] = 325,
[5] = 320,
[6] = 320,
[7] = 315,
[8] = 315,
[9] = 310,
[10] = 310
},
{
type = "attribute",
name = "spawingCooldownEnd",
[1] = 120,
[2] = 120,
[3] = 115,
[4] = 115,
[5] = 110,
[6] = 110,
[7] = 105,
[8] = 105,
[9] = 100,
[10] = 100
},
{
type = "attribute",
name = "evolutionRequirement",
[1] = 0,
[2] = 0.1,
[3] = 0.2,
[4] = 0.3,
[5] = 0.4,
[6] = 0.5,
[7] = 0.6,
[8] = 0.7,
[9] = 0.8,
[10] = 0.9
},
{
type = "attribute",
name = "unitsOwned",
[1] = 1,
[2] = 2,
[3] = 3,
[4] = 4,
[5] = 4,
[6] = 5,
[7] = 5,
[8] = 6,
[9] = 6,
[10] = 6
},
{
type = "attribute",
name = "unitsToSpawn",
[1] = 1,
[2] = 2,
[3] = 3,
[4] = 3,
[5] = 4,
[6] = 4,
[7] = 5,
[8] = 5,
[9] = 5,
[10] = 5
},
{
type = "resistance",
name = "physical",
decrease = {
[1] = 2,
[2] = 2,
[3] = 4,
[4] = 4,
[5] = 6,
[6] = 6,
[7] = 10,
[8] = 12,
[9] = 12,
[10] = 14
},
percent = {
[1] = 15,
[2] = 15,
[3] = 17,
[4] = 17,
[5] = 18,
[6] = 18,
[7] = 19,
[8] = 19,
[9] = 20,
[10] = 20
}
},
{
type = "resistance",
name = "explosion",
decrease = {
[1] = 7,
[2] = 7,
[3] = 10,
[4] = 10,
[5] = 13,
[6] = 13,
[7] = 16,
[8] = 16,
[9] = 19,
[10] = 23
},
percent = {
[1] = 65,
[2] = 65,
[3] = 70,
[4] = 75,
[5] = 75,
[6] = 80,
[7] = 85,
[8] = 85,
[9] = 90,
[10] = 90
}
},
{
type = "resistance",
name = "fire",
decrease = {
[1] = 1,
[2] = 1,
[3] = 2,
[4] = 2,
[5] = 3,
[6] = 3,
[7] = 4,
[8] = 4,
[9] = 5,
[10] = 5
},
percent = {
[1] = 40,
[2] = 40,
[3] = 42,
[4] = 42,
[5] = 43,
[6] = 43,
[7] = 44,
[8] = 44,
[9] = 45,
[10] = 45
}
}
},
probabilityTable = {
[1] = 1,
[2] = 1,
[3] = 1,
[4] = 1,
[5] = 1,
[6] = 1,
[7] = 1,
[8] = 1,
[9] = 1,
[10] = 1,
}
},
createSuicideAttack,
{
unit = 10,
unitSpawner = NUCLEAR_NEST_VARIATIONS
},
{
unit = 10,
unitSpawner = NUCLEAR_NEST_TIERS
}
)
-- nuclear worms
buildWorm(
{
name = "nuclear-worm",
attributes = {},
attack = {
stickerAnimation = {
filename = "__base__/graphics/entity/slowdown-sticker/slowdown-sticker.png",
priority = "extra-high",
width = 11,
height = 11,
frame_count = 13,
animation_speed = 0.4
},
areaEffects = function (attributes)
return {
{
type = "damage",
damage = { amount = attributes.damage, type = "acid" }
},
{
type = "create-sticker",
sticker = attributes.name .. "-sticker-rampant"
}
}
end,
softSmokeName = "nuclear-soft-smoke-rampant"
},
resistances = {},
scales = {
[1] = 0.5,
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
attackName = "worm-nuclear-ball",
tint = {r=0.56, g=0.46, b=0.42, a=0.65},
pTint = {r=0, g=1, b=1, a=0.5},
sTint = {r=0, g=1, b=1, a=0.5}
},
{
{
type = "attribute",
name = "health",
[1] = 200,
[2] = 350,
[3] = 500,
[4] = 750,
[5] = 900,
[6] = 1000,
[7] = 1500,
[8] = 1500,
[9] = 2500,
[10] = 4500
},
{
type = "attack",
name = "cooldown",
[1] = 50,
[2] = 50,
[3] = 45,
[4] = 45,
[5] = 40,
[6] = 40,
[7] = 35,
[8] = 35,
[9] = 30,
[10] = 30
},
{
type = "attack",
name = "stickerMovementModifier",
[1] = 1.2,
[2] = 1.2,
[3] = 1.3,
[4] = 1.3,
[5] = 1.4,
[6] = 1.4,
[7] = 1.5,
[8] = 1.5,
[9] = 1.6,
[10] = 1.6
},
{
type = "attack",
name = "stickerDuration",
[1] = 1800,
[2] = 1800,
[3] = 1900,
[4] = 1900,
[5] = 2000,
[6] = 2000,
[7] = 2100,
[8] = 2100,
[9] = 2200,
[10] = 2200
},
{
type = "attribute",
name = "evolutionRequirement",
[1] = 0,
[2] = 0.1,
[3] = 0.2,
[4] = 0.3,
[5] = 0.4,
[6] = 0.5,
[7] = 0.6,
[8] = 0.7,
[9] = 0.8,
[10] = 0.9
},
{
type = "attack",
name = "damage",
[1] = 12,
[2] = 20,
[3] = 25,
[4] = 30,
[5] = 35,
[6] = 40,
[7] = 50,
[8] = 60,
[9] = 70,
[10] = 80
},
{
type = "attribute",
name = "healing",
[1] = 0.01,
[2] = 0.01,
[3] = 0.015,
[4] = 0.02,
[5] = 0.05,
[6] = 0.075,
[7] = 0.1,
[8] = 0.12,
[9] = 0.14,
[10] = 0.16
},
{
type = "attribute",
name = "prepareRange",
[1] = 30,
[2] = 30,
[3] = 31,
[4] = 31,
[5] = 32,
[6] = 32,
[7] = 33,
[8] = 33,
[9] = 34,
[10] = 34
},
{
type = "attribute",
name = "foldingSpeed",
[1] = 0.15,
[2] = 0.15,
[3] = 0.16,
[4] = 0.16,
[5] = 0.16,
[6] = 0.17,
[7] = 0.17,
[8] = 0.18,
[9] = 0.18,
[10] = 0.19
},
{
type = "attribute",
name = "preparingSpeed",
[1] = 0.025,
[2] = 0.025,
[3] = 0.026,
[4] = 0.026,
[5] = 0.027,
[6] = 0.027,
[7] = 0.028,
[8] = 0.028,
[9] = 0.029,
[10] = 0.029
},
{
type = "resistance",
name = "physical",
decrease = {
[1] = 0,
[2] = 0,
[3] = 5,
[4] = 5,
[5] = 8,
[6] = 8,
[7] = 10,
[8] = 10,
[9] = 12,
[10] = 12
}
},
{
type = "resistance",
name = "explosion",
decrease = {
[1] = 7,
[2] = 7,
[3] = 10,
[4] = 10,
[5] = 13,
[6] = 13,
[7] = 16,
[8] = 16,
[9] = 19,
[10] = 23
},
percent = {
[1] = 65,
[2] = 65,
[3] = 70,
[4] = 75,
[5] = 75,
[6] = 80,
[7] = 85,
[8] = 85,
[9] = 90,
[10] = 90
}
},
{
type = "resistance",
name = "fire",
decrease = {
[1] = 1,
[2] = 1,
[3] = 2,
[4] = 2,
[5] = 3,
[6] = 3,
[7] = 4,
[8] = 4,
[9] = 5,
[10] = 5
},
percent = {
[1] = 40,
[2] = 40,
[3] = 42,
[4] = 42,
[5] = 43,
[6] = 43,
[7] = 44,
[8] = 44,
[9] = 45,
[10] = 45
}
},
{
type = "attack",
name = "range",
[1] = 21,
[2] = 22,
[3] = 23,
[4] = 23,
[5] = 24,
[6] = 26,
[7] = 26,
[8] = 28,
[9] = 30,
[10] = 32
},
{
type = "attack",
name = "radius",
[1] = 1.5,
[2] = 1.6,
[3] = 1.7,
[4] = 1.8,
[5] = 1.9,
[6] = 2.0,
[7] = 2.2,
[8] = 2.3,
[9] = 2.5,
[10] = 3.0
},
{
type = "attack",
name = "particleVerticalAcceleration",
[1] = 0.01,
[2] = 0.01,
[3] = 0.02,
[4] = 0.02,
[5] = 0.03,
[6] = 0.03,
[7] = 0.04,
[8] = 0.04,
[9] = 0.05,
[10] = 0.05
},
{
type = "attack",
name = "particleHoizontalSpeed",
[1] = 0.6,
[2] = 0.6,
[3] = 0.7,
[4] = 0.7,
[5] = 0.8,
[6] = 0.8,
[7] = 0.9,
[8] = 0.9,
[9] = 1,
[10] = 1
},
{
type = "attack",
name = "particleHoizontalSpeedDeviation",
[1] = 0.0025,
[2] = 0.0025,
[3] = 0.0024,
[4] = 0.0024,
[5] = 0.0023,
[6] = 0.0023,
[7] = 0.0022,
[8] = 0.0022,
[9] = 0.0021,
[10] = 0.0021
}
},
function (attributes)
makeSticker(attributes)
createAcidBall(attributes)
return createFireAttack(attributes, attributes.name .. "-stream-rampant")
end,
NUCLEAR_WORM_VARIATIONS,
NUCLEAR_WORM_TIERS
)

852
prototypes/Physical.lua Executable file
View File

@ -0,0 +1,852 @@
-- imports
local physicalBall = require("utils/AttackAcidBall")
local biterUtils = require("utils/BiterUtils")
local smokeUtils = require("utils/SmokeUtils")
local swarmUtils = require("SwarmUtils")
local colorUtils = require("utils/ColorUtils")
package.path = "../libs/?.lua;" .. package.path
local constants = require("Constants")
-- constants
local PHYSICAL_NEST_TIERS = constants.PHYSICAL_NEST_TIERS
local PHYSICAL_NEST_VARIATIONS = constants.PHYSICAL_NEST_VARIATIONS
local PHYSICAL_WORM_TIERS = constants.PHYSICAL_WORM_TIERS
local PHYSICAL_WORM_VARIATIONS = constants.PHYSICAL_WORM_VARIATIONS
-- imported functions
local makeColor = colorUtils.makeColor
local makeSmokeSoft = smokeUtils.makeSmokeSoft
local buildUnitSpawner = swarmUtils.buildUnitSpawner
local buildWorm = swarmUtils.buildWorm
local createAcidBall = physicalBall.createAcidBall
local createFireAttack = biterUtils.createFireAttack
local createMeleeAttack = biterUtils.createMeleeAttack
makeSmokeSoft({name="physical", softSmokeTint=makeColor(0.75, 0.75, 0.75, 0.1)})
-- physical biters
buildUnitSpawner(
{
unit = {
name = "physical-biter",
attributes = {
explosion = "blood-explosion-small"
},
attack = {
},
resistances = {},
type = "biter",
scales = {
[1] = 0.7,
[2] = 0.8,
[3] = 0.9,
[4] = 1,
[5] = 1.1,
[6] = 1.2,
[7] = 1.3,
[8] = 1.4,
[9] = 1.5,
[10] = 1.6
},
tint1 = {r=0.85, g=0.85, b=0.83, a=0.65},
tint2 = {r=0.85, g=0.85, b=0.83, a=0.65}
},
unitSpawner = {
name = "physical-biter-nest",
attributes = {},
resistances = {},
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
},
tint = {r=0.85, g=0.85, b=0.83, a=0.65}
}
},
{
unit = {
{
type = "attribute",
name = "health",
[1] = 30,
[2] = 150,
[3] = 300,
[4] = 500,
[5] = 800,
[6] = 1500,
[7] = 3000,
[8] = 6000,
[9] = 10000,
[10] = 20000
},
{
type = "attack",
name = "cooldown",
[1] = 35,
[2] = 35,
[3] = 35,
[4] = 35,
[5] = 35,
[6] = 35,
[7] = 50,
[8] = 50,
[9] = 55,
[10] = 57
},
{
type = "attribute",
name = "spawningTimeModifer",
[1] = 0,
[2] = 0,
[3] = 1,
[4] = 2,
[5] = 3,
[6] = 7,
[7] = 10,
[8] = 10,
[9] = 12,
[10] = 12
},
{
type = "attribute",
name = "pollutionToAttack",
[1] = 200,
[2] = 750,
[3] = 1750,
[4] = 3500,
[5] = 5000,
[6] = 10000,
[7] = 20000,
[8] = 25000,
[9] = 30000,
[10] = 40000
},
{
type = "attack",
name = "damage",
[1] = 7,
[2] = 15,
[3] = 22.5,
[4] = 35,
[5] = 45,
[6] = 60,
[7] = 75,
[8] = 90,
[9] = 150,
[10] = 200
},
{
type = "attribute",
name = "healing",
[1] = 0.01,
[2] = 0.01,
[3] = 0.015,
[4] = 0.02,
[5] = 0.05,
[6] = 0.075,
[7] = 0.1,
[8] = 0.12,
[9] = 0.14,
[10] = 0.16
},
{
type = "attribute",
name = "movement",
[1] = 0.17,
[2] = 0.17,
[3] = 0.1675,
[4] = 0.1675,
[5] = 0.165,
[6] = 0.165,
[7] = 0.16,
[8] = 0.16,
[9] = 0.1575,
[10] = 0.1575
},
{
type = "attribute",
name = "distancePerFrame",
[1] = 0.075,
[2] = 0.075,
[3] = 0.08,
[4] = 0.08,
[5] = 0.085,
[6] = 0.085,
[7] = 0.09,
[8] = 0.09,
[9] = 0.1,
[10] = 0.1
},
{
type = "resistance",
name = "explosion",
decrease = {
[1] = 0,
[2] = 0,
[3] = 0,
[4] = 0,
[5] = 0,
[6] = 0,
[7] = 10,
[8] = 12,
[9] = 14,
[10] = 15
},
percent = {
[1] = 0,
[2] = 0,
[3] = 0,
[4] = 10,
[5] = 12,
[6] = 12,
[7] = 13,
[8] = 13,
[9] = 14,
[10] = 15
}
},
{
type = "resistance",
name = "physical",
decrease = {
[1] = 5,
[2] = 5,
[3] = 7,
[4] = 10,
[5] = 13,
[6] = 13,
[7] = 16,
[8] = 16,
[9] = 19,
[10] = 23
},
percent = {
[1] = 65,
[2] = 65,
[3] = 70,
[4] = 75,
[5] = 75,
[6] = 80,
[7] = 85,
[8] = 85,
[9] = 90,
[10] = 90
}
},
{
type = "attack",
name = "range",
[1] = 0.5,
[2] = 0.5,
[3] = 0.75,
[4] = 0.75,
[5] = 1.0,
[6] = 1.0,
[7] = 1.25,
[8] = 1.50,
[9] = 1.75,
[10] = 2.0
}
},
unitSpawner = {
{
type = "attribute",
name = "health",
[1] = 700,
[2] = 1000,
[3] = 1500,
[4] = 3000,
[5] = 5000,
[6] = 7000,
[7] = 10000,
[8] = 14000,
[9] = 20000,
[10] = 30000
},
{
type = "attribute",
name = "healing",
[1] = 0.02,
[2] = 0.02,
[3] = 0.022,
[4] = 0.024,
[5] = 0.026,
[6] = 0.028,
[7] = 0.03,
[8] = 0.032,
[9] = 0.034,
[10] = 0.036
},
{
type = "attribute",
name = "spawingCooldownStart",
[1] = 360,
[2] = 360,
[3] = 355,
[4] = 355,
[5] = 350,
[6] = 350,
[7] = 345,
[8] = 345,
[9] = 340,
[10] = 340
},
{
type = "attribute",
name = "spawingCooldownEnd",
[1] = 150,
[2] = 150,
[3] = 145,
[4] = 145,
[5] = 140,
[6] = 140,
[7] = 135,
[8] = 135,
[9] = 130,
[10] = 130
},
{
type = "attribute",
name = "evolutionRequirement",
[1] = 0,
[2] = 0.1,
[3] = 0.2,
[4] = 0.3,
[5] = 0.4,
[6] = 0.5,
[7] = 0.6,
[8] = 0.7,
[9] = 0.8,
[10] = 0.9
},
{
type = "attribute",
name = "unitsOwned",
[1] = 7,
[2] = 7,
[3] = 8,
[4] = 8,
[5] = 9,
[6] = 9,
[7] = 10,
[8] = 10,
[9] = 11,
[10] = 11
},
{
type = "attribute",
name = "unitsToSpawn",
[1] = 5,
[2] = 5,
[3] = 6,
[4] = 6,
[5] = 7,
[6] = 7,
[7] = 8,
[8] = 8,
[9] = 9,
[10] = 9
},
{
type = "resistance",
name = "explosion",
decrease = {
[1] = 5,
[2] = 5,
[3] = 6,
[4] = 6,
[5] = 7,
[6] = 7,
[7] = 8,
[8] = 8,
[9] = 9,
[10] = 9
},
percent = {
[1] = 15,
[2] = 15,
[3] = 17,
[4] = 17,
[5] = 18,
[6] = 18,
[7] = 19,
[8] = 19,
[9] = 20,
[10] = 20
}
},
{
type = "resistance",
name = "fire",
decrease = {
[1] = 3,
[2] = 3,
[3] = 4,
[4] = 4,
[5] = 6,
[6] = 6,
[7] = 6,
[8] = 6,
[9] = 7,
[10] = 7
},
percent = {
[1] = 60,
[2] = 60,
[3] = 62,
[4] = 62,
[5] = 63,
[6] = 63,
[7] = 64,
[8] = 64,
[9] = 65,
[10] = 65
}
},
{
type = "resistance",
name = "physical",
decrease = {
[1] = 7,
[2] = 7,
[3] = 10,
[4] = 10,
[5] = 13,
[6] = 13,
[7] = 16,
[8] = 16,
[9] = 19,
[10] = 23
},
percent = {
[1] = 65,
[2] = 65,
[3] = 70,
[4] = 75,
[5] = 75,
[6] = 80,
[7] = 85,
[8] = 85,
[9] = 90,
[10] = 90
}
}
},
probabilityTable = {
[1] = 1,
[2] = 1,
[3] = 1,
[4] = 1,
[5] = 1,
[6] = 1,
[7] = 1,
[8] = 1,
[9] = 1,
[10] = 1,
}
},
createMeleeAttack,
{
unit = 10,
unitSpawner = PHYSICAL_NEST_VARIATIONS
},
{
unit = 10,
unitSpawner = PHYSICAL_NEST_TIERS
}
)
-- physical worms
buildWorm(
{
name = "physical-worm",
attributes = {
},
attack = {
damageType = "physical",
pointEffects = function (attributes)
return {
{
type= "create-entity",
entity_name = "small-scorchmark"
},
{
type= "create-entity",
entity_name = "explosion"
}
}
end,
softSmokeName = "physical-soft-smoke-rampant"
},
resistances = {},
scales = {
[1] = 0.7,
[2] = 0.8,
[3] = 0.9,
[4] = 1,
[5] = 1.1,
[6] = 1.2,
[7] = 1.3,
[8] = 1.4,
[9] = 1.5,
[10] = 1.6
},
attackName = "worm-physical",
tint = {r=0.85, g=0.85, b=0.83, a=0.65},
pTint = {r=0, g=0, b=0, a=1},
sTint = {r=0, g=0, b=0, a=1}
},
{
{
type = "attribute",
name = "health",
[1] = 400,
[2] = 700,
[3] = 1000,
[4] = 1500,
[5] = 1800,
[6] = 2000,
[7] = 3000,
[8] = 4000,
[9] = 5000,
[10] = 9000
},
{
type = "attack",
name = "cooldown",
[1] = 50,
[2] = 50,
[3] = 45,
[4] = 45,
[5] = 40,
[6] = 40,
[7] = 35,
[8] = 35,
[9] = 30,
[10] = 30
},
{
type = "attribute",
name = "evolutionRequirement",
[1] = 0,
[2] = 0.1,
[3] = 0.2,
[4] = 0.3,
[5] = 0.4,
[6] = 0.5,
[7] = 0.6,
[8] = 0.7,
[9] = 0.8,
[10] = 0.9
},
{
type = "attack",
name = "damage",
[1] = 12,
[2] = 20,
[3] = 25,
[4] = 30,
[5] = 35,
[6] = 40,
[7] = 50,
[8] = 60,
[9] = 70,
[10] = 80
},
{
type = "attribute",
name = "healing",
[1] = 0.01,
[2] = 0.01,
[3] = 0.015,
[4] = 0.02,
[5] = 0.05,
[6] = 0.075,
[7] = 0.1,
[8] = 0.12,
[9] = 0.14,
[10] = 0.16
},
{
type = "attribute",
name = "prepareRange",
[1] = 30,
[2] = 30,
[3] = 31,
[4] = 31,
[5] = 32,
[6] = 32,
[7] = 33,
[8] = 33,
[9] = 34,
[10] = 34
},
{
type = "attribute",
name = "foldingSpeed",
[1] = 0.15,
[2] = 0.15,
[3] = 0.16,
[4] = 0.16,
[5] = 0.16,
[6] = 0.17,
[7] = 0.17,
[8] = 0.18,
[9] = 0.18,
[10] = 0.19
},
{
type = "attribute",
name = "preparingSpeed",
[1] = 0.025,
[2] = 0.025,
[3] = 0.026,
[4] = 0.026,
[5] = 0.027,
[6] = 0.027,
[7] = 0.028,
[8] = 0.028,
[9] = 0.029,
[10] = 0.029
},
{
type = "resistance",
name = "explosion",
decrease = {
[1] = 0,
[2] = 0,
[3] = 5,
[4] = 5,
[5] = 8,
[6] = 8,
[7] = 10,
[8] = 10,
[9] = 12,
[10] = 12
},
percent = {
[1] = 0,
[2] = 0,
[3] = 10,
[4] = 10,
[5] = 20,
[6] = 20,
[7] = 30,
[8] = 30,
[9] = 40,
[10] = 40
}
},
{
type = "resistance",
name = "physical",
decrease = {
[1] = 7,
[2] = 7,
[3] = 10,
[4] = 10,
[5] = 13,
[6] = 13,
[7] = 16,
[8] = 16,
[9] = 19,
[10] = 23
},
percent = {
[1] = 65,
[2] = 65,
[3] = 70,
[4] = 75,
[5] = 75,
[6] = 80,
[7] = 85,
[8] = 85,
[9] = 90,
[10] = 90
}
},
{
type = "resistance",
name = "fire",
decrease = {
[1] = 3,
[2] = 3,
[3] = 4,
[4] = 4,
[5] = 6,
[6] = 6,
[7] = 6,
[8] = 6,
[9] = 7,
[10] = 7
},
percent = {
[1] = 70,
[2] = 70,
[3] = 72,
[4] = 72,
[5] = 73,
[6] = 73,
[7] = 74,
[8] = 74,
[9] = 75,
[10] = 75
}
},
{
type = "attack",
name = "range",
[1] = 21,
[2] = 22,
[3] = 23,
[4] = 23,
[5] = 24,
[6] = 26,
[7] = 26,
[8] = 28,
[9] = 30,
[10] = 32
},
{
type = "attack",
name = "radius",
[1] = 1.5,
[2] = 1.6,
[3] = 1.7,
[4] = 1.8,
[5] = 1.9,
[6] = 2.0,
[7] = 2.2,
[8] = 2.3,
[9] = 2.5,
[10] = 3.0
},
{
type = "attack",
name = "particleVerticalAcceleration",
[1] = 0.01,
[2] = 0.01,
[3] = 0.02,
[4] = 0.02,
[5] = 0.03,
[6] = 0.03,
[7] = 0.04,
[8] = 0.04,
[9] = 0.05,
[10] = 0.05
},
{
type = "attack",
name = "particleHoizontalSpeed",
[1] = 0.6,
[2] = 0.6,
[3] = 0.7,
[4] = 0.7,
[5] = 0.8,
[6] = 0.8,
[7] = 0.9,
[8] = 0.9,
[9] = 1,
[10] = 1
},
{
type = "attack",
name = "particleHoizontalSpeedDeviation",
[1] = 0.0025,
[2] = 0.0025,
[3] = 0.0024,
[4] = 0.0024,
[5] = 0.0023,
[6] = 0.0023,
[7] = 0.0022,
[8] = 0.0022,
[9] = 0.0021,
[10] = 0.0021
}
},
function (attributes)
createAcidBall(attributes)
return createFireAttack(attributes, attributes.name .. "-stream-rampant")
end,
PHYSICAL_WORM_VARIATIONS,
PHYSICAL_WORM_TIERS
)

944
prototypes/Suicide.lua Executable file
View File

@ -0,0 +1,944 @@
-- imports
local acidBall = require("utils/AttackAcidBall")
local biterUtils = require("utils/BiterUtils")
local stickerUtils = require("utils/StickerUtils")
local smokeUtils = require("utils/SmokeUtils")
local swarmUtils = require("SwarmUtils")
local colorUtils = require("utils/ColorUtils")
package.path = "../libs/?.lua;" .. package.path
local constants = require("Constants")
-- constants
local SUICIDE_NEST_TIERS = constants.SUICIDE_NEST_TIERS
local SUICIDE_NEST_VARIATIONS = constants.SUICIDE_NEST_VARIATIONS
local SUICIDE_WORM_TIERS = constants.SUICIDE_WORM_TIERS
local SUICIDE_WORM_VARIATIONS = constants.SUICIDE_WORM_VARIATIONS
-- imported functions
local makeColor = colorUtils.makeColor
local makeSmokeSoft = smokeUtils.makeSmokeSoft
local makeSticker = stickerUtils.makeSticker
local buildUnitSpawner = swarmUtils.buildUnitSpawner
local buildWorm = swarmUtils.buildWorm
local createAcidBall = acidBall.createAcidBall
local createFireAttack = biterUtils.createFireAttack
local createSuicideAttack = biterUtils.createSuicideAttack
makeSmokeSoft({name="suicide", softSmokeTint=makeColor(0.3, 0.75, 0.3, 0.1)})
-- suicide biters
buildUnitSpawner(
{
unit = {
name = "suicide-biter",
attributes = {
explosion = "blood-explosion-small"
},
attack = {
scorchmark = "small-scorchmark"
},
resistances = {},
type = "biter",
scales = {
[1] = 0.5,
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
tint1 = {r=0.56, g=0.46, b=0.42, a=0.65},
tint2 = {r=1, g=0.63, b=0, a=0.4}
},
unitSpawner = {
name = "suicide-biter-nest",
attributes = {},
resistances = {},
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
},
tint = {r=1.0, g=1.0, b=1.0, a=1.0}
}
},
{
unit = {
{
type = "attribute",
name = "health",
[1] = 7,
[2] = 42,
[3] = 75,
[4] = 125,
[5] = 200,
[6] = 350,
[7] = 750,
[8] = 1500,
[9] = 3000,
[10] = 5000
},
{
type = "attack",
name = "cooldown",
[1] = 35,
[2] = 35,
[3] = 35,
[4] = 35,
[5] = 35,
[6] = 35,
[7] = 50,
[8] = 50,
[9] = 55,
[10] = 57
},
{
type = "attribute",
name = "spawningTimeModifer",
[1] = 0,
[2] = 0,
[3] = 1,
[4] = 2,
[5] = 3,
[6] = 5,
[7] = 6,
[8] = 6,
[9] = 8,
[10] = 8
},
{
type = "attribute",
name = "pollutionToAttack",
[1] = 200,
[2] = 750,
[3] = 1750,
[4] = 3500,
[5] = 5000,
[6] = 10000,
[7] = 20000,
[8] = 25000,
[9] = 30000,
[10] = 40000
},
{
type = "attack",
mapping = "explosion",
[1] = "explosion",
[2] = "explosion",
[3] = "big-explosion",
[4] = "big-explosion",
[5] = "big-explosion",
[6] = "big-explosion",
[7] = "massive-explosion",
[8] = "massive-explosion",
[9] = "massive-explosion",
[10] = "massive-explosion"
},
{
type = "attack",
name = "radius",
[1] = 3.5,
[2] = 3.5,
[3] = 4,
[4] = 5,
[5] = 6,
[6] = 6,
[7] = 7,
[8] = 7,
[9] = 7.5,
[10] = 8
},
{
type = "attack",
name = "explosionDistance",
[1] = 2,
[2] = 2,
[3] = 2,
[4] = 2,
[5] = 2,
[6] = 2.5,
[7] = 2.5,
[8] = 2.5,
[9] = 3,
[10] = 3
},
{
type = "attack",
name = "explosionCount",
min = 2,
[1] = 2,
[2] = 3,
[3] = 4,
[4] = 5,
[5] = 6,
[6] = 8,
[7] = 10,
[8] = 12,
[9] = 13,
[10] = 14
},
{
type = "attack",
name = "damage",
[1] = 20,
[2] = 25,
[3] = 30,
[4] = 35,
[5] = 45,
[6] = 60,
[7] = 75,
[8] = 80,
[9] = 100,
[10] = 150
},
{
type = "attribute",
name = "healing",
[1] = 0.01,
[2] = 0.01,
[3] = 0.015,
[4] = 0.02,
[5] = 0.05,
[6] = 0.075,
[7] = 0.1,
[8] = 0.12,
[9] = 0.14,
[10] = 0.16
},
{
type = "attribute",
name = "movement",
[1] = 0.23,
[2] = 0.23,
[3] = 0.22,
[4] = 0.22,
[5] = 0.21,
[6] = 0.21,
[7] = 0.2,
[8] = 0.2,
[9] = 0.19,
[10] = 0.19
},
{
type = "attribute",
name = "distancePerFrame",
[1] = 0.12,
[2] = 0.145,
[3] = 0.17,
[4] = 0.21,
[5] = 0.21,
[6] = 0.22,
[7] = 0.22,
[8] = 0.23,
[9] = 0.23,
[10] = 0.24
},
{
type = "resistance",
name = "physical",
decrease = {
[1] = 0,
[2] = 0,
[3] = 4,
[4] = 5,
[5] = 6,
[6] = 8,
[7] = 9,
[8] = 9,
[9] = 10,
[10] = 10
},
percent = {
[1] = 0,
[2] = 0,
[3] = 0,
[4] = 10,
[5] = 12,
[6] = 12,
[7] = 13,
[8] = 13,
[9] = 14,
[10] = 15
}
},
{
type = "resistance",
name = "explosion",
decrease = {
[1] = -7,
[2] = -7,
[3] = -10,
[4] = -10,
[5] = -13,
[6] = -13,
[7] = -16,
[8] = -16,
[9] = -19,
[10] = -23
},
percent = {
[1] = -65,
[2] = -65,
[3] = -70,
[4] = -75,
[5] = -75,
[6] = -80,
[7] = -85,
[8] = -85,
[9] = -90,
[10] = -90
}
},
{
type = "attack",
name = "range",
[1] = 0.5,
[2] = 0.5,
[3] = 0.75,
[4] = 0.75,
[5] = 1.0,
[6] = 1.0,
[7] = 1.25,
[8] = 1.50,
[9] = 1.75,
[10] = 2.0
}
},
unitSpawner = {
{
type = "attribute",
name = "health",
[1] = 350,
[2] = 500,
[3] = 750,
[4] = 1500,
[5] = 2500,
[6] = 3500,
[7] = 5000,
[8] = 7000,
[9] = 10000,
[10] = 15000
},
{
type = "attribute",
name = "healing",
[1] = 0.02,
[2] = 0.02,
[3] = 0.022,
[4] = 0.024,
[5] = 0.026,
[6] = 0.028,
[7] = 0.03,
[8] = 0.032,
[9] = 0.034,
[10] = 0.036
},
{
type = "attribute",
name = "spawingCooldownStart",
[1] = 330,
[2] = 330,
[3] = 325,
[4] = 325,
[5] = 320,
[6] = 320,
[7] = 315,
[8] = 315,
[9] = 310,
[10] = 310
},
{
type = "attribute",
name = "spawingCooldownEnd",
[1] = 120,
[2] = 120,
[3] = 115,
[4] = 115,
[5] = 110,
[6] = 110,
[7] = 105,
[8] = 105,
[9] = 100,
[10] = 100
},
{
type = "attribute",
name = "evolutionRequirement",
[1] = 0,
[2] = 0.1,
[3] = 0.2,
[4] = 0.3,
[5] = 0.4,
[6] = 0.5,
[7] = 0.6,
[8] = 0.7,
[9] = 0.8,
[10] = 0.9
},
{
type = "attribute",
name = "unitsOwned",
[1] = 6,
[2] = 6,
[3] = 7,
[4] = 7,
[5] = 8,
[6] = 8,
[7] = 9,
[8] = 9,
[9] = 10,
[10] = 10
},
{
type = "attribute",
name = "unitsToSpawn",
[1] = 3,
[2] = 3,
[3] = 4,
[4] = 5,
[5] = 5,
[6] = 6,
[7] = 6,
[8] = 7,
[9] = 7,
[10] = 8
},
{
type = "resistance",
name = "physical",
decrease = {
[1] = 2,
[2] = 2,
[3] = 4,
[4] = 4,
[5] = 6,
[6] = 6,
[7] = 10,
[8] = 12,
[9] = 12,
[10] = 14
},
percent = {
[1] = 15,
[2] = 15,
[3] = 17,
[4] = 17,
[5] = 18,
[6] = 18,
[7] = 19,
[8] = 19,
[9] = 20,
[10] = 20
}
},
{
type = "resistance",
name = "explosion",
decrease = {
[1] = 7,
[2] = 7,
[3] = 10,
[4] = 10,
[5] = 13,
[6] = 13,
[7] = 16,
[8] = 16,
[9] = 19,
[10] = 23
},
percent = {
[1] = 65,
[2] = 65,
[3] = 70,
[4] = 75,
[5] = 75,
[6] = 80,
[7] = 85,
[8] = 85,
[9] = 90,
[10] = 90
}
},
{
type = "resistance",
name = "fire",
decrease = {
[1] = 1,
[2] = 1,
[3] = 2,
[4] = 2,
[5] = 3,
[6] = 3,
[7] = 4,
[8] = 4,
[9] = 5,
[10] = 5
},
percent = {
[1] = 40,
[2] = 40,
[3] = 42,
[4] = 42,
[5] = 43,
[6] = 43,
[7] = 44,
[8] = 44,
[9] = 45,
[10] = 45
}
}
},
probabilityTable = {
[1] = 1,
[2] = 1,
[3] = 1,
[4] = 1,
[5] = 1,
[6] = 1,
[7] = 1,
[8] = 1,
[9] = 1,
[10] = 1,
}
},
createSuicideAttack,
{
unit = 10,
unitSpawner = SUICIDE_NEST_VARIATIONS
},
{
unit = 10,
unitSpawner = SUICIDE_NEST_TIERS
}
)
-- suicide worms
buildWorm(
{
name = "suicide-worm",
attributes = {},
attack = {
stickerAnimation = {
filename = "__base__/graphics/entity/slowdown-sticker/slowdown-sticker.png",
priority = "extra-high",
width = 11,
height = 11,
frame_count = 13,
animation_speed = 0.4
},
areaEffects = function (attributes)
return {
{
type = "damage",
damage = { amount = attributes.damage, type = "acid" }
},
{
type = "create-sticker",
sticker = attributes.name .. "-sticker-rampant"
}
}
end,
softSmokeName = "suicide-soft-smoke-rampant"
},
resistances = {},
scales = {
[1] = 0.5,
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
attackName = "worm-suicide-ball",
tint = {r=0.56, g=0.46, b=0.42, a=0.65},
pTint = {r=0, g=1, b=1, a=0.5},
sTint = {r=0, g=1, b=1, a=0.5}
},
{
{
type = "attribute",
name = "health",
[1] = 200,
[2] = 350,
[3] = 500,
[4] = 750,
[5] = 900,
[6] = 1000,
[7] = 1500,
[8] = 1500,
[9] = 2500,
[10] = 4500
},
{
type = "attack",
name = "cooldown",
[1] = 50,
[2] = 50,
[3] = 45,
[4] = 45,
[5] = 40,
[6] = 40,
[7] = 35,
[8] = 35,
[9] = 30,
[10] = 30
},
{
type = "attack",
name = "stickerMovementModifier",
[1] = 1.2,
[2] = 1.2,
[3] = 1.3,
[4] = 1.3,
[5] = 1.4,
[6] = 1.4,
[7] = 1.5,
[8] = 1.5,
[9] = 1.6,
[10] = 1.6
},
{
type = "attack",
name = "stickerDuration",
[1] = 1800,
[2] = 1800,
[3] = 1900,
[4] = 1900,
[5] = 2000,
[6] = 2000,
[7] = 2100,
[8] = 2100,
[9] = 2200,
[10] = 2200
},
{
type = "attribute",
name = "evolutionRequirement",
[1] = 0,
[2] = 0.1,
[3] = 0.2,
[4] = 0.3,
[5] = 0.4,
[6] = 0.5,
[7] = 0.6,
[8] = 0.7,
[9] = 0.8,
[10] = 0.9
},
{
type = "attack",
name = "damage",
[1] = 12,
[2] = 20,
[3] = 25,
[4] = 30,
[5] = 35,
[6] = 40,
[7] = 50,
[8] = 60,
[9] = 70,
[10] = 80
},
{
type = "attribute",
name = "healing",
[1] = 0.01,
[2] = 0.01,
[3] = 0.015,
[4] = 0.02,
[5] = 0.05,
[6] = 0.075,
[7] = 0.1,
[8] = 0.12,
[9] = 0.14,
[10] = 0.16
},
{
type = "attribute",
name = "prepareRange",
[1] = 30,
[2] = 30,
[3] = 31,
[4] = 31,
[5] = 32,
[6] = 32,
[7] = 33,
[8] = 33,
[9] = 34,
[10] = 34
},
{
type = "attribute",
name = "foldingSpeed",
[1] = 0.15,
[2] = 0.15,
[3] = 0.16,
[4] = 0.16,
[5] = 0.16,
[6] = 0.17,
[7] = 0.17,
[8] = 0.18,
[9] = 0.18,
[10] = 0.19
},
{
type = "attribute",
name = "preparingSpeed",
[1] = 0.025,
[2] = 0.025,
[3] = 0.026,
[4] = 0.026,
[5] = 0.027,
[6] = 0.027,
[7] = 0.028,
[8] = 0.028,
[9] = 0.029,
[10] = 0.029
},
{
type = "resistance",
name = "physical",
decrease = {
[1] = 0,
[2] = 0,
[3] = 5,
[4] = 5,
[5] = 8,
[6] = 8,
[7] = 10,
[8] = 10,
[9] = 12,
[10] = 12
}
},
{
type = "resistance",
name = "explosion",
decrease = {
[1] = 7,
[2] = 7,
[3] = 10,
[4] = 10,
[5] = 13,
[6] = 13,
[7] = 16,
[8] = 16,
[9] = 19,
[10] = 23
},
percent = {
[1] = 65,
[2] = 65,
[3] = 70,
[4] = 75,
[5] = 75,
[6] = 80,
[7] = 85,
[8] = 85,
[9] = 90,
[10] = 90
}
},
{
type = "resistance",
name = "fire",
decrease = {
[1] = 1,
[2] = 1,
[3] = 2,
[4] = 2,
[5] = 3,
[6] = 3,
[7] = 4,
[8] = 4,
[9] = 5,
[10] = 5
},
percent = {
[1] = 40,
[2] = 40,
[3] = 42,
[4] = 42,
[5] = 43,
[6] = 43,
[7] = 44,
[8] = 44,
[9] = 45,
[10] = 45
}
},
{
type = "attack",
name = "range",
[1] = 21,
[2] = 22,
[3] = 23,
[4] = 23,
[5] = 24,
[6] = 26,
[7] = 26,
[8] = 28,
[9] = 30,
[10] = 32
},
{
type = "attack",
name = "radius",
[1] = 1.5,
[2] = 1.6,
[3] = 1.7,
[4] = 1.8,
[5] = 1.9,
[6] = 2.0,
[7] = 2.2,
[8] = 2.3,
[9] = 2.5,
[10] = 3.0
},
{
type = "attack",
name = "particleVerticalAcceleration",
[1] = 0.01,
[2] = 0.01,
[3] = 0.02,
[4] = 0.02,
[5] = 0.03,
[6] = 0.03,
[7] = 0.04,
[8] = 0.04,
[9] = 0.05,
[10] = 0.05
},
{
type = "attack",
name = "particleHoizontalSpeed",
[1] = 0.6,
[2] = 0.6,
[3] = 0.7,
[4] = 0.7,
[5] = 0.8,
[6] = 0.8,
[7] = 0.9,
[8] = 0.9,
[9] = 1,
[10] = 1
},
{
type = "attack",
name = "particleHoizontalSpeedDeviation",
[1] = 0.0025,
[2] = 0.0025,
[3] = 0.0024,
[4] = 0.0024,
[5] = 0.0023,
[6] = 0.0023,
[7] = 0.0022,
[8] = 0.0022,
[9] = 0.0021,
[10] = 0.0021
}
},
function (attributes)
makeSticker(attributes)
createAcidBall(attributes)
return createFireAttack(attributes, attributes.name .. "-stream-rampant")
end,
SUICIDE_WORM_VARIATIONS,
SUICIDE_WORM_TIERS
)

View File

@ -9,6 +9,8 @@ local mathUtils = require("libs/MathUtils")
local gaussianRandomRangeRG = mathUtils.gaussianRandomRangeRG
local roundToNearest = mathUtils.roundToNearest
local mMax = math.max
local mMin = math.min
@ -30,7 +32,7 @@ local makeUnitSpawner = biterUtils.makeUnitSpawner
-- module code
local function unitSetToProbabilityTable(points, upgradeTable, unitSet)
local function unitSetToProbabilityTable(upgradeTable, unitSet)
local dividers = {}
for i=1,#unitSet do
@ -38,6 +40,7 @@ local function unitSetToProbabilityTable(points, upgradeTable, unitSet)
end
if upgradeTable then
local points = #upgradeTable * 10
while (points > 0) do
local index = mFloor(xorRandom() * #upgradeTable)+1
local upgrade = upgradeTable[index]
@ -119,88 +122,106 @@ local function unitSetToProbabilityTable(points, upgradeTable, unitSet)
return result
end
local function processUpgradeTable(upgradeTable)
for i=1,#upgradeTable do
local bonuses = upgradeTable[i]
for ii=1,#bonuses do
local bonus = bonuses[ii]
if (bonus.type == "attribute") or (bonus.type == "attack") then
if not bonus.mapping then
for x = 1, #bonus do
bonus[x] = bonus[x] * 0.10
end
end
elseif (bonus.type == "resistance") then
if bonus.decrease then
for x = 1, #bonus.decrease do
bonus.decrease[x] = bonus.decrease[x] * 0.10
end
end
if bonus.percent then
for x = 1, #bonus.percent do
bonus.percent[x] = bonus.percent[x] * 0.10
end
end
end
end
end
return upgradeTable
end
-- local function processUpgradeTable(upgradeTable)
local function upgradeEntity(points, entity, upgradeTable, tier)
local remainingPoints = points
-- for i=1,#upgradeTable do
-- local bonuses = upgradeTable[i]
-- for ii=1,#bonuses do
-- local bonus = bonuses[ii]
-- if (bonus.type == "attribute") or (bonus.type == "attack") then
-- if not bonus.mapping then
-- for x = 1, #bonus do
-- bonus[x] = bonus[x] * 0.10
-- end
-- end
-- elseif (bonus.type == "resistance") then
-- if bonus.decrease then
-- for x = 1, #bonus.decrease do
-- bonus.decrease[x] = bonus.decrease[x] * 0.10
-- end
-- end
-- if bonus.percent then
-- for x = 1, #bonus.percent do
-- bonus.percent[x] = bonus.percent[x] * 0.10
-- end
-- end
-- end
-- end
-- end
-- return upgradeTable
-- end
local function upgradeEntity(entity, upgradeTable, tier)
if upgradeTable then
while (remainingPoints > 0) do
local upgrade = upgradeTable[mFloor(xorRandom() * #upgradeTable)+1]
for i=1, #upgrade do
local bonus = upgrade[i]
if (bonus.type == "attribute") then
if bonus.mapping then
entity.attributes[bonus.name] = bonus.mapping[entity.attributes[bonus.name] or "default"]
else
local adj = bonus[tier]
adj = gaussianRandomRangeRG(adj, adj * 0.2, adj * 0.875, adj * 1.25, xorRandom)
entity.attributes[bonus.name] = (entity.attributes[bonus.name] or 0) + adj
end
end
if (bonus.type == "resistance") then
local field = bonus.name
if not entity.resistances[field] then
entity.resistances[field] = {}
end
local adj
if bonus.decrease then
adj = bonus.decrease[tier]
entity.resistances[field].decrease = (entity.resistances[field].decrease or 0) + adj
end
if bonus.percent then
adj = bonus.percent[tier]
entity.resistances[field].percent = mMin((entity.resistances[field].percent or 0) + adj, 100)
end
end
if (bonus.type == "attack") then
if bonus.mapping then
entity.attack[bonus.name] = bonus.mapping[entity.attack[bonus.name] or "default"]
else
local adj = bonus[tier]
-- if adj < 0 then
-- adj = -adj
-- adj = -gaussianRandomRangeRG(adj, adj * 0.2, adj * 0.75, adj * 1.25, xorRandom)
-- else
adj = gaussianRandomRangeRG(adj, adj * 0.2, adj * 0.875, adj * 1.25, xorRandom)
--end
entity.attack[bonus.name] = (entity.attack[bonus.name] or 0) + adj
for upgradeIndex=1, #upgradeTable do
local upgrade = upgradeTable[upgradeIndex]
if (upgrade.type == "attribute") then
if upgrade.mapping then
entity.attributes[upgrade.mapping] = upgrade[tier]
else
local adj = upgrade[tier]
local min = upgrade.min or adj * 0.70
local max = upgrade.max or adj * 1.30
if (adj < 0) then
local t = min
min = max
max = t
end
adj = roundToNearest(gaussianRandomRangeRG(adj, adj * 0.2, min, max, xorRandom), 0.001)
entity.attributes[upgrade.name] = (entity.attributes[upgrade.name] or 0) + adj
end
end
if (upgrade.type == "resistance") then
local field = upgrade.name
if not entity.resistances[field] then
entity.resistances[field] = {}
end
local adj
if upgrade.decrease then
adj = upgrade.decrease[tier]
local min = upgrade.min or adj * 0.70
local max = upgrade.max or adj * 1.30
if (adj < 0) then
local t = min
min = max
max = t
end
adj = roundToNearest(gaussianRandomRangeRG(adj, adj * 0.2, min, max, xorRandom), 0.001)
entity.resistances[field].decrease = (entity.resistances[field].decrease or 0) + adj
end
if upgrade.percent then
adj = upgrade.percent[tier]
local min = upgrade.min or adj * 0.70
local max = upgrade.max or adj * 1.30
if (adj < 0) then
local t = min
min = max
max = t
end
adj = roundToNearest(gaussianRandomRangeRG(adj, adj * 0.2, min, max, xorRandom), 0.001)
entity.resistances[field].percent = mMin((entity.resistances[field].percent or 0) + adj, 100)
end
end
if (upgrade.type == "attack") then
if upgrade.mapping then
entity.attack[upgrade.mapping] = upgrade[tier]
else
local adj = upgrade[tier]
local min = upgrade.min or adj * 0.70
local max = upgrade.max or adj * 1.30
if (adj < 0) then
local t = min
min = max
max = t
end
adj = roundToNearest(gaussianRandomRangeRG(adj, adj * 0.2, min, max, xorRandom), 0.001)
entity.attack[upgrade.name] = (entity.attack[upgrade.name] or 0) + adj
end
end
remainingPoints = remainingPoints - 1
end
end
end
@ -229,16 +250,21 @@ local function generateApperance(unit, tier)
unit.attack.scale = scale
unit.attack.tint = tint
end
else
end
if unit.tint1 and unit.tint2 then
local tint1 = calculateRGBa(unit.tint1, tier)
local tint2 = calculateRGBa(unit.tint2, tier)
unit.attributes.tint1 = tint1
unit.attributes.tint2 = tint2
unit.attack.scale = scale
unit.attack.tint1 = tint1
unit.attack.tint2 = tint2
if unit.attack then
unit.attack.scale = scale
unit.attack.tint1 = tint1
unit.attack.tint2 = tint2
end
end
if unit.attack then
if unit.pTint then
unit.attack.pTint = calculateRGBa(unit.pTint, tier)
end
@ -251,7 +277,7 @@ local function generateApperance(unit, tier)
end
end
local function buildUnits(startingPoints, template, attackGenerator, upgradeTable, variations, tiers)
local function buildUnits(template, attackGenerator, upgradeTable, variations, tiers)
local unitSet = {}
for t=1, tiers do
@ -261,7 +287,7 @@ local function buildUnits(startingPoints, template, attackGenerator, upgradeTabl
local unit = deepcopy(template)
unit.name = unit.name .. "-v" .. i .. "-t" .. t
generateApperance(unit, t)
upgradeEntity(startingPoints, unit, upgradeTable, t)
upgradeEntity(unit, upgradeTable, t)
if unit.attackName then
unit.attack.name = unit.attackName .. "-v" .. i .. "-t" .. t
@ -294,15 +320,8 @@ local function buildUnits(startingPoints, template, attackGenerator, upgradeTabl
end
function swarmUtils.buildUnitSpawner(templates, upgradeTable, attackGenerator, variations, tiers)
local unitPoints = #upgradeTable.unit * 10
local unitSpawnerPoints = #upgradeTable.unitSpawner * 10
local probabilityPoints = #upgradeTable.probabilityTable * 10
processUpgradeTable(upgradeTable.unit)
processUpgradeTable(upgradeTable.unitSpawner)
local unitSet = buildUnits(unitPoints,
templates.unit,
local unitSet = buildUnits(templates.unit,
attackGenerator,
upgradeTable.unit,
variations.unit,
@ -313,11 +332,10 @@ function swarmUtils.buildUnitSpawner(templates, upgradeTable, attackGenerator, v
for i=1,variations.unitSpawner do
local unitSpawner = deepcopy(templates.unitSpawner)
unitSpawner.name = unitSpawner.name .. "-v" .. i .. "-t" .. t
local unitTable = unitSetToProbabilityTable(probabilityPoints,
upgradeTable.probabilityTable,
local unitTable = unitSetToProbabilityTable(upgradeTable.probabilityTable,
unitSet)
generateApperance(unitSpawner, t)
upgradeEntity(unitSpawnerPoints, unitSpawner, upgradeTable.unitSpawner, t)
upgradeEntity(unitSpawner, upgradeTable.unitSpawner, t)
if unitSpawner.autoplace then
unitSpawner.attributes["autoplace"] = unitSpawner.autoplace[t]
@ -335,16 +353,13 @@ function swarmUtils.buildUnitSpawner(templates, upgradeTable, attackGenerator, v
end
function swarmUtils.buildWorm(template, upgradeTable, attackGenerator, variations, tiers)
local wormPoints = #upgradeTable * 10
processUpgradeTable(upgradeTable)
for t=1, tiers do
for i=1,variations do
local worm = deepcopy(template)
worm.name = worm.name .. "-v" .. i .. "-t" .. t
generateApperance(worm, t)
upgradeEntity(wormPoints, worm, upgradeTable, t)
upgradeEntity(worm, upgradeTable, t)
if worm.attackName then
worm.attack.name = worm.attackName .. "-v" .. i .. "-t" .. t

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,7 @@ local acidBall = {}
function acidBall.createAcidBall(attributes)
local templateDamage = { amount = attributes.damage, type = "acid" }
local templateDamage = { amount = attributes.damage, type = attributes.damageType or "acid" }
local templateArea = {
type = "area",
radius = attributes.radius,
@ -25,7 +25,7 @@ function acidBall.createAcidBall(attributes)
{
{
type = "instant",
target_effects =
target_effects = (attributes.areaEffects and attributes.areaEffects(attributes)) or
{
{
type = "damage",
@ -42,15 +42,15 @@ function acidBall.createAcidBall(attributes)
type = "direct",
action_delivery = {
type = "instant",
target_effects = {
type= "create-entity",
entity_name = "acid-splash-purple"
}
target_effects = (attributes.pointEffects and attributes.pointEffects(attributes)) or
{
type= "create-entity",
entity_name = attributes.crater or "acid-splash-purple"
}
}
}
}
local template = {
name = attributes.name,
particleTint = attributes.pTint,

View File

@ -1,3 +1,5 @@
local attackFlame = {}
-- imported
local streamUtils = require("StreamUtils")
@ -15,178 +17,65 @@ local makeSpreadEffect = fireUtils.makeSpreadEffect
-- module code
local name = "acid-flame"
local spawnEntityName = makeSpreadEffect({
name = name,
smokeWithoutGlowTint = makeColor(0.25,0.75,0.1, 0.25)
})
local fireName = makeFire({
name = name,
fireTint = {r=0, g=0.9, b=0, a=0.5},
smokeWithGlowTint = {r=0.2, g=0.8, b=0.2, a=0.25},
spawnEntityName = spawnEntityName
})
local stickerName = makeSticker({
name = name,
spawnEntityName = spawnEntityName
})
makeStream({
name = name,
particleTint = {r=0, g=1, b=1, a=0.5},
spineAnimationTint = {r=0, g=1, b=1, a=0.5},
softSmokeTint = makeColor(0.3, 0.75, 0.3, 0.1),
actions = {
{
type = "area",
radius = 2.5,
action_delivery =
{
type = "instant",
target_effects =
{
function attackFlame.makeAttackFlame(attributes)
local name = attributes.name .. "-flame-rampant"
local spawnEntityName = makeSpreadEffect({
name = name,
smokeWithoutGlowTint = makeColor(0.25,0.75,0.1, 0.25)
})
local fireName = makeFire({
name = name,
fireTint = {r=0, g=0.9, b=0, a=0.5},
smokeWithGlowTint = {r=0.2, g=0.8, b=0.2, a=0.25},
spawnEntityName = spawnEntityName
})
local stickerName = makeSticker({
name = name,
spawnEntityName = spawnEntityName
})
makeStream({
name = name,
particleTint = {r=0, g=1, b=1, a=0.5},
spineAnimationTint = {r=0, g=1, b=1, a=0.5},
softSmokeTint = makeColor(0.3, 0.75, 0.3, 0.1),
actions = {
{
type = "area",
radius = 2.5,
action_delivery =
{
type = "instant",
target_effects =
{
type = "create-sticker",
sticker = stickerName
},
{
type = "damage",
damage = { amount = 1, type = "fire" }
},
{
type = "damage",
damage = { amount = 1, type = "acid" }
{
type = "create-sticker",
sticker = stickerName
},
{
type = "damage",
damage = { amount = 1, type = "fire" }
},
{
type = "damage",
damage = { amount = 1, type = "acid" }
}
}
}
}
},
{
type = "direct",
action_delivery = {
type = "instant",
target_effects = {
type= "create-fire",
entity_name = fireName
}
},
{
type = "direct",
action_delivery = {
type = "instant",
target_effects = {
type= "create-fire",
entity_name = fireName
}
}
}
}
}
})
})
end
--
name = "acid-flame-1"
spawnEntityName = makeSpreadEffect({
name = name,
smokeWithoutGlowTint = makeColor(0.25,0.75,0.1, 0.25),
})
fireName = makeFire({
name = name,
fireTint = {r=0, g=0.9, b=0, a=0.5},
smokeWithGlowTint = {r=0.2, g=0.8, b=0.2, a=0.25},
spawnEntityName = spawnEntityName
})
stickerName = makeSticker({
name = name,
spawnEntityName = spawnEntityName
})
makeStream({
name = name,
particleTint = {r=0, g=1, b=1, a=0.5},
spineAnimationTint = {r=0, g=1, b=1, a=0.5},
softSmokeTint = makeColor(0.3, 0.75, 0.3, 0.1),
actions = {
{
type = "area",
radius = 2.5,
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "create-sticker",
sticker = stickerName
},
{
type = "damage",
damage = { amount = 1, type = "fire" }
},
{
type = "damage",
damage = { amount = 2, type = "acid" }
}
}
}
},
{
type = "direct",
action_delivery = {
type = "instant",
target_effects = {
type= "create-fire",
entity_name = fireName
}
}
}
}
})
--
name = "acid-flame-2"
spawnEntityName = makeSpreadEffect({
name = name,
smokeWithoutGlowTint = makeColor(0.25,0.75,0.1, 0.25),
})
fireName = makeFire({
name = name,
fireTint = {r=0, g=0.9, b=0, a=0.5},
smokeWithGlowTint = {r=0.2, g=0.8, b=0.2, a=0.25},
spawnEntityName = spawnEntityName
})
stickerName = makeSticker({
name = name,
spawnEntityName = spawnEntityName
})
makeStream({
name = name,
particleTint = {r=0, g=1, b=1, a=0.5},
spineAnimationTint = {r=0, g=1, b=1, a=0.5},
softSmokeTint = makeColor(0.3, 0.75, 0.3, 0.1),
actions = {
{
type = "area",
radius = 2.5,
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "create-sticker",
sticker = stickerName
},
{
type = "damage",
damage = { amount = 2, type = "fire" }
},
{
type = "damage",
damage = { amount = 3, type = "acid" }
}
}
}
},
{
type = "direct",
action_delivery = {
type = "instant",
target_effects = {
type= "create-fire",
entity_name = fireName
}
}
}
}
})
return attackFlame

153
prototypes/utils/BeamUtils.lua Executable file
View File

@ -0,0 +1,153 @@
local beamUtils = {}
function beamUtils.makeBeam(attributes)
local result =
{
type = "beam",
flags = {"not-on-map"},
width = attributes.width or 0.5,
damage_interval = attributes.damageInterval or 20,
action =
{
type = "direct",
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "damage",
damage = { amount = attributes.damage or 10, type = attributes.damageType or "electric"}
}
}
}
},
start =
{
filename = "__base__/graphics/entity/beam/tileable-beam-START.png",
line_length = 4,
width = 52,
height = 40,
frame_count = 16,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.03125, 0},
hr_version = {
filename = "__base__/graphics/entity/beam/hr-tileable-beam-START.png",
line_length = 4,
width = 94,
height = 66,
frame_count = 16,
axially_symmetrical = false,
direction_count = 1,
shift = {0.53125, 0},
scale = 0.5,
}
},
ending =
{
filename = "__base__/graphics/entity/beam/tileable-beam-END.png",
line_length = 4,
width = 49,
height = 54,
frame_count = 16,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.046875, 0},
hr_version = {
filename = "__base__/graphics/entity/beam/hr-tileable-beam-END.png",
line_length = 4,
width = 91,
height = 93,
frame_count = 16,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.078125, -0.046875},
scale = 0.5,
}
},
head =
{
filename = "__base__/graphics/entity/beam/beam-head.png",
line_length = 16,
width = 45,
height = 39,
frame_count = 16,
animation_speed = 0.5,
blend_mode = "additive-soft",
},
tail =
{
filename = "__base__/graphics/entity/beam/beam-tail.png",
line_length = 16,
width = 45,
height = 39,
frame_count = 16,
blend_mode = "additive-soft",
},
body =
{
{
filename = "__base__/graphics/entity/beam/beam-body-1.png",
line_length = 16,
width = 45,
height = 39,
frame_count = 16,
blend_mode = "additive-soft",
},
{
filename = "__base__/graphics/entity/beam/beam-body-2.png",
line_length = 16,
width = 45,
height = 39,
frame_count = 16,
blend_mode = "additive-soft",
},
{
filename = "__base__/graphics/entity/beam/beam-body-3.png",
line_length = 16,
width = 45,
height = 39,
frame_count = 16,
blend_mode = "additive-soft",
},
{
filename = "__base__/graphics/entity/beam/beam-body-4.png",
line_length = 16,
width = 45,
height = 39,
frame_count = 16,
blend_mode = "additive-soft",
},
{
filename = "__base__/graphics/entity/beam/beam-body-5.png",
line_length = 16,
width = 45,
height = 39,
frame_count = 16,
blend_mode = "additive-soft",
},
{
filename = "__base__/graphics/entity/beam/beam-body-6.png",
line_length = 16,
width = 45,
height = 39,
frame_count = 16,
blend_mode = "additive-soft",
},
}
}
result.working_sound =
{
{
filename = "__base__/sound/fight/electric-beam.ogg",
volume = 0.7
}
}
result.name = attributes.name .. "-beam-rampant"
data:extend({result})
end
return beamUtils

View File

@ -20,27 +20,27 @@ function biterFunctions.makeSpitterCorpse(attributes)
animation = spitterdyinganimation(attributes.scale, attributes.tint)
}
})
return name
return name
end
function biterFunctions.makeBiterCorpse(attributes)
local name = attributes.name .. "-corpse-rampant"
data:extend({
{
type = "corpse",
name = name,
icon = "__base__/graphics/icons/big-biter-corpse.png",
icon_size = 32,
selectable_in_game = false,
selection_box = {{-1, -1}, {1, 1}},
subgroup="corpses",
order = "c[corpse]-b[spitter]-a[small]",
flags = {"placeable-neutral", "placeable-off-grid", "building-direction-8-way", "not-on-map"},
dying_speed = 0.04,
time_before_removed = 15 * 60 * 60,
final_render_layer = "corpse",
animation = biterdieanimation(attributes.scale, attributes.tint1, attributes.tint2)
}
{
type = "corpse",
name = name,
icon = "__base__/graphics/icons/big-biter-corpse.png",
icon_size = 32,
selectable_in_game = false,
selection_box = {{-1, -1}, {1, 1}},
subgroup="corpses",
order = "c[corpse]-b[spitter]-a[small]",
flags = {"placeable-neutral", "placeable-off-grid", "building-direction-8-way", "not-on-map"},
dying_speed = 0.04,
time_before_removed = 15 * 60 * 60,
final_render_layer = "corpse",
animation = biterdieanimation(attributes.scale, attributes.tint1, attributes.tint2)
}
})
return name
end
@ -49,26 +49,26 @@ function biterFunctions.makeUnitSpawnerCorpse(attributes)
local name = attributes.name .. "-corpse-rampant"
data:extend({
{
type = "corpse",
name = name,
flags = {"placeable-neutral", "placeable-off-grid", "not-on-map"},
icon = "__base__/graphics/icons/biter-spawner-corpse.png",
icon_size = 32,
collision_box = {{-2, -2}, {2, 2}},
selection_box = {{-2, -2}, {2, 2}},
selectable_in_game = false,
dying_speed = 0.04,
time_before_removed = 15 * 60 * 60,
subgroup="corpses",
order = "c[corpse]-c[spitter-spawner]",
final_render_layer = "remnants",
animation =
{
spawner_die_animation(0, attributes.tint),
spawner_die_animation(1, attributes.tint),
spawner_die_animation(2, attributes.tint),
spawner_die_animation(3, attributes.tint)
}
type = "corpse",
name = name,
flags = {"placeable-neutral", "placeable-off-grid", "not-on-map"},
icon = "__base__/graphics/icons/biter-spawner-corpse.png",
icon_size = 32,
collision_box = {{-2, -2}, {2, 2}},
selection_box = {{-2, -2}, {2, 2}},
selectable_in_game = false,
dying_speed = 0.04,
time_before_removed = 15 * 60 * 60,
subgroup="corpses",
order = "c[corpse]-c[spitter-spawner]",
final_render_layer = "remnants",
animation =
{
spawner_die_animation(0, attributes.tint),
spawner_die_animation(1, attributes.tint),
spawner_die_animation(2, attributes.tint),
spawner_die_animation(3, attributes.tint)
}
}
})
return name
@ -78,19 +78,19 @@ function biterFunctions.makeWormCorpse(attributes)
local name = attributes.name .. "-corpse-rampant"
data:extend({
{
type = "corpse",
name = name,
icon = "__base__/graphics/icons/medium-worm-corpse.png",
icon_size = 32,
selection_box = {{-0.8, -0.8}, {0.8, 0.8}},
selectable_in_game = false,
subgroup="corpses",
order = "c[corpse]-c[worm]-b[medium]",
flags = {"placeable-neutral", "placeable-off-grid", "building-direction-8-way", "not-repairable", "not-on-map"},
dying_speed = 0.01,
time_before_removed = 15 * 60 * 60,
final_render_layer = "corpse",
animation = worm_die_animation(attributes.scale, attributes.tint)
type = "corpse",
name = name,
icon = "__base__/graphics/icons/medium-worm-corpse.png",
icon_size = 32,
selection_box = {{-0.8, -0.8}, {0.8, 0.8}},
selectable_in_game = false,
subgroup="corpses",
order = "c[corpse]-c[worm]-b[medium]",
flags = {"placeable-neutral", "placeable-off-grid", "building-direction-8-way", "not-repairable", "not-on-map"},
dying_speed = 0.01,
time_before_removed = 15 * 60 * 60,
final_render_layer = "corpse",
animation = worm_die_animation(attributes.scale, attributes.tint)
}
})
return name
@ -271,16 +271,16 @@ function biterFunctions.makeWorm(name, attributes, attack, wormResistances)
dying_explosion = "blood-explosion-big",
inventory_size = attributes.inventorySize,
dying_sound = make_worm_dying_sounds(0.9),
folded_speed = attributes.foldedSpeed or 0.01,
folded_speed = 0.01,
folded_animation = worm_folded_animation(attributes.scale, attributes.tint),
preparing_speed = attributes.preparingSpeed or 0.025,
preparing_animation = worm_preparing_animation(attributes.scale, attributes.tint, "forward"),
prepared_speed = attributes.preparedSpeed or 0.015,
prepared_speed = 0.015,
prepared_animation = worm_prepared_animation(attributes.scale, attributes.tint),
starting_attack_speed = attributes.attackSpeed or 0.03,
starting_attack_speed = 0.03,
starting_attack_animation = worm_attack_animation(attributes.scale, attributes.tint, "forward"),
starting_attack_sound = make_worm_roars(0.8),
ending_attack_speed = attributes.endingAttackSpeed or 0.03,
ending_attack_speed = 0.03,
ending_attack_animation = worm_attack_animation(attributes.scale, attributes.tint, "backward"),
folding_speed = attributes.foldingSpeed or 0.015,
folding_animation = worm_preparing_animation(attributes.scale, attributes.tint, "backward"),
@ -298,99 +298,158 @@ function biterFunctions.makeWorm(name, attributes, attack, wormResistances)
end
function biterFunctions.createSuicideAttack(attributes)
return { type = "projectile",
range = 0.5,
cooldown = 35,
ammo_category = "melee",
ammo_type = {
category = "biological",
action = {
{
type = "direct",
action_delivery = {
type = "instant",
target_effects =
{
{
type = "create-entity",
entity_name = attributes.explosion,
check_buildability = true
},
{
type = "nested-result",
action = {
type = "area",
radius = attributes.area,
action_delivery = {
type = "instant",
target_effects = {
{
type = "damage",
damage = {
amount = attributes.damage,
type = "explosion"
}
},
}
}
}
},
{
type = "create-entity",
entity_name = attributes.scorchmark,
check_buildability = true
}
}
},
},
{
type = "cluster",
cluster_count = attributes.explosionCount,
distance = attributes.explosionDistance,
distance_deviation = 3,
action_delivery =
{
type = "instant",
target_effects= {
{
type="create-entity",
entity_name = attributes.explosion,
check_buildability = true
},
{
type = "create-entity",
entity_name = attributes.scorchmark,
check_buildability = true
},
{
type = "nested-result",
action = {
type = "area",
radius = attributes.area,
action_delivery = {
type = "instant",
target_effects = {
{
type = "damage",
damage = {
amount = attributes.damage,
type = "explosion"
}
},
}
}
}
}
}
}
}
}
},
sound = make_biter_roars(0.5),
animation = biterattackanimation(attributes.scale, attributes.tint1, attributes.tint2)
local o = {
type = "projectile",
range = attributes.range or 0.5,
cooldown = attributes.cooldown or 35,
ammo_category = "melee",
ammo_type = {
category = "biological"
},
sound = make_biter_roars(0.5),
animation = biterattackanimation(attributes.scale, attributes.tint1, attributes.tint2)
}
if attributes.nuclear then
o.ammo_type.action = {
type = "direct",
action_delivery =
{
type = "instant",
target_effects =
{
{
repeat_count = 100,
type = "create-trivial-smoke",
smoke_name = "nuclear-smoke",
offset_deviation = {{-1, -1}, {1, 1}},
slow_down_factor = 1,
starting_frame = 3,
starting_frame_deviation = 5,
starting_frame_speed = 0,
starting_frame_speed_deviation = 5,
speed_from_center = 0.5,
speed_deviation = 0.2
},
{
type = "create-entity",
entity_name = "explosion"
},
{
type = "damage",
damage = {amount = attributes.damage or 400, type = attributes.damageType or "explosion"}
},
{
type = "create-entity",
entity_name = "small-scorchmark",
check_buildability = true
},
{
type = "nested-result",
action =
{
type = "area",
target_entities = false,
repeat_count = attributes.repeatCount or 2000,
radius = attributes.radius or 35,
action_delivery =
{
type = "projectile",
projectile = "atomic-bomb-wave",
starting_speed = 0.5
}
}
}
}
}
}
else
o.ammo_type.action = {
{
type = "direct",
action_delivery = {
type = "instant",
target_effects =
{
{
type = "create-entity",
entity_name = attributes.explosion,
check_buildability = true
},
{
type = "nested-result",
action = {
type = "area",
radius = attributes.radius,
action_delivery = {
type = "instant",
target_effects = {
{
type = "damage",
damage = {
amount = attributes.damage,
type = attributes.damageType or "explosion"
}
},
}
}
}
},
{
type = "create-entity",
entity_name = attributes.scorchmark,
check_buildability = true
}
}
},
},
{
type = "cluster",
cluster_count = attributes.explosionCount,
distance = attributes.explosionDistance,
distance_deviation = 3,
action_delivery =
{
type = "instant",
target_effects= {
{
type="create-entity",
entity_name = attributes.explosion,
check_buildability = true
},
{
type = "create-entity",
entity_name = attributes.scorchmark,
check_buildability = true
},
{
type = "nested-result",
action = {
type = "area",
radius = attributes.radius,
action_delivery = {
type = "instant",
target_effects = {
{
type = "damage",
damage = {
amount = attributes.damage,
type = attributes.damageType or "explosion"
}
}
}
}
}
}
}
}
}
}
end
return o
end
function biterFunctions.findRunScale(entity)
@ -405,6 +464,33 @@ function biterFunctions.findTint(entity)
return entity.run_animation.layers[2].tint
end
function biterFunctions.createElectricAttack(attributes, electricBeam, animation)
return
{
type = "beam",
ammo_category = "combat-robot-beam",
cooldown = attributes.cooldown or 20,
range = attributes.range or 15,
ammo_type =
{
category = "combat-robot-beam",
action =
{
type = "direct",
action_delivery =
{
type = "beam",
beam = electricBeam or "electric-beam",
max_length = attributes.range or 15,
duration = attributes.duration or 20,
source_offset = {0.15, -0.5},
}
}
},
animation = animation
}
end
function biterFunctions.createMeleeAttack(attributes)
return
{

View File

@ -8,37 +8,39 @@ local math3d = require("math3d")
function stickerUtils.makeSticker(attributes)
local name = attributes.name .. "-sticker-rampant"
data:extend(
{
{
local o = {
type = "sticker",
name = name,
flags = {"not-on-map"},
animation =
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-13.png",
line_length = 8,
width = 60,
height = 118,
frame_count = 25,
axially_symmetrical = false,
direction_count = 1,
blend_mode = "normal",
animation_speed = 1,
scale = 0.2,
tint = attributes.stickerTint, --{ r = 1, g = 1, b = 1, a = 0.35 },
shift = math3d.vector2.mul({-0.078125, -1.8125}, 0.1),
},
animation = attributes.stickerAnimation -- or
-- {
-- filename = "__base__/graphics/entity/fire-flame/fire-flame-13.png",
-- line_length = 8,
-- width = 60,
-- height = 118,
-- frame_count = 25,
-- axially_symmetrical = false,
-- direction_count = 1,
-- blend_mode = "normal",
-- animation_speed = 1,
-- scale = 0.2,
-- tint = attributes.stickerTint, --{ r = 1, g = 1, b = 1, a = 0.35 },
-- shift = math3d.vector2.mul({-0.078125, -1.8125}, 0.1),
-- }
,
duration_in_ticks = attributes.stickerDuration or (30 * 60),
target_movement_modifier = attributes.stickerMovementModifier or 0.8,
damage_per_tick = attributes.stickerDamagePerTick or { amount = 120 / 60, type = "fire" },
duration_in_ticks = attributes.stickerDuration -- or (30 * 60)
,
target_movement_modifier = attributes.stickerMovementModifier -- or 0.8
,
damage_per_tick = attributes.stickerDamagePerTick, -- or { amount = 120 / 60, type = "fire" },
spread_fire_entity = attributes.spawnEntityName,
fire_spread_cooldown = 30,
fire_spread_radius = 0.75,
}
})
fire_spread_cooldown = attributes.fireSpreadCooldown -- or 30
,
fire_spread_radius = attributes.fireSpreadRadius -- or 0.75
}
data:extend({o})
return name
end

View File

@ -1,112 +0,0 @@
local biterUtils = require("BiterUtils")
local createFireAttack = biterUtils.createFireAttack
local makeSpitter = biterUtils.makeSpitter
local makeResistance = biterUtils.makeResistance
local smallFireBiterScale = 0.53
local smallFireBiterTint1 = {r=0.8, g=0.0, b=0.20, a=0.8}
local smallFireBiterTint2 = {r=0.7, g=0.0, b=0.30, a=0.4}
local mediumFireBiterScale = 0.73
local mediumFireBiterTint1 = {r=0.8, g=0.0, b=0.20, a=0.8}
local mediumFireBiterTint2 = {r=0.7, g=0.0, b=0.30, a=0.4}
local bigFireBiterScale = 1.05
local bigFireBiterTint1 = {r=0.8, g=0.0, b=0.20, a=0.8}
local bigFireBiterTint2 = {r=0.7, g=0.0, b=0.30, a=0.4}
local behemothFireBiterScale = 1.23
local behemothFireBiterTint1 = {r=0.8, g=0.0, b=0.20, a=0.8}
local behemothFireBiterTint2 = {r=0.7, g=0.0, b=0.30, a=0.4}
data:extend({
makeSpitter({name = "small-fire-spitter-rampant",
health = 15,
movement = 0.21,
distancePerFrame = 0.1,
healing = 0.01,
scale = smallFireBiterScale,
tint1 = smallFireBiterTint1,
tint2 = smallFireBiterTint2,
corpse = "small-spitter-corpse",
explosion = "blood-explosion-small"},
createFireAttack({ scale = smallFireBiterScale,
tint1 = smallFireBiterTint1,
tint2 = smallFireBiterTint2,
range = 13,
minRange = 5,
cooldown = 55,
turnRange = 1,
firePenalty = 15}, "acid-flame-stream-rampant"),
{
makeResistance("fire", 0, 15)
}),
makeSpitter({name = "medium-fire-spitter-rampant",
health = 65,
movement = 0.165,
distancePerFrame = 0.055,
healing = 0.01,
scale = mediumFireBiterScale,
tint1 = mediumFireBiterTint1,
tint2 = mediumFireBiterTint2,
corpse = "medium-spitter-corpse",
explosion = "blood-explosion-small"},
createFireAttack({ scale = mediumFireBiterScale,
tint1 = mediumFireBiterTint1,
tint2 = mediumFireBiterTint2,
range = 14,
minRange = 5,
cooldown = 40,
turnRange = 1,
firePenalty = 15}, "acid-flame-1-stream-rampant"),
{
makeResistance("fire", 2, 35)
}),
makeSpitter({name = "big-fire-spitter-rampant",
health = 225,
movement = 0.15,
distancePerFrame = 0.07,
healing = 0.01,
scale = bigFireBiterScale,
tint1 = bigFireBiterTint1,
tint2 = bigFireBiterTint2,
corpse = "big-spitter-corpse",
explosion = "blood-explosion-big"},
createFireAttack({ scale = bigFireBiterScale,
tint1 = bigFireBiterTint1,
tint2 = bigFireBiterTint2,
range = 16,
minRange = 5,
cooldown = 25,
turnRange = 1,
firePenalty = 15}, "acid-flame-1-stream-rampant"),
{
makeResistance("fire", 4, 55)
}),
makeSpitter({name = "behemoth-fire-spitter-rampant",
health = 2250,
movement = 0.15,
distancePerFrame = 0.084,
healing = 0.01,
scale = behemothFireBiterScale,
tint1 = behemothFireBiterTint1,
tint2 = behemothFireBiterTint2,
corpse = "behemoth-spitter-corpse",
explosion = "blood-explosion-big"},
createFireAttack({ scale = behemothFireBiterScale,
tint1 = behemothFireBiterTint1,
tint2 = behemothFireBiterTint2,
range = 17,
minRange = 5,
cooldown = 15,
turnRange = 1,
firePenalty = 15}, "acid-flame-2-stream-rampant"),
{
makeResistance("fire", 6, 75)
})
})

View File

@ -1,110 +0,0 @@
local biterUtils = require("BiterUtils")
local makeBiter = biterUtils.makeBiter
local createSuicideAttack = biterUtils.createSuicideAttack
local makeResistance = biterUtils.makeResistance
local smallSuicideBiterScale = 0.55
local smallSuicideBiterTint1 = {r=0.6, g=0.0, b=0.70, a=0.8}
local smallSuicideBiterTint2 = {r=0.7, g=0.0, b=0.72, a=0.4}
local mediumSuicideBiterScale = 0.75
local mediumSuicideBiterTint1 = {r=0.6, g=0.0, b=0.70, a=0.8}
local mediumSuicideBiterTint2 = {r=0.7, g=0.0, b=0.72, a=0.4}
local bigSuicideBiterScale = 1.05
local bigSuicideBiterTint1 = {r=0.6, g=0.0, b=0.70, a=0.8}
local bigSuicideBiterTint2 = {r=0.7, g=0.0, b=0.72, a=0.4}
local behemothSuicideBiterScale = 1.25
local behemothSuicideBiterTint1 = {r=0.6, g=0.0, b=0.70, a=0.8}
local behemothSuicideBiterTint2 = {r=0.7, g=0.0, b=0.72, a=0.4}
data:extend({
makeBiter({name = "small-suicide-biter-rampant",
health = 30,
movement = 0.21,
distancePerFrame = 0.1,
healing = 0.01,
scale = smallSuicideBiterScale,
tint1 = smallSuicideBiterTint1,
tint2 = smallSuicideBiterTint2,
explosion = "blood-explosion-small"},
createSuicideAttack({ area = 3.5,
damage = 20,
explosion = "explosion",
scorchmark = "small-scorchmark",
explosionCount = 2,
explosionDistance = 2,
scale = smallSuicideBiterScale,
tint1 = smallSuicideBiterTint1,
tint2 = smallSuicideBiterTint2}),
{makeResistance("explosion", 0, -50),
makeResistance("laser", 1, 0),
makeResistance("fire", 0, -60)}),
makeBiter({name = "medium-suicide-biter-rampant",
health = 125,
movement = 0.19,
distancePerFrame = 0.15,
healing = 0.01,
scale = mediumSuicideBiterScale,
tint1 = mediumSuicideBiterTint1,
tint2 = mediumSuicideBiterTint2,
explosion = "blood-explosion-small"},
createSuicideAttack({ area = 4.5,
damage = 28,
explosion = "big-explosion",
scorchmark = "small-scorchmark",
explosionCount = 4,
explosionDistance = 2,
scale = mediumSuicideBiterScale,
tint1 = mediumSuicideBiterTint1,
tint2 = mediumSuicideBiterTint2}),
{makeResistance("physical", 1, 0),
makeResistance("explosion", 0, -40),
makeResistance("laser", 1, 20),
makeResistance("fire", 0, -50)}),
makeBiter({name = "big-suicide-biter-rampant",
health = 425,
movement = 0.18,
distancePerFrame = 0.19,
scale = bigSuicideBiterScale,
tint1 = bigSuicideBiterTint1,
tint2 = bigSuicideBiterTint2,
explosion = "blood-explosion-big"},
createSuicideAttack({ area = 5.5,
damage = 63,
explosion = "big-explosion",
scorchmark = "small-scorchmark",
explosionCount = 8,
explosionDistance = 3,
scale = bigSuicideBiterScale,
tint1 = bigSuicideBiterTint1,
tint2 = bigSuicideBiterTint2}),
{makeResistance("physical", 2, 0),
makeResistance("explosion", 0, -30),
makeResistance("laser", 3, 25),
makeResistance("fire", 0, -30)}),
makeBiter({name = "behemoth-suicide-biter-rampant",
health = 1200,
movement = 0.18,
distancePerFrame = 0.19,
scale = behemothSuicideBiterScale,
tint1 = behemothSuicideBiterTint1,
tint2 = behemothSuicideBiterTint2,
explosion = "blood-explosion-big"},
createSuicideAttack({ area = 7.5,
damage = 150,
explosion = "massive-explosion",
scorchmark = "small-scorchmark",
explosionCount = 12,
explosionDistance = 3,
scale = behemothSuicideBiterScale,
tint1 = behemothSuicideBiterTint1,
tint2 = behemothSuicideBiterTint2}),
{makeResistance("physical", 4, 20),
makeResistance("explosion", 0, -20),
makeResistance("laser", 5, 30),
makeResistance("fire", 0, -10)})
})

View File

@ -1,42 +0,0 @@
-- imports
local biterUtils = require("BiterUtils")
-- import functions
local makeBiter = biterUtils.makeBiter
local createSuicideAttack = biterUtils.createSuicideAttack
local makeResistance = biterUtils.makeResistance
-- local
local smallSuicideBiterScale = 0.75
local smallSuicideBiterTint1 = {r=0.0, g=0.0, b=0.70, a=0.8}
local smallSuicideBiterTint2 = {r=0.0, g=0.0, b=0.72, a=0.4}
-- module code
data:extend({
makeBiter({name = "small-tendril-biter-rampant",
health = 30,
movement = 0.21,
distancePerFrame = 0.1,
healing = 0.01,
scale = smallSuicideBiterScale,
tint1 = smallSuicideBiterTint1,
tint2 = smallSuicideBiterTint2,
explosion = "blood-explosion-small"},
createSuicideAttack({ area = 3.5,
damage = 20,
explosion = "explosion",
scorchmark = "small-scorchmark",
explosionCount = 2,
explosionDistance = 2,
scale = smallSuicideBiterScale,
tint1 = smallSuicideBiterTint1,
tint2 = smallSuicideBiterTint2}),
{makeResistance("explosion", 0, -50),
makeResistance("laser", 1, 0),
makeResistance("fire", 0, -60)}),
})