3 --made for MC like Survival game
4 --License for code WTFPL and otherwise stated in readmes
7 local MP
= minetest
.get_modpath(minetest
.get_current_modname())
8 local S
, NS
= dofile(MP
.."/intllib.lua")
11 --################### VEX
14 mobs
:register_mob("mobs_mc:vex", {
18 attack_type
= "dogfight",
22 collisionbox
= {-0.2, 0.2, -0.2, 0.2, 1.0, 0.2}, --bat
24 mesh
= "mobs_mc_vex.b3d",
27 "default_tool_steelsword.png",
31 visual_size
= {x
=1.25, y
=1.25},
37 attack_type
= "dogfight",
40 death
= "green_slime_death",
54 do_custom
= function(self
, dtime
)
55 -- Glow red while attacking
56 if self
.state
== "attack" then
57 if self
.base_texture
[2] ~= "mobs_mc_vex_charging.png" then
58 self
.base_texture
[2] = "mobs_mc_vex_charging.png"
59 self
.object
:set_properties({textures
=self
.base_texture
})
62 if self
.base_texture
[1] ~= "default_tool_steelsword.png" then
63 self
.base_texture
[1] = "default_tool_steelsword.png"
64 self
.object
:set_properties({textures
=self
.base_texture
})
68 -- Take constant damage if the vex' life clock ran out
69 -- (only for vexes summoned by evokers)
70 if self
._summoned
then
71 if not self
._lifetimer
then
74 self
._lifetimer
= self
._lifetimer
- dtime
75 if self
._lifetimer
<= 0 then
76 if self
._damagetimer
then
77 self
._damagetimer
= self
._damagetimer
- 1
79 self
.object
:punch(self
.object
, 1.0, {
80 full_punch_interval
= 1.0,
81 damage_groups
= {fleshy
= 2},
96 mobs
:register_egg("mobs_mc:vex", S("Vex"), "mobs_mc_spawn_icon_vex.png", 0)
99 if minetest
.settings
:get_bool("log_mods") then
100 minetest
.log("action", "MC Vex loaded")