################################################################################ # Castlevania SOTN HUD # ################################################################################ # script original por: Vlad # # Tradução do script original por: Henrik # # Modificação por :Alucard_2 # # # # ATENÇÃO! ESTE script É UMA MODIFICAÇÃO DA HUD DO script "REQUIEM SBABS", # # PORTANTO, VOCÊ: # # # # * AO UTILIZAR O script, OS CRÉDITOS TAMBÉM DEVEM SER DADOS AO CRIADOR DO # # "REQUIEM SBABS". # # # # * ESTÁ PROIBIDO DE UTILIZAR O script PARA POSTAR EM ALGUM OUTRO FÓRUM. # # # ################################################################################ #============================================================================== # Crissaegrim HUD (Modificada) #==============================================================================
# HUD Background Image Background = "hpbar"
# MP Bar Image MP_Bar = "mpbar"
# HP and MP Bars Background Image Base = "hpbar"
# Switch that show or hide the HUD OnOff_Hud_Switch = 20
################################## class Requiem_HUD1 < Window_Base def initialize super(-32,-32,224,140) self.opacity = 0 update end def update return if $game_party.members.size <= 0 @actor = $game_party.members[0] self.contents.clear draw_mpbar(@actor, 25, 25) draw_actor_hp_number(@actor, 0, 40) 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) end end def draw_ally_life(actor,x,y) self.contents.font.size = 16 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_hpbar(actor, x, y) back = Cache.system(Base) cw = back.width ch = back.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x, y, 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, y, meter, src_rect) end def draw_mpbar(actor, x, y) back = Cache.system(Base) cw = back.width ch = back.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x, y, 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 + 57, y + 12, meter, src_rect) end end class Scene_Map < Scene_Base alias crissaegrim_hud_start start alias crissaegrim_hud_update update alias crissaegrim_hud_terminate terminate def start crissaegrim_hud_start @hud_window1 = Requiem_HUD1.new @hud_window1.visible = false showing_hud end def update crissaegrim_hud_update @hud_window1.update showing_hud end def terminate crissaegrim_hud_terminate @hud_window1.dispose end def showing_hud if OnOff_Hud_Switch <= 0 or $game_switches[OnOff_Hud_Switch] == true @hud_window1.visible = true else @hud_window1.visible = false end end
end
############### # Window_Base # ###############
class Window_Base < Window
#-------------------------------------------------------------------------- # Exibição do HP # actor : herói # x : exibe na coordenada X # y : exibe na coordenada Y # width : largura #-------------------------------------------------------------------------- def draw_actor_hp_number(actor, x, y, width = 120) if actor.hp == actor.maxhp self.contents.font.color = Color.new(255,255,255,255) else if actor.hp / actor.maxhp <= 30#self.contents.font.color = hp_color(actor) self.contents.font.color = Color.new(235,235,235,255) end end self.contents.font.size = 30 xr = x + width if width < 120 self.contents.draw_text(xr - 40, y, 40, WLH, actor.hp, 2) else self.contents.draw_text(xr - 90, y, 40, WLH, actor.hp, 2) end end end #============================================================================== # Window_StatusMap #------------------------------------------------------------------------------ # Janela que exibe o HP e MP do personagem principal. #==============================================================================
class Window_StatusMap < Window_Base #-------------------------------------------------------------------------- # Inicialização do objeto # actor : herói #-------------------------------------------------------------------------- def initialize(actor) super(0, 0, 544, 416) @actor = actor refresh end #-------------------------------------------------------------------------- # Atualização #-------------------------------------------------------------------------- def refresh self.contents.clear draw_actor_hp(@actor, 50, 0) end end
|