mobs_mc/witch.lua

120 lines
2.5 KiB
Lua
Raw Normal View History

--MCmobs v0.2
--maikerumine
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### WITCH
--###################
2017-06-20 19:13:57 -04:00
2017-05-23 19:03:37 -04:00
mobs:register_mob("mobs_mc:witch", {
type = "monster",
2017-06-14 19:47:33 -04:00
hp_min = 26,
hp_max = 26,
2017-05-23 19:03:37 -04:00
collisionbox = {-0.35, -0.01, -0.35, 0.35, 2, 0.35},
rotate = -180,
visual = "mesh",
mesh = "witch.b3d",
textures = {
2017-05-23 19:03:37 -04:00
{"witch.png"},
},
2017-05-23 19:03:37 -04:00
visual_size = {x=3, y=3},
makes_footstep_sound = true,
damage = 2,
walk_velocity = 1.2,
run_velocity = 2.4,
2017-05-28 23:16:44 -04:00
pathfinding = 2,
group_attack = true,
attack_type = "dogshoot",
arrow = "mobs:potion_arrow",
shoot_interval = 2.5,
shoot_offset = 1,
--'dogshoot_switch' allows switching between shoot and dogfight modes inside dogshoot using timer (1 = shoot, 2 = dogfight)
--'dogshoot_count_max' number of seconds before switching above modes.
dogshoot_switch = 1,
dogshoot_count_max =1.8,
drops = {
{name = "default:apple",
chance = 10,
min = 1,
max = 2,},
},
sounds = {
random = "Villager1",
death = "Villagerdead",
damage = "Villagerhurt1",
},
animation = {
speed_normal = 30,
speed_run = 60,
stand_start = 0,
stand_end = 0,
walk_start = 0,
walk_end = 40,
run_start = 0,
run_end = 40,
hurt_start = 85,
hurt_end = 115,
death_start = 117,
death_end = 145,
shoot_start = 50,
shoot_end = 82,
},
drawtype = "front",
water_damage = 1,
lava_damage = 5,
light_damage = 0,
view_range = 16,
fear_height = 5,
})
2017-05-23 19:03:37 -04:00
2017-05-28 23:16:44 -04:00
-- fireball (weapon)
mobs:register_arrow(":mobs:potion_arrow", {
visual = "sprite",
visual_size = {x = 0.5, y = 0.5},
textures = {"vessels_glass_bottle.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 = 2},
}, nil)
end,
hit_mob = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 2},
}, nil)
end,
-- node hit, bursts into flame
hit_node = function(self, pos, node)
--mobs:explosion(pos, 1, 1, 0)
end
})
2017-05-23 19:03:37 -04:00
mobs:register_spawn("mobs_mc:witch", {"default:dirt_with_rainforest_litter"}, 20, 8, 9500, 2, 31000)
-- compatibility
2017-05-23 19:03:37 -04:00
-- spawn eggs
--mobs:register_egg("mobs_mc:witch", "Villager", "spawn_egg_villager.png")
mobs:register_egg("mobs_mc:witch", "Witch", "witch_inv.png", 0)
2017-06-19 19:00:03 -04:00
if minetest.setting_get("log_mods") then
minetest.log("action", "MC mobs loaded")
end