The World of EverGrand
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.


 
PortalPortal  InícioInício  ProcurarProcurar  Últimas imagensÚltimas imagens  RegistrarRegistrar  Entrar  

Compartilhe|

HUD estilo Castlevania Symphony of the Night

Ver o tópico anterior Ver o tópico seguinte Ir para baixo
AutorMensagem
Alucard_2
Alucard_2
Membro Especial
Membro Especial

Masculino Postagens : 6
Data de inscrição : 29/01/2010
HUD estilo Castlevania Symphony of the Night 11101010

HUD estilo Castlevania Symphony of the Night Vide
MensagemAssunto: HUD estilo Castlevania Symphony of the Night HUD estilo Castlevania Symphony of the Night EmptyQua Jul 21, 2010 8:42 pm

Introdução

Este script cria uma HUD ao estilo Castlevania Symphony of the Night (PSX).
Para saber mais, olhe as screenshots.
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.


ScreenShots

HUD estilo Castlevania Symphony of the Night Hudcv
Screenshot retirada do meu projeto: Castlevania - A Origem do Mal, no qual fiz o script.

script e como usar
1º passo: Cole o script na seção "scripts Adicionais".
2º passo: Nas linhas 21 a 31, você encontrará o seguinte:

Código:
# Fundo da HUD em si
Background = "hpbar"

#  Imagem da barra de MP
MP_Bar = "mpbar"

# Imagem de fundo da barra de MP/número do HP
Base = "hpbar"

# Switch que irá ativar/desativar a HUD
OnOff_Hud_Switch = 20

A explicação está logo aqui:
Background - Imagem de fundo da HUD
MP_Bar - Imagem da barra de MP
Base - Fundo da barra de MP e do HP

Mude o nome das imagens (o nome está entre os "") para o nome da imagem desejada.

Ah, é claro, tem também o OnOff_Hud_Switch, que é a ID da switch que liga/desliga a HUD.

script

Código:
################################################################################
# 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

Créditos

Vlad - Criação do script original.
Henrik - Tradução do script original.
Alucard_2 - Modificação para HUD de Castlevania.


Imagens Necessárias

HUD estilo Castlevania Symphony of the Night Hpbar
HUD estilo Castlevania Symphony of the Night Mpbar
HUD estilo Castlevania Symphony of the Night Index.php?action=dlattach;topic=20170HUD estilo Castlevania Symphony of the Night Index.php?action=dlattach;topic=20170
Ir para o topo Ir para baixo
Wolf_Moon
Wolf_Moon
Novato
Novato

Postagens : 9
Data de inscrição : 21/07/2010
HUD estilo Castlevania Symphony of the Night 11101010

HUD estilo Castlevania Symphony of the Night Vide
MensagemAssunto: Re: HUD estilo Castlevania Symphony of the Night HUD estilo Castlevania Symphony of the Night EmptyQua Jul 21, 2010 8:48 pm

Òtimo!
Continue assim!
Ir para o topo Ir para baixo

HUD estilo Castlevania Symphony of the Night

Ver o tópico anterior Ver o tópico seguinte Ir para o topo
Página 1 de 1

Permissões neste sub-fórumNão podes responder a tópicos
The World of EverGrand :: Programação em Linguagens :: Ruby Game Scripting System :: Scripts :: RPG Maker VX-