Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --
- -- Boss HUD rendering code.
- -- (c) Inuyasha 2014.
- -- Permission is granted for you to use this code
- -- and the associated graphics in your own mods.
- --
- local function hud_draw(v, stplyr)
- local notboostfill = 0;
- local notboostcap = 0;
- local feeltheheat = 0;
- -- Iterate through all thinkers for bosses
- for player in players.iterate
- if player.mo and player.mo.skin == "greeneyes"
- and not (player.pflags & PF_NIGHTSMODE)
- notboostcap = $1 + 40
- notboostfill = $1 + player.notboostmeter
- feeltheheat = $1 + player.feelingheat
- end
- end
- local p_startseg = v.cachePatch("METRENDL")
- local p_onseg = v.cachePatch("METRMIDL")
- local p_offseg = v.cachePatch("METRMPTY")
- local p_endseg = v.cachePatch("METRENDR")
- local p_heat = v.cachePatch("METRHEAT")
- local posx = 320 - 26
- local posy = 176
- -- Ending segment first
- for player in players.iterate
- if player.mo and player.mo.skin == "greeneyes"
- v.draw(posx, posy, p_endseg, V_SNAPTOTOP|V_SNAPTORIGHT)
- posx = $1 - 1
- -- Step through backwards, to match the way we're drawing.
- for i = notboostcap, 1, -1
- if notboostfill >= i
- v.draw(posx, posy, p_onseg, V_SNAPTOTOP|V_SNAPTORIGHT)
- else
- v.draw(posx, posy, p_offseg, V_SNAPTOTOP|V_SNAPTORIGHT)
- end
- posx = $1 - 1;
- end
- if feeltheheat == 1
- v.draw(260, 176, p_heat)
- end
- -- Start segment
- v.draw(posx, posy, p_startseg, V_SNAPTOTOP|V_SNAPTORIGHT);
- end
- end
- end
- hud.add(hud_draw)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement