1
0
mirror of https://github.com/veden/Rampant.git synced 2025-02-07 13:31:36 +02:00
Rampant/prototypes/Neutral.lua

208 lines
3.9 KiB
Lua
Raw Normal View History

2018-01-13 16:12:09 -08:00
-- imports
2018-01-23 13:39:32 -08:00
local acidBall = require("utils/AttackBall")
local biterUtils = require("utils/BiterUtils")
2018-01-13 23:07:29 -08:00
local swarmUtils = require("SwarmUtils")
package.path = "../libs/?.lua;" .. package.path
local constants = require("Constants")
-- constants
local neutral = {}
2018-01-27 17:02:33 -08:00
local NEUTRAL_UNIT_TIERS = constants.NEUTRAL_UNIT_TIERS
local NEUTRAL_UNIT_VARIATIONS = constants.NEUTRAL_UNIT_VARIATIONS
local NEUTRAL_NEST_TIERS = constants.NEUTRAL_NEST_TIERS
local NEUTRAL_NEST_VARIATIONS = constants.NEUTRAL_NEST_VARIATIONS
local NEUTRAL_WORM_TIERS = constants.NEUTRAL_WORM_TIERS
local NEUTRAL_WORM_VARIATIONS = constants.NEUTRAL_WORM_VARIATIONS
2018-01-13 16:12:09 -08:00
-- imported functions
2018-01-14 15:10:56 -08:00
local buildUnitSpawner = swarmUtils.buildUnitSpawner
local buildWorm = swarmUtils.buildWorm
2018-01-23 13:39:32 -08:00
local createAttackBall = acidBall.createAttackBall
2018-02-06 00:01:20 -08:00
local createRangedAttack = biterUtils.createRangedAttack
local createMeleeAttack = biterUtils.createMeleeAttack
2018-01-13 16:12:09 -08:00
local softSmoke = "the-soft-smoke-rampant"
local makeUnitAlienLootTable = biterUtils.makeUnitAlienLootTable
local makeSpawnerAlienLootTable = biterUtils.makeSpawnerAlienLootTable
local makeWormAlienLootTable = biterUtils.makeWormAlienLootTable
function neutral.addFaction()
local biterLoot = makeUnitAlienLootTable(nil)
local spawnerLoot = makeSpawnerAlienLootTable(nil)
local wormLoot = makeWormAlienLootTable(nil)
-- neutral biters
buildUnitSpawner(
{
unit = {
name = "neutral-biter",
loot = biterLoot,
attributes = {
explosion = "blood-explosion-small"
},
attack = {},
resistances = {},
type = "biter",
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 = "neutral-biter-nest",
loot = spawnerLoot,
attributes = {},
resistances = {},
tint = {r=0.56, g=0.46, b=0.42, a=0.65}
}
},
{
unit = {
},
unitSpawner = {
{
type = "attribute",
name = "evolutionRequirement",
[1] = 0,
[2] = 0.12,
[3] = 0.22,
[4] = 0.32,
[5] = 0.42,
[6] = 0.52,
[7] = 0.62,
[8] = 0.72,
[9] = 0.82,
[10] = 0.92
},
2018-01-17 23:15:10 -08:00
}
},
createMeleeAttack,
{
unit = NEUTRAL_UNIT_VARIATIONS,
unitSpawner = NEUTRAL_NEST_VARIATIONS
},
{
unit = NEUTRAL_UNIT_TIERS,
unitSpawner = NEUTRAL_NEST_TIERS
}
)
-- neutral spitters
buildUnitSpawner(
{
unit = {
name = "neutral-spitter",
loot = biterLoot,
attributes = {
explosion = "blood-explosion-small"
},
attack = {
type = "projectile",
directionOnly = true,
softSmokeName = softSmoke
},
resistances = {},
type = "spitter",
attackName = "neutral-spitter",
tint = {r=0.56, g=0.46, b=0.42, a=1},
pTint = {r=0, g=1, b=1, a=0.5},
sTint = {r=0, g=1, b=1, a=0.5}
},
unitSpawner = {
name = "neutral-spitter-nest",
loot = spawnerLoot,
attributes = {},
resistances = {},
tint = {r=0.99, g=0.09, b=0.09, a=1}
}
},
{
unit = {
2018-06-06 22:29:40 -07:00
},
unitSpawner = {
}
},
function (attributes)
return createRangedAttack(attributes,
createAttackBall(attributes),
spitterattackanimation(attributes.scale,
attributes.tint))
end,
{
unit = NEUTRAL_UNIT_VARIATIONS,
unitSpawner = NEUTRAL_NEST_VARIATIONS
},
{
unit = NEUTRAL_UNIT_TIERS,
unitSpawner = NEUTRAL_NEST_TIERS
}
)
-- neutral worms
buildWorm(
{
name = "neutral-worm",
loot = wormLoot,
attributes = {},
attack = {
2018-02-06 00:01:20 -08:00
type = "projectile",
softSmokeName = softSmoke
},
resistances = {},
attackName = "neutral-worm",
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}
},
2018-06-06 22:29:40 -07:00
{
},
function (attributes)
return createRangedAttack(attributes,
createAttackBall(attributes))
end,
NEUTRAL_WORM_VARIATIONS,
NEUTRAL_WORM_TIERS
)
end
return neutral