1
0
mirror of https://github.com/veden/Rampant.git synced 2025-01-07 23:01:39 +02:00
Rampant/prototypes/Acid.lua

370 lines
5.9 KiB
Lua
Raw Normal View History

2018-01-14 02:12:09 +02:00
-- imports
2018-01-23 23:39:32 +02:00
local acidBall = require("utils/AttackBall")
local biterUtils = require("utils/BiterUtils")
2018-01-14 09:07:29 +02:00
local swarmUtils = require("SwarmUtils")
package.path = "../libs/?.lua;" .. package.path
local constants = require("Constants")
-- constants
local acid = {}
2018-01-28 03:02:33 +02:00
local ACID_UNIT_TIERS = constants.ACID_UNIT_TIERS
local ACID_UNIT_VARIATIONS = constants.ACID_UNIT_VARIATIONS
local ACID_NEST_TIERS = constants.ACID_NEST_TIERS
local ACID_NEST_VARIATIONS = constants.ACID_NEST_VARIATIONS
local ACID_WORM_TIERS = constants.ACID_WORM_TIERS
local ACID_WORM_VARIATIONS = constants.ACID_WORM_VARIATIONS
2018-01-14 02:12:09 +02:00
-- imported functions
2018-01-15 01:10:56 +02:00
local buildUnitSpawner = swarmUtils.buildUnitSpawner
local buildWorm = swarmUtils.buildWorm
2018-01-23 23:39:32 +02:00
local createAttackBall = acidBall.createAttackBall
2018-02-06 10:01:20 +02:00
local createRangedAttack = biterUtils.createRangedAttack
local createMeleeAttack = biterUtils.createMeleeAttack
2018-01-14 02:12:09 +02:00
local softSmoke = "the-soft-smoke-rampant"
2018-01-14 02:12:09 +02:00
local makeUnitAlienLootTable = biterUtils.makeUnitAlienLootTable
local makeSpawnerAlienLootTable = biterUtils.makeSpawnerAlienLootTable
local makeWormAlienLootTable = biterUtils.makeWormAlienLootTable
local biterLoot = makeUnitAlienLootTable("green")
local spawnerLoot = makeSpawnerAlienLootTable("green")
local wormLoot = makeWormAlienLootTable("green")
function acid.addFaction()
-- acid biters
buildUnitSpawner(
{
unit = {
name = "acid-biter",
attributes = {
explosion = "blood-explosion-small"
},
attack = {
damageType = "acid"
},
resistances = {},
type = "biter",
loot = biterLoot,
tint1 = {r=0, g=0.85, b=0.13, a=0.65},
tint2 = {r=0, g=0.85, b=0.13, a=0.65}
},
unitSpawner = {
name = "acid-biter-nest",
loot = spawnerLoot,
attributes = {},
resistances = {},
tint = {r=0, g=0.85, b=0.13, a=0.65}
}
},
{
unit = {
2018-06-08 08:52:39 +02:00
{
type = "resistance",
name = "acid",
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
}
}
},
unitSpawner = {
{
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 = "resistance",
name = "acid",
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
}
}
2018-01-18 09:15:10 +02:00
}
},
createMeleeAttack,
{
unit = ACID_UNIT_VARIATIONS,
unitSpawner = ACID_NEST_VARIATIONS
},
{
unit = ACID_UNIT_TIERS,
unitSpawner = ACID_NEST_TIERS
}
)
-- acid spitters
buildUnitSpawner(
{
unit = {
name = "acid-spitter",
loot = biterLoot,
attributes = {
explosion = "blood-explosion-small"
},
attack = {
type = "projectile",
directionOnly = true,
softSmokeName = softSmoke
},
resistances = {},
type = "spitter",
attackName = "acid-spitter",
tint = {r=0, g=0.85, b=0.1, a=0.65},
pTint = {r=0, g=1, b=0.1, a=0.5},
sTint = {r=0, g=1, b=0.1, a=0.5}
},
unitSpawner = {
name = "acid-spitter-nest",
loot = spawnerLoot,
attributes = {},
resistances = {},
tint = {r=0, g=0.85, b=0.13, a=1}
}
},
{
unit = {
2018-06-09 04:41:46 +02:00
2018-06-07 07:29:40 +02:00
{
type = "resistance",
name = "acid",
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
}
}
},
unitSpawner = {
{
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 = "resistance",
name = "acid",
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
}
}
}
},
function (attributes)
return createRangedAttack(attributes,
createAttackBall(attributes),
spitterattackanimation(attributes.scale,
attributes.tint))
end,
{
unit = ACID_UNIT_VARIATIONS,
unitSpawner = ACID_NEST_VARIATIONS
},
{
unit = ACID_UNIT_TIERS,
unitSpawner = ACID_NEST_TIERS
}
)
-- acid worms
buildWorm(
{
name = "acid-worm",
loot = wormLoot,
attributes = {},
attack = {
2018-02-06 10:01:20 +02:00
type = "projectile",
softSmokeName = softSmoke
},
resistances = {},
attackName = "acid-worm",
tint = {r=0, g=0.85, b=0.1, a=0.65},
pTint = {r=0, g=1, b=0.1, a=0.5},
sTint = {r=0, g=1, b=0.1, a=0.5}
},
{
2018-06-07 07:29:40 +02:00
{
type = "resistance",
name = "acid",
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
}
}
2018-06-07 07:29:40 +02:00
},
function (attributes)
return createRangedAttack(attributes,
createAttackBall(attributes))
end,
ACID_WORM_VARIATIONS,
ACID_WORM_TIERS
)
end
return acid