2018-01-13 16:12:09 -08:00
|
|
|
-- imports
|
|
|
|
|
2018-01-23 13:39:32 -08:00
|
|
|
local acidBall = require("utils/AttackBall")
|
2018-01-20 23:42:47 -08:00
|
|
|
local biterUtils = require("utils/BiterUtils")
|
2018-01-13 23:07:29 -08:00
|
|
|
local swarmUtils = require("SwarmUtils")
|
2018-01-20 23:42:47 -08:00
|
|
|
package.path = "../libs/?.lua;" .. package.path
|
|
|
|
local constants = require("Constants")
|
2018-01-15 23:21:12 -08:00
|
|
|
|
|
|
|
-- constants
|
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
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
|
|
|
|
|
2018-01-15 23:21:12 -08:00
|
|
|
local NEUTRAL_NEST_TIERS = constants.NEUTRAL_NEST_TIERS
|
|
|
|
local NEUTRAL_NEST_VARIATIONS = constants.NEUTRAL_NEST_VARIATIONS
|
|
|
|
|
2018-01-20 23:42:47 -08:00
|
|
|
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
|
2018-01-19 23:15:13 -08:00
|
|
|
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
|
|
|
|
|
2018-01-15 23:21:12 -08:00
|
|
|
local createMeleeAttack = biterUtils.createMeleeAttack
|
2018-01-13 16:12:09 -08:00
|
|
|
|
2018-01-26 18:15:40 -08:00
|
|
|
local softSmoke = "the-soft-smoke-rampant"
|
2018-01-15 23:21:12 -08:00
|
|
|
|
2018-01-28 17:51:24 -08:00
|
|
|
local makeUnitAlienLootTable = biterUtils.makeUnitAlienLootTable
|
|
|
|
local makeSpawnerAlienLootTable = biterUtils.makeSpawnerAlienLootTable
|
|
|
|
local makeWormAlienLootTable = biterUtils.makeWormAlienLootTable
|
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
function neutral.addFaction()
|
2018-01-28 17:51:24 -08:00
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
local biterLoot = makeUnitAlienLootTable(nil)
|
|
|
|
local spawnerLoot = makeSpawnerAlienLootTable(nil)
|
|
|
|
local wormLoot = makeWormAlienLootTable(nil)
|
2018-01-15 23:21:12 -08:00
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
-- neutral biters
|
|
|
|
buildUnitSpawner(
|
|
|
|
{
|
|
|
|
unit = {
|
|
|
|
name = "neutral-biter",
|
2018-01-15 23:21:12 -08:00
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
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}
|
2018-01-18 23:25:32 -08:00
|
|
|
},
|
2018-04-14 16:02:40 -07:00
|
|
|
|
|
|
|
unitSpawner = {
|
|
|
|
name = "neutral-biter-nest",
|
|
|
|
|
|
|
|
loot = spawnerLoot,
|
|
|
|
attributes = {},
|
|
|
|
resistances = {},
|
|
|
|
tint = {r=0.56, g=0.46, b=0.42, a=0.65}
|
|
|
|
}
|
2018-01-15 23:21:12 -08:00
|
|
|
},
|
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
{
|
|
|
|
unit = {
|
2018-01-15 23:21:12 -08:00
|
|
|
|
|
|
|
},
|
2018-01-18 23:25:32 -08:00
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
unitSpawner = {
|
|
|
|
|
|
|
|
{
|
|
|
|
type = "attribute",
|
|
|
|
name = "evolutionRequirement",
|
2018-01-21 23:13:18 -08:00
|
|
|
[1] = 0,
|
2018-04-14 16:02:40 -07:00
|
|
|
[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
|
|
|
}
|
2018-01-15 23:21:12 -08:00
|
|
|
},
|
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
createMeleeAttack,
|
2018-01-15 23:21:12 -08:00
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
{
|
|
|
|
unit = NEUTRAL_UNIT_VARIATIONS,
|
|
|
|
unitSpawner = NEUTRAL_NEST_VARIATIONS
|
|
|
|
},
|
2018-01-15 23:21:12 -08:00
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
{
|
|
|
|
unit = NEUTRAL_UNIT_TIERS,
|
|
|
|
unitSpawner = NEUTRAL_NEST_TIERS
|
|
|
|
}
|
|
|
|
)
|
2018-01-18 23:25:32 -08:00
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
-- neutral spitters
|
|
|
|
buildUnitSpawner(
|
|
|
|
{
|
|
|
|
unit = {
|
|
|
|
name = "neutral-spitter",
|
2018-01-18 23:25:32 -08:00
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
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}
|
2018-01-21 23:13:18 -08:00
|
|
|
},
|
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
unitSpawner = {
|
|
|
|
name = "neutral-spitter-nest",
|
|
|
|
|
|
|
|
loot = spawnerLoot,
|
|
|
|
attributes = {},
|
|
|
|
resistances = {},
|
2018-01-21 23:13:18 -08:00
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
tint = {r=0.99, g=0.09, b=0.09, a=1}
|
|
|
|
}
|
|
|
|
},
|
2018-01-18 23:25:32 -08:00
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
{
|
|
|
|
unit = {
|
2018-06-06 22:29:40 -07:00
|
|
|
|
2018-01-18 23:25:32 -08:00
|
|
|
},
|
2018-04-14 16:02:40 -07:00
|
|
|
|
|
|
|
unitSpawner = {
|
|
|
|
|
2018-01-18 23:25:32 -08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
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
|
2018-01-18 23:25:32 -08:00
|
|
|
}
|
2018-04-14 16:02:40 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
-- neutral worms
|
|
|
|
buildWorm(
|
|
|
|
{
|
|
|
|
name = "neutral-worm",
|
|
|
|
|
|
|
|
loot = wormLoot,
|
|
|
|
attributes = {},
|
2018-01-20 23:42:47 -08:00
|
|
|
attack = {
|
2018-02-06 00:01:20 -08:00
|
|
|
type = "projectile",
|
2018-01-25 16:52:26 -08:00
|
|
|
softSmokeName = softSmoke
|
2018-01-20 23:42:47 -08:00
|
|
|
},
|
2018-01-18 23:25:32 -08:00
|
|
|
resistances = {},
|
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
attackName = "neutral-worm",
|
|
|
|
tint = {r=0.56, g=0.46, b=0.42, a=0.65},
|
2018-01-18 23:25:32 -08:00
|
|
|
pTint = {r=0, g=1, b=1, a=0.5},
|
2018-01-20 23:42:47 -08:00
|
|
|
sTint = {r=0, g=1, b=1, a=0.5}
|
2018-01-18 23:25:32 -08:00
|
|
|
},
|
|
|
|
|
2018-06-06 22:29:40 -07:00
|
|
|
{
|
2018-01-18 23:25:32 -08:00
|
|
|
|
|
|
|
},
|
2018-01-19 23:15:13 -08:00
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
function (attributes)
|
|
|
|
return createRangedAttack(attributes,
|
|
|
|
createAttackBall(attributes))
|
|
|
|
end,
|
2018-01-19 23:15:13 -08:00
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
NEUTRAL_WORM_VARIATIONS,
|
|
|
|
NEUTRAL_WORM_TIERS
|
|
|
|
)
|
|
|
|
end
|
2018-01-19 23:15:13 -08:00
|
|
|
|
|
|
|
|
2018-04-14 16:02:40 -07:00
|
|
|
return neutral
|