Make vex red while attacking

This commit is contained in:
Wuzzy 2017-06-22 23:16:09 +02:00
parent ee834e570c
commit 541fd19c98
4 changed files with 15 additions and 2 deletions

BIN
textures/mobs_mc_vex.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

17
vex.lua
View File

@ -43,9 +43,22 @@ mobs:register_mob("mobs_mc:vex", {
walk_start = 0, walk_end = 40,
run_start = 0, run_end = 40,
},
-- Take constant damage if the vex' life clock ran out
-- (only for vexes summoned by evokers)
do_custom = function(self, dtime)
-- Glow red while attacking
if self.state == "attack" then
if self.base_texture[1] ~= "mobs_mc_vex_charging.png" then
self.base_texture = {"mobs_mc_vex_charging.png"}
self.object:set_properties({textures=self.base_texture})
end
else
if self.base_texture[1] ~= "mobs_mc_vex.png" then
self.base_texture = {"mobs_mc_vex.png"}
self.object:set_properties({textures=self.base_texture})
end
end
-- Take constant damage if the vex' life clock ran out
-- (only for vexes summoned by evokers)
if self._summoned then
if not self._lifetimer then
self._lifetimer = 33