Version 0.42.1
[MineClone/MineClone2.git] / mods / ENTITIES / mobs_mc / witch.lua
blob7edce46e51d694ecec023358d1d91d39e548cf4b
1 --MCmobs v0.2
2 --maikerumine
3 --made for MC like Survival game
4 --License for code WTFPL and otherwise stated in readmes
6 -- intllib
7 local MP = minetest.get_modpath(minetest.get_current_modname())
8 local S, NS = dofile(MP.."/intllib.lua")
10 --dofile(minetest.get_modpath("mobs").."/api.lua")
12 --###################
13 --################### WITCH
14 --###################
19 mobs:register_mob("mobs_mc:witch", {
20 type = "monster",
21 hp_min = 26,
22 hp_max = 26,
23 collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
24 visual = "mesh",
25 mesh = "mobs_mc_witch.b3d",
26 textures = {
27 {"mobs_mc_witch.png"},
29 visual_size = {x=3, y=3},
30 makes_footstep_sound = true,
31 damage = 2,
32 reach = 2,
33 walk_velocity = 1.2,
34 run_velocity = 2.4,
35 pathfinding = 1,
36 group_attack = true,
37 attack_type = "dogshoot",
38 arrow = "mobs:potion_arrow",
39 shoot_interval = 2.5,
40 shoot_offset = 1,
41 dogshoot_switch = 1,
42 dogshoot_count_max =1.8,
43 max_drops = 3,
44 drops = {
45 {name = mobs_mc.items.glass_bottle, chance = 8, min = 0, max = 2,},
46 {name = mobs_mc.items.glowstone_dust, chance = 8, min = 0, max = 2,},
47 {name = mobs_mc.items.gunpowder, chance = 8, min = 0, max = 2,},
48 {name = mobs_mc.items.redstone, chance = 8, min = 0, max = 2,},
49 {name = mobs_mc.items.spider_eye, chance = 8, min = 0, max = 2,},
50 {name = mobs_mc.items.sugar, chance = 8, min = 0, max = 2,},
51 {name = mobs_mc.items.stick, chance = 4, min = 0, max = 2,},
53 -- TODO: sounds
54 animation = {
55 speed_normal = 30,
56 speed_run = 60,
57 stand_start = 0,
58 stand_end = 0,
59 walk_start = 0,
60 walk_end = 40,
61 run_start = 0,
62 run_end = 40,
63 hurt_start = 85,
64 hurt_end = 115,
65 death_start = 117,
66 death_end = 145,
67 shoot_start = 50,
68 shoot_end = 82,
70 water_damage = 1,
71 lava_damage = 5,
72 light_damage = 0,
73 view_range = 16,
74 fear_height = 4,
78 -- fireball (weapon)
79 mobs:register_arrow(":mobs:potion_arrow", {
80 visual = "sprite",
81 visual_size = {x = 0.5, y = 0.5},
82 --textures = {"vessels_glass_bottle.png"}, --TODO fix to else if default
83 textures = {"mcl_potions_dragon_breath.png"},
84 velocity = 6,
86 -- direct hit, no fire... just plenty of pain
87 hit_player = function(self, player)
88 player:punch(self.object, 1.0, {
89 full_punch_interval = 1.0,
90 damage_groups = {fleshy = 2},
91 }, nil)
92 end,
94 hit_mob = function(self, player)
95 player:punch(self.object, 1.0, {
96 full_punch_interval = 1.0,
97 damage_groups = {fleshy = 2},
98 }, nil)
99 end,
101 -- node hit, bursts into flame
102 hit_node = function(self, pos, node)
103 --mobs:explosion(pos, 1, 1, 0)
107 -- TODO: Spawn when witch works properly
108 --mobs:spawn_specific("mobs_mc:witch", mobs_mc.spawn.jungle, {"air"}, 0, minetest.LIGHT_MAX-6, 12, 20000, 2, mobs_mc.spawn_height.water-6, mobs_mc.spawn_height.overworld_max)
110 -- spawn eggs
111 mobs:register_egg("mobs_mc:witch", S("Witch"), "mobs_mc_spawn_icon_witch.png", 0)
113 if minetest.settings:get_bool("log_mods") then
114 minetest.log("action", "MC mobs loaded")