1
0
mirror of https://github.com/veden/Rampant.git synced 2025-01-07 23:01:39 +02:00
Rampant/prototypes/utils/UnitSpawnerUtils.lua
2019-02-27 18:53:59 -08:00

155 lines
6.1 KiB
Lua
Executable File

local unitSpawnerUtils = {}
function unitSpawnerUtils.spawner_integration(scale)
return
{
filename = "__base__/graphics/entity/spawner/spawner-idle-integration.png",
variation_count = 4,
width = 258,
height = 188,
shift = util.by_pixel(2, -2),
frame_count = 1,
scale = scale,
line_length = 1,
hr_version =
{
filename = "__base__/graphics/entity/spawner/hr-spawner-idle-integration.png",
variation_count = 4,
width = 522,
height = 380,
shift = util.by_pixel(3, -3),
frame_count = 1,
line_length = 1,
scale = scale * 0.5
}
}
end
function unitSpawnerUtils.spawner_idle_animation(variation, tint, scale)
return
{
layers =
{
{
filename = "__base__/graphics/entity/spawner/spawner-idle.png",
line_length = 4,
width = 248,
height = 180,
frame_count = 8,
animation_speed = 0.18,
direction_count = 1,
scale = scale,
run_mode = "forward-then-backward",
shift = util.by_pixel(2, -4),
y = variation * 180 * 2,
hr_version =
{
filename = "__base__/graphics/entity/spawner/hr-spawner-idle.png",
line_length = 4,
width = 490,
height = 354,
frame_count = 8,
animation_speed = 0.18,
direction_count = 1,
scale = scale * 0.5,
run_mode = "forward-then-backward",
shift = util.by_pixel(3, -2),
y = variation * 354 * 2,
}
},
{
filename = "__base__/graphics/entity/spawner/spawner-idle-mask.png",
flags = { "mask" },
width = 140,
height = 118,
frame_count = 8,
animation_speed = 0.18,
run_mode = "forward-then-backward",
shift = util.by_pixel(-2, -14),
line_length = 4,
tint = tint,
scale = scale,
y = variation * 118 * 2,
hr_version =
{
filename = "__base__/graphics/entity/spawner/hr-spawner-idle-mask.png",
flags = { "mask" },
width = 276,
height = 234,
frame_count = 8,
animation_speed = 0.18,
run_mode = "forward-then-backward",
shift = util.by_pixel(-1, -14),
line_length = 4,
tint = tint,
y = variation * 234 * 2,
scale = scale * 0.5
}
}
}
}
end
function unitSpawnerUtils.spawner_die_animation(variation, tint, scale)
return
{
layers =
{
{
filename = "__base__/graphics/entity/spawner/spawner-die.png",
line_length = 8,
width = 248,
height = 178,
frame_count = 8,
direction_count = 1,
shift = util.by_pixel(2, -2),
y = variation * 178,
scale = scale,
hr_version =
{
filename = "__base__/graphics/entity/spawner/hr-spawner-die.png",
line_length = 8,
width = 490,
height = 354,
frame_count = 8,
direction_count = 1,
shift = util.by_pixel(3, -2),
y = variation * 354,
scale = scale * 0.5
}
},
{
filename = "__base__/graphics/entity/spawner/spawner-die-mask.png",
flags = { "mask" },
width = 140,
height = 118,
frame_count = 8,
direction_count = 1,
shift = util.by_pixel(-2, -14),
scale = scale,
line_length = 8,
tint = tint,
y = variation * 118,
he_version =
{
filename = "__base__/graphics/entity/spawner/hr-spawner-die-mask.png",
flags = { "mask" },
width = 276,
height = 234,
frame_count = 8,
direction_count = 1,
shift = util.by_pixel(-1, -14),
line_length = 8,
tint = tint,
y = variation * 234,
scale = scale * 0.5
}
}
}
}
end
return unitSpawnerUtils