Advertisement
BGSYuuna

VTS-Enemy HP Bars

Mar 24th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.15 KB | None | 0 0
  1. # Enemy HP Bars and Wound Damage *Patch*
  2. # Requires both scripts
  3. # Both Scripts by Ventwig
  4.  
  5. class Window_Enemy_Hud < Window_Base
  6.   if EHUD::NEO_ULTIMATE_ACE == false
  7.    def draw_actor_hp(actor, x, y, width = 124)
  8.     draw_hp_gauge(x, y, width, actor.hp_rate, actor.mhp_rate, hp_gauge_color1, hp_gauge_color2)
  9.     change_color(system_color)
  10.     draw_text(x, y, 30, line_height, Vocab::hp_a) if EHUD::DRAW_HP_VOCAB == true
  11.     change_color(hp_color(actor))
  12.     draw_text(x+width/4*3, y, 100, line_height, actor.hp) if EHUD::DRAW_HP_NUMBERS == true
  13.     change_color(system_color)
  14.     end
  15.    
  16.     def draw_hp_gauge(x, y, width, rate, rate2, color1, color2)
  17.       fill_w2 = (width * rate2).to_i
  18.       fill_w = (width * rate).to_i
  19.       gauge_y = y + line_height - 8
  20.       contents.fill_rect(x, gauge_y, width, 6, gauge_back_color)
  21.       contents.gradient_fill_rect(x, gauge_y, fill_w2, 6, text_color(VTS_WOUNDS::WOUND_COLOR1), text_color(VTS_WOUNDS::WOUND_COLOR2))
  22.       contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2)
  23.     end
  24.   else
  25.     def draw_actor_hp(actor, x, y, width = 124)
  26.       gwidth = width * actor.hp_rate# / actor.omhp
  27.       gwidth2 = width * actor.mhp_rate# / actor.omhp
  28.       cg = neo_gauge_back_color
  29.       c1, c2, c3 = cg[0], cg[1], cg[2]
  30.       draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
  31.         HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
  32.        
  33.       (1..3).each {|i| eval("c#{i} = WHP_GCOLOR_#{i}")}
  34.       draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
  35.         HPMP_GAUGE_Y_PLUS, gwidth2, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
  36.         width, 30)
  37.        
  38.       (1..3).each {|i| eval("c#{i} = HP_GCOLOR_#{i}")}
  39.       draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
  40.         HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
  41.         width, 30)
  42.       change_color(system_color)
  43.     draw_text(x, y, 30, line_height, Vocab::hp_a) if EHUD::DRAW_HP_VOCAB == true
  44.        change_color(hp_color(actor))
  45.     draw_text(x+width/4*3, y, 100, line_height, actor.hp) if EHUD::DRAW_HP_NUMBERS == true
  46.        change_color(system_color)
  47.     end
  48.   end
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement