Make mobs and bed use mcl_explosions
[MineClone/MineClone2.git] / mods / ENTITIES / mobs_mc / wither.lua
blobebbbf92fb1143628d56d8afe583b8061cb68ec55
1 --MCmobs v0.4
2 --maikerumine
3 --made for MC like Survival game
4 --License for code WTFPL and otherwise stated in readmes
6 local S = minetest.get_translator("mobs_mc")
8 --###################
9 --################### WITHER
10 --###################
12 mobs:register_mob("mobs_mc:wither", {
13 type = "monster",
14 spawn_class = "hostile",
15 hp_max = 300,
16 hp_min = 300,
17 armor = 80,
18 -- This deviates from MC Wiki's size, which makes no sense
19 collisionbox = {-0.9, 0.4, -0.9, 0.9, 2.45, 0.9},
20 visual = "mesh",
21 mesh = "mobs_mc_wither.b3d",
22 textures = {
23 {"mobs_mc_wither.png"},
25 visual_size = {x=4, y=4},
26 makes_footstep_sound = true,
27 view_range = 16,
28 fear_height = 4,
29 walk_velocity = 2,
30 run_velocity = 4,
31 sounds = {
32 shoot_attack = "mobs_mc_ender_dragon_shoot",
33 attack = "mobs_mc_ender_dragon_attack",
34 -- TODO: sounds
35 distance = 60,
37 jump = true,
38 jump_height = 10,
39 fly = true,
40 dogshoot_switch = 1,
41 dogshoot_count_max =1,
42 attack_animals = true,
43 drops = {
44 {name = mobs_mc.items.nether_star,
45 chance = 1,
46 min = 1,
47 max = 1},
49 lava_damage = 0,
50 fire_damage = 0,
51 attack_type = "dogshoot",
52 explosion_strength = 8,
53 dogshoot_stop = true,
54 arrow = "mobs_mc:wither_skull",
55 reach = 5,
56 shoot_interval = 0.5,
57 shoot_offset = -1,
58 animation = {
59 walk_speed = 12, run_speed = 12, stand_speed = 12,
60 stand_start = 0, stand_end = 20,
61 walk_start = 0, walk_end = 20,
62 run_start = 0, run_end = 20,
66 local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false
68 mobs:register_arrow("mobs_mc:wither_skull", {
69 visual = "sprite",
70 visual_size = {x = 0.75, y = 0.75},
71 -- TODO: 3D projectile, replace tetxture
72 textures = {"mobs_mc_TEMP_wither_projectile.png"},
73 velocity = 6,
75 -- direct hit
76 hit_player = function(self, player)
77 player:punch(self.object, 1.0, {
78 full_punch_interval = 0.5,
79 damage_groups = {fleshy = 8},
80 }, nil)
81 mobs:boom(self, self.object:get_pos(), 1)
82 end,
84 hit_mob = function(self, mob)
85 mob:punch(self.object, 1.0, {
86 full_punch_interval = 0.5,
87 damage_groups = {fleshy = 8},
88 }, nil)
89 mobs:boom(self, self.object:get_pos(), 1)
90 end,
92 -- node hit, explode
93 hit_node = function(self, pos, node)
94 mobs:boom(self, pos, 1)
95 end
97 -- TODO: Add blue wither skull
99 --Spawn egg
100 mobs:register_egg("mobs_mc:wither", S("Wither"), "mobs_mc_spawn_icon_wither.png", 0, true)