Advertisement
Guest User

Untitled

a guest
Apr 13th, 2014
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. --
  2. -- Boss HUD rendering code.
  3. -- (c) Inuyasha 2014.
  4. -- Permission is granted for you to use this code
  5. -- and the associated graphics in your own mods.
  6. --
  7. local function hud_draw(v, stplyr)
  8. local notboostfill = 0;
  9. local notboostcap = 0;
  10. local feeltheheat = 0;
  11.  
  12. -- Iterate through all thinkers for bosses
  13. for player in players.iterate
  14. if player.mo and player.mo.skin == "greeneyes"
  15. and not (player.pflags & PF_NIGHTSMODE)
  16. notboostcap = $1 + 40
  17. notboostfill = $1 + player.notboostmeter
  18. feeltheheat = $1 + player.feelingheat
  19. end
  20. end
  21.  
  22. local p_startseg = v.cachePatch("METRENDL")
  23. local p_onseg = v.cachePatch("METRMIDL")
  24. local p_offseg = v.cachePatch("METRMPTY")
  25. local p_endseg = v.cachePatch("METRENDR")
  26. local p_heat = v.cachePatch("METRHEAT")
  27.  
  28. local posx = 320 - 26
  29. local posy = 176
  30.  
  31. -- Ending segment first
  32. for player in players.iterate
  33. if player.mo and player.mo.skin == "greeneyes"
  34. v.draw(posx, posy, p_endseg, V_SNAPTOTOP|V_SNAPTORIGHT)
  35. posx = $1 - 1
  36.  
  37. -- Step through backwards, to match the way we're drawing.
  38. for i = notboostcap, 1, -1
  39. if notboostfill >= i
  40. v.draw(posx, posy, p_onseg, V_SNAPTOTOP|V_SNAPTORIGHT)
  41. else
  42. v.draw(posx, posy, p_offseg, V_SNAPTOTOP|V_SNAPTORIGHT)
  43. end
  44. posx = $1 - 1;
  45. end
  46.  
  47. if feeltheheat == 1
  48. v.draw(260, 176, p_heat)
  49. end
  50.  
  51. -- Start segment
  52. v.draw(posx, posy, p_startseg, V_SNAPTOTOP|V_SNAPTORIGHT);
  53. end
  54. end
  55. end
  56. hud.add(hud_draw)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement