#==============================================================================
# Requiem HUD
#==============================================================================
=begin
#==============================================================================
#------------------------------------------------------------------------------
#==============================================================================
Original:
Vlad
Custom:
Necro_100000 (Matt Kaes)
Thanks to:
venjulienecorpuz
venjulienecorpuz made the orignal conversion between my extra bar script and
Vlads new HUD with this and venjulienecorpuz's demo and My base I added a ton
of new functions, added new bars, changed around text, and allowed you to
customize...
-Font Text Name
-Font Color
-Font Size Hud Diffrence
-Ability to Show levels
-Level Color
-AND of corse the Extra EXP Bar. =D
Once again I would like to thank venjulienecorpuz.
Hope you enjoy the script!
#==============================================================================
#------------------------------------------------------------------------------
#==============================================================================
=end
# Imagem de fundo da HUD
#The name of your text =D
#Font_Text_Name = "Arial"
Font_Text_Name = ["Exocet", "Exocet", "Exocet"]
#The color of the Main HUD font!
#Defult Color.new(175,175,175)
# (Red, Green, Blue)
Font_Color = Color.new(255, 0 , 0 )
#Font_Size = "18"
Font_Size = 15
#How much bigger do you want the font on the Hud on the bottem
Font_Size_Hud_Add = 2
#Draw Level
#Do you want the HUD to display Levels?
Draw_Level_HUD = true
Level_Font_Color = Color.new(255,255,0) #Defult is yellow
#Use Custom Bar Hue?
#If ture you can input your own bar hues!
Use_Necro_100000_Glow = true
#Glow Speed! =D
HP_Bar_Hue = 1
MP_Bar_Hue = 2
EXTRA_Bar_Hue = 1
#End of Necro's Custom Functions! =D
#Back to the Normal Declerations!
Hud_Background = "HUD Bar"
Hud_Decor = "Basis"
HP_Bar = "HP-Bar" # Imagem da barra de HP
MP_Bar = "MP-Bar" # Imagem da barra de MP
Base = "Bars-Base" # Imagm do fundo das barras
Base2 = "HPMPBars-base"
EXTRA_Bar = "Exp-Bar" # (Necro_100000) Extra Addon used for things like
# Exp display exetera.
# Swhitch que mostra / esconde a HUD (Deixe 0 se quer ela permanente)
OnOff_Hud_Switch = 1
Show_Hide_Button = Input::Tab # Tecla que mostra / esconde a HUD
#------------------------------------------------------------------------------
class Window_RequiemHUD1 < Window_Base
def initialize
super(-32,320,700,900)
self.opacity = 0
@actor = $game_party.members[0]
@displayed = false
@reward = $Reward
@time = 0
refresh
end
def update
return if $game_party.members.size <= 0
@time -= 1 if @time > 0
if @actor != $game_party.members[0]
@actor = $game_party.members[0]
refresh
end
if @reward != $Reward
@reward = $Reward
@time = 200
@displayed = true
refresh
end
if @time <= 0 and @displayed == true
@reward = $Reward = ""
@displayed = false
refresh
end
end
def refresh
return if $game_party.members.size <= 0
self.contents.clear
self.contents.font.size = Font_Size + Font_Size_Hud_Add
bitmap = Cache.system(Hud_Background)
rect = Rect.new(0,0,544,80)
self.contents.blt(16,16,bitmap,rect)
mx = 20
draw_ammo(32,mx)
draw_skills(256,mx)
draw_conjures(360,mx)
draw_items(464,mx)
self.contents.font.name = Font_Text_Name
self.contents.draw_text(130,mx,96,24,"Reward",1)
self.contents.font.color = normal_color
self.contents.draw_text(130,mx+20,96,24,@reward,1)
end
def draw_ammo(x,y)
self.contents.font.name = Font_Text_Name
if Requiem_SBABS::Distance_Weapons.has_key?(@actor.weapon_id)
if Requiem_SBABS::Distance_Weapons[@actor.weapon_id][5] > 0
a = $game_party.item_number(item)
enbl = ($game_party.has_item?($data_items[Requiem_SBABS::Distance_Weapons[@actor.weapon_id][5]])? true : false)
draw_icon($data_items[Requiem_SBABS::Distance_Weapons[@actor.weapon_id][5]].icon_index,x,y+20,enbl)
self.contents.font.color = Color.new(0,0,0)
self.contents.draw_text(x+1,y+37,24,24,a,1)
self.contents.font.color = normal_color
self.contents.draw_text(x,y+36,24,24,a,1)
end
if Requiem_SBABS::Distance_Weapons[@actor.weapon_id][6] > 0
b = $game_party.item_number(item)
enbl = ($game_party.has_item?($data_items[Requiem_SBABS::Distance_Weapons[@actor.weapon_id][6]])? true : false)
draw_icon($data_items[Requiem_SBABS::Distance_Weapons[@actor.weapon_id][6]].icon_index,x+32,y+20,enbl)
self.contents.font.color = Color.new(0,0,0)
self.contents.draw_text(x+33,y+37,24,24,b,1)
self.contents.font.color = normal_color
self.contents.draw_text(x+32,y+36,24,24,b,1)
end
end
self.contents.font.color = Font_Color
self.contents.draw_text(x,y-7,56,24,"Ammo",1)
end
def draw_skills(x,y)
self.contents.font.name = Font_Text_Name
count = 0
@actor.skill_hotkeys.each {|key, id|
next if id.nil?
xx = (32*count)
skill = $data_skills[id]
next if skill.nil?
enbl = (@actor.mp >= skill.mp_cost ? true : false)
draw_icon(skill.icon_index,x+xx,y+20,enbl)
n = Input.name?(key)
self.contents.font.color = Color.new(0,0,0)
self.contents.draw_text(x+xx+1,y+37,24,24,"#{n}",1)
self.contents.font.color = normal_color
self.contents.draw_text(x+xx,y+36,24,24,"#{n}",1)
count += 1
}
self.contents.font.color = Font_Color
self.contents.draw_text(x,y-6,84,24,"Skill",1)
end
def draw_conjures(x,y)
self.contents.font.name = Font_Text_Name
count = 0
@actor.conjure_hotkeys.each {|key, id|
next if id.nil?
xx = (32*count)
conjure = $data_skills[id]
next if conjure.nil?
enbl = (@actor.mp >= conjure.mp_cost ? true : false)
draw_icon(conjure.icon_index,x+xx,y+20,enbl)
n = Input.name?(key)
self.contents.font.color = Color.new(0,0,0)
self.contents.draw_text(x+xx+1,y+37,24,24,"#{n}",1)
self.contents.font.color = normal_color
self.contents.draw_text(x+xx,y+36,24,24,"#{n}",1)
count += 1
}
self.contents.font.color = Font_Color
self.contents.draw_text(x,y-7,84,24,"Conjure",1)
end
def draw_items(x,y)
self.contents.font.name = Font_Text_Name
count = 0
@actor.item_hotkeys.each {|key, id|
next if id.nil?
xx = (32*count)
item = $data_items[id]
next if item.nil?
enbl = ($game_party.has_item?(item) ? true : false)
draw_icon(item.icon_index,x+xx,y+20,enbl)
n = $game_party.item_number(item)
self.contents.font.color = Color.new(0,0,0)
self.contents.draw_text(x+xx+1,y+37,24,24,"#{n}",1)
self.contents.font.color = normal_color
self.contents.draw_text(x+xx,y+36,24,24,"#{n}",1)
count += 1
}
self.contents.font.color = Font_Color
self.contents.draw_text(x,y-6,84,24,"Item",1)
end
end
#------------------------------------------------------------------------------
class Requiem_HUD2 < Window_Base
def initialize
super(-32,-32,800,768)
self.opacity = 0
update
end
def update
return if $game_party.members.size < 0
@actor = $game_party.members[0]
self.contents.clear
draw_hud_decor(@actor, 164, 140)
if Draw_Level_HUD == true
draw_level(@actor, 27, 35)
draw_exp(@actor, 64, 60)
draw_actor_head(@actor,24,24)
draw_hpbar(@actor, 64, 20)
draw_mpbar(@actor, 64, 40)
draw_hp_mp_exp(@actor, 64, 50)
end
for actor in $game_party.members
next if actor == @actor
xx = (actor.index-1)*64
draw_ally_life(actor,16+xx,64)
draw_actor_head(actor,16+xx,72)
if Draw_Level_HUD == true
draw_level(actor,18 + xx, 84)
end
end
end
def draw_ally_life(actor,x,y)
self.contents.font.name = Font_Text_Name
self.contents.font.size = Font_Size
self.contents.font.color = text_color(15)
self.contents.draw_text(x+33,y+1,contents.width,24,"#{actor.hp}")
self.contents.draw_text(x+33,y+19,contents.width,24,"#{actor.mp}")
if actor.hp <= (actor.maxhp * 25) / 100
self.contents.font.color = text_color(2)
elsif actor.hp <= actor.maxhp / 2
self.contents.font.color = text_color(6)
else
self.contents.font.color = text_color(3)
end
self.contents.draw_text(x+32,y,contents.width,24,"#{actor.hp}")
self.contents.font.color = text_color(1)
self.contents.draw_text(x+32,y+18,contents.width,24,"#{actor.mp}")
end
def draw_level(actor,x,y)
self.contents.font.name = Font_Text_Name
self.contents.font.size = Font_Size
self.contents.font.color = Level_Font_Color
self.contents.font.color = Color.new(0,0,0)
self.contents.draw_text(x+1,y+1,contents.width,24,"#{actor.level}")
self.contents.font.color = Level_Font_Color
self.contents.draw_text(x,y,contents.width,24,"#{actor.level}")
end
def draw_hpbar(actor, x, y)
self.contents.font.name = Font_Text_Name
back = Cache.system(Base2)
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x-21, y+325, back, src_rect)
return if actor.hp <= 0
meter = Cache.system(HP_Bar)
cw = meter.width * actor.hp / actor.maxhp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x-19, y+327, meter, src_rect)
self.contents.font.size = Font_Size
self.contents.draw_text(x-5,y,contents.width,24,"#{actor.hp}")
if actor.hp <= (actor.maxhp * 25) / 100
self.contents.font.color = text_color(2)
elsif actor.hp <= actor.maxhp / 2
self.contents.font.color = text_color(6)
else
self.contents.font.color = text_color(0)
end
self.contents.draw_text(x+4,y-1,contents.width,24,"#{actor.hp}")
end
def draw_mpbar(actor, x, y)
self.contents.font.name = Font_Text_Name
self.contents.font.size = Font_Size
back = Cache.system(Base2)
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x+354, y+305, back, src_rect)
return if actor.mp <= 0
meter = Cache.system(MP_Bar)
cw = meter.width * actor.mp / actor.maxmp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x+356, y+307, meter, src_rect)
self.contents.font.size = 16
self.contents.font.color = text_color(15)
self.contents.draw_text(x+5,y-6,contents.width,24,"#{actor.mp}")
self.contents.font.color = text_color(1)
self.contents.draw_text(x+4,y-7,contents.width,24,"#{actor.mp}")
end
def draw_exp(actor, x, y)
if actor.level == 99
return
end
back = Cache.system(Base)
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x+175, y+285, back, src_rect)
meter = Cache.system(EXTRA_Bar)
cw = meter.width * (actor.exp_s - actor.current_lvl_exp) / actor.next_lvl_exp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x+177, y+287, meter, src_rect)
end
def draw_hud_decor(actor, x, y)
back = Cache.system(Hud_Decor)
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x-147, y+199, back, src_rect)
end
def draw_hp_mp_exp(actor, x, y)
self.contents.font.color = Font_Color
self.contents.draw_text(x-61,y+292,56,24,"HP",1)
self.contents.draw_text(x+300,y+292,84,24,"MP",1)
self.contents.draw_text(x+117,y+292,84,24,"EXP",1)
end
def current_lvl_exp
return @exp_list[@level]
end
def next_lvl_exp
return @exp_list[@level+1]-@exp_list[@level]
end
end
#------------------------------------------------------------------------------