1
0
mirror of https://github.com/veden/Rampant.git synced 2025-03-17 20:58:35 +02:00

added localized math.random and refactor biter attacks

This commit is contained in:
Aaron Veden 2017-06-30 21:36:23 -07:00
parent a246928452
commit d8a36bc5f7
34 changed files with 1603 additions and 1699 deletions

View File

@ -57,6 +57,13 @@ Configure Options not in game menu:
# Version History
0.15.17 -
- Tweak: Increased small worm turret range from 17 to 18
- Improvement: added ground effect to worm turret for attacking drones
- Improvement: Added option to remove blood particles on biter deaths, which should help reduce lag spikes (default is to remove them)
- Optimization: Moved math.random to local level instead of global
- Refactored: Unit and attack prototypes
0.15.16 -
- Tweak: Increased death pheromone weight for squad attack from 1 to 2
- Tweak: Increased failed unit behaviors from 6 to 10

View File

@ -122,14 +122,6 @@ function upgrade.attempt(natives)
-- used for breaking up how many squads are processing per logic cycle
natives.regroupIndex = 1
-- RE-ENABLE WHEN COMPLETE
natives.useCustomAI = constants.DEV_CUSTOM_AI
-- natives.useCustomAI = settings.startup["rampant-useCustomAI"].value
-- if natives.useCustomAI then
-- game.forces.enemy.ai_controllable = false
-- else
-- game.forces.enemy.ai_controllable = true
-- end
natives.bases = {}
natives.baseDistanceMin = 0
natives.baseIndex = 1
@ -152,6 +144,18 @@ function upgrade.attempt(natives)
game.surfaces[1].print("Rampant - Version 0.15.16")
global.version = constants.VERSION_26
end
if (global.version < constants.VERSION_27) then
natives.useCustomAI = constants.DEV_CUSTOM_AI
-- natives.useCustomAI = settings.startup["rampant-useCustomAI"].value
if natives.useCustomAI then
game.forces.enemy.ai_controllable = false
else
game.forces.enemy.ai_controllable = true
end
game.surfaces[1].print("Rampant - Version 0.15.17")
end
return starting ~= global.version
end

View File

@ -65,6 +65,8 @@ local makeImmortalEntity = entityUtils.makeImmortalEntity
local processBases = baseProcessor.processBases
local mRandom = math.random
-- local references to global
local regionMap
@ -281,7 +283,7 @@ local function onDeath(event)
surface,
natives,
tick)
if (math.random() < natives.rallyThreshold) and not surface.peaceful_mode then
if (mRandom() < natives.rallyThreshold) and not surface.peaceful_mode then
rallyUnits(deathChunk,
regionMap,
surface,

View File

@ -11,6 +11,14 @@ local function NEDetected()
return settings.startup["NE_Difficulty"] ~= nil
end
if settings.startup["rampant-removeBloodParticles"].value then
local explosions = data.raw["explosion"]
explosions["blood-explosion-small"]["created_effect"] = nil
explosions["blood-explosion-big"]["created_effect"] = nil
explosions["blood-explosion-huge"]["created_effect"] = nil
end
if settings.startup["rampant-useDumbProjectiles"].value then
vanillaUpdates.useDumbProjectiles()
if bobsDetected() then

View File

@ -1,10 +1,10 @@
{
"name" : "Rampant",
"factorio_version" : "0.15",
"version" : "0.15.16",
"version" : "0.15.17",
"title" : "Rampant",
"author" : "Veden",
"homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445",
"description" : "Improves the enemies tactics by using potential fields/pheromones allowing probing of defenses, retreats, reinforcements, counterattacking, breaching, rallying death cry, and player hunting. Also removes homing biter projectiles. Difficulty setting in mod options menu.",
"dependencies" : ["base >= 0.13.17", "? bobenemies", "? Natural_Evolution_Enemies", "? DayNightExtender", "? Orbital Ion Cannon"]
"dependencies" : ["base >= 0.15.26", "? bobenemies", "? Natural_Evolution_Enemies", "? DayNightExtender", "? Orbital Ion Cannon"]
}

View File

@ -34,6 +34,8 @@ local NEST_COUNT = constants.NEST_COUNT
-- imported functions
local mRandom = math.random
local positionFromDirectionAndChunk = mapUtils.positionFromDirectionAndChunk
local getNeighborChunks = mapUtils.getNeighborChunks
@ -100,7 +102,7 @@ end
function aiAttackWave.formSquads(regionMap, surface, natives, chunk, cost)
local valid = (cost == AI_VENGENCE_SQUAD_COST) or ((cost == AI_SQUAD_COST) and attackWaveValidCandidate(chunk, natives, surface))
if valid and (math.random() < natives.formSquadThreshold) then
if valid and (mRandom() < natives.formSquadThreshold) then
local squadPath, squadDirection = scoreNeighborsForFormation(getNeighborChunks(regionMap, chunk.cX, chunk.cY),
validUnitGroupLocation,
@ -116,7 +118,7 @@ function aiAttackWave.formSquads(regionMap, surface, natives, chunk, cost)
if squadPosition then
local squad = createSquad(squadPosition, surface, natives)
squad.rabid = math.random() < 0.03
squad.rabid = mRandom() < 0.03
local scaledWaveSize = attackWaveScaling(natives)
local foundUnits = surface.set_multi_command({ command = { type = DEFINES_COMMAND_GROUP,

View File

@ -42,6 +42,8 @@ local randomTickEvent = mathUtils.randomTickEvent
local mFloor = math.floor
local mRandom = math.random
local mMax = math.max
-- module code
@ -76,17 +78,17 @@ function aiPlanning.planning(natives, evolution_factor, tick, surface)
natives.attackWaveThreshold = (threshold - (threshold * evolution_factor)) + natives.attackThresholdMin
if (natives.points < maxPoints) then
natives.points = natives.points + mFloor((AI_POINT_GENERATOR_AMOUNT * math.random()) +
natives.points = natives.points + mFloor((AI_POINT_GENERATOR_AMOUNT * mRandom()) +
((AI_POINT_GENERATOR_AMOUNT * 0.7) * (evolution_factor ^ 2.5)) * natives.aiPointsScaler)
end
if (natives.temperamentTick == tick) then
natives.temperament = math.random()
natives.temperament = mRandom()
natives.temperamentTick = randomTickEvent(tick, AI_MIN_TEMPERAMENT_DURATION, AI_MAX_TEMPERAMENT_DURATION)
end
if (natives.stateTick == tick) then
local roll = math.random() * mMax(1 - evolution_factor, 0.15)
local roll = mRandom() * mMax(1 - evolution_factor, 0.15)
if (roll > natives.temperament) then
natives.state = AI_STATE_PEACEFUL
elseif natives.aiNocturnalMode then

View File

@ -28,6 +28,8 @@ local mFloor = math.floor
local buildTendril = tendrilUtils.buildTendril
local mRandom = math.random
-- module code
function baseUtils.findNearbyBase(natives, position)
@ -60,7 +62,7 @@ function baseUtils.createBase(regionMap, natives, position, surface, tick)
eggs = {},
upgradePoints = 0,
growth = tick,
pattern = math.random(MAGIC_MAXIMUM_BASE_NUMBER),
pattern = mRandom(MAGIC_MAXIMUM_BASE_NUMBER),
level = mFloor(distance / 200)
}
if not buildHive(regionMap, base, surface) then

View File

@ -21,6 +21,8 @@ local DOUBLE_CHUNK_SIZE = constants.DOUBLE_CHUNK_SIZE
local registerEnemyBaseStructure = baseRegisterUtils.registerEnemyBaseStructure
local gaussianRandomRange = mathUtils.gaussianRandomRange
local mRandom = math.random
-- module code
function buildUtils.buildHive(regionMap, base, surface)
@ -40,7 +42,7 @@ function buildUtils.buildHive(regionMap, base, surface)
return valid
end
function buildUtils.buildOutpost(regionMap, natives, base, surface, position)
function buildUtils.buildOutpost(regionMap, natives, base, surface, tendril)
local foundHive = false
for _,_ in pairs(base.hives) do
foundHive = true
@ -49,9 +51,13 @@ function buildUtils.buildOutpost(regionMap, natives, base, surface, position)
if not foundHive or (base.upgradePoints < 10) then
return
end
if not tendril.unit.valid then
return
end
local position = tendril.unit.position
local generator = natives.randomGenerator
generator.re_seed(math.random(MAGIC_MAXIMUM_BASE_NUMBER))
generator.re_seed(mRandom(MAGIC_MAXIMUM_BASE_NUMBER))
for level=0,(base.level * 0.5) do
local slices = (level * 3)

View File

@ -7,12 +7,11 @@ local constants = require("Constants")
-- constants
local CHUNK_QUEUE_SIZE = constants.CHUNK_QUEUE_SIZE
local CHUNK_SIZE = constants.CHUNK_SIZE
-- imported functions
local remakeChunk = chunkUtils.remakeChunk
local createChunk = chunkUtils.createChunk
local checkChunkPassability = chunkUtils.checkChunkPassability
local scoreChunk = chunkUtils.scoreChunk
@ -55,6 +54,8 @@ function chunkProcessor.processPendingChunks(natives, regionMap, surface, pendin
checkChunkPassability(chunkTiles, chunk, surface)
if vanillaAI then
registerChunkEnemies(chunk, surface, query)
else
remakeChunk(regionMap, chunk, surface, natives, tick, query)
end
scoreChunk(chunk, surface, natives, query)
processQueue[#processQueue+1] = chunk

View File

@ -13,6 +13,7 @@ constants.VERSION_22 = 22
constants.VERSION_23 = 23
constants.VERSION_25 = 25
constants.VERSION_26 = 26
constants.VERSION_27 = 27
-- misc

View File

@ -59,6 +59,8 @@ local mMin = math.min
local validPlayer = playerUtils.validPlayer
local mRandom = math.random
-- module code
local function nonRepeatingRandom(players)
@ -67,7 +69,7 @@ local function nonRepeatingRandom(players)
ordering[#ordering+1] = player.index
end
for i=#ordering,1,-1 do
local s = math.random(i)
local s = mRandom(i)
local t = ordering[i]
ordering[i] = ordering[s]
ordering[s] = t
@ -87,7 +89,7 @@ function mapProcessor.processMap(regionMap, surface, natives, tick)
local index = regionMap.processPointer
if (index == 1) then
roll = math.random()
roll = mRandom()
regionMap.processRoll = roll
end
@ -130,7 +132,7 @@ function mapProcessor.processPlayers(players, regionMap, surface, natives, tick)
-- randomize player order to ensure a single player isn't singled out
local playerOrdering = nonRepeatingRandom(players)
local roll = math.random()
local roll = mRandom()
local allowingAttacks = canAttack(natives, surface)

View File

@ -18,6 +18,8 @@ local mLog10 = math.log10
local mFloor = math.floor
local mRandom = math.random
-- module code
function mathUtils.roundToNearest(number, multiple)
@ -26,7 +28,7 @@ function mathUtils.roundToNearest(number, multiple)
end
function mathUtils.randomTickEvent(tick, low, high)
local minutesToTick = mMax(high * math.random(), low)
local minutesToTick = mMax(high * mRandom(), low)
local nextTick = mathUtils.roundToNearest(TICKS_A_MINUTE * minutesToTick, INTERVAL_LOGIC)
return tick + nextTick
end
@ -43,8 +45,8 @@ local function marsagliaPolarMethod(rg)
iid1 = 2 * rg() + -1
iid2 = 2 * rg() + -1
else
iid1 = 2 * math.random() + -1
iid2 = 2 * math.random() + -1
iid1 = 2 * mRandom() + -1
iid2 = 2 * mRandom() + -1
end
q = (iid1 * iid1) + (iid2 * iid2)
until (q ~= 0) and (q < 1)

View File

@ -34,6 +34,8 @@ local DEFINES_DISTRACTION_BY_ANYTHING = defines.distraction.by_anything
-- imported functions
local mRandom = math.random
local findMovementPosition = movementUtils.findMovementPosition
local getNeighborChunks = mapUtils.getNeighborChunks
@ -143,8 +145,8 @@ function squadAttack.squadsBeginAttack(natives, players)
squad.frenzyPosition.y = groupPosition.y
end
if (math.random() < 0.70) then
squad.kamikaze = math.random() < kamikazeThreshold
if (mRandom() < 0.70) then
squad.kamikaze = mRandom() < kamikazeThreshold
squad.status = SQUAD_RAIDING
end
end

View File

@ -77,9 +77,9 @@ local function buildTendrilPath(regionMap, tendril, surface, base, tick, natives
scoreTendrilChunk,
nil)
if (tendrilDirection == -1) then
-- removeTendril(base, tendril)
-- buildOutpost(regionMap, natives, base, surface, tendril)
-- tendrilUtils.buildTendril(regionMap, natives, base, surface, tick)
removeTendril(base, tendril)
buildOutpost(regionMap, natives, base, surface, tendril)
tendrilUtils.buildTendril(regionMap, natives, base, surface, tick)
colorChunk(chunk.x, chunk.y, "hazard-concrete-left", surface)
return
elseif tendrilPath then

View File

@ -28,6 +28,8 @@ local AI_SQUAD_MERGE_THRESHOLD = constants.AI_SQUAD_MERGE_THRESHOLD
-- imported functions
local mRandom = math.random
local mLog = math.log10
local mMin = math.min
@ -208,7 +210,7 @@ function unitGroupUtils.regroupSquads(natives)
end
if mergedSquads and not squad.kamikaze then
local kamikazeThreshold = unitGroupUtils.calculateKamikazeThreshold(squad, natives)
if (math.random() < kamikazeThreshold) then
if (mRandom() < kamikazeThreshold) then
squad.kamikaze = true
end
end

View File

@ -48,6 +48,7 @@ rampant-aiPointsScaler=Difficulty Scaling
rampant-addWallResistanceAcid=Increase wall resistance to spitters
rampant-useCustomAI=Use Custom AI (Alpha)
rampant-safeBuildings-lamps=Make lamps safe from biters
rampant-removeBloodParticles=Remove blood particles (Reduces lag spikes)
[mod-setting-description]
rampant-useDumbProjectiles=Turns off homing projectiles for worms and spitters
@ -69,4 +70,5 @@ rampant-attackPlayerThreshold=The score that a chunk must reach for it to contri
rampant-permanentNocturnal=Toggling this will cause Rampant attack waves to spawn at night. DOES NOT turn off vanilla attack groups yet. Works better with Day/Night extender mod.
rampant-aiPointsScaler=Between 0.0 and 5.0. This scales how many action points the ai gets per logic cycle to perform actions like making attack waves. 0.3 - very easy, 0.75 - easy, 1.0 - medium, 1.25+ - hard
rampant-addWallResistanceAcid=Toggling this will cause a %60 acid resistance to be added to all wall entities to reduce the damage done by spitters to walls back to vanilla levels.
rampant-useCustomAI=Having this enabled will completely remove the vanilla ai and change how biters build, produce units, and attack.
rampant-useCustomAI=Having this enabled will completely remove the vanilla ai and change how biters build, produce units, and attack.
rampant-removeBloodParticles=The blood particles that are created when biters are being killed can cause UPS spikes, this removes them.

View File

@ -77,8 +77,8 @@
(copyDirectory "prototypes" modFolder)))
(define (run)
;; (copyFiles modFolder)
(copyFiles modFolder)
;; (copyFiles zipModFolder)
(makeZip modFolder)
;;(makeZip modFolder)
)
)

View File

@ -1,16 +1,20 @@
local biterStreamUtils = require("BiterStreamUtils")
-- import
local streamUtils = require("StreamUtils")
local colorUtils = require("ColorUtils")
-- imported functions
local makeStream = streamUtils.makeStream
local makeColor = colorUtils.makeColor
-- dumb acid projectiles
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "acid-ball-stream-rampant",
firePictureTint = {r=0.35,g=0.90,b=0,a=1},
smallTreeFlameTint = {r=0.35,g=0.8,b=0,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 2,
particleHoizontalSpeed = 0.2* 0.75 * 4,
particleHoizontalSpeedDeviation = 0.005 * 0.50,
makeStream({
name = "acid-ball",
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",
@ -39,36 +43,16 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=0, g=1, b=1, a=0.5},
fireFlameName = "acid-ball-flame-rampant",
fireFlameTint = {r=0, g=0.9, b=0, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-acid-ball-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.3, 0.75, 0.3, 0.1),
smokeName = "acid-ball-smoke-rampant",
smokeTint = {r=0.2, g=0.8, b=0.2, a=0.25},
stickerName = "acid-ball-sticker-rampant",
stickerTint = { r = 0.25, g = 0.5, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "acid-ball-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.25,0.75,0.1, 0.25),
spawnEntityName = "acid-ball-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "acid-ball-smoke-on-adding-fuel-rampant"
}
)
}
})
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "acid-ball-1-stream-rampant",
firePictureTint = {r=0.35,g=0.90,b=0,a=1},
smallTreeFlameTint = {r=0.35,g=0.8,b=0,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 2,
particleHoizontalSpeed = 0.2* 0.75 * 4,
particleHoizontalSpeedDeviation = 0.005 * 0.50,
--
makeStream({
name = "acid-ball-1",
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",
@ -99,36 +83,16 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=0, g=1, b=1, a=0.5},
fireFlameName = "acid-ball-1-flame-rampant",
fireFlameTint = {r=0, g=0.9, b=0, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-acid-ball-1-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.3, 0.75, 0.3, 0.1),
smokeName = "acid-ball-1-smoke-rampant",
smokeTint = {r=0.2, g=0.8, b=0.2, a=0.25},
stickerName = "acid-ball-1-sticker-rampant",
stickerTint = { r = 0.25, g = 0.5, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "acid-ball-1-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.25,0.75,0.1, 0.25),
spawnEntityName = "acid-ball-1-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "acid-ball-1-smoke-on-adding-fuel-rampant"
}
)
}
})
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "acid-ball-2-stream-rampant",
firePictureTint = {r=0.35,g=0.90,b=0,a=1},
smallTreeFlameTint = {r=0.35,g=0.8,b=0,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 2,
particleHoizontalSpeed = 0.2* 0.75 * 4,
particleHoizontalSpeedDeviation = 0.005 * 0.50,
--
makeStream({
name = "acid-ball-2",
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",
@ -159,36 +123,16 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=0, g=1, b=1, a=0.5},
fireFlameName = "acid-ball-2-flame-rampant",
fireFlameTint = {r=0, g=0.9, b=0, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-acid-ball-2-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.3, 0.75, 0.3, 0.1),
smokeName = "acid-ball-2-smoke-rampant",
smokeTint = {r=0.2, g=0.8, b=0.2, a=0.25},
stickerName = "acid-ball-2-sticker-rampant",
stickerTint = { r = 0.25, g = 0.5, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "acid-ball-2-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.25,0.75,0.1, 0.25),
spawnEntityName = "acid-ball-2-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "acid-ball-2-smoke-on-adding-fuel-rampant"
}
)
}
})
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "acid-ball-3-stream-rampant",
firePictureTint = {r=0.35,g=0.90,b=0,a=1},
smallTreeFlameTint = {r=0.35,g=0.8,b=0,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 2,
particleHoizontalSpeed = 0.2* 0.75 * 4,
particleHoizontalSpeedDeviation = 0.005 * 0.50,
--
makeStream({
name = "acid-ball-3",
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",
@ -219,36 +163,16 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=0, g=1, b=1, a=0.5},
fireFlameName = "acid-ball-3-flame-rampant",
fireFlameTint = {r=0, g=0.9, b=0, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-acid-ball-3-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.3, 0.75, 0.3, 0.1),
smokeName = "acid-ball-3-smoke-rampant",
smokeTint = {r=0.2, g=0.8, b=0.2, a=0.25},
stickerName = "acid-ball-3-sticker-rampant",
stickerTint = { r = 0.25, g = 0.5, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "acid-ball-3-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.25,0.75,0.1, 0.25),
spawnEntityName = "acid-ball-3-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "acid-ball-3-smoke-on-adding-fuel-rampant"
}
)
}
})
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "wide-acid-ball-stream-rampant",
firePictureTint = {r=0.35,g=0.90,b=0,a=1},
smallTreeFlameTint = {r=0.35,g=0.8,b=0,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 2,
particleHoizontalSpeed = 0.2* 0.75 * 4,
particleHoizontalSpeedDeviation = 0.005 * 0.50,
--
makeStream({
name = "wide-acid-ball",
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",
@ -279,37 +203,16 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=0, g=1, b=1, a=0.5},
fireFlameName = "wide-acid-ball-flame-rampant",
fireFlameTint = {r=0, g=0.9, b=0, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-wide-acid-ball-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.3, 0.75, 0.3, 0.1),
smokeName = "wide-acid-ball-smoke-rampant",
smokeTint = {r=0.2, g=0.8, b=0.2, a=0.25},
stickerName = "wide-acid-ball-sticker-rampant",
stickerTint = { r = 0.25, g = 0.5, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "wide-acid-ball-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.25,0.75,0.1, 0.25),
spawnEntityName = "wide-acid-ball-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "wide-acid-ball-smoke-on-adding-fuel-rampant"
}
)
}
})
--
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "acid-ball-4-stream-rampant",
firePictureTint = {r=0.35,g=0.90,b=0,a=1},
smallTreeFlameTint = {r=0.35,g=0.8,b=0,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 2,
particleHoizontalSpeed = 0.2* 0.75 * 4,
particleHoizontalSpeedDeviation = 0.005 * 0.50,
makeStream({
name = "acid-ball-4",
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",
@ -340,36 +243,16 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=0, g=1, b=1, a=0.5},
fireFlameName = "acid-ball-4-flame-rampant",
fireFlameTint = {r=0, g=0.9, b=0, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-acid-ball-4-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.3, 0.75, 0.3, 0.1),
smokeName = "acid-ball-4-smoke-rampant",
smokeTint = {r=0.2, g=0.8, b=0.2, a=0.25},
stickerName = "acid-ball-4-sticker-rampant",
stickerTint = { r = 0.25, g = 0.5, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "acid-ball-4-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.25,0.75,0.1, 0.25),
spawnEntityName = "acid-ball-4-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "acid-ball-4-smoke-on-adding-fuel-rampant"
}
)
}
})
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "acid-ball-5-stream-rampant",
firePictureTint = {r=0.35,g=0.90,b=0,a=1},
smallTreeFlameTint = {r=0.35,g=0.8,b=0,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 2,
particleHoizontalSpeed = 0.2* 0.75 * 4,
particleHoizontalSpeedDeviation = 0.005 * 0.50,
--
makeStream({
name = "acid-ball-5",
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",
@ -400,22 +283,5 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=0, g=1, b=1, a=0.5},
fireFlameName = "acid-ball-5-flame-rampant",
fireFlameTint = {r=0, g=0.9, b=0, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-acid-ball-5-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.3, 0.75, 0.3, 0.1),
smokeName = "acid-ball-5-smoke-rampant",
smokeTint = {r=0.2, g=0.8, b=0.2, a=0.25},
stickerName = "acid-ball-5-sticker-rampant",
stickerTint = { r = 0.25, g = 0.5, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "acid-ball-5-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.25,0.75,0.1, 0.25),
spawnEntityName = "acid-ball-5-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "acid-ball-5-smoke-on-adding-fuel-rampant"
}
)
}
})

View File

@ -1,32 +1,42 @@
local biterStreamUtils = require("BiterStreamUtils")
-- imported
-- persistent flame attacks
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "acid-flame-fire-stream-rampant",
firePictureTint = {r=0.35,g=0.90,b=0,a=1},
smallTreeFlameTint = {r=0.35,g=0.8,b=0,a=1},
particleTimeout = 2,
particleVertialAcceleration = 0.005 * 0.60,
particleHoizontalSpeed = 0.2* 0.75 * 1.5,
particleHoizontalSpeedDeviation = 0.005 * 0.70,
local streamUtils = require("StreamUtils")
local colorUtils = require("ColorUtils")
local fireUtils = require("FireUtils")
local stickerUtils = require("StickerUtils")
-- imported functions
local makeColor = colorUtils.makeColor
local makeStream = streamUtils.makeStream
local makeFire = fireUtils.makeFire
local makeSticker = stickerUtils.makeSticker
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 = "direct",
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "create-fire",
entity_name = "acid-flame-fire-flame-rampant"
}
}
}
},
{
{
type = "area",
perimeter = 2.5,
action_delivery =
@ -36,7 +46,7 @@ biterStreamUtils.createBiterStreamAttack(
{
{
type = "create-sticker",
sticker = "acid-flame-fire-sticker-rampant"
sticker = stickerName
},
{
type = "damage",
@ -48,53 +58,44 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
}
},
spineAnimationTint = {r=0, g=1, b=1, a=0.5},
fireFlameName = "acid-flame-fire-flame-rampant",
fireFlameTint = {r=0, g=0.9, b=0, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-acid-flame-fire-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.3, 0.75, 0.3, 0.1),
smokeName = "acid-flame-fire-smoke-rampant",
smokeTint = {r=0.2, g=0.8, b=0.2, a=0.25},
stickerName = "acid-flame-fire-sticker-rampant",
stickerTint = { r = 0.25, g = 0.5, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "acid-flame-fire-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.25,0.75,0.1, 0.25),
spawnEntityName = "acid-flame-fire-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "acid-flame-fire-smoke-on-adding-fuel-rampant"
}
)
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "acid-flame-1-fire-stream-rampant",
firePictureTint = {r=0.35,g=0.90,b=0,a=1},
smallTreeFlameTint = {r=0.35,g=0.8,b=0,a=1},
particleTimeout = 4,
particleVertialAcceleration = 0.005 * 0.60,
particleHoizontalSpeed = 0.2* 0.75 * 1.5,
particleHoizontalSpeedDeviation = 0.005 * 0.70,
particleTint = {r=0, g=1, b=1, a=0.5},
actions = {
{
type = "direct",
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "create-fire",
entity_name = "acid-flame-1-fire-flame-rampant"
}
}
}
},
{
type = "direct",
action_delivery = {
type = "instant",
target_effects = {
type= "create-fire",
entity_name = fireName
}
}
}
}
})
--
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",
perimeter = 2.5,
action_delivery =
@ -104,7 +105,7 @@ biterStreamUtils.createBiterStreamAttack(
{
{
type = "create-sticker",
sticker = "acid-flame-1-fire-sticker-rampant"
sticker = stickerName
},
{
type = "damage",
@ -116,53 +117,45 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
}
},
spineAnimationTint = {r=0, g=1, b=1, a=0.5},
fireFlameName = "acid-flame-1-fire-flame-rampant",
fireFlameTint = {r=0, g=0.9, b=0, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-acid-flame-1-fire-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.3, 0.75, 0.3, 0.1),
smokeName = "acid-flame-1-fire-smoke-rampant",
smokeTint = {r=0.2, g=0.8, b=0.2, a=0.25},
stickerName = "acid-flame-1-fire-sticker-rampant",
stickerTint = { r = 0.25, g = 0.5, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "acid-flame-1-fire-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.25,0.75,0.1, 0.25),
spawnEntityName = "acid-flame-1-fire-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "acid-flame-1-fire-smoke-on-adding-fuel-rampant"
}
)
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "acid-flame-2-fire-stream-rampant",
firePictureTint = {r=0.35,g=0.90,b=0,a=1},
smallTreeFlameTint = {r=0.35,g=0.8,b=0,a=1},
particleTimeout = 8,
particleVertialAcceleration = 0.005 * 0.60,
particleHoizontalSpeed = 0.2* 0.75 * 1.5,
particleHoizontalSpeedDeviation = 0.005 * 0.70,
particleTint = {r=0, g=1, b=1, a=0.5},
actions = {
{
type = "direct",
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "create-fire",
entity_name = "acid-flame-2-fire-flame-rampant"
}
}
}
},
{
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",
perimeter = 2.5,
action_delivery =
@ -172,35 +165,28 @@ biterStreamUtils.createBiterStreamAttack(
{
{
type = "create-sticker",
sticker = "acid-flame-2-fire-sticker-rampant"
sticker = stickerName
},
{
type = "damage",
damage = { amount = 1, type = "fire" }
damage = { amount = 2, type = "fire" }
},
{
type = "damage",
damage = { amount = 2, type = "acid" }
damage = { amount = 3, type = "acid" }
}
}
}
},
{
type = "direct",
action_delivery = {
type = "instant",
target_effects = {
type= "create-fire",
entity_name = fireName
}
}
}
},
spineAnimationTint = {r=0, g=1, b=1, a=0.5},
fireFlameName = "acid-flame-2-fire-flame-rampant",
fireFlameTint = {r=0, g=0.9, b=0, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-acid-flame-2-fire-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.3, 0.75, 0.3, 0.1),
smokeName = "acid-flame-2-fire-smoke-rampant",
smokeTint = {r=0.2, g=0.8, b=0.2, a=0.25},
stickerName = "acid-flame-2-fire-sticker-rampant",
stickerTint = { r = 0.25, g = 0.5, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "acid-flame-2-fire-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.25,0.75,0.1, 0.25),
spawnEntityName = "acid-flame-2-fire-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "acid-flame-2-fire-smoke-on-adding-fuel-rampant"
}
)
}
})

View File

@ -1,17 +1,27 @@
local biterStreamUtils = require("BiterStreamUtils")
-- bobs replacement attacks
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "bob-explosive-ball-stream-rampant",
firePictureTint = {r=0.35,g=0.90,b=0,a=1},
smallTreeFlameTint = {r=0.35,g=0.8,b=0,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 0.60,
particleHoizontalSpeed = 0.2* 0.75 * 1.5,
particleHoizontalSpeedDeviation = 0.005 * 0.70,
-- import
local streamUtils = require("StreamUtils")
local colorUtils = require("ColorUtils")
local fireUtils = require("FireUtils")
local stickerUtils = require("StickerUtils")
-- imported functions
local makeStream = streamUtils.makeStream
local makeColor = colorUtils.makeColor
local makeSpreadEffect = fireUtils.makeSpreadEffect
local makeFire = fireUtils.makeFire
local makeSticker = stickerUtils.makeSticker
-- module code
makeStream({
name = "bob-explosive-ball",
particleTint = {r=1, g=0.97, b=0.34, a=0.5},
spineAnimationTint = {r=1, g=0.97, b=0.34, a=0.5},
softSmokeTint = makeColor(0.3, 0.75, 0.3, 0.1),
actions = {
{
type = "direct",
@ -52,37 +62,16 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=1, g=0.97, b=0.34, a=0.5},
fireFlameName = "bob-explosive-ball-flame-rampant",
fireFlameTint = {r=0, g=0.9, b=0, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-bob-explosive-ball-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.3, 0.75, 0.3, 0.1),
smokeName = "bob-explosive-ball-smoke-rampant",
smokeTint = {r=0.2, g=0.8, b=0.2, a=0.25},
stickerName = "bob-explosive-ball-sticker-rampant",
stickerTint = { r = 0.25, g = 0.5, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "bob-explosive-ball-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.25,0.75,0.1, 0.25),
spawnEntityName = "bob-explosive-ball-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "bob-explosive-ball-smoke-on-adding-fuel-rampant"
}
)
}
})
--
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "bob-explosive-ball-1-stream-rampant",
firePictureTint = {r=0.35,g=0.90,b=0,a=1},
smallTreeFlameTint = {r=0.35,g=0.8,b=0,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 0.60,
particleHoizontalSpeed = 0.2* 0.75 * 1.5,
particleHoizontalSpeedDeviation = 0.005 * 0.70,
makeStream({
name = "bob-explosive-ball-1",
particleTint = {r=1, g=0.97, b=0.34, a=0.5},
spineAnimationTint = {r=1, g=0.97, b=0.34, a=0.5},
softSmokeTint = makeColor(0.3, 0.75, 0.3, 0.1),
actions = {
{
type = "direct",
@ -123,38 +112,31 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=1, g=0.97, b=0.34, a=0.5},
fireFlameName = "bob-explosive-ball-1-flame-rampant",
fireFlameTint = {r=0, g=0.9, b=0, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-bob-explosive-ball-1-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.3, 0.75, 0.3, 0.1),
smokeName = "bob-explosive-ball-1-smoke-rampant",
smokeTint = {r=0.2, g=0.8, b=0.2, a=0.25},
stickerName = "bob-explosive-ball-1-sticker-rampant",
stickerTint = { r = 0.25, g = 0.5, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "bob-explosive-ball-1-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.25,0.75,0.1, 0.25),
spawnEntityName = "bob-explosive-ball-1-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "bob-explosive-ball-1-smoke-on-adding-fuel-rampant"
}
)
}
})
-- fire
--
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "bob-fire-ball-stream-rampant",
firePictureTint = {r=1,g=1,b=1,a=1},
smallTreeFlameTint = {r=1,g=1,b=1,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 0.60,
particleHoizontalSpeed = 0.2* 0.75 * 1.5,
particleHoizontalSpeedDeviation = 0.005 * 0.70,
local name = "bob-fire-ball"
local spawnEntityName = makeSpreadEffect({
name = name,
smokeWithoutGlowTint = makeColor(0.45,0.25,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=1, g=0.17, b=0.17, a=0.5},
spineAnimationTint = {r=1, g=0.43, b=0.17, a=0.5},
softSmokeTint = makeColor(0.7, 0.4, 0.2, 0.1),
actions = {
{
type = "direct",
@ -165,7 +147,7 @@ biterStreamUtils.createBiterStreamAttack(
{
{
type = "create-fire",
entity_name = "bob-fire-ball-flame-rampant"
entity_name = fireName
}
}
}
@ -180,7 +162,7 @@ biterStreamUtils.createBiterStreamAttack(
{
{
type = "create-sticker",
sticker = "bob-fire-ball-sticker-rampant",
sticker = stickerName,
},
{
type = "damage",
@ -189,38 +171,16 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=1, g=0.43, b=0.17, a=0.5},
fireFlameName = "bob-fire-ball-flame-rampant",
fireFlameTint = {r=1, g=0.64, b=0.05, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-bob-fire-ball-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.7, 0.4, 0.2, 0.1),
smokeName = "bob-fire-ball-smoke-rampant",
smokeTint = {r=0.2, g=0.2, b=0.2, a=0.25},
stickerName = "bob-fire-ball-sticker-rampant",
stickerTint = { r = 0.45, g = 0.25, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "bob-fire-ball-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.45,0.25,0.1, 0.25),
spawnEntityName = "bob-fire-ball-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "bob-fire-ball-smoke-on-adding-fuel-rampant"
}
)
}
})
-- poison
--
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "bob-poison-ball-stream-rampant",
firePictureTint = {r=1,g=1,b=1,a=1},
smallTreeFlameTint = {r=1,g=1,b=1,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 0.60,
particleHoizontalSpeed = 0.2* 0.75 * 1.5,
particleHoizontalSpeedDeviation = 0.005 * 0.70,
makeStream({
name = "bob-poison-ball",
particleTint = {r=0.1, g=0.5, b=1, a=0.5},
spineAnimationTint = {r=0, g=0, b=1, a=0.5},
softSmokeTint = makeColor(0.7, 0.4, 0.2, 0.1),
actions = {
{
type = "direct",
@ -251,36 +211,17 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=0, g=0, b=1, a=0.5},
fireFlameName = "bob-poison-ball-flame-rampant",
fireFlameTint = {r=1, g=0.64, b=0.05, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-bob-poison-ball-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.7, 0.4, 0.2, 0.1),
smokeName = "bob-poison-ball-smoke-rampant",
smokeTint = {r=0.2, g=0.2, b=0.2, a=0.25},
stickerName = "bob-poison-ball-sticker-rampant",
stickerTint = { r = 0.45, g = 0.25, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "bob-poison-ball-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.45,0.25,0.1, 0.25),
spawnEntityName = "bob-poison-ball-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "bob-poison-ball-smoke-on-adding-fuel-rampant"
}
)
}
})
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "bob-poison-ball-1-stream-rampant",
firePictureTint = {r=1,g=1,b=1,a=1},
smallTreeFlameTint = {r=1,g=1,b=1,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 0.60,
particleHoizontalSpeed = 0.2* 0.75 * 1.5,
particleHoizontalSpeedDeviation = 0.005 * 0.70,
--
makeStream({
name = "bob-poison-ball-1",
particleTint = {r=0.1, g=0.5, b=1, a=0.5},
spineAnimationTint = {r=0, g=0, b=1, a=0.5},
softSmokeTint = makeColor(0.7, 0.4, 0.2, 0.1),
actions = {
{
type = "direct",
@ -311,27 +252,11 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=0, g=0, b=1, a=0.5},
fireFlameName = "bob-poison-ball-1-flame-rampant",
fireFlameTint = {r=1, g=0.64, b=0.05, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-bob-poison-ball-1-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.7, 0.4, 0.2, 0.1),
smokeName = "bob-poison-ball-1-smoke-rampant",
smokeTint = {r=0.2, g=0.2, b=0.2, a=0.25},
stickerName = "bob-poison-ball-1-sticker-rampant",
stickerTint = { r = 0.45, g = 0.25, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "bob-poison-ball-1-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.45,0.25,0.1, 0.25),
spawnEntityName = "bob-poison-ball-1-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "bob-poison-ball-1-smoke-on-adding-fuel-rampant"
}
)
}
})
-- piercing
data:extend({
{
type = "projectile",
@ -363,16 +288,11 @@ data:extend({
}
})
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "bob-piercing-ball-stream-rampant",
firePictureTint = {r=1,g=1,b=1,a=1},
smallTreeFlameTint = {r=1,g=1,b=1,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 0.60,
particleHoizontalSpeed = 0.2* 0.75 * 1.5,
particleHoizontalSpeedDeviation = 0.005 * 0.70,
makeStream({
name = "bob-piercing-ball",
particleTint = {r=0.1, g=0.1, b=0.1, a=0.8},
spineAnimationTint = {r=0.1, g=0.1, b=0.1, a=0.8},
softSmokeTint = makeColor(0.7, 0.4, 0.2, 0.1),
actions = {
{
type = "cluster",
@ -403,27 +323,10 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=0.1, g=0.1, b=0.1, a=0.8},
fireFlameName = "bob-piercing-ball-flame-rampant",
fireFlameTint = {r=1, g=0.64, b=0.05, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-bob-piercing-ball-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.7, 0.4, 0.2, 0.1),
smokeName = "bob-piercing-ball-smoke-rampant",
smokeTint = {r=0.2, g=0.2, b=0.2, a=0.25},
stickerName = "bob-piercing-ball-sticker-rampant",
stickerTint = { r = 0.45, g = 0.25, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "bob-piercing-ball-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.45,0.25,0.1, 0.25),
spawnEntityName = "bob-piercing-ball-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "bob-piercing-ball-smoke-on-adding-fuel-rampant"
}
)
}
})
-- electric
--
data:extend({
{
@ -466,16 +369,12 @@ data:extend({
}
})
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "bob-electric-ball-stream-rampant",
firePictureTint = {r=1,g=1,b=1,a=1},
smallTreeFlameTint = {r=1,g=1,b=1,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 0.60,
particleHoizontalSpeed = 0.2* 0.75 * 1.5,
particleHoizontalSpeedDeviation = 0.005 * 0.70,
makeStream({
name = "bob-electric-ball",
particleTint = {r=0, g=0.1, b=1, a=1},
spineAnimationTint = {r=0, g=0.1, b=1, a=1},
softSmokeTint = makeColor(0.7, 0.4, 0.2, 0.1),
actions = {
{
type = "cluster",
@ -506,36 +405,16 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=0, g=0.1, b=1, a=1},
fireFlameName = "bob-electric-ball-flame-rampant",
fireFlameTint = {r=1, g=0.64, b=0.05, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-bob-electric-ball-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.7, 0.4, 0.2, 0.1),
smokeName = "bob-electric-ball-smoke-rampant",
smokeTint = {r=0.2, g=0.2, b=0.2, a=0.25},
stickerName = "bob-electric-ball-sticker-rampant",
stickerTint = { r = 0.45, g = 0.25, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "bob-electric-ball-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.45,0.25,0.1, 0.25),
spawnEntityName = "bob-electric-ball-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "bob-electric-ball-smoke-on-adding-fuel-rampant"
}
)
}
})
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "bob-electric-ball-1-stream-rampant",
firePictureTint = {r=1,g=1,b=1,a=1},
smallTreeFlameTint = {r=1,g=1,b=1,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 0.60,
particleHoizontalSpeed = 0.2* 0.75 * 1.5,
particleHoizontalSpeedDeviation = 0.005 * 0.70,
--
makeStream({
name = "bob-electric-ball-1",
particleTint = {r=0, g=0.1, b=1, a=1},
spineAnimationTint = {r=0, g=0.1, b=1, a=1},
softSmokeTint = makeColor(0.7, 0.4, 0.2, 0.1),
actions = {
{
type = "cluster",
@ -566,112 +445,16 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=0, g=0.1, b=1, a=1},
fireFlameName = "bob-electric-ball-1-flame-rampant",
fireFlameTint = {r=1, g=0.64, b=0.05, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-bob-electric-ball-1-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.7, 0.4, 0.2, 0.1),
smokeName = "bob-electric-ball-1-smoke-rampant",
smokeTint = {r=0.2, g=0.2, b=0.2, a=0.25},
stickerName = "bob-electric-ball-1-sticker-rampant",
stickerTint = { r = 0.45, g = 0.25, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "bob-electric-ball-1-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.45,0.25,0.1, 0.25),
spawnEntityName = "bob-electric-ball-1-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "bob-electric-ball-1-smoke-on-adding-fuel-rampant"
}
)
}
})
-- titan
--
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "bob-titan-ball-stream-rampant",
firePictureTint = {r=1,g=1,b=1,a=1},
smallTreeFlameTint = {r=1,g=1,b=1,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 0.60,
particleHoizontalSpeed = 0.2* 0.75 * 1.5,
particleHoizontalSpeedDeviation = 0.005 * 0.70,
makeStream({
name = "bob-titan-ball",
particleTint = {r=0, g=0.1, b=1, a=1},
actions = {
{
type = "direct",
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "create-entity",
entity_name = "small-fire-cloud"
},
{
type = "create-entity",
entity_name = "big-explosion"
}
}
}
},
{
type = "area",
perimeter = 3,
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "damage",
damage = { amount = 15, type = "electric" }
},
{
type = "damage",
damage = { amount = 15, type = "explosion" }
},
{
type = "damage",
damage = { amount = 15, type = "fire" }
}
}
}
}
},
spineAnimationTint = {r=0, g=0.1, b=1, a=1},
fireFlameName = "bob-titan-ball-flame-rampant",
fireFlameTint = {r=1, g=0.64, b=0.05, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-bob-titan-ball-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.7, 0.4, 0.2, 0.1),
smokeName = "bob-titan-ball-smoke-rampant",
smokeTint = {r=0.2, g=0.2, b=0.2, a=0.25},
stickerName = "bob-titan-ball-sticker-rampant",
stickerTint = { r = 0.45, g = 0.25, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "bob-titan-ball-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.45,0.25,0.1, 0.25),
spawnEntityName = "bob-titan-ball-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "bob-titan-ball-smoke-on-adding-fuel-rampant"
}
)
-- behemoth
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "bob-behemoth-ball-stream-rampant",
firePictureTint = {r=1,g=1,b=1,a=1},
smallTreeFlameTint = {r=1,g=1,b=1,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 0.60,
particleHoizontalSpeed = 0.2* 0.75 * 1.5,
particleHoizontalSpeedDeviation = 0.005 * 0.70,
particleTint = {r=0, g=0.1, b=1, a=1},
softSmokeTint = makeColor(0.7, 0.4, 0.2, 0.1),
actions = {
{
type = "direct",
@ -718,38 +501,72 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=0, g=0.1, b=1, a=1},
fireFlameName = "bob-behemoth-ball-flame-rampant",
fireFlameTint = {r=1, g=0.64, b=0.05, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-bob-behemoth-ball-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.7, 0.4, 0.2, 0.1),
smokeName = "bob-behemoth-ball-smoke-rampant",
smokeTint = {r=0.2, g=0.2, b=0.2, a=0.25},
stickerName = "bob-behemoth-ball-sticker-rampant",
stickerTint = { r = 0.45, g = 0.25, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "bob-behemoth-ball-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.45,0.25,0.1, 0.25),
spawnEntityName = "bob-behemoth-ball-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "bob-behemoth-ball-smoke-on-adding-fuel-rampant"
}
)
}
})
-- leviathan
--
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "bob-leviathan-ball-stream-rampant",
firePictureTint = {r=1,g=1,b=1,a=1},
smallTreeFlameTint = {r=1,g=1,b=1,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 0.60,
particleHoizontalSpeed = 0.2* 0.75 * 1.5,
particleHoizontalSpeedDeviation = 0.005 * 0.70,
makeStream({
name = "bob-behemoth-ball",
particleTint = {r=0, g=0.1, b=1, a=1},
spineAnimationTint = {r=0, g=0.1, b=1, a=1},
softSmokeTint = makeColor(0.7, 0.4, 0.2, 0.1),
actions = {
{
type = "direct",
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "create-entity",
entity_name = "small-poison-cloud"
},
{
type = "create-entity",
entity_name = "big-explosion"
}
}
}
},
{
type = "area",
perimeter = 3,
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "damage",
damage = { amount = 15, type = "electric" }
},
{
type = "damage",
damage = { amount = 15, type = "explosion" }
},
{
type = "damage",
damage = { amount = 15, type = "fire" }
},
{
type = "damage",
damage = { amount = 15, type = "poison" }
}
}
}
}
}
})
--
makeStream({
name = "bob-leviathan-ball",
particleTint = {r=0, g=0.1, b=1, a=1},
spineAnimationTint = {r=0, g=0.1, b=1, a=1},
softSmokeTint = makeColor(0.7, 0.4, 0.2, 0.1),
actions = {
{
type = "cluster",
@ -819,22 +636,5 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=0, g=0.1, b=1, a=1},
fireFlameName = "bob-leviathan-ball-flame-rampant",
fireFlameTint = {r=1, g=0.64, b=0.05, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-bob-leviathan-ball-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.7, 0.4, 0.2, 0.1),
smokeName = "bob-leviathan-ball-smoke-rampant",
smokeTint = {r=0.2, g=0.2, b=0.2, a=0.25},
stickerName = "bob-leviathan-ball-sticker-rampant",
stickerTint = { r = 0.45, g = 0.25, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "bob-leviathan-ball-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.45,0.25,0.1, 0.25),
spawnEntityName = "bob-leviathan-ball-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "bob-leviathan-ball-smoke-on-adding-fuel-rampant"
}
)
}
})

View File

@ -1,17 +1,20 @@
local biterStreamUtils = require("BiterStreamUtils")
-- import
-- NE replacement attacks
-- unit launchers
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "ne-infected-unit-ball-stream-rampant",
firePictureTint = {r=0.35,g=0.90,b=0,a=1},
smallTreeFlameTint = {r=0.35,g=0.8,b=0,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 2,
particleHoizontalSpeed = 0.2* 0.75 * 4,
particleHoizontalSpeedDeviation = 0.005 * 0.50,
local streamUtils = require("StreamUtils")
local colorUtils = require("ColorUtils")
-- imported functions
local makeStream = streamUtils.makeStream
local makeColor = colorUtils.makeColor
-- module code
makeStream({
name = "ne-infected-unit-ball",
particleTint = {r=0, g=0.97, b=0.34, a=0.5},
spineAnimationTint = {r=0, g=0.1, b=1, a=1},
softSmokeTint = makeColor(0.7, 0.4, 0.2, 0.1),
actions = {
{
type = "direct",
@ -44,36 +47,16 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=0, g=0.57, b=0.34, a=0.5},
fireFlameName = "ne-infected-unit-ball-flame-rampant",
fireFlameTint = {r=0, g=0.9, b=0, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-ne-infected-unit-ball-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.3, 0.75, 0.3, 0.1),
smokeName = "ne-infected-unit-ball-smoke-rampant",
smokeTint = {r=0.2, g=0.8, b=0.2, a=0.25},
stickerName = "ne-infected-unit-ball-sticker-rampant",
stickerTint = { r = 0.25, g = 0.5, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "ne-infected-unit-ball-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.25,0.75,0.1, 0.25),
spawnEntityName = "ne-infected-unit-ball-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "ne-infected-unit-ball-smoke-on-adding-fuel-rampant"
}
)
}
})
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "ne-mutated-unit-ball-stream-rampant",
firePictureTint = {r=0.35,g=0.90,b=0,a=1},
smallTreeFlameTint = {r=0.35,g=0.8,b=0,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 2,
particleHoizontalSpeed = 0.2* 0.75 * 4,
particleHoizontalSpeedDeviation = 0.005 * 0.50,
--
makeStream({
name = "ne-mutated-unit-ball",
particleTint = {r=0.5, g=0.7, b=0.34, a=0.5},
spineAnimationTint = {r=0.5, g=0.97, b=0.34, a=0.5},
softSmokeTint = makeColor(0.3, 0.75, 0.3, 0.1),
actions = {
{
type = "direct",
@ -117,38 +100,16 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=0.5, g=0.97, b=0.34, a=0.5},
fireFlameName = "ne-mutated-unit-ball-flame-rampant",
fireFlameTint = {r=0, g=0.9, b=0, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-ne-mutated-unit-ball-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.3, 0.75, 0.3, 0.1),
smokeName = "ne-mutated-unit-ball-smoke-rampant",
smokeTint = {r=0.2, g=0.8, b=0.2, a=0.25},
stickerName = "ne-mutated-unit-ball-sticker-rampant",
stickerTint = { r = 0.25, g = 0.5, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "ne-mutated-unit-ball-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.25,0.75,0.1, 0.25),
spawnEntityName = "ne-mutated-unit-ball-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "ne-mutated-unit-ball-smoke-on-adding-fuel-rampant"
}
)
}
})
-- standard attack
--
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "ne-infected-ball-stream-rampant",
firePictureTint = {r=0.35,g=0.90,b=0,a=1},
smallTreeFlameTint = {r=0.35,g=0.8,b=0,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 2,
particleHoizontalSpeed = 0.2* 0.75 * 4,
particleHoizontalSpeedDeviation = 0.005 * 0.50,
particleTint = {r=0, g=0.97, b=0.34, a=0.5},
makeStream({
name = "ne-infected-ball",
particleTint = {r=0.5, g=0.7, b=0.34, a=0.5},
spineAnimationTint = {r=0.5, g=0.97, b=0.34, a=0.5},
softSmokeTint = makeColor(0.3, 0.75, 0.3, 0.1),
actions = {
{
type = "direct",
@ -183,37 +144,16 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=1, g=0.97, b=0.34, a=0.5},
fireFlameName = "ne-infected-ball-flame-rampant",
fireFlameTint = {r=0, g=0.9, b=0, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-ne-infected-ball-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.3, 0.75, 0.3, 0.1),
smokeName = "ne-infected-ball-smoke-rampant",
smokeTint = {r=0.2, g=0.8, b=0.2, a=0.25},
stickerName = "ne-infected-ball-sticker-rampant",
stickerTint = { r = 0.25, g = 0.5, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "ne-infected-ball-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.25,0.75,0.1, 0.25),
spawnEntityName = "ne-infected-ball-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "ne-infected-ball-smoke-on-adding-fuel-rampant"
}
)
}
})
--
biterStreamUtils.createBiterStreamAttack(
{
fireFlameStreamName = "ne-mutated-ball-stream-rampant",
firePictureTint = {r=0.35,g=0.90,b=0,a=1},
smallTreeFlameTint = {r=0.35,g=0.8,b=0,a=1},
particleTimeout = 1,
particleVertialAcceleration = 0.005 * 2,
particleHoizontalSpeed = 0.2* 0.75 * 4,
particleHoizontalSpeedDeviation = 0.005 * 0.50,
makeStream({
name = "ne-mutated-ball",
particleTint = {r=0.5, g=0.7, b=0.34, a=0.5},
spineAnimationTint = {r=0.5, g=0.97, b=0.34, a=0.5},
softSmokeTint = makeColor(0.3, 0.75, 0.3, 0.1),
actions = {
{
type = "direct",
@ -229,7 +169,7 @@ biterStreamUtils.createBiterStreamAttack(
{
type = "create-entity",
entity_name = "acid-splash-mutated"
}
}
}
}
},
@ -252,22 +192,5 @@ biterStreamUtils.createBiterStreamAttack(
}
}
}
},
spineAnimationTint = {r=0.5, g=0.97, b=0.34, a=0.5},
fireFlameName = "ne-mutated-ball-flame-rampant",
fireFlameTint = {r=0, g=0.9, b=0, a=0.5},
fireFlameDamagePerTick = { amount = 45/60, type = "fire" },
softSmokeName = "soft-ne-mutated-ball-smoke-rampant",
softSmokeTint = biterStreamUtils.make_color(0.3, 0.75, 0.3, 0.1),
smokeName = "ne-mutated-ball-smoke-rampant",
smokeTint = {r=0.2, g=0.8, b=0.2, a=0.25},
stickerName = "ne-mutated-ball-sticker-rampant",
stickerTint = { r = 0.25, g = 0.5, b = 0.25, a = 0.18 },
stickerDamagePerTick = { amount = 120 / 60, type = "fire" },
smokeWithoutGlowName = "ne-mutated-ball-smoke-without-glow-rampant",
smokeWithoutGlowTint = biterStreamUtils.make_color(0.25,0.75,0.1, 0.25),
spawnEntityName = "ne-mutated-ball-flame-on-tree",
spawnEntityDamagePerTick = { amount = 45/60, type = "fire" },
smokeOnAddingFuel = "ne-mutated-ball-smoke-on-adding-fuel-rampant"
}
)
}
})

View File

@ -1,822 +0,0 @@
local biterStreamUtils = {}
local math3d = require "math3d"
function biterStreamUtils.make_color(r_,g_,b_,a_)
return { r = r_ * a_, g = g_ * a_, b = b_ * a_, a = a_ }
end
function foreach(table_, fun_)
for k, tab in pairs(table_) do fun_(tab) end
return table_
end
-- biter stream attack
function biterStreamUtils.createBiterStreamAttack(attributes)
----- UTILS
local function create_burnt_patch_pictures()
local base = {
filename = "__base__/graphics/entity/fire-flame/burnt-patch.png",
line_length = 3,
width = 115,
height = 56,
frame_count = 9,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.09375, 0.125},
}
local variations = {}
for y=1,(base.frame_count / base.line_length) do
for x=1,base.line_length do
table.insert(variations,
{
filename = base.filename,
width = base.width,
height = base.height,
tint = base.tint,
shift = base.shift,
x = (x-1) * base.width,
y = (y-1) * base.height,
})
end
end
return variations
end
local function create_fire_pictures(opts)
local fire_blend_mode = opts.blend_mode or "additive"
local fire_animation_speed = opts.animation_speed or 0.5
local fire_scale = opts.scale or 1
local fire_tint = attributes.firePictureTint
local fire_flags = { "compressed" }
local retval = {
{
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 = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { -0.0390625, -0.90625 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-12.png",
line_length = 8,
width = 63,
height = 116,
frame_count = 25,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { -0.015625, -0.914065 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-11.png",
line_length = 8,
width = 61,
height = 122,
frame_count = 25,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { -0.0078125, -0.90625 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-10.png",
line_length = 8,
width = 65,
height = 108,
frame_count = 25,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { -0.0625, -0.64844 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-09.png",
line_length = 8,
width = 64,
height = 101,
frame_count = 25,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { -0.03125, -0.695315 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-08.png",
line_length = 8,
width = 50,
height = 98,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { -0.0546875, -0.77344 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-07.png",
line_length = 8,
width = 54,
height = 84,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { 0.015625, -0.640625 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-06.png",
line_length = 8,
width = 65,
height = 92,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { 0, -0.83594 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-05.png",
line_length = 8,
width = 59,
height = 103,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { 0.03125, -0.882815 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-04.png",
line_length = 8,
width = 67,
height = 130,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { 0.015625, -1.109375 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-03.png",
line_length = 8,
width = 74,
height = 117,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { 0.046875, -0.984375 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-02.png",
line_length = 8,
width = 74,
height = 114,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { 0.0078125, -0.96875 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-01.png",
line_length = 8,
width = 66,
height = 119,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { -0.0703125, -1.039065 }
},
}
return foreach(retval, function(tab)
if tab.shift and tab.scale then tab.shift = { tab.shift[1] * tab.scale, tab.shift[2] * tab.scale } end
end)
end
local function create_small_tree_flame_animations(opts)
local fire_blend_mode = opts.blend_mode or "additive"
local fire_animation_speed = opts.animation_speed or 0.5
local fire_scale = opts.scale or 1
local fire_tint = attributes.smallTreeFlameTint
local fire_flags = { "compressed" }
local retval = {
{
filename = "__base__/graphics/entity/fire-flame/tree-fire-flame-01-a.png",
line_length = 8,
width = 38,
height = 110,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.03125, -1.5},
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags
},
{
filename = "__base__/graphics/entity/fire-flame/tree-fire-flame-01-b.png",
line_length = 8,
width = 39,
height = 111,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.078125, -1.51562},
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags
},
{
filename = "__base__/graphics/entity/fire-flame/tree-fire-flame-01-c.png",
line_length = 8,
width = 44,
height = 108,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.15625, -1.5},
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags
},
{
filename = "__base__/graphics/entity/fire-flame/tree-fire-flame-03-a.png",
line_length = 8,
width = 38,
height = 110,
frame_count = 23,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.03125, -1.5},
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags
},
{
filename = "__base__/graphics/entity/fire-flame/tree-fire-flame-03-b.png",
line_length = 8,
width = 34,
height = 98,
frame_count = 23,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.03125, -1.34375},
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags
},
{
filename = "__base__/graphics/entity/fire-flame/tree-fire-flame-03-c.png",
line_length = 8,
width = 39,
height = 111,
frame_count = 23,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.078125, -1.51562},
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags
}
}
return foreach(retval, function(tab)
if tab.shift and tab.scale then tab.shift = { tab.shift[1] * tab.scale, tab.shift[2] * tab.scale } end
end)
end
------CONTENT -----
-- type of stream biter spit
data:extend(
{
{
type = "stream",
name = attributes.fireFlameStreamName,
flags = {"not-on-map"},
stream_light = {intensity = 1, size = 4},
ground_light = {intensity = 0.8, size = 4},
smoke_sources =
{
{
name = attributes.softSmokeName,
frequency = 0.05, --0.25,
position = {0.0, 0}, -- -0.8},
starting_frame_deviation = 60
}
},
particle_buffer_size = 90,
particle_spawn_interval = 1,
particle_spawn_timeout = attributes.particleTimeout,
particle_vertical_acceleration = attributes.particleVertialAcceleration,
particle_horizontal_speed = attributes.particleHoizontalSpeed,
particle_horizontal_speed_deviation = attributes.particleHoizontalSpeedDeviation,
particle_start_alpha = 0.5,
particle_end_alpha = 1,
particle_start_scale = 0.2,
particle_loop_frame_count = 3,
particle_fade_out_threshold = 0.9,
particle_loop_exit_threshold = 0.25,
action = attributes.actions,
spine_animation =
{
filename = "__base__/graphics/entity/flamethrower-fire-stream/flamethrower-fire-stream-spine.png",
blend_mode = "additive",
tint = attributes.spineAnimationTint,
line_length = 4,
width = 32,
height = 18,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
animation_speed = 2,
shift = {0, 0},
},
shadow =
{
filename = "__base__/graphics/entity/acid-projectile-purple/acid-projectile-purple-shadow.png",
line_length = 5,
width = 28,
height = 16,
frame_count = 33,
priority = "high",
shift = {-0.09, 0.395}
},
particle =
{
filename = "__base__/graphics/entity/flamethrower-fire-stream/flamethrower-explosion.png",
priority = "extra-high",
width = 64,
tint = attributes.particleTint,
height = 64,
frame_count = 32,
line_length = 8
},
}
}
)
-- the burning animation
data:extend({
{
type = "fire",
name = attributes.fireFlameName,
flags = {"placeable-off-grid", "not-on-map"},
duration = 600,
fade_away_duration = 600,
spread_duration = 600,
start_scale = 0.20,
end_scale = 1.0,
color = attributes.fireFlameTint,
damage_per_tick = attributes.fireFlameDamagePerTick,
spawn_entity = attributes.spawnEntityName,
spread_delay = 300,
spread_delay_deviation = 180,
maximum_spread_count = 100,
initial_lifetime = 480,
flame_alpha = 0.35,
flame_alpha_deviation = 0.05,
emissions_per_tick = 0.005,
add_fuel_cooldown = 10,
increase_duration_cooldown = 10,
increase_duration_by = 20,
fade_in_duration = 30,
fade_out_duration = 30,
lifetime_increase_by = 20,
lifetime_increase_cooldown = 10,
delay_between_initial_flames = 10,
burnt_patch_lifetime = 1800,
on_fuel_added_action =
{
type = "direct",
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "create-smoke",
entity_name = attributes.smokeOnAddingFuel,
-- speed = {-0.03, 0},
-- speed_multiplier = 0.99,
-- speed_multiplier_deviation = 1.1,
offset_deviation = {{-0.5, -0.5}, {0.5, 0.5}},
speed_from_center = 0.01
}
}
}
},
pictures = create_fire_pictures({ blend_mode = "normal", animation_speed = 1, scale = 0.5}),
smoke_source_pictures =
{
{
filename = "__base__/graphics/entity/fire-flame/fire-smoke-source-1.png",
line_length = 8,
width = 101,
height = 138,
frame_count = 31,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.109375, -1.1875},
animation_speed = 0.5,
},
{
filename = "__base__/graphics/entity/fire-flame/fire-smoke-source-2.png",
line_length = 8,
width = 99,
height = 138,
frame_count = 31,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.203125, -1.21875},
animation_speed = 0.5,
},
},
burnt_patch_pictures = create_burnt_patch_pictures(),
burnt_patch_alpha_default = 0.4,
burnt_patch_alpha_variations = {
-- { tile = "grass", alpha = 0.4 },
-- { tile = "grass-medium", alpha = 0.4 },
{ tile = "grass-dry", alpha = 0.45 },
{ tile = "dirt", alpha = 0.3 },
{ tile = "dirt-dark", alpha = 0.35 },
{ tile = "sand", alpha = 0.24 },
{ tile = "sand-dark", alpha = 0.28 },
{ tile = "stone-path", alpha = 0.26 },
{ tile = "concrete", alpha = 0.24 },
},
smoke =
{
{
name = attributes.smokeName,
deviation = {0.5, 0.5},
frequency = 0.25 / 2,
position = {0.0, -0.8},
starting_vertical_speed = 0.05,
starting_vertical_speed_deviation = 0.005,
vertical_speed_slowdown = 0.99,
starting_frame_deviation = 60,
height = -0.5,
}
},
light = {intensity = 1, size = 20},
working_sound =
{
sound = { filename = "__base__/sound/furnace.ogg" },
max_sounds_per_type = 3
},
}})
-- what the stream spawns on the ground for persistent damage
data:extend(
{
{
type = "sticker",
name = attributes.stickerName,
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),
},
duration_in_ticks = 30 * 60,
target_movement_modifier = 0.8,
damage_per_tick = attributes.stickerDamagePerTick,
spread_fire_entity = attributes.spawnEntityName,
fire_spread_cooldown = 30,
fire_spread_radius = 0.75,
},
})
-- types of smoke coming off stream
local function firesmoke(opts)
return {
type = "smoke",
name = opts.name,
flags = {"not-on-map"},
duration = opts.duration or 600,
fade_in_duration = opts.fade_in_duration or 0,
fade_away_duration = opts.fade_away_duration or 600,
spread_duration = opts.spread_duration or 600,
start_scale = opts.start_scale or 0.20,
end_scale = opts.end_scale or 1.0,
color = opts.color,
cyclic = true,
affected_by_wind = opts.affected_by_wind or true,
animation = opts.animation or
{
width = 152,
height = 120,
line_length = 5,
frame_count = 60,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.53125, -0.4375},
priority = "high",
flags = { "compressed" },
animation_speed = 0.25,
filename = "__base__/graphics/entity/smoke/smoke.png"
},
glow_animation = opts.glow_animation,
glow_fade_away_duration = opts.glow_fade_away_duration,
vertical_speed_slowdown = opts.vertical_speed_slowdown
}
end
data:extend(
{
firesmoke
{
name = attributes.smokeName,
color = attributes.smokeTint,
start_scale = 0.5,
end_scale = 1,
duration = 300,
spread_delay = 120,
fade_away_duration = 90,
fade_in_duration = 60,
animation =
{
filename = "__base__/graphics/entity/fire-smoke/fire-smoke.png",
flags = { "compressed" },
line_length = 8,
width = 253,
height = 210,
frame_count = 60,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.265625, -0.09375},
priority = "high",
animation_speed = 0.25,
},
glow_animation =
{
filename = "__base__/graphics/entity/fire-smoke/fire-smoke-glow.png",
flags = { "compressed" },
blend_mode = "additive",
line_length = 8,
width = 253,
height = 152,
frame_count = 60,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.265625, 0.8125},
priority = "high",
animation_speed = 0.25,
},
glow_fade_away_duration = 70
},
firesmoke
{
name = attributes.smokeWithoutGlowName,
color = attributes.smokeWithoutGlowTint,
start_scale = 0.5,
end_scale = 1,
duration = 300,
spread_delay = 120,
fade_away_duration = 90,
fade_in_duration = 60,
animation =
{
filename = "__base__/graphics/entity/fire-smoke/fire-smoke.png",
flags = { "compressed" },
line_length = 8,
width = 253,
height = 210,
frame_count = 60,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.265625, -0.09375},
priority = "high",
animation_speed = 0.25,
},
},
firesmoke
{
name = attributes.softSmokeName,
color = attributes.softSmokeTint,
start_scale = 0.5,
end_scale = 1.2,
duration = 300,
spread_delay = 120,
fade_away_duration = 60,
},
firesmoke
{
name = attributes.smokeOnAddingFuel,
start_scale = 0.5,
end_scale = 0.7,
duration = 300,
spread_delay = 120,
fade_away_duration = 60,
fade_in_duration = 60,
animation =
{
filename = "__base__/graphics/entity/fire-smoke/fire-smoke.png",
flags = { "compressed" },
line_length = 8,
width = 253,
height = 210,
frame_count = 60,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.265625, -0.09375},
priority = "high",
animation_speed = 0.25,
}
},
}
)
-- what happens when attack spreads
data:extend({
{
type = "fire",
name = attributes.spawnEntityName,
flags = {"placeable-off-grid", "not-on-map"},
damage_per_tick = attributes.spawnEntityDamagePerTick,
spawn_entity = attributes.spawnEntityName,
maximum_spread_count = 100,
spread_delay = 300,
spread_delay_deviation = 180,
flame_alpha = 0.35,
flame_alpha_deviation = 0.05,
tree_dying_factor = 0.8,
emissions_per_tick = 0.005,
fade_in_duration = 120,
fade_out_duration = 100,
smoke_fade_in_duration = 100,
smoke_fade_out_duration = 130,
delay_between_initial_flames = 20,
small_tree_fire_pictures = create_small_tree_flame_animations({ blend_mode = "additive", animation_speed = 0.5, scale = 0.7 * 0.75 }),
pictures = create_fire_pictures({ blend_mode = "additive", animation_speed = 1, scale = 0.5 * 1.25}),
smoke_source_pictures =
{
{
filename = "__base__/graphics/entity/fire-flame/fire-smoke-source-1.png",
line_length = 8,
width = 101,
height = 138,
frame_count = 31,
axially_symmetrical = false,
direction_count = 1,
scale = 0.6,
shift = {-0.109375 * 0.6, -1.1875 * 0.6},
animation_speed = 0.5,
tint = biterStreamUtils.make_color(0,1,0, 0.75),
},
{
filename = "__base__/graphics/entity/fire-flame/fire-smoke-source-2.png",
line_length = 8,
width = 99,
height = 138,
frame_count = 31,
axially_symmetrical = false,
direction_count = 1,
scale = 0.6,
shift = {-0.203125 * 0.6, -1.21875 * 0.6},
animation_speed = 0.5,
tint = biterStreamUtils.make_color(0,1,0, 0.75),
},
},
smoke =
{
{
name = attributes.smokeWithoutGlowName,
deviation = {0.5, 0.5},
frequency = 0.25 / 2,
position = {0.0, -0.8},
starting_vertical_speed = 0.008,
starting_vertical_speed_deviation = 0.05,
starting_frame_deviation = 60,
height = -0.5,
}
},
light = {intensity = 1, size = 20},
working_sound =
{
sound = { filename = "__base__/sound/furnace.ogg" },
max_sounds_per_type = 3
},
}})
end
return biterStreamUtils

View File

@ -0,0 +1,9 @@
local colorUtils = {}
-- module code
function colorUtils.makeColor(r_,g_,b_,a_)
return { r = r_ * a_, g = g_ * a_, b = b_ * a_, a = a_ }
end
return colorUtils

View File

@ -0,0 +1,241 @@
local fireUtils = {}
-- imported
local colorUtils = require("ColorUtils")
local imageUtils = require("ImageUtils")
local smokeUtils = require("SmokeUtils")
-- imported functions
local create_burnt_patch_pictures = imageUtils.create_burnt_patch_pictures
local create_fire_pictures = imageUtils.create_fire_pictures
local create_small_tree_flame_animations = imageUtils.create_small_tree_flame_animations
local makeSmokeWithGlow = smokeUtils.makeSmokeWithGlow
local makeSmokeWithoutGlow = smokeUtils.makeSmokeWithoutGlow
local makeSmokeAddingFuel = smokeUtils.makeSmokeAddingFuel
local makeColor = colorUtils.makeColor
-- module code
function fireUtils.makeSpreadEffect(attributes)
local name = attributes.name .. "-spread-rampant"
local smokeName = attributes.smokeWithoutGlowName or makeSmokeWithoutGlow(attributes)
data:extend({
{
type = "fire",
name = name,
flags = {"placeable-off-grid", "not-on-map"},
damage_per_tick = attributes.damagePerTick or { amount = 45/60, type = "fire" },
spawn_entity = name,
maximum_spread_count = 100,
spread_delay = 300,
spread_delay_deviation = 180,
flame_alpha = 0.35,
flame_alpha_deviation = 0.05,
tree_dying_factor = 0.8,
emissions_per_tick = 0.005,
fade_in_duration = 120,
fade_out_duration = 100,
smoke_fade_in_duration = 100,
smoke_fade_out_duration = 130,
delay_between_initial_flames = 20,
small_tree_fire_pictures = create_small_tree_flame_animations({ blend_mode = "additive", animation_speed = 0.5, scale = 0.7 * 0.75 }),
pictures = create_fire_pictures({ blend_mode = "additive", animation_speed = 1, scale = 0.5 * 1.25}),
smoke_source_pictures =
{
{
filename = "__base__/graphics/entity/fire-flame/fire-smoke-source-1.png",
line_length = 8,
width = 101,
height = 138,
frame_count = 31,
axially_symmetrical = false,
direction_count = 1,
scale = 0.6,
shift = {-0.109375 * 0.6, -1.1875 * 0.6},
animation_speed = 0.5,
tint = makeColor(0,1,0, 0.75),
},
{
filename = "__base__/graphics/entity/fire-flame/fire-smoke-source-2.png",
line_length = 8,
width = 99,
height = 138,
frame_count = 31,
axially_symmetrical = false,
direction_count = 1,
scale = 0.6,
shift = {-0.203125 * 0.6, -1.21875 * 0.6},
animation_speed = 0.5,
tint = makeColor(0,1,0, 0.75),
},
},
smoke =
{
{
name = smokeName,
deviation = {0.5, 0.5},
frequency = 0.25 / 2,
position = {0.0, -0.8},
starting_vertical_speed = 0.008,
starting_vertical_speed_deviation = 0.05,
starting_frame_deviation = 60,
height = -0.5,
}
},
light = {intensity = 1, size = 20},
working_sound =
{
sound = { filename = "__base__/sound/furnace.ogg" },
max_sounds_per_type = 3
},
}})
return name
end
function fireUtils.makeFire(attributes)
local name = attributes.name .. "-fire-rampant"
local spawnEntityName = attributes.spawnEntityName
local smokeAddingFuelName = attributes.smokeAddingFuelName or makeSmokeAddingFuel(attributes)
local smokeName = attributes.smokeWithGlowName or makeSmokeWithGlow(attributes)
data:extend({{
type = "fire",
name = name,
flags = {"placeable-off-grid", "not-on-map"},
color = attributes.fireTint,
damage_per_tick = attributes.damagePerTick or { amount = 45/60, type = "fire" },
maximum_damage_multiplier = 6,
damage_multiplier_increase_per_added_fuel = 1,
damage_multiplier_decrease_per_tick = 0.005,
spawn_entity = spawnEntityName,
spread_delay = 300,
spread_delay_deviation = 180,
maximum_spread_count = 100,
flame_alpha = 0.35,
flame_alpha_deviation = 0.05,
emissions_per_tick = 0.005,
add_fuel_cooldown = 10,
fade_in_duration = 30,
fade_out_duration = 30,
initial_lifetime = 120,
lifetime_increase_by = 150,
lifetime_increase_cooldown = 1,
maximum_lifetime = 1800,
delay_between_initial_flames = 10,
--initial_flame_count = 1,
burnt_patch_lifetime = 1800,
on_fuel_added_action =
{
type = "direct",
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "create-smoke",
entity_name = smokeAddingFuelName,
-- speed = {-0.03, 0},
-- speed_multiplier = 0.99,
-- speed_multiplier_deviation = 1.1,
offset_deviation = {{-0.5, -0.5}, {0.5, 0.5}},
speed_from_center = 0.01
}
}
}
},
pictures = create_fire_pictures({ blend_mode = "normal", animation_speed = 1, scale = 0.5}),
smoke_source_pictures =
{
{
filename = "__base__/graphics/entity/fire-flame/fire-smoke-source-1.png",
line_length = 8,
width = 101,
height = 138,
frame_count = 31,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.109375, -1.1875},
animation_speed = 0.5,
},
{
filename = "__base__/graphics/entity/fire-flame/fire-smoke-source-2.png",
line_length = 8,
width = 99,
height = 138,
frame_count = 31,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.203125, -1.21875},
animation_speed = 0.5,
},
},
burnt_patch_pictures = create_burnt_patch_pictures(),
burnt_patch_alpha_default = 0.4,
burnt_patch_alpha_variations = {
-- { tile = "grass", alpha = 0.4 },
-- { tile = "grass-medium", alpha = 0.4 },
{ tile = "grass-dry", alpha = 0.45 },
{ tile = "dirt", alpha = 0.3 },
{ tile = "dirt-dark", alpha = 0.35 },
{ tile = "sand", alpha = 0.24 },
{ tile = "sand-dark", alpha = 0.28 },
{ tile = "stone-path", alpha = 0.26 },
{ tile = "concrete", alpha = 0.24 },
},
smoke =
{
{
name = smokeName,
deviation = {0.5, 0.5},
frequency = 0.25 / 2,
position = {0.0, -0.8},
starting_vertical_speed = 0.05,
starting_vertical_speed_deviation = 0.005,
vertical_speed_slowdown = 0.99,
starting_frame_deviation = 60,
height = -0.5,
}
},
light = {intensity = 1, size = 20},
working_sound =
{
sound = { filename = "__base__/sound/furnace.ogg" },
max_sounds_per_type = 3
},
}
}
)
return name
end
return fireUtils

View File

@ -0,0 +1,355 @@
local imageUtils = {}
-- module code
local function foreach(table_, fun_)
for _, tab in pairs(table_) do fun_(tab) end
return table_
end
function imageUtils.create_burnt_patch_pictures()
local base = {
filename = "__base__/graphics/entity/fire-flame/burnt-patch.png",
line_length = 3,
width = 115,
height = 56,
frame_count = 9,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.09375, 0.125},
}
local variations = {}
for y=1,(base.frame_count / base.line_length) do
for x=1,base.line_length do
table.insert(variations,
{
filename = base.filename,
width = base.width,
height = base.height,
tint = base.tint,
shift = base.shift,
x = (x-1) * base.width,
y = (y-1) * base.height,
})
end
end
return variations
end
function imageUtils.create_small_tree_flame_animations(opts)
local fire_blend_mode = opts.blend_mode or "additive"
local fire_animation_speed = opts.animation_speed or 0.5
local fire_scale = opts.scale or 1
local fire_tint = opts.smallTreeFlameTint
local fire_flags = { "compressed" }
local retval = {
{
filename = "__base__/graphics/entity/fire-flame/tree-fire-flame-01-a.png",
line_length = 8,
width = 38,
height = 110,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.03125, -1.5},
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags
},
{
filename = "__base__/graphics/entity/fire-flame/tree-fire-flame-01-b.png",
line_length = 8,
width = 39,
height = 111,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.078125, -1.51562},
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags
},
{
filename = "__base__/graphics/entity/fire-flame/tree-fire-flame-01-c.png",
line_length = 8,
width = 44,
height = 108,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.15625, -1.5},
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags
},
{
filename = "__base__/graphics/entity/fire-flame/tree-fire-flame-03-a.png",
line_length = 8,
width = 38,
height = 110,
frame_count = 23,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.03125, -1.5},
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags
},
{
filename = "__base__/graphics/entity/fire-flame/tree-fire-flame-03-b.png",
line_length = 8,
width = 34,
height = 98,
frame_count = 23,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.03125, -1.34375},
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags
},
{
filename = "__base__/graphics/entity/fire-flame/tree-fire-flame-03-c.png",
line_length = 8,
width = 39,
height = 111,
frame_count = 23,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.078125, -1.51562},
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags
}
}
return foreach(retval, function(tab)
if tab.shift and tab.scale then tab.shift = { tab.shift[1] * tab.scale, tab.shift[2] * tab.scale } end
end)
end
function imageUtils.create_fire_pictures(opts)
local fire_blend_mode = opts.blend_mode or "additive"
local fire_animation_speed = opts.animation_speed or 0.5
local fire_scale = opts.scale or 1
local fire_tint = opts.firePictureTint
local fire_flags = { "compressed" }
local retval = {
{
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 = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { -0.0390625, -0.90625 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-12.png",
line_length = 8,
width = 63,
height = 116,
frame_count = 25,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { -0.015625, -0.914065 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-11.png",
line_length = 8,
width = 61,
height = 122,
frame_count = 25,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { -0.0078125, -0.90625 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-10.png",
line_length = 8,
width = 65,
height = 108,
frame_count = 25,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { -0.0625, -0.64844 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-09.png",
line_length = 8,
width = 64,
height = 101,
frame_count = 25,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { -0.03125, -0.695315 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-08.png",
line_length = 8,
width = 50,
height = 98,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { -0.0546875, -0.77344 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-07.png",
line_length = 8,
width = 54,
height = 84,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { 0.015625, -0.640625 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-06.png",
line_length = 8,
width = 65,
height = 92,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { 0, -0.83594 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-05.png",
line_length = 8,
width = 59,
height = 103,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { 0.03125, -0.882815 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-04.png",
line_length = 8,
width = 67,
height = 130,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { 0.015625, -1.109375 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-03.png",
line_length = 8,
width = 74,
height = 117,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { 0.046875, -0.984375 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-02.png",
line_length = 8,
width = 74,
height = 114,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { 0.0078125, -0.96875 }
},
{
filename = "__base__/graphics/entity/fire-flame/fire-flame-01.png",
line_length = 8,
width = 66,
height = 119,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = { -0.0703125, -1.039065 }
},
}
return foreach(retval, function(tab)
if tab.shift and tab.scale then tab.shift = { tab.shift[1] * tab.scale, tab.shift[2] * tab.scale } end
end)
end
return imageUtils

View File

@ -0,0 +1,165 @@
local smokeUtils = {}
-- module code
function smokeUtils.makeSmokeWithGlow(attributes)
local name = attributes.name .. "-glow-smoke-rampant"
data:extend(
{
smokeUtils.makeSmokeBasic
{
name = name,
color = attributes.smokeWithGlowTint,
start_scale = 0.5,
end_scale = 1,
duration = 300,
spread_delay = 120,
fade_away_duration = 90,
fade_in_duration = 60,
animation =
{
filename = "__base__/graphics/entity/fire-smoke/fire-smoke.png",
flags = { "compressed" },
line_length = 8,
width = 253,
height = 210,
frame_count = 60,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.265625, -0.09375},
priority = "high",
animation_speed = 0.25,
},
glow_animation =
{
filename = "__base__/graphics/entity/fire-smoke/fire-smoke-glow.png",
flags = { "compressed" },
blend_mode = "additive",
line_length = 8,
width = 253,
height = 152,
frame_count = 60,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.265625, 0.8125},
priority = "high",
animation_speed = 0.25,
},
glow_fade_away_duration = 70
}})
return name
end
function smokeUtils.makeSmokeWithoutGlow(attributes)
local name = attributes.name .. "-without-glow-smoke-rampant"
data:extend({
smokeUtils.makeSmokeBasic
{
name = name,
color = attributes.smokeWithoutGlowTint,
start_scale = 0.5,
end_scale = 1,
duration = 300,
spread_delay = 120,
fade_away_duration = 90,
fade_in_duration = 60,
animation =
{
filename = "__base__/graphics/entity/fire-smoke/fire-smoke.png",
flags = { "compressed" },
line_length = 8,
width = 253,
height = 210,
frame_count = 60,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.265625, -0.09375},
priority = "high",
animation_speed = 0.25,
},
}
})
return name
end
function smokeUtils.makeSmokeSoft(attributes)
local name = attributes.name .. "-soft-smoke-rampant"
data:extend({
smokeUtils.makeSmokeBasic({
name = name,
color = attributes.softSmokeTint,
start_scale = 0.5,
end_scale = 1.2,
duration = 300,
spread_delay = 120,
fade_away_duration = 60,
})
})
return name
end
function smokeUtils.makeSmokeAddingFuel(attributes)
local name = attributes.name .. "-adding-fuel-rampant"
data:extend({
smokeUtils.makeSmokeBasic({
name = name,
start_scale = 0.5,
end_scale = 0.7,
duration = 300,
spread_delay = 120,
fade_away_duration = 60,
fade_in_duration = 60,
animation =
{
filename = "__base__/graphics/entity/fire-smoke/fire-smoke.png",
flags = { "compressed" },
line_length = 8,
width = 253,
height = 210,
frame_count = 60,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.265625, -0.09375},
priority = "high",
animation_speed = 0.25,
}
})
})
return name
end
function smokeUtils.makeSmokeBasic(attributes)
return {
type = "smoke",
name = attributes.name,
flags = {"not-on-map"},
duration = attributes.duration or 600,
fade_in_duration = attributes.fade_in_duration or 0,
fade_away_duration = attributes.fade_away_duration or 600,
spread_duration = attributes.spread_duration or 600,
start_scale = attributes.start_scale or 0.20,
end_scale = attributes.end_scale or 1.0,
color = attributes.color,
cyclic = true,
affected_by_wind = attributes.affected_by_wind or true,
animation = attributes.animation or
{
width = 152,
height = 120,
line_length = 5,
frame_count = 60,
axially_symmetrical = false,
direction_count = 1,
shift = {-0.53125, -0.4375},
priority = "high",
flags = { "compressed" },
animation_speed = 0.25,
filename = "__base__/graphics/entity/smoke/smoke.png"
},
glow_animation = attributes.glow_animation,
glow_fade_away_duration = attributes.glow_fade_away_duration,
vertical_speed_slowdown = attributes.vertical_speed_slowdown
}
end
return smokeUtils

View File

@ -0,0 +1,46 @@
local stickerUtils = {}
-- imported
local math3d = require("math3d")
-- module code
function stickerUtils.makeSticker(attributes)
local name = attributes.name .. "-sticker-rampant"
data:extend(
{
{
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),
},
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,
}
})
return name
end
return stickerUtils

View File

@ -0,0 +1,88 @@
local streamUtils = {}
-- imported
local smokeUtils = require("SmokeUtils")
-- imported functions
local makeSmokeSoft = smokeUtils.makeSmokeSoft
-- module code
function streamUtils.makeStream(attributes)
local softSmokeName = attributes.softSmokeName or makeSmokeSoft(attributes)
data:extend(
{
{
type = "stream",
name = attributes.name .. "-stream-rampant",
flags = {"not-on-map"},
stream_light = {intensity = 1, size = 4},
ground_light = {intensity = 0.8, size = 4},
smoke_sources =
{
{
name = softSmokeName,
frequency = 0.05, --0.25,
position = {0.0, 0}, -- -0.8},
starting_frame_deviation = 60
}
},
particle_buffer_size = 90,
particle_spawn_interval = 1,
particle_spawn_timeout = attributes.particleTimeout or 1,
particle_vertical_acceleration = attributes.particleVertialAcceleration or (0.005 * 2),
particle_horizontal_speed = attributes.particleHoizontalSpeed or (0.2 * 0.75 * 4),
particle_horizontal_speed_deviation = attributes.particleHoizontalSpeedDeviation or (0.005 * 0.50),
particle_start_alpha = 0.5,
particle_end_alpha = 1,
particle_start_scale = 0.2,
particle_loop_frame_count = 3,
particle_fade_out_threshold = 0.9,
particle_loop_exit_threshold = 0.25,
action = attributes.actions,
spine_animation =
{
filename = "__base__/graphics/entity/flamethrower-fire-stream/flamethrower-fire-stream-spine.png",
blend_mode = "additive",
tint = attributes.spineAnimationTint,
line_length = 4,
width = 32,
height = 18,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
animation_speed = 2,
shift = {0, 0},
},
shadow =
{
filename = "__base__/graphics/entity/acid-projectile-purple/acid-projectile-purple-shadow.png",
line_length = 5,
width = 28,
height = 16,
frame_count = 33,
priority = "high",
shift = {-0.09, 0.395}
},
particle =
{
filename = "__base__/graphics/entity/flamethrower-fire-stream/flamethrower-explosion.png",
priority = "extra-high",
width = 64,
tint = attributes.particleTint,
height = 64,
frame_count = 32,
line_length = 8
},
}
}
)
end
return streamUtils

View File

@ -23,8 +23,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.0,
distancePerFrame = 0.00,
movement = 0.21,
distancePerFrame = 0.1,
healing = 0.01,
scale = smallFireBiterScale,
tint1 = smallFireBiterTint1,
@ -38,7 +38,7 @@ data:extend({
minRange = 5,
cooldown = 55,
turnRange = 1,
firePenalty = 15}, "acid-flame-fire-stream-rampant"),
firePenalty = 15}, "acid-flame-stream-rampant"),
{
makeResistance("fire", 0, 15)
}),
@ -59,7 +59,7 @@ data:extend({
minRange = 5,
cooldown = 40,
turnRange = 1,
firePenalty = 15}, "acid-flame-1-fire-stream-rampant"),
firePenalty = 15}, "acid-flame-1-stream-rampant"),
{
makeResistance("fire", 2, 35)
}),
@ -80,7 +80,7 @@ data:extend({
minRange = 5,
cooldown = 25,
turnRange = 1,
firePenalty = 15}, "acid-flame-1-fire-stream-rampant"),
firePenalty = 15}, "acid-flame-1-stream-rampant"),
{
makeResistance("fire", 4, 55)
}),
@ -101,7 +101,7 @@ data:extend({
minRange = 5,
cooldown = 15,
turnRange = 1,
firePenalty = 15}, "acid-flame-2-fire-stream-rampant"),
firePenalty = 15}, "acid-flame-2-stream-rampant"),
{
makeResistance("fire", 6, 75)
})

View File

@ -159,21 +159,6 @@ function bobsUpdates.useDumbProjectiles()
},
"bob-fire-ball-stream-rampant")
unit = units["bob-giant-poison-spitter"]
unit["attack_parameters"] = biterUtils.createFireAttack(
{
cooldown = 80,
range = 15,
min_range = 3,
turn_range = 1,
warmup = 30,
fire_penalty = 15,
scale = biterUtils.findRunScale(unit),
tint1 = biterUtils.findTint(unit),
tint2 = biterUtils.findTint(unit)
},
"bob-poison-ball-stream-rampant")
unit = units["bob-giant-poison-spitter"]
unit["attack_parameters"] = biterUtils.createFireAttack(
{

View File

@ -8,7 +8,7 @@ function vanillaUpdates.useDumbProjectiles()
turrets["small-worm-turret"]["attack_parameters"] = biterUtils.createFireAttack(
{
cooldown = 50,
range = 17,
range = 18,
min_range = 5,
turn_range = 1,
fire_penalty = 0,

View File

@ -0,0 +1,192 @@
local smallbiterscale = 0.5
local small_biter_tint1 = {r=0.56, g=0.46, b=0.42, a=0.65}
local small_biter_tint2 = {r=1, g=0.63, b=0, a=0.4}
data:extend({
{ -- this defines a damage type so resistances don't effect this damage
type = "damage-type",
name = "healing"
},
{ -- this defines your healing cloud
type = "smoke-with-trigger",
name = "healing-cloud-overlord",
flags = {"not-on-map"},
show_when_smoke_off = true,
animation =
{
filename = "__base__/graphics/entity/cloud/cloud-45-frames.png",
flags = { "compressed" },
priority = "low",
width = 256,
height = 256,
frame_count = 45,
animation_speed = 0.5,
line_length = 7,
scale = 3,
},
slow_down_factor = 0,
affected_by_wind = false,
cyclic = true,
duration = 60 * 5,
fade_away_duration = 5 * 60,
spread_duration = 10,
color = { r = 0.0, g = 0.0, b = 0.9, a = 0.2 },
action =
{
type = "direct",
action_delivery =
{
type = "instant",
target_effects =
{
type = "nested-result",
action =
{
type = "area",
perimeter = 11,
entity_flags = {"breaths-air"},
action_delivery =
{
type = "instant",
target_effects =
{
type = "damage",
damage = { amount = -2, type = "healing"}
}
}
}
}
}
},
action_cooldown = 30
},
{ -- this is your custom projectile that will create the healing cloud
type = "projectile",
name = "healing-orb-overlord",
flags = {"not-on-map"},
acceleration = 0.005,
action =
{
type = "direct",
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "play-sound",
sound =
{
{
filename = "__base__/sound/creatures/projectile-acid-burn-1.ogg",
volume = 0.8
},
{
filename = "__base__/sound/creatures/projectile-acid-burn-2.ogg",
volume = 0.8
},
{
filename = "__base__/sound/creatures/projectile-acid-burn-long-1.ogg",
volume = 0.8
},
{
filename = "__base__/sound/creatures/projectile-acid-burn-long-2.ogg",
volume = 0.8
}
}
},
{
type = "create-entity",
entity_name = "healing-cloud-overlord"
}
}
}
},
animation =
{
filename = "__base__/graphics/entity/acid-projectile-purple/acid-projectile-purple.png",
line_length = 5,
width = 16,
height = 18,
frame_count = 33,
priority = "high"
},
shadow =
{
filename = "__base__/graphics/entity/acid-projectile-purple/acid-projectile-purple-shadow.png",
line_length = 5,
width = 28,
height = 16,
frame_count = 33,
priority = "high",
shift = {-0.09, 0.395}
},
rotatable = false
},
{
type = "unit",
name = "small-healing-biter-overlord",
icon = "__base__/graphics/icons/small-biter.png",
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air"},
max_health = 15,
order = "b-b-a",
subgroup="enemies",
healing_per_tick = 0.01,
collision_box = {{-0.2, -0.2}, {0.2, 0.2}},
selection_box = {{-0.4, -0.7}, {0.7, 0.4}},
attack_parameters = {
type = "projectile",
ammo_category = "rocket",
damage_modifier = 10,
cooldown = 150,
projectile_center = {0, 0},
projectile_creation_distance = 0.6,
range = 15, -- make this whatever distance you want the unit to stop at
animation = biterattackanimation(smallbiterscale, small_biter_tint1, small_biter_tint2),
sound = {
filename = "__base__/sound/fight/pulse.ogg",
volume = 0.7
},
ammo_type = {
type = "projectile",
category = "biological",
speed = 1,
action =
{
{
type = "direct",
action_delivery =
{
type = "projectile",
projectile = "healing-orb-overlord",
starting_speed = 0.5,
max_range = 1 -- the distance you want the cloud to appear from the unit
}
},
{
type = "direct",
action_delivery =
{
type = "projectile",
projectile = "acid-projectile-purple",
starting_speed = 0.5,
max_range = 15 -- should be whatever range you want the unit to shoot for
}
}
}
}
},
vision_distance = 30,
movement_speed = 0.2,
distance_per_frame = 0.1,
pollution_to_join_attack = 200,
distraction_cooldown = 300,
min_pursue_time = 10 * 60,
max_pursue_distance = 50,
corpse = "small-biter-corpse",
dying_explosion = "blood-explosion-small",
dying_sound = make_biter_dying_sounds(0.4),
working_sound = make_biter_calls(0.3),
run_animation = biterrunanimation(smallbiterscale, small_biter_tint1, small_biter_tint2)
}
})

View File

@ -181,7 +181,32 @@ data:extend({
default_value = false,
order = "g[modifier]-a[damage]",
per_user = false
}-- ,
},
{
type = "bool-setting",
name = "rampant-removeBloodParticles",
description = "rampant-reduceBloodParticles",
setting_type = "startup",
default_value = true,
order = "h[modifier]-a[optimize]",
per_user = false
},
{
type = "bool-setting",
name = "rampant-reduceAnimations",
description = "rampant-reduceAnimations",
setting_type = "startup",
default_value = true,
order = "h[modifier]-b[optimize]",
per_user = false
}
-- ,
-- {
-- type = "bool-setting",