Skip to content
Snippets Groups Projects
Commit 898ef7dc authored by dg's avatar dg
Browse files

Screen will turn greenish when healing is impossible

git-svn-id: http://svn.net-core.org/repos/t-engine4@6403 51575b47-30f0-44d4-a5cc-537603b46e54
parent ea7e780d
No related branches found
No related tags found
No related merge requests found
......@@ -300,6 +300,7 @@ function _M:act()
self.shader_old_life = self.life
self.old_air = self.air
self.old_psi = self.psi
self.old_healwarn = (self:attr("no_healing") or ((self.healing_factor or 1) <= 0))
-- Clean log flasher
-- game.flash:empty()
......@@ -348,6 +349,13 @@ function _M:updateMainShader()
if solipsism_power > 0 then game.fbo_shader:setUniform("solipsism_warning", solipsism_power)
else game.fbo_shader:setUniform("solipsism_warning", 0) end
end
if (self:attr("no_healing") or ((self.healing_factor or 1) <= 0)) ~= self.old_healwarn then
if (self:attr("no_healing") or ((self.healing_factor or 1) <= 0)) then
game.fbo_shader:setUniform("intensify", {0.3,1.3,0.3,1})
else
game.fbo_shader:setUniform("intensify", {0,0,0,0})
end
end
-- Colorize shader
if self:attr("stealth") and self:attr("stealth") > 0 then game.fbo_shader:setUniform("colorize", {0.9,0.9,0.9,0.6})
......
uniform float hp_warning;
uniform float air_warning;
uniform float death_warning;
uniform float solipsism_warning;
uniform float motionblur;
uniform float blur;
......@@ -104,9 +105,14 @@ void main(void)
if (intensify.r > 0.0 || intensify.g > 0.0 || intensify.b > 0.0)
{
/*
float grey = gl_FragColor.r*0.3+gl_FragColor.g*0.59+gl_FragColor.b*0.11;
vec4 vgrey = vec4(grey, grey, grey, gl_FragColor.a);
gl_FragColor = max(gl_FragColor * intensify, vgrey);
*/
float grey = gl_FragColor.r*0.3+gl_FragColor.g*0.59+gl_FragColor.b*0.11;
vec4 vgrey = vec4(grey, grey, grey, gl_FragColor.a);
gl_FragColor = gl_FragColor * intensify;
}
if (hp_warning > 0.0)
......
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