Well, I've been trying to mod the weapon onto other things, such as a turret, and a personal weapon.
When used on a turret, the weapon fires, but the animation lasts for only 1 frame.
When used on a personal weapon, the animation doesn't play at all, but it does still deal some damage.
here is an example weapon and ammo... you'll probably want to change the icon tags. It's using the existing beam used on the combat robot.
Code: Select all
data:extend(
{
{
type = "ammo-category",
name = "beam-rifle"
},
{
type = "gun",
name = "laser-beam-rifle",
icon = "__bobwarfare__/graphics/icons/laser-rifle.png",
flags = {"goes-to-main-inventory"},
subgroup = "gun",
order = "b[laser-rifle]",
stack_size = 5,
attack_parameters =
{
type = "beam",
ammo_category = "beam-rifle",
cooldown = 20,
range = 15,
movement_slow_down_factor = 0.5,
damage_modifier = 10,
sound = make_laser_sounds(),
},
},
{
type = "ammo",
name = "laser-beam-rifle-ammo",
icon = "__bobwarfare__/graphics/icons/laser-rifle-battery-sapphire.png",
flags = {"goes-to-main-inventory"},
subgroup = "bob-ammo",
order = "f[laser-beam]",
stack_size = 100,
magazine_size = 50,
ammo_type =
{
category = "beam-rifle",
action =
{
type = "direct",
action_delivery =
{
type = "beam",
beam = "electric-beam",
max_length = 15,
duration = 20,
}
}
},
},
}
)