2018-02-06 00:01:20 -08:00
|
|
|
local projectileUtils = {}
|
|
|
|
|
|
|
|
function projectileUtils.makeProjectile(name, attributes, attack)
|
|
|
|
local n = name .. "-projectile-rampant"
|
|
|
|
|
|
|
|
data:extend({{
|
|
|
|
type = "projectile",
|
|
|
|
name = n,
|
|
|
|
flags = {"not-on-map"},
|
2018-02-06 23:57:41 -08:00
|
|
|
collision_box = attributes.collisionBox or {{-0.01, -0.01}, {0.01, 0.01}},
|
2019-03-16 20:39:30 -07:00
|
|
|
collision_mask = attributes.collisionMask or {"layer-11"},
|
2018-02-06 00:01:20 -08:00
|
|
|
direction_only = attributes.directionOnly,
|
|
|
|
piercing_damage = attributes.piercingDamage or 0,
|
2019-05-03 12:32:59 -07:00
|
|
|
acceleration = attributes.acceleration or 0.02,
|
2019-04-20 00:02:37 -07:00
|
|
|
force_condition = (settings.startup["rampant-disableCollidingProjectiles"].value and "not-same") or nil,
|
2018-02-06 00:01:20 -08:00
|
|
|
action = attack,
|
|
|
|
animation =
|
|
|
|
{
|
2019-03-16 20:39:30 -07:00
|
|
|
filename = "__base__/graphics/entity/acid-projectile/acid-projectile-head.png",
|
|
|
|
line_length = 5,
|
|
|
|
width = 22,
|
|
|
|
height = 84,
|
|
|
|
frame_count = 15,
|
|
|
|
shift = util.mul_shift(util.by_pixel(-2, 30), attributes.scale or 1),
|
|
|
|
tint = attributes.tint,
|
|
|
|
priority = "high",
|
|
|
|
scale = (attributes.scale or 1),
|
|
|
|
animation_speed = 1,
|
|
|
|
hr_version =
|
|
|
|
{
|
|
|
|
filename = "__base__/graphics/entity/acid-projectile/hr-acid-projectile-head.png",
|
|
|
|
line_length = 5,
|
|
|
|
width = 42,
|
|
|
|
height = 164,
|
|
|
|
frame_count = 15,
|
|
|
|
shift = util.mul_shift(util.by_pixel(-2, 31), attributes.scale or 1),
|
|
|
|
tint = attributes.tint,
|
|
|
|
priority = "high",
|
|
|
|
scale = 0.5 * (attributes.scale or 1),
|
|
|
|
animation_speed = 1,
|
|
|
|
}
|
|
|
|
},
|
2018-02-06 00:01:20 -08:00
|
|
|
shadow =
|
|
|
|
{
|
2019-03-16 20:39:30 -07:00
|
|
|
filename = "__base__/graphics/entity/acid-projectile/acid-projectile-shadow.png",
|
|
|
|
line_length = 15,
|
|
|
|
width = 22,
|
|
|
|
height = 84,
|
|
|
|
frame_count = 15,
|
|
|
|
priority = "high",
|
|
|
|
shift = util.mul_shift(util.by_pixel(-2, 30), attributes.scale or 1),
|
|
|
|
draw_as_shadow = true,
|
|
|
|
scale = (attributes.scale or 1),
|
|
|
|
animation_speed = 1,
|
|
|
|
hr_version =
|
|
|
|
{
|
|
|
|
filename = "__base__/graphics/entity/acid-projectile/hr-acid-projectile-shadow.png",
|
|
|
|
line_length = 15,
|
|
|
|
width = 42,
|
|
|
|
height = 164,
|
|
|
|
frame_count = 15,
|
|
|
|
shift = util.mul_shift(util.by_pixel(-2, 31), attributes.scale or 1),
|
|
|
|
draw_as_shadow = true,
|
|
|
|
priority = "high",
|
|
|
|
scale = 0.5 * (attributes.scale or 1),
|
|
|
|
animation_speed = 1,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
-- rotatable = false,
|
|
|
|
oriented_particle = true,
|
|
|
|
shadow_scale_enabled = true,
|
|
|
|
|
2018-02-06 00:01:20 -08:00
|
|
|
}})
|
2019-03-16 20:39:30 -07:00
|
|
|
|
2018-02-06 00:01:20 -08:00
|
|
|
return n
|
|
|
|
end
|
|
|
|
|
|
|
|
return projectileUtils
|