you will need to register an "arrow"
Use dungeon master as a referance:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
-- Dungeon Master by PilzAdam
stuff needed when you register_mob:
attack_type = "dogshoot",
reach = 3,
shoot_interval = 2.5,
arrow = "mobs:fireball",
shoot_offset = 1,
-- fireball (weapon)
mobs:register_arrow("mobs:fireball", {
visual = "sprite",
visual_size = {x = 1, y = 1},
textures = {"mobs_fireball.png"},
velocity = 6,
-- direct hit, no fire... just plenty of pain
hit_player = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 8},
}, nil)
end,
hit_mob = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 8},
}, nil)
end,
-- node hit, bursts into flame
hit_node = function(self, pos, node)
mobs:explosion(pos, 1, 1, 0)
end
})