Skip to content
Snippets Groups Projects
Commit 0bc88722 authored by dg's avatar dg
Browse files

New status effects will flash green/red when they appear

git-svn-id: http://svn.net-core.org/repos/t-engine4@5639 51575b47-30f0-44d4-a5cc-537603b46e54
parent 45a77109
No related branches found
No related tags found
No related merge requests found
......@@ -4178,6 +4178,10 @@ function _M:on_set_temporary_effect(eff_id, e, p)
if e.status == "detrimental" and e.type == "physical" and self:knowTalent(self.T_SPINE_OF_THE_WORLD) then
self:triggerTalent(self.T_SPINE_OF_THE_WORLD)
end
if self.player then
p.__set_time = core.game.getTime()
end
end
-- @param t a type table describing the attack, passed to engine.Target:getType() for interpretation
......
......@@ -1157,6 +1157,12 @@ function _M:handleEffect(player, eff_id, e, p, x, y, hs, bx, by, is_first, scale
game.tooltip_x, game.tooltip_y = 1, 1; game:tooltipDisplayAtMap(game.w, game.h, desc)
end
local flash = 0
if p.__set_time and p.__set_time >= self.now - 500 then
flash = 5
end
self.tbuff[eff_id..":"..dur] = {eff_id, "tbuff"..eff_id, function(x, y)
core.display.drawQuad(x+4, y+4, 32, 32, 0, 0, 0, 255)
e.display_entity:toScreen(self.hotkeys_display_icons.tiles, x+4, y+4, 32, 32)
......@@ -1165,6 +1171,12 @@ function _M:handleEffect(player, eff_id, e, p, x, y, hs, bx, by, is_first, scale
txt._tex:toScreenFull(x+4+2 + (40 - txt.fw)/2, y+4+2 + (40 - txt.fh)/2, txt.w, txt.h, txt._tex_w, txt._tex_h, 0, 0, 0, 0.7)
txt._tex:toScreenFull(x+4 + (40 - txt.fw)/2, y+4 + (40 - txt.fh)/2, txt.w, txt.h, txt._tex_w, txt._tex_h)
end
if flash > 0 then
if e.status ~= "detrimental" then core.display.drawQuad(x+4, y+4, 32, 32, 0, 255, 0, 170 - flash * 30)
else core.display.drawQuad(x+4, y+4, 32, 32, 255, 0, 0, 170 - flash * 30)
end
flash = flash - 1
end
end, desc_fct}
end
......@@ -1768,6 +1780,7 @@ end
function _M:display(nb_keyframes)
local d = core.display
self.now = core.game.getTime()
-- Now the map, if any
game:displayMap(nb_keyframes)
......
......@@ -18,6 +18,7 @@
Nicolas Casalini "DarkGod"
darkgod@te4.org
*/
#include <stdlib.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment