#==============================================================================
# +++ MOG - Battle Hud EX (v3.8) +++
#==============================================================================
# By Moghunter
# http://www.atelier-rgss.com
#==============================================================================
# Sistema avan?ado de Hud de batalha, voltado para artistas gráficos e
# usuários avan?ados.
#
# Compatível com :
#
# - Victor's Animated_battle (1.21)
# - Victor's Active Time Battle (1.05)
# - Victor's Map Turn Battle (1.09)
# - Victor's Target Arrows (1.08)
# - Yami's Battle Symphony (1.16)
# - Yanfly's Battle Engine (1.09)
# - Yanfly's Visual Battlers (1.01)
# - Yanfly's Enemy Target Info (1.02)
# - Kread-EX's Animated Battlers (1.08)
# - Galv's Animated Battlers (1.2)
# - Jet's Viewed Battle Systems (?)
# - Jet's Animated Battlers(?)
# - C Winter's Active Time Battle (1.62)
# - Enu's Tankentai SBS (v1.00)
#
#==============================================================================
#
# Coloque as imagens da hud na pasta.
#
# Graphics/Huds/Battle/
#==============================================================================
# Para ocultar ou apresentar a hud de batalha use o código abaixo.
#
# battle_hud_visible(false)
#
# ou
#
# battle_hud_visible(true)
#
#==============================================================================
# Para mudar o sprite da face do battler use o código abaixo.
#==============================================================================
#
# battler_face_name( ACTOR_ID, FIlE_NAME )
#
#==============================================================================
#==============================================================================
# Atualiza??es desta vers?o.
#============================================================================
# (Ver 3.8)
# - Melhoria na posi??o Z da janelas.
# - Melhoria de compatibilidade com alguns scripts.
# (Ver 3.7)
# - A Hud n?o é mais influênciada pela tonalidade da tela, como nas
# batalhas noturnas.
#==============================================================================
module MOG_BATTLE_HUD_EX
#============================================================================
#============================================================================
# * HUD SPRITE (GENERAL)
#============================================================================
# Defini??o da quantidade maxima de personagens na batalha.
#---------------------------------------------------------------------------
MAX_BATTLE_MEMBERS = 4
#---------------------------------------------------------------------------
# Defini??o da prioridade da hud.
#---------------------------------------------------------------------------
HUD_Z = 50
#---------------------------------------------------------------------------
# Defini??o da posi??o geral da hud, influência em todos os sprites da hud.
#---------------------------------------------------------------------------
HUD_POSITION = [0,323]
#---------------------------------------------------------------------------
# Defini??o do espa?o entre os membros do grupo.
# (Use apenas para ajustes)
#---------------------------------------------------------------------------
MEMBERS_SPACE = [0,0]
#---------------------------------------------------------------------------
# Defini??o fixa da hud se deseja posicionar a hud em lugares
# específicos da tela.
#
# FIXED_POSITION[INDEX_ID] = [X,Y]
#
#---------------------------------------------------------------------------
FIXED_HUD_POSITION = []
# FIXED_HUD_POSITION[0] = [10,10]
# FIXED_HUD_POSITION[1] = [410,10]
# FIXED_HUD_POSITION[2] = [10,320]
# FIXED_HUD_POSITION[3] = [410,320]
#---------------------------------------------------------------------------
# Defini??o da posi??o do comando quando a op??o de janelas fixa é ativada.
#---------------------------------------------------------------------------
FIXED_COMMAND_POSITION = []
#FIXED_COMMAND_POSITION[0] = [130,10]
# FIXED_COMMAND_POSITION[1] = [300,10]
# FIXED_COMMAND_POSITION[2] = [130,290]
# FIXED_COMMAND_POSITION[3] = [300,290]
#---------------------------------------------------------------------------
# Ocultar a HUD quando a janela de mensagem está ativa.
#---------------------------------------------------------------------------
MESSAGE_WINDOW_FADE_HUD = true
#---------------------------------------------------------------------------
# Defini??o da posi??o da janela de mensagem.
#---------------------------------------------------------------------------
# 0 - Acima
# 1 - Centro
# 2 - Abaixo
#---------------------------------------------------------------------------
BATTLE_MESSAGE_POSITION = 0
#---------------------------------------------------------------------------
# Defini??o da porcentagem do parametro baixo, isso influência na cor
# do número dos parametros de HP, MP e TP.
#---------------------------------------------------------------------------
LOW_PARAMETER_PERCENTAGE = 30
#============================================================================
#============================================================================
#============================================================================
#============================================================================
# * NAME
#============================================================================
# Ativar o Sprite do nome do personagem.
#---------------------------------------------------------------------------
NAME_VISIBLE = false
#---------------------------------------------------------------------------
# Defini??o da prioridade do Sprite.
#---------------------------------------------------------------------------
NAME_Z = 5
#---------------------------------------------------------------------------
# Defini??o da posi??o da Face. [X,Y]
#---------------------------------------------------------------------------
NAME_POSITION = [0,-7]
#---------------------------------------------------------------------------
# Defini??o do tipo alinhamento do nome.
#
# 0 - Esquerda
# 1 - Centro
# 2 - Direita
#---------------------------------------------------------------------------
NAME_ALIGN_TYPE = 1
#---------------------------------------------------------------------------
# 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 = false
#---------------------------------------------------------------------------
# Defini??o da cor da sombra
#---------------------------------------------------------------------------
NAME_FONT_SHADOW_COLOR = Color.new(0,0,0,255)
#---------------------------------------------------------------------------
# Defini??o da distancia da sombra.
#---------------------------------------------------------------------------
NAME_FONT_SHADOW_POSITION = [2,2]
#============================================================================
#============================================================================
#============================================================================
#============================================================================
# * FACE
#============================================================================
# Ativar a face.
# Será necessário o arquivo.
#
# ACTOR_NAME + _Face.png
#
# Eric_Face.png
#
#---------------------------------------------------------------------------
FACE_VISIBLE = true
# Ativar as Faces representando os battlers.
# Deixe "false" se tiver problemas de compatibilidade com scripts.
FACE_BATTLER = true
#---------------------------------------------------------------------------
# Defini??o da prioridade do sprite.
#---------------------------------------------------------------------------
FACE_Z = -1
#---------------------------------------------------------------------------
# Defini??o da posi??o da Face. [X,Y]
#---------------------------------------------------------------------------
FACE_POSITION = [68,5]
#---------------------------------------------------------------------------
# Ativar faces animadas.
# Será necessário ter uma imagem de 5 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 = true
#---------------------------------------------------------------------------
# Ativar o efeito de Zoom quando o personagem usar alguma a??o.
#---------------------------------------------------------------------------
FACE_ZOOM_ANIMATION = true
#---------------------------------------------------------------------------
# Ativar o efeito Mirror na anima??o de a??o do personagem.
#---------------------------------------------------------------------------
FACE_ZOOM_MIRROR_EFFECT = 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 = true
#============================================================================
#============================================================================
#============================================================================
#============================================================================
# * TURN (ACTIVE INDICATOR)
#============================================================================
# Ativar o indicador de turno do personagem.
# Será necessário o arquivo.
#
# Turn.png
#
#---------------------------------------------------------------------------
TURN_SPRITE_VISIBLE = true
#---------------------------------------------------------------------------
# Defini??o da prioridade do Sprite.
#---------------------------------------------------------------------------
TURN_SPRITE_Z = 0
#---------------------------------------------------------------------------
# Defini??o da posi??o do sprite de turno.
#---------------------------------------------------------------------------
TURN_SPRITE_POSITION = [7,-30]
#---------------------------------------------------------------------------
# Ativar o efeito de anima??o de piscar.
#---------------------------------------------------------------------------
TURN_BLINK_EFFECT = true
#---------------------------------------------------------------------------
#============================================================================
#============================================================================
# * HP
#============================================================================
# Ativar o número de HP.
# Será necessário o arquivo.
#
# HP_Number.png
#
#---------------------------------------------------------------------------
HP_NUMBER_VISIBLE = true
#---------------------------------------------------------------------------
# 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 = [117,26]
#---------------------------------------------------------------------------
# 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 = true
#---------------------------------------------------------------------------
# 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 = [38,39]
#---------------------------------------------------------------------------
# Defini??o do angulo 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 = true
#---------------------------------------------------------------------------
# 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
#============================================================================
# Ativar o número de MP.
# Será necessário o arquivo.
#
# MP_Number.png
#
#---------------------------------------------------------------------------
MP_NUMBER_VISIBLE = true
#---------------------------------------------------------------------------
# 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 = [90,44]
#---------------------------------------------------------------------------
# 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 = [9,56]
#---------------------------------------------------------------------------
# Defini??o do angulo 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 = true
#---------------------------------------------------------------------------
# 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 = true
#---------------------------------------------------------------------------
# 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
#============================================================================
# Ativar o número de TP.
# Será necessário o arquivo.
#
# TP_Number.png
#
#---------------------------------------------------------------------------
TP_NUMBER_VISIBLE = true
#---------------------------------------------------------------------------
# Defini??o da prioridade do sprite.
#---------------------------------------------------------------------------
TP_NUMBER_Z = 5
#---------------------------------------------------------------------------
# Defini??o da posi??o do número de TP. [X,Y]
#---------------------------------------------------------------------------
TP_NUMBER_POSITION = [19,23]
#---------------------------------------------------------------------------
# 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 = 1
#---------------------------------------------------------------------------
# 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 = true
#---------------------------------------------------------------------------
# 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 = [68,74]
#---------------------------------------------------------------------------
# Defini??o do angulo 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 = 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.
#---------------------------------------------------------------------------
TP_METER_GRADIENT_ANIMATION = true
#---------------------------------------------------------------------------
# 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 = true
#---------------------------------------------------------------------------
# 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
#============================================================================
#============================================================================
#============================================================================
#============================================================================
# * AT
#============================================================================
# Ativar o número de AT.
# Será necessário o arquivo.
#
# AT_Number.png
#
#---------------------------------------------------------------------------
AT_NUMBER_VISIBLE = false
#---------------------------------------------------------------------------
# Defini??o da prioridade do Sprite.
#---------------------------------------------------------------------------
AT_NUMBER_Z = 2
#---------------------------------------------------------------------------
# Defini??o da posi??o do número de AT. [X,Y]
#---------------------------------------------------------------------------
AT_NUMBER_POSITION = [125,-27]
#---------------------------------------------------------------------------
# Ativar o número de AT Total.
# Será necessário o arquivo.
#
# AT_Number_Max.png
#
#---------------------------------------------------------------------------
AT_NUMBER_MAX_VISIBLE = false
#---------------------------------------------------------------------------
# Defini??o da posi??o do número de AT Total. [X,Y]
#---------------------------------------------------------------------------
AT_NUMBER_MAX_POSITION = [165,-17]
#---------------------------------------------------------------------------
# Defini??o do tipo alinhamento do número.
#
# 0 - Esquerda
# 1 - Centro
# 2 - Direita
#---------------------------------------------------------------------------
AT_NUMBER_ALIGN_TYPE = 2
#---------------------------------------------------------------------------
# Ativa o efeito de alinhar os números em posi??es de Y diferentes.
#---------------------------------------------------------------------------
AT_NUMBER_WAVE_ALIGN_EFFECT = false
#---------------------------------------------------------------------------
# Apresentar os números em porcentagem.
#---------------------------------------------------------------------------
AT_NUMBER_PERCENTAGE = true
#---------------------------------------------------------------------------
# Ativar números animados ("Rolantes").
#---------------------------------------------------------------------------
AT_NUMBER_ANIMATION = false
#---------------------------------------------------------------------------
# Ativar o medidor de AT.
# Será necessário o arquivo.
#
# AT_Meter.png
#
#---------------------------------------------------------------------------
AT_METER_VISIBLE = true
#---------------------------------------------------------------------------
# Defini??o da prioridade do sprite.
#---------------------------------------------------------------------------
AT_METER_Z = 1
#---------------------------------------------------------------------------
# Defini??o da posi??o do medidor de AT. [X,Y]
#---------------------------------------------------------------------------
AT_METER_POSITION = [38,76]
#---------------------------------------------------------------------------
# Defini??o do angulo do medidor.
#---------------------------------------------------------------------------
AT_METER_ANGLE = 0
#---------------------------------------------------------------------------
# Ativar o efeito mirror, essa op??o faz com que o medidor tenha o movimento
# inverso.
#---------------------------------------------------------------------------
AT_METER_MIRROR_EFFECT = 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.
#---------------------------------------------------------------------------
AT_METER_GRADIENT_ANIMATION = true
#============================================================================
#============================================================================
#============================================================================
# * LEVEL
#============================================================================
# Ativar o número de Level.
# Será necessário o arquivo.
#
# LV_Number.png
#
#---------------------------------------------------------------------------
LEVEL_NUMBER_VISIBLE = false
#---------------------------------------------------------------------------
# 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 = [84,0]
#---------------------------------------------------------------------------
# Defini??o do tipo alinhamento do número.
#
# 0 - Esquerda
# 1 - Centro
# 2 - Direita
#---------------------------------------------------------------------------
LEVEL_NUMBER_ALIGN_TYPE = 1
#============================================================================
#============================================================================
#============================================================================
#============================================================================
# * STATE
#============================================================================
# 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 = [7,65]
#---------------------------------------------------------------------------
# Ativar o efeito animado das condi??es deslizando.
#---------------------------------------------------------------------------
STATES_SCROLLING_ANIMATION = false
#---------------------------------------------------------------------------
# Defini??o do angulo do sprite.
#---------------------------------------------------------------------------
STATE_ANGLE = 0
#---------------------------------------------------------------------------
# Defini??o das condi??es que ser?o ocultadas pela hud.
# EX - HIDE_STATES_ID = [9,10,12,14]
#---------------------------------------------------------------------------
HIDE_STATES_ID = []
#============================================================================
#============================================================================
#============================================================================
#============================================================================
# * SECOND LAYOUT (Overlayer)
#============================================================================
# Ativar a segunda camada de Layout
# Será necessário o arquivo.
#
# Layout_2.png
#
#============================================================================
SECOND_LAYOUT = false
#---------------------------------------------------------------------------
# Defini??o da prioridade do sprite.
#---------------------------------------------------------------------------
SECOND_LAYOUT_Z = 4
#---------------------------------------------------------------------------
# Defini??o da posi??o do sprite.
#---------------------------------------------------------------------------
SECOND_LAYOUT_POSITION = [-5,-10]
#============================================================================
#============================================================================
end
#============================================================================
#============================================================================
# * CUSTOM WINDOWS (GENERAL)
#============================================================================
module MOG_BATTLE_HUD_EX
#============================================================================
# * BATTLE LOG WINDOW
#============================================================================
#Defini??o da posi??o da janela de log.
BATTLE_LOG_POSITION = [0,0]
#============================================================================
#============================================================================
# * SKILL WINDOW
#============================================================================
#Defini??o do tamanho da janela.
SKILL_WINDOW_SIZE = [Graphics.width, 120]
#Defini??o da posi??o da janela.
SKILL_WINDOW_POSITION = [0,0]
#Defini??o da transparência da janela.
SKILL_WINDOW_OPACITY = 0
#Ativar a imagem de Layout. ("Layout_Skill.png")
SKILL_WINDOW_LAYOUT = true
#Defini??o do layout.
SKILL_WINDOW_LAYOUT_POSITION = [0,-7]
#============================================================================
#============================================================================
# * ITEM WINDOW
#============================================================================
#Defini??o do tamanho da janela.
ITEM_WINDOW_SIZE = [Graphics.width, 120]
#Defini??o da posi??o da janela.
ITEM_WINDOW_POSITION = [0,0]
#Defini??o da transparência da janela.
ITEM_WINDOW_OPACITY = 0
#Ativar a imagem de Layout. ("Layout_Item.png")
ITEM_WINDOW_LAYOUT = true
#Defini??o do layout.
ITEM_WINDOW_LAYOUT_POSITION = [0,-7]
#============================================================================
#============================================================================
# * COMMAND WINDOW
#============================================================================
#Ajustar automáticamente
AUTO_ADJUST_ACTOR_COMMAND = true
#Defini??o da posi??o da janela. (Apenas para Ajustes)
ACTOR_COMMAND_POSITION = [0,-50]
#Defini??o da transparência da janela.
ACTOR_COMMAND_OPACITY = 0
#Ativar a imagem de Layout. ("Layout_Command.png")
ACTOR_COMMAND_LAYOUT = true
#Defini??o do layout.
ACTOR_COMMAND_LAYOUT_POSITION = [0,0]
#============================================================================
#============================================================================
# * HELP WINDOW
#============================================================================
#Defini??o do tamanho da janela.
HELP_WINDOW_SIZE = [Graphics.width, 72]
#Defini??o do tamanho da janela.
HELP_WINDOW_POSITION = [Graphics.width / 2, 0]
#Defini??o da transparência da janela.
HELP_WINDOW_OPACITY = 0
#Ativar a imagem de Layout. ("Layout_Help.png")
HELP_WINDOW_LAYOUT = true
#Defini??o do layout.
HELP_WINDOW_LAYOUT_POSITION = [0,0]
#============================================================================
#============================================================================
# * TARGET ACTOR WINDOW
#============================================================================
#Defini??o do tamanho da janela.
ACTOR_WINDOW_SIZE = [Graphics.width, 120]
#Defini??o do tamanho da janela.
ACTOR_WINDOW_POSITION = [Graphics.width / 2, Graphics.height]
#Defini??o da transparência da janela.
ACTOR_WINDOW_OPACITY = 0
#Ativar a imagem de Layout. ("Layout_Target_Actor.png")
ACTOR_WINDOW_LAYOUT = true
#Defini??o do layout.
ACTOR_WINDOW_LAYOUT_POSITION = [0,0]
#============================================================================
#============================================================================
# * TARGET ENEMY WINDOW
#============================================================================
#Defini??o do tamanho da janela.
ENEMY_WINDOW_SIZE = [Graphics.width, 120]
#Defini??o do tamanho da janela.
ENEMY_WINDOW_POSITION = [Graphics.width / 2, Graphics.height]
#Defini??o da transparência da janela.
ENEMY_WINDOW_OPACITY = 0
#Ativar a imagem de Layout. ("Layout_Target_Actor.png")
ENEMY_WINDOW_LAYOUT = true
#Defini??o do layout.
ENEMY_WINDOW_LAYOUT_POSITION = [0,0]
#============================================================================
#============================================================================
# * PARTY WINDOW (Fight/Escape)
#============================================================================
#Defini??o do tamanho da janela.
PARTY_COMMAND_POSITION = [Graphics.width / 2,Graphics.height / 2]
#Defini??o da transparência da janela.
PARTY_COMMAND_OPACITY = 0
#Ativar a imagem de Layout. ("Layout_Party.png")
PARTY_COMMAND_LAYOUT = true
#Defini??o do layout.
PARTY_COMMAND_LAYOUT_POSITION = [0,0]
#============================================================================
end
$imported = {} if $imported.nil?
$imported[:mog_battle_hud_ex] = true
#--------------------------------------------------------------------------
# * Hud
#--------------------------------------------------------------------------
def self.battle_hud(filename)
load_bitmap("Graphics/Huds/Battle/", filename)
end
end
#==============================================================================
# ** Game Temp
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# * Check Screen Xyz
#--------------------------------------------------------------------------
def check_screen_xyz_nil
return if !SceneManager.face_battler?
for actor in $game_party.battle_members
actor.screen_x = 0 if actor.screen_x == nil
actor.screen_y = 0 if actor.screen_y == nil
actor.screen_z = 0 if actor.screen_z == nil
end
end
end
#==============================================================================
# ** Game Interpreter
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# * Battler Face Name
#--------------------------------------------------------------------------
def battler_face_name(actor_id,face_name = "")
for actor in $game_party.members
actor.battler_face_name = face_name if actor.id == actor_id
end
refresh_battle_hud
end
#--------------------------------------------------------------------------
# * Battler Hud Visible
#--------------------------------------------------------------------------
def battle_hud_visible(value)
$game_temp.battle_hud_visible = value
end
#--------------------------------------------------------------------------
# * Command_129
#--------------------------------------------------------------------------
alias mog_monogatari_bhud_command_129 command_129
def command_129
mog_monogatari_bhud_command_129
refresh_battle_hud if SceneManager.scene_is?(Scene_Battle)
end
end
#==============================================================================
# ** Game Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Setup
#--------------------------------------------------------------------------
alias mog_monogatari_face_animation setup
def setup(actor_id)
mog_monogatari_face_animation(actor_id)
@face_animation = [0,0,0]
@battler_face_name = "Face_" + actor_id.to_s
end
#--------------------------------------------------------------------------
# ● Real Next Level
#--------------------------------------------------------------------------
def real_next_level
next_level_exp - exp_for_level(level)
end
#==============================================================================
# ** Game Party
#==============================================================================
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# * Get Maximum Number of Battle Members
#--------------------------------------------------------------------------
def max_battle_members
return MOG_BATTLE_HUD_EX::MAX_BATTLE_MEMBERS
end
#--------------------------------------------------------------------------
# * Current Index
#--------------------------------------------------------------------------
def self.current_index
return 0 if @actor_index == nil
return @actor_index != -1 ? @actor_index : 0
end
#--------------------------------------------------------------------------
# * Current Index Real
#--------------------------------------------------------------------------
def self.current_index_real
return -1 if @actor_index == nil
return @actor_index
end
#--------------------------------------------------------------------------
# * Next Actor Avaliable
#--------------------------------------------------------------------------
def self.next_actor_avaliable?
return false if @actor_index == nil
next_index = @actor_index + 1
return false if next_index >= $game_party.members.size
return true
end
#--------------------------------------------------------------------------
# * To Next Command Input
#--------------------------------------------------------------------------
def self.next_command_avaliable
aindex = @actor_index
begin
if !actor || !actor.next_command
return false if actor == nil
aindex += 1
return false if aindex >= $game_party.members.size
end
end until actor.inputable?
return true
end
#--------------------------------------------------------------------------
# * Can Enable Window?
#--------------------------------------------------------------------------
def self.can_enable_window?
max_members = $game_party.members.size
index_real = current_index_real + 1
return false if index_real > max_members
return false if in_turn?
return false if $imported[:mog_battle_cursor]
return true
end
#--------------------------------------------------------------------------
# * Face Battler
#--------------------------------------------------------------------------
def self.face_battler?
return false if !MOG_BATTLE_HUD_EX::FACE_BATTLER
return false if $imported[:ve_animated_battle]
return false if $imported[:ve_actor_battlers]
return false if $imported["YES-BattleSymphony"]
return false if $imported["YEA-VisualBattlers"]
return false if $imported["Galv_Animated_Battlers"]
return false if $imported['KRX-AnimatedBattlers']
return false if $sv_camera != nil
return false if BattleManager.true_surprise != nil rescue nil
return false if $imported[:jet][:AnimatedBattlers] rescue nil
return true
end
end
#==============================================================================
# ■ Sprite Picture
#==============================================================================
class Sprite_Picture < Sprite
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
alias mog_battle_hud_initialize initialize
def initialize(viewport, picture)
mog_battle_hud_initialize(viewport, picture)
self.viewport = nil if SceneManager.scene_is?(Scene_Battle)
end
#--------------------------------------------------------------------------
# * Update Position
#--------------------------------------------------------------------------
alias mog_battle_hud_update_position update_position
def update_position
mog_battle_hud_update_position
self.z = @picture.number + 120 if SceneManager.scene_is?(Scene_Battle)
end
end
#==============================================================================
# ■ Sprite Base
#==============================================================================
class Sprite_Base < Sprite
#--------------------------------------------------------------------------
# * Animation Set Sprite
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_animation_set_sprites animation_set_sprites
def animation_set_sprites(frame)
mog_battle_hud_ex_animation_set_sprites(frame)
update_sprite_z_animation rescue nil if SceneManager.scene_is?(Scene_Battle)
end
#--------------------------------------------------------------------------
# * Update Sprite Z Animation
#--------------------------------------------------------------------------
def update_sprite_z_animation
@ani_sprites.each_with_index do |sprite, i|
sprite.viewport = nil ; sprite.z = 100 + i end
end
end
#==============================================================================
# ** Spriteset Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# * Create Actors
#--------------------------------------------------------------------------
alias mog_battle_hud_create_actors create_actors
def create_actors
if can_create_max_members?
@actor_sprites = Array.new($game_party.max_battle_members) { Sprite_Battler.new(@viewport1) }
return
end
mog_battle_hud_create_actors
end
#--------------------------------------------------------------------------
# * Can Create Max Members
#--------------------------------------------------------------------------
def can_create_max_members?
return false if $imported[:ve_animated_battle]
return false if $imported[:ve_actor_battlers]
return false if $sv_camera != nil
return true
end
end
#==============================================================================
# ■ Scene Battle
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● Clear All Windows
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_start start
def start
setup_battle_hud_ex
mog_battle_hud_ex_start
end
#--------------------------------------------------------------------------
# ● Setup Battle Hud EX
#--------------------------------------------------------------------------
def setup_battle_hud_ex
@force_clear_duration = 0
end
#--------------------------------------------------------------------------
# ● Clear All Windows
#--------------------------------------------------------------------------
def clear_all_windows
if @actor_window != nil
@actor_window.visible = false
@actor_window.active = false
end
if @status_window != nil
@status_window.visible = false
@status_window.active = false
end
if @actor_command_window != nil
@actor_command_window.visible = false
@actor_command_window.active = false
end
if @party_command_window != nil
@party_command_window.visible = false
@party_command_window.active = false
end
if @help_window != nil
@help_window.visible = false
end
end
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_update_main update
def update
mog_battle_hud_ex_update_main
update_battle_hud_ex
end
#--------------------------------------------------------------------------
# ● Update Battle Hud_ex
#--------------------------------------------------------------------------
def update_battle_hud_ex
end
end
if SceneManager.face_battler?
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● Use Sprite?
#--------------------------------------------------------------------------
def use_sprite?
return true
end
end
#==============================================================================
# ■ Sprite_Battler
#==============================================================================
class Sprite_Battler < Sprite_Base
include MOG_BATTLE_HUD_EX
#--------------------------------------------------------------------------
# ● Update Collapse
#--------------------------------------------------------------------------
alias mog_battle_hud_update_collapse update_collapse
def update_collapse
return if face_can_cancel_method?
mog_battle_hud_update_collapse
end
#--------------------------------------------------------------------------
# ● Update Instant Collapse
#--------------------------------------------------------------------------
alias mog_battle_hud_update_instant_collapse update_instant_collapse
def update_instant_collapse
return if face_can_cancel_method?
mog_battle_hud_update_instant_collapse
end
#--------------------------------------------------------------------------
# ● Init Visibility
#--------------------------------------------------------------------------
alias mog_battle_face_init_visibility init_visibility
def init_visibility
return if face_can_cancel_method?
mog_battle_face_init_visibility
end
#--------------------------------------------------------------------------
# ● Face Can Cancel Method
#--------------------------------------------------------------------------
def face_can_cancel_method?
return false if !SceneManager.face_battler?
return false if @battler.is_a?(Game_Enemy)
self.opacity = 255 ; self.visible = true
return true
end
#--------------------------------------------------------------------------
# ● Update Position
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_update_position update_position
def update_position
if !face_sprite_visible?
self.y = -480
return
end
mog_battle_hud_ex_update_position
end
#--------------------------------------------------------------------------
# * Sprite Visible
#--------------------------------------------------------------------------
def face_sprite_visible?
return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
return false if !$game_temp.battle_hud_visible
return true
end
end
end
#==============================================================================
# ** Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Selectable
include MOG_BATTLE_HUD_EX
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
ACTOR_WINDOW_SIZE[0]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
alias mog_monogatari_refresh refresh
def refresh
mog_monogatari_refresh
self.visible = false
end
end
#==============================================================================
# ** Window Actor Command
#==============================================================================
class Window_ActorCommand < Window_Command
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
alias mog_hud_battle_hud_ex_turn_sprite_update update
def update
mog_hud_battle_hud_ex_turn_sprite_update
$game_temp.command_visible = self.visible
end
end
if MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
#==============================================================================
# ** Window BattleLog
#==============================================================================
class Window_BattleLog < Window_Selectable
include MOG_BATTLE_HUD_EX
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_log_initialize initialize
def initialize
mog_battle_hud_ex_log_initialize
self.x = BATTLE_LOG_POSITION[0]
self.y = BATTLE_LOG_POSITION[1]
end
#--------------------------------------------------------------------------
# * Create Back Sprite
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_log_create_back_sprite create_back_sprite
def create_back_sprite
self.x = BATTLE_LOG_POSITION[0]
self.y = BATTLE_LOG_POSITION[1]
mog_battle_hud_ex_log_create_back_sprite
end
end
#==============================================================================
# ** Window Actor Command
#==============================================================================
class Window_ActorCommand < Window_Command
include MOG_BATTLE_HUD_EX
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
alias mog_monogatari_initialize initialize
def initialize
mog_monogatari_initialize
create_layout
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
alias mog_monogatari_actor_command_dispose dispose
def dispose
mog_monogatari_actor_command_dispose
dispose_layout
end
#--------------------------------------------------------------------------
# * Select
#--------------------------------------------------------------------------
alias mog_monogatari_select_actor_command select
def select(index)
mog_monogatari_select_actor_command(index)
set_command_position
end
#--------------------------------------------------------------------------
# * Set Command Position
#--------------------------------------------------------------------------
def set_command_position
self.viewport = nil
self.opacity = ACTOR_COMMAND_OPACITY
battler_index = BattleManager.current_index rescue nil
battler_index = 0 if battler_index == nil
if @actor != nil and $game_temp.hud_pos[battler_index] != nil
if FIXED_COMMAND_POSITION[battler_index] != nil
self.x = FIXED_COMMAND_POSITION[battler_index][0]
self.y = FIXED_COMMAND_POSITION[battler_index][1]
else
self.x = ACTOR_COMMAND_POSITION[0] + $game_temp.hud_pos[battler_index][0] - (self.width / 2)
self.x = Graphics.width - self.width if self.x + self.width > Graphics.width
self.x = 0 if self.x < 0
self.y = ACTOR_COMMAND_POSITION[1] + $game_temp.hud_pos[battler_index][1] - self.height
end
end
refresh_layout
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_refresh refresh
def refresh
mog_battle_hud_ex_refresh
$game_temp.refresh_turn_sprite = true
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
alias mog_monogatari_actor_commnand_update update
def update
mog_monogatari_actor_commnand_update
self.visible = self.active
if @layout.visible != nil
refresh_layout if @layout.visible != self.visible
end
end
end
#==============================================================================
# ** Window_PartyCommand
#==============================================================================
class Window_PartyCommand < Window_Command
include MOG_BATTLE_HUD_EX
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
alias mog_monogatari_party_initialize initialize
def initialize
mog_monogatari_party_initialize
create_layout
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
alias mog_monogatari_party_window_dispose dispose
def dispose
mog_monogatari_party_window_dispose
dispose_layout
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
alias mog_monogatari_party_window_update update
def update
mog_monogatari_party_window_update
self.visible = self.active
if @layout != nil and @layout.visible != self.visible
refresh_layout
end
end
end
#==============================================================================
# ** Window_Help
#==============================================================================
class Window_Help < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
alias mog_monogatari_battle_help_refresh refresh
def refresh
mog_monogatari_battle_help_refresh
if @battle_phase
self.x = @org_position[0]
self.y = @org_position[1]
self.opacity = HELP_WINDOW_OPACITY
end
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
alias mog_monogatari_help_window_update update
def update
mog_monogatari_help_window_update
if @layout != nil
refresh_layout if @layout.visible != self.visible
@layout.visible = self.visible
end
end
end
#==============================================================================
# ** Window_BattleActor
#==============================================================================
class Window_BattleActor < Window_BattleStatus
#--------------------------------------------------------------------------
# * Can Force Hide?
#--------------------------------------------------------------------------
def can_force_hide?
return true if $imported[:ve_target_arrow]
return true if $imported[:mog_battle_cursor]
return false
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
alias mog_monogatari_actor_window_dispose dispose
def dispose
mog_monogatari_actor_window_dispose
dispose_layout
end
#--------------------------------------------------------------------------
# * Create Layout
#--------------------------------------------------------------------------
def create_layout
return if @layout != nil
return if !ACTOR_WINDOW_LAYOUT
return if $game_temp.mbhud_window[3]
$game_temp.mbhud_window[3] = true
@layout = Sprite.new
@layout.bitmap = Cache.battle_hud("Layout_Target_Actor")
@layout.z = self.z - 1
refresh_layout
@layout.visible = false
end
#--------------------------------------------------------------------------
# * Dispose Layout
#--------------------------------------------------------------------------
def dispose_layout
return if @layout == nil
@layout.dispose
@layout = nil
end
if $imported[:ve_target_arrow]
#--------------------------------------------------------------------------
# * New method: show_actor
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_show_actor show_actor
def show_actor
return true if SceneManager.face_battler?
mog_battle_hud_ex_show_actor
end
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
alias mog_monogatari_actor_window_update update
def update
mog_monogatari_actor_window_update
self.visible = self.active
self.visible = false if @force_hide
if @layout != nil
refresh_layout if @layout.visible != self.visible
end
end
end
#==============================================================================
# ** Window_BattleEnemy
#==============================================================================
class Window_BattleEnemy < Window_Selectable
#--------------------------------------------------------------------------
# * Can Force Hide?
#--------------------------------------------------------------------------
def can_force_hide?
return true if $imported[:ve_target_arrow]
return true if $imported[:mog_battle_cursor]
return false
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
alias mog_monogatari_enemy_window_dispose dispose
def dispose
mog_monogatari_enemy_window_dispose
dispose_layout
end
#--------------------------------------------------------------------------
# * Create Layout
#--------------------------------------------------------------------------
def create_layout
return if @layout != nil
return if !ENEMY_WINDOW_LAYOUT
return if $game_temp.mbhud_window[4]
$game_temp.mbhud_window[4] = true
@layout = Sprite.new
@layout.bitmap = Cache.battle_hud("Layout_Target_Enemy")
@layout.z = self.z - 1
refresh_layout
@layout.visible = false
end
#--------------------------------------------------------------------------
# * Dispose Layout
#--------------------------------------------------------------------------
def dispose_layout
return if @layout == nil
@layout.dispose
@layout = nil
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
alias mog_monogatari_enemy_window_update update
def update
mog_monogatari_enemy_window_update
self.visible = false if @force_hide
if @layout != nil and @layout.visible != self.visible
refresh_layout
end
end
if $imported["YEA-BattleEngine"]
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
change_color(normal_color)
name = $game_troop.alive_members[index].name
draw_text(item_rect_for_text(index), name)
end
end
end
#==============================================================================
# ** Window_BattleSkill
#==============================================================================
class Window_BattleSkill < Window_SkillList
include MOG_BATTLE_HUD_EX
#--------------------------------------------------------------------------
# * Can Force Hide Active?
#--------------------------------------------------------------------------
def can_force_hide_active?
return true if $imported[:ve_target_arrow]
return true if $imported[:mog_battle_cursor] != nil
return false
end
#--------------------------------------------------------------------------
# * Can Force Hide?
#--------------------------------------------------------------------------
def can_force_hide?
return false
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
alias mog_monogatari_skill_window_dispose dispose
def dispose
mog_monogatari_skill_window_dispose
dispose_layout
end
#--------------------------------------------------------------------------
# * Create Layout
#--------------------------------------------------------------------------
def create_layout
return if @layout != nil
return if !SKILL_WINDOW_LAYOUT
return if $game_temp.mbhud_window[5]
$game_temp.mbhud_window[5] = true
@layout = Sprite.new
@layout.bitmap = Cache.battle_hud("Layout_Skill")
@layout.z = self.z - 1
refresh_layout
@layout.visible = false
end
#--------------------------------------------------------------------------
# * Dispose Layout
#--------------------------------------------------------------------------
def dispose_layout
return if @layout == nil
@layout.dispose
@layout = nil
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
alias mog_monogatari_skill_window_update update
def update
mog_monogatari_skill_window_update
self.visible = self.active if @force_hide_active
self.visible = false if @force_hide
if @layout != nil and @layout.visible != self.visible
refresh_layout
end
end
end
#==============================================================================
# ** Window_BattleItem
#==============================================================================
class Window_BattleItem < Window_ItemList
include MOG_BATTLE_HUD_EX
#--------------------------------------------------------------------------
# * Can Force Hide Active?
#--------------------------------------------------------------------------
def can_force_hide_active?
return true if $imported[:ve_target_arrow]
return true if $imported[:mog_battle_cursor] != nil
return false
end
#--------------------------------------------------------------------------
# * Can Force Hide?
#--------------------------------------------------------------------------
def can_force_hide?
return false
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
alias mog_monogatari_item_window_dispose dispose
def dispose
mog_monogatari_item_window_dispose
dispose_layout
end
#--------------------------------------------------------------------------
# * Create Layout
#--------------------------------------------------------------------------
def create_layout
return if @layout != nil
return if !ITEM_WINDOW_LAYOUT
return if $game_temp.mbhud_window[6]
$game_temp.mbhud_window[6] = true
@layout = Sprite.new
@layout.bitmap = Cache.battle_hud("Layout_Item")
@layout.z = self.z - 1
refresh_layout
@layout.visible = false
end
#--------------------------------------------------------------------------
# * Dispose Layout
#--------------------------------------------------------------------------
def dispose_layout
return if @layout == nil
@layout.dispose
@layout = nil
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
alias mog_monogatari_item_window_update update
def update
mog_monogatari_item_window_update
self.visible = self.active if @force_hide_active
self.visible = false if @force_hide
if @layout != nil
refresh_layout if @layout.visible != self.visible
end
end
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
#################################
if $imported["YEA-BattleEngine"]
#################################
#==============================================================================
# ** Window_BattleStatusAid
#==============================================================================
class Window_BattleStatusAid < Window_BattleStatus
#==============================================================================
# ■ Window ActorCommand
#==============================================================================
class Window_ActorCommand < Window_Command
#--------------------------------------------------------------------------
# * Show
#--------------------------------------------------------------------------
alias mog_bhud_yf_command_show show
def show
return if !BattleManager.can_enable_window?
mog_bhud_yf_command_show
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
alias mog_monogatari_bhud_yf_actorcommand_update update
def update
mog_monogatari_bhud_yf_actorcommand_update
update_visible_yf
end
#==============================================================================
# ** Scene Battle
#==============================================================================
class Scene_Battle < Scene_Base
include MOG_BATTLE_HUD_EX
#--------------------------------------------------------------------------
# alias method: create_skill_window
#--------------------------------------------------------------------------
alias mog_yf_scene_battle_create_skill_window create_skill_window
def create_skill_window
mog_yf_scene_battle_create_skill_window
@skill_window.width = SKILL_WINDOW_SIZE[0]
@skill_window.height = SKILL_WINDOW_SIZE[1]
@skill_window.x = SKILL_WINDOW_POSITION[0]
@skill_window.y = SKILL_WINDOW_POSITION[1]
end
#--------------------------------------------------------------------------
# alias method: create_item_window
#--------------------------------------------------------------------------
alias mog_yf_scene_battle_create_item_window create_item_window
def create_item_window
mog_yf_scene_battle_create_item_window
@item_window.width = ITEM_WINDOW_SIZE[0]
@item_window.height = ITEM_WINDOW_SIZE[1]
@item_window.x = ITEM_WINDOW_POSITION[0]
@item_window.y = ITEM_WINDOW_POSITION[1]
end
#--------------------------------------------------------------------------
# * Next Command
#--------------------------------------------------------------------------
def next_command
if BattleManager.next_command
@status_window.show
redraw_current_status
@actor_command_window.show
@status_aid_window.hide
start_actor_command_selection
else
turn_start
end
end
#--------------------------------------------------------------------------
# ● Update Battle Hud_ex
#--------------------------------------------------------------------------
alias mog_monogatari_yf_sb_update_battle_hud_ex update_battle_hud_ex
def update_battle_hud_ex
update_yf_visible
mog_monogatari_yf_sb_update_battle_hud_ex
end
#--------------------------------------------------------------------------
# * STW Can Visible
#--------------------------------------------------------------------------
def stw_can_visible?
return false if !BattleManager.can_enable_window?
return false if @item_window.visible
return false if @skill_window.visible
return true if @actor_window.active
return false
end
if $imported["YEA-CommandEquip"]
#--------------------------------------------------------------------------
# * Command Equip
#--------------------------------------------------------------------------
alias mog_yf_command_equip command_equip
def command_equip
@actor_command_window.visible = false
@actor_command_window.update
$game_temp.battle_hud_visible_refresh = [true,false]
@spriteset.update_battle_hud_ex
@spriteset.battler_sprites.each do |s| s.dispose_animation end
mog_yf_command_equip
$game_temp.battle_hud_visible_refresh = [true,true]
end
end
end
end
#--------------------------------------------------------------------------
######################################
if $imported["YEA-EnemyTargetInfo"]
######################################
#==============================================================================
# ■ Window_Comparison
#==============================================================================
class Window_Comparison < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_yf_refresh refresh
def refresh
mog_battle_hud_ex_yf_refresh
self.z = MOG_BATTLE_HUD_EX::HUD_Z + 152
self.viewport = nil
end
end
#==============================================================================
# ■ Window_ComparisonHelp
#==============================================================================
class Window_ComparisonHelp < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_yf_refresh refresh
def refresh
mog_battle_hud_ex_yf_refresh
self.z = MOG_BATTLE_HUD_EX::HUD_Z + 152
self.viewport = nil
end
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
#################################
if $imported["YEA-EnemyTargetInfo"]
#################################
class Window_Comparison < Window_Base
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
alias mog_battle_hud_yf_wcomparison_initialize initialize
def initialize(type)
mog_battle_hud_yf_wcomparison_initialize(type)
self.z = 102
end
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
#################################
if $imported["YSA-CATB"]
#################################
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_yami_initialize initialize
def initialize(battler, sprite, type)
mog_battle_hud_ex_yami_initialize(battler, sprite, type)
self.z = 90
end
end
#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler < Game_BattlerBase
attr_accessor :catb_value
attr_accessor :max_atb
#--------------------------------------------------------------------------
# * Max ATB
#--------------------------------------------------------------------------
def max_atb
return MAX_CATB_VALUE
return 1
end
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
#==============================================================================
# ** Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_initialize initialize
def initialize
check_screen_xyz_nil rescue nil
mog_battle_hud_ex_initialize
create_battle_hud_ex
end
#--------------------------------------------------------------------------
# * Check Screen Xyz
#--------------------------------------------------------------------------
def check_screen_xyz_nil
return if !SceneManager.face_battler?
for actor in $game_party.battle_members
actor.screen_x = 0 if actor.screen_x == nil
actor.screen_y = 0 if actor.screen_y == nil
actor.screen_z = 0 if actor.screen_z == nil
end
end
#--------------------------------------------------------------------------
# * Check Screen Xyz after
#--------------------------------------------------------------------------
def check_screen_xyz_after
return if !SceneManager.face_battler?
$game_party.battle_members.each_with_index do |actor, index|
actor.screen_x = $game_temp.battler_face_pos[index][0] rescue nil
actor.screen_y = $game_temp.battler_face_pos[index][1] rescue nil
actor.screen_z = $game_temp.battler_face_pos[index][2] rescue nil
end
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_dispose dispose
def dispose
dispose_battle_hud_ex
mog_battle_hud_ex_dispose
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_update update
def update
mog_battle_hud_ex_update
update_battle_hud_ex
end
#--------------------------------------------------------------------------
# * Create Battle Hud EX
#--------------------------------------------------------------------------
def create_battle_hud_ex
return if @battle_hud_ex != nil
$game_temp.battle_hud_visible = true
@battle_hud_ex = Monogatari_Bhud.new(nil)
check_screen_xyz_after
end
#--------------------------------------------------------------------------
# * Dispose Battle Hud EX
#--------------------------------------------------------------------------
def dispose_battle_hud_ex
return if @battle_hud_ex == nil
@battle_hud_ex.dispose
@battle_hud_ex = nil
$game_temp.mbhud_window = [false,false,false,false,false,false,false]
end
#--------------------------------------------------------------------------
# * Update Battle Hud EX
#--------------------------------------------------------------------------
def update_battle_hud_ex
refresh_battle_hud if $game_temp.mbhud_force_refresh
return if @battle_hud_ex == nil
@battle_hud_ex.update
end
#==============================================================================
# ** Monogatari Bhud
#==============================================================================
class Monogatari_Bhud
include MOG_BATTLE_HUD_EX
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
def initialize(viewport)
@pre_message_position = $game_message.position
$game_message.position = MOG_BATTLE_HUD_EX::BATTLE_MESSAGE_POSITION
@battle_hud = []
$game_party.battle_members.each_with_index do |actor, index|
@battle_hud.push(Battle_Hud_EX.new(actor,index,max_members,nil)) end
create_turn_sprite(nil)
end
#--------------------------------------------------------------------------
# * Max members
#--------------------------------------------------------------------------
def max_members
if $game_party.members.size > $game_party.max_battle_members
return $game_party.max_battle_members
end
return $game_party.members.size
end
#--------------------------------------------------------------------------
# * Dispose Turn Sprite
#--------------------------------------------------------------------------
def dispose_turn_sprite
return if @turn_sprite == nil
@turn_sprite.dispose
@turn_sprite = nil
end
#--------------------------------------------------------------------------
# * Update Turn Sprite
#--------------------------------------------------------------------------
def update_turn_sprite
return if @turn_sprite == nil
if @turn_sprite_update_time > 0
@turn_sprite_update_time -= 1
return
end
update_turn_visible if can_refresh_turn_sprite?
update_turn_blink
end
#--------------------------------------------------------------------------
# * Update Turn Visible
#--------------------------------------------------------------------------
def update_turn_visible
$game_temp.refresh_turn_sprite = false
@turn_sprite.visible = $game_temp.command_visible
battler_index = BattleManager.current_index rescue nil
battler_index = 0 if battler_index == nil
x = $game_temp.hud_pos_real[battler_index][0] + TURN_SPRITE_POSITION[0]
y = $game_temp.hud_pos_real[battler_index][1] + TURN_SPRITE_POSITION[1]
@turn_sprite.x = x
@turn_sprite.y = y
end
#--------------------------------------------------------------------------
# * Update Turn Blink
#--------------------------------------------------------------------------
def update_turn_blink
return if !TURN_BLINK_EFFECT
return if !@turn_sprite.visible
@turn_sprite_blink[0] += 1
case @turn_sprite_blink[0]
when 0..30
@turn_sprite_blink[1] += 3
when 31..60
@turn_sprite_blink[1] -= 3
else
@turn_sprite_blink = [0,0]
end
@turn_sprite.opacity = 150 + @turn_sprite_blink[1]
end
end
#==============================================================================
#==============================================================================
# ** Battle Hud EX
#==============================================================================
#==============================================================================
class Battle_Hud_EX
include MOG_BATTLE_HUD_EX
#--------------------------------------------------------------------------
# * Terminate
#--------------------------------------------------------------------------
def terminate
@actor.atb = 0 rescue nil if $imported[:ve_active_time_battle]
end
#--------------------------------------------------------------------------
# * AT
#--------------------------------------------------------------------------
def actor_at
return @actor.at if $imported[:mog_atb_system]
return @actor.atb if $imported[:ve_active_time_battle]
return @actor.catb_value if $imported["YSA-CATB"]
return @actor.ap if @ccwinter_atb != nil
return 0
end
#--------------------------------------------------------------------------
# * Max AT
#--------------------------------------------------------------------------
def actor_max_at
return $game_system.at_max if $imported[:mog_atb_system]
return @actor.max_atb if $imported[:ve_active_time_battle]
return @actor.max_atb if $imported["YSA-CATB"]
return ATB::MAX_AP if @ccwinter_atb != nil
return 1
end
#--------------------------------------------------------------------------
# ● Actor Cast
#--------------------------------------------------------------------------
def actor_cast
return @actor.at_cast[1] if $imported[:mog_atb_system]
return @actor.atb if $imported[:ve_active_time_battle]
return @actor.chant_count rescue 0 if @ccwinter_atb != nil
return 0
end
#--------------------------------------------------------------------------
# ● Actor Max Cast
#--------------------------------------------------------------------------
def actor_max_cast
return @actor.at_cast[0].speed.abs if $imported[:mog_atb_system]
return @actor.max_atb if $imported[:ve_active_time_battle]
return @actor.max_chant_count rescue 1 if @ccwinter_atb != nil
return 1
end
#--------------------------------------------------------------------------
# ● Actor Cast?
#--------------------------------------------------------------------------
def actor_cast?
if $imported[:mog_atb_system]
return true if [email protected]_cast.empty?
end
if $imported[:ve_active_time_battle]
return true if @actor.cast_action?
end
if @ccwinter_atb
return true if @actor.chanting?
end
return false
end
#--------------------------------------------------------------------------
# * Sprite Visible
#--------------------------------------------------------------------------
def sprite_visible?
return false if $game_message.visible and MESSAGE_WINDOW_FADE_HUD
return false if !$game_temp.battle_hud_visible
return true
end
#--------------------------------------------------------------------------
# * Sprite Visible
#--------------------------------------------------------------------------
def sprite_visible(sprite)
if @sprite_visible
sprite.opacity += 5 unless @sprite_visitle_wait > 0
else
sprite.opacity -= 10 ; @sprite_visitle_wait = 5
end
end
end
#==============================================================================
#==============================================================================
# ** Battle Hud EX
#==============================================================================
#==============================================================================
class Battle_Hud_EX
#--------------------------------------------------------------------------
# * Setup Position
#--------------------------------------------------------------------------
def setup_position
sprite_width = (Graphics.width - 64) / 4
sprite_center = sprite_width / 2
if $game_party.battle_members.size > 4
members = $game_party.battle_members.size - 4
fx = 32 * members
else
fx = 0
end
space_x = MEMBERS_SPACE[0] - fx
space_y = MEMBERS_SPACE[1]
center = Graphics.width / 2
members_space = (Graphics.width + space_x) / @max_members
members_space2 = (members_space * @actor_index)
members_space3 = ((members_space / 2) * (@max_members - 1))
members_space_y = space_y * @actor_index
x = HUD_POSITION[0] - sprite_center + center + members_space2 - members_space3
screen_resize_y = 0
screen_resize_y = (Graphics.height - 416) if Graphics.height > 416
y = HUD_POSITION[1] + members_space_y + screen_resize_y
@hud_position = [x,y]
$game_temp.hud_pos_real[@actor_index] = [] if $game_temp.hud_pos_real[@actor_index] == nil
$game_temp.hud_pos_real[@actor_index] = [x,y]
x2 = x + sprite_center
$game_temp.hud_pos[@actor_index] = [] if $game_temp.hud_pos[@actor_index] == nil
$game_temp.hud_pos[@actor_index] = [x2,y]
if FIXED_HUD_POSITION[@actor_index] != nil
@hud_position = [FIXED_HUD_POSITION[@actor_index][0],FIXED_HUD_POSITION[@actor_index][1]]
$game_temp.hud_pos_real[@actor_index] = [@hud_position[0],@hud_position[1]]
$game_temp.hud_pos[@actor_index] = [] if $game_temp.hud_pos[@actor_index] == nil
$game_temp.hud_pos[@actor_index] = [Graphics.width / 2,(Graphics.height / 2) + 96]
end
end
end
#==============================================================================
# ** Game Temp
#==============================================================================
class Game_Temp
attr_accessor :cache_bhud_sprites
#--------------------------------------------------------------------------
# * Cache Battle Hud
#--------------------------------------------------------------------------
def cache_battle_hud
execute_cache_bhud_sprites if @cache_bhud_sprites == nil
end
@cache_bhud_sprites = []
windows = ["Layout_Command","Layout_Party","Layout_Help",
"Layout_Target_Actor","Layout_Target_Enemy","Layout_Skill",
"Layout_Item"]
for s in windows
@cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
end
sprites = ["Layout","Layout_2",
"MP_Number","Max_MP_Number","MP_Icon","MP_Icon_EX","MP_Icon_Number",
"TP_Number","Max_TP_Number","TP_Icon","TP_Icon_EX","TP_Icon_Number",
"AT_Number","Max_AT_Number","AT_Icon","AT_Icon_EX","AT_Icon_Number",
"LV_Number","Turn","Iconset"
]
for s in sprites
@cache_bhud_sprites.push(Cache.battle_hud(s)) rescue nil
end
end
end
#==============================================================================
# ** Spriteset_Map
#==============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
alias mog_monogatari_bhud_initialize initialize
def initialize
$game_temp.cache_battle_hud
mog_monogatari_bhud_initialize
end
end
#==============================================================================
#==============================================================================
# ** Battle Hud EX
#==============================================================================
#==============================================================================
class Battle_Hud_EX
#--------------------------------------------------------------------------
# * Pre Cache
#--------------------------------------------------------------------------
def pre_cache
$game_temp.cache_battle_hud
@force_hide = false
@force_hide_time = 0
@fade_hud = false
@fade_hud_gold = false
@fade_hud_equip = false
@layout_image = Cache.battle_hud("Layout")
@layout_cw = @layout_image.width
@layout_ch = @layout_image.height
@layout2_image = Cache.battle_hud("Layout_2") rescue nil
@layout2_cw = @layout2_image.width if @layout2_image != nil
@layout2_ch = @layout2_image.height if @layout2_image != nil
@layout2_cw = 0 if @layout2_cw == nil
#------------------------------------------------
# HP
#------------------------------------------------
if HP_NUMBER_VISIBLE
@hp_number_image = Cache.battle_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.battle_hud("Max_HP_Number")
@hp_number2_cw = @hp_number2_image.width / 10
@hp_number2_ch = @hp_number2_image.height
end
if HP_METER_VISIBLE
@hp_meter_image = Cache.battle_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.battle_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.battle_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.battle_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.battle_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.battle_hud("Max_MP_Number")
@mp_number2_cw = @mp_number2_image.width / 10
@mp_number2_ch = @mp_number2_image.height
end
if MP_METER_VISIBLE
@mp_meter_image = Cache.battle_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.battle_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.battle_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.battle_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.battle_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.battle_hud("Max_TP_Number")
@tp_number2_cw = @tp_number2_image.width / 10
@tp_number2_ch = @tp_number2_image.height
end
if TP_METER_VISIBLE
@tp_meter_image = Cache.battle_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.battle_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.battle_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.battle_hud("TP_Icon_Number")
@tp_icon_number_cw = @tp_icon_number_image.width / 10
@tp_icon_number_ch = @tp_icon_number_image.height
end
#------------------------------------------------
# AT
#------------------------------------------------
if AT_NUMBER_VISIBLE
@at_number_image = Cache.battle_hud("AT_Number")
@at_number_cw = @at_number_image.width / 10
@at_number_ch = @at_number_image.height
@at_wave_number = AT_NUMBER_WAVE_ALIGN_EFFECT
@at_number_ch += (@at_number_ch / 2) if @at_wave_number
end
if AT_NUMBER_MAX_VISIBLE
@at_number2_image = Cache.battle_hud("Max_AT_Number")
@at_number2_cw = @at_number2_image.width / 10
@at_number2_ch = @at_number2_image.height
end
if AT_METER_VISIBLE
@at_meter_image = Cache.battle_hud("AT_Meter")
if AT_METER_GRADIENT_ANIMATION
@at_meter_cw = @at_meter_image.width / 3
else
@at_meter_cw = @at_meter_image.width
end
@at_meter_ch = @at_meter_image.height / 3
end
#------------------------------------------------
# LV
#------------------------------------------------
if LEVEL_NUMBER_VISIBLE
@lv_number_image = Cache.battle_hud("LV_Number")
@lv_number_cw = @lv_number_image.width / 10
@lv_number_ch = @lv_number_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
#==============================================================================
#==============================================================================
# ** Battle Hud EX
#==============================================================================
#==============================================================================
class Battle_Hud_EX
#--------------------------------------------------------------------------
# * 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 = actor_at if type == 6
actor_value = actor_max_at if type == 7
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
elsif type == 6
@at_number_old = actor_at
@at_number_refresh = true
elsif type == 7
@at_number2_old = actor_max_at
@at_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
@at_number_refresh = true if type == 6
@at_number_old = value if type == 6
@at_number2_refresh = true if type == 7
@at_number2_old = value if type == 7
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
elsif type == 6 and AT_NUMBER_PERCENTAGE
value_max = actor_max_at
value = value.to_f / value_max.to_f * 100
elsif type == 7 and AT_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 = @hud_position[0] + HP_NUMBER_POSITION[0]
when 1; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - (cx / 2)
when 2; @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0] - cx
end
elsif type == 1
case MP_NUMBER_ALIGN_TYPE
when 0; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
when 1; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - (cx / 2)
when 2; @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0] - cx
end
elsif type == 2
case TP_NUMBER_ALIGN_TYPE
when 0; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
when 1; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - (cx / 2)
when 2; @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0] - cx
end
elsif type == 3
case HP_NUMBER_ALIGN_TYPE
when 0; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
when 1; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - (cx / 2)
when 2; @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0] - cx
end
elsif type == 4
case MP_NUMBER_ALIGN_TYPE
when 0; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
when 1; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - (cx / 2)
when 2; @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0] - cx
end
elsif type == 5
case TP_NUMBER_ALIGN_TYPE
when 0; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
when 1; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - (cx / 2)
when 2; @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0] - cx
end
elsif type == 6
case MP_NUMBER_ALIGN_TYPE
when 0; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
when 1; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
when 2; @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0] - cx
end
elsif type == 7
case AT_NUMBER_ALIGN_TYPE
when 0; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0]
when 1; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[0] - (cx / 2)
when 2; @at_number2.x = @hud_position[0] + AT_NUMBER_POSITION[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
@at_number_refresh = false if type == 6
@at_number2_refresh = false if type == 7
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
#==============================================================================
#==============================================================================
# ** Battle Hud EX
#==============================================================================
#==============================================================================
class Battle_Hud_EX
#--------------------------------------------------------------------------
# * 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
sprite_visible(@name)
end
end
#==============================================================================
#==============================================================================
# ** Battle Hud EX
#==============================================================================
#==============================================================================
class Battle_Hud_EX
#--------------------------------------------------------------------------
# * 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 = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
when 1; @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0] - (cx / 2)
when 2; @hp_icon_number.x = @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
sprite_visible(@hp_number)
refresh_number(0,@hp_number_old,@hp_number,@hp_number_image,@hp_number_cw,@hp_number_ch,@hp_wave_number) if @hp_number_refresh
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
sprite_visible(@hp_number2)
end
if @hp_meter != nil
sprite_visible(@hp_meter)
update_flow_hp
end
if @hp_icon != nil
sprite_visible(@hp_icon)
refresh_hp_icon if @hp_icon_old != @actor.hp
end
if @hp_icon3 != nil
sprite_visible(@hp_icon3)
update_icon_hp_ex_anime
end
if @hp_icon_number != nil
sprite_visible(@hp_icon_number)
refresh_icon_number_hp if can_refresh_icon_number_hp?
end
end
end
#==============================================================================
#==============================================================================
# ** Battle Hud EX
#==============================================================================
#==============================================================================
class Battle_Hud_EX
#--------------------------------------------------------------------------
# * 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 = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
when 1; @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0] - (cx / 2)
when 2; @mp_icon_number.x = @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
sprite_visible(@mp_number)
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
end
if @mp_number2 != nil
sprite_visible(@mp_number2)
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
end
if @mp_meter != nil
sprite_visible(@mp_meter)
update_flow_mp
end
if @mp_icon != nil
sprite_visible(@mp_icon)
refresh_mp_icon if @mp_icon_old != @actor.mp
end
if @mp_icon3 != nil
sprite_visible(@mp_icon3)
update_icon_mp_ex_anime
end
if @mp_icon_number != nil
sprite_visible(@mp_icon_number)
refresh_icon_number_mp if can_refresh_icon_number_mp?
end
end
end
#==============================================================================
#==============================================================================
# ** Battle Hud EX
#==============================================================================
#==============================================================================
class Battle_Hud_EX
#--------------------------------------------------------------------------
# * 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 = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
when 1; @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0] - (cx / 2)
when 2; @tp_icon_number.x = @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
sprite_visible(@tp_number)
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
end
if @tp_number2 != nil
sprite_visible(@tp_number2)
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
end
if @tp_meter != nil
sprite_visible(@tp_meter)
update_flow_tp
end
if @tp_icon != nil
sprite_visible(@tp_icon)
refresh_tp_icon if @tp_icon_old != @actor.tp
end
if @tp_icon3 != nil
sprite_visible(@tp_icon3)
update_icon_tp_ex_anime
end
if @tp_icon_number != nil
sprite_visible(@tp_icon_number)
refresh_icon_number_tp if can_refresh_icon_number_tp?
end
end
end
#==============================================================================
#==============================================================================
# ** Battle Hud EX
#==============================================================================
#==============================================================================
class Battle_Hud_EX
#--------------------------------------------------------------------------
# * Update AT
#--------------------------------------------------------------------------
def update_at
if @at_number != nil
sprite_visible(@at_number)
if AT_NUMBER_ANIMATION
update_number(6,@at_number_old)
else
update_number_fix(6) if @at_number_old != actor_at
end
refresh_number(6,@at_number_old,@at_number,@at_number_image,@at_number_cw,@at_number_ch,@at_wave_number) if @at_number_refresh
end
if @at_number2 != nil
sprite_visible(@at_number2)
if AT_NUMBER_ANIMATION
update_number(7,@at_number2_old)
else
update_number_fix(7) if @at_number2_old != actor_max_at
end
refresh_number(7,@at_number2_old,@at_number2,@at_number2_image,@at_number2_cw,@at_number2_ch,@at_wave_number) if @at_number2_refresh
end
if @at_meter != nil
sprite_visible(@at_meter)
update_flow_at
end
end
end
#==============================================================================
#==============================================================================
# ** Battle Hud EX
#==============================================================================
#==============================================================================
class Battle_Hud_EX
#--------------------------------------------------------------------------
# * Refresh States
#--------------------------------------------------------------------------
def refresh_states
check_icon_image
@status_size_real = set_real_states_size
@status_old = @actor.states
@status_flow = [0,0]
@states_size = @status_size_real > 0 ? (26 * @status_size_real) : 24
@actor_status.dispose if @actor_status != nil
@actor_status = Bitmap.new(@states_size,24)
index = 0
for i in @actor.states
next if HIDE_STATES_ID.include?(i.id)
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
#--------------------------------------------------------------------------
# * Set Real States Size
#--------------------------------------------------------------------------
def set_real_states_size
n = 0
for i in @actor.states
next if HIDE_STATES_ID.include?(i.id)
n += 1
end
return n
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
sprite_visible(@status)
refresh_states if @status_old != @actor.states
flow_states
end
end
#==============================================================================
#==============================================================================
# ** Battle Hud EX
#==============================================================================
#==============================================================================
class Battle_Hud_EX
#--------------------------------------------------------------------------
# * Refresh Face
#--------------------------------------------------------------------------
def refresh_face
@face.mirror = false
@face.zoom_x = 1.00
@face.zoom_y = 1.00
@face_index = @actor.face_animation[1]
@face.bitmap.clear
if !FACE_ANIMATION
f_scr = Rect.new(0,0,@face_cw,@face_ch)
else
f_scr = Rect.new(@face_index * @face_cw,0,@face_cw,@face_ch)
end
@face.bitmap.blt(0,0,@face_image,f_scr)
end
#--------------------------------------------------------------------------
# * Update Face Duration
#--------------------------------------------------------------------------
def update_face_duration
return if @actor.face_animation[0] == 0
@actor.face_animation[0] -= 1
update_face_shake_effect
update_face_zoom if @actor.face_animation[1] == 2
return if @actor.face_animation[0] > 0
clear_face_index
end
#--------------------------------------------------------------------------
# * Clear Face Index
#--------------------------------------------------------------------------
def clear_face_index
@actor.face_animation[1] = @actor.low_hp? ? 3 : 0
@actor.face_animation[1] = 4 if @actor.dead?
refresh_face
end
#--------------------------------------------------------------------------
# * Update Face Zoom
#--------------------------------------------------------------------------
def update_face_zoom
return if !FACE_ZOOM_ANIMATION
case @actor.face_animation[0]
when 30..60
@face.zoom_x += 0.01
@face.zoom_x = 1.30 if @face.zoom_x > 1.30
@face.mirror = true unless !FACE_ZOOM_MIRROR_EFFECT
when 1..29
@face.zoom_x -= 0.01
@face.zoom_x = 1.00 if @face.zoom_x < 1.00
@face.mirror = false
else
@face.zoom_x = 1.00
@face.mirror = false
end
@face.zoom_y = @face.zoom_x
end
#--------------------------------------------------------------------------
# * Can Refresh Index MP TP?
#--------------------------------------------------------------------------
def can_refresh_index_mp_tp?
return true if @face_old_mp != @actor.mp
return false
end
#--------------------------------------------------------------------------
# * Refresh Face Index HP
#--------------------------------------------------------------------------
def refresh_face_index_hp
@actor.face_animation[0] = FACE_ANIMATION_DURATION
@actor.face_animation[1] = @face_old_hp > @actor.hp ? 3 : 1
@face_old_hp = @actor.hp
end
#--------------------------------------------------------------------------
# * Refresh Face Index MP TP
#--------------------------------------------------------------------------
def refresh_face_index_mp_tp
if @face_old_mp < @actor.mp
@actor.face_animation[0] = FACE_ANIMATION_DURATION
@actor.face_animation[1] = 1
end
@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 @actor.face_animation[0] > 0 and @actor.face_animation[1] == 3 and @actor.hp > 0
@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 @actor.face_animation[0] == 0
@face.x = @face_org[0]
return
end
if @actor.face_animation[1] == 3 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
sprite_visible(@face)
refresh_face_index_hp if !FACE_ANIMATION and @face_old_hp != @actor.hp
update_face_duration
return if !FACE_ANIMATION
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 != @actor.face_animation[1]
end
end
#==============================================================================
# ■ Battle Manager
#==============================================================================
class << BattleManager
#--------------------------------------------------------------------------
# ● Battle End
#--------------------------------------------------------------------------
alias mog_battle_hud_battle_process_victory process_victory
def process_victory
execute_face_effect
mog_battle_hud_battle_process_victory
end
#--------------------------------------------------------------------------
# ● Prepare
#--------------------------------------------------------------------------
def execute_face_effect
$game_message.position = MOG_BATTLE_HUD_EX::BATTLE_MESSAGE_POSITION
for i in $game_party.members
i.face_animation = [120,1,0] if i.hp > 0
end
end
#--------------------------------------------------------------------------
# * Display EXP Earned
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_message_battle_process_defeat process_defeat
def process_defeat
$game_message.position = MOG_BATTLE_HUD_EX::BATTLE_MESSAGE_POSITION
mog_battle_hud_ex_message_battle_process_defeat
end
#--------------------------------------------------------------------------
# * Process Escape
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_message_battle_process_escape process_escape
def process_escape
$game_message.position = MOG_BATTLE_HUD_EX::BATTLE_MESSAGE_POSITION
mog_battle_hud_ex_message_battle_process_escape
end
#--------------------------------------------------------------------------
# * Display EXP Earned
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_message_battle_display_exp display_exp
def display_exp
$game_message.position = MOG_BATTLE_HUD_EX::BATTLE_MESSAGE_POSITION
mog_battle_hud_ex_message_battle_display_exp
end
#--------------------------------------------------------------------------
# * Gold Acquisition and Display
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_message_battle_gain_gold gain_gold
def gain_gold
$game_message.position = MOG_BATTLE_HUD_EX::BATTLE_MESSAGE_POSITION
mog_battle_hud_ex_message_battle_gain_gold
end
#--------------------------------------------------------------------------
# * Dropped Item Acquisition and Display
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_message_battle_gain_drop_items gain_drop_items
def gain_drop_items
$game_message.position = MOG_BATTLE_HUD_EX::BATTLE_MESSAGE_POSITION
mog_battle_hud_ex_message_battle_gain_drop_items
end
#--------------------------------------------------------------------------
# * EXP Acquisition and Level Up Display
#--------------------------------------------------------------------------
alias mog_battle_hud_ex_message_battle_gain_exp gain_exp
def gain_exp
$game_message.position = MOG_BATTLE_HUD_EX::BATTLE_MESSAGE_POSITION
mog_battle_hud_ex_message_battle_gain_exp
end
end
#==============================================================================
# ** Scene Battle
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# * Use Item
#--------------------------------------------------------------------------
alias mog_monogatari_use_item use_item
def use_item
execute_face_animation
mog_monogatari_use_item
end
#--------------------------------------------------------------------------
# * Execute Face Animation
#--------------------------------------------------------------------------
def execute_face_animation
return if @subject.is_a?(Game_Enemy)
@subject.face_animation = [60 ,2,0]
end
end
#==============================================================================
#==============================================================================
# ** Battle Hud EX
#==============================================================================
#==============================================================================
class Battle_Hud_EX
#--------------------------------------------------------------------------
# * Dispose Layout
#--------------------------------------------------------------------------
def dispose_layout
return if @layout == nil
@layout.dispose
@layout = nil
end
#--------------------------------------------------------------------------
# * Dispose Layout 2
#--------------------------------------------------------------------------
def dispose_layout_2
return if @layout2 == nil
@layout2.dispose
@layout2 = nil
end
#--------------------------------------------------------------------------
# * Dispose Name
#--------------------------------------------------------------------------
def dispose_name
return if @name == nil
@name.bitmap.dispose
@name.dispose
@name = nil
end
#--------------------------------------------------------------------------
# * Dispose Face
#--------------------------------------------------------------------------
def dispose_face
return if @face == nil
@face.bitmap.dispose if @face.bitmap != nil
@face.dispose
@face = nil
@face_image.dispose if @face_image != nil
end
#--------------------------------------------------------------------------
# * Dispose HP Number
#--------------------------------------------------------------------------
def dispose_hp_number
return if @hp_number == nil
@hp_number.bitmap.dispose
@hp_number.dispose
@hp_number = nil
end
#--------------------------------------------------------------------------
# * Dispose HP Number Max
#--------------------------------------------------------------------------
def dispose_hp_number_max
return if @hp_number2 == nil
@hp_number2.bitmap.dispose
@hp_number2.dispose
@hp_number2 = nil
end
#--------------------------------------------------------------------------
# * Dispose HP Meter
#--------------------------------------------------------------------------
def dispose_hp_meter
return if @hp_meter == nil
@hp_meter.bitmap.dispose
@hp_meter.dispose
@hp_meter = nil
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
@hp_icon = nil
end
#--------------------------------------------------------------------------
# * Dispose HP Icon EX
#--------------------------------------------------------------------------
def dispose_hp_icon_ex
return if @hp_icon3 == nil
@hp_icon3.bitmap.dispose
@hp_icon3.dispose
@hp_icon3 = nil
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
@hp_icon_number = nil
end
#--------------------------------------------------------------------------
# * Dispose MP Number
#--------------------------------------------------------------------------
def dispose_mp_number
return if @mp_number == nil
@mp_number.bitmap.dispose
@mp_number.dispose
@mp_number = nil
end
#--------------------------------------------------------------------------
# * Dispose MP Number Max
#--------------------------------------------------------------------------
def dispose_mp_number_max
return if @mp_number2 == nil
@mp_number2.bitmap.dispose
@mp_number2.dispose
@mp_number2 = nil
end
#--------------------------------------------------------------------------
# * Dispose MP Meter
#--------------------------------------------------------------------------
def dispose_mp_meter
return if @mp_meter == nil
@mp_meter.bitmap.dispose
@mp_meter.dispose
@mp_meter = nil
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
@mp_icon = nil
end
#--------------------------------------------------------------------------
# * Dispose MP Icon EX
#--------------------------------------------------------------------------
def dispose_mp_icon_ex
return if @mp_icon3 == nil
@mp_icon3.bitmap.dispose
@mp_icon3.dispose
@mp_icon3 = nil
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
@mp_icon_number = nil
end
#--------------------------------------------------------------------------
# * Dispose TP Number
#--------------------------------------------------------------------------
def dispose_tp_number
return if @tp_number == nil
@tp_number.bitmap.dispose
@tp_number.dispose
@tp_number = nil
end
#--------------------------------------------------------------------------
# * Dispose TP Number Max
#--------------------------------------------------------------------------
def dispose_tp_number_max
return if @tp_number2 == nil
@tp_number2.bitmap.dispose
@tp_number2.dispose
@tp_number2 = nil
end
#--------------------------------------------------------------------------
# * Dispose TP Meter
#--------------------------------------------------------------------------
def dispose_tp_meter
return if @tp_meter == nil
@tp_meter.bitmap.dispose
@tp_meter.dispose
@tp_meter = nil
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
@tp_icon = nil
end
#--------------------------------------------------------------------------
# * Dispose TP Icon EX
#--------------------------------------------------------------------------
def dispose_tp_icon_ex
return if @tp_icon3 == nil
@tp_icon3.bitmap.dispose
@tp_icon3.dispose
@tp_icon3 = nil
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
@tp_icon_numbe = nil
end
#--------------------------------------------------------------------------
# * Dispose AT Number
#--------------------------------------------------------------------------
def dispose_at_number
return if @at_number == nil
@at_number.bitmap.dispose
@at_number.dispose
@at_number = nil
end
#--------------------------------------------------------------------------
# * Dispose AT Number Max
#--------------------------------------------------------------------------
def dispose_at_number_max
return if @at_number2 == nil
@at_number2.bitmap.dispose
@at_number2.dispose
@at_number2 = nil
end
#--------------------------------------------------------------------------
# * Dispose AT Meter
#--------------------------------------------------------------------------
def dispose_at_meter
return if @at_meter == nil
@at_meter.bitmap.dispose
@at_meter.dispose
@at_meter = nil
end
#--------------------------------------------------------------------------
# * Dispose Lv Number
#--------------------------------------------------------------------------
def dispose_lv_number
return if @lv_number == nil
@lv_number.bitmap.dispose
@lv_number.dispose
@lv_number = nil
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
@status = nil
end
end
#==============================================================================
#==============================================================================
# ** Battle Hud EX
#==============================================================================
#==============================================================================
class Battle_Hud_EX
#--------------------------------------------------------------------------
# * Refresh Visible
#--------------------------------------------------------------------------
def refresh_visible(vis)
@layout.visible = vis if @layout
@layout2.visible = vis if @layout2
@name.visible = vis if @name
@lv_number.visible = vis if @lv_number
@status.visible = vis if @status
@face.visible = vis if @face
@hp_number.visible = vis if @hp_number
@hp_number2.visible = vis if @hp_number2
@hp_meter.visible = vis if @hp_meter
@hp_icon.visible = vis if @hp_icon
@hp_icon3.visible = vis if @hp_icon3
@hp_icon_number.visible = vis if @hp_icon_number
@mp_number.visible = vis if @mp_number
@mp_number2.visible = vis if @mp_number2
@mp_meter.visible = vis if @mp_meter
@mp_icon.visible = vis if @mp_icon
@mp_icon3.visible = vis if @mp_icon3
@mp_icon_number.visible = vis if @mp_icon_number
@tp_number.visible = vis if @tp_number
@tp_number2.visible = vis if @tp_number2
@tp_meter.visible = vis if @tp_meter
@tp_icon.visible = vis if @tp_icon
@tp_icon3.visible = vis if @tp_icon3
@tp_icon_number.visible = vis if @tp_icon_number
@at_number.visible = vis if @at_number
@at_number2.visible = vis if @at_number2
@at_meter.visible = vis if @at_meter
end
end
if true
#==============================================================================
# +++ MOG - ATB System (v 1.4) +++
#==============================================================================
# By Moghunter
# http://www.atelier-rgss.com/
#==============================================================================
# Sistema de batalha de turnos em tempo real.
#==============================================================================
#==============================================================================
# ● AT SYSTEM
#==============================================================================
# A velocidade de AT é baseaddo na agilidade do Battler.
# Em caso de batalhas preventivas (Preemptive) os aliados come?ar?o com AT em
# 80% e os inimigos come?ar?o com AT em 0 (Zero)
# Em batalhas surpresas (Surprise) é o inverso das batalhas preventivas.
# Em batalhas normais todos os battlers come?ar?o com AT em 40%.
#==============================================================================
# ● CAST TIME
#==============================================================================
# Para definir uma habilidade ou item com a fun??o de Cast Time basta definir
# o valor da velocidade (Speed) diferente de 0 (Zero).
#
# NOTA - N?o é possível ativar 2 ou mais habilidades com a fun??o Cast Time no
# mesmo turno. (Caso você esteja usando características de Multi Action em
# seu projeto.)
#==============================================================================
module MOG_AT_SYSTEM
#Som quando o sistema AT estiver no maximo
SE_ACTIVE = "Decision2"
#Defini??o do valor de AT para ativar a a??o.(Gauge Meter).
AT_GAUGE_METER = 5000
# Defini??o do tipo de dura??o (Contagem/formula) de um turno.
# Essa defini??o influência na ativa??o dos eventos de batalha.
# (BATTLE EVENTS)
#
# 0 - Dura??o de um turno é um valor fixo.
# 1 - Dura??o de um turno é multiplicado pela quantidade de batllers.
# 2 - Dura??o de um turno é baseado na média de agilidade dos battlers.
#
TURN_DURATION_TYPE = 1
# Defini??o de valor usado para calcular a dura??o de um turno.
TURN_DURATION = 60
# Defini??o da anima??o quando o battler usa habilidades de carregamento.
CAST_ANIMATION = 49
# Ativar a janela de LOG, deixe desativado se desejar uma batalha mais
# dinamica.
WAIT_LOG_WINDOW = false
# Ativar a mensagem inicial com os nomes dos inimigos.
MESSAGE_ENEMY_APPEAR = false
# Tipo de posicionamento da Hud.
# 0 - Posi??o fixa.
# 1 - Posi??o baseado no valor X e Y do battler.
AT_HUD_POSITION_TYPE = 0
#Posi??o geral (Inicial) da Hud.
AT_HUD_POSITION = [25,400]
#Posi??o do medidor de AT
AT_METER_POSITION = [29,1]
#Defini??o da posi??o do espa?o da HUD entre os membros do grupo.
#
#MEMBERS_SPACE = [Horizontal ,Vertical]
#
MEMBERS_SPACE = [136,0]
#Velocidade de anima??o do medidor de at, defina 0 se n?o quiser a anima??o.
AT_METER_FLOW_SPEED = 3
#Prioridade da Hud.
BATTLE_HUD_Z = 0
end
#==============================================================================
# ● Histórico (Version History)
#==============================================================================
# v 1.4 - Melhoria na velocidade da batalha.
#==============================================================================
$imported = {} if $imported.nil?
$imported[:mog_atb_system] = true
#==============================================================================
# ■ Game Temp
#==============================================================================
class Game_Temp
attr_accessor :reset_turn_duration
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias mog_atb_temp_initialize initialize
def initialize
@reset_turn_duration = false
mog_atb_temp_initialize
end
end
#==============================================================================
# ■ Game_System
#==============================================================================
class Game_System
attr_accessor :at_max
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias mog_at_system_initialize initialize
def initialize
@at_max = [[MOG_AT_SYSTEM::AT_GAUGE_METER, 999999].min, 100].max
mog_at_system_initialize
end
end
#==============================================================================
# ■ Game Interpreter
#==============================================================================
class Game_Interpreter
#==============================================================================
# ■ Game Troop
#==============================================================================
class Game_Troop < Game_Unit
#--------------------------------------------------------------------------
# ● Set Turn
#--------------------------------------------------------------------------
def set_turn(turn_value)
@turn_count = turn_value
end
#--------------------------------------------------------------------------
# ● Battle Start
#--------------------------------------------------------------------------
def self.battle_start
$game_system.battle_count += 1
$game_party.on_battle_start
$game_troop.on_battle_start
if MOG_AT_SYSTEM::MESSAGE_ENEMY_APPEAR
$game_troop.enemy_names.each do |name|
$game_message.add(sprintf(Vocab::Emerge, name))
end
end
if @preemptive
$game_message.add(sprintf(Vocab::Preemptive, $game_party.name))
elsif @surprise
$game_message.add(sprintf(Vocab::Surprise, $game_party.name))
end
wait_for_message
end
#--------------------------------------------------------------------------
# ● Input Start
#--------------------------------------------------------------------------
def self.input_start_at(battler)
if @phase != :input
@phase = :input
battler.make_actions
clear_actor
end
return !@surprise && battler.inputable?
end
#--------------------------------------------------------------------------
# ● Preemtive Attack
#--------------------------------------------------------------------------
def self.preemptive_attack
@preemptive
end
#--------------------------------------------------------------------------
# ● Suprise Attack
#--------------------------------------------------------------------------
def self.surprise_attack
@surprise
end
end
#==============================================================================
# ■ Game Action
#==============================================================================
class Game_Action
#--------------------------------------------------------------------------
# ● Prepare
#--------------------------------------------------------------------------
alias mog_at_system_prepare prepare
def prepare
mog_at_system_prepare
set_cast_action
end
#--------------------------------------------------------------------------
# ● Set Cast Action
#--------------------------------------------------------------------------
def set_cast_action
return if forcing
if @item.object != nil and @item.object.speed != 0 and @subject.at_cast.empty?
@subject.at_cast = [@item.object,@item.object.speed.abs,@target_index]
@item.object = nil
@subject.animation_id = MOG_AT_SYSTEM::CAST_ANIMATION
@subject.at = 0
BattleManager.turn_end if @subject.auto_battle?
elsif [email protected]_cast.empty?
if @subject.at_cast[1] == 0
@item.object = @subject.at_cast[0]
@target_index = @subject.at_cast[2]
@subject.at_cast.clear
else
@item.object = nil
end
end
end
end
#==============================================================================
# ■ Game Battler Base
#==============================================================================
class Game_BattlerBase
#--------------------------------------------------------------------------
# ● At
#--------------------------------------------------------------------------
def at
return [[@at, max_at].min, 0].max
end
#--------------------------------------------------------------------------
# ● Max AT
#--------------------------------------------------------------------------
def max_at
return $game_system.at_max
end
#--------------------------------------------------------------------------
# ● Max AT?
#--------------------------------------------------------------------------
def max_at?
self.at >= max_at
end
#--------------------------------------------------------------------------
# ● Added New State
#--------------------------------------------------------------------------
alias mog_at_system_add_new_state add_new_state
def add_new_state(state_id)
mog_at_system_add_new_state(state_id)
if restriction >= 4
self.at_cast.clear
self.at -= 1
self.at = 0 if self.hp == 0
end
end
#--------------------------------------------------------------------------
# ● can AT?
#--------------------------------------------------------------------------
def can_upd_at?
return false if restriction >= 4
return false if self.hp == 0
return false if !self.at_cast.empty?
return false if self.at_action != nil
return false if self.hidden
return false if @wait_motion && $game_temp.battler_in_motion
return true
end
end
#==============================================================================
# ■ Game Enemy
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● Tranform
#--------------------------------------------------------------------------
alias mog_at_system_transform transform
def transform(enemy_id)
mog_at_system_transform(enemy_id)
self.at = 0
self.at_cast.clear
end
end
if !MOG_AT_SYSTEM::WAIT_LOG_WINDOW
#==============================================================================
# ■ BattleManager
#==============================================================================
class Window_BattleLog < Window_Selectable
#--------------------------------------------------------------------------
# ● Refresh
#--------------------------------------------------------------------------
def refresh
end
#--------------------------------------------------------------------------
# * Wait for Effect
#--------------------------------------------------------------------------
def wait_for_effect
return false
end
end
end
#==============================================================================
# ■ Scene Battle
#==============================================================================
class Scene_Battle < Scene_Base
include MOG_AT_SYSTEM
#--------------------------------------------------------------------------
# ● AT Wait
#--------------------------------------------------------------------------
alias mog_at_system_start start
def start
reset_at_parameter
mog_at_system_start
end
#--------------------------------------------------------------------------
# ● Reset AT Parameter
#--------------------------------------------------------------------------
def reset_at_parameter
return if @at_phase != nil
$game_temp.reset_turn_duration = false
@at_phase = 0
nt = $game_system.at_max * 30 / 100
st = $game_system.at_max * 20 / 100
pt = $game_system.at_max * 65 / 100
all_battle_members.each do |battler|
n_at = rand(nt)
p_at = pt + rand(nt)
s_at = rand(st)
if BattleManager.preemptive_attack
battler.at = p_at if battler.is_a?(Game_Actor)
battler.at = s_at if battler.is_a?(Game_Enemy)
elsif BattleManager.surprise_attack
battler.at = p_at if battler.is_a?(Game_Enemy)
battler.at = s_at if battler.is_a?(Game_Actor)
else
battler.at = n_at
end
if battler.at >= $game_system.at_max
battler.at = $game_system.at_max - 1
end
battler.at_cast.clear
end
end
#--------------------------------------------------------------------------
# ● Set Turn Duration
#--------------------------------------------------------------------------
def set_turn_duration
max_battlers = all_battle_members.size > 0 ? all_battle_members.size : 1
case TURN_DURATION_TYPE
when 1
n = TURN_DURATION * max_battlers
when 2
turn_sp = 0
all_battle_members.each do |battler|
turn_sp += battler.agi
end
n = TURN_DURATION + (turn_sp / max_battlers)
else
n = TURN_DURATION
end
turn_time_max = [[n, 9999].min, 120].max
@turn_duration = [0, turn_time_max]
if @status_window != nil
@status_window.open
end
end
#--------------------------------------------------------------------------
# ● Turn End
#--------------------------------------------------------------------------
def turn_end
@at_phase = 0
all_battle_members.each do |battler|
if battler.max_at?
battler.at = 0
refresh_status
@log_window.display_auto_affected_status(battler)
@log_window.wait_and_clear
end
end
BattleManager.turn_end
end
#--------------------------------------------------------------------------
# ● Update Turn Duration
#--------------------------------------------------------------------------
def update_turn_duration
return if @turn_duration == nil or @turn_duration[0] == nil
update_force_reset_turn_duration if $game_temp.reset_turn_duration
@turn_duration[0] += 1
if @turn_duration[0] >= @turn_duration[1]
@turn_duration[0] = 0
$game_troop.increase_turn
process_event
check_states_effect_turn
end
end
#--------------------------------------------------------------------------
# ● Update Force Reset Turn Duration
#--------------------------------------------------------------------------
def update_force_reset_turn_duration
$game_temp.reset_turn_duration = false
@turn_duration[0] = 0
$game_troop.set_turn(0)
end
#--------------------------------------------------------------------------
# ● Check States Effect Turn
#--------------------------------------------------------------------------
def check_states_effect_turn
all_battle_members.each do |battler|
battler.on_turn_end if battler.restriction >= 4
end
end
#--------------------------------------------------------------------------
# ● Update AT System
#--------------------------------------------------------------------------
def update_at_system
reset_at_parameter if @at_phase == nil
set_turn_duration if @turn_duration == nil
return if !can_update_at?
update_turn_duration
all_battle_members.each do |battler|
update_battler_turn_duration(battler)
if !battler.at_cast.empty?
battler.at_cast[1] -= 1
if battler.at_cast[1] <= 0
execute_at_cast(battler)
break
end
else
battler.at += battler.agi unless !battler.can_upd_at?
end
if battler.max_at?
battler.on_turn_end
update_at_actor(battler)
update_at_enemy(battler)
battler.current_action.prepare if battler.current_action
if battler.at_cast.empty?
@at_phase = 1
turn_start if battler.is_a?(Game_Enemy)
end
break
end
end
end
#--------------------------------------------------------------------------
# ● Update Battler Turn Duration
#--------------------------------------------------------------------------
def update_battler_turn_duration(battler)
if battler.restriction >= 4
battler.at_turn_duration += 1
if battler.at_turn_duration >= $game_system.at_max
battler.on_turn_end
battler.at_turn_duration = 0
end
else
battler.at_turn_duration = 0
end
end
#--------------------------------------------------------------------------
# ● Execute AT CAST
#--------------------------------------------------------------------------
def execute_at_cast(battler)
@subject = battler
battler.make_actions
turn_start
end
#--------------------------------------------------------------------------
# ● Update AT Actor
#--------------------------------------------------------------------------
def update_at_actor(battler)
return if !battler.is_a?(Game_Actor)
Audio.se_play("Audio/SE/" + SE_ACTIVE,100,100)
start_party_command_selection_at(battler)
end
#--------------------------------------------------------------------------
# ● Update AT Enemy
#--------------------------------------------------------------------------
def update_at_enemy(battler)
return if !battler.is_a?(Game_Enemy)
battler.make_actions
end
#--------------------------------------------------------------------------
# ● Can Update AT
#--------------------------------------------------------------------------
def can_update_at?
return false if $game_troop.interpreter.running?
return false if BattleManager.action_forced?
return false if @at_phase != 0
return false if $game_message.visible
return false if BattleManager.in_turn?
return true
end
#--------------------------------------------------------------------------
# ● Star Party Command Selection at
#--------------------------------------------------------------------------
def start_party_command_selection_at(battler)
unless scene_changing?
refresh_status
@status_window.unselect
@status_window.open
if BattleManager.input_start_at(battler)
@actor_command_window.close
next_command
else
turn_start
end
end
end
#--------------------------------------------------------------------------
# ● Update Basic
#--------------------------------------------------------------------------
alias mog_at_system_update_basic update_basic
def update_basic
mog_at_system_update_basic
update_at_system
update_party_command
end
#--------------------------------------------------------------------------
# ● Update Party Command
#--------------------------------------------------------------------------
def update_party_command
return if !@party_command_window.active
return if !@actor_command_window.visible
return if $game_message.visible
if Input.trigger?(:B)
next_command
Sound.play_cancel
@party_command_window.active = false
end
end
end
unless $imported[:mog_battle_hud_ex]
#==============================================================================
# ■ Game Temp
#==============================================================================
class Game_Temp
attr_accessor :cache_at_meter
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias mog_at_meter_initialize initialize
def initialize
mog_at_meter_initialize
cache_atmeter
end
#==============================================================================
# ■ AT Meter
#==============================================================================
class AT_Meter
#==============================================================================
# ■ Spriteset Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias mog_at_system_initialize initialize
def initialize
mog_at_system_initialize
create_at_meter
end
#--------------------------------------------------------------------------
# ● Create AT Meter
#--------------------------------------------------------------------------
def create_at_meter
@at_meter = []
for i in $game_party.battle_members
@at_meter.push(AT_Meter.new(i))
end
end
#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
alias mog_at_system_dispose dispose
def dispose
mog_at_system_dispose
dispose_at_meter
end
#--------------------------------------------------------------------------
# ● Dispose AT Meter
#--------------------------------------------------------------------------
def dispose_at_meter
return if @at_meter == nil
@at_meter.each {|sprite| sprite.dispose }
@at_meter = nil
end
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
alias mog_at_system_update update
def update
mog_at_system_update
update_at_meter
end
#--------------------------------------------------------------------------
# ● Update AT Meter
#--------------------------------------------------------------------------
def update_at_meter
return if @at_meter == nil
@at_meter.each {|sprite| sprite.update }
end
end
end
end
#==============================================================================
# +++ MOG - Ayesha AT Gauge (ver 1.3) +++
#==============================================================================
# By Moghunter
# http://www.atelier-rgss.com
#==============================================================================
# Adiciona um medidor animado de AT, incluindo os ícones dos respectivos
# battlers.
#==============================================================================
# Arquivos necessários.
#
# ATB_Layout.png
# ATB_Enemy.png
# ATB_Actor.png
#
# Coloque as imagens na pasta
#
# /Graphics/Ayesha_ATB/
#
#==============================================================================
# Opcional - ícones específicos dos battlers.
#==============================================================================
# Nomeie os arquivos das seguinte forma.
#
# Actor_ + ID.png
# Enemy_ + ID.png
#
#==============================================================================
# Compatível com :
#
# - MOG ATB System (v 1.0)
# - Victor's Active Time Battle (1.05)
# - C Winter's Active Time Battle (1.62)
#
#==============================================================================
# Histórico
#==============================================================================
# v1.3 - Melhoria no efeito de fade ao terminar a batalha.
# v1.2 - Op??o de definir a posi??o Z baseado na altura do sprite.
# v1.1 - Melhoria na transparência inicial.
# - Op??o de ajustar o valor Z baseado na posi??o do ícone.
#==============================================================================
module AYESHA_ATB_GAUGE
#Defini??o do tipo de medidor. (Nota - A imagem original deve ser na vertical)
# 0 - Vertical / 1 - Horizontal
GAUGE_TYPE = 0
#Posi??o geral do medidor
LAYOUT_POS = [480,0]
#Posi??o do ícones dos battlers.
POINT_POS = [2,50]
#Posi??o do ícone quando o battler estiver ativo.
CENTER_POS = [11,9]
#Tamanho do medidor. [Altura e largura]
GAUGE_SIZE = [170,31]
#Posi??o Z do sprite.
SPRITE_Z = 51
#Definir a posi??o z do sprite baseado na altura.
Z_FIX = false
end
$imported = {} if $imported.nil?
$imported[:mog_ayesha_at_gauge] = true
load_bitmap("Graphics/Ayesha_ATB/", filename)
#~ , filename
end
end
#==============================================================================
# ■ Game BattlerBase
#==============================================================================
class Game_BattlerBase
attr_accessor :hidden
end
#==============================================================================
# ■ Game Temp
#==============================================================================
class Game_Temp
attr_accessor :ay_gauge_data
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias mog_ayesha_gauge_initialize initialize
def initialize
@ay_gauge_data = [false,false,[0,0]]
mog_ayesha_gauge_initialize
end
end
#==============================================================================
# ■ Game System
#==============================================================================
class Game_System
attr_accessor :ay_gauge_type
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias mog_ayesha_gauge_sys_initialize initialize
def initialize
@ay_gauge_type = AYESHA_ATB_GAUGE::GAUGE_TYPE
mog_ayesha_gauge_sys_initialize
end
end
#===============================================================================
# ■ Spriteset_Battle
#===============================================================================
class Spriteset_Battle
include AYESHA_ATB_GAUGE
#--------------------------------------------------------------------------
# ● Update Battle Start
#--------------------------------------------------------------------------
alias mog_ayesha_atb_initialize initialize
def initialize
mog_ayesha_atb_initialize
create_ayesha_atb
end
#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------
alias mog_ayesha_atb_dispose dispose
def dispose
dispose_ayesha_atb
mog_ayesha_atb_dispose
end
alias mog_ayesha_atb_update update
def update
mog_ayesha_atb_update
update_ayesha_atb
end
#--------------------------------------------------------------------------
# ● Create Ayesha ATB
#--------------------------------------------------------------------------
def create_ayesha_atb
return if @schala_atb != nil
view = Z_FIX ? @viewport1 : nil
@ayesha_atb = Ayesha_ATB_Gauge.new(view)
end
#--------------------------------------------------------------------------
# ● Dispose ayesha ATB
#--------------------------------------------------------------------------
def dispose_ayesha_atb
return if @ayesha_atb == nil
@ayesha_atb.dispose ; @ayesha_atb = nil
end
#--------------------------------------------------------------------------
# ● Update Schala ATB
#--------------------------------------------------------------------------
def update_ayesha_atb
return if @ayesha_atb == nil
@ayesha_atb.update
end
end
#==============================================================================
# ** Game Interpreter
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# * Command_129
#--------------------------------------------------------------------------
alias mog_ayesha_gauge_command_129 command_129
def command_129
mog_ayesha_gauge_command_129
$game_temp.ay_gauge_data[1] = true if SceneManager.scene_is?(Scene_Battle)
end
end
#==============================================================================
# ■ Ayesha ATB Gauge
#==============================================================================
class Ayesha_ATB_Gauge
include AYESHA_ATB_GAUGE
#--------------------------------------------------------------------------
# ● Dispose Schala Point
#--------------------------------------------------------------------------
def dipose_schala_point
return if self.bitmap == nil or self.bitmap.disposed?
self.bitmap.dispose ; self.bitmap = nil ; dispose_charge
end
#--------------------------------------------------------------------------
# ● Dispose Charge
#--------------------------------------------------------------------------
def dispose_charge
@charge.bitmap.dispose if @charge.bitmap != nil
@charge.dispose
end
#--------------------------------------------------------------------------
# ● Update Schala Point
#--------------------------------------------------------------------------
def update_schala_point
return if self.bitmap == nil or self.bitmap.disposed? or !self.visible
if can_update_atb?
self.opacity += 10 unless @wait_fade > 0; update_atb
else
self.opacity -= 10 ; check_all_dead? if self.opacity == 0
self.zoom_x = 1.00 ; @cast_time[0] = false ; @wait_fade = 2
end
execute_move(0,self.x,@x) ; execute_move(1,self.y,@y)
self.zoom_y = self.zoom_x ; self.opacity = 0 if $game_message.visible
update_charge ; @wait_fade -= 1 if @wait_fade > 0
end
#--------------------------------------------------------------------------
# ● Check All Dead?
#--------------------------------------------------------------------------
def check_all_dead?
return if [email protected]_a?(Game_Enemy)
self.visible = false ; $game_temp.ay_gauge_data[0] = true
$game_troop.members.each {|b| $game_temp.ay_gauge_data[0] = false if !b.dead?}
end
#--------------------------------------------------------------------------
# ● Can Update ATB
#--------------------------------------------------------------------------
def can_update_atb?
return false if @target == nil or @target.dead? or @target.hidden
return false if $game_temp.ay_gauge_data[0]
return true
end
#--------------------------------------------------------------------------
# ● ATB Max
#--------------------------------------------------------------------------
def atb_max?
return true if @atb.abs >= @atb_max.abs
return true if @cast_time[1] > 0
return false
end
#--------------------------------------------------------------------------
# ● Update ATB Type
#--------------------------------------------------------------------------
def update_atb_type
if actor_cast?
@atb_max = actor_max_cast ; @atb = actor_cast ; @cast_time = [true,0]
@charge.visible = true
else
@atb_max = actor_max_at ; @atb = actor_at
@cast_time[1] = cast_wait_time if @cast_time[0] ; @cast_time[1] -= 1 if @cast_time[1] > 0
@cast_time[0] = false ; @charge.visible = false unless @cast_time[1] > 55
end
@atb_max = 1 if @atb_max == 0
end
#--------------------------------------------------------------------------
# ● Execute Move
#--------------------------------------------------------------------------
def execute_move(type,cp,np)
sp = 5 + ((cp - np).abs / 20)
if cp > np
cp -= sp ; cp = np if cp < np
elsif cp < np
cp += sp ; cp = np if cp > np
end
self.x = cp if type == 0 ; self.y = cp if type == 1
end
#--------------------------------------------------------------------------
# * AT
#--------------------------------------------------------------------------
def actor_at
return @target.at if $imported[:mog_atb_system]
return @target.atb if $imported[:ve_active_time_battle]
return @target.catb_value if $imported["YSA-CATB"]
return @target.ap if @ccwinter_atb != nil
return 0
end
#--------------------------------------------------------------------------
# * Max AT
#--------------------------------------------------------------------------
def actor_max_at
return $game_system.at_max if $imported[:mog_atb_system]
return @target.max_atb if $imported[:ve_active_time_battle]
return @target.max_atb if $imported["YSA-CATB"]
return ATB::MAX_AP if @ccwinter_atb != nil
return 1
end
#--------------------------------------------------------------------------
# ● Actor Cast
#--------------------------------------------------------------------------
def actor_cast
return @target.at_cast[1] rescue nil if $imported[:mog_atb_system]
return [email protected] if $imported[:ve_active_time_battle]
return @target.chant_count rescue 0 if @ccwinter_atb != nil
return 0
end
#--------------------------------------------------------------------------
# ● Actor Max Cast
#--------------------------------------------------------------------------
def actor_max_cast
return @target.at_cast[0].speed.abs if $imported[:mog_atb_system]
return @target.max_atb if $imported[:ve_active_time_battle]
return [email protected]_chant_count rescue 1 if @ccwinter_atb != nil
return 1
end
#--------------------------------------------------------------------------
# ● Actor Max Cast
#--------------------------------------------------------------------------
def gauge_cast
return @gauge_size if $imported[:mog_atb_system]
return 0
end
#--------------------------------------------------------------------------
# ● Actor Cast?
#--------------------------------------------------------------------------
def actor_cast?
if $imported[:mog_atb_system]
return true if [email protected]_cast.empty? rescue false
end
if $imported[:ve_active_time_battle]
return true if @target.cast_action? rescue false
end
if @ccwinter_atb
return true if @target.chanting? rescue false
end
return false
end
#--------------------------------------------------------------------------
# ● Cast Wait Time
#--------------------------------------------------------------------------
def cast_wait_time
return 10 if @ccwinter_atb
return 60
end
end
#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler < Game_BattlerBase
attr_accessor :chant_count
attr_accessor :max_chant_count
end
class A1_System::CommonModule
#--------------------------------------------------------------------------
# ○ 定数
#--------------------------------------------------------------------------
TWOBYTE_LIST = {
" " => " ",
"=" => "=",
":" => ":"
}
#--------------------------------------------------------------------------
# ○ オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
define_command
end
#--------------------------------------------------------------------------
# ○ 変換対象の全角文字を半角に置換
#--------------------------------------------------------------------------
def replace_twobyte(str)
for key in TWOBYTE_LIST.keys
str.gsub!(key) {TWOBYTE_LIST[key]}
end
return str
end
#--------------------------------------------------------------------------
# ○ マイナスが含まれている文字列を数値にする
#--------------------------------------------------------------------------
def minus_to_i(s)
if s[0,0] == "-"
s.gsub!("-","")
return s.to_i * -1
else
return s.to_i
end
end
#--------------------------------------------------------------------------
# ○ ミリ秒単位の現在時間
#--------------------------------------------------------------------------
def now_usec
now = Time.now
hour = now.hour * 60 * 60
min = now.min * 60
sec = now.sec
msec = (now.usec / 1000.0).round
return (hour + min + sec) * 1000 + msec
end
#--------------------------------------------------------------------------
# ○ イベントリストの作成
#--------------------------------------------------------------------------
def create_event_list(code, indent, parameters)
list = RPG::EventCommand.new
list.code = code
list.indent = indent
list.parameters = parameters
return list
end
#--------------------------------------------------------------------------
# ○ メソッド呼び出し
#--------------------------------------------------------------------------
def send_method(method_name)
return send(method_name) if respond_to?(method_name)
end
#--------------------------------------------------------------------------
# ○ オブジェクトの型を判断してStringならエンコード
#--------------------------------------------------------------------------
def encoding_string(obj)
obj.force_encoding("UTF-8") if obj.is_a?(String)
return obj
end
#--------------------------------------------------------------------------
# ○ メモの内容から必要な情報を取得
#--------------------------------------------------------------------------
def note_data(note, key)
result = []
note.each_line {|line|
next unless line =~ /<#{key}[ ]?(.*)>/
return true if $1.empty?
data = $a1_common.replace_twobyte($1).split(" ")
for st in data
result.push(st)
end
}
return false if result.empty?
return result
end
#--------------------------------------------------------------------------
# ○ メモの内容からハッシュを作成
#--------------------------------------------------------------------------
def note_data_hash(note, key, data_default = nil, default = {}, ret = {})
list = note_data_split(note, key)
return default if list.empty?
list.each {|data| ret[data[0]] = data[1] ? data[1] : data_default }
return ret
end
#--------------------------------------------------------------------------
# ○ メモの内容からカンマ区切りの多元配列を取得
#--------------------------------------------------------------------------
def note_data_split(note, key, default = [], ret = [])
data = note_data(note, key)
return default unless data.is_a?(Array)
data.each {|str| ret.push(convert_integer_from_array(split_array(str)))}
return ret
end
#--------------------------------------------------------------------------
# ○ 配列の内容から数値があれば変換
#--------------------------------------------------------------------------
def convert_integer_from_array(data, ret = [])
data.each {|str| ret.push(convert_integer(str))}
return ret
end
#--------------------------------------------------------------------------
# ○ 数値があれば変換
#--------------------------------------------------------------------------
def convert_integer(str)
return $1.to_i if str =~ /(^[-]?[0-9]+$)/
str.is_a?(Array) ? convert_integer_from_array(str) : str
end
#--------------------------------------------------------------------------
# ○ メモの内容から単項目の数値を取得
#--------------------------------------------------------------------------
def note_data_one_value(note, key, default)
data = note_data(note, key)
return data[0].to_i if data.is_a?(Array)
return default
end
#--------------------------------------------------------------------------
# ○ メモの内容から単項目を取得
#--------------------------------------------------------------------------
def note_data_one(note, key, default)
data = note_data(note, key)
return data[0] if data.is_a?(Array)
return default
end
#--------------------------------------------------------------------------
# ○ メモの内容からカンマ区切りの文字列を取得
#--------------------------------------------------------------------------
def note_data_array_str(note, key, default)
data = note_data(note, key)
return data[0].split(",") if data.is_a?(Array)
return default
end
#--------------------------------------------------------------------------
# ○ メモの内容からカンマ区切りの数値を取得
#--------------------------------------------------------------------------
def note_data_array_value(note, key, default)
data = note_data(note, key)
return default unless data.is_a?(Array)
return convert_integer_from_array(split_array(data[0]))
end
#--------------------------------------------------------------------------
# ○ カンマ区切りの文字列メモを変換
#--------------------------------------------------------------------------
def note_data_array(note, key, type, default = nil, through = true)
ret = []
default.each {|dat| ret.push(dat)} if default != nil
data = note_data(note, key)
return ret unless data.is_a?(Array)
data = data[0].split(",")
for d in data
next if ret.include?(d) if through
ret.push(d.to_i) if type.is_a?(Integer)
ret.push(d) if type.is_a?(String)
end
return ret
end
#--------------------------------------------------------------------------
# ○ ディレクトリの作成
#--------------------------------------------------------------------------
def make_directory(dir_name)
Dir::mkdir(dir_name) unless FileTest.exist?(dir_name)
end
#--------------------------------------------------------------------------
# ○ コマンドリスト
#--------------------------------------------------------------------------
def make_command(command, src = "", dect = "")
src.gsub!("/","\\")
dect.gsub!("/","\\")
cmd = "#{command} \"#{src}\" \"#{dect}\""
return cmd
end
#--------------------------------------------------------------------------
# ○ 素材の拡張子を取得
#--------------------------------------------------------------------------
def material_ext(directory, file, direct = false)
exts = []
exts = [".png",".bmp",".jpg"] if directory =~ /(.*)Graphics\/(.*)/
exts = [".mid",".ogg",".wav",".mp3",".wma"] if directory =~ /(.*)Audio(.*)/
find_file = sprintf("%s%s", directory, file) unless direct
find_file = file if direct
for ext in exts
return ext if File.exist?(sprintf("%s%s", find_file, ext))
end
return nil
end
#--------------------------------------------------------------------------
# ○ 素材が存在するかチェック
#--------------------------------------------------------------------------
def material_exist?(directory, file, direct = false)
return false if material_ext(directory, file, direct) == nil
return true
end
#--------------------------------------------------------------------------
# ○ ファイルコピー
#--------------------------------------------------------------------------
def copy_file(src, dest)
srcFile = File.open( src, "rb" )
dstFile = File.open( dest, "wb" )
dstFile.write( srcFile.read )
srcFile.close
dstFile.close
end
#--------------------------------------------------------------------------
# ○ ファイルの存在を確認してファイルコピー
#--------------------------------------------------------------------------
def material_copy(src, dest, directory)
ext = material_ext(directory, src, true)
copy_file( src + ext, dest + ext ) if ext != nil
end
#--------------------------------------------------------------------------
# ○ 配列からAudioを作成
#--------------------------------------------------------------------------
def set_audio(sound, kind)
case kind
when "BGM"; audio = RPG::BGM.new
when "BGS"; audio = RPG::BGS.new
when "ME"; audio = RPG::ME.new
when "SE"; audio = RPG::SE.new
end
audio.name = sound[0]
audio.volume = sound[1]
audio.pitch = sound[2]
return audio
end
#--------------------------------------------------------------------------
# ○ 既に準拠識別子を持っているかチェック
#--------------------------------------------------------------------------
def chk_rtp(file_name, default)
return "" if file_name =~ /^VX_.*/
return "" if file_name =~ /^XP_.*/
return "" if file_name =~ /^2000_.*/
return "" if file_name =~ /^2003_.*/
return default
end
#--------------------------------------------------------------------------
# ○ 先頭の $ を切り出す
#--------------------------------------------------------------------------
def one_character(file_name)
return file_name unless file_name[0] == "$"
tmp = file_name.clone
tmp[0] = ""
return tmp
end
#--------------------------------------------------------------------------
# ○ 配列を入れ替える
#--------------------------------------------------------------------------
def change_array(array, index1, index2)
tmp = array[index1]
array[index1] = array[index2]
array[index2] = tmp
return array
end
#--------------------------------------------------------------------------
# ○ 移動ルートの作成
#--------------------------------------------------------------------------
def create_move_route(repeat, skippable, wait, list)
move_route = RPG::MoveRoute.new
move_route.repeat = repeat
move_route.skippable = skippable
move_route.wait = wait
move_route.list = list
return move_route
end
#--------------------------------------------------------------------------
# ○ 移動ルートコマンドの作成
#--------------------------------------------------------------------------
def create_move_command(code, parameters)
list = RPG::MoveCommand.new
list.code = code
list.parameters = parameters
return list
end
#--------------------------------------------------------------------------
# ○ インタプリタ起動用リストの作成
#--------------------------------------------------------------------------
def create_list(code, indent, parameters)
list = RPG::EventCommand.new
list.code = code
list.indent = indent
list.parameters = parameters
return list
end
#--------------------------------------------------------------------------
# ○ クラス名の取得
#--------------------------------------------------------------------------
def class_name(class_instance)
return class_instance.to_s.split(":")[0].gsub("#<","")
end
#--------------------------------------------------------------------------
# ○ 配列を考慮したsplit
#--------------------------------------------------------------------------
def split_array(str)
str = convert_escape_characters(str)
ret = []
tmp_array = str.split(",")
return strip_array_str(tmp_array) unless str.include?("[")
tmp_str = ""
tmp_array.each {|s|
if char_in_str(s, "[", "]") && tmp_str.empty?
ret.push(s) unless s =~ /^\[/
ret.push([s[1...s.size-1]]) if s =~ /^\[/
else
tmp_str = "#{tmp_str}#{s},"
if char_in_str(tmp_str, "[", "]")
unless tmp_str =~ /^\[/
ret.push(tmp_str[0...tmp_str.size-1])
tmp_str = ""
else
tmp_str = tmp_str[1...tmp_str.size-2]
tmp_str = split_array(tmp_str) if tmp_str.include?("[")
tmp_str = tmp_str.split(",") if tmp_str.include?(",")
ret.push(tmp_str) if tmp_str.is_a?(Array)
ret.push([tmp_str]) if !tmp_str.is_a?(Array)
tmp_str = ""
end
end
end
}
return strip_array_str(ret)
end
#--------------------------------------------------------------------------
# ○ 配列の中の文字列の先頭と末尾の空白を除去
#--------------------------------------------------------------------------
def strip_array_str(array, ret = [])
array.each {|str| ret.push(strip_array_str(str)) if str.is_a?(Array); next if str.is_a?(Array); ret.push(str.strip) }
return ret
end
#--------------------------------------------------------------------------
# ○ 文字列の中に文字が何文字含まれているか調べて同数ならtrueを返す
#--------------------------------------------------------------------------
def char_in_str(str, c1, c2)
num1 = 0
num2 = 0
(0...str.size).each {|i| num1 += 1 if str == c1; num2 += 1 if str == c2 }
return num1 == num2
end
#--------------------------------------------------------------------------
# ○ 制御文字の変換
#--------------------------------------------------------------------------
def convert_escape_characters(text)
result = text.to_s.clone
result.gsub!(/\\/) { "\e" }
result.gsub!(/\e\e/) { "\\" }
result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
result.gsub!(/\eN\[(\d+)\]/i) { actor_name($1.to_i) }
result.gsub!(/\eP\[(\d+)\]/i) { party_member_name($1.to_i) }
result.gsub!(/\eG/i) { Vocab::currency_unit }
loop { result = result.sub(/<s>(.+?)<\/s>/i) { eval($1) }; break unless $1 }
result
end
#--------------------------------------------------------------------------
# ○ アクター n 番の名前を取得
#--------------------------------------------------------------------------
def actor_name(n)
actor = n >= 1 ? $game_actors[n] : nil
actor ? actor.name : ""
end
#--------------------------------------------------------------------------
# ○ パーティメンバー n 番の名前を取得
#--------------------------------------------------------------------------
def party_member_name(n)
actor = n >= 1 ? $game_party.members[n - 1] : nil
actor ? actor.name : ""
end
#--------------------------------------------------------------------------
# ○ 配列を全て整数にする
#--------------------------------------------------------------------------
def params_to_i(params)
ret = []
params.each {|param| ret.push(param.to_i)}
return ret
end
#--------------------------------------------------------------------------
# ○ 注釈コマンド定義
#--------------------------------------------------------------------------
def define_command
@cmd_108 = {}
end
#--------------------------------------------------------------------------
# ○ 注釈コマンド定義取得
#--------------------------------------------------------------------------
def cmd_108
@cmd_108
end
#--------------------------------------------------------------------------
# ○ フレーム更新
#--------------------------------------------------------------------------
def update
end
#--------------------------------------------------------------------------
# ○ 文字の幅と高さを取得
#--------------------------------------------------------------------------
def text_size(font, size, text)
bitmap = Cache.system("")
bitmap.font.name = font
bitmap.font.size = size
tw = bitmap.text_size(text).width
th = bitmap.text_size(text).height
bitmap.dispose
return [tw, th]
end
#--------------------------------------------------------------------------
# ○ 文字の幅を取得
#--------------------------------------------------------------------------
def text_width(font, text)
texts = text.split("\n")
@max_width = 0
texts.each {|text|
width = text_size(font.name, font.size, text)[0]
@max_width = @max_width < width ? width : @max_width
}
return @max_width
end
end
#==============================================================================
# ◆ RGSS3用処理
#==============================================================================
if rgss_version == 3
#==============================================================================
# ■ RPG::Tileset
#==============================================================================
class Window_BattleStatus < Window_Selectable
#--------------------------------------------------------------------------
# ☆ リフレッシュ
#--------------------------------------------------------------------------
alias a1_battle_common_wbs_refresh refresh
def refresh
call_method(:refresh_statsu_window)
return unless self.visible
a1_battle_common_wbs_refresh
end
#--------------------------------------------------------------------------
# ○ ウィンドウを開く
#--------------------------------------------------------------------------
def open
super
call_method(:open_status_window)
end
#--------------------------------------------------------------------------
# ○ ウィンドウを閉じる
#--------------------------------------------------------------------------
def close
super
call_method(:close_status_window)
end
#--------------------------------------------------------------------------
# ○ 項目の選択
#--------------------------------------------------------------------------
def select(index)
super
call_method(:select_status_window, index)
end
#--------------------------------------------------------------------------
# ○ フレーム更新
#--------------------------------------------------------------------------
def update
call_method(:update_status_window)
return unless self.visible
super
end
#--------------------------------------------------------------------------
# ○ 解放
#--------------------------------------------------------------------------
def dispose
super
call_method(:dispose_status_window)
end
end
#==============================================================================
# ■ Window_PersonalStatus
#==============================================================================
class Window_PersonalStatus < Window_Base
#--------------------------------------------------------------------------
# ○ オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y, opacity = 0)
super(x, y, Graphics.width / 2, 120)
self.opacity = opacity
self.openness = 0
@actor = nil
end
#--------------------------------------------------------------------------
# ○ アクターの設定
#--------------------------------------------------------------------------
def actor=(actor)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# ○ リフレッシュ
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_face(@actor.face_name, @actor.face_index, 0, 0)
draw_text(116, line_height * 0, contents.width, line_height, @actor.name)
draw_actor_level(@actor, 116, 0 + line_height * 1)
draw_actor_icons(@actor, 180, 0 + line_height * 1)
draw_actor_hp(@actor, 116, 0 + line_height * 2, 128)
draw_actor_mp(@actor, 116, 0 + line_height * 3, 60)
draw_actor_tp(@actor, 184, 0 + line_height * 3, 60) if $data_system.opt_display_tp
end
#--------------------------------------------------------------------------
# ○ フレーム更新
#--------------------------------------------------------------------------
def update
return unless self.visible
super
self.visible = false if self.openness == 0
end
#--------------------------------------------------------------------------
# ○ オープン
#--------------------------------------------------------------------------
def open
self.visible = true
super
end
#--------------------------------------------------------------------------
# ○ 顔グラフィックの描画
#--------------------------------------------------------------------------
def draw_face(face_name, face_index, x, y, enabled = true)
draw_face_no_dispose(face_name, face_index, x, y, enabled)
end
end
#==============================================================================
# ■ RPG::Enemy
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ☆ オブジェクト初期化
#--------------------------------------------------------------------------
alias a1_battle_common_ge_initialize initialize
def initialize(index, enemy_id)
@equips = []
a1_battle_common_ge_initialize(index, enemy_id)
init_equips(enemy.equips)
end
end
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
# アクターを扱うクラスです。このクラスは Game_Actors クラス($game_actors)
# の内部で使用され、Game_Party クラス($game_party)からも参照されます。
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ★ 装備品の初期化
# equips : 初期装備の配列
#--------------------------------------------------------------------------
def init_equips(equips)
super
end
#--------------------------------------------------------------------------
# ★ 装備タイプからスロット ID に変換(空きを優先)
#--------------------------------------------------------------------------
def empty_slot(etype_id)
super
end
#--------------------------------------------------------------------------
# ★ 装備タイプからスロット ID のリストに変換
#--------------------------------------------------------------------------
def slot_list(etype_id)
super
end
#--------------------------------------------------------------------------
# ★ エディタで設定されたインデックスを装備タイプ ID に変換
#--------------------------------------------------------------------------
def index_to_etype_id(index)
super
end
#--------------------------------------------------------------------------
# ★ 装備スロットの配列を取得
#--------------------------------------------------------------------------
def equip_slots
super
end
#--------------------------------------------------------------------------
# ★ 装備品オブジェクトの配列取得
#--------------------------------------------------------------------------
def equips
super
end
#--------------------------------------------------------------------------
# ★ 武器オブジェクトの配列取得
#--------------------------------------------------------------------------
def weapons
super
end
#--------------------------------------------------------------------------
# ★ 通常能力値の加算値取得
#--------------------------------------------------------------------------
def param_plus(param_id)
super
end
#--------------------------------------------------------------------------
# ☆ 通常攻撃 アニメーション ID の取得
#--------------------------------------------------------------------------
alias a1_battle_common_ga_atk_animation_id1 atk_animation_id1
def atk_animation_id1
return a1_battle_common_ga_atk_animation_id1 if !@current_weapon || @current_weapon.is_a?(Array)
@current_weapon.animation_id
end
#--------------------------------------------------------------------------
# ☆ 通常攻撃 アニメーション ID の取得(二刀流:武器2)
#--------------------------------------------------------------------------
alias a1_battle_common_ga_atk_animation_id2 atk_animation_id2
def atk_animation_id2
return a1_battle_common_ga_atk_animation_id2 if !@current_weapon || @current_weapon.is_a?(Array)
@current_weapon.animation_id
end
#--------------------------------------------------------------------------
# ○ 装備タイプ名を取得
#--------------------------------------------------------------------------
def e_type_name(item)
return $data_system.weapon_types[item.wtype_id] if item.is_a?(RPG::Weapon)
return $data_system.armor_types[item.atype_id] if item.is_a?(RPG::Armor)
end
end
#==============================================================================
# ■ Game_BattlerBase
#------------------------------------------------------------------------------
# バトラーを扱う基本のクラスです。主に能力値計算のメソッドを含んでいます。こ
# のクラスは Game_Battler クラスのスーパークラスとして使用されます。
#==============================================================================
class Game_BattlerBase
#--------------------------------------------------------------------------
# ○ 二刀流?
#--------------------------------------------------------------------------
def two_sword_style?
weapons[0] && weapons[1]
end
#--------------------------------------------------------------------------
# ○ バトラーオブジェクト取得
#--------------------------------------------------------------------------
def battler
return actor if self.actor?
return enemy
end
end
#==============================================================================
# ■ Game_Battler
#------------------------------------------------------------------------------
# スプライトや行動に関するメソッドを追加したバトラーのクラスです。このクラス
# は Game_Actor クラスと Game_Enemy クラスのスーパークラスとして使用されます。
#==============================================================================
class Game_Battler < Game_BattlerBase
#--------------------------------------------------------------------------
# ○ 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :current_weapon
attr_accessor :current_main
#--------------------------------------------------------------------------
# ○ 装備品の初期化
# equips : 初期装備の配列
#--------------------------------------------------------------------------
def init_equips(equips)
@equips = Array.new(equip_slots.size) { Game_BaseItem.new }
equips.each_with_index do |item_id, i|
etype_id = index_to_etype_id(i)
slot_id = empty_slot(etype_id)
@equips[slot_id].set_equip(etype_id == 0, item_id) if slot_id
end
refresh
end
#--------------------------------------------------------------------------
# ○ 装備タイプからスロット ID に変換(空きを優先)
#--------------------------------------------------------------------------
def empty_slot(etype_id)
list = slot_list(etype_id)
list.find {|i| @equips.is_nil? } || list[0]
end
#--------------------------------------------------------------------------
# ○ 装備タイプからスロット ID のリストに変換
#--------------------------------------------------------------------------
def slot_list(etype_id)
result = []
equip_slots.each_with_index {|e, i| result.push(i) if e == etype_id }
result
end
#--------------------------------------------------------------------------
# ○ エディタで設定されたインデックスを装備タイプ ID に変換
#--------------------------------------------------------------------------
def index_to_etype_id(index)
index == 1 && dual_wield? ? 0 : index
end
#--------------------------------------------------------------------------
# ○ 装備スロットの配列を取得
#--------------------------------------------------------------------------
def equip_slots
return [0,0,2,3,4] if dual_wield? # 二刀流
return [0,1,2,3,4] # 通常
end
#--------------------------------------------------------------------------
# ○ 装備品オブジェクトの配列取得
#--------------------------------------------------------------------------
def equips
@equips.collect {|item| item.object }
end
#--------------------------------------------------------------------------
# ○ 武器オブジェクトの配列取得
#--------------------------------------------------------------------------
def weapons
@equips.select {|item| item.is_weapon? }.collect {|item| item.object }
end
#--------------------------------------------------------------------------
# ○ 通常能力値の加算値取得
#--------------------------------------------------------------------------
def param_plus(param_id)
equips.compact.inject(super) {|r, item| r += item.params[param_id] + ex_item_params(item, param_id) }
end
#--------------------------------------------------------------------------
# ○ アイテムにかける追加要素
#--------------------------------------------------------------------------
def ex_item_params(item, param_id)
return 0
end
#--------------------------------------------------------------------------
# ○ スキルを取得
#--------------------------------------------------------------------------
def skill(skill_id)
$data_skills[skill_id]
end
end
#==============================================================================
# ■ Game_Party
#------------------------------------------------------------------------------
# パーティを扱うクラスです。所持金やアイテムなどの情報が含まれます。このクラ
# スのインスタンスは $game_party で参照されます。
#==============================================================================
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# ☆ アクターを加える
#--------------------------------------------------------------------------
alias a1_battle_common_gp_add_actor add_actor
def add_actor(actor_id)
return a1_battle_common_gp_add_actor(actor_id) unless in_battle
return if @actors.include?(actor_id)
prev_add_actor(battle_members)
insert_actor(actor_id)
post_add_actor($game_actors[actor_id])
end
#--------------------------------------------------------------------------
# ○ アクターを加える
#--------------------------------------------------------------------------
def insert_actor(actor_id)
@new_index = @remove_member_index ? @remove_member_index[0] : @actors.size
@actors.insert(@new_index, actor_id) unless @actors.include?(actor_id)
$game_player.refresh
$game_map.need_refresh = true
return unless @remove_member_index
@remove_member_index.delete_at(0)
@remove_member_index = nil if @remove_member_index.empty?
end
#--------------------------------------------------------------------------
# ○ アクターを加えたIndexを取得
#--------------------------------------------------------------------------
def new_index
@new_index
end
#--------------------------------------------------------------------------
# ○ アクターを加える前処理
#--------------------------------------------------------------------------
def prev_add_actor(members)
BattleManager.call_method(:prev_add_battler, members)
end
#--------------------------------------------------------------------------
# ○ アクターを加えた後処理
#--------------------------------------------------------------------------
def post_add_actor(member)
BattleManager.call_method(:post_add_battler, member)
end
#--------------------------------------------------------------------------
# ☆ アクターを外す
#--------------------------------------------------------------------------
alias a1_battle_common_gp_remove_actor remove_actor
def remove_actor(actor_id)
prev_remove_actor($game_actors[actor_id]) if in_battle
a1_battle_common_gp_remove_actor(actor_id)
post_remove_actor if in_battle
end
#--------------------------------------------------------------------------
# ○ アクターを外す前処理
#--------------------------------------------------------------------------
def prev_remove_actor(member)
@remove_member_index ||= []
@remove_member_index.push(member.index)
BattleManager.call_method(:prev_remove_battler, member)
end
#--------------------------------------------------------------------------
# ○ アクターを外した後処理
#--------------------------------------------------------------------------
def post_remove_actor
BattleManager.call_method(:post_remove_battler)
end
end
#==============================================================================
# ■ BattleManager
#------------------------------------------------------------------------------
# 戦闘の進行を管理するモジュールです。
#==============================================================================
module BattleManager
#--------------------------------------------------------------------------
# ○ エイリアス用特異メソッド
#--------------------------------------------------------------------------
class << self
alias :a1_battle_common_bm_turn_end :turn_end
alias :a1_battle_common_bm_turn_start :turn_start
alias :a1_battle_common_bm_battle_end :battle_end
end
#--------------------------------------------------------------------------
# ☆ ターン開始
#--------------------------------------------------------------------------
def self.turn_start
@turn_end_wait = 0
a1_battle_common_bm_turn_start
end
#--------------------------------------------------------------------------
# ☆ ターン終了
#--------------------------------------------------------------------------
def self.turn_end
call_method(:wait, @turn_end_wait) if @turn_end_wait > 0
@turn_end_wait = 0
a1_battle_common_bm_turn_end
end
#--------------------------------------------------------------------------
# ○ メソッドの設定
#--------------------------------------------------------------------------
def self.define_method(method, symbol)
@method ||= {}
@method[symbol] = method
end
#--------------------------------------------------------------------------
# ○ メソッドのコール
#--------------------------------------------------------------------------
def self.call_method(symbol, *args)
@method[symbol].call(*args) if @method[symbol]
end
#--------------------------------------------------------------------------
# ○ ターン終了後ウェイト設定
#--------------------------------------------------------------------------
def self.turn_end_wait=(flame)
@turn_end_wait = flame if @turn_end_wait < flame || flame == 0
end
#--------------------------------------------------------------------------
# ☆ 戦闘終了
# result : 結果(0:勝利 1:逃走 2:敗北)
#--------------------------------------------------------------------------
def self.battle_end(result)
call_method(:battle_end, result)
a1_battle_common_bm_battle_end(result)
end
end
#==============================================================================
# ■ Game_Action
#------------------------------------------------------------------------------
# 戦闘行動を扱うクラスです。このクラスは Game_Battler クラスの内部で使用され
# ます。
#==============================================================================
class Game_Action
#--------------------------------------------------------------------------
# ☆ ターゲットの配列作成
#--------------------------------------------------------------------------
alias a1_battle_common_gac_make_targets make_targets
def make_targets
@targets ||= pre_make_targets
return @targets
end
#--------------------------------------------------------------------------
# ○ ターゲットの配列先行作成
#--------------------------------------------------------------------------
def pre_make_targets
@targets = a1_battle_common_gac_make_targets
end
#--------------------------------------------------------------------------
# ○ ターゲットの配列を取得
#--------------------------------------------------------------------------
def targets
@targets.compact
end
#--------------------------------------------------------------------------
# ○ ターゲットの配列をクリア
#--------------------------------------------------------------------------
def clear_targets
@targets = nil
end
end
#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
# バトル画面の処理を行うクラスです。
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ☆ 開始処理
#--------------------------------------------------------------------------
alias a1_battle_common_sb_start start
def start
a1_battle_common_sb_start
define_battle_manager_method
end
#--------------------------------------------------------------------------
# ○ バトルマネージャメソッドの定義
#--------------------------------------------------------------------------
def define_battle_manager_method
BattleManager.define_method(method(:wait), :wait)
BattleManager.define_method(method(:post_add_battler), :post_add_battler)
BattleManager.define_method(method(:post_remove_battler), :post_remove_battler)
BattleManager.define_method(method(:prev_remove_battler), :prev_remove_battler)
BattleManager.define_method(method(:prev_add_battler), :prev_add_battler)
BattleManager.define_method(method(:process_victory), :process_victory)
BattleManager.define_method(method(:battle_end), :battle_end)
end
#--------------------------------------------------------------------------
# ☆ ステータスウィンドウの作成
#--------------------------------------------------------------------------
alias a1_battle_common_sb_create_status_window create_status_window
def create_status_window
a1_battle_common_sb_create_status_window
post_create_status_window
define_status_window_method
end
#--------------------------------------------------------------------------
# ○ ステータスウィンドウ作成の後処理
#--------------------------------------------------------------------------
def post_create_status_window
end
#--------------------------------------------------------------------------
# ○ ステータスウィンドウメソッドの定義
#--------------------------------------------------------------------------
def define_status_window_method
@status_window.define_method(method(:refresh_statsu_window), :refresh_statsu_window)
@status_window.define_method(method(:close_status_window), :close_status_window)
@status_window.define_method(method(:open_status_window), :open_status_window)
@status_window.define_method(method(:select_status_window), :select_status_window)
@status_window.define_method(method(:update_status_window), :update_status_window)
@status_window.define_method(method(:dispose_status_window), :dispose_status_window)
end
#--------------------------------------------------------------------------
# ○ ステータスウィンドウがリフレッシュされた時の処理
#--------------------------------------------------------------------------
def refresh_statsu_window
end
#--------------------------------------------------------------------------
# ○ ステータスウィンドウがクローズされた時の処理
#--------------------------------------------------------------------------
def close_status_window
end
#--------------------------------------------------------------------------
# ○ ステータスウィンドウがオープンされた時の処理
#--------------------------------------------------------------------------
def open_status_window
end
#--------------------------------------------------------------------------
# ○ ステータスウィンドウがセレクトされた時の処理
#--------------------------------------------------------------------------
def select_status_window(index)
end
#--------------------------------------------------------------------------
# ○ ステータスウィンドウが更新された時の処理
#--------------------------------------------------------------------------
def update_status_window
end
#--------------------------------------------------------------------------
# ○ ステータスウィンドウが解放された時の処理
#--------------------------------------------------------------------------
def dispose_status_window
end
#--------------------------------------------------------------------------
# ☆ 情報表示ビューポートの作成
#--------------------------------------------------------------------------
alias a1_battle_common_sb_create_info_viewport create_info_viewport
def create_info_viewport
a1_battle_common_sb_create_info_viewport
post_create_info_viewport
end
#--------------------------------------------------------------------------
# ○ 情報表示ビューポート作成の後処理
#--------------------------------------------------------------------------
def post_create_info_viewport
end
#--------------------------------------------------------------------------
# ☆ スキルウィンドウの作成
#--------------------------------------------------------------------------
alias a1_battle_common_sb_create_skill_window create_skill_window
def create_skill_window
a1_battle_common_sb_create_skill_window
post_create_skill_window
define_skill_window_method
end
#--------------------------------------------------------------------------
# ○ スキルウィンドウ作成の後処理
#--------------------------------------------------------------------------
def post_create_skill_window
end
#--------------------------------------------------------------------------
# ○ スキルウィンドウメソッドの定義
#--------------------------------------------------------------------------
def define_skill_window_method
@skill_window.define_method(method(:skill_item_window_show), :skill_item_window_show)
@skill_window.define_method(method(:skill_item_window_hide), :skill_item_window_hide)
end
#--------------------------------------------------------------------------
# ☆ アイテムウィンドウの作成
#--------------------------------------------------------------------------
alias a1_battle_common_sb_create_item_window create_item_window
def create_item_window
a1_battle_common_sb_create_item_window
post_create_item_window
define_item_window_method
end
#--------------------------------------------------------------------------
# ○ アイテムウィンドウ作成の後処理
#--------------------------------------------------------------------------
def post_create_item_window
end
#--------------------------------------------------------------------------
# ○ アイテムウィンドウメソッドの定義
#--------------------------------------------------------------------------
def define_item_window_method
@item_window.define_method(method(:skill_item_window_show), :skill_item_window_show)
@item_window.define_method(method(:skill_item_window_hide), :skill_item_window_hide)
end
#--------------------------------------------------------------------------
# ○ スキル/アイテムウィンドウが表示された時の処理
#--------------------------------------------------------------------------
def skill_item_window_show
end
#--------------------------------------------------------------------------
# ○ スキル/アイテムウィンドウが非表示になった時の処理
#--------------------------------------------------------------------------
def skill_item_window_hide
end
#--------------------------------------------------------------------------
# ☆ パーティコマンドウィンドウの作成
#--------------------------------------------------------------------------
alias a1_battle_common_sb_create_actor_command_window create_actor_command_window
def create_actor_command_window
a1_battle_common_sb_create_actor_command_window
post_create_actor_command_window
define_actor_command_window_method
define_actor_command_window_handle
end
#--------------------------------------------------------------------------
# ○ パーティコマンドウィンドウ作成の後処理
#--------------------------------------------------------------------------
def post_create_actor_command_window
end
#--------------------------------------------------------------------------
# ○ パーティコマンドウィンドウメソッドの定義
#--------------------------------------------------------------------------
def define_actor_command_window_method
end
#--------------------------------------------------------------------------
# ○ パーティコマンドウィンドウハンドルの定義
#--------------------------------------------------------------------------
def define_actor_command_window_handle
end
#--------------------------------------------------------------------------
# ☆ アクターウィンドウの作成
#--------------------------------------------------------------------------
alias a1_battle_common_sb_create_actor_window create_actor_window
def create_actor_window
a1_battle_common_sb_create_actor_window
post_create_actor_window
define_actor_window_method
end
#--------------------------------------------------------------------------
# ○ アクターウィンドウ作成の後処理
#--------------------------------------------------------------------------
def post_create_actor_window
end
#--------------------------------------------------------------------------
# ○ アクターウィンドウメソッドの定義
#--------------------------------------------------------------------------
def define_actor_window_method
@actor_window.define_method(method(:select_actor), :select_actor)
@actor_window.define_method(method(:select_actor_end), :select_actor_end)
end
#--------------------------------------------------------------------------
# ○ アクターウィンドウをセレクトした時の処理
#--------------------------------------------------------------------------
def select_actor(index)
end
#--------------------------------------------------------------------------
# ○ アクターウィンドウをセレクト終了した時の処理
#--------------------------------------------------------------------------
def select_actor_end
end
#--------------------------------------------------------------------------
# ☆ 敵キャラウィンドウの作成
#--------------------------------------------------------------------------
alias a1_battle_common_sb_create_enemy_window create_enemy_window
def create_enemy_window
a1_battle_common_sb_create_enemy_window
post_create_enemy_window
define_enemy_window_method
end
#--------------------------------------------------------------------------
# ○ 敵キャラウィンドウ作成の後処理
#--------------------------------------------------------------------------
def post_create_enemy_window
end
#--------------------------------------------------------------------------
# ○ 敵キャラウィンドウメソッドの定義
#--------------------------------------------------------------------------
def define_enemy_window_method
@enemy_window.define_method(method(:select_enemy), :select_enemy)
@enemy_window.define_method(method(:select_enemy_end) ,:select_enemy_end)
end
#--------------------------------------------------------------------------
# ○ 敵キャラウィンドウをセレクトした時の処理
#--------------------------------------------------------------------------
def select_enemy(index)
end
#--------------------------------------------------------------------------
# ○ 敵キャラウィンドウをセレクト終了した時の処理
#--------------------------------------------------------------------------
def select_enemy_end
end
#--------------------------------------------------------------------------
# ☆ アクターコマンドウィンドウの作成
#--------------------------------------------------------------------------
alias a1_battle_common_sb_start_create_actor_command_window create_actor_command_window
def create_actor_command_window
a1_battle_common_sb_start_create_actor_command_window
post_create_actor_command_window
define_actor_command_handle
define_actor_command_window
end
#--------------------------------------------------------------------------
# ○ アクターコマンドウィンドウ作成の後処理
#--------------------------------------------------------------------------
def post_create_actor_command_window
end
#--------------------------------------------------------------------------
# ○ アクターコマンドウィンドウメソッドの定義
#--------------------------------------------------------------------------
def define_actor_command_window
@actor_command_window.define_method(method(:actor_command_open), :actor_command_open)
@actor_command_window.define_method(method(:actor_command_close), :actor_command_close)
@actor_command_window.define_method(method(:actor_command_setup), :actor_command_setup)
end
#--------------------------------------------------------------------------
# ○ アクターコマンドウィンドウハンドルの定義
#--------------------------------------------------------------------------
def define_actor_command_handle
end
#--------------------------------------------------------------------------
# ○ アクターコマンドウィンドウがオープンした時の処理
#--------------------------------------------------------------------------
def actor_command_open
end
#--------------------------------------------------------------------------
# ○ アクターコマンドウィンドウがクローズした時の処理
#--------------------------------------------------------------------------
def actor_command_close
end
#--------------------------------------------------------------------------
# ○ アクターコマンドウィンドウのセットアップ時の処理
#--------------------------------------------------------------------------
def actor_command_setup(actor)
end
#--------------------------------------------------------------------------
# ☆ パーティコマンド選択の開始
#--------------------------------------------------------------------------
alias a1_battle_common_sb_start_party_command_selection start_party_command_selection
def start_party_command_selection
prev_start_party_command_selection
a1_battle_common_sb_start_party_command_selection
post_start_party_command_selection
end
#--------------------------------------------------------------------------
# ○ パーティコマンド選択の開始の前処理
#--------------------------------------------------------------------------
def prev_start_party_command_selection
end
#--------------------------------------------------------------------------
# ○ パーティコマンド選択の開始の後処理
#--------------------------------------------------------------------------
def post_start_party_command_selection
end
#--------------------------------------------------------------------------
# ☆ 次のコマンド入力へ
#--------------------------------------------------------------------------
alias a1_battle_common_sb_next_command next_command
def next_command
prev_next_command
a1_battle_common_sb_next_command
post_next_command
end
#--------------------------------------------------------------------------
# ○ 次のコマンド入力への前処理
#--------------------------------------------------------------------------
def prev_next_command
end
#--------------------------------------------------------------------------
# ○ 次のコマンド入力への後処理
#--------------------------------------------------------------------------
def post_next_command
end
#--------------------------------------------------------------------------
# ☆ 前のコマンド入力へ
#--------------------------------------------------------------------------
alias a1_battle_common_sb_prior_command prior_command
def prior_command
prev_prior_command
a1_battle_common_sb_prior_command
post_prior_command
end
#--------------------------------------------------------------------------
# ○ 前のコマンド入力への前処理
#--------------------------------------------------------------------------
def prev_prior_command
end
#--------------------------------------------------------------------------
# ○ 前のコマンド入力への後処理
#--------------------------------------------------------------------------
def post_prior_command
end
#--------------------------------------------------------------------------
# ☆ ターン開始
#--------------------------------------------------------------------------
alias a1_battle_common_sb_turn_start turn_start
def turn_start
prev_turn_start
a1_battle_common_sb_turn_start
post_turn_start
end
#--------------------------------------------------------------------------
# ○ ターン開始の前処理
#--------------------------------------------------------------------------
def prev_turn_start
end
#--------------------------------------------------------------------------
# ○ ターン開始の後処理
#--------------------------------------------------------------------------
def post_turn_start
end
#--------------------------------------------------------------------------
# ☆ ターン終了
#--------------------------------------------------------------------------
alias a1_battle_common_sb_turn_end turn_end
def turn_end
prev_turn_end
a1_battle_common_sb_turn_end
post_turn_end
end
#--------------------------------------------------------------------------
# ○ ターン終了の前処理
#--------------------------------------------------------------------------
def prev_turn_end
end
#--------------------------------------------------------------------------
# ○ ターン終了の後処理
#--------------------------------------------------------------------------
def post_turn_end
end
#--------------------------------------------------------------------------
# ○ ウィンドウが閉じるまでウェイト
#--------------------------------------------------------------------------
def wait_fot_window_close(window)
update_basic while window.close?
end
#--------------------------------------------------------------------------
# ○ アクターのバトルメンバー取得
#--------------------------------------------------------------------------
def battle_members
@party_battle_members ||= $game_party.battle_members
return @party_battle_members
end
#--------------------------------------------------------------------------
# ○ バトルメンバーの追加の前処理
#--------------------------------------------------------------------------
def prev_add_battler(members)
end
#--------------------------------------------------------------------------
# ○ バトルメンバーの追加後の処理
#--------------------------------------------------------------------------
def post_add_battler(member)
@party_battle_members = $game_party.battle_members
end
#--------------------------------------------------------------------------
# ○ バトルメンバー削除の前処理
#--------------------------------------------------------------------------
def prev_remove_battler(member)
end
#--------------------------------------------------------------------------
# ○ バトルメンバーの削除後の処理
#--------------------------------------------------------------------------
def post_remove_battler
@party_battle_members = $game_party.battle_members
end
#--------------------------------------------------------------------------
# ☆ 戦闘行動の実行
#--------------------------------------------------------------------------
alias a1_battle_common_sb_execute_action execute_action
def execute_action
prev_execute_action
a1_battle_common_sb_execute_action
post_execute_action
end
#--------------------------------------------------------------------------
# ○ 戦闘行動の実行の前処理
#--------------------------------------------------------------------------
def prev_execute_action
@subject.current_action.pre_make_targets
end
#--------------------------------------------------------------------------
# ○ 戦闘行動の実行の後処理
#--------------------------------------------------------------------------
def post_execute_action
@subject.current_action.clear_targets if @subject.current_action
end
#--------------------------------------------------------------------------
# ☆ スキル/アイテムの使用
#--------------------------------------------------------------------------
alias a1_battle_common_sb_use_item use_item
def use_item
prev_use_item
a1_battle_common_sb_use_item
post_use_item
end
#--------------------------------------------------------------------------
# ○ スキル/アイテムの使用の前処理
#--------------------------------------------------------------------------
def prev_use_item
end
#--------------------------------------------------------------------------
# ○ スキル/アイテムの使用の後処理
#--------------------------------------------------------------------------
def post_use_item
end
#--------------------------------------------------------------------------
# ○ 勝利の処理
#--------------------------------------------------------------------------
def process_victory
end
#--------------------------------------------------------------------------
# ○ 戦闘終了
#--------------------------------------------------------------------------
def battle_end(result)
$game_party.all_members.each {|member| init_member_battle_end(member) }
end
#--------------------------------------------------------------------------
# ○ 戦闘終了時のメンバー初期化
#--------------------------------------------------------------------------
def init_member_battle_end(member)
member.current_weapon = nil
member.current_main = nil
end
end
end