Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # +++ MOG - Ultima HUD (v1.1) +++
- #==============================================================================
- # By Moghunter
- # http://www.atelier-rgss.com
- #==============================================================================
- # Sistema avançado de Hud, voltado para artistas gráficos.
- # Este script possui uma vasta gama de opções que permitirão o designer gráfico
- # criar huds complexas e animadas, visando o máximo desempenho com o mÃnimo
- # de perda no processamento de imagens.
- #==============================================================================
- # Coloque as imagens da hud na pasta.
- #
- # Graphics/Huds/Ultima/
- #
- #==============================================================================
- #==============================================================================
- # Version History
- #==============================================================================
- # v1.1 - Corrigido o erro de não ativar o efeito shake em faces não animadas.
- #==============================================================================
- module MOG_ULTIMA_HUD
- REMOVE_PARTS = {
- # ID => [Removed HUD Parts; :exp and/or :stamina]
- 1 => [],
- 2 => [],
- 3 => [],
- 4 => [],
- 5 => [],
- 6 => [],
- 7 => [],
- 8 => [:exp, :stamina],
- }
- #============================================================================
- #============================================================================
- # * VISIBILITY
- #============================================================================
- # Para ativar ou desativar a hud no meio do jogo utilize o código abaixo.
- #
- # hud_visible(true)
- #
- # hud_visible(false)
- #
- #---------------------------------------------------------------------------
- # Deixar a Hud visÃvel ao começar o jogo.
- #---------------------------------------------------------------------------
- INITIAL_VISIBLE = true
- #---------------------------------------------------------------------------
- # Ocultar a Hud automaticamente ao iniciar o interpretador.
- #---------------------------------------------------------------------------
- AUTO_HIDE_FOR_INTERPRETER = true
- #============================================================================
- #============================================================================
- #============================================================================
- #============================================================================
- # * SMART FADE
- #============================================================================
- # Ativar a Hud no modo translucido quando o personagem ficar abaixo da hud.
- #---------------------------------------------------------------------------
- SMART_FADE_EFFECT = true
- #---------------------------------------------------------------------------
- # Definição da área "extra" do alcance do Smart Fade.
- # O alcance é baseado no tamanho da imagem do Layout.
- #---------------------------------------------------------------------------
- SMART_FADE_RANGE_X = [0,0]
- SMART_FADE_RANGE_Y = [0,0]
- #---------------------------------------------------------------------------
- # Limite de transparência da hud
- #---------------------------------------------------------------------------
- SMART_FADE_LIMIT = 90
- #============================================================================
- #============================================================================
- #============================================================================
- #============================================================================
- # * HUD SPRITE (GENERAL)
- #============================================================================
- # Definição da prioridade da hud.
- #---------------------------------------------------------------------------
- HUD_Z = 305
- #---------------------------------------------------------------------------
- # Para mudar a posição da HUD no meio do jogo use o código abaixo.
- #
- # hud_position( X , Y)
- #
- #---------------------------------------------------------------------------
- # Definição da posição geral da hud, influência em todos os sprites da hud.
- #---------------------------------------------------------------------------
- HUD_POSITION = [5,12]
- #---------------------------------------------------------------------------
- # Definição da porcentagem do parâmetro baixo, isso influencia na cor
- # do número dos parâmetros de HP, MP e TP.
- #---------------------------------------------------------------------------
- LOW_PARAMETER_PERCENTAGE = 30
- #============================================================================
- #============================================================================
- #============================================================================
- #============================================================================
- # * NAME SPRITE
- #============================================================================
- # Ativar o Sprite do nome do personagem.
- #---------------------------------------------------------------------------
- NAME_VISIBLE = true
- #---------------------------------------------------------------------------
- # Definição da prioridade do Sprite.
- #---------------------------------------------------------------------------
- NAME_Z = 5
- #---------------------------------------------------------------------------
- # Definição da posição da Face. [X,Y]
- #---------------------------------------------------------------------------
- NAME_POSITION = [87,-10]
- #---------------------------------------------------------------------------
- # Definição do tipo alinhamento do nome.
- #
- # 0 - Esquerda
- # 1 - Centro
- # 2 - Direita
- #---------------------------------------------------------------------------
- NAME_ALIGN_TYPE = 0
- #---------------------------------------------------------------------------
- # Definição do nome da fonte.
- #---------------------------------------------------------------------------
- NAME_FONT_NAME = "Georgia"
- #---------------------------------------------------------------------------
- # Definição do tamanho da fonte.
- #---------------------------------------------------------------------------
- NAME_FONT_SIZE = 16
- #---------------------------------------------------------------------------
- # Ativar Bold.
- #---------------------------------------------------------------------------
- NAME_FONT_BOLD = true
- #---------------------------------------------------------------------------
- # Ativar Italic.
- #---------------------------------------------------------------------------
- NAME_FONT_ITALIC = true
- #---------------------------------------------------------------------------
- # Definição da cor da fonte
- #---------------------------------------------------------------------------
- NAME_FONT_COLOR = Color.new(255,255,255,255)
- #---------------------------------------------------------------------------
- # Ativar Sombra
- #---------------------------------------------------------------------------
- NAME_FONT_SHADOW = true
- #---------------------------------------------------------------------------
- # Definição da cor da sombra
- #---------------------------------------------------------------------------
- NAME_FONT_SHADOW_COLOR = Color.new(0,0,0,255)
- #---------------------------------------------------------------------------
- # Definição da distância da sombra.
- #---------------------------------------------------------------------------
- NAME_FONT_SHADOW_POSITION = [2,2]
- #============================================================================
- #============================================================================
- #============================================================================
- #============================================================================
- # * FACE SPRITE
- #============================================================================
- # Ativar a face.
- # Será necessário o arquivo.
- #
- # ACTOR_NAME + _Face.png
- #
- # Eric_Face.png
- #
- #---------------------------------------------------------------------------
- FACE_VISIBLE = true
- #---------------------------------------------------------------------------
- # Definição da prioridade do sprite.
- #---------------------------------------------------------------------------
- FACE_Z = -1
- #---------------------------------------------------------------------------
- # Definição da posição da Face. [X,Y]
- #---------------------------------------------------------------------------
- FACE_POSITION = [-7,-25]
- #---------------------------------------------------------------------------
- # Ativar faces animadas.
- # Será necessário ter uma imagem de 4 faces do personagem no mesmo arquivo.
- #
- # FACE1/FACE2/FACE3/FACE4
- #
- # A imagem será dividida por 4 frames, no caso de definir a função como FALSE
- # a imagem será dividida por 1 frame
- #---------------------------------------------------------------------------
- FACE_ANIMATION = false
- #---------------------------------------------------------------------------
- # Definição do tempo duração da animação da face.
- #---------------------------------------------------------------------------
- FACE_ANIMATION_DURATION = 40
- #---------------------------------------------------------------------------
- # Ativar o efeito tremor da face quando o personagem sofrer dano.
- #---------------------------------------------------------------------------
- FACE_SHAKE_EFFECT = false
- #============================================================================
- #============================================================================
- #============================================================================
- #============================================================================
- # * HP SPRITE
- #============================================================================
- # Ativar o número de HP.
- # Será necessário o arquivo.
- #
- # HP_Number.png
- #
- #---------------------------------------------------------------------------
- HP_NUMBER_VISIBLE = false
- #---------------------------------------------------------------------------
- # Definição da prioridade do Sprite.
- #---------------------------------------------------------------------------
- HP_NUMBER_Z = 2
- #---------------------------------------------------------------------------
- # Definição da posição do número de HP. [X,Y]
- #---------------------------------------------------------------------------
- HP_NUMBER_POSITION = [163,14]
- #---------------------------------------------------------------------------
- # Ativar o número de HP Total.
- # Será necessário o arquivo.
- #
- # HP_Number_Max.png
- #
- #---------------------------------------------------------------------------
- HP_NUMBER_MAX_VISIBLE = false
- #---------------------------------------------------------------------------
- # Definição da posição do número de HP Total. [X,Y]
- #---------------------------------------------------------------------------
- HP_NUMBER_MAX_POSITION = [165,30]
- #---------------------------------------------------------------------------
- # Definição do tipo alinhamento do número.
- #
- # 0 - Esquerda
- # 1 - Centro
- # 2 - Direita
- #---------------------------------------------------------------------------
- HP_NUMBER_ALIGN_TYPE = 2
- #---------------------------------------------------------------------------
- # Ativa o efeito de alinhar os números em posições de Y diferentes.
- #---------------------------------------------------------------------------
- HP_NUMBER_WAVE_ALIGN_EFFECT = false
- #---------------------------------------------------------------------------
- # Apresentar os números em porcentagem.
- #---------------------------------------------------------------------------
- HP_NUMBER_PERCENTAGE = false
- #---------------------------------------------------------------------------
- # Ativar números animados ("Rolantes").
- #---------------------------------------------------------------------------
- HP_NUMBER_ANIMATION = false
- #---------------------------------------------------------------------------
- # Ativar a cor do HP baixo.
- # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
- # arquivo de imagem, a imagem será dividida por 2 frames de altura.
- #
- # NORMAL_COLOR
- # LOW_PARAMETER_COLOR
- #
- # Caso definir a função como FALSE a imagem será dividida apenas como
- # 1 frame de altura.
- #---------------------------------------------------------------------------
- HP_NUMBER_LOW_COLOR = false
- #---------------------------------------------------------------------------
- # Ativar o medidor de HP.
- # Será necessário o arquivo.
- #
- # HP_Meter.png
- #
- #---------------------------------------------------------------------------
- HP_METER_VISIBLE = true
- #---------------------------------------------------------------------------
- # Definição da prioridade do sprite.
- #---------------------------------------------------------------------------
- HP_METER_Z = 1
- #---------------------------------------------------------------------------
- # Definição da posição do medidor de HP. [X,Y]
- #---------------------------------------------------------------------------
- HP_METER_POSITION = [35,24]
- #---------------------------------------------------------------------------
- # Definição do ângulo do medidor.
- #---------------------------------------------------------------------------
- HP_METER_ANGLE = 0
- #---------------------------------------------------------------------------
- # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
- # inverso.
- #---------------------------------------------------------------------------
- HP_METER_MIRROR_EFFECT = false
- #---------------------------------------------------------------------------
- # Ativar o efeito animado de dano no medidor.
- # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
- # arquivo de imagem, a imagem será dividida por 2 frames de altura.
- #
- # NORMAL_COLOR
- # DAMAGE_COLOR
- #
- # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
- #---------------------------------------------------------------------------
- HP_METER_REDUCTION_ANIMATION = true
- #---------------------------------------------------------------------------
- # Ativar o efeito animado do "medidor fluindo".
- # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
- # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
- # Se definir como FALSE use apenas uma imagem com o tamanho normal.
- #---------------------------------------------------------------------------
- HP_METER_GRADIENT_ANIMATION = false
- #---------------------------------------------------------------------------
- # Ativar HP em Ãcones.
- # Será necessário ter a imagem.
- #
- # HP_Icon.png
- #
- #---------------------------------------------------------------------------
- HP_ICON_VISIBLE = false
- #---------------------------------------------------------------------------
- # Definição da prioridade do Sprite.
- #---------------------------------------------------------------------------
- HP_ICON_Z = 1
- #---------------------------------------------------------------------------
- # Posição do Ãcone de HP.
- #---------------------------------------------------------------------------
- HP_ICON_POSITION = [200,0]
- #---------------------------------------------------------------------------
- # Ativar o sprite EX do ultimo Ãcone
- # Será necessário ter a imagem.
- #
- # HP_Icon_EX.png
- #
- #---------------------------------------------------------------------------
- HP_ICON_EX_VISIBLE = false
- #---------------------------------------------------------------------------
- # Posição do Ãcone Animado.
- #---------------------------------------------------------------------------
- HP_ICON_EX_POSITION = [0,0]
- #---------------------------------------------------------------------------
- # Ativar o efeito de Zoom do Sprite.
- #---------------------------------------------------------------------------
- HP_ICON_EX_ZOOM_EFFECT = true
- #---------------------------------------------------------------------------
- # Espaço entre os Ãcones.
- #---------------------------------------------------------------------------
- HP_ICON_SPACE = [-10,-10]
- #---------------------------------------------------------------------------
- # Definição da quantidade maxima de Ãcones na horizontal.
- #---------------------------------------------------------------------------
- HP_ICON_COL_MAX = 10
- #---------------------------------------------------------------------------
- # Definição da quantidade maxima de Ãcones na vertical.
- #---------------------------------------------------------------------------
- HP_ICON_ROW_MAX = 2
- #---------------------------------------------------------------------------
- # Ativar o número de HP de Ãcones.
- # Será necessário ter a imagem.
- #
- # HP_Icon_Number.png
- #
- #---------------------------------------------------------------------------
- HP_ICON_NUMBER_VISIBLE = false
- #---------------------------------------------------------------------------
- # Definição da prioridade do sprite.
- #---------------------------------------------------------------------------
- HP_ICON_NUMBER_Z = 4
- #---------------------------------------------------------------------------
- # Posição do número do Ãcone
- #---------------------------------------------------------------------------
- HP_ICON_NUMBER_POSITION = [0,0]
- #---------------------------------------------------------------------------
- # Definição do tipo alinhamento do número.
- #
- # 0 - Esquerda
- # 1 - Centro
- # 2 - Direita
- #---------------------------------------------------------------------------
- HP_ICON_NUMBER_ALIGN_TYPE = 0
- #============================================================================
- #============================================================================
- #============================================================================
- #============================================================================
- # * MP SPRITE
- #============================================================================
- # Ativar o número de MP.
- # Será necessário o arquivo.
- #
- # MP_Number.png
- #
- #---------------------------------------------------------------------------
- MP_NUMBER_VISIBLE = false
- #---------------------------------------------------------------------------
- # Definição da prioridade do Sprite.
- #---------------------------------------------------------------------------
- MP_NUMBER_Z = 2
- #---------------------------------------------------------------------------
- # Definição da posição do número de MP. [X,Y]
- #---------------------------------------------------------------------------
- MP_NUMBER_POSITION = [187,43]
- #---------------------------------------------------------------------------
- # Ativar o número de MP Total.
- # Será necessário o arquivo.
- #
- # MP_Number_Max.png
- #
- #---------------------------------------------------------------------------
- MP_NUMBER_MAX_VISIBLE = false
- #---------------------------------------------------------------------------
- # Definição da posição do número de MP Total. [X,Y]
- #---------------------------------------------------------------------------
- MP_NUMBER_MAX_POSITION = [128,53]
- #---------------------------------------------------------------------------
- # Definição do tipo alinhamento do número.
- #
- # 0 - Esquerda
- # 1 - Centro
- # 2 - Direita
- #---------------------------------------------------------------------------
- MP_NUMBER_ALIGN_TYPE = 2
- #---------------------------------------------------------------------------
- # Ativa o efeito de alinhar os números em posições de Y diferentes.
- #---------------------------------------------------------------------------
- MP_NUMBER_WAVE_ALIGN_EFFECT = false
- #---------------------------------------------------------------------------
- # Apresentar os números em porcentagem.
- #---------------------------------------------------------------------------
- MP_NUMBER_PERCENTAGE = false
- #---------------------------------------------------------------------------
- # Ativar números animados ("Rolantes").
- #---------------------------------------------------------------------------
- MP_NUMBER_ANIMATION = true
- #---------------------------------------------------------------------------
- # Ativar a cor do MP baixo.
- # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
- # arquivo de imagem, a imagem será dividida por 2 frames de altura.
- #
- # NORMAL_COLOR
- # LOW_PARAMETER_COLOR
- #
- # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
- #---------------------------------------------------------------------------
- MP_NUMBER_LOW_COLOR = false
- #---------------------------------------------------------------------------
- # Ativar o medidor de MP.
- # Será necessário o arquivo.
- #
- # MP_Meter.png
- #
- #---------------------------------------------------------------------------
- MP_METER_VISIBLE = true
- #---------------------------------------------------------------------------
- # Definição da prioridade do sprite.
- #---------------------------------------------------------------------------
- MP_METER_Z = 1
- #---------------------------------------------------------------------------
- # Definição da posição do medidor de MP. [X,Y]
- #---------------------------------------------------------------------------
- MP_METER_POSITION = [19,42]
- #---------------------------------------------------------------------------
- # Definição do ângulo do medidor.
- #---------------------------------------------------------------------------
- MP_METER_ANGLE = 0
- #---------------------------------------------------------------------------
- # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
- # inverso.
- #---------------------------------------------------------------------------
- MP_METER_MIRROR_EFFECT = false
- #---------------------------------------------------------------------------
- # Ativar o efeito animado de dano no medidor.
- # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
- # arquivo de imagem, a imagem será dividida por 2 frames de altura.
- #
- # NORMAL_COLOR
- # DAMAGE_COLOR
- #
- # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
- #---------------------------------------------------------------------------
- MP_METER_REDUCTION_ANIMATION = true
- #---------------------------------------------------------------------------
- # Ativar o efeito animado do "medidor fluindo".
- # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
- # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
- # Se definir como FALSE use apenas uma imagem com o tamanho normal.
- #---------------------------------------------------------------------------
- MP_METER_GRADIENT_ANIMATION = false
- #---------------------------------------------------------------------------
- # Ativar MP em Ãcones.
- # Será necessário ter a imagem.
- #
- # MP_Icon.png
- #
- #---------------------------------------------------------------------------
- MP_ICON_VISIBLE = false
- #---------------------------------------------------------------------------
- # Definição da prioridade do Sprite.
- #---------------------------------------------------------------------------
- MP_ICON_Z = 1
- #---------------------------------------------------------------------------
- # Posição do Ãcone de MP.
- #---------------------------------------------------------------------------
- MP_ICON_POSITION = [200,64]
- #---------------------------------------------------------------------------
- # Ativar o sprite EX do ultimo Ãcone
- # Será necessário ter a imagem.
- #
- # MP_Icon_EX.png
- #
- #---------------------------------------------------------------------------
- MP_ICON_EX_VISIBLE = false
- #---------------------------------------------------------------------------
- # Posição do Ãcone Animado.
- #---------------------------------------------------------------------------
- MP_ICON_EX_POSITION = [0,0]
- #---------------------------------------------------------------------------
- # Ativar o efeito de Zoom do Sprite.
- #---------------------------------------------------------------------------
- MP_ICON_EX_ZOOM_EFFECT = false
- #---------------------------------------------------------------------------
- # Espaço entre os Ãcones.
- #---------------------------------------------------------------------------
- MP_ICON_SPACE = [-10,-10]
- #---------------------------------------------------------------------------
- # Definição da quantidade maxima de Ãcones na horizontal.
- #---------------------------------------------------------------------------
- MP_ICON_COL_MAX = 10
- #---------------------------------------------------------------------------
- # Definição da quantidade maxima de Ãcones na vertical.
- #---------------------------------------------------------------------------
- MP_ICON_ROW_MAX = 2
- #---------------------------------------------------------------------------
- # Ativar o número de MP de Ãcones.
- # Será necessário ter a imagem.
- #
- # MP_Icon_Number.png
- #
- #---------------------------------------------------------------------------
- MP_ICON_NUMBER_VISIBLE = false
- #---------------------------------------------------------------------------
- # Definição da prioridade do sprite.
- #---------------------------------------------------------------------------
- MP_ICON_NUMBER_Z = 4
- #---------------------------------------------------------------------------
- # Posição do número do Ãcone
- #---------------------------------------------------------------------------
- MP_ICON_NUMBER_POSITION = [0,64]
- #---------------------------------------------------------------------------
- # Definição do tipo alinhamento do número.
- #
- # 0 - Esquerda
- # 1 - Centro
- # 2 - Direita
- #---------------------------------------------------------------------------
- MP_ICON_NUMBER_ALIGN_TYPE = 0
- #============================================================================
- #============================================================================
- #============================================================================
- #============================================================================
- # * TP SPRITE
- #============================================================================
- # Ativar o número de TP.
- # Será necessário o arquivo.
- #
- # TP_Number.png
- #
- #---------------------------------------------------------------------------
- TP_NUMBER_VISIBLE = false
- #---------------------------------------------------------------------------
- # Definição da prioridade do sprite.
- #---------------------------------------------------------------------------
- TP_NUMBER_Z = 2
- #---------------------------------------------------------------------------
- # Definição da posição do número de TP. [X,Y]
- #---------------------------------------------------------------------------
- TP_NUMBER_POSITION = [190,14]
- #---------------------------------------------------------------------------
- # Ativar o número de TP Total.
- # Será necessário o arquivo.
- #
- # TP_Number_Max.png
- #
- #---------------------------------------------------------------------------
- TP_NUMBER_MAX_VISIBLE = false
- #---------------------------------------------------------------------------
- # Definição da posição do número de TP Total. [X,Y]
- #---------------------------------------------------------------------------
- TP_NUMBER_MAX_POSITION = [165,73]
- #---------------------------------------------------------------------------
- # Definição do tipo alinhamento do número.
- #
- # 0 - Esquerda
- # 1 - Centro
- # 2 - Direita
- #---------------------------------------------------------------------------
- TP_NUMBER_ALIGN_TYPE = 2
- #---------------------------------------------------------------------------
- # Ativa o efeito de alinhar os números em posições de Y diferentes.
- #---------------------------------------------------------------------------
- TP_NUMBER_WAVE_ALIGN_EFFECT = false
- #---------------------------------------------------------------------------
- # Apresentar os números em porcentagem.
- #---------------------------------------------------------------------------
- TP_NUMBER_PERCENTAGE = false
- #---------------------------------------------------------------------------
- # Ativar números animados ("Rolantes").
- #---------------------------------------------------------------------------
- TP_NUMBER_ANIMATION = false
- #---------------------------------------------------------------------------
- # Ativar a cor do TP baixo.
- # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
- # arquivo de imagem, a imagem será dividida por 2 frames de altura.
- #
- # NORMAL_COLOR
- # LOW_PARAMETER_COLOR
- #
- # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
- #---------------------------------------------------------------------------
- TP_NUMBER_LOW_COLOR = false
- #---------------------------------------------------------------------------
- # Ativar o medidor de TP.
- # Será necessário o arquivo.
- #
- # TP_Meter.png
- #
- #---------------------------------------------------------------------------
- TP_METER_VISIBLE = false
- #---------------------------------------------------------------------------
- # Definição da prioridade do sprite.
- #---------------------------------------------------------------------------
- TP_METER_Z = 1
- #---------------------------------------------------------------------------
- # Definição da posição do medidor de TP. [X,Y]
- #---------------------------------------------------------------------------
- TP_METER_POSITION = [75,65]
- #---------------------------------------------------------------------------
- # Definição do ângulo do medidor.
- #---------------------------------------------------------------------------
- TP_METER_ANGLE = 0
- #---------------------------------------------------------------------------
- # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
- # inverso.
- #---------------------------------------------------------------------------
- TP_METER_MIRROR_EFFECT = false
- #---------------------------------------------------------------------------
- # Ativar o efeito animado de dano no medidor.
- # Será necessário ter a imagem com as duas cores do paramêtro no mesmo
- # arquivo de imagem, a imagem será dividida por 2 frames de altura.
- #
- # NORMAL_COLOR
- # DAMAGE_COLOR
- #
- # Se definir como FALSE use apenas use uma imagem com o tamanho normal.
- #---------------------------------------------------------------------------
- TP_METER_REDUCTION_ANIMATION = false
- #---------------------------------------------------------------------------
- # Ativar o efeito animado do "medidor fluindo".
- # Será necessário ter a imagem com a largura 3 vezes maior que o tamanho normal.
- # Essa imagem dever estar em gradiente para ter o efeito "fluindo".
- # Se definir como FALSE use apenas uma imagem com o tamanho normal.
- #---------------------------------------------------------------------------
- TP_METER_GRADIENT_ANIMATION = false
- #---------------------------------------------------------------------------
- # Ativar TP em Ãcones.
- # Será necessário ter a imagem.
- #
- # TP_Icon.png
- #
- #---------------------------------------------------------------------------
- TP_ICON_VISIBLE = false
- #---------------------------------------------------------------------------
- # Definição da prioridade do sprite.
- #---------------------------------------------------------------------------
- TP_ICON_Z = 1
- #---------------------------------------------------------------------------
- # Posição do Ãcone de TP.
- #---------------------------------------------------------------------------
- TP_ICON_POSITION = [200,128]
- #---------------------------------------------------------------------------
- # Ativar o sprite EX do ultimo Ãcone
- # Será necessário ter a imagem.
- #
- # TP_Icon_EX.png
- #
- #---------------------------------------------------------------------------
- TP_ICON_EX_VISIBLE = false
- #---------------------------------------------------------------------------
- # Posição do Ãcone Animado.
- #---------------------------------------------------------------------------
- TP_ICON_EX_POSITION = [0,0]
- #---------------------------------------------------------------------------
- # Ativar o efeito de Zoom do Sprite.
- #---------------------------------------------------------------------------
- TP_ICON_EX_ZOOM_EFFECT = false
- #---------------------------------------------------------------------------
- # Espaço entre os Ãcones.
- #---------------------------------------------------------------------------
- TP_ICON_SPACE = [-10,-10]
- #---------------------------------------------------------------------------
- # Definição da quantidade maxima de Ãcones na horizontal.
- #---------------------------------------------------------------------------
- TP_ICON_COL_MAX = 10
- #---------------------------------------------------------------------------
- # Definição da quantidade maxima de Ãcones na vertical.
- #---------------------------------------------------------------------------
- TP_ICON_ROW_MAX = 2
- #---------------------------------------------------------------------------
- # Ativar o número de TP de Ãcones.
- # Será necessário ter a imagem.
- #
- # TP_Icon_Number.png
- #
- #---------------------------------------------------------------------------
- TP_ICON_NUMBER_VISIBLE = false
- #---------------------------------------------------------------------------
- # Definição da prioridade do sprite.
- #---------------------------------------------------------------------------
- TP_ICON_NUMBER_Z = 4
- #---------------------------------------------------------------------------
- # Posição do número do Ãcone
- #---------------------------------------------------------------------------
- TP_ICON_NUMBER_POSITION = [0,128]
- #---------------------------------------------------------------------------
- # Definição do tipo alinhamento do número.
- #
- # 0 - Esquerda
- # 1 - Centro
- # 2 - Direita
- #---------------------------------------------------------------------------
- TP_ICON_NUMBER_ALIGN_TYPE = 0
- #============================================================================
- #============================================================================
- #============================================================================
- #============================================================================
- # * LEVEL / EXP SPRITE
- #============================================================================
- # Ativar o número de Level.
- # Será necessário o arquivo.
- #
- # LV_Number.png
- #
- #---------------------------------------------------------------------------
- LEVEL_NUMBER_VISIBLE = true
- #---------------------------------------------------------------------------
- # Definição da prioridade do Sprite.
- #---------------------------------------------------------------------------
- LEVEL_NUMBER_Z = 2
- #---------------------------------------------------------------------------
- # Definição da posição do número do Level. [X,Y]
- #---------------------------------------------------------------------------
- LEVEL_NUMBER_POSITION = [49,51]
- #---------------------------------------------------------------------------
- # Definição do tipo alinhamento do número.
- #
- # 0 - Esquerda
- # 1 - Centro
- # 2 - Direita
- #---------------------------------------------------------------------------
- LEVEL_NUMBER_ALIGN_TYPE = 1
- #---------------------------------------------------------------------------
- # Ativar o medidor de exp.
- # Será necessário o arquivo.
- #
- # LV_Meter.png
- #
- #---------------------------------------------------------------------------
- LEVEL_METER_VISIBLE = true
- #---------------------------------------------------------------------------
- # Definição da prioridade do Sprite.
- #---------------------------------------------------------------------------
- LEVEL_METER_Z = 1
- #---------------------------------------------------------------------------
- # Definição da posição do medidor de experiência. [X,Y]
- #---------------------------------------------------------------------------
- LEVEL_METER_POSITION = [5,57]
- #---------------------------------------------------------------------------
- # Definição do ângulo do medidor.
- #---------------------------------------------------------------------------
- LEVEL_METER_ANGLE = 0
- #---------------------------------------------------------------------------
- # Ativar o efeito mirror, essa opção faz com que o medidor tenha o movimento
- # inverso.
- #---------------------------------------------------------------------------
- LEVEL_METER_MIRROR_EFFECT = false
- #---------------------------------------------------------------------------
- # Ativar o número de exp necessário para atingir o level.
- # Será necessário o arquivo.
- #
- # LV_Number_Exp.png
- #
- #---------------------------------------------------------------------------
- LEVEL_NUMBER_EXP_VISIBLE = false
- #---------------------------------------------------------------------------
- # Definição da posição do número de experiência. [X,Y]
- #---------------------------------------------------------------------------
- LEVEL_NUMBER_EXP_POSITION = [180,96]
- #---------------------------------------------------------------------------
- # Definição do tipo alinhamento do número.
- #
- # 0 - Esquerda
- # 1 - Centro
- # 2 - Direita
- #---------------------------------------------------------------------------
- LEVEL_NUMBER_EXP_ALIGN_TYPE = 2
- #---------------------------------------------------------------------------
- # Definição do tipo de exp apresentado na HUD.
- #
- # 0 = Exp necessária para atingir o próximo nÃvel. (Next EXP)
- # 1 = Exp total do personagem. (Current EXP)
- #---------------------------------------------------------------------------
- LEVEL_NUMBER_EXP_TYPE = 0
- #============================================================================
- #============================================================================
- #============================================================================
- #============================================================================
- # * STATE SPRITE
- #============================================================================
- # Ativar as condições.
- #---------------------------------------------------------------------------
- STATES_VISIBLE = true
- #---------------------------------------------------------------------------
- # Definição da prioridade do sprite.
- #---------------------------------------------------------------------------
- STATES_Z = 1
- #---------------------------------------------------------------------------
- # Definição da posição das condições. [X,Y]
- #---------------------------------------------------------------------------
- STATES_POSITION = [147,60]
- #---------------------------------------------------------------------------
- # Ativar o efeito animado das condições deslizando.
- #---------------------------------------------------------------------------
- STATES_SCROLLING_ANIMATION = false
- #---------------------------------------------------------------------------
- # Definição do ângulo do sprite.
- #---------------------------------------------------------------------------
- STATE_ANGLE = 0
- #============================================================================
- #============================================================================
- #============================================================================
- #============================================================================
- # * SECOND LAYOUT (Overlayer)
- #============================================================================
- # Ativar a segunda camada de Layout
- # Será necessário o arquivo.
- #
- # Layout_2.png
- #
- #============================================================================
- SECOND_LAYOUT = true
- #---------------------------------------------------------------------------
- # Definição da prioridade do sprite.
- #---------------------------------------------------------------------------
- SECOND_LAYOUT_Z = 10
- #---------------------------------------------------------------------------
- # Definição da posição do sprite.
- #---------------------------------------------------------------------------
- SECOND_LAYOUT_POSITION = [19,18]
- #============================================================================
- #============================================================================
- #============================================================================
- #============================================================================
- # * GOLD HUD
- #============================================================================
- # Ativar a HUD de ouro. (Dinheiro)
- # Serão necessários os arquivos.
- #
- # Gold_Layout.png
- # Gold_Number.png
- #
- #============================================================================
- GOLD_VISIBLE = false
- #---------------------------------------------------------------------------
- # Ativar o Smart Fade separado da hud principal.
- #---------------------------------------------------------------------------
- GOLD_DETACHED_SMART_FADE = true
- #---------------------------------------------------------------------------
- # Definição da área "extra" do alcance do Smart Fade.
- # O alcance é baseado no tamanho da imagem do Layout.
- #---------------------------------------------------------------------------
- GOLD_SMART_FADE_RANGE_X = [-32,0]
- GOLD_SMART_FADE_RANGE_Y = [0,32]
- #---------------------------------------------------------------------------
- # Definição da prioridade da hud.
- #---------------------------------------------------------------------------
- GOLD_HUD_Z = 0
- #---------------------------------------------------------------------------
- # Definição da posição geral da hud, influência em todos os sprites da hud.
- #---------------------------------------------------------------------------
- GOLD_POSITION = [5,366]
- #---------------------------------------------------------------------------
- # Definição da posição do número.
- #---------------------------------------------------------------------------
- GOLD_NUMBER_POSITION = [80,20]
- #---------------------------------------------------------------------------
- # Definição do tipo alinhamento do número.
- #
- # 0 - Esquerda
- # 1 - Centro
- # 2 - Direita
- #---------------------------------------------------------------------------
- GOLD_NUMBER_ALIGN_TYPE = 1
- #============================================================================
- #============================================================================
- #============================================================================
- #============================================================================
- # * EQUIPMENT HUD
- #============================================================================
- # Ativar a HUD de equipamento.
- # Será necessário o arquivo.
- #
- # Equip_Layout.png
- #
- #============================================================================
- EQUIPMENT_VISIBLE = true
- #---------------------------------------------------------------------------
- # Ativar o Smart Fade separado da hud principal.
- #---------------------------------------------------------------------------
- EQUIPMENT_DETACHED_SMART_FADE = true
- #---------------------------------------------------------------------------
- # Definição da área "extra" do alcance do Smart Fade.
- # O alcance é baseado no tamanho da imagem do Layout.
- #---------------------------------------------------------------------------
- EQUIPMENT_SMART_FADE_RANGE_X = [0,0]
- EQUIPMENT_SMART_FADE_RANGE_Y = [0,32]
- #---------------------------------------------------------------------------
- # Definição da prioridade da hud.
- #---------------------------------------------------------------------------
- EQUIPMENT_Z = 0
- #---------------------------------------------------------------------------
- # Definição da posição geral da hud, influência em todos os sprites da hud.
- #---------------------------------------------------------------------------
- EQUIPMENT_POSITION = [5,90]
- #---------------------------------------------------------------------------
- # Apresentar o Ãcone da arma e a definição da posição do Ãcone.
- #---------------------------------------------------------------------------
- EQUIPMENT_WEAPON_VISIBLE = true
- EQUIPMENT_WEAPON_POSITION = [8,9]
- #---------------------------------------------------------------------------
- # Apresentar o Ãcone da escudo e a definição da posição do Ãcone.
- #---------------------------------------------------------------------------
- EQUIPMENT_SHIELD_VISIBLE = false
- EQUIPMENT_SHIELD_POSITION = [2,2]
- #---------------------------------------------------------------------------
- # Apresentar o Ãcone da capacete e a definição da posição do Ãcone.
- #---------------------------------------------------------------------------
- EQUIPMENT_HEAD_VISIBLE = false
- EQUIPMENT_HEAD_POSITION = [2,36]
- #---------------------------------------------------------------------------
- # Apresentar o Ãcone da armadura e a definição da posição do Ãcone.
- #---------------------------------------------------------------------------
- EQUIPMENT_BODY_VISIBLE = false
- EQUIPMENT_BODY_POSITION = [67,2]
- #---------------------------------------------------------------------------
- # Apresentar o Ãcone do acessório e a definição da posição do Ãcone.
- #---------------------------------------------------------------------------
- EQUIPMENT_ACCESSORY_VISIBLE = true
- EQUIPMENT_ACCESSORY_POSITION = [38,37]
- #============================================================================
- #============================================================================
- end
- #==============================================================================
- #==============================================================================
- # ** Ultima Hud
- #==============================================================================
- #==============================================================================
- #==============================================================================
- # ** Game System
- #==============================================================================
- class Game_System
- attr_accessor :hud_face
- attr_accessor :hud_visible
- attr_accessor :hud_position
- #--------------------------------------------------------------------------
- # * Initialize
- #--------------------------------------------------------------------------
- alias mog_master_hud_initialize initialize
- def initialize
- @hud_face = [0,0]
- @hud_visible = MOG_ULTIMA_HUD::INITIAL_VISIBLE
- @hud_position = [MOG_ULTIMA_HUD::HUD_POSITION[0],MOG_ULTIMA_HUD::HUD_POSITION[1]]
- mog_master_hud_initialize
- end
- end
- #==============================================================================
- # ** Game Interpreter
- #==============================================================================
- class Game_Interpreter
- #--------------------------------------------------------------------------
- # * Hud Visible
- #--------------------------------------------------------------------------
- def hud_visible(value = true)
- $game_system.hud_visible = value
- end
- #--------------------------------------------------------------------------
- # * Hud Visible
- #--------------------------------------------------------------------------
- def hud_position(x = 0, y = 0)
- $game_system.hud_position = [x,y]
- SceneManager.goto(Scene_Refresh_Map)
- end
- #--------------------------------------------------------------------------
- # * Refresh Screen
- #--------------------------------------------------------------------------
- def refresh_screen
- SceneManager.goto(Scene_Refresh_Map)
- end
- #--------------------------------------------------------------------------
- # * Testing Hud
- #--------------------------------------------------------------------------
- def testing_hud(perc = 15, death = false)
- return if $game_party.members[0] == nil
- return if $game_party.members[0].hp == 0
- actor = $game_party.members[0]
- hp_per = actor.mhp * perc / 100
- mp_per = actor.mmp * perc / 100
- tp_per = actor.max_tp * perc / 100
- hp_per = perc > 0 ? 1 : -1 if hp_per == 0
- mp_per = perc > 0 ? 1 : -1 if mp_per == 0
- tp_per = perc > 0 ? 1 : -1 if tp_per == 0
- actor.hp -= hp_per
- actor.hp = 1 if !death and actor.hp == 0
- actor.mp -= mp_per
- actor.tp -= tp_per
- end
- #--------------------------------------------------------------------------
- # * Testing Hud Level
- #--------------------------------------------------------------------------
- def testing_hud_level
- return if $game_party.members[0] == nil
- actor = $game_party.members[0]
- actor.change_level(actor.level + 1, false)
- actor.gain_exp_test
- end
- end
- #==============================================================================
- # ** Cache
- #==============================================================================
- module Cache
- #--------------------------------------------------------------------------
- # * Hud
- #--------------------------------------------------------------------------
- def self.ultima_hud(filename)
- load_bitmap("Graphics/Huds/Ultima/", filename)
- end
- end
- #==============================================================================
- # ** Game Actor
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # â Real Next Level
- #--------------------------------------------------------------------------
- def real_next_level
- next_level_exp - exp_for_level(level)
- end
- #--------------------------------------------------------------------------
- # â Remain Exp
- #--------------------------------------------------------------------------
- def remain_exp
- exp - exp_for_level(level)
- end
- #--------------------------------------------------------------------------
- # â Gain Exp Test
- #--------------------------------------------------------------------------
- def gain_exp_test
- exp_r = rand(next_level_exp)
- change_exp(self.exp + (exp_r * final_exp_rate).to_i, false)
- end
- #--------------------------------------------------------------------------
- # â Low HP?
- #--------------------------------------------------------------------------
- def low_hp?
- hp <= (mhp * MOG_ULTIMA_HUD::LOW_PARAMETER_PERCENTAGE) / 100
- end
- #--------------------------------------------------------------------------
- # â Low MP?
- #--------------------------------------------------------------------------
- def low_mp?
- mp <= (mmp * MOG_ULTIMA_HUD::LOW_PARAMETER_PERCENTAGE) / 100
- end
- #--------------------------------------------------------------------------
- # â Low TP?
- #--------------------------------------------------------------------------
- def low_tp?
- tp <= (max_tp * MOG_ULTIMA_HUD::LOW_PARAMETER_PERCENTAGE) / 100
- end
- end
- #==============================================================================
- # ** Scene Refresh Map
- #==============================================================================
- class Scene_Refresh_Map
- #--------------------------------------------------------------------------
- # * Main
- #--------------------------------------------------------------------------
- def main
- Graphics.transition(10)
- SceneManager.goto(Scene_Map)
- Graphics.freeze
- end
- end
- #==============================================================================
- # ** Spriteset Map
- #==============================================================================
- class Spriteset_Map
- #--------------------------------------------------------------------------
- # * Initialize
- #--------------------------------------------------------------------------
- alias mog_ultima_hud_initialize initialize
- def initialize
- create_ultima_hud
- mog_ultima_hud_initialize
- end
- #--------------------------------------------------------------------------
- # * Dispose
- #--------------------------------------------------------------------------
- alias mog_ultima_hud_dispose dispose
- def dispose
- mog_ultima_hud_dispose
- dispose_ultima_hud
- end
- #--------------------------------------------------------------------------
- # * Update
- #--------------------------------------------------------------------------
- alias mog_ultima_hud_update update
- def update
- mog_ultima_hud_update
- update_ultima_hud
- end
- #--------------------------------------------------------------------------
- # * Create Ultima Hud
- #--------------------------------------------------------------------------
- def create_ultima_hud
- return if @mhud != nil
- @ultima_hud = Ultima_Hud.new
- end
- #--------------------------------------------------------------------------
- # * Dispose Ultima Hud
- #--------------------------------------------------------------------------
- def dispose_ultima_hud
- return if @ultima_hud == nil
- @ultima_hud.dispose
- @ultima_hud = nil
- end
- #--------------------------------------------------------------------------
- # * Update Ultima Hud
- #--------------------------------------------------------------------------
- def update_ultima_hud
- return if @ultima_hud == nil
- @ultima_hud.update
- end
- end
- #==============================================================================
- #==============================================================================
- # ** Ultima Hud (INITIALIZE)
- #==============================================================================
- #==============================================================================
- class Ultima_Hud
- include MOG_ULTIMA_HUD
- #--------------------------------------------------------------------------
- # * Initialize
- #--------------------------------------------------------------------------
- def initialize
- pre_cache
- setup
- create_sprites
- end
- #--------------------------------------------------------------------------
- # * Setup
- #--------------------------------------------------------------------------
- def setup
- @actor = $game_party.members[0]
- $game_system.hud_face = [1,0]
- @hp_icon_max = -1
- @hp_icon_old = -1
- @hp_icon_col_max = HP_ICON_COL_MAX
- @hp_icon_col_max = 1 if @hp_icon_col_max <= 0
- @hp_icon_row_max = HP_ICON_ROW_MAX
- @hp_icon_row_max = 1 if @hp_icon_row_max <= 0
- @hp_icon_real_max = @hp_icon_col_max * @hp_icon_row_max
- @mp_icon_max = -1
- @mp_icon_old = -1
- @mp_icon_col_max = MP_ICON_COL_MAX
- @mp_icon_col_max = 1 if @mp_icon_col_max <= 0
- @mp_icon_row_max = MP_ICON_ROW_MAX
- @mp_icon_row_max = 1 if @mp_icon_row_max <= 0
- @mp_icon_real_max = @mp_icon_col_max * @mp_icon_row_max
- @tp_icon_max = -1
- @tp_icon_old = -1
- @tp_icon_col_max = TP_ICON_COL_MAX
- @tp_icon_col_max = 1 if @tp_icon_col_max <= 0
- @tp_icon_row_max = TP_ICON_ROW_MAX
- @tp_icon_row_max = 1 if @tp_icon_row_max <= 0
- @tp_icon_real_max = @tp_icon_col_max * @tp_icon_row_max
- setup_actor
- end
- #--------------------------------------------------------------------------
- # * Setup Actor
- #--------------------------------------------------------------------------
- def setup_actor
- return if @actor == nil
- @hp_number_refresh = true
- @hp_number2_refresh = true
- @hp_number_old = @actor.hp
- @hp_number2_old = @actor.mhp
- @hp_old_meter = 0
- @mp_number_refresh = true
- @mp_number2_refresh = true
- @mp_number_old = @actor.mp
- @mp_number2_old = @actor.mmp
- @mp_old_meter = 0
- @tp_number_refresh = true
- @tp_number2_refresh = true
- @tp_number_old = @actor.tp
- @tp_number2_old = @actor.max_tp
- @tp_old_meter = 0
- end
- #--------------------------------------------------------------------------
- # * Create Sprites
- #--------------------------------------------------------------------------
- def create_sprites
- dispose
- return if @actor == nil
- create_layout
- create_layout_2
- create_name
- create_face
- create_hp_number
- create_hp_number_max
- create_hp_meter
- create_hp_icon
- create_hp_icon_ex
- create_hp_icon_number
- create_mp_number
- create_mp_number_max
- create_mp_meter
- create_mp_icon
- create_mp_icon_ex
- create_mp_icon_number
- create_tp_number
- create_tp_number_max
- create_tp_meter
- create_tp_icon
- create_tp_icon_ex
- create_tp_icon_number
- create_level_number
- create_level_number_exp
- create_level_meter
- create_states
- create_equipment
- create_gold
- update
- end
- end
- #==============================================================================
- #==============================================================================
- # ** Ultima Hud (PRE CACHE)
- #==============================================================================
- #==============================================================================
- class Ultima_Hud
- #--------------------------------------------------------------------------
- # * Pre Cache
- #--------------------------------------------------------------------------
- def pre_cache
- @force_hide = false
- @force_hide_time = 0
- @fade_hud = false
- @fade_hud_gold = false
- @fade_hud_equip = false
- #------------------------------------------------
- # HP
- #------------------------------------------------
- if HP_NUMBER_VISIBLE
- @hp_number_image = Cache.ultima_hud("HP_Number")
- @hp_number_cw = @hp_number_image.width / 10
- if HP_NUMBER_LOW_COLOR
- @hp_number_ch = @hp_number_image.height / 2
- else
- @hp_number_ch = @hp_number_image.height
- end
- @hp_wave_number = HP_NUMBER_WAVE_ALIGN_EFFECT
- @hp_number_ch += (@hp_number_ch / 2) if @hp_wave_number
- end
- if HP_NUMBER_MAX_VISIBLE
- @hp_number2_image = Cache.ultima_hud("HP_Number_Max")
- @hp_number2_cw = @hp_number2_image.width / 10
- @hp_number2_ch = @hp_number2_image.height
- end
- if HP_METER_VISIBLE
- @hp_meter_image = Cache.ultima_hud("HP_Meter")
- if HP_METER_GRADIENT_ANIMATION
- @hp_meter_cw = @hp_meter_image.width / 3
- else
- @hp_meter_cw = @hp_meter_image.width
- end
- if HP_METER_REDUCTION_ANIMATION
- @hp_meter_ch = @hp_meter_image.height / 2
- else
- @hp_meter_ch = @hp_meter_image.height
- end
- end
- if HP_ICON_VISIBLE
- @hp_icon_image = Cache.ultima_hud("HP_Icon")
- @hp_icon_cw = @hp_icon_image.width / 2
- @hp_icon_ch = @hp_icon_image.height
- end
- if HP_ICON_EX_VISIBLE
- @hp_icon2_image = Cache.ultima_hud("HP_Icon_EX")
- @hp_icon2_cw = @hp_icon2_image.width
- @hp_icon2_ch = @hp_icon2_image.height
- end
- if HP_ICON_NUMBER_VISIBLE
- @hp_icon_number_image = Cache.ultima_hud("HP_Icon_Number")
- @hp_icon_number_cw = @hp_icon_number_image.width / 10
- @hp_icon_number_ch = @hp_icon_number_image.height
- end
- #------------------------------------------------
- # MP
- #------------------------------------------------
- if MP_NUMBER_VISIBLE
- @mp_number_image = Cache.ultima_hud("MP_Number")
- @mp_number_cw = @mp_number_image.width / 10
- if MP_NUMBER_LOW_COLOR
- @mp_number_ch = @mp_number_image.height / 2
- else
- @mp_number_ch = @mp_number_image.height
- end
- @mp_wave_number = MP_NUMBER_WAVE_ALIGN_EFFECT
- @mp_number_ch += (@mp_number_ch / 2) if @mp_wave_number
- end
- if MP_NUMBER_MAX_VISIBLE
- @mp_number2_image = Cache.ultima_hud("MP_Number_Max")
- @mp_number2_cw = @mp_number2_image.width / 10
- @mp_number2_ch = @mp_number2_image.height
- end
- if MP_METER_VISIBLE
- @mp_meter_image = Cache.ultima_hud("MP_Meter")
- if MP_METER_GRADIENT_ANIMATION
- @mp_meter_cw = @mp_meter_image.width / 3
- else
- @mp_meter_cw = @mp_meter_image.width
- end
- if MP_METER_REDUCTION_ANIMATION
- @mp_meter_ch = @mp_meter_image.height / 2
- else
- @mp_meter_ch = @mp_meter_image.height
- end
- end
- if MP_ICON_VISIBLE
- @mp_icon_image = Cache.ultima_hud("MP_Icon")
- @mp_icon_cw = @mp_icon_image.width / 2
- @mp_icon_ch = @mp_icon_image.height
- end
- if MP_ICON_EX_VISIBLE
- @mp_icon2_image = Cache.ultima_hud("MP_Icon_EX")
- @mp_icon2_cw = @mp_icon2_image.width
- @mp_icon2_ch = @mp_icon2_image.height
- end
- if MP_ICON_NUMBER_VISIBLE
- @mp_icon_number_image = Cache.ultima_hud("MP_Icon_Number")
- @mp_icon_number_cw = @mp_icon_number_image.width / 10
- @mp_icon_number_ch = @mp_icon_number_image.height
- end
- #------------------------------------------------
- # TP
- #------------------------------------------------
- if TP_NUMBER_VISIBLE
- @tp_number_image = Cache.ultima_hud("TP_Number")
- @tp_number_cw = @tp_number_image.width / 10
- if TP_NUMBER_LOW_COLOR
- @tp_number_ch = @tp_number_image.height / 2
- else
- @tp_number_ch = @tp_number_image.height
- end
- @tp_wave_number = TP_NUMBER_WAVE_ALIGN_EFFECT
- @tp_number_ch += (@tp_number_ch / 2) if @tp_wave_number
- end
- if TP_NUMBER_MAX_VISIBLE
- @tp_number2_image = Cache.ultima_hud("TP_Number_Max")
- @tp_number2_cw = @tp_number2_image.width / 10
- @tp_number2_ch = @tp_number2_image.height
- end
- if TP_METER_VISIBLE
- @tp_meter_image = Cache.ultima_hud("TP_Meter")
- if TP_METER_GRADIENT_ANIMATION
- @tp_meter_cw = @tp_meter_image.width / 3
- else
- @tp_meter_cw = @tp_meter_image.width
- end
- if TP_METER_REDUCTION_ANIMATION
- @tp_meter_ch = @tp_meter_image.height / 2
- else
- @tp_meter_ch = @tp_meter_image.height
- end
- end
- if TP_ICON_VISIBLE
- @tp_icon_image = Cache.ultima_hud("TP_Icon")
- @tp_icon_cw = @tp_icon_image.width / 2
- @tp_icon_ch = @tp_icon_image.height
- end
- if TP_ICON_EX_VISIBLE
- @tp_icon2_image = Cache.ultima_hud("TP_Icon_EX")
- @tp_icon2_cw = @tp_icon2_image.width
- @tp_icon2_ch = @tp_icon2_image.height
- end
- if TP_ICON_NUMBER_VISIBLE
- @tp_icon_number_image = Cache.ultima_hud("TP_Icon_Number")
- @tp_icon_number_cw = @tp_icon_number_image.width / 10
- @tp_icon_number_ch = @tp_icon_number_image.height
- end
- #------------------------------------------------
- # LV
- #------------------------------------------------
- if LEVEL_NUMBER_VISIBLE
- @lv_number_image = Cache.ultima_hud("LV_Number")
- @lv_number_cw = @lv_number_image.width / 10
- @lv_number_ch = @lv_number_image.height
- end
- if LEVEL_NUMBER_EXP_VISIBLE
- @lv_number2_image = Cache.ultima_hud("LV_Number_Exp")
- @lv_number2_cw = @lv_number2_image.width / 10
- @lv_number2_ch = @lv_number2_image.height
- end
- if LEVEL_METER_VISIBLE
- @lv_meter_image = Cache.ultima_hud("LV_Meter")
- @lv_meter_cw = @lv_meter_image.width
- @lv_meter_ch = @lv_meter_image.height
- end
- #------------------------------------------------
- # ICON
- #------------------------------------------------
- if STATES_VISIBLE or EQUIPMENT_VISIBLE
- @icon_image = Cache.system("Iconset")
- end
- end
- #--------------------------------------------------------------------------
- # * Check Icon Image
- #--------------------------------------------------------------------------
- def check_icon_image
- if @icon_image == nil or @icon_image.disposed?
- @icon_image = Cache.system("Iconset")
- end
- end
- end
- #==============================================================================
- #==============================================================================
- # ** Ultima Hud (SPRITE SYSTEM)
- #==============================================================================
- #==============================================================================
- class Ultima_Hud
- #--------------------------------------------------------------------------
- # * Update Number
- #--------------------------------------------------------------------------
- def update_number(type,value)
- actor_value = @actor.hp if type == 0
- actor_value = @actor.mp if type == 1
- actor_value = @actor.tp if type == 2
- actor_value = @actor.mhp if type == 3
- actor_value = @actor.mmp if type == 4
- actor_value = @actor.max_tp if type == 5
- actor_value = $game_party.gold if type == 6
- if value < actor_value
- value += number_refresh_speed(actor_value,value)
- value = actor_value if value >= actor_value
- refresh_sprite_number(type,value)
- elsif value > actor_value
- value -= number_refresh_speed(actor_value,value)
- value = actor_value if value <= actor_value
- refresh_sprite_number(type,value)
- end
- end
- #--------------------------------------------------------------------------
- # * Number Refresh Speed
- #--------------------------------------------------------------------------
- def number_refresh_speed(actor_value,value)
- n = 1 * (actor_value - value).abs / 10
- return [[n, 99999999].min,1].max
- end
- #--------------------------------------------------------------------------
- # * Update Number Fix
- #--------------------------------------------------------------------------
- def update_number_fix(type)
- if type == 0
- @hp_number_old = @actor.hp
- @hp_number_refresh = true
- elsif type == 1
- @mp_number_old = @actor.mp
- @mp_number_refresh = true
- elsif type == 2
- @tp_number_old = @actor.tp
- @tp_number_refresh = true
- elsif type == 3
- @hp_number2_old = @actor.mhp
- @hp_number2_refresh = true
- elsif type == 4
- @mp_number2_old = @actor.mmp
- @mp_number2_refresh = true
- elsif type == 5
- @tp_number2_old = @actor.max_tp
- @tp_number2_refresh = true
- end
- end
- #--------------------------------------------------------------------------
- # * Refresh Sprite Number
- #--------------------------------------------------------------------------
- def refresh_sprite_number(type,value)
- @hp_number_refresh = true if type == 0
- @hp_number_old = value if type == 0
- @mp_number_refresh = true if type == 1
- @mp_number_old = value if type == 1
- @tp_number_refresh = true if type == 2
- @tp_number_old = value if type == 2
- @hp_number2_refresh = true if type == 3
- @hp_number2_old = value if type == 3
- @mp_number2_refresh = true if type == 4
- @mp_number2_old = value if type == 4
- @tp_number2_refresh = true if type == 5
- @tp_number2_old = value if type == 5
- @gold_refresh = true if type == 6
- @gold_old = value if type == 6
- end
- #--------------------------------------------------------------------------
- # * Refresh Number
- #--------------------------------------------------------------------------
- def refresh_number(type,value,sprite,image,number_cw,number_ch,wave_number = false)
- sprite.bitmap.clear
- clear_number_refresh(type)
- number_color = low_number_color(type,number_ch)
- if type == 0 and HP_NUMBER_PERCENTAGE
- value_max = @actor.mhp
- value = value.to_f / value_max.to_f * 100
- value = 1 if (value < 0 and @actor.hp > 0) or @actor.hp == 1
- elsif type == 1 and MP_NUMBER_PERCENTAGE
- value_max = @actor.mmp
- value = value.to_f / value_max.to_f * 100
- elsif type == 2 and TP_NUMBER_PERCENTAGE
- value_max = @actor.max_tp
- value = value.to_f / value_max.to_f * 100
- elsif type == 3 and HP_NUMBER_PERCENTAGE
- value = 100
- elsif type == 4 and MP_NUMBER_PERCENTAGE
- value = 100
- elsif type == 5 and TP_NUMBER_PERCENTAGE
- value = 100
- end
- value = 9999999 if value > 9999999
- number_value = value.truncate.abs.to_s.split(//)
- wave_h = 0
- wave_h2 = wave_number ? (number_ch / 3) : 0
- wave_h3 = number_color != 0 ? wave_h2 : 0
- for r in 0..number_value.size - 1
- number_value_abs = number_value[r].to_i
- wh = wave_h2 * wave_h
- wh2 = wave_h == 0 ? wave_h2 : 0
- nsrc_rect = Rect.new(number_cw * number_value_abs, number_color - wave_h3, number_cw, number_ch - wh2)
- sprite.bitmap.blt(number_cw * r, wh, image, nsrc_rect)
- wave_h = wave_h == 0 ? 1 : 0
- end
- refresh_number_position(type,number_value.size,number_cw)
- end
- #--------------------------------------------------------------------------
- # * Refresh Number
- #--------------------------------------------------------------------------
- def refresh_number_position(type,number_value,number_cw)
- cx = number_value * number_cw
- if type == 0
- case HP_NUMBER_ALIGN_TYPE
- when 0; @hp_number.x = $game_system.hud_position[0] + HP_NUMBER_POSITION[0]
- when 1; @hp_number.x = $game_system.hud_position[0] + HP_NUMBER_POSITION[0] - (cx / 2)
- when 2; @hp_number.x = $game_system.hud_position[0] + HP_NUMBER_POSITION[0] - cx
- end
- elsif type == 1
- case MP_NUMBER_ALIGN_TYPE
- when 0; @mp_number.x = $game_system.hud_position[0] + MP_NUMBER_POSITION[0]
- when 1; @mp_number.x = $game_system.hud_position[0] + MP_NUMBER_POSITION[0] - (cx / 2)
- when 2; @mp_number.x = $game_system.hud_position[0] + MP_NUMBER_POSITION[0] - cx
- end
- elsif type == 2
- case TP_NUMBER_ALIGN_TYPE
- when 0; @tp_number.x = $game_system.hud_position[0] + TP_NUMBER_POSITION[0]
- when 1; @tp_number.x = $game_system.hud_position[0]+ TP_NUMBER_POSITION[0] - (cx / 2)
- when 2; @tp_number.x = $game_system.hud_position[0] + TP_NUMBER_POSITION[0] - cx
- end
- elsif type == 3
- case HP_NUMBER_ALIGN_TYPE
- when 0; @hp_number2.x = $game_system.hud_position[0] + HP_NUMBER_MAX_POSITION[0]
- when 1; @hp_number2.x = $game_system.hud_position[0] + HP_NUMBER_MAX_POSITION[0] - (cx / 2)
- when 2; @hp_number2.x = $game_system.hud_position[0] + HP_NUMBER_MAX_POSITION[0] - cx
- end
- elsif type == 4
- case MP_NUMBER_ALIGN_TYPE
- when 0; @mp_number2.x = $game_system.hud_position[0] + MP_NUMBER_MAX_POSITION[0]
- when 1; @mp_number2.x = $game_system.hud_position[0] + MP_NUMBER_MAX_POSITION[0] - (cx / 2)
- when 2; @mp_number2.x = $game_system.hud_position[0] + MP_NUMBER_MAX_POSITION[0] - cx
- end
- elsif type == 5
- case TP_NUMBER_ALIGN_TYPE
- when 0; @tp_number2.x = $game_system.hud_position[0] + TP_NUMBER_MAX_POSITION[0]
- when 1; @tp_number2.x = $game_system.hud_position[0] + TP_NUMBER_MAX_POSITION[0] - (cx / 2)
- when 2; @tp_number2.x = $game_system.hud_position[0] + TP_NUMBER_MAX_POSITION[0] - cx
- end
- elsif type == 6
- case GOLD_NUMBER_ALIGN_TYPE
- when 0; @gold_number.x = @gold_pos[0]
- when 1; @gold_number.x = @gold_pos[0] - (cx / 2)
- when 2; @gold_number.x = @gold_pos[0] - cx
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Low Number Color
- #--------------------------------------------------------------------------
- def low_number_color(type,number_ch)
- if type == 0
- if HP_NUMBER_LOW_COLOR
- return @actor.low_hp? ? number_ch : 0
- else
- return 0
- end
- elsif type == 1
- if MP_NUMBER_LOW_COLOR
- return @actor.low_mp? ? number_ch : 0
- else
- return 0
- end
- elsif type == 2
- if TP_NUMBER_LOW_COLOR
- return @actor.low_tp? ? number_ch : 0
- else
- return 0
- end
- else
- return 0
- end
- end
- #--------------------------------------------------------------------------
- # * Clear Number Refresh
- #--------------------------------------------------------------------------
- def clear_number_refresh(type)
- @hp_number_refresh = false if type == 0
- @mp_number_refresh = false if type == 1
- @tp_number_refresh = false if type == 2
- @hp_number2_refresh = false if type == 3
- @mp_number2_refresh = false if type == 4
- @tp_number2_refresh = false if type == 5
- @gold_refresh = false if type == 6
- end
- #--------------------------------------------------------------------------
- # * Fade Sprite
- #--------------------------------------------------------------------------
- def fade_sprite(sprite,fade_hud)
- if @force_hide
- sprite.opacity = 0 if @force_hide_time > 5
- else
- if fade_hud
- sprite.opacity -= 15 if sprite.opacity > SMART_FADE_LIMIT
- sprite.opacity = SMART_FADE_LIMIT if sprite.opacity < SMART_FADE_LIMIT
- else
- sprite.opacity += 15
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Icon Limit
- #--------------------------------------------------------------------------
- def icon_limit(value,value_max)
- n1 = value / value_max
- n2 = value - (n1 * value_max)
- n2 = value_max if (n2 == 0 and value > 0)
- return n2
- end
- end
- #==============================================================================
- #==============================================================================
- # ** Ultima Hud (LAYOUT)
- #==============================================================================
- #==============================================================================
- class Ultima_Hud
- #--------------------------------------------------------------------------
- # * Create Layout
- #--------------------------------------------------------------------------
- def create_layout
- @layout = Sprite.new
- @layout.bitmap = Cache.ultima_hud("Layout")
- @layout.z = HUD_Z
- @layout.x = $game_system.hud_position[0]
- @layout.y = $game_system.hud_position[1]
- @layout.opacity = 0 if !$game_system.hud_visible
- @hud_size_x = [$game_system.hud_position[0] + SMART_FADE_RANGE_X[0], $game_system.hud_position[0] + @layout.bitmap.width + SMART_FADE_RANGE_X[1]]
- @hud_size_y = [$game_system.hud_position[1] + SMART_FADE_RANGE_Y[0], $game_system.hud_position[1] + @layout.bitmap.height + SMART_FADE_RANGE_Y[1]]
- end
- #--------------------------------------------------------------------------
- # * Update Layout
- #--------------------------------------------------------------------------
- def update_layout
- return if @layout == nil
- fade_sprite(@layout,@fade_hud)
- end
- #--------------------------------------------------------------------------
- # * Create Layout
- #--------------------------------------------------------------------------
- def create_layout_2
- return if !SECOND_LAYOUT
- @layout2 = Sprite.new
- @layout2.bitmap = Cache.ultima_hud("Layout_2")
- @layout2.z = HUD_Z + SECOND_LAYOUT_Z
- @layout2.x = $game_system.hud_position[0] + SECOND_LAYOUT_POSITION[0]
- @layout2.y = $game_system.hud_position[1] + SECOND_LAYOUT_POSITION[1]
- @layout2.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Update Layout
- #--------------------------------------------------------------------------
- def update_layout_2
- return if @layout2 == nil
- fade_sprite(@layout2,@fade_hud)
- end
- end
- #==============================================================================
- #==============================================================================
- # ** Ultima Hud (NAME)
- #==============================================================================
- #==============================================================================
- class Ultima_Hud
- #--------------------------------------------------------------------------
- # * Create Name
- #--------------------------------------------------------------------------
- def create_name
- return if !NAME_VISIBLE
- @name = Sprite.new
- @name.bitmap = Bitmap.new(160,32)
- @name.bitmap.font.name = NAME_FONT_NAME
- @name.bitmap.font.size = NAME_FONT_SIZE
- @name.bitmap.font.bold = NAME_FONT_BOLD
- @name.bitmap.font.italic = NAME_FONT_ITALIC
- @name.bitmap.font.color = NAME_FONT_COLOR
- @name.z = HUD_Z + NAME_Z
- @name.x = $game_system.hud_position[0] + NAME_POSITION[0]
- @name.y = $game_system.hud_position[1] + NAME_POSITION[1]
- @name.opacity = 0 if !$game_system.hud_visible
- refresh_name
- end
- #--------------------------------------------------------------------------
- # * Refresh Name
- #--------------------------------------------------------------------------
- def refresh_name
- return if @name == nil
- @name.bitmap.clear
- if NAME_FONT_SHADOW
- @name.bitmap.font.color = NAME_FONT_SHADOW_COLOR
- @name.bitmap.draw_text(NAME_FONT_SHADOW_POSITION[0],NAME_FONT_SHADOW_POSITION[1],160,32,@actor.name,NAME_ALIGN_TYPE)
- @name.bitmap.font.color = NAME_FONT_COLOR
- end
- @name.bitmap.draw_text(0,0,160,32,@actor.name,NAME_ALIGN_TYPE)
- end
- #--------------------------------------------------------------------------
- # * Update Name
- #--------------------------------------------------------------------------
- def update_name
- return if @name == nil
- fade_sprite(@name,@fade_hud)
- end
- end
- #==============================================================================
- #==============================================================================
- # ** Ultima Hud (HP)
- #==============================================================================
- #==============================================================================
- class Ultima_Hud
- #--------------------------------------------------------------------------
- # * Create HP Number
- #--------------------------------------------------------------------------
- def create_hp_number
- return if !HP_NUMBER_VISIBLE
- @hp_number = Sprite.new
- @hp_number.bitmap = Bitmap.new(@hp_number_cw * 4,@hp_number_ch)
- @hp_number.z = HUD_Z + HP_NUMBER_Z
- @hp_number.x = $game_system.hud_position[0] + HP_NUMBER_POSITION[0]
- @hp_number.y = $game_system.hud_position[1] + HP_NUMBER_POSITION[1]
- @hp_number.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Create HP Number Max
- #--------------------------------------------------------------------------
- def create_hp_number_max
- return if !HP_NUMBER_MAX_VISIBLE
- @hp_number2 = Sprite.new
- @hp_number2.bitmap = Bitmap.new(@hp_number2_cw * 4,@hp_number2_ch)
- @hp_number2.z = HUD_Z + HP_NUMBER_Z
- @hp_number2.x = $game_system.hud_position[0] + HP_NUMBER_MAX_POSITION[0]
- @hp_number2.y = $game_system.hud_position[1] + HP_NUMBER_MAX_POSITION[1]
- @hp_number2.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Create HP Meter
- #--------------------------------------------------------------------------
- def create_hp_meter
- return if !HP_METER_VISIBLE
- @hp_flow_max = @hp_meter_cw * 2
- @hp_flow = rand(@hp_flow_max)
- @hp_meter = Sprite.new
- @hp_meter.bitmap = Bitmap.new(@hp_meter_cw,@hp_meter_ch)
- @hp_meter.z = HUD_Z + HP_METER_Z
- @hp_meter.x = $game_system.hud_position[0] + HP_METER_POSITION[0]
- @hp_meter.y = $game_system.hud_position[1] + HP_METER_POSITION[1]
- @hp_meter.angle = HP_METER_ANGLE
- @hp_meter.mirror = HP_METER_MIRROR_EFFECT
- @hp_meter.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # â Update Flow HP
- #--------------------------------------------------------------------------
- def update_flow_hp
- @hp_meter.bitmap.clear
- @hp_flow = 0 if !HP_METER_GRADIENT_ANIMATION
- meter_width = @hp_meter_cw * @actor.hp / @actor.mhp rescue nil
- meter_width = 0 if meter_width == nil
- execute_hp_damage_flow(meter_width)
- meter_src_rect = Rect.new(@hp_flow, 0,meter_width, @hp_meter_ch)
- @hp_meter.bitmap.blt(0,0, @hp_meter_image, meter_src_rect)
- @hp_flow += 5
- @hp_flow = 0 if @hp_flow >= @hp_flow_max
- end
- #--------------------------------------------------------------------------
- # â Execute HP Damage Flow
- #--------------------------------------------------------------------------
- def execute_hp_damage_flow(meter_width)
- return if !HP_METER_REDUCTION_ANIMATION
- return if @hp_old_meter == meter_width
- n = (@hp_old_meter - meter_width).abs * 3 / 100
- damage_flow = [[n, 2].min,0.5].max
- @hp_old_meter -= damage_flow
- @hp_old_meter = meter_width if @hp_old_meter <= meter_width
- src_rect_old = Rect.new(0,@hp_meter_ch, @hp_old_meter, @hp_meter_ch)
- @hp_meter.bitmap.blt(0,0, @hp_meter_image, src_rect_old)
- end
- #--------------------------------------------------------------------------
- # * Create HP Icon
- #--------------------------------------------------------------------------
- def create_hp_icon
- return if !HP_ICON_VISIBLE
- @hp_icon = Sprite.new
- icon_width = @hp_icon_col_max * (@hp_icon_cw + HP_ICON_SPACE[0].abs)
- icon_height = @hp_icon_row_max * (@hp_icon_ch + HP_ICON_SPACE[1].abs)
- @hp_icon.bitmap = Bitmap.new(icon_width,icon_height)
- @hp_icon.z = HUD_Z + HP_ICON_Z
- @hp_icon.x = $game_system.hud_position[0] + HP_ICON_POSITION[0]
- @hp_icon.y = $game_system.hud_position[1] + HP_ICON_POSITION[1]
- @hp_icon.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Refresh HP Icon
- #--------------------------------------------------------------------------
- def refresh_hp_icon
- @hp_icon_old = @actor.hp
- @hp_icon.bitmap.clear
- max_value = (@actor.mhp / @hp_icon_real_max) * @hp_icon_real_max
- if @actor.hp > max_value
- icon_max = icon_limit(@actor.mhp,@hp_icon_real_max)
- else
- icon_max = @actor.mhp
- end
- for i in 0...icon_max
- break if (i / @hp_icon_col_max) >= @hp_icon_row_max
- rx = (i * (@hp_icon_cw + HP_ICON_SPACE[0]) ) - ((i / @hp_icon_col_max) * (@hp_icon_cw + HP_ICON_SPACE[0]) * @hp_icon_col_max)
- ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
- i_scr = Rect.new(0,0,@hp_icon_cw,@hp_icon_ch)
- @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
- end
- icon_max = icon_limit(@actor.hp,@hp_icon_real_max)
- rx = 0
- ry = 0
- for i in 0...icon_max
- break if (i / @hp_icon_col_max) >= @hp_icon_row_max
- rx = (i * (@hp_icon_cw + HP_ICON_SPACE[0]) ) - ((i / @hp_icon_col_max) * (@hp_icon_cw + HP_ICON_SPACE[0]) * @hp_icon_col_max)
- ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
- i_scr = Rect.new(@hp_icon_cw,0,@hp_icon_cw,@hp_icon_ch)
- @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
- end
- refresh_hp_icon_ex(rx,ry)
- end
- #--------------------------------------------------------------------------
- # * Create HP Icon EX
- #--------------------------------------------------------------------------
- def create_hp_icon_ex
- return if !HP_ICON_EX_VISIBLE
- @hp_icon3_anime_phase = 0
- @hp_icon3 = Sprite.new
- @hp_icon3.bitmap = Bitmap.new(@hp_icon2_cw,@hp_icon2_ch)
- @hp_icon3.ox = @hp_icon3.bitmap.width / 2
- @hp_icon3.oy = @hp_icon3.bitmap.height / 2
- @hp_icon3.z = HUD_Z + HP_ICON_Z + 2
- @hp_icon3_org = [$game_system.hud_position[0] + HP_ICON_POSITION[0] + HP_ICON_EX_POSITION[0] + @hp_icon3.ox,
- $game_system.hud_position[1] + HP_ICON_POSITION[1] + HP_ICON_EX_POSITION[1] + @hp_icon3.oy]
- @hp_icon3.x = @hp_icon3_org[0]
- @hp_icon3.y = @hp_icon3_org[1]
- @hp_icon3.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Refresh HP Icon EX
- #--------------------------------------------------------------------------
- def refresh_hp_icon_ex(rx,ry)
- return if @hp_icon3 == nil
- @hp_icon3.bitmap.clear
- return if @actor.hp == 0
- i_scr = Rect.new(0,0,@hp_icon2_cw,@hp_icon2_ch)
- @hp_icon3.bitmap.blt(0,0, @hp_icon2_image ,i_scr )
- @hp_icon3.x = @hp_icon3_org[0] + rx
- @hp_icon3.y = @hp_icon3_org[1] + ry
- end
- #--------------------------------------------------------------------------
- # * Update Icon HP EX Anime
- #--------------------------------------------------------------------------
- def update_icon_hp_ex_anime
- return if !HP_ICON_EX_ZOOM_EFFECT
- if @hp_icon3_anime_phase == 0
- @hp_icon3.zoom_x += 0.01
- if @hp_icon3.zoom_x >= 1.30
- @hp_icon3.zoom_x = 1.30
- @hp_icon3_anime_phase = 1
- end
- else
- @hp_icon3.zoom_x -= 0.01
- if @hp_icon3.zoom_x <= 1.05
- @hp_icon3.zoom_x = 1.05
- @hp_icon3_anime_phase = 0
- end
- end
- @hp_icon3.zoom_y = @hp_icon3.zoom_x
- end
- #--------------------------------------------------------------------------
- # * Create HP Icon Nummber
- #--------------------------------------------------------------------------
- def create_hp_icon_number
- return if !HP_ICON_NUMBER_VISIBLE
- @hp_icon_number_old = [-1,-1]
- @hp_icon_number = Sprite.new
- @hp_icon_number.bitmap = Bitmap.new(@hp_icon_number_cw * 4,@hp_icon_number_ch)
- @hp_icon_number.z = HUD_Z + HP_ICON_NUMBER_Z
- @hp_icon_number.x = $game_system.hud_position[0] + HP_ICON_NUMBER_POSITION[0]
- @hp_icon_number.y = $game_system.hud_position[1] + HP_ICON_NUMBER_POSITION[1]
- @hp_icon_number.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Refresh Icon Number HP
- #--------------------------------------------------------------------------
- def refresh_icon_number_hp
- @hp_icon_number_old[0] = @actor.hp
- @hp_icon_number_old[1] = @actor.mhp
- @hp_icon_number.bitmap.clear
- value = ((@actor.hp - 1) / @hp_icon_col_max) / @hp_icon_row_max
- value = 0 if value < 0
- number_value = value.truncate.abs.to_s.split(//)
- for r in 0..number_value.size - 1
- number_value_abs = number_value[r].to_i
- nsrc_rect = Rect.new(@hp_icon_number_cw * number_value_abs, 0, @hp_icon_number_cw, @hp_icon_number_ch)
- @hp_icon_number.bitmap.blt(@hp_icon_number_cw * r, 0, @hp_icon_number_image, nsrc_rect)
- end
- cx = (number_value.size * @hp_icon_number_cw)
- case HP_ICON_NUMBER_ALIGN_TYPE
- when 0; @hp_icon_number.x = $game_system.hud_position[0] + HP_ICON_NUMBER_POSITION[0]
- when 1; @hp_icon_number.x = $game_system.hud_position[0] + HP_ICON_NUMBER_POSITION[0] - (cx / 2)
- when 2; @hp_icon_number.x = $game_system.hud_position[0] + HP_ICON_NUMBER_POSITION[0] - cx
- end
- end
- #--------------------------------------------------------------------------
- # * Can Refresh Icon Number HP
- #--------------------------------------------------------------------------
- def can_refresh_icon_number_hp?
- return true if @hp_icon_number_old[0] != @actor.hp
- return true if @hp_icon_number_old[1] != @actor.mhp
- return false
- end
- #--------------------------------------------------------------------------
- # * Update HP
- #--------------------------------------------------------------------------
- def update_hp
- if @hp_number != nil
- if HP_NUMBER_ANIMATION
- update_number(0,@hp_number_old)
- else
- update_number_fix(0) if @hp_number_old != @actor.hp
- end
- refresh_number(0,@hp_number_old,@hp_number,@hp_number_image,@hp_number_cw,@hp_number_ch,@hp_wave_number) if @hp_number_refresh
- fade_sprite(@hp_number,@fade_hud)
- end
- if @hp_number2 != nil
- if HP_NUMBER_ANIMATION
- update_number(3,@hp_number2_old)
- else
- update_number_fix(3) if @hp_number2_old != @actor.mhp
- end
- refresh_number(3,@hp_number2_old,@hp_number2,@hp_number2_image,@hp_number2_cw,@hp_number2_ch,@hp_wave_number) if @hp_number2_refresh
- fade_sprite(@hp_number2,@fade_hud)
- end
- if @hp_meter != nil
- update_flow_hp
- fade_sprite(@hp_meter,@fade_hud)
- end
- if @hp_icon != nil
- refresh_hp_icon if @hp_icon_old != @actor.hp
- fade_sprite(@hp_icon,@fade_hud)
- end
- if @hp_icon3 != nil
- update_icon_hp_ex_anime
- fade_sprite(@hp_icon3,@fade_hud)
- end
- if @hp_icon_number != nil
- refresh_icon_number_hp if can_refresh_icon_number_hp?
- fade_sprite(@hp_icon_number,@fade_hud)
- end
- end
- end
- #==============================================================================
- #==============================================================================
- # ** Ultima Hud (MP)
- #==============================================================================
- #==============================================================================
- class Ultima_Hud
- #--------------------------------------------------------------------------
- # * Create MP Number
- #--------------------------------------------------------------------------
- def create_mp_number
- return if !MP_NUMBER_VISIBLE
- @mp_number = Sprite.new
- @mp_number.bitmap = Bitmap.new(@mp_number_cw * 4, @mp_number_ch)
- @mp_number.z = HUD_Z + MP_NUMBER_Z
- @mp_number.x = $game_system.hud_position[0] + MP_NUMBER_POSITION[0]
- @mp_number.y = $game_system.hud_position[1] + MP_NUMBER_POSITION[1]
- @mp_number.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Create MP Number Max
- #--------------------------------------------------------------------------
- def create_mp_number_max
- return if !MP_NUMBER_MAX_VISIBLE
- @mp_number2 = Sprite.new
- @mp_number2.bitmap = Bitmap.new(@mp_number2_cw * 4, @mp_number2_ch)
- @mp_number2.z = HUD_Z + MP_NUMBER_Z
- @mp_number2.x = $game_system.hud_position[0] + MP_NUMBER_MAX_POSITION[0]
- @mp_number2.y = $game_system.hud_position[1] + MP_NUMBER_MAX_POSITION[1]
- @mp_number2.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Create MP Meter
- #--------------------------------------------------------------------------
- def create_mp_meter
- return if !MP_METER_VISIBLE
- @mp_flow_max = @mp_meter_cw * 2
- @mp_flow = rand(@mp_flow_max)
- @mp_meter = Sprite.new
- @mp_meter.bitmap = Bitmap.new(@mp_meter_cw,@mp_meter_ch)
- @mp_meter.z = HUD_Z + MP_METER_Z
- @mp_meter.x = $game_system.hud_position[0] + MP_METER_POSITION[0]
- @mp_meter.y = $game_system.hud_position[1] + MP_METER_POSITION[1]
- @mp_meter.angle = MP_METER_ANGLE
- @mp_meter.mirror = MP_METER_MIRROR_EFFECT
- @mp_meter.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # â Update Flow MP
- #--------------------------------------------------------------------------
- def update_flow_mp
- @mp_meter.bitmap.clear
- @mp_flow = 0 if !MP_METER_GRADIENT_ANIMATION
- meter_width = @mp_meter_cw * @actor.mp / @actor.mmp rescue nil
- meter_width = 0 if meter_width == nil
- execute_mp_damage_flow(meter_width)
- meter_src_rect = Rect.new(@mp_flow, 0,meter_width, @mp_meter_ch)
- @mp_meter.bitmap.blt(0,0, @mp_meter_image, meter_src_rect)
- @mp_flow += 5
- @mp_flow = 0 if @mp_flow >= @mp_flow_max
- end
- #--------------------------------------------------------------------------
- # â Execute MP Damage Flow
- #--------------------------------------------------------------------------
- def execute_mp_damage_flow(meter_width)
- return if !MP_METER_REDUCTION_ANIMATION
- return if @mp_old_meter == meter_width
- n = (@mp_old_meter - meter_width).abs * 3 / 100
- damage_flow = [[n, 2].min,0.5].max
- @mp_old_meter -= damage_flow
- @mp_old_meter = meter_width if @mp_old_meter <= meter_width
- src_rect_old = Rect.new(0,@mp_meter_ch, @mp_old_meter, @mp_meter_ch)
- @mp_meter.bitmap.blt(0,0, @mp_meter_image, src_rect_old)
- end
- #--------------------------------------------------------------------------
- # * Create MP Icon
- #--------------------------------------------------------------------------
- def create_mp_icon
- return if !MP_ICON_VISIBLE
- @mp_icon = Sprite.new
- icon_width = @mp_icon_col_max * (@mp_icon_cw + MP_ICON_SPACE[0].abs)
- icon_height = @mp_icon_row_max * (@mp_icon_ch + MP_ICON_SPACE[1].abs)
- @mp_icon.bitmap = Bitmap.new(icon_width,icon_height)
- @mp_icon.z = HUD_Z + MP_ICON_Z
- @mp_icon.x = $game_system.hud_position[0] + MP_ICON_POSITION[0]
- @mp_icon.y = $game_system.hud_position[1] + MP_ICON_POSITION[1]
- @mp_icon.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Refresh MP Icon
- #--------------------------------------------------------------------------
- def refresh_mp_icon
- @mp_icon_old = @actor.mp
- @mp_icon.bitmap.clear
- max_value = (@actor.mmp / @mp_icon_real_max) * @mp_icon_real_max
- if @actor.mp > max_value
- icon_max = icon_limit(@actor.mmp,@mp_icon_real_max)
- else
- icon_max = @actor.mmp
- end
- for i in 0...icon_max
- break if (i / @mp_icon_col_max) >= @mp_icon_row_max
- rx = (i * (@mp_icon_cw + MP_ICON_SPACE[0]) ) - ((i / @mp_icon_col_max) * (@mp_icon_cw + MP_ICON_SPACE[0]) * @mp_icon_col_max)
- ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
- i_scr = Rect.new(0,0,@mp_icon_cw,@mp_icon_ch)
- @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
- end
- icon_max = icon_limit(@actor.mp,@mp_icon_real_max)
- rx = 0
- ry = 0
- for i in 0...icon_max
- break if (i / @mp_icon_col_max) >= @mp_icon_row_max
- rx = (i * (@mp_icon_cw + MP_ICON_SPACE[0]) ) - ((i / @mp_icon_col_max) * (@mp_icon_cw + MP_ICON_SPACE[0]) * @mp_icon_col_max)
- ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
- i_scr = Rect.new(@mp_icon_cw,0,@mp_icon_cw,@mp_icon_ch)
- @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
- end
- refresh_mp_icon_ex(rx,ry)
- end
- #--------------------------------------------------------------------------
- # * Create MP Icon EX
- #--------------------------------------------------------------------------
- def create_mp_icon_ex
- return if !MP_ICON_EX_VISIBLE
- @mp_icon3_anime_phase = 0
- @mp_icon3 = Sprite.new
- @mp_icon3.bitmap = Bitmap.new(@mp_icon2_cw,@mp_icon2_ch)
- @mp_icon3.ox = @mp_icon3.bitmap.width / 2
- @mp_icon3.oy = @mp_icon3.bitmap.height / 2
- @mp_icon3.z = HUD_Z + MP_ICON_Z + 2
- @mp_icon3_org = [$game_system.hud_position[0] + MP_ICON_POSITION[0] + MP_ICON_EX_POSITION[0] + @mp_icon3.ox,
- $game_system.hud_position[1] + MP_ICON_POSITION[1] + MP_ICON_EX_POSITION[1] + @mp_icon3.oy]
- @mp_icon3.x = @mp_icon3_org[0]
- @mp_icon3.y = @mp_icon3_org[1]
- @mp_icon3.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Refresh MP Icon EX
- #--------------------------------------------------------------------------
- def refresh_mp_icon_ex(rx,ry)
- return if @mp_icon3 == nil
- @mp_icon3.bitmap.clear
- return if @actor.mp == 0
- i_scr = Rect.new(0,0,@mp_icon2_cw,@mp_icon2_ch)
- @mp_icon3.bitmap.blt(0,0, @mp_icon2_image ,i_scr )
- @mp_icon3.x = @mp_icon3_org[0] + rx
- @mp_icon3.y = @mp_icon3_org[1] + ry
- end
- #--------------------------------------------------------------------------
- # * Update Icon MP EX Anime
- #--------------------------------------------------------------------------
- def update_icon_mp_ex_anime
- return if !MP_ICON_EX_ZOOM_EFFECT
- if @mp_icon3_anime_phase == 0
- @mp_icon3.zoom_x += 0.01
- if @mp_icon3.zoom_x >= 1.30
- @mp_icon3.zoom_x = 1.30
- @mp_icon3_anime_phase = 1
- end
- else
- @mp_icon3.zoom_x -= 0.01
- if @mp_icon3.zoom_x <= 1.05
- @mp_icon3.zoom_x = 1.05
- @mp_icon3_anime_phase = 0
- end
- end
- @mp_icon3.zoom_y = @mp_icon3.zoom_x
- end
- #--------------------------------------------------------------------------
- # * Create MP Icon Number
- #--------------------------------------------------------------------------
- def create_mp_icon_number
- return if !MP_ICON_NUMBER_VISIBLE
- @mp_icon_number_old = [-1,-1]
- @mp_icon_number = Sprite.new
- @mp_icon_number.bitmap = Bitmap.new(@mp_icon_number_cw * 4,@mp_icon_number_ch)
- @mp_icon_number.z = HUD_Z + MP_ICON_NUMBER_Z
- @mp_icon_number.x = $game_system.hud_position[0] + MP_ICON_NUMBER_POSITION[0]
- @mp_icon_number.y = $game_system.hud_position[1] + MP_ICON_NUMBER_POSITION[1]
- @mp_icon_number.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Refresh Icon Number MP
- #--------------------------------------------------------------------------
- def refresh_icon_number_mp
- @mp_icon_number_old[0] = @actor.mp
- @mp_icon_number_old[1] = @actor.mmp
- @mp_icon_number.bitmap.clear
- value = ((@actor.mp - 1) / @mp_icon_col_max) / @mp_icon_row_max
- value = 0 if value < 0
- number_value = value.truncate.abs.to_s.split(//)
- for r in 0..number_value.size - 1
- number_value_abs = number_value[r].to_i
- nsrc_rect = Rect.new(@mp_icon_number_cw * number_value_abs, 0, @mp_icon_number_cw, @mp_icon_number_ch)
- @mp_icon_number.bitmap.blt(@mp_icon_number_cw * r, 0, @mp_icon_number_image, nsrc_rect)
- end
- cx = (number_value.size * @mp_icon_number_cw)
- case MP_ICON_NUMBER_ALIGN_TYPE
- when 0; @mp_icon_number.x = $game_system.hud_position[0] + MP_ICON_NUMBER_POSITION[0]
- when 1; @mp_icon_number.x = $game_system.hud_position[0] + MP_ICON_NUMBER_POSITION[0] - (cx / 2)
- when 2; @mp_icon_number.x = $game_system.hud_position[0] + MP_ICON_NUMBER_POSITION[0] - cx
- end
- end
- #--------------------------------------------------------------------------
- # * Can Refresh Icon Number MP
- #--------------------------------------------------------------------------
- def can_refresh_icon_number_mp?
- return true if @mp_icon_number_old[0] != @actor.mp
- return true if @mp_icon_number_old[1] != @actor.mmp
- return false
- end
- #--------------------------------------------------------------------------
- # * Update MP
- #--------------------------------------------------------------------------
- def update_mp
- if @mp_number != nil
- if MP_NUMBER_ANIMATION
- update_number(1,@mp_number_old)
- else
- update_number_fix(1) if @mp_number_old != @actor.mp
- end
- refresh_number(1,@mp_number_old,@mp_number,@mp_number_image,@mp_number_cw,@mp_number_ch,@mp_wave_number) if @mp_number_refresh
- fade_sprite(@mp_number,@fade_hud)
- end
- if @mp_number2 != nil
- if MP_NUMBER_ANIMATION
- update_number(4,@mp_number2_old)
- else
- update_number_fix(4) if @mp_number2_old != @actor.mmp
- end
- refresh_number(4,@mp_number2_old,@mp_number2,@mp_number2_image,@mp_number2_cw,@mp_number2_ch,@mp_wave_number) if @mp_number2_refresh
- fade_sprite(@mp_number2,@fade_hud)
- end
- if @mp_meter != nil
- update_flow_mp
- fade_sprite(@mp_meter,@fade_hud)
- end
- if @mp_icon != nil
- refresh_mp_icon if @mp_icon_old != @actor.mp
- fade_sprite(@mp_icon,@fade_hud)
- end
- if @mp_icon3 != nil
- update_icon_mp_ex_anime
- fade_sprite(@mp_icon3,@fade_hud)
- end
- if @mp_icon_number != nil
- refresh_icon_number_mp if can_refresh_icon_number_mp?
- fade_sprite(@mp_icon_number,@fade_hud)
- end
- end
- end
- #==============================================================================
- #==============================================================================
- # ** Ultima Hud (TP)
- #==============================================================================
- #==============================================================================
- class Ultima_Hud
- #--------------------------------------------------------------------------
- # * Create TP Number
- #--------------------------------------------------------------------------
- def create_tp_number
- return if !TP_NUMBER_VISIBLE
- @tp_number = Sprite.new
- @tp_number.bitmap = Bitmap.new(@tp_number_cw * 3, @tp_number_ch)
- @tp_number.z = HUD_Z + TP_NUMBER_Z
- @tp_number.x = $game_system.hud_position[0] + TP_NUMBER_POSITION[0]
- @tp_number.y = $game_system.hud_position[1]+ TP_NUMBER_POSITION[1]
- @tp_number.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Create TP Number MAX
- #--------------------------------------------------------------------------
- def create_tp_number_max
- return if !TP_NUMBER_MAX_VISIBLE
- @tp_number2 = Sprite.new
- @tp_number2.bitmap = Bitmap.new(@tp_number2_cw * 3, @tp_number2_ch)
- @tp_number2.z = HUD_Z + TP_NUMBER_Z
- @tp_number2.x = $game_system.hud_position[0] + TP_NUMBER_MAX_POSITION[0]
- @tp_number2.y = $game_system.hud_position[1] + TP_NUMBER_MAX_POSITION[1]
- @tp_number2.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Create TP Meter
- #--------------------------------------------------------------------------
- def create_tp_meter
- return if !TP_METER_VISIBLE
- @tp_flow_max = @tp_meter_cw * 2
- @tp_flow = rand(@tp_flow_max)
- @tp_meter = Sprite.new
- @tp_meter.bitmap = Bitmap.new(@tp_meter_cw,@tp_meter_ch)
- @tp_meter.z = HUD_Z + TP_METER_Z
- @tp_meter.x = $game_system.hud_position[0] + TP_METER_POSITION[0]
- @tp_meter.y = $game_system.hud_position[1] + TP_METER_POSITION[1]
- @tp_meter.angle = TP_METER_ANGLE
- @tp_meter.mirror = TP_METER_MIRROR_EFFECT
- @tp_meter.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # â Update Flow TP
- #--------------------------------------------------------------------------
- def update_flow_tp
- @tp_meter.bitmap.clear
- @tp_flow = 0 if !TP_METER_GRADIENT_ANIMATION
- meter_width = @tp_meter_cw * @actor.tp / @actor.max_tp rescue nil
- meter_width = 0 if meter_width == nil
- execute_tp_damage_flow(meter_width)
- meter_src_rect = Rect.new(@tp_flow, 0,meter_width, @tp_meter_ch)
- @tp_meter.bitmap.blt(0,0, @tp_meter_image, meter_src_rect)
- @tp_flow += 5
- @tp_flow = 0 if @tp_flow >= @tp_flow_max
- end
- #--------------------------------------------------------------------------
- # â Execute TP Damage Flow
- #--------------------------------------------------------------------------
- def execute_tp_damage_flow(meter_width)
- return if !TP_METER_REDUCTION_ANIMATION
- return if @tp_old_meter == meter_width
- n = (@tp_old_meter - meter_width).abs * 3 / 100
- damage_flow = [[n, 2].min,0.5].max
- @tp_old_meter -= damage_flow
- @tp_old_meter = meter_width if @tp_old_meter <= meter_width
- src_rect_old = Rect.new(0,@tp_meter_ch, @tp_old_meter, @tp_meter_ch)
- @tp_meter.bitmap.blt(0,0, @tp_meter_image, src_rect_old)
- end
- #--------------------------------------------------------------------------
- # * Create TP Icon
- #--------------------------------------------------------------------------
- def create_tp_icon
- return if !TP_ICON_VISIBLE
- @tp_icon = Sprite.new
- icon_width = @tp_icon_col_max * (@tp_icon_cw + TP_ICON_SPACE[0].abs)
- icon_height = @tp_icon_row_max * (@tp_icon_ch + TP_ICON_SPACE[1].abs)
- @tp_icon.bitmap = Bitmap.new(icon_width,icon_height)
- @tp_icon.z = HUD_Z + TP_ICON_Z
- @tp_icon.x = $game_system.hud_position[0] + TP_ICON_POSITION[0]
- @tp_icon.y = $game_system.hud_position[1] + TP_ICON_POSITION[1]
- @tp_icon.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Refresh TP Icon
- #--------------------------------------------------------------------------
- def refresh_tp_icon
- @tp_icon_old = @actor.tp
- @tp_icon.bitmap.clear
- max_value = (@actor.max_tp / @tp_icon_real_max) * @tp_icon_real_max
- if @actor.mp > max_value
- icon_max = icon_limit(@actor.max_tp,@tp_icon_real_max)
- else
- icon_max = @actor.max_tp
- end
- for i in 0...icon_max
- break if (i / @tp_icon_col_max) >= @tp_icon_row_max
- rx = (i * (@tp_icon_cw + TP_ICON_SPACE[0]) ) - ((i / @tp_icon_col_max) * (@tp_icon_cw + TP_ICON_SPACE[0]) * @tp_icon_col_max)
- ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
- i_scr = Rect.new(0,0,@tp_icon_cw,@tp_icon_ch)
- @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
- end
- icon_max = icon_limit(@actor.tp,@tp_icon_real_max)
- rx = 0
- ry = 0
- for i in 0...icon_max
- break if (i / @tp_icon_col_max) >= @tp_icon_row_max
- rx = (i * (@tp_icon_cw + TP_ICON_SPACE[0]) ) - ((i / @tp_icon_col_max) * (@tp_icon_cw + TP_ICON_SPACE[0]) * @tp_icon_col_max)
- ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
- i_scr = Rect.new(@mp_icon_cw,0,@tp_icon_cw,@tp_icon_ch)
- @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
- end
- refresh_tp_icon_ex(rx,ry)
- end
- #--------------------------------------------------------------------------
- # * Create TP Icon EX
- #--------------------------------------------------------------------------
- def create_tp_icon_ex
- return if !TP_ICON_EX_VISIBLE
- @tp_icon3_anime_phase = 0
- @tp_icon3 = Sprite.new
- @tp_icon3.bitmap = Bitmap.new(@tp_icon2_cw,@tp_icon2_ch)
- @tp_icon3.ox = @tp_icon3.bitmap.width / 2
- @tp_icon3.oy = @tp_icon3.bitmap.height / 2
- @tp_icon3.z = HUD_Z + TP_ICON_Z + 2
- @tp_icon3_org = [$game_system.hud_position[0] + TP_ICON_POSITION[0] + TP_ICON_EX_POSITION[0] + @tp_icon3.ox,
- $game_system.hud_position[1] + TP_ICON_POSITION[1] + TP_ICON_EX_POSITION[1] + @tp_icon3.oy]
- @tp_icon3.x = @tp_icon3_org[0]
- @tp_icon3.y = @tp_icon3_org[1]
- @tp_icon3.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Refresh TP Icon EX
- #--------------------------------------------------------------------------
- def refresh_tp_icon_ex(rx,ry)
- return if @tp_icon3 == nil
- @tp_icon3.bitmap.clear
- return if @actor.tp == 0
- i_scr = Rect.new(0,0,@tp_icon2_cw,@tp_icon2_ch)
- @tp_icon3.bitmap.blt(0,0, @tp_icon2_image ,i_scr )
- @tp_icon3.x = @tp_icon3_org[0] + rx
- @tp_icon3.y = @tp_icon3_org[1] + ry
- end
- #--------------------------------------------------------------------------
- # * Update Icon TP EX Anime
- #--------------------------------------------------------------------------
- def update_icon_tp_ex_anime
- return if !MP_ICON_EX_ZOOM_EFFECT
- if @tp_icon3_anime_phase == 0
- @tp_icon3.zoom_x += 0.01
- if @tp_icon3.zoom_x >= 1.30
- @tp_icon3.zoom_x = 1.30
- @tp_icon3_anime_phase = 1
- end
- else
- @tp_icon3.zoom_x -= 0.01
- if @tp_icon3.zoom_x <= 1.05
- @tp_icon3.zoom_x = 1.05
- @tp_icon3_anime_phase = 0
- end
- end
- @tp_icon3.zoom_y = @tp_icon3.zoom_x
- end
- #--------------------------------------------------------------------------
- # * Create HP Icon Number
- #--------------------------------------------------------------------------
- def create_tp_icon_number
- return if !TP_ICON_NUMBER_VISIBLE
- @tp_icon_number_old = [-1,-1]
- @tp_icon_number = Sprite.new
- @tp_icon_number.bitmap = Bitmap.new(@tp_icon_number_cw * 3,@tp_icon_number_ch)
- @tp_icon_number.z = HUD_Z + TP_ICON_NUMBER_Z
- @tp_icon_number.x = $game_system.hud_position[0] + TP_ICON_NUMBER_POSITION[0]
- @tp_icon_number.y = $game_system.hud_position[1] + TP_ICON_NUMBER_POSITION[1]
- @tp_icon_number.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Refresh Icon Number TP
- #--------------------------------------------------------------------------
- def refresh_icon_number_tp
- @tp_icon_number_old[0] = @actor.tp
- @tp_icon_number_old[1] = @actor.max_tp
- @tp_icon_number.bitmap.clear
- value = ((@actor.tp - 1) / @tp_icon_col_max) / @tp_icon_row_max
- value = 0 if value < 0
- number_value = value.truncate.abs.to_s.split(//)
- for r in 0..number_value.size - 1
- number_value_abs = number_value[r].to_i
- nsrc_rect = Rect.new(@tp_icon_number_cw * number_value_abs, 0, @tp_icon_number_cw, @tp_icon_number_ch)
- @tp_icon_number.bitmap.blt(@tp_icon_number_cw * r, 0, @tp_icon_number_image, nsrc_rect)
- end
- cx = (number_value.size * @tp_icon_number_cw)
- case TP_ICON_NUMBER_ALIGN_TYPE
- when 0; @tp_icon_number.x = $game_system.hud_position[0] + TP_ICON_NUMBER_POSITION[0]
- when 1; @tp_icon_number.x = $game_system.hud_position[0] + TP_ICON_NUMBER_POSITION[0] - (cx / 2)
- when 2; @tp_icon_number.x = $game_system.hud_position[0] + TP_ICON_NUMBER_POSITION[0] - cx
- end
- end
- #--------------------------------------------------------------------------
- # * Can Refresh Icon Number TP
- #--------------------------------------------------------------------------
- def can_refresh_icon_number_tp?
- return true if @tp_icon_number_old[0] != @actor.tp
- return true if @tp_icon_number_old[1] != @actor.max_tp
- return false
- end
- #--------------------------------------------------------------------------
- # * Update TP
- #--------------------------------------------------------------------------
- def update_tp
- if @tp_number != nil
- if MP_NUMBER_ANIMATION
- update_number(2,@tp_number_old)
- else
- update_number_fix(2) if @tp_number_old != @actor.tp
- end
- refresh_number(2,@tp_number_old,@tp_number,@tp_number_image,@tp_number_cw,@tp_number_ch,@tp_wave_number) if @tp_number_refresh
- fade_sprite(@tp_number,@fade_hud)
- end
- if @tp_number2 != nil
- if MP_NUMBER_ANIMATION
- update_number(5,@tp_number2_old)
- else
- update_number_fix(5) if @tp_number2_old != @actor.max_tp
- end
- refresh_number(5,@tp_number2_old,@tp_number2,@tp_number2_image,@tp_number2_cw,@tp_number2_ch,@tp_wave_number) if @tp_number2_refresh
- fade_sprite(@tp_number2,@fade_hud)
- end
- if @tp_meter != nil
- update_flow_tp
- fade_sprite(@tp_meter,@fade_hud)
- end
- if @tp_icon != nil
- refresh_tp_icon if @tp_icon_old != @actor.tp
- fade_sprite(@tp_icon,@fade_hud)
- end
- if @tp_icon3 != nil
- update_icon_tp_ex_anime
- fade_sprite(@tp_icon3,@fade_hud)
- end
- if @tp_icon_number != nil
- refresh_icon_number_tp if can_refresh_icon_number_tp?
- fade_sprite(@tp_icon_number,@fade_hud)
- end
- end
- end
- #==============================================================================
- #==============================================================================
- # ** Ultima Hud (LEVEL)
- #==============================================================================
- #==============================================================================
- class Ultima_Hud
- #--------------------------------------------------------------------------
- # * Create Level Number
- #--------------------------------------------------------------------------
- def create_level_number
- return if !LEVEL_NUMBER_VISIBLE
- @old_level = -1
- @lv_number = Sprite.new
- @lv_number.bitmap = Bitmap.new(@lv_number_cw * 2, @lv_number_ch)
- @lv_number.z = HUD_Z + LEVEL_NUMBER_Z
- @lv_number.x = $game_system.hud_position[0] + LEVEL_NUMBER_POSITION[0]
- @lv_number.y = $game_system.hud_position[1] + LEVEL_NUMBER_POSITION[1]
- @lv_number.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Create Level Number EXP
- #--------------------------------------------------------------------------
- def create_level_number_exp
- return if !LEVEL_NUMBER_EXP_VISIBLE
- @old_exp = -1
- @lv_number2 = Sprite.new
- @lv_number2.bitmap = Bitmap.new(@lv_number2_cw * 7, @lv_number2_ch)
- @lv_number2.z = HUD_Z + LEVEL_NUMBER_Z
- @lv_number2.x = $game_system.hud_position[0] + LEVEL_NUMBER_EXP_POSITION[0]
- @lv_number2.y = $game_system.hud_position[1] + LEVEL_NUMBER_EXP_POSITION[1]
- @lv_number2.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Create Level Meter
- #--------------------------------------------------------------------------
- def create_level_meter
- return if !LEVEL_METER_VISIBLE
- @old_exp_meter = -1
- @lv_meter = Sprite.new
- @lv_meter.bitmap = Bitmap.new(@lv_meter_cw,@lv_meter_ch)
- @lv_meter.z = HUD_Z + LEVEL_METER_Z
- @lv_meter.x = $game_system.hud_position[0] + LEVEL_METER_POSITION[0]
- @lv_meter.y = $game_system.hud_position[1] + LEVEL_METER_POSITION[1]
- @lv_meter.angle = LEVEL_METER_ANGLE
- @lv_meter.mirror = LEVEL_METER_MIRROR_EFFECT
- @lv_meter.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Refresh Level Number
- #--------------------------------------------------------------------------
- def refresh_level_number
- @lv_number.bitmap.clear
- @old_level = @actor.level
- number_value = @actor.level.abs.to_s.split(//)
- for r in 0..number_value.size - 1
- number_value_abs = number_value[r].to_i
- nsrc_rect = Rect.new(@lv_number_cw * number_value_abs, 0, @lv_number_cw, @lv_number_ch)
- @lv_number.bitmap.blt(@lv_number_cw * r, 0, @lv_number_image, nsrc_rect)
- end
- cx = (number_value.size * @lv_number_cw)
- case LEVEL_NUMBER_ALIGN_TYPE
- when 0; @lv_number.x = $game_system.hud_position[0] + LEVEL_NUMBER_POSITION[0]
- when 1; @lv_number.x = $game_system.hud_position[0] + LEVEL_NUMBER_POSITION[0] - (cx / 2)
- when 2; @lv_number.x = $game_system.hud_position[0] + LEVEL_NUMBER_POSITION[0] - cx
- end
- end
- #--------------------------------------------------------------------------
- # * Refresh Level Number EXP
- #--------------------------------------------------------------------------
- def refresh_level_number_exp
- @lv_number2.bitmap.clear
- @old_exp = @actor.exp
- if LEVEL_NUMBER_EXP_TYPE == 0
- value = @actor.next_level_exp - @actor.exp
- value = 0 if @actor.max_level?
- else
- value = @actor.exp
- end
- value = 9999999 if value > 9999999
- number_value = value.abs.to_s.split(//)
- for r in 0..number_value.size - 1
- number_value_abs = number_value[r].to_i
- nsrc_rect = Rect.new(@lv_number2_cw * number_value_abs, 0, @lv_number2_cw, @lv_number2_ch)
- @lv_number2.bitmap.blt(@lv_number2_cw * r, 0, @lv_number2_image, nsrc_rect)
- end
- cx = (number_value.size * @lv_number2_cw)
- case LEVEL_NUMBER_EXP_ALIGN_TYPE
- when 0; @lv_number2.x = $game_system.hud_position[0] + LEVEL_NUMBER_EXP_POSITION[0]
- when 1; @lv_number2.x = $game_system.hud_position[0] + LEVEL_NUMBER_EXP_POSITION[0] - (cx / 2)
- when 2; @lv_number2.x = $game_system.hud_position[0] + LEVEL_NUMBER_EXP_POSITION[0] - cx
- end
- end
- #--------------------------------------------------------------------------
- # * Refresh Level Meter
- #--------------------------------------------------------------------------
- def refresh_level_meter
- @lv_meter.bitmap.clear
- @old_exp_meter = @actor.exp
- new_level = 0
- lv_width = @lv_meter_cw * @actor.remain_exp / @actor.real_next_level rescue nil
- lv_width = @lv_meter_cw if lv_width == nil or @actor.level == 99
- lv_scr = Rect.new(0,0,lv_width,@lv_meter_ch)
- @lv_meter.bitmap.blt(0,0,@lv_meter_image,lv_scr)
- end
- #--------------------------------------------------------------------------
- # * Update Level
- #--------------------------------------------------------------------------
- def update_level
- if @lv_number != nil
- refresh_level_number if @old_level != @actor.level
- fade_sprite(@lv_number,@fade_hud)
- end
- if @lv_number2 != nil
- refresh_level_number_exp if @old_exp != @actor.exp
- fade_sprite(@lv_number2,@fade_hud)
- end
- if @lv_meter != nil
- refresh_level_meter if @old_exp_meter != @actor.exp
- fade_sprite(@lv_meter,@fade_hud)
- end
- end
- end
- #==============================================================================
- #==============================================================================
- # ** Ultima Hud (STATES)
- #==============================================================================
- #==============================================================================
- class Ultima_Hud
- #--------------------------------------------------------------------------
- # * Create States
- #--------------------------------------------------------------------------
- def create_states
- return if !STATES_VISIBLE
- @status_old = nil
- @status_flow = [-24,0]
- @status = Sprite.new
- @status.bitmap = Bitmap.new(24,24)
- @status.x = $game_system.hud_position[0] + STATES_POSITION[0]
- @status.y = $game_system.hud_position[1] + STATES_POSITION[1]
- @status.z = HUD_Z + STATES_Z
- @status.angle = STATE_ANGLE
- @status.opacity = 0 if !$game_system.hud_visible
- end
- #--------------------------------------------------------------------------
- # * Refresh States
- #--------------------------------------------------------------------------
- def refresh_states
- check_icon_image
- @status_old = @actor.states
- @status_flow = [0,0]
- @actor_status.dispose if @actor_status != nil
- @states_size = @actor.states.size > 0 ? (26 * @actor.states.size) : 24
- @actor_status = Bitmap.new(@states_size,24)
- index = 0
- for i in @actor.states
- rect = Rect.new(i.icon_index % 16 * 24, i.icon_index / 16 * 24, 24, 24)
- @actor_status.blt(26 * index , 0, @icon_image, rect)
- index += 1
- end
- end
- #--------------------------------------------------------------------------
- # * Flow_Status
- #--------------------------------------------------------------------------
- def flow_states
- return if @actor_status == nil
- @status.bitmap.clear
- return if @actor.states.size == 0
- st_src_rect = Rect.new(@status_flow[0],0, 24,24)
- @status.bitmap.blt(0,0, @actor_status, st_src_rect)
- if STATES_SCROLLING_ANIMATION
- @status_flow[0] += 1
- @status_flow[0] = -24 if @status_flow[0] >= @states_size + 2
- else
- @status_flow[1] += 1 unless @actor.states.size <= 1
- if @status_flow[1] > 30
- @status_flow[1] = 0
- @status_flow[0] += 26
- @status_flow[0] = 0 if @status_flow[0] >= (@states_size - 0)
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Update States
- #--------------------------------------------------------------------------
- def update_states
- return if @status == nil
- refresh_states if @status_old != @actor.states
- flow_states
- fade_sprite(@status,@fade_hud)
- end
- end
- #==============================================================================
- #==============================================================================
- # ** Ultima Hud (FACE)
- #==============================================================================
- #==============================================================================
- class Ultima_Hud
- #--------------------------------------------------------------------------
- # * Create Face
- #--------------------------------------------------------------------------
- def create_face
- return if !FACE_VISIBLE
- @face_old_hp = @actor.hp
- @face_old_mp = @actor.mp
- @face_old_tp = @actor.tp
- @face_name = ""
- @face = Sprite.new
- @face_org = [$game_system.hud_position[0] + FACE_POSITION[0], $game_system.hud_position[1] + FACE_POSITION[1]]
- @face.x = @face_org[0]
- @face.y = @face_org[1]
- @face.z = HUD_Z + FACE_Z
- @face.opacity = 0 if !$game_system.hud_visible
- refresh_face_name
- end
- #--------------------------------------------------------------------------
- # * Refresh Face Name
- #--------------------------------------------------------------------------
- def refresh_face_name
- @face_name = @actor.name
- @face_image.dispose if @face_image != nil
- @face.bitmap.dispose if @face.bitmap != nil
- return if @actor.name == nil or @actor.name == ""
- @face_image = Cache.ultima_hud(@actor.name + "_Face") rescue nil
- @face_image = Bitmap.new(32,32) if @face_image == nil
- @face_cw = FACE_ANIMATION ? @face_image.width / 4 : @face_image.width
- @face_ch = @face_image.height
- @face.bitmap = Bitmap.new(@face_cw,@face_ch)
- refresh_face
- end
- #--------------------------------------------------------------------------
- # * Refresh Face
- #--------------------------------------------------------------------------
- def refresh_face
- @face_index = $game_system.hud_face[1]
- @face.bitmap.clear
- f_scr = Rect.new(@face_index * @face_cw,0,@face_cw,@face_ch)
- @face.bitmap.blt(0,0,@face_image,f_scr)
- end
- #--------------------------------------------------------------------------
- # * Update Face Duration
- #--------------------------------------------------------------------------
- def update_face_duration
- return if $game_system.hud_face[0] == 0
- $game_system.hud_face[0] -= 1
- return if $game_system.hud_face[0] > 0
- $game_system.hud_face[1] = @actor.low_hp? ? 2 : 0
- refresh_face
- end
- #--------------------------------------------------------------------------
- # * Can Refresh Index MP TP?
- #--------------------------------------------------------------------------
- def can_refresh_index_mp_tp?
- return true if @face_old_mp != @actor.mp
- return true if @face_old_tp != @actor.tp
- return false
- end
- #--------------------------------------------------------------------------
- # * Refresh Face Index HP
- #--------------------------------------------------------------------------
- def refresh_face_index_hp
- $game_system.hud_face[0] = FACE_ANIMATION_DURATION
- $game_system.hud_face[1] = @face_old_hp > @actor.hp ? 2 : 1
- @face_old_hp = @actor.hp
- end
- #--------------------------------------------------------------------------
- # * Refresh Face Index MP TP
- #--------------------------------------------------------------------------
- def refresh_face_index_mp_tp
- $game_system.hud_face[0] = FACE_ANIMATION_DURATION
- $game_system.hud_face[1] = @face_old_mp > @actor.mp ? 3 : 1
- $game_system.hud_face[1] = 3 if @face_old_tp > @actor.tp
- @face_old_mp = @actor.mp
- @face_old_tp = @actor.tp
- end
- #--------------------------------------------------------------------------
- # * Update Face Shake Effect
- #--------------------------------------------------------------------------
- def update_face_shake_effect
- return if !FACE_SHAKE_EFFECT
- if FACE_ANIMATION
- update_shake_animated_face
- else
- update_shake_still_face
- end
- end
- #--------------------------------------------------------------------------
- # * Update Shake Still Effect Face
- #--------------------------------------------------------------------------
- def update_shake_still_face
- if $game_system.hud_face[0] > 0 and $game_system.hud_face[1] == 2 and @actor.hp > 0
- $game_system.hud_face[0] -= 1
- @face.x = @face_org[0] - 4 + rand(8)
- else
- @face.x = @face_org[0]
- end
- end
- #--------------------------------------------------------------------------
- # * Update Shake Animated Face
- #--------------------------------------------------------------------------
- def update_shake_animated_face
- if $game_system.hud_face[0] == 0
- @face.x = @face_org[0]
- return
- end
- if $game_system.hud_face[1] == 2 and @actor.hp > 0
- @face.x = @face_org[0] - 4 + rand(8)
- else
- @face.x = @face_org[0]
- end
- end
- #--------------------------------------------------------------------------
- # * Update Face
- #--------------------------------------------------------------------------
- def update_face
- return if @face == nil
- fade_sprite(@face,@fade_hud)
- refresh_face_index_hp if !FACE_ANIMATION and @face_old_hp != @actor.hp
- update_face_shake_effect
- return if !FACE_ANIMATION
- update_face_duration
- refresh_face_index_mp_tp if can_refresh_index_mp_tp?
- refresh_face_index_hp if @face_old_hp != @actor.hp
- refresh_face if @face_index != $game_system.hud_face[1]
- end
- end
- #==============================================================================
- #==============================================================================
- # ** Ultima Hud (STATES)
- #==============================================================================
- #==============================================================================
- class Ultima_Hud
- #--------------------------------------------------------------------------
- # * Create Equipment
- #--------------------------------------------------------------------------
- def create_equipment
- return if !EQUIPMENT_VISIBLE
- return if @equip_layout != nil
- create_equipment_layout
- create_equipment_icons
- end
- #--------------------------------------------------------------------------
- # * Create Equipment Layout
- #--------------------------------------------------------------------------
- def create_equipment_layout
- @equip_layout = Sprite.new
- @equip_layout.bitmap = Cache.ultima_hud("Equip_Layout")
- @equip_layout.z = HUD_Z + EQUIPMENT_Z
- @equip_layout.x = EQUIPMENT_POSITION[0]
- @equip_layout.y = EQUIPMENT_POSITION[1]
- @equip_smart_fade = EQUIPMENT_DETACHED_SMART_FADE
- @equip_hud_size_x = [EQUIPMENT_POSITION[0] + EQUIPMENT_SMART_FADE_RANGE_X[0], EQUIPMENT_POSITION[0] + @equip_layout.bitmap.width + EQUIPMENT_SMART_FADE_RANGE_X[1]]
- @equip_hud_size_y = [EQUIPMENT_POSITION[1] + EQUIPMENT_SMART_FADE_RANGE_Y[0], EQUIPMENT_POSITION[1] + @equip_layout.bitmap.height + EQUIPMENT_SMART_FADE_RANGE_Y[1]]
- end
- #--------------------------------------------------------------------------
- # * Create Icon Weapon
- #--------------------------------------------------------------------------
- def create_equipment_icons
- @equip_icon = Sprite.new
- icon_cw = @equip_layout.bitmap.width + 48
- icon_ch = @equip_layout.bitmap.height + 48
- @equip_icon.bitmap = Bitmap.new(icon_cw,icon_ch)
- @equip_icon.z = HUD_Z + EQUIPMENT_Z + 1
- @equip_icon.x = EQUIPMENT_POSITION[0] - 24
- @equip_icon.y = EQUIPMENT_POSITION[1] - 24
- refresh_equipment
- end
- #--------------------------------------------------------------------------
- # * Set Equipment
- #--------------------------------------------------------------------------
- def set_equipment
- @equip_wep = @actor != nil ? @actor.equips : nil
- end
- #--------------------------------------------------------------------------
- # * Refresh Equipment
- #--------------------------------------------------------------------------
- def refresh_equipment
- set_equipment
- return if @equip_layout == nil
- @equip_icon.bitmap.clear
- return if @actor == nil
- check_icon_image
- if @actor.equips[0] != nil and EQUIPMENT_WEAPON_VISIBLE
- icon_index = @actor.equips[0].icon_index
- icon_pos = [EQUIPMENT_WEAPON_POSITION[0],EQUIPMENT_WEAPON_POSITION[1]]
- draw_icons(@equip_icon,icon_pos[0] + 24,icon_pos[1] + 24,icon_index)
- end
- if @actor.equips[1] != nil and EQUIPMENT_SHIELD_VISIBLE
- icon_index = @actor.equips[1].icon_index
- icon_pos = [EQUIPMENT_SHIELD_POSITION[0],EQUIPMENT_SHIELD_POSITION[1]]
- draw_icons(@equip_icon,icon_pos[0] + 24,icon_pos[1] + 24,icon_index)
- end
- if @actor.equips[2] != nil and EQUIPMENT_HEAD_VISIBLE
- icon_index = @actor.equips[2].icon_index
- icon_pos = [EQUIPMENT_HEAD_POSITION[0],EQUIPMENT_HEAD_POSITION[1]]
- draw_icons(@equip_icon,icon_pos[0] + 24,icon_pos[1] + 24,icon_index)
- end
- if @actor.equips[3] != nil and EQUIPMENT_BODY_VISIBLE
- icon_index = @actor.equips[3].icon_index
- icon_pos = [EQUIPMENT_BODY_POSITION[0],EQUIPMENT_BODY_POSITION[1]]
- draw_icons(@equip_icon,icon_pos[0] + 24,icon_pos[1] + 24,icon_index)
- end
- if @actor.equips[4] != nil and EQUIPMENT_ACCESSORY_VISIBLE
- icon_index = @actor.equips[4].icon_index
- icon_pos = [EQUIPMENT_ACCESSORY_POSITION[0],EQUIPMENT_ACCESSORY_POSITION[1]]
- draw_icons(@equip_icon,icon_pos[0] + 24,icon_pos[1] + 24,icon_index)
- end
- end
- #--------------------------------------------------------------------------
- # * draw_icons
- #--------------------------------------------------------------------------
- def draw_icons(sprite,x,y,icon_index)
- icon_rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
- sprite.bitmap.blt(x, y, @icon_image, icon_rect)
- end
- #--------------------------------------------------------------------------
- # * Update Equipment
- #--------------------------------------------------------------------------
- def update_equipment
- return if @equip_layout == nil
- refresh_equipment if @equip_wep != @actor.equips
- if @equip_smart_fade
- fade_sprite(@equip_layout,@fade_hud_equip)
- fade_sprite(@equip_icon,@fade_hud_equip)
- #----------------------------------------------------------------------
- # Kadafi Edit
- #----------------------------------------------------------------------
- SceneManager.scene.toolhud.fade_skill_sprite(@force_hide,
- @force_hide_time, @fade_hud_equip) if SceneManager.scene.spriteset
- #----------------------------------------------------------------------
- else
- fade_sprite(@equip_layout,@fade_hud)
- fade_sprite(@equip_icon,@fade_hud)
- #----------------------------------------------------------------------
- # Kadafi Edit
- #----------------------------------------------------------------------
- SceneManager.scene.toolhud.fade_skill_sprite(@force_hide,
- @force_hide_time, @fade_hud) if SceneManager.scene.spriteset
- #----------------------------------------------------------------------
- end
- end
- end
- #==============================================================================
- #==============================================================================
- # ** Ultima Hud (GOLD)
- #==============================================================================
- #==============================================================================
- class Ultima_Hud
- #--------------------------------------------------------------------------
- # * Create Gold
- #--------------------------------------------------------------------------
- def create_gold
- return if !GOLD_VISIBLE
- return if @gold != nil
- create_gold_layout
- create_gold_number
- end
- #--------------------------------------------------------------------------
- # * Create Gold Layout
- #--------------------------------------------------------------------------
- def create_gold_layout
- @gold = Sprite.new
- @gold.bitmap = Cache.ultima_hud("Gold_Layout")
- @gold.x = GOLD_POSITION[0]
- @gold.y = GOLD_POSITION[1]
- @gold.z = HUD_Z + GOLD_HUD_Z
- @gold_smart_fade = GOLD_DETACHED_SMART_FADE
- @gold_hud_size_x = [GOLD_POSITION[0] + GOLD_SMART_FADE_RANGE_X[0], GOLD_POSITION[0] + @gold.bitmap.width + GOLD_SMART_FADE_RANGE_X[1]]
- @gold_hud_size_y = [GOLD_POSITION[1] + GOLD_SMART_FADE_RANGE_Y[0], GOLD_POSITION[1] + @gold.bitmap.height + GOLD_SMART_FADE_RANGE_Y[1]]
- end
- #--------------------------------------------------------------------------
- # * Create Gold Number
- #--------------------------------------------------------------------------
- def create_gold_number
- @gold_old = $game_party.gold
- @gold_refresh = true
- @gold_number_image = Cache.ultima_hud("Gold_Number")
- @gold_cw = @gold_number_image.width / 10
- @gold_ch = @gold_number_image.height
- @gold_number = Sprite.new
- @gold_number.bitmap = Bitmap.new(@gold_cw * 7,@gold_ch)
- @gold_pos = [GOLD_POSITION[0] + GOLD_NUMBER_POSITION[0],
- GOLD_POSITION[1] + GOLD_NUMBER_POSITION[1]]
- @gold_number.x = @gold_pos[0]
- @gold_number.y = @gold_pos[1]
- @gold_number.z = HUD_Z + GOLD_HUD_Z + 1
- end
- #--------------------------------------------------------------------------
- # * Update Gold
- #--------------------------------------------------------------------------
- def update_gold
- return if @gold == nil
- update_number(6,@gold_old)
- refresh_number(6,@gold_old,@gold_number,@gold_number_image,@gold_cw,@gold_ch,false)
- if @gold_smart_fade
- fade_sprite(@gold,@fade_hud_gold)
- fade_sprite(@gold_number,@fade_hud_gold)
- else
- fade_sprite(@gold,@fade_hud)
- fade_sprite(@gold_number,@fade_hud)
- end
- end
- end
- #==============================================================================
- #==============================================================================
- # ** Ultima Hud (DISPOSE)
- #==============================================================================
- #==============================================================================
- class Ultima_Hud
- #--------------------------------------------------------------------------
- # * Dispose
- #--------------------------------------------------------------------------
- def dispose
- dispose_layout
- dispose_layout_2
- dispose_name
- dispose_face
- dispose_hp_number
- dispose_hp_number_max
- dispose_hp_meter
- dispose_hp_icon
- dispose_hp_icon_ex
- dispose_hp_icon_number
- dispose_mp_number
- dispose_mp_number_max
- dispose_mp_meter
- dispose_mp_icon
- dispose_mp_icon_ex
- dispose_mp_icon_number
- dispose_tp_number
- dispose_tp_number_max
- dispose_tp_meter
- dispose_tp_icon
- dispose_tp_icon_ex
- dispose_tp_icon_number
- dispose_lv_number
- dispose_lv_number_exp
- dispose_lv_meter
- dispose_states
- dispose_equipment
- dispose_gold
- end
- #--------------------------------------------------------------------------
- # * Dispose Layout
- #--------------------------------------------------------------------------
- def dispose_layout
- return if @layout == nil
- @layout.bitmap.dispose
- @layout.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose Layout 2
- #--------------------------------------------------------------------------
- def dispose_layout_2
- return if @layout2 == nil
- @layout2.bitmap.dispose
- @layout2.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose Name
- #--------------------------------------------------------------------------
- def dispose_name
- return if @name == nil
- @name.bitmap.dispose
- @name.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose Face
- #--------------------------------------------------------------------------
- def dispose_face
- return if @face == nil
- @face_image.dispose if @face_image != nil
- @face.bitmap.dispose if @face.bitmap != nil
- @face.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose HP Number
- #--------------------------------------------------------------------------
- def dispose_hp_number
- return if @hp_number == nil
- @hp_number.bitmap.dispose
- @hp_number.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose HP Number Max
- #--------------------------------------------------------------------------
- def dispose_hp_number_max
- return if @hp_number2 == nil
- @hp_number2.bitmap.dispose
- @hp_number2.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose HP Meter
- #--------------------------------------------------------------------------
- def dispose_hp_meter
- return if @hp_meter == nil
- @hp_meter.bitmap.dispose
- @hp_meter.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose HP Icon
- #--------------------------------------------------------------------------
- def dispose_hp_icon
- return if @hp_icon == nil
- @hp_icon.bitmap.dispose if @hp_icon.bitmap != nil
- @hp_icon.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose HP Icon EX
- #--------------------------------------------------------------------------
- def dispose_hp_icon_ex
- return if @hp_icon3 == nil
- @hp_icon3.bitmap.dispose
- @hp_icon3.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose HP Icon Number
- #--------------------------------------------------------------------------
- def dispose_hp_icon_number
- return if @hp_icon_number == nil
- @hp_icon_number.bitmap.dispose
- @hp_icon_number.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose MP Number
- #--------------------------------------------------------------------------
- def dispose_mp_number
- return if @mp_number == nil
- @mp_number.bitmap.dispose
- @mp_number.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose MP Number Max
- #--------------------------------------------------------------------------
- def dispose_mp_number_max
- return if @mp_number2 == nil
- @mp_number2.bitmap.dispose
- @mp_number2.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose MP Meter
- #--------------------------------------------------------------------------
- def dispose_mp_meter
- return if @mp_meter == nil
- @mp_meter.bitmap.dispose
- @mp_meter.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose MP Icon
- #--------------------------------------------------------------------------
- def dispose_mp_icon
- return if @mp_icon == nil
- @mp_icon.bitmap.dispose if @mp_icon.bitmap != nil
- @mp_icon.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose MP Icon EX
- #--------------------------------------------------------------------------
- def dispose_mp_icon_ex
- return if @mp_icon3 == nil
- @mp_icon3.bitmap.dispose
- @mp_icon3.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose MP Icon Number
- #--------------------------------------------------------------------------
- def dispose_mp_icon_number
- return if @mp_icon_number == nil
- @mp_icon_number.bitmap.dispose
- @mp_icon_number.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose TP Number
- #--------------------------------------------------------------------------
- def dispose_tp_number
- return if @tp_number == nil
- @tp_number.bitmap.dispose
- @tp_number.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose TP Number Max
- #--------------------------------------------------------------------------
- def dispose_tp_number_max
- return if @tp_number2 == nil
- @tp_number2.bitmap.dispose
- @tp_number2.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose TP Meter
- #--------------------------------------------------------------------------
- def dispose_tp_meter
- return if @tp_meter == nil
- @tp_meter.bitmap.dispose
- @tp_meter.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose TP Icon
- #--------------------------------------------------------------------------
- def dispose_tp_icon
- return if @tp_icon == nil
- @tp_icon.bitmap.dispose if @tp_icon.bitmap != nil
- @tp_icon.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose TP Icon EX
- #--------------------------------------------------------------------------
- def dispose_tp_icon_ex
- return if @tp_icon3 == nil
- @tp_icon3.bitmap.dispose
- @tp_icon3.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose TP Icon Number
- #--------------------------------------------------------------------------
- def dispose_tp_icon_number
- return if @tp_icon_number == nil
- @tp_icon_number.bitmap.dispose
- @tp_icon_number.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose Lv Number
- #--------------------------------------------------------------------------
- def dispose_lv_number
- return if @lv_number == nil
- @lv_number.bitmap.dispose
- @lv_number.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose Lv Number EXP
- #--------------------------------------------------------------------------
- def dispose_lv_number_exp
- return if @lv_number2 == nil
- @lv_number2.bitmap.dispose
- @lv_number2.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose Lv Meter
- #--------------------------------------------------------------------------
- def dispose_lv_meter
- return if @lv_meter == nil
- @lv_meter.bitmap.dispose
- @lv_meter.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose States
- #--------------------------------------------------------------------------
- def dispose_states
- return if @status == nil
- @status.bitmap.dispose if @status.bitmap != nil
- @status.dispose
- @actor_status.dispose if @actor_status != nil
- end
- #--------------------------------------------------------------------------
- # * Dispose Equipment
- #--------------------------------------------------------------------------
- def dispose_equipment
- return if @equip_layout == nil
- @equip_layout.bitmap.dispose
- @equip_layout.dispose
- @equip_icon.bitmap.dispose
- @equip_icon.dispose
- end
- #--------------------------------------------------------------------------
- # * Dispose Gold
- #--------------------------------------------------------------------------
- def dispose_gold
- return if @gold == nil
- @gold_number.bitmap.dispose
- @gold.dispose
- @gold_number.bitmap.dispose
- @gold_number.dispose
- end
- end
- #==============================================================================
- #==============================================================================
- # ** Ultima Hud (UPDATE)
- #==============================================================================
- #==============================================================================
- class Ultima_Hud
- #--------------------------------------------------------------------------
- # * Update
- #--------------------------------------------------------------------------
- def update
- refresh_actor if @actor != $game_party.members[0]
- return if @actor == nil
- update_visible
- update_layout
- update_layout_2
- update_name
- update_face
- update_hp
- update_mp
- update_tp
- update_level
- update_states
- update_equipment
- update_gold
- update_removed_parts
- end
- def update_removed_parts
- if REMOVE_PARTS[@actor.id].include?(:exp)
- @lv_number.visible = false if @lv_number
- @lv_number2.visible = false if @lv_number2
- @lv_meter.visible = false if @lv_meter
- @layout.bitmap = Cache.ultima_hud("Removed_EXP_Layout") if @layout
- @layout2.bitmap = Cache.ultima_hud("Removed_EXP_Layout_2") if @layout2
- else
- @lv_number.visible = true if @lv_number
- @lv_number2.visible = true if @lv_number2
- @lv_meter.visible = true if @lv_meter
- @layout.bitmap = Cache.ultima_hud("Layout") if @layout
- @layout2.bitmap = Cache.ultima_hud("Layout_2") if @layout2
- end
- end
- #--------------------------------------------------------------------------
- # * Update Visible
- #--------------------------------------------------------------------------
- def update_visible
- update_auto_hide
- return if !SMART_FADE_EFFECT
- @fade_hud = smart_fade_in_range?(@hud_size_x,@hud_size_y)
- update_gold_smart_fade
- update_equip_smart_fade
- end
- #--------------------------------------------------------------------------
- # * Update Auto Hide
- #--------------------------------------------------------------------------
- def update_auto_hide
- if can_auto_hide?
- @force_hide = true
- @force_hide_time += 1
- else
- @force_hide = false
- @force_hide_time = 0
- end
- end
- #--------------------------------------------------------------------------
- # * Can Auto Hide
- #--------------------------------------------------------------------------
- def can_auto_hide?
- return true if !$game_system.hud_visible
- return false if !AUTO_HIDE_FOR_INTERPRETER
- return true if $game_map.interpreter.running?
- return true if $game_message.visible
- return false
- end
- #--------------------------------------------------------------------------
- # * Smart Fade In Range
- #--------------------------------------------------------------------------
- def smart_fade_in_range?(range_x,range_y)
- if $game_player.screen_x.between?(range_x[0],range_x[1]) and
- $game_player.screen_y.between?(range_y[0],range_y[1])
- return true
- else
- return false
- end
- end
- #--------------------------------------------------------------------------
- # * Update Gold Smart Fade
- #--------------------------------------------------------------------------
- def update_gold_smart_fade
- return if @gold == nil
- return if !@gold_smart_fade
- @fade_hud_gold = smart_fade_in_range?(@gold_hud_size_x,@gold_hud_size_y)
- end
- #--------------------------------------------------------------------------
- # * Update Equip Smart Fade
- #--------------------------------------------------------------------------
- def update_equip_smart_fade
- return if @equip_layout == nil
- return if !@equip_smart_fade
- @fade_hud_equip = smart_fade_in_range?(@equip_hud_size_x,@equip_hud_size_y)
- end
- #--------------------------------------------------------------------------
- # * Refresh Actor
- #--------------------------------------------------------------------------
- def refresh_actor
- if can_initialize_hud?
- setup
- create_sprites
- end
- clear_base_parameters
- end
- #--------------------------------------------------------------------------
- # * Clear Base Parameters
- #--------------------------------------------------------------------------
- def clear_base_parameters
- @actor = $game_party.members[0]
- $game_system.hud_face = [1,0]
- @hp_old_meter = 0
- @mp_old_meter = 0
- @tp_old_meter = 0
- refresh_equipment
- if @actor != nil
- if @face != nil
- refresh_face_name rescue nil
- @face_old_hp = @actor.hp
- @face_old_mp = @actor.mp
- @face_old_tp = @actor.tp
- end
- if @name != nil
- refresh_name rescue nil
- end
- update_removed_parts
- end
- end
- #--------------------------------------------------------------------------
- # * Can Initialize HUD?
- #--------------------------------------------------------------------------
- def can_initialize_hud?
- return false if @actor != nil and $game_party.members[0] != nil
- return true
- end
- end
- $mog_rgss3_ultima_hud = true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement