From dc7592528cf948556e4e925310e830648b52dff1 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Fri, 23 Apr 2021 17:23:00 -0400 Subject: [PATCH] Add red tint hurt effect --- mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua index 09877ac2a1..36ba4d7558 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua @@ -695,7 +695,14 @@ mobs.mob_step = function(self, dtime) self.object:remove() return false end - + + + --color mod which coincides with the pause_timer + if self.old_health and self.health < self.old_health then + self.object:set_texture_mod("^[colorize:red:120") + end + self.old_health = self.health + --do death logic (animation, poof, explosion, etc) if self.health <= 0 then @@ -724,8 +731,9 @@ mobs.mob_step = function(self, dtime) if self.pause_timer > 0 then self.pause_timer = self.pause_timer - dtime --perfectly reset pause_timer - if self.pause_timer < 0 then + if self.pause_timer <= 0 then self.pause_timer = 0 + self.object:set_texture_mod("") end end --this overrides internal lua collision detection @@ -783,8 +791,9 @@ mobs.mob_step = function(self, dtime) end --perfectly reset pause_timer - if self.pause_timer < 0 then + if self.pause_timer <= 0 then self.pause_timer = 0 + self.object:set_texture_mod("") end --stop projectile mobs from being completely disabled while stunned