赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 0 |
最后登录 | 2025-2-23 |
在线时间 | 68 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 112
- 在线时间
- 68 小时
- 注册时间
- 2024-1-8
- 帖子
- 18
|
50星屑
经过初步排查。
先附带物品颜色脚本- #==========================================================================
- # ■ 物品颜色描绘 Ver.1.3 - By 柍若
- # ItemLevelDrawer
- #------------------------------------------------------------------------------
- # Item类窗口中给图标描绘彩色边框以表示品质等级,同时改变名称颜色。
- # 物品、技能、装备等适用。
- #==============================================================================
- #
- # - 2014.02.05 By 柍若
- # * [ BUG修正 ]重定义品质判定算法,兼容性更良。
- # * [ 优化 ]简化写法(基本是重写了)。
- # * [ 补充 ]无限扩张品级数目。支持自定义。
- # * [ 补充 ]添加背景块,支持不透明度设定。
- # * [ 新功能 ]美化品质框,可选圆角或方角形状。
- # * [ 优化 ]修正名称文字显示位置。
- # * [ 新功能 ]定义全局自动/ 手动描绘两种模式可切换。
- # * [ 新功能 ]物品名称可用控制符。
- #
- #------------------------------------------------------------------------------
- # 基于以下脚本
- # 改写已取得两位作者同意
- #==============================================================================
- # - 2012.01.03 By 仲秋启明
- # * 修改为VA定义
- # - 2011.12.27 By 仲秋启明
- # * 移植至RGSS3,遵循PS0协议;
- # * 优化数据库备注中设定方法
- # - 2011.08.22 By 冰舞蝶恋
- # * 蓝本(实用·极简 -- 按品质,给物品描绘色彩边框)
- # - 2010.08.06 By 仲秋启明
- # * 蓝本(物品颜色描绘脚本(完整无冲突版))
- #------------------------------------------------------------------------------
- # [使用说明]
- # - 替换原Window_Base中的draw_item_name定义或复制到Main之前
- #------------------------------------------------------------------------------
- # [使用方法]
- # - 在备注栏内填写"<品质 n>",其中n表示品质等级。
- #==============================================================================
- module ItemLevelDrawer
- #==============================================================================
-
- # true: 默认全局描绘 / false: 手动设置描绘
-
- WhenZero = false # 开启则当品质为0(即不填)时,默认描绘品质1颜色
- #------------------------------------------------------------------------------
- # true: 圆角 / false: 方角
-
- CornerShape = true
- #------------------------------------------------------------------------------
- # 背景块不透明度
-
- BackOpacity = 0
- #------------------------------------------------------------------------------
-
- # 各品质颜色设置,预设7种,可自行添加新品级
- # 数据库设定的品质大于下列品质的最大值时,将不描绘品质
-
- ColorSet = [[255, 255, 255], # 备注 <品质 1> 或不填 [ 白 ]
-
- [128, 255, 128], # 备注 <品质 2> [ 绿 ]
-
- [128, 128, 255], # 备注 <品质 3> [ 蓝 ]
-
- [255, 0, 255], # 备注 <品质 4> [ 紫 ]
-
- [255, 128, 128], # 备注 <品质 5> [ 红 ]
-
- [255, 128, 0], # 备注 <品质 6> [ 橙 ]
-
- [255, 255, 128], # 备注 <品质 7> [ 黄 ]
-
- ]
- #==============================================================================
- end
- #==============================================================================
- # ■ Window_Base
- #==============================================================================
- class Window_Base < Window
- alias din2 draw_item_name
- def draw_item_name(item, x, y, enabled = true, width = 172)
- return unless item
- n = $1.to_i if /<品质 (\d+?)>/i =~ item.note
- x += 2
- return din2(item, x, y, enabled, width) unless n or ItemLevelDrawer::WhenZero and n.to_i <= ItemLevelDrawer::ColorSet.size
- n -= 1 if n and n >= 1
- n = 0 unless n
- n = ItemLevelDrawer::ColorSet[n.to_i]
- self.contents.fill_rect(x+1, y+2, 22, 20, Color.new(n[0], n[1], n[2], ItemLevelDrawer::BackOpacity))
- s = 1 if ItemLevelDrawer::CornerShape
- self.contents.fill_rect(x+s.to_i, y+1, 24-s.to_i*2, 1, Color.new(n[0], n[1], n[2]))
- self.contents.fill_rect(x, y+s.to_i+1, 1, 22-s.to_i*2, Color.new(n[0], n[1], n[2]))
- self.contents.fill_rect(x+s.to_i, y+22, 24-s.to_i*2, 1, Color.new(n[0], n[1], n[2]))
- self.contents.fill_rect(x+23, y+s.to_i+1, 1, 22-s.to_i*2, Color.new(n[0], n[1], n[2]))
- draw_icon(item.icon_index, x, y, enabled)
- change_color(Color.new(n[0], n[1], n[2]), enabled)
- draw_text_ex(x + 30, y, item.name, Color.new(n[0], n[1], n[2]))
- end
- def draw_text_ex(x, y, text, initial_color = normal_color)
- reset_font_settings(initial_color)
- text = convert_escape_characters(text)
- pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
- process_character(text.slice!(0, 1), text, pos) until text.empty?
- end
- def reset_font_settings(initial_color = normal_color)
- change_color(initial_color)
- contents.font.size = Font.default_size
- contents.font.bold = Font.default_bold
- contents.font.italic = Font.default_italic
- end
- end
- #==============================================================================
- # End of Script
- #==============================================================================
复制代码
该脚本可以给物品(装备)在装备栏中和背包栏中附上颜色。
但不知道为什么,和以下mog——战斗hugex脚本同时应用下。
物品的颜色在背包中处于无效状态,必须装备上才有用。
求助大佬们
- #==============================================================================
- # +++ MOG - 战斗 Hud EX (v6.6) +++
- #==============================================================================
- # By Moghunter
- # https://atelierrgss.wordpress.com/
- #==============================================================================
- # 可以在战斗画面中显示各种自定义HUD图片。
- # 全部图片放在文件夹:
- #
- # Graphics/Huds/Battle/
- #==============================================================================
- # 显示或隐藏战斗Hud的脚本
- #
- # battle_hud_visible(false)
- #
- # 或
- #
- # battle_hud_visible(true)
- #
- #==============================================================================
- # 改变脸图的脚本
- #==============================================================================
- #
- # battler_face_name( 角色ID, 脸图文件名 )
- #
- #==============================================================================
- #==============================================================================
- # Atualizações desta versão.
- #==============================================================================
- # (ver 6.6)
- # - Correção do Crash caso optar por desativar o layout das janelas.
- # (ver 6.5)
- # - Melhoria no cálculo da posição Z.
- # - Correção de travar o menu.
- # (ver 6.4)
- # - Correção do glitch de aparecer um pedaço da Windowskin quando se
- # usa mais de 4 battlers na batalha.
- # (ver 6.3)
- # - Compatibilidade com o MOG Battle Camera.
- # (ver 6.2)
- # - Refresh da hud ao trocar a posição dos personagens.
- # (ver 6.0)
- # - Adição da camada da tela.
- # - Adição do efeito Slide.
- # - Adição de novas opções referente a fonte.
- #==============================================================================
- $imported = {} if $imported.nil?
- $imported[:mog_battle_hud_ex] = true
- module MOG_BATTLE_HUD_EX
-
- #============================================================================
- #============================================================================
- # * HUD 精灵 (通用)
- #============================================================================
- # 最大战斗角色数.
- #---------------------------------------------------------------------------
- MAX_BATTLE_MEMBERS = 4
- #---------------------------------------------------------------------------
- # hud的Z坐标.
- #---------------------------------------------------------------------------
- HUD_Z = 0
- #---------------------------------------------------------------------------
- # hud的位置.
- #---------------------------------------------------------------------------
- HUD_POSITION = [0,323]
- #---------------------------------------------------------------------------
- # 调整数字间距
- #---------------------------------------------------------------------------
- MEMBERS_SPACE = [0,0]
- #---------------------------------------------------------------------------
- # 修改指定HUD的位置
- #
- # FIXED_POSITION[索引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]
- #---------------------------------------------------------------------------
- # 修改指定指令窗口的位置
- #---------------------------------------------------------------------------
- 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]
- #---------------------------------------------------------------------------
- # 是否在显示文章时隐藏HUD.
- #---------------------------------------------------------------------------
- MESSAGE_WINDOW_FADE_HUD = true
- #---------------------------------------------------------------------------
- # 设置视为低数值的百分比,这会影响HP、MP、TP的颜色。有快消耗完时改变值槽颜色的
- # 效果
- #---------------------------------------------------------------------------
- LOW_PARAMETER_PERCENTAGE = 30
- #============================================================================
- #============================================================================
-
-
- #============================================================================
- #============================================================================
- # * 名字
- #============================================================================
- # 是否显示名字的精灵
- #---------------------------------------------------------------------------
- NAME_VISIBLE = true
- #---------------------------------------------------------------------------
- # 名字精灵的Z坐标
- #---------------------------------------------------------------------------
- NAME_Z = 1
- #---------------------------------------------------------------------------
- # 名字位置. [X,Y]
- #---------------------------------------------------------------------------
- NAME_POSITION = [0,40]
- #---------------------------------------------------------------------------
- # 设定对齐方式.
- #
- # 0 - 左
- # 1 - 中
- # 2 - 右
- #---------------------------------------------------------------------------
- NAME_ALIGN_TYPE = 0
- #---------------------------------------------------------------------------
- # 字体
- #---------------------------------------------------------------------------
- NAME_FONT_NAME = "黑体"
- #---------------------------------------------------------------------------
- # 字体大小
- #---------------------------------------------------------------------------
- NAME_FONT_SIZE = 16
- #---------------------------------------------------------------------------
- # 是否加粗
- #---------------------------------------------------------------------------
- NAME_FONT_BOLD = true
- #---------------------------------------------------------------------------
- # 是否斜体
- #---------------------------------------------------------------------------
- NAME_FONT_ITALIC = true
- #---------------------------------------------------------------------------
- # 字体颜色
- #---------------------------------------------------------------------------
- NAME_FONT_COLOR = Color.new(255,255,255,255)
- #---------------------------------------------------------------------------
- # 是否显示字体阴影
- #---------------------------------------------------------------------------
- NAME_FONT_SHADOW = false
- #---------------------------------------------------------------------------
- # 字体阴影的颜色
- #---------------------------------------------------------------------------
- NAME_FONT_SHADOW_COLOR = Color.new(0,0,0,255)
- #---------------------------------------------------------------------------
- # 字体阴影的位置
- #---------------------------------------------------------------------------
- NAME_FONT_SHADOW_POSITION = [2,2]
- #============================================================================
- #============================================================================
-
-
- #============================================================================
- #============================================================================
- # * 脸图
- #============================================================================
- # 是否显示脸图.
- # 需要图片:
- #
- # 角色名 + _Face.png
- #
- # Eric_Face.png
- #
- #---------------------------------------------------------------------------
- FACE_VISIBLE = true
- # 是否将角色的脸图作为其战斗图
- # 如果脚本出现问题请设定为"false".
- FACE_BATTLER = true
- #---------------------------------------------------------------------------
- # 脸图的Z坐标.
- #---------------------------------------------------------------------------
- FACE_Z = 0
- #---------------------------------------------------------------------------
- # 脸图的位置. [X,Y]
- #---------------------------------------------------------------------------
- FACE_POSITION = [40,-5]
- #---------------------------------------------------------------------------
- # 是否显示脸图动画.
- # 你需要一张可以分成五分的图片.
- #
- # FACE1/FACE2/FACE3/FACE4
- #
- #---------------------------------------------------------------------------
- FACE_ANIMATION = false
- #---------------------------------------------------------------------------
- # 是否显示脸图的缩放动画
- #---------------------------------------------------------------------------
- FACE_ZOOM_ANIMATION = false
- #---------------------------------------------------------------------------
- # 是否显示脸图镜像效果.
- #---------------------------------------------------------------------------
- FACE_ZOOM_MIRROR_EFFECT = false
- #---------------------------------------------------------------------------
- # 脸图动画的时间.
- #---------------------------------------------------------------------------
- FACE_ANIMATION_DURATION = 40
- #---------------------------------------------------------------------------
- # 是否显示脸图震动效果.
- #---------------------------------------------------------------------------
- FACE_SHAKE_EFFECT = true
- #============================================================================
- #============================================================================
-
-
- #============================================================================
- #============================================================================
- # * 回合数 (实时数值)
- #============================================================================
- # 是否显示回合数的图片
- # 需要图片
- #
- # Turn.png
- #
- #---------------------------------------------------------------------------
- TURN_SPRITE_VISIBLE = true
- #---------------------------------------------------------------------------
- # 回合数图片精灵Z坐标.
- #---------------------------------------------------------------------------
- TURN_SPRITE_Z = 0
- #---------------------------------------------------------------------------
- # 回合数图片位置
- #---------------------------------------------------------------------------
- TURN_SPRITE_POSITION = [-8,-30]
- #---------------------------------------------------------------------------
- # 是否显示闪烁效果
- #---------------------------------------------------------------------------
- TURN_BLINK_EFFECT = true
- #---------------------------------------------------------------------------
-
-
- #============================================================================
- #============================================================================
- # * HP
- #============================================================================
- # 是否显示HP数字图片
- # 需要图片
- #
- # HP_Number.png
- #
- #---------------------------------------------------------------------------
- HP_NUMBER_VISIBLE = true
- #---------------------------------------------------------------------------
- # Hp数字的Z坐标
- #---------------------------------------------------------------------------
- HP_NUMBER_Z = 1
- #---------------------------------------------------------------------------
- # HP数字的位置. [X,Y]
- #---------------------------------------------------------------------------
- HP_NUMBER_POSITION = [147,9]
- #---------------------------------------------------------------------------
- # 是否显示HP总量数字的图片.
- # 需要图片:
- #
- # HP_Number_Max.png
- #
- #---------------------------------------------------------------------------
- HP_NUMBER_MAX_VISIBLE = false
- #---------------------------------------------------------------------------
- # HP总量数字的位置. [X,Y]
- #---------------------------------------------------------------------------
- HP_NUMBER_MAX_POSITION = [163,30]
- #---------------------------------------------------------------------------
- # 设定数字对齐方式.
- #
- # 0 - 左
- # 1 - 中
- # 2 - 右
- #---------------------------------------------------------------------------
- HP_NUMBER_ALIGN_TYPE = 2
- #---------------------------------------------------------------------------
- # 是否显示数字波浪形对齐方式.
- #---------------------------------------------------------------------------
- HP_NUMBER_WAVE_ALIGN_EFFECT = false
- #---------------------------------------------------------------------------
- # 是否以百分比显示数字
- #---------------------------------------------------------------------------
- HP_NUMBER_PERCENTAGE = false
- #---------------------------------------------------------------------------
- # 是否显示数字动画效果 ("滚动").
- #---------------------------------------------------------------------------
- HP_NUMBER_ANIMATION = true
- #---------------------------------------------------------------------------
- # 是否在HP低下时显示另一张颜色的图片作为HP数字.
- # 需要一张被分成两帧高的图片
- #
- # 普通颜色
- # 低下时颜色
- #
- # 如果你设定为false则图片会被分成一帧高.
- #---------------------------------------------------------------------------
- HP_NUMBER_LOW_COLOR = false
- #---------------------------------------------------------------------------
- # 是否使用 HP 条图片.
- # 需要图片.
- #
- # HP_Meter.png
- #
- #---------------------------------------------------------------------------
- HP_METER_VISIBLE = true
- #---------------------------------------------------------------------------
- # 设定HP条的Z坐标.
- #---------------------------------------------------------------------------
- HP_METER_Z = 1
- #---------------------------------------------------------------------------
- # 设定HP条的位置. [X,Y]
- #---------------------------------------------------------------------------
- HP_METER_POSITION = [88,23]
- #---------------------------------------------------------------------------
- # 设定HP条的倾角.
- #---------------------------------------------------------------------------
- HP_METER_ANGLE = 0
- #---------------------------------------------------------------------------
- # 是否显示HP条的镜像效果
- #---------------------------------------------------------------------------
- HP_METER_MIRROR_EFFECT = false
- #---------------------------------------------------------------------------
- # 是否使用HP条在角色受到伤害时显示不同的颜色的效果
- # 需要一张被分成两帧高的图片
- #
- # 普通颜色
- # 受伤颜色
- #
- # 设定为false则显示普通效果.
- #---------------------------------------------------------------------------
- HP_METER_REDUCTION_ANIMATION = true
- #---------------------------------------------------------------------------
- #是否使用HP条的动画流动效果,需要一张宽度为正常大小三倍的图片,图片需要有颜色
- #梯度变化来表现"流动"的效果。
- #设定为false则显示普通效果.
- #---------------------------------------------------------------------------
- HP_METER_GRADIENT_ANIMATION = true
- #---------------------------------------------------------------------------
- # 是否显示HP图标图片.
- # 需要图片:
- #
- # HP_Icon.png
- #
- #---------------------------------------------------------------------------
- HP_ICON_VISIBLE = false
- #---------------------------------------------------------------------------
- # HP图标的Z坐标
- #---------------------------------------------------------------------------
- HP_ICON_Z = 1
- #---------------------------------------------------------------------------
- # HP图标的位置.
- #---------------------------------------------------------------------------
- HP_ICON_POSITION = [200,0]
- #---------------------------------------------------------------------------
- # 是否使用HP图标EX ,其作为HP图标的最后一个图标
- # 需要图片:
- #
- # HP_Icon_EX.png
- #
- #---------------------------------------------------------------------------
- HP_ICON_EX_VISIBLE = false
- #---------------------------------------------------------------------------
- # HP图标EX的位置.
- #---------------------------------------------------------------------------
- HP_ICON_EX_POSITION = [0,0]
- #---------------------------------------------------------------------------
- # 是否显示HP图标EX的缩放效果.
- #---------------------------------------------------------------------------
- HP_ICON_EX_ZOOM_EFFECT = true
- #---------------------------------------------------------------------------
- # HP图标EX的间隔.
- #---------------------------------------------------------------------------
- HP_ICON_SPACE = [-10,-10]
- #---------------------------------------------------------------------------
- # 设置水平上图标的最大数量
- #---------------------------------------------------------------------------
- HP_ICON_COL_MAX = 10
- #---------------------------------------------------------------------------
- # 设置竖直上图标的最大数量
- #---------------------------------------------------------------------------
- HP_ICON_ROW_MAX = 2
- #---------------------------------------------------------------------------
- # 是否显示HP图标图片
- # 需要图片
- #
- # HP_Icon_Number.png
- #
- #---------------------------------------------------------------------------
- HP_ICON_NUMBER_VISIBLE = false
- #---------------------------------------------------------------------------
- # Hp图标的Z坐标
- #---------------------------------------------------------------------------
- HP_ICON_NUMBER_Z = 4
- #---------------------------------------------------------------------------
- # Posição do número do ícone
- #---------------------------------------------------------------------------
- HP_ICON_NUMBER_POSITION = [0,0]
- #---------------------------------------------------------------------------
- # 设定图标数字对齐方式.
- #
- # 0 - 左
- # 1 - 中
- # 2 - 右
- #---------------------------------------------------------------------------
- HP_ICON_NUMBER_ALIGN_TYPE = 0
- #============================================================================
- #============================================================================
-
-
-
- #============================================================================
- #============================================================================
- # * MP
- #============================================================================
- # 是否显示MP数字图片
- # 需要图片
- #
- # MP_Number.png
- #
- #---------------------------------------------------------------------------
- MP_NUMBER_VISIBLE = true
- #---------------------------------------------------------------------------
- # Mp数字的Z坐标
- #---------------------------------------------------------------------------
- MP_NUMBER_Z = 1
- #---------------------------------------------------------------------------
- # MP数字的位置
- #---------------------------------------------------------------------------
- MP_NUMBER_POSITION = [147,35]
- #---------------------------------------------------------------------------
- # 是否显示MP总量数字的图片.
- # 需要图片:
- #
- # MP_Number_Max.png
- #
- #---------------------------------------------------------------------------
- MP_NUMBER_MAX_VISIBLE = false
- #---------------------------------------------------------------------------
- # MP总量数字的位置. [X,Y]
- #---------------------------------------------------------------------------
- MP_NUMBER_MAX_POSITION = [128,53]
- #---------------------------------------------------------------------------
- # 设定数字对齐方式.
- #
- # 0 - 左
- # 1 - 中
- # 2 - 右
- #---------------------------------------------------------------------------
- MP_NUMBER_ALIGN_TYPE = 2
- #---------------------------------------------------------------------------
- #是否显示数字波浪形对齐方式.
- #---------------------------------------------------------------------------
- MP_NUMBER_WAVE_ALIGN_EFFECT = false
- #---------------------------------------------------------------------------
- # 是否以百分比显示数字
- #---------------------------------------------------------------------------
- MP_NUMBER_PERCENTAGE = false
- #---------------------------------------------------------------------------
- # 是否显示数字动画效果 ("滚动").
- #---------------------------------------------------------------------------
- MP_NUMBER_ANIMATION = true
- #---------------------------------------------------------------------------
- # 是否在HP低下时显示另一张颜色的图片作为MP数字.
- # 需要一张被分成两帧高的图片
- #
- # 普通颜色
- # 低下时颜色
- #
- # 如果你设定为false则图片会被分成一帧高.
- #---------------------------------------------------------------------------
- MP_NUMBER_LOW_COLOR = false
- #---------------------------------------------------------------------------
- # 是否使用 MP 条图片.
- # 需要图片.
- #
- # MP_Meter.png
- #
- #---------------------------------------------------------------------------
- MP_METER_VISIBLE = true
- #---------------------------------------------------------------------------
- # 设定MP条的Z坐标.
- #---------------------------------------------------------------------------
- MP_METER_Z = 1
- #---------------------------------------------------------------------------
- # 设定MP条的位置. [X,Y]
- #---------------------------------------------------------------------------
- MP_METER_POSITION = [88,49]
- #---------------------------------------------------------------------------
- # 设定MP条的倾角.
- #---------------------------------------------------------------------------
- MP_METER_ANGLE = 0
- #---------------------------------------------------------------------------
- # 是否显示MP条的镜像效果
- #---------------------------------------------------------------------------
- MP_METER_MIRROR_EFFECT = false
- #---------------------------------------------------------------------------
- # 是否使用MP条在角色受到伤害时显示不同的颜色的效果
- # 需要一张被分成两帧高的图片
- #
- # 普通颜色
- # 受伤颜色
- #
- # 设定为false则显示普通效果.
- #---------------------------------------------------------------------------
- MP_METER_REDUCTION_ANIMATION = true
- #---------------------------------------------------------------------------
- #是否使用MP条的动画流动效果,需要一张宽度为正常大小三倍的图片,图片需要有颜色
- #梯度变化来表现"流动"的效果。
- #设定为false则显示普通效果.
- #---------------------------------------------------------------------------
- MP_METER_GRADIENT_ANIMATION = true
- #---------------------------------------------------------------------------
- # 是否显示MP图标图片.
- # 需要图片:
- #
- # MP_Icon.png
- #
- #---------------------------------------------------------------------------
- MP_ICON_VISIBLE = false
- #---------------------------------------------------------------------------
- # MP图标的Z坐标
- #---------------------------------------------------------------------------
- MP_ICON_Z = 1
- #---------------------------------------------------------------------------
- # MP图标的位置.
- #---------------------------------------------------------------------------
- MP_ICON_POSITION = [200,64]
- #---------------------------------------------------------------------------
- # 是否使用MP图标EX ,其作为MP图标的最后一个图标
- # 需要图片:
- #
- # MP_Icon_EX.png
- #
- #---------------------------------------------------------------------------
- MP_ICON_EX_VISIBLE = false
- #---------------------------------------------------------------------------
- # MP图标EX的位置.
- #---------------------------------------------------------------------------
- MP_ICON_EX_POSITION = [0,0]
- #---------------------------------------------------------------------------
- # 是否显示MP图标EX的缩放效果.
- #---------------------------------------------------------------------------
- MP_ICON_EX_ZOOM_EFFECT = true
- #---------------------------------------------------------------------------
- # MP图标EX的间隔.
- #---------------------------------------------------------------------------
- MP_ICON_SPACE = [-10,-10]
- #---------------------------------------------------------------------------
- # 设置水平上图标的最大数量
- #---------------------------------------------------------------------------
- MP_ICON_COL_MAX = 10
- #---------------------------------------------------------------------------
- # 设置竖直上图标的最大数量
- #---------------------------------------------------------------------------
- MP_ICON_ROW_MAX = 2
- #---------------------------------------------------------------------------
- # 是否显示MP图标图片
- # 需要图片
- #
- # MP_Icon_Number.png
- #
- #---------------------------------------------------------------------------
- MP_ICON_NUMBER_VISIBLE = false
- #---------------------------------------------------------------------------
- # Mp图标的Z坐标
- #---------------------------------------------------------------------------
- MP_ICON_NUMBER_Z = 4
- #---------------------------------------------------------------------------
- # MP图标的位置
- #---------------------------------------------------------------------------
- MP_ICON_NUMBER_POSITION = [0,64]
- #---------------------------------------------------------------------------
- # 设定图标数字对齐方式.
- #
- # 0 - 左
- # 1 - 中
- # 2 - 右
- #---------------------------------------------------------------------------
- MP_ICON_NUMBER_ALIGN_TYPE = 0
- #============================================================================
- #============================================================================
-
-
- #============================================================================
- #============================================================================
- # * TP
- #============================================================================
- # 是否显示TP数字图片
- # 需要图片
- #
- # TP_Number.png
- #
- #---------------------------------------------------------------------------
- TP_NUMBER_VISIBLE = false
- #---------------------------------------------------------------------------
- # Tp数字的Z坐标
- #---------------------------------------------------------------------------
- TP_NUMBER_Z = 5
- #---------------------------------------------------------------------------
- # TP数字的位置. [X,Y]
- #---------------------------------------------------------------------------
- TP_NUMBER_POSITION = [19,23]
- #---------------------------------------------------------------------------
- # 是否显示TP总量数字的图片.
- # 需要图片:
- #
- # TP_Number_Max.png
- #
- #---------------------------------------------------------------------------
- TP_NUMBER_MAX_VISIBLE = false
- #---------------------------------------------------------------------------
- # TP总量数字的位置. [X,Y]
- #---------------------------------------------------------------------------
- TP_NUMBER_MAX_POSITION = [165,73]
- #---------------------------------------------------------------------------
- # 设定数字对齐方式.
- #
- # 0 - 左
- # 1 - 中
- # 2 - 右
- #---------------------------------------------------------------------------
- TP_NUMBER_ALIGN_TYPE = 1
- #---------------------------------------------------------------------------
- # 是否显示数字波浪形对齐方式.
- #---------------------------------------------------------------------------
- TP_NUMBER_WAVE_ALIGN_EFFECT = false
- #---------------------------------------------------------------------------
- # 是否以百分比显示数字
- #---------------------------------------------------------------------------
- TP_NUMBER_PERCENTAGE = false
- #---------------------------------------------------------------------------
- # 是否显示数字动画效果 ("滚动").
- #---------------------------------------------------------------------------
- TP_NUMBER_ANIMATION = true
- #---------------------------------------------------------------------------
- # 是否在HP低下时显示另一张颜色的图片作为TP数字.
- # 需要一张被分成两帧高的图片
- #
- # 普通颜色
- # 低下时颜色
- #
- # 如果你设定为false则图片会被分成一帧高.
- #---------------------------------------------------------------------------
- TP_NUMBER_LOW_COLOR = false
- #---------------------------------------------------------------------------
- # 是否使用 TP 条图片.
- # 需要图片.
- #
- # TP_Meter.png
- #
- #---------------------------------------------------------------------------
- TP_METER_VISIBLE = false
- #---------------------------------------------------------------------------
- # 设定TP条的Z坐标.
- #---------------------------------------------------------------------------
- TP_METER_Z = 1
- #---------------------------------------------------------------------------
- # 设定TP条的位置. [X,Y]
- #---------------------------------------------------------------------------
- TP_METER_POSITION = [68,74]
- #---------------------------------------------------------------------------
- # 设定TP条的倾角.
- #---------------------------------------------------------------------------
- TP_METER_ANGLE = 0
- #---------------------------------------------------------------------------
- # 是否显示TP条的镜像效果
- #---------------------------------------------------------------------------
- TP_METER_MIRROR_EFFECT = false
- #---------------------------------------------------------------------------
- # 是否使用TP条在角色受到伤害时显示不同的颜色的效果
- # 需要一张被分成两帧高的图片
- #
- # 普通颜色
- # 受伤颜色
- #
- # 设定为false则显示普通效果.
- #---------------------------------------------------------------------------
- TP_METER_REDUCTION_ANIMATION = true
- #---------------------------------------------------------------------------
- #是否使用TP条的动画流动效果,需要一张宽度为正常大小三倍的图片,图片需要有颜色
- #梯度变化来表现"流动"的效果。
- #设定为false则显示普通效果.
- #---------------------------------------------------------------------------
- TP_METER_GRADIENT_ANIMATION = true
- #---------------------------------------------------------------------------
- # 是否显示TP图标图片.
- # 需要图片:
- #
- # TP_Icon.png
- #
- #---------------------------------------------------------------------------
- TP_ICON_VISIBLE = false
- #---------------------------------------------------------------------------
- # TP图标的Z坐标
- #---------------------------------------------------------------------------
- TP_ICON_Z = 1
- #---------------------------------------------------------------------------
- # TP图标的位置.
- #---------------------------------------------------------------------------
- TP_ICON_POSITION = [200,128]
- #---------------------------------------------------------------------------
- # 是否使用TP图标EX ,其作为TP图标的最后一个图标
- # 需要图片:
- #
- # TP_Icon_EX.png
- #
- #---------------------------------------------------------------------------
- TP_ICON_EX_VISIBLE = false
- #---------------------------------------------------------------------------
- # TP图标EX的位置.
- #---------------------------------------------------------------------------
- TP_ICON_EX_POSITION = [0,0]
- #---------------------------------------------------------------------------
- # 是否显示TP图标EX的缩放效果.
- #---------------------------------------------------------------------------
- TP_ICON_EX_ZOOM_EFFECT = true
- #---------------------------------------------------------------------------
- # TP图标EX的间隔.
- #---------------------------------------------------------------------------
- TP_ICON_SPACE = [-10,-10]
- #---------------------------------------------------------------------------
- # 设置水平上图标的最大数量
- #---------------------------------------------------------------------------
- TP_ICON_COL_MAX = 10
- #---------------------------------------------------------------------------
- # 设置竖直上图标的最大数量
- #---------------------------------------------------------------------------
- TP_ICON_ROW_MAX = 2
- #---------------------------------------------------------------------------
- # 是否显示TP图标图片
- # 需要图片
- #
- # TP_Icon_Number.png
- #
- #---------------------------------------------------------------------------
- TP_ICON_NUMBER_VISIBLE = false
- #---------------------------------------------------------------------------
- # Tp图标的Z坐标
- #---------------------------------------------------------------------------
- TP_ICON_NUMBER_Z = 4
- #---------------------------------------------------------------------------
- # TP图标的位置
- #---------------------------------------------------------------------------
- TP_ICON_NUMBER_POSITION = [0,128]
- #---------------------------------------------------------------------------
- # 设定图标数字对齐方式.
- #
- # 0 - 左
- # 1 - 中
- # 2 - 右
- #---------------------------------------------------------------------------
- TP_ICON_NUMBER_ALIGN_TYPE = 0
- #============================================================================
- #============================================================================
-
- #============================================================================
- #============================================================================
- # * AT
- #============================================================================
- # 是否显示At数字图片
- # 需要图片
- #
- # AT_Number.png
- #
- #---------------------------------------------------------------------------
- AT_NUMBER_VISIBLE = false
- #---------------------------------------------------------------------------
- # AT数字的Z坐标
- #---------------------------------------------------------------------------
- AT_NUMBER_Z = -180
- #---------------------------------------------------------------------------
- # AT数字的位置. [X,Y]
- #---------------------------------------------------------------------------
- AT_NUMBER_POSITION = [175,-27]
- #---------------------------------------------------------------------------
- # 是否显示AT总量数字的图片.
- # 需要图片:
- #
- # AT_Number_Max.png
- #
- #---------------------------------------------------------------------------
- AT_NUMBER_MAX_VISIBLE = false
- #---------------------------------------------------------------------------
- # AT总量数字的位置. [X,Y]
- #---------------------------------------------------------------------------
- AT_NUMBER_MAX_POSITION = [165,-17]
- #---------------------------------------------------------------------------
- # 设定数字对齐方式.
- #
- # 0 - 左
- # 1 - 中
- # 2 - 右
- #---------------------------------------------------------------------------
- AT_NUMBER_ALIGN_TYPE = 2
- #---------------------------------------------------------------------------
- # 是否显示数字波浪形对齐方式.
- #---------------------------------------------------------------------------
- AT_NUMBER_WAVE_ALIGN_EFFECT = false
- #---------------------------------------------------------------------------
- # 是否以百分比显示数字
- #---------------------------------------------------------------------------
- AT_NUMBER_PERCENTAGE = false
- #---------------------------------------------------------------------------
- # 是否显示数字动画效果 ("滚动").
- #---------------------------------------------------------------------------
- AT_NUMBER_ANIMATION = false
- #---------------------------------------------------------------------------
- # 是否使用 AT 条图片.
- # 需要图片.
- #
- # AT_Meter.png
- #
- #---------------------------------------------------------------------------
- AT_METER_VISIBLE = true
- #---------------------------------------------------------------------------
- # 设定AT条的Z坐标.
- #---------------------------------------------------------------------------
- AT_METER_Z = 1
- #---------------------------------------------------------------------------
- # 设定AT条的位置. [X,Y]
- #---------------------------------------------------------------------------
- AT_METER_POSITION = [84,76]
- #---------------------------------------------------------------------------
- # AT条的倾角.
- #---------------------------------------------------------------------------
- AT_METER_ANGLE = 0
- #---------------------------------------------------------------------------
- # 是否显示AT条的镜像效果
- #---------------------------------------------------------------------------
- AT_METER_MIRROR_EFFECT = false
- #---------------------------------------------------------------------------
- #是否使用AT条的动画流动效果,需要一张宽度为正常大小三倍的图片,图片需要有颜色
- #梯度变化来表现"流动"的效果。
- #设定为false则显示普通效果.
- #---------------------------------------------------------------------------
- AT_METER_GRADIENT_ANIMATION = true
- #============================================================================
-
-
- #============================================================================
- #============================================================================
- # * LEVEL
- #============================================================================
- # 是否显示等级数字图片
- # 需要图片
- #
- # LV_Number.png
- #
- #---------------------------------------------------------------------------
- LEVEL_NUMBER_VISIBLE = false
- #---------------------------------------------------------------------------
- # 等级数字的Z坐标
- #---------------------------------------------------------------------------
- LEVEL_NUMBER_Z = 2
- #---------------------------------------------------------------------------
- # 等级数字的位置. [X,Y]
- #---------------------------------------------------------------------------
- LEVEL_NUMBER_POSITION = [84,0]
- #---------------------------------------------------------------------------
- # 设定数字对齐方式.
- #
- # 0 - 左
- # 1 - 中
- # 2 - 右
- #---------------------------------------------------------------------------
- LEVEL_NUMBER_ALIGN_TYPE = 1
- #============================================================================
- #============================================================================
-
-
- #============================================================================
- #============================================================================
- # * 状态
- #============================================================================
- # 是否显示状态图标
- #---------------------------------------------------------------------------
- STATES_VISIBLE = true
- #---------------------------------------------------------------------------
- # 状态精灵Z坐标
- #---------------------------------------------------------------------------
- STATES_Z = 1
- #---------------------------------------------------------------------------
- # 状态位置. [X,Y]
- #---------------------------------------------------------------------------
- STATES_POSITION = [53,65]
- #---------------------------------------------------------------------------
- # 是否显示状态滚动动画.
- #---------------------------------------------------------------------------
- STATES_SCROLLING_ANIMATION = false
- #---------------------------------------------------------------------------
- # 状态倾角.
- #---------------------------------------------------------------------------
- STATE_ANGLE = 0
- #---------------------------------------------------------------------------
- # 不在hud中显示状态图标的状态.
- # 例子 - HIDE_STATES_ID = [9,10,12,14]
- #---------------------------------------------------------------------------
- HIDE_STATES_ID = []
- #============================================================================
- #============================================================================
- #============================================================================
- #============================================================================
- # * 第二图层 (Overlayer)
- #============================================================================
- # 是否显示第二图层图片
- # 需要图片
- #
- # Layout_2.png
- #
- #============================================================================
- SECOND_LAYOUT = false
- #---------------------------------------------------------------------------
- # 第二图层的Z坐标
- #---------------------------------------------------------------------------
- SECOND_LAYOUT_Z = 4
- #---------------------------------------------------------------------------
- # 第二图层的位置
- #---------------------------------------------------------------------------
- SECOND_LAYOUT_POSITION = [-5,-10]
- #============================================================================
- #============================================================================
-
- #============================================================================
- #============================================================================
- # * 画面图片
- #============================================================================
- # 在画面上显示一张图片.
- # 需要图片:
- #
- # Layout_Screen.png
- #
- #============================================================================
- #是否显示画面图片
- SCREEN_LAYOUT = false
- #---------------------------------------------------------------------------
- #画面图片的位置
- #---------------------------------------------------------------------------
- SCREEN_LAYOUT_POSITION = [-20,330000]
- #---------------------------------------------------------------------------
- #画面图片的Z坐标
- #---------------------------------------------------------------------------
- SCREEN_LAYOUT_Z = -91
-
- end
- #============================================================================
- #============================================================================
- # * 自定义窗口 (通用)
- #============================================================================
- module MOG_BATTLE_HUD_EX
-
- #============================================================================
- # * 是否启用自定义窗口
- #============================================================================
- ENABLE_CUSTOM_WINDOWS = true
- #============================================================================
- # * 战斗日志窗口
- #============================================================================
- # 修改战斗日志窗口的位置
- BATTLE_LOG_POSITION = [0,0]
- #============================================================================
-
- #============================================================================
- # * 字体设定
- #============================================================================
- #是否启用窗口字体
- ENABLE_WINDOW_FONT_SET = false
- #窗口字体名
- WINDOW_FONT_NAME = nil
- #窗口字体大小
- WINDOW_FONT_SIZE = 18
- #窗口字体是否加粗
- WINDOW_FONT_BOLD = true
- #窗口字体是否斜体
- WINDOW_FONT_ITALIC = false
-
- #============================================================================
- # * 技能窗口
- #============================================================================
- #技能窗口大小
- SKILL_WINDOW_SIZE = [640, 120]
- #技能窗口位置.
- SKILL_WINDOW_POSITION = [0,0]
- #技能窗口不透明度
- SKILL_WINDOW_OPACITY = 255
- #是否显示技能窗口的图片. ("Layout_Skill.png")
- SKILL_WINDOW_LAYOUT = false
- #技能窗口图片的位置
- SKILL_WINDOW_LAYOUT_POSITION = [0,-7]
- #Definição da quantidade colunas máxima.
- SKILL_COL_MAX = 2
- #是否显示技能窗口的滑动效果
- SKILL_WINDOW_SLIDE_EFFECT = false
- #技能窗口的滑动位置
- SKILL_WINDOW_SLIDE_POSITION = [150,150]
- #============================================================================
-
- #============================================================================
- # * 物品窗口
- #============================================================================
- #物品窗口大小.
- ITEM_WINDOW_SIZE = [640, 120]
- #物品窗口的位置.
- ITEM_WINDOW_POSITION = [0,0]
- #物品窗口不透明度
- ITEM_WINDOW_OPACITY = 255
- #是否显示物品窗口的图片. ("Layout_Item.png")
- ITEM_WINDOW_LAYOUT = false
- #物品窗口图片的位置.
- ITEM_WINDOW_LAYOUT_POSITION = [0,-7]
- #
- ITEM_COL_MAX = 2
- #是否显示物品窗口的滑动效果
- ITEM_WINDOW_SLIDE_EFFECT = false
- #物品窗口的滑动位置
- ITEM_WINDOW_SLIDE_POSITION = [150,150]
- #============================================================================
-
- #============================================================================
- # * 角色指令窗口(攻击/防御等)
- #============================================================================
- #是否自动调整指令窗口
- AUTO_ADJUST_ACTOR_COMMAND = false #指令窗口的位置
- ACTOR_COMMAND_POSITION = [0,-50]
- #指令窗口不透明度
- ACTOR_COMMAND_OPACITY = 0
- #是否使用指令窗口的图片. ("Layout_Command.png")
- ACTOR_COMMAND_LAYOUT = true
- #指令窗口图片的位置.
- ACTOR_COMMAND_LAYOUT_POSITION = [-20,0]
- #============================================================================
-
- #============================================================================
- # * 帮助窗口
- #============================================================================
- #帮助窗口的大小.
- HELP_WINDOW_SIZE = [640, 72]
- #帮助窗口的位置. HELP_WINDOW_POSITION = [Graphics.width / 2, 0]
- HELP_WINDOW_POSITION = [320, 0]
- #帮助窗口不透明度
- HELP_WINDOW_OPACITY = 255
- #是否显示帮助窗口的图片. ("Layout_Help.png")
- HELP_WINDOW_LAYOUT = false
- #帮助窗口图片的位置.
- HELP_WINDOW_LAYOUT_POSITION = [0,0]
- #是否显示帮助窗口的滑动效果
- HELP_WINDOW_SLIDE_EFFECT = false
- #帮助窗口的滑动位置
- HELP_WINDOW_SLIDE_POSITION = [0,-150]
- #============================================================================
-
- #============================================================================
- # * 目标角色窗口
- #============================================================================
- #角色窗口的大小.
- ACTOR_WINDOW_SIZE = [640, 120]
- #角色窗口的位置.
- ACTOR_WINDOW_POSITION = [320, Graphics.height]
- #角色窗口不透明度.
- ACTOR_WINDOW_OPACITY = 255
- #是否显示角色窗口的图片. ("Layout_Target_Actor.png")
- ACTOR_WINDOW_LAYOUT = false
- #角色窗口图片的位置.
- ACTOR_WINDOW_LAYOUT_POSITION = [320,0]
- #是否显示角色窗口的滑动效果
- ACTOR_WINDOW_SLIDE_EFFECT = false
- #角色窗口的滑动位置
- ACTOR_WINDOW_SLIDE_POSITION = [0,0]
- #============================================================================
-
- #============================================================================
- # * 目标敌人窗口
- #============================================================================
- #敌人窗口的大小.
- ENEMY_WINDOW_SIZE = [640, 120]
- #敌人窗口的位置
- ENEMY_WINDOW_POSITION = [320, Graphics.height]
- #敌人窗口不透明度.
- ENEMY_WINDOW_OPACITY = 255
- #是否显示敌人窗口的图片. ("Layout_Target_Actor.png")
- ENEMY_WINDOW_LAYOUT = false
- #敌人窗口图片的位置.
- ENEMY_WINDOW_LAYOUT_POSITION = [100,0]
- #是否显示敌人窗口的滑动效果
- ENEMY_WINDOW_SLIDE_EFFECT = false
- #敌人窗口的滑动位置
- ENEMY_WINDOW_SLIDE_POSITION = [0,100]
- #============================================================================
-
- #============================================================================
- # * 队伍窗口 (战斗/撤退)
- #============================================================================
- #队伍窗口位置
- PARTY_COMMAND_POSITION = [Graphics.width / 2,Graphics.height / 2]
- #队伍窗口不透明度
- PARTY_COMMAND_OPACITY = 0
- #是否显示队伍窗口的图片 ("Layout_Party.png")
- PARTY_COMMAND_LAYOUT = true
- #队伍窗口图片的位置
- PARTY_COMMAND_LAYOUT_POSITION = [0,0]
- #是否显示队伍窗口的滑动效果
- PARTY_COMMAND_SLIDE_EFFECT = false
- #队伍窗口的滑动位置
- PARTY_COMMAND_SLIDE_POSITION = [0,-150]
- #============================================================================
- end
- #==============================================================================
- # ** 核心
- #==============================================================================
- module Cache
- #--------------------------------------------------------------------------
- # * Hud
- #--------------------------------------------------------------------------
- def self.battle_hud(filename)
- load_bitmap("Graphics/Huds/Battle/", filename)
- end
- end
- #==============================================================================
- # ** Game Temp
- #==============================================================================
- class Game_Temp
-
- attr_accessor :battler_face_pos
- attr_accessor :hud_pos
- attr_accessor :hud_pos_real
- attr_accessor :com_pos
- attr_accessor :mbhud_force_refresh
- attr_accessor :mbhud_window
- attr_accessor :command_visible
- attr_accessor :refresh_turn_sprite
- attr_accessor :battle_hud_visible
- attr_accessor :battle_hud_visible_refresh
- attr_accessor :battle_end
-
- #--------------------------------------------------------------------------
- # * Initialize
- #--------------------------------------------------------------------------
- alias mog_monogatari_bhud_initialize initialize
- def initialize
- @battler_face_pos = []
- @hud_pos = []
- @hud_pos_real = []
- @com_pos = []
- @mbhud_force_refresh = false
- @mbhud_window = [false,false,false,false,false,false,false]
- @command_visible = false
- @refresh_turn_sprite = false
- @battle_hud_visible = true
- @battle_hud_visible_refresh = [false,false]
- @battle_end = false
- mog_monogatari_bhud_initialize
- 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
-
- #--------------------------------------------------------------------------
- # ● Sprite Visible
- #--------------------------------------------------------------------------
- def sprite_visible
- return false if $game_message.visible
- return false if $game_temp.battle_end
- return true
- end
-
- end
- #==============================================================================
- # ** Game Interpreter
- #==============================================================================
- class Game_Interpreter
-
- #--------------------------------------------------------------------------
- # * Refresh Battle Hud
- #--------------------------------------------------------------------------
- def refresh_battle_hud
- $game_temp.check_screen_xyz_nil rescue nil
- $game_temp.mbhud_force_refresh = true
- end
-
- #--------------------------------------------------------------------------
- # * 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
-
- attr_accessor :face_animation
- attr_accessor :battler_face_name
-
- #--------------------------------------------------------------------------
- # * 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
-
- #--------------------------------------------------------------------------
- # ● Remain Exp
- #--------------------------------------------------------------------------
- def remain_exp
- exp - exp_for_level(level)
- end
-
- #--------------------------------------------------------------------------
- # ● Gain Exp Test
- #--------------------------------------------------------------------------
- def gain_exp_test
- exp_r = rand(next_level_exp)
- change_exp(self.exp + (exp_r * final_exp_rate).to_i, false)
- end
-
- #--------------------------------------------------------------------------
- # ● Low HP?
- #--------------------------------------------------------------------------
- def low_hp?
- hp <= (mhp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
- end
-
- #--------------------------------------------------------------------------
- # ● Low MP?
- #--------------------------------------------------------------------------
- def low_mp?
- mp <= (mmp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
- end
-
- #--------------------------------------------------------------------------
- # ● Low TP?
- #--------------------------------------------------------------------------
- def low_tp?
- tp <= (max_tp * MOG_BATTLE_HUD_EX::LOW_PARAMETER_PERCENTAGE) / 100
- end
-
- 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
-
- #--------------------------------------------------------------------------
- # * Swap Order
- #--------------------------------------------------------------------------
- alias mog_bhex_swap_order swap_order
- def swap_order(index1, index2)
- mog_bhex_swap_order(index1, index2)
- if SceneManager.scene_is?(Scene_Battle)
- $game_temp.check_screen_xyz_nil rescue nil
- $game_temp.mbhud_force_refresh = true
- end
- end
-
- end
- #==============================================================================
- # ** BattleManager
- #==============================================================================
- module BattleManager
-
- #--------------------------------------------------------------------------
- # * Current Index
- #--------------------------------------------------------------------------
- def self.current_index
- if $imported[:mog_atb_system]
- return actor.index if actor
- end
- 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
-
- end
- #==============================================================================
- # ** SceneManager
- #==============================================================================
- module SceneManager
-
- #--------------------------------------------------------------------------
- # * Face Battler
- #--------------------------------------------------------------------------
- def self.face_battler?
- return false if !MOG_BATTLE_HUD_EX::FACE_BATTLER
- return false if !MOG_BATTLE_HUD_EX::FACE_VISIBLE
- return false if $imported[:mog_sprite_actor]
- 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 $imported[:Theo_BasicFuntions]
- 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
- #--------------------------------------------------------------------------
- # * Initialize
- #--------------------------------------------------------------------------
- alias mog_bhud_ex_initialize initialize
- def initialize(viewport = nil)
- @ani_x = SceneManager.face_battler? ? MOG_BATTLE_HUD_EX::HUD_Z + 20 : 100
- mog_bhud_ex_initialize(viewport)
- end
-
- #--------------------------------------------------------------------------
- # * 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
- if $imported[:mog_battle_camera]
- @ani_sprites.each_with_index do |sprite, i|
- # sprite.z = @ani_x + i end
- sprite.z = 999 end
- else
- @ani_sprites.each_with_index do |sprite, i|
- #sprite.viewport = nil ; sprite.z = @ani_x + i end
- sprite.viewport = nil ; sprite.z = 999 end
- 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
- @status_window.visible = false
- end
-
- if MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
- #--------------------------------------------------------------------------
- # * On Skill OK
- #--------------------------------------------------------------------------
- alias mog_battle_hud_ex_on_skill_ok on_skill_ok
- def on_skill_ok
- @skill = @skill_window.item
- @skill_window.hide if @skill.for_opponent? or @skill.for_friend?
- mog_battle_hud_ex_on_skill_ok
- end
-
- #--------------------------------------------------------------------------
- # * On Item OK
- #--------------------------------------------------------------------------
- alias mog_battle_hud_on_item_ok on_item_ok
- def on_item_ok
- @item = @item_window.item
- @item_window.hide if @item.for_opponent? or @item.for_friend?
- mog_battle_hud_on_item_ok
- end
-
- #--------------------------------------------------------------------------
- # * On Enemy Cancel
- #--------------------------------------------------------------------------
- alias mog_battle_hud_ex_on_enemy_cancel on_enemy_cancel
- def on_enemy_cancel
- mog_battle_hud_ex_on_enemy_cancel
- @skill_window.show if @skill_window.active
- @item_window.show if @item_window.active
- end
-
- #--------------------------------------------------------------------------
- # * On Actor Cancel
- #--------------------------------------------------------------------------
- alias mog_battle_hud_ex_on_actor_cancel on_actor_cancel
- def on_actor_cancel
- mog_battle_hud_ex_on_actor_cancel
- @skill_window.show if @skill_window.active
- @item_window.show if @item_window.active
- mog_battle_hud_ex_on_actor_cancel
- end
- end
- end
- if SceneManager.face_battler?
- #==============================================================================
- # ■ Game_Actor
- #==============================================================================
- class Game_Actor < Game_Battler
-
- attr_accessor :screen_x
- attr_accessor :screen_y
- attr_accessor :screen_z
-
- #--------------------------------------------------------------------------
- # ● 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
-
- #--------------------------------------------------------------------------
- # ● 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 Bitmap
- #--------------------------------------------------------------------------
- alias mog_battle_hud_ex_update_bitmap update_bitmap
- def update_bitmap
- return if face_can_cancel_method?
- mog_battle_hud_ex_update_bitmap
- end
-
- #--------------------------------------------------------------------------
- # ● Update Position
- #--------------------------------------------------------------------------
- alias mog_battle_hud_ex_update_position update_position
- def update_position
- if @battler.is_a?(Game_Actor) and SceneManager.face_battler?
- if !face_sprite_visible? or $game_temp.battle_end
- self.y = -1000
- return
- end
- 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
- self.opacity = 0
- self.contents_opacity = 0
- self.y = 1200
- 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
- #==============================================================================
- # ** Window_BattleActor
- #==============================================================================
- class Window_BattleActor < Window_BattleStatus
-
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- alias mog_battle_hud_ex_actor_w_refresh refresh
- def refresh
- mog_battle_hud_ex_actor_w_refresh
- self.contents_opacity = 255
- self.opacity = 255 if !MOG_BATTLE_HUD_EX::ENABLE_CUSTOM_WINDOWS
- self.visible = true
- 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]
- self.z = MOG_BATTLE_HUD_EX::HUD_Z + 140
- 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]
- self.z = MOG_BATTLE_HUD_EX::HUD_Z + 140
- 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 if $imported[:mog_battle_command_ex] == nil
- end
-
- #--------------------------------------------------------------------------
- # * Dispose
- #--------------------------------------------------------------------------
- alias mog_monogatari_actor_command_dispose dispose
- def dispose
- mog_monogatari_actor_command_dispose
- dispose_layout
- end
-
- #--------------------------------------------------------------------------
- # * Create Layout
- #--------------------------------------------------------------------------
- def create_layout
- return if @layout != nil
- return if !ACTOR_COMMAND_LAYOUT
- return if $game_temp.mbhud_window[0]
- self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
- $game_temp.mbhud_window[0] = true
- @layout = Sprite.new
- @layout.bitmap = Cache.battle_hud("Layout_Command")
- @layout.z = self.z - 1
- @layout.x = self.x + ACTOR_COMMAND_LAYOUT_POSITION[0]
- @layout.y = self.y + ACTOR_COMMAND_LAYOUT_POSITION[1]
- @layout.visible = false
- end
-
- #--------------------------------------------------------------------------
- # * Dispose Layout
- #--------------------------------------------------------------------------
- def dispose_layout
- return if @layout == nil
- @layout.dispose
- @layout = nil
- end
-
- #--------------------------------------------------------------------------
- # * Refresh Layout
- #--------------------------------------------------------------------------
- def refresh_layout
- return if @layout == nil
- @layout.x = self.x + ACTOR_COMMAND_LAYOUT_POSITION[0]
- @layout.y = self.y + ACTOR_COMMAND_LAYOUT_POSITION[1]
- @layout.visible = self.visible
- @layout.z = self.z - 1
- end
-
- #--------------------------------------------------------------------------
- # * Select
- #--------------------------------------------------------------------------
- alias mog_monogatari_select_actor_command select
- def select(index)
- mog_monogatari_select_actor_command(index)
- set_command_position if $imported[:mog_battle_command_ex] == nil
- 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 if $imported[:mog_battle_command_ex] == nil
- end
-
- #--------------------------------------------------------------------------
- # * Update
- #--------------------------------------------------------------------------
- alias mog_monogatari_actor_commnand_update update
- def update
- mog_monogatari_actor_commnand_update
- if $imported[:mog_battle_command_ex] == nil
- self.visible = self.active
- if [email protected]?
- refresh_layout if @layout.visible != self.visible
- @layout.visible = false if !$game_temp.sprite_visible
- end
- self.visible = false if !$game_temp.sprite_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
- # self.x = @org_position[0] ; self.y = @org_position[1]
- # self.opacity = PARTY_COMMAND_OPACITY
- create_layout
- end
-
- #--------------------------------------------------------------------------
- # * Dispose
- #--------------------------------------------------------------------------
- alias mog_monogatari_party_window_dispose dispose
- def dispose
- mog_monogatari_party_window_dispose
- dispose_layout
- end
-
- #--------------------------------------------------------------------------
- # * Create Layout
- #--------------------------------------------------------------------------
- def create_layout
- return if @layout != nil
- return if !PARTY_COMMAND_LAYOUT
- return if $game_temp.mbhud_window[1]
- self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
- $game_temp.mbhud_window[1] = true
- @org_position_2 = [@org_position[0] + PARTY_COMMAND_LAYOUT_POSITION[0],@org_position[1] + PARTY_COMMAND_LAYOUT_POSITION[1]]
- @layout = Sprite.new
- @layout.bitmap = Cache.battle_hud("Layout_Party")
- @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
-
- #--------------------------------------------------------------------------
- # * Refresh Layout
- #--------------------------------------------------------------------------
- def refresh_layout
- return if @layout == nil
- @layout.x = @org_position_2[0]
- @layout.y = @org_position_2[1]
- @layout.x += PARTY_COMMAND_SLIDE_POSITION[0] if PARTY_COMMAND_SLIDE_EFFECT
- @layout.y += PARTY_COMMAND_SLIDE_POSITION[1] if PARTY_COMMAND_SLIDE_EFFECT
- @layout.visible = self.visible
- end
-
- #--------------------------------------------------------------------------
- # * Select
- #--------------------------------------------------------------------------
- alias mog_monogatari_refresh_partycommand refresh
- def refresh
- if @org_position == nil
- @org_position = [PARTY_COMMAND_POSITION[0] - (self.width / 2),
- PARTY_COMMAND_POSITION[1] - (self.height / 2)]
- end
- mog_monogatari_refresh_partycommand
-
- self.viewport = nil
- self.x = @org_position[0] ; self.y = @org_position[1]
- if PARTY_COMMAND_SLIDE_EFFECT
- self.x += PARTY_COMMAND_SLIDE_POSITION[0]
- self.y += PARTY_COMMAND_SLIDE_POSITION[1]
- end
- self.opacity = PARTY_COMMAND_OPACITY
- end
-
- def show
-
- end
-
- #--------------------------------------------------------------------------
- # * Show
- #--------------------------------------------------------------------------
- alias mog_bg_ex_slide_show_party show
- def show
- self.viewport = nil
- self.x = @org_position[0] ; self.y = @org_position[1]
- if PARTY_COMMAND_SLIDE_EFFECT
- self.x += PARTY_COMMAND_SLIDE_POSITION[0]
- self.y += PARTY_COMMAND_SLIDE_POSITION[1]
- end
- self.opacity = PARTY_COMMAND_OPACITY
- mog_bg_ex_slide_show_party
- 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
- execute_slide_effect if self.visible
- end
-
- end
- #==============================================================================
- # ** Window_Help
- #==============================================================================
- class Window_Help < Window_Base
-
- include MOG_BATTLE_HUD_EX
-
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- alias mog_monogatari_battle_help_initialize initialize
- def initialize(line_number = 2)
- @battle_phase = false
- mog_monogatari_battle_help_initialize(line_number)
- @wait_time = 5
- if SceneManager.scene_is?(Scene_Battle)
- @battle_phase = true
- self.width = HELP_WINDOW_SIZE[0]
- self.height = HELP_WINDOW_SIZE[1]
- @org_position = [HELP_WINDOW_POSITION[0] - (self.width / 2),
- HELP_WINDOW_POSITION[1]]
- self.x = @org_position[0]
- self.y = @org_position[1]
- self.opacity = HELP_WINDOW_OPACITY
- self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
- create_layout
- end
- end
- #--------------------------------------------------------------------------
- # * Dispose
- #--------------------------------------------------------------------------
- alias mog_monogatari_help_window_dispose dispose
- def dispose
- mog_monogatari_help_window_dispose
- dispose_layout
- end
-
- #--------------------------------------------------------------------------
- # * Create Layout
- #--------------------------------------------------------------------------
- def create_layout
- return if @layout != nil
- return if !HELP_WINDOW_LAYOUT
- return if $game_temp.mbhud_window[2]
- return if !SceneManager.scene_is?(Scene_Battle)
- $game_temp.mbhud_window[2] = true
- @org_position_2 = [self.x + HELP_WINDOW_LAYOUT_POSITION[0],self.y + HELP_WINDOW_LAYOUT_POSITION[1]]
- @layout = Sprite.new
- @layout.bitmap = Cache.battle_hud("Layout_Help")
- @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
-
- #--------------------------------------------------------------------------
- # * Refresh Layout
- #--------------------------------------------------------------------------
- def refresh_layout
- return if @layout == nil
- @layout.x = @org_position_2[0]
- @layout.y = @org_position_2[1]
- @layout.x += HELP_WINDOW_SLIDE_POSITION[0] if HELP_WINDOW_SLIDE_EFFECT
- @layout.y += HELP_WINDOW_SLIDE_POSITION[1] if HELP_WINDOW_SLIDE_EFFECT
- @layout.visible = self.visible
- end
-
- #--------------------------------------------------------------------------
- # * Show
- #--------------------------------------------------------------------------
- alias mog_bg_ex_slide_show_help show
- def show
- if @battle_phase
- self.viewport = nil
- self.x = @org_position[0] ; self.y = @org_position[1]
- if HELP_WINDOW_SLIDE_EFFECT
- self.x += HELP_WINDOW_SLIDE_POSITION[0]
- self.y += HELP_WINDOW_SLIDE_POSITION[1]
- end
- self.opacity = HELP_WINDOW_OPACITY
- end
- mog_bg_ex_slide_show_help
- end
-
- #--------------------------------------------------------------------------
- # * Update
- #--------------------------------------------------------------------------
- alias mog_monogatari_help_window_update update
- def update
- if @wait_time > 0
- @wait_time -= 1
- return
- end
- mog_monogatari_help_window_update
- if SceneManager.scene_is?(Scene_Battle)
- if @layout != nil
- refresh_layout if @layout.visible != self.visible
- @layout.visible = self.visible
- end
- self.visible = false if !$game_temp.sprite_visible
- execute_slide_effect if self.visible
- end
- end
-
- end
- #==============================================================================
- # ** Window_BattleActor
- #==============================================================================
- class Window_BattleActor < Window_BattleStatus
-
- include MOG_BATTLE_HUD_EX
-
- #--------------------------------------------------------------------------
- # * Initialize
- #--------------------------------------------------------------------------
- alias mog_monogatari_battle_actor_initialize initialize
- def initialize(info_viewport)
- @force_hide = can_force_hide?
- mog_monogatari_battle_actor_initialize(info_viewport)
- self.width = ACTOR_WINDOW_SIZE[0]
- self.height = ACTOR_WINDOW_SIZE[1]
- @org_position = [ACTOR_WINDOW_POSITION[0] - (self.width / 2),
- ACTOR_WINDOW_POSITION[1] - self.height]
- @org_position[1] = Graphics.height + 64 if @force_hide
- self.x = @org_position[0]
- self.y = @org_position[1]
- self.opacity = ACTOR_WINDOW_OPACITY
- self.z = MOG_BATTLE_HUD_EX::HUD_Z + 151
- self.viewport = nil
- create_layout
- end
-
- #--------------------------------------------------------------------------
- # * 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
- @org_position_2 = [self.x + ACTOR_WINDOW_LAYOUT_POSITION[0],self.y + ACTOR_WINDOW_LAYOUT_POSITION[1]]
- @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
-
- #--------------------------------------------------------------------------
- # * Refresh Layout
- #--------------------------------------------------------------------------
- def refresh_layout
- return if @layout == nil
- @layout.x = @org_position_2[0]
- @layout.y = @org_position_2[1]
- @layout.x += ACTOR_WINDOW_SLIDE_POSITION[0] if ACTOR_WINDOW_SLIDE_EFFECT
- @layout.y += ACTOR_WINDOW_SLIDE_POSITION[1] if ACTOR_WINDOW_SLIDE_EFFECT
- @layout.visible = self.visible
- 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
-
- #--------------------------------------------------------------------------
- # * Show
- #--------------------------------------------------------------------------
- alias mog_bg_ex_slide_show_actor show
- def show
- self.viewport = nil
- self.x = @org_position[0] ; self.y = @org_position[1]
- if ACTOR_WINDOW_SLIDE_EFFECT
- self.x += ACTOR_WINDOW_SLIDE_POSITION[0]
- self.y += ACTOR_WINDOW_SLIDE_POSITION[1]
- end
- self.opacity = ACTOR_WINDOW_OPACITY
- mog_bg_ex_slide_show_actor
- 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
- if !$game_temp.sprite_visible
- self.visible = false
- @layout.visible = self.visible if @layout != nil
- end
- execute_slide_effect if self.visible
- end
-
- end
- #==============================================================================
- # ** Window_BattleEnemy
- #==============================================================================
- class Window_BattleEnemy < Window_Selectable
-
- include MOG_BATTLE_HUD_EX
-
- #--------------------------------------------------------------------------
- # * Initialize
- #--------------------------------------------------------------------------
- alias mog_monogatari_battle_enemy_initialize initialize
- def initialize(info_viewport)
- @force_hide = can_force_hide?
- mog_monogatari_battle_enemy_initialize(info_viewport)
- self.width = ENEMY_WINDOW_SIZE[0]
- self.height = ENEMY_WINDOW_SIZE[1]
- @org_position = [ENEMY_WINDOW_POSITION[0] - (self.width / 2),
- ENEMY_WINDOW_POSITION[1] - self.height]
- @org_position[1] = Graphics.height + 64 if @force_hide
- self.x = @org_position[0]
- self.y = @org_position[1]
- self.opacity = ENEMY_WINDOW_OPACITY
- self.z = MOG_BATTLE_HUD_EX::HUD_Z + 151
- create_layout
- end
-
- #--------------------------------------------------------------------------
- # * 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
- @org_position_2 = [self.x + ENEMY_WINDOW_LAYOUT_POSITION[0],self.y + ENEMY_WINDOW_LAYOUT_POSITION[1]]
- @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
-
- #--------------------------------------------------------------------------
- # * Refresh Layout
- #--------------------------------------------------------------------------
- def refresh_layout
- return if @layout == nil
- @layout.x = @org_position_2[0]
- @layout.y = @org_position_2[1]
- @layout.x += ENEMY_WINDOW_SLIDE_POSITION[0] if ENEMY_WINDOW_SLIDE_EFFECT
- @layout.y += ENEMY_WINDOW_SLIDE_POSITION[1] if ENEMY_WINDOW_SLIDE_EFFECT
- @layout.visible = self.visible
- end
-
- #--------------------------------------------------------------------------
- # * Show
- #--------------------------------------------------------------------------
- alias mog_bg_ex_slide_show_enemy show
- def show
- self.viewport = nil
- self.x = @org_position[0] ; self.y = @org_position[1]
- if ENEMY_WINDOW_SLIDE_EFFECT
- self.x += ENEMY_WINDOW_SLIDE_POSITION[0]
- self.y += ENEMY_WINDOW_SLIDE_POSITION[1]
- end
- self.opacity = ENEMY_WINDOW_OPACITY
- mog_bg_ex_slide_show_enemy
- 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
- if !$game_temp.sprite_visible
- self.visible = false
- @layout.visible = self.visible if @layout != nil
- end
- execute_slide_effect if self.visible
- 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
- #--------------------------------------------------------------------------
- # * Process Cursor Move
- #--------------------------------------------------------------------------
- alias mog_atb_wenemy_process_cursor_move process_cursor_move
- def process_cursor_move
- return if SceneManager.scene_is?(Scene_Battle) and !$game_temp.sprite_visible
- mog_atb_wenemy_process_cursor_move
- end
-
- #--------------------------------------------------------------------------
- # * Process Handling
- #--------------------------------------------------------------------------
- alias mog_atb_wenemy_process_handling process_handling
- def process_handling
- return if SceneManager.scene_is?(Scene_Battle) and !$game_temp.sprite_visible
- mog_atb_wenemy_process_handling
- end
-
- end
- #==============================================================================
- # ** Window_BattleSkill
- #==============================================================================
- class Window_BattleSkill < Window_SkillList
- include MOG_BATTLE_HUD_EX
-
- #--------------------------------------------------------------------------
- # * Initialize
- #--------------------------------------------------------------------------
- alias mog_monogatari_battle_skill_initialize initialize
- def initialize(help_window, info_viewport)
- @force_hide = can_force_hide?
- @force_hide_active = can_force_hide_active?
- mog_monogatari_battle_skill_initialize(help_window, info_viewport)
- self.width = SKILL_WINDOW_SIZE[0]
- self.height = SKILL_WINDOW_SIZE[1]
- @org_position = [SKILL_WINDOW_POSITION[0],
- Graphics.height - self.height + SKILL_WINDOW_POSITION[1]]
- self.x = @org_position[0]
- self.y = @org_position[1]
- self.opacity = SKILL_WINDOW_OPACITY
- self.viewport = nil
- self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
- create_layout
- end
-
- #--------------------------------------------------------------------------
- # * Col Max
- #--------------------------------------------------------------------------
- def col_max
- return SKILL_COL_MAX
- end
-
- #--------------------------------------------------------------------------
- # * 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
- @org_position_2 = [self.x + SKILL_WINDOW_LAYOUT_POSITION[0],self.y + SKILL_WINDOW_LAYOUT_POSITION[1]]
- @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
-
- #--------------------------------------------------------------------------
- # * Refresh Layout
- #--------------------------------------------------------------------------
- def refresh_layout
- return if @layout == nil
- @layout.x = @org_position_2[0]
- @layout.y = @org_position_2[1]
- @layout.x += SKILL_WINDOW_SLIDE_POSITION[0] if SKILL_WINDOW_SLIDE_EFFECT
- @layout.y += SKILL_WINDOW_SLIDE_POSITION[1] if SKILL_WINDOW_SLIDE_EFFECT
- @layout.visible = self.visible
- end
-
- #--------------------------------------------------------------------------
- # * Show
- #--------------------------------------------------------------------------
- alias mog_bg_ex_slide_show_skill show
- def show
- self.viewport = nil
- self.x = @org_position[0] ; self.y = @org_position[1]
- if SKILL_WINDOW_SLIDE_EFFECT
- self.x += SKILL_WINDOW_SLIDE_POSITION[0]
- self.y += SKILL_WINDOW_SLIDE_POSITION[1]
- end
- self.opacity = SKILL_WINDOW_OPACITY
- mog_bg_ex_slide_show_skill
- 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
- self.visible = false if !$game_temp.sprite_visible
- execute_slide_effect if self.visible
- end
-
- end
- #==============================================================================
- # ** Window_BattleItem
- #==============================================================================
- class Window_BattleItem < Window_ItemList
- include MOG_BATTLE_HUD_EX
- #--------------------------------------------------------------------------
- # * Initialize
- #--------------------------------------------------------------------------
- alias mog_monogatari_battle_item_initialize initialize
- def initialize(help_window, info_viewport)
- @force_hide = can_force_hide?
- @force_hide_active = can_force_hide_active?
- mog_monogatari_battle_item_initialize(help_window, info_viewport)
- self.width = ITEM_WINDOW_SIZE[0]
- self.height = ITEM_WINDOW_SIZE[1]
- @org_position = [ITEM_WINDOW_POSITION[0],
- Graphics.height - self.height + ITEM_WINDOW_POSITION[1]]
- self.x = @org_position[0]
- self.y = @org_position[1]
- self.viewport = nil
- self.opacity = ITEM_WINDOW_OPACITY
- self.z = MOG_BATTLE_HUD_EX::HUD_Z + 150
- create_layout
- end
-
- #--------------------------------------------------------------------------
- # * Col Max
- #--------------------------------------------------------------------------
- def col_max
- return ITEM_COL_MAX
- end
-
- #--------------------------------------------------------------------------
- # * 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
- @org_position_2 = [self.x + ITEM_WINDOW_LAYOUT_POSITION[0],self.y + ITEM_WINDOW_LAYOUT_POSITION[1]]
- @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
-
- #--------------------------------------------------------------------------
- # * Refresh Layout
- #--------------------------------------------------------------------------
- def refresh_layout
- return if @layout == nil
- @layout.x = @org_position_2[0]
- @layout.y = @org_position_2[1]
- @layout.x += ITEM_WINDOW_SLIDE_POSITION[0] if ITEM_WINDOW_SLIDE_EFFECT
- @layout.y += ITEM_WINDOW_SLIDE_POSITION[1] if ITEM_WINDOW_SLIDE_EFFECT
- @layout.visible = self.visible
- end
-
- #--------------------------------------------------------------------------
- # * Show
- #--------------------------------------------------------------------------
- alias mog_bg_ex_slide_show_item show
- def show
- self.viewport = nil
- self.x = @org_position[0] ; self.y = @org_position[1]
- if ITEM_WINDOW_SLIDE_EFFECT
- self.x += ITEM_WINDOW_SLIDE_POSITION[0]
- self.y += ITEM_WINDOW_SLIDE_POSITION[1]
- end
- self.opacity = ITEM_WINDOW_OPACITY
- mog_bg_ex_slide_show_item
- 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
- self.visible = false if !$game_temp.sprite_visible
- execute_slide_effect if self.visible
- end
-
- end
- end
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- #################################
- if $imported["YEA-BattleEngine"]
- #################################
- #==============================================================================
- # ** Window_BattleStatusAid
- #==============================================================================
- class Window_BattleStatusAid < Window_BattleStatus
-
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- self.visible = false
- end
-
- end
- #==============================================================================
- # ** Window_BattleStatus
- #==============================================================================
- class Window_BattleStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # * Update
- #--------------------------------------------------------------------------
- alias mog_monogatari_bhud_yf_update update
- def update
- mog_monogatari_bhud_yf_update
- update_visible_yf
- end
-
- #--------------------------------------------------------------------------
- # * Update Visible Yf
- #--------------------------------------------------------------------------
- def update_visible_yf
- self.visible = self.active
- self.visible = false if !$game_temp.sprite_visible
- end
-
- end
- #==============================================================================
- # ■ 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
-
- #--------------------------------------------------------------------------
- # * Update Visible Yf
- #--------------------------------------------------------------------------
- def update_visible_yf
- self.visible = self.active
- self.visible = false if !$game_temp.sprite_visible
- end
-
- 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
-
- if !$imported[:mog_atb_system]
- #--------------------------------------------------------------------------
- # * 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
- 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"]
- #################################
- #==============================================================================
- # ■ Enemy CATB Gauge Viewport
- #==============================================================================
- class Enemy_CATB_Gauge_Viewport < Viewport
-
- #--------------------------------------------------------------------------
- # 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
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- #==============================================================================
- # ** Window Base
- #==============================================================================
- class Window_Base < Window
-
- #--------------------------------------------------------------------------
- # * Execute Move W
- #--------------------------------------------------------------------------
- def execute_move_w(sprite,type,cp,np)
- sp = 6 + ((cp - np).abs / 10)
- if cp > np ; cp -= sp ; cp = np if cp < np
- elsif cp < np ; cp += sp ; cp = np if cp > np
- end
- sprite.x = cp if type == 0 ; sprite.y = cp if type == 1
- end
-
- #--------------------------------------------------------------------------
- # * Set BH EX Font
- #--------------------------------------------------------------------------
- def set_bh_ex_font
- return if !MOG_BATTLE_HUD_EX::ENABLE_WINDOW_FONT_SET
- self.contents.font.bold = MOG_BATTLE_HUD_EX::WINDOW_FONT_BOLD
- self.contents.font.size = MOG_BATTLE_HUD_EX::WINDOW_FONT_SIZE
- self.contents.font.italic = MOG_BATTLE_HUD_EX::WINDOW_FONT_ITALIC
- self.contents.font.name = MOG_BATTLE_HUD_EX::WINDOW_FONT_NAME if MOG_BATTLE_HUD_EX::WINDOW_FONT_NAME != nil
- end
-
- #--------------------------------------------------------------------------
- # * Execute Slide Effect
- #--------------------------------------------------------------------------
- def execute_slide_effect
- return if @org_position == nil
- execute_move_w(self,0,self.x,@org_position[0])
- execute_move_w(self,1,self.y,@org_position[1])
- return if @layout == nil
- execute_move_w(@layout,0,@layout.x,@org_position_2[0])
- execute_move_w(@layout,1,@layout.y,@org_position_2[1])
- end
-
- end
- #==============================================================================
- # ** Window Help
- #==============================================================================
- class Window_Help < Window_Base
-
- #--------------------------------------------------------------------------
- # * Draw Text
- #--------------------------------------------------------------------------
- alias mog_bh_ex_draw_text_help draw_text
- def draw_text(*args)
- set_bh_ex_font
- mog_bh_ex_draw_text_help(*args)
- end
-
- end
- #==============================================================================
- # ** Window BattleActor
- #==============================================================================
- class Window_BattleActor < Window_BattleStatus
-
- #--------------------------------------------------------------------------
- # * Draw Item
- #--------------------------------------------------------------------------
- alias mog_bbex_draw_item_actor draw_item
- def draw_item(index)
- set_bh_ex_font
- mog_bbex_draw_item_actor(index)
- end
-
- end
- #==============================================================================
- # ** Window BattleEnemy
- #==============================================================================
- class Window_BattleEnemy < Window_Selectable
-
- #--------------------------------------------------------------------------
- # * Draw Item
- #--------------------------------------------------------------------------
- alias mog_bbex_draw_item_enemy draw_item
- def draw_item(index)
- set_bh_ex_font
- mog_bbex_draw_item_enemy(index)
- end
-
- end
- #==============================================================================
- # ** Window ItemList
- #==============================================================================
- class Window_ItemList < Window_Selectable
-
- #--------------------------------------------------------------------------
- # * Draw Item Name
- #--------------------------------------------------------------------------
- alias mog_bhex_draw_item_name_item draw_item_name
- def draw_item_name(item, x, y, enabled = true, width = 172)
- set_bh_ex_font
- mog_bhex_draw_item_name_item(item, x, y, enabled , width )
- end
- end
- #==============================================================================
- # ** Window SkillList
- #==============================================================================
- class Window_SkillList < Window_Selectable
- #--------------------------------------------------------------------------
- # * Draw Item Name
- #--------------------------------------------------------------------------
- alias mog_bhex_draw_item_name_skill draw_item_name
- def draw_item_name(item, x, y, enabled = true, width = 172)
- set_bh_ex_font
- mog_bhex_draw_item_name_skill(item, x, y, enabled , width )
- 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
-
- #--------------------------------------------------------------------------
- # * Refresh Battle Hud
- #--------------------------------------------------------------------------
- def refresh_battle_hud
- $game_temp.mbhud_force_refresh = false
- check_screen_xyz_nil rescue nil
- dispose_battle_hud_ex
- create_battle_hud_ex
- end
-
- end
- #==============================================================================
- # ** Monogatari Bhud
- #==============================================================================
- class Monogatari_Bhud
-
- include MOG_BATTLE_HUD_EX
-
- #--------------------------------------------------------------------------
- # * Initialize
- #--------------------------------------------------------------------------
- def initialize(viewport)
- @battle_hud = [] ; @sprite_visitle_wait = 0
- $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)
- create_screen_layout(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
- #--------------------------------------------------------------------------
- def dispose
- @battle_hud.each {|sprite| sprite.dispose }
- dispose_turn_sprite
- dispose_screen_layout
- end
-
- #--------------------------------------------------------------------------
- # * Update
- #--------------------------------------------------------------------------
- def update
- @battle_hud.each {|sprite| sprite.update }
- update_turn_sprite
- update_screen_layout
- refresh_battle_hud_visible if $game_temp.battle_hud_visible_refresh[0]
- end
-
- #--------------------------------------------------------------------------
- # * Update
- #--------------------------------------------------------------------------
- def refresh_battle_hud_visible
- $game_temp.battle_hud_visible_refresh[0] = false
- @turn_sprite.visible = $game_temp.battle_hud_visible_refresh[1] if @turn_sprite != nil
- @screen_layout.visible = $game_temp.battle_hud_visible_refresh[1] if @screen_layout != nil
- @skill_name.visible = $game_temp.battle_hud_visible_refresh[1] if @skill_name != nil
- @battle_hud.each {|sprite| sprite.refresh_visible($game_temp.battle_hud_visible_refresh[1]) }
- end
-
- end
- #==============================================================================
- # ** Monogatari Bhud
- #==============================================================================
- class Monogatari_Bhud
-
- #--------------------------------------------------------------------------
- # * Can Update Turn Sprite
- #--------------------------------------------------------------------------
- def can_refresh_turn_sprite?
- return true if @turn_sprite.visible != $game_temp.command_visible
- return true if $game_temp.refresh_turn_sprite
- return false
- end
-
- #--------------------------------------------------------------------------
- # * Create Turn Sprite
- #--------------------------------------------------------------------------
- def create_turn_sprite(viewport)
- return if !TURN_SPRITE_VISIBLE
- return if @turn_sprite != nil
- @turn_sprite = Sprite.new
- @turn_sprite.bitmap = Cache.battle_hud("Turn")
- @turn_sprite.viewport = viewport
- @turn_sprite.z = HUD_Z + TURN_SPRITE_Z
- @turn_sprite.visible = false
- @turn_sprite_update_time = 5
- @turn_sprite_blink = [0,0]
- 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
- update_turn_blink
- end
-
- #--------------------------------------------------------------------------
- # * Update Turn Visible
- #--------------------------------------------------------------------------
- def update_turn_visible
- $game_temp.refresh_turn_sprite = false
- @turn_sprite.visible = can_turn_sprite_visible?
- return if BattleManager.actor == nil
- x = $game_temp.hud_pos_real[BattleManager.actor.index][0] + TURN_SPRITE_POSITION[0] rescue nil
- y = $game_temp.hud_pos_real[BattleManager.actor.index][1] + TURN_SPRITE_POSITION[1] rescue nil
- x = -1000 if x == nil ; y = -1000 if y == nil
- @turn_sprite.x = x ; @turn_sprite.y = y
- end
-
- #--------------------------------------------------------------------------
- # * Can Turn Sprite Visible?
- #--------------------------------------------------------------------------
- def can_turn_sprite_visible?
- return false if BattleManager.actor == nil
- return false if $game_temp.battle_end
- return false if $game_message.visible
- return true
- 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
- #==============================================================================
- # ** Monogatari Bhud
- #==============================================================================
- class Monogatari_Bhud
-
- #--------------------------------------------------------------------------
- # * Create Screen Layout
- #--------------------------------------------------------------------------
- def create_screen_layout(viewport)
- return if !SCREEN_LAYOUT
- @screen_layout = Sprite.new
- @screen_layout.bitmap = Cache.battle_hud("Layout_Screen")
- @screen_layout.z = HUD_Z + SCREEN_LAYOUT_Z
- @screen_layout.x = SCREEN_LAYOUT_POSITION[0]
- @screen_layout.y = SCREEN_LAYOUT_POSITION[1]
- @screen_layout.opacity = 0
- @screen_layout.viewport = viewport
- end
-
- #--------------------------------------------------------------------------
- # * Dispose Screen Layout
- #--------------------------------------------------------------------------
- def dispose_screen_layout
- return if @screen_layout == nil
- @screen_layout.dispose ; @screen_layout = nil
- end
-
- #--------------------------------------------------------------------------
- # * Update Screen Layout
- #--------------------------------------------------------------------------
- def update_screen_layout
- return if @screen_layout == nil
- @sprite_visitle_wait -= 1 if @sprite_visitle_wait > 0
- sprite_visible(@screen_layout)
- 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 false if !$game_temp.sprite_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
- include MOG_BATTLE_HUD_EX
-
- #--------------------------------------------------------------------------
- # * Initialize
- #--------------------------------------------------------------------------
- def initialize(actor = nil,index = 0, max_members = 0,viewport = nil)
- pre_cache
- setup(actor,index,max_members)
- create_sprites(viewport)
- end
-
- #--------------------------------------------------------------------------
- # * Setup
- #--------------------------------------------------------------------------
- def setup(actor,index,max_members)
- $game_temp.battle_end = false
- @actor = actor
- @actor_index = index
- @max_members = max_members
- @actor.face_animation = [0,0,0]
- @hp_icon_max = -1
- @hp_icon_old = -1
- @hp_icon_col_max = HP_ICON_COL_MAX
- @hp_icon_col_max = 1 if @hp_icon_col_max <= 0
- @hp_icon_row_max = HP_ICON_ROW_MAX
- @hp_icon_row_max = 1 if @hp_icon_row_max <= 0
- @hp_icon_real_max = @hp_icon_col_max * @hp_icon_row_max
- @mp_icon_max = -1
- @mp_icon_old = -1
- @mp_icon_col_max = MP_ICON_COL_MAX
- @mp_icon_col_max = 1 if @mp_icon_col_max <= 0
- @mp_icon_row_max = MP_ICON_ROW_MAX
- @mp_icon_row_max = 1 if @mp_icon_row_max <= 0
- @mp_icon_real_max = @mp_icon_col_max * @mp_icon_row_max
- @tp_icon_max = -1
- @tp_icon_old = -1
- @tp_icon_col_max = TP_ICON_COL_MAX
- @tp_icon_col_max = 1 if @tp_icon_col_max <= 0
- @tp_icon_row_max = TP_ICON_ROW_MAX
- @tp_icon_row_max = 1 if @tp_icon_row_max <= 0
- @tp_icon_real_max = @tp_icon_col_max * @tp_icon_row_max
- @sprite_visible = true
- @sprite_visitle_wait = 0
- setup_actor
- setup_position
- end
-
- #--------------------------------------------------------------------------
- # * Setup Actor
- #--------------------------------------------------------------------------
- def setup_actor
- return if @actor == nil
- @hp_number_refresh = true
- @hp_number2_refresh = true
- @hp_number_old = @actor.hp
- @hp_number2_old = @actor.mhp
- @hp_old_meter = 0
- @mp_number_refresh = true
- @mp_number2_refresh = true
- @mp_number_old = @actor.mp
- @mp_number2_old = @actor.mmp
- @mp_old_meter = 0
- @tp_number_refresh = true
- @tp_number2_refresh = true
- @tp_number_old = @actor.tp
- @tp_number2_old = @actor.max_tp
- @tp_old_meter = 0
- @at_number_refresh = true
- @at_number2_refresh = true
- @at_number_old = actor_at
- @at_number2_old = actor_max_at
- @at_old_meter = 0
- catb = ATB::MAX_AP rescue nil
- @ccwinter_atb = true if catb != nil
- end
-
- #--------------------------------------------------------------------------
- # * Terminate
- #--------------------------------------------------------------------------
- def terminate
- @actor.atb = 0 rescue nil if $imported[:ve_active_time_battle]
- end
-
- #--------------------------------------------------------------------------
- # * AT
- #--------------------------------------------------------------------------
- def actor_at
- return @actor.atb 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 @actor.atb_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.atb_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
- if $imported[:mog_atb_system]
- return @actor.atb_cast[2] if @actor.atb_cast[2] != 0
- return @actor.atb_cast[0].speed.abs
- end
- 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
-
- #--------------------------------------------------------------------------
- # * Create Sprites
- #--------------------------------------------------------------------------
- def create_sprites(viewport)
- dispose
- return if @actor == nil
- create_layout(viewport)
- create_layout_2(viewport)
- create_name(viewport)
- create_face(viewport)
- create_hp_number(viewport)
- create_hp_number_max(viewport)
- create_hp_meter(viewport)
- create_hp_icon(viewport)
- create_hp_icon_ex(viewport)
- create_hp_icon_number(viewport)
- create_mp_number(viewport)
- create_mp_number_max(viewport)
- create_mp_meter(viewport)
- create_mp_icon(viewport)
- create_mp_icon_ex(viewport)
- create_mp_icon_number(viewport)
- create_tp_number(viewport)
- create_tp_number_max(viewport)
- create_tp_meter(viewport)
- create_tp_icon(viewport)
- create_tp_icon_ex(viewport)
- create_tp_icon_number(viewport)
- create_at_number(viewport)
- create_at_number_max(viewport)
- create_at_meter(viewport)
- create_level_number(viewport)
- create_states(viewport)
- update
- 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 false if !$game_temp.sprite_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
-
- #--------------------------------------------------------------------------
- # * Execute Cache Bhud Sprites
- #--------------------------------------------------------------------------
- def execute_cache_bhud_sprites
- @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","Layout_Screen"
- ]
- 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
- #--------------------------------------------------------------------------
- # * Create Layout
- #--------------------------------------------------------------------------
- def create_layout(viewport)
- @layout = Sprite.new
- @layout.bitmap = @layout_image
- @layout.z = HUD_Z
- @layout.x = @hud_position[0]
- @layout.y = @hud_position[1]
- @layout.opacity = 0
- @layout.viewport = viewport
- end
-
- #--------------------------------------------------------------------------
- # * Update Layout
- #--------------------------------------------------------------------------
- def update_layout
- return if @layout == nil
- sprite_visible(@layout)
- end
-
- #--------------------------------------------------------------------------
- # * Create Layout
- #--------------------------------------------------------------------------
- def create_layout_2(viewport)
- return if !SECOND_LAYOUT
- @layout2 = Sprite.new
- @layout2.bitmap = @layout2_image
- @layout2.z = HUD_Z + SECOND_LAYOUT_Z
- @layout2.x = @hud_position[0] + SECOND_LAYOUT_POSITION[0]
- @layout2.y = @hud_position[1] + SECOND_LAYOUT_POSITION[1]
- @layout2.opacity = 0
- @layout2.viewport = viewport
- end
-
- #--------------------------------------------------------------------------
- # * Update Layout
- #--------------------------------------------------------------------------
- def update_layout_2
- return if @layout2 == nil
- sprite_visible(@layout2)
- end
-
- end
- #==============================================================================
- #==============================================================================
- # ** Battle Hud EX
- #==============================================================================
- #==============================================================================
- class Battle_Hud_EX
-
- #--------------------------------------------------------------------------
- # * Create Name
- #--------------------------------------------------------------------------
- def create_name(viewport)
- return if !NAME_VISIBLE
- @name = Sprite.new
- @name.bitmap = Bitmap.new(160,32)
- @name.bitmap.font.size = NAME_FONT_SIZE
- @name.bitmap.font.bold = NAME_FONT_BOLD
- @name.bitmap.font.italic = NAME_FONT_ITALIC
- @name.bitmap.font.color = NAME_FONT_COLOR
- @name.z = HUD_Z + NAME_Z
- @name.x = @hud_position[0] + NAME_POSITION[0]
- @name.y = @hud_position[1] + NAME_POSITION[1]
- @name.viewport = viewport
- @name.opacity = 0
- refresh_name
- end
-
- #--------------------------------------------------------------------------
- # * Refresh Name
- #--------------------------------------------------------------------------
- def refresh_name
- return if @name == nil
- @name.bitmap.clear
- if NAME_FONT_SHADOW
- @name.bitmap.font.color = NAME_FONT_SHADOW_COLOR
- @name.bitmap.draw_text(NAME_FONT_SHADOW_POSITION[0],NAME_FONT_SHADOW_POSITION[1],160,32,@actor.name,NAME_ALIGN_TYPE)
- @name.bitmap.font.color = NAME_FONT_COLOR
- end
- @name.bitmap.draw_text(0,0,160,32,@actor.name,NAME_ALIGN_TYPE)
- end
-
- #--------------------------------------------------------------------------
- # * Update Name
- #--------------------------------------------------------------------------
- def update_name
- return if @name == nil
- sprite_visible(@name)
- end
-
- end
- #==============================================================================
- #==============================================================================
- # ** Battle Hud EX
- #==============================================================================
- #==============================================================================
- class Battle_Hud_EX
-
- #--------------------------------------------------------------------------
- # * Create HP Number
- #--------------------------------------------------------------------------
- def create_hp_number(viewport)
- return if !HP_NUMBER_VISIBLE
- @hp_number = Sprite.new
- @hp_number.bitmap = Bitmap.new(@hp_number_cw * 6,@hp_number_ch)
- @hp_number.z = HUD_Z + HP_NUMBER_Z
- @hp_number.x = @hud_position[0] + HP_NUMBER_POSITION[0]
- @hp_number.y = @hud_position[1] + HP_NUMBER_POSITION[1]
- @hp_number.viewport = viewport
- @hp_number.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * Create HP Number Max
- #--------------------------------------------------------------------------
- def create_hp_number_max(viewport)
- return if !HP_NUMBER_MAX_VISIBLE
- @hp_number2 = Sprite.new
- @hp_number2.bitmap = Bitmap.new(@hp_number2_cw * 6,@hp_number2_ch)
- @hp_number2.z = HUD_Z + HP_NUMBER_Z
- @hp_number2.x = @hud_position[0] + HP_NUMBER_MAX_POSITION[0]
- @hp_number2.y = @hud_position[1] + HP_NUMBER_MAX_POSITION[1]
- @hp_number2.viewport = viewport
- @hp_number2.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * Create HP Meter
- #--------------------------------------------------------------------------
- def create_hp_meter(viewport)
- return if !HP_METER_VISIBLE
- @hp_flow_max = @hp_meter_cw * 2
- @hp_flow = rand(@hp_flow_max)
- @hp_meter = Sprite.new
- @hp_meter.bitmap = Bitmap.new(@hp_meter_cw,@hp_meter_ch)
- @hp_meter.z = HUD_Z + HP_METER_Z
- @hp_meter.x = @hud_position[0] + HP_METER_POSITION[0]
- @hp_meter.y = @hud_position[1] + HP_METER_POSITION[1]
- @hp_meter.angle = HP_METER_ANGLE
- @hp_meter.mirror = HP_METER_MIRROR_EFFECT
- @hp_meter.viewport = viewport
- @hp_meter.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # ● Update Flow HP
- #--------------------------------------------------------------------------
- def update_flow_hp
- @hp_meter.bitmap.clear
- @hp_flow = 0 if !HP_METER_GRADIENT_ANIMATION
- meter_width = @hp_meter_cw * @actor.hp / @actor.mhp rescue nil
- meter_width = 0 if meter_width == nil
- execute_hp_damage_flow(meter_width)
- meter_src_rect = Rect.new(@hp_flow, 0,meter_width, @hp_meter_ch)
- @hp_meter.bitmap.blt(0,0, @hp_meter_image, meter_src_rect)
- @hp_flow += 1
- @hp_flow = 0 if @hp_flow >= @hp_flow_max
- end
-
- #--------------------------------------------------------------------------
- # ● Execute HP Damage Flow
- #--------------------------------------------------------------------------
- def execute_hp_damage_flow(meter_width)
- return if !HP_METER_REDUCTION_ANIMATION
- return if @hp_old_meter == meter_width
- n = (@hp_old_meter - meter_width).abs * 3 / 100
- damage_flow = [[n, 2].min,0.5].max
- @hp_old_meter -= damage_flow
- @hp_old_meter = meter_width if @hp_old_meter <= meter_width
- src_rect_old = Rect.new(0,@hp_meter_ch, @hp_old_meter, @hp_meter_ch)
- @hp_meter.bitmap.blt(0,0, @hp_meter_image, src_rect_old)
- end
- #--------------------------------------------------------------------------
- # * Create HP Icon
- #--------------------------------------------------------------------------
- def create_hp_icon(viewport)
- return if !HP_ICON_VISIBLE
- @hp_icon = Sprite.new
- icon_width = @hp_icon_col_max * (@hp_icon_cw + HP_ICON_SPACE[0].abs)
- icon_height = @hp_icon_row_max * (@hp_icon_ch + HP_ICON_SPACE[1].abs)
- @hp_icon.bitmap = Bitmap.new(icon_width,icon_height)
- @hp_icon.z = HUD_Z + HP_ICON_Z
- @hp_icon.x = @hud_position[0] + HP_ICON_POSITION[0]
- @hp_icon.y = @hud_position[1] + HP_ICON_POSITION[1]
- @hp_icon.viewport = viewport
- @hp_icon.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * Refresh HP Icon
- #--------------------------------------------------------------------------
- def refresh_hp_icon
- @hp_icon_old = @actor.hp
- @hp_icon.bitmap.clear
- max_value = (@actor.mhp / @hp_icon_real_max) * @hp_icon_real_max
- if @actor.hp > max_value
- icon_max = icon_limit(@actor.mhp,@hp_icon_real_max)
- else
- icon_max = @actor.mhp
- end
- for i in 0...icon_max
- break if (i / @hp_icon_col_max) >= @hp_icon_row_max
- rx = (i * (@hp_icon_cw + HP_ICON_SPACE[0]) ) - ((i / @hp_icon_col_max) * (@hp_icon_cw + HP_ICON_SPACE[0]) * @hp_icon_col_max)
- ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
- i_scr = Rect.new(0,0,@hp_icon_cw,@hp_icon_ch)
- @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
- end
- icon_max = icon_limit(@actor.hp,@hp_icon_real_max)
- rx = 0
- ry = 0
- for i in 0...icon_max
- break if (i / @hp_icon_col_max) >= @hp_icon_row_max
- rx = (i * (@hp_icon_cw + HP_ICON_SPACE[0]) ) - ((i / @hp_icon_col_max) * (@hp_icon_cw + HP_ICON_SPACE[0]) * @hp_icon_col_max)
- ry = (i / @hp_icon_col_max) * (@hp_icon_ch + HP_ICON_SPACE[1])
- i_scr = Rect.new(@hp_icon_cw,0,@hp_icon_cw,@hp_icon_ch)
- @hp_icon.bitmap.blt(rx,ry,@hp_icon_image ,i_scr )
- end
- refresh_hp_icon_ex(rx,ry)
- end
-
- #--------------------------------------------------------------------------
- # * Create HP Icon EX
- #--------------------------------------------------------------------------
- def create_hp_icon_ex(viewport)
- return if !HP_ICON_EX_VISIBLE
- @hp_icon3_anime_phase = 0
- @hp_icon3 = Sprite.new
- @hp_icon3.bitmap = Bitmap.new(@hp_icon2_cw,@hp_icon2_ch)
- @hp_icon3.ox = @hp_icon3.bitmap.width / 2
- @hp_icon3.oy = @hp_icon3.bitmap.height / 2
- @hp_icon3.z = HUD_Z + HP_ICON_Z + 2
- @hp_icon3_org = [@hud_position[0] + HP_ICON_POSITION[0] + HP_ICON_EX_POSITION[0] + @hp_icon3.ox,
- @hud_position[1] + HP_ICON_POSITION[1] + HP_ICON_EX_POSITION[1] + @hp_icon3.oy]
- @hp_icon3.x = @hp_icon3_org[0]
- @hp_icon3.y = @hp_icon3_org[1]
- @hp_icon3.viewport = viewport
- @hp_icon3.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * Refresh HP Icon EX
- #--------------------------------------------------------------------------
- def refresh_hp_icon_ex(rx,ry)
- return if @hp_icon3 == nil
- @hp_icon3.bitmap.clear
- return if @actor.hp == 0
- i_scr = Rect.new(0,0,@hp_icon2_cw,@hp_icon2_ch)
- @hp_icon3.bitmap.blt(0,0, @hp_icon2_image ,i_scr )
- @hp_icon3.x = @hp_icon3_org[0] + rx
- @hp_icon3.y = @hp_icon3_org[1] + ry
- end
-
- #--------------------------------------------------------------------------
- # * Update Icon HP EX Anime
- #--------------------------------------------------------------------------
- def update_icon_hp_ex_anime
- return if !HP_ICON_EX_ZOOM_EFFECT
- if @hp_icon3_anime_phase == 0
- @hp_icon3.zoom_x += 0.01
- if @hp_icon3.zoom_x >= 1.30
- @hp_icon3.zoom_x = 1.30
- @hp_icon3_anime_phase = 1
- end
- else
- @hp_icon3.zoom_x -= 0.01
- if @hp_icon3.zoom_x <= 1.05
- @hp_icon3.zoom_x = 1.05
- @hp_icon3_anime_phase = 0
- end
- end
- @hp_icon3.zoom_y = @hp_icon3.zoom_x
- end
-
- #--------------------------------------------------------------------------
- # * Create HP Icon Nummber
- #--------------------------------------------------------------------------
- def create_hp_icon_number(viewport)
- return if !HP_ICON_NUMBER_VISIBLE
- @hp_icon_number_old = [-1,-1]
- @hp_icon_number = Sprite.new
- @hp_icon_number.bitmap = Bitmap.new(@hp_icon_number_cw * 4,@hp_icon_number_ch)
- @hp_icon_number.z = HUD_Z + HP_ICON_NUMBER_Z
- @hp_icon_number.x = @hud_position[0] + HP_ICON_NUMBER_POSITION[0]
- @hp_icon_number.y = @hud_position[1] + HP_ICON_NUMBER_POSITION[1]
- @hp_icon_number.viewport = viewport
- @hp_icon_number.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * Refresh Icon Number HP
- #--------------------------------------------------------------------------
- def refresh_icon_number_hp
- @hp_icon_number_old[0] = @actor.hp
- @hp_icon_number_old[1] = @actor.mhp
- @hp_icon_number.bitmap.clear
- value = ((@actor.hp - 1) / @hp_icon_col_max) / @hp_icon_row_max
- value = 0 if value < 0
- number_value = value.truncate.abs.to_s.split(//)
- for r in 0..number_value.size - 1
- number_value_abs = number_value[r].to_i
- nsrc_rect = Rect.new(@hp_icon_number_cw * number_value_abs, 0, @hp_icon_number_cw, @hp_icon_number_ch)
- @hp_icon_number.bitmap.blt(@hp_icon_number_cw * r, 0, @hp_icon_number_image, nsrc_rect)
- end
- cx = (number_value.size * @hp_icon_number_cw)
- case HP_ICON_NUMBER_ALIGN_TYPE
- when 0; @hp_icon_number.x = @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
-
- #--------------------------------------------------------------------------
- # * Create MP Number
- #--------------------------------------------------------------------------
- def create_mp_number(viewport)
- return if !MP_NUMBER_VISIBLE
- @mp_number = Sprite.new
- @mp_number.bitmap = Bitmap.new(@mp_number_cw * 6, @mp_number_ch)
- @mp_number.z = HUD_Z + MP_NUMBER_Z
- @mp_number.x = @hud_position[0] + MP_NUMBER_POSITION[0]
- @mp_number.y = @hud_position[1] + MP_NUMBER_POSITION[1]
- @mp_number.viewport = viewport
- @mp_number.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * Create MP Number Max
- #--------------------------------------------------------------------------
- def create_mp_number_max(viewport)
- return if !MP_NUMBER_MAX_VISIBLE
- @mp_number2 = Sprite.new
- @mp_number2.bitmap = Bitmap.new(@mp_number2_cw * 6, @mp_number2_ch)
- @mp_number2.z = HUD_Z + MP_NUMBER_Z
- @mp_number2.x = @hud_position[0] + MP_NUMBER_MAX_POSITION[0]
- @mp_number2.y = @hud_position[1] + MP_NUMBER_MAX_POSITION[1]
- @mp_number2.viewport = viewport
- @mp_number2.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * Create MP Meter
- #--------------------------------------------------------------------------
- def create_mp_meter(viewport)
- return if !MP_METER_VISIBLE
- @mp_flow_max = @mp_meter_cw * 2
- @mp_flow = rand(@mp_flow_max)
- @mp_meter = Sprite.new
- @mp_meter.bitmap = Bitmap.new(@mp_meter_cw,@mp_meter_ch)
- @mp_meter.z = HUD_Z + MP_METER_Z
- @mp_meter.x = @hud_position[0] + MP_METER_POSITION[0]
- @mp_meter.y = @hud_position[1] + MP_METER_POSITION[1]
- @mp_meter.angle = MP_METER_ANGLE
- @mp_meter.mirror = MP_METER_MIRROR_EFFECT
- @mp_meter.viewport = viewport
- @mp_meter.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # ● Update Flow MP
- #--------------------------------------------------------------------------
- def update_flow_mp
- @mp_meter.bitmap.clear
- @mp_flow = 0 if !MP_METER_GRADIENT_ANIMATION
- meter_width = @mp_meter_cw * @actor.mp / @actor.mmp rescue nil
- meter_width = 0 if meter_width == nil
- execute_mp_damage_flow(meter_width)
- meter_src_rect = Rect.new(@mp_flow, 0,meter_width, @mp_meter_ch)
- @mp_meter.bitmap.blt(0,0, @mp_meter_image, meter_src_rect)
- @mp_flow += 1
- @mp_flow = 0 if @mp_flow >= @mp_flow_max
- end
-
- #--------------------------------------------------------------------------
- # ● Execute MP Damage Flow
- #--------------------------------------------------------------------------
- def execute_mp_damage_flow(meter_width)
- return if !MP_METER_REDUCTION_ANIMATION
- return if @mp_old_meter == meter_width
- n = (@mp_old_meter - meter_width).abs * 3 / 100
- damage_flow = [[n, 2].min,0.5].max
- @mp_old_meter -= damage_flow
- @mp_old_meter = meter_width if @mp_old_meter <= meter_width
- src_rect_old = Rect.new(0,@mp_meter_ch, @mp_old_meter, @mp_meter_ch)
- @mp_meter.bitmap.blt(0,0, @mp_meter_image, src_rect_old)
- end
- #--------------------------------------------------------------------------
- # * Create MP Icon
- #--------------------------------------------------------------------------
- def create_mp_icon(viewport)
- return if !MP_ICON_VISIBLE
- @mp_icon = Sprite.new
- icon_width = @mp_icon_col_max * (@mp_icon_cw + MP_ICON_SPACE[0].abs)
- icon_height = @mp_icon_row_max * (@mp_icon_ch + MP_ICON_SPACE[1].abs)
- @mp_icon.bitmap = Bitmap.new(icon_width,icon_height)
- @mp_icon.z = HUD_Z + MP_ICON_Z
- @mp_icon.x = @hud_position[0] + MP_ICON_POSITION[0]
- @mp_icon.y = @hud_position[1] + MP_ICON_POSITION[1]
- @mp_icon.viewport = viewport
- @mp_icon.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * Refresh MP Icon
- #--------------------------------------------------------------------------
- def refresh_mp_icon
- @mp_icon_old = @actor.mp
- @mp_icon.bitmap.clear
- max_value = (@actor.mmp / @mp_icon_real_max) * @mp_icon_real_max
- if @actor.mp > max_value
- icon_max = icon_limit(@actor.mmp,@mp_icon_real_max)
- else
- icon_max = @actor.mmp
- end
- for i in 0...icon_max
- break if (i / @mp_icon_col_max) >= @mp_icon_row_max
- rx = (i * (@mp_icon_cw + MP_ICON_SPACE[0]) ) - ((i / @mp_icon_col_max) * (@mp_icon_cw + MP_ICON_SPACE[0]) * @mp_icon_col_max)
- ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
- i_scr = Rect.new(0,0,@mp_icon_cw,@mp_icon_ch)
- @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
- end
- icon_max = icon_limit(@actor.mp,@mp_icon_real_max)
- rx = 0
- ry = 0
- for i in 0...icon_max
- break if (i / @mp_icon_col_max) >= @mp_icon_row_max
- rx = (i * (@mp_icon_cw + MP_ICON_SPACE[0]) ) - ((i / @mp_icon_col_max) * (@mp_icon_cw + MP_ICON_SPACE[0]) * @mp_icon_col_max)
- ry = (i / @mp_icon_col_max) * (@mp_icon_ch + MP_ICON_SPACE[1])
- i_scr = Rect.new(@mp_icon_cw,0,@mp_icon_cw,@mp_icon_ch)
- @mp_icon.bitmap.blt(rx,ry,@mp_icon_image ,i_scr )
- end
- refresh_mp_icon_ex(rx,ry)
- end
-
- #--------------------------------------------------------------------------
- # * Create MP Icon EX
- #--------------------------------------------------------------------------
- def create_mp_icon_ex(viewport)
- return if !MP_ICON_EX_VISIBLE
- @mp_icon3_anime_phase = 0
- @mp_icon3 = Sprite.new
- @mp_icon3.bitmap = Bitmap.new(@mp_icon2_cw,@mp_icon2_ch)
- @mp_icon3.ox = @mp_icon3.bitmap.width / 2
- @mp_icon3.oy = @mp_icon3.bitmap.height / 2
- @mp_icon3.z = HUD_Z + MP_ICON_Z + 2
- @mp_icon3_org = [@hud_position[0] + MP_ICON_POSITION[0] + MP_ICON_EX_POSITION[0] + @mp_icon3.ox,
- @hud_position[1] + MP_ICON_POSITION[1] + MP_ICON_EX_POSITION[1] + @mp_icon3.oy]
- @mp_icon3.x = @mp_icon3_org[0]
- @mp_icon3.y = @mp_icon3_org[1]
- @mp_icon3.viewport = viewport
- @mp_icon3.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * Refresh MP Icon EX
- #--------------------------------------------------------------------------
- def refresh_mp_icon_ex(rx,ry)
- return if @mp_icon3 == nil
- @mp_icon3.bitmap.clear
- return if @actor.mp == 0
- i_scr = Rect.new(0,0,@mp_icon2_cw,@mp_icon2_ch)
- @mp_icon3.bitmap.blt(0,0, @mp_icon2_image ,i_scr )
- @mp_icon3.x = @mp_icon3_org[0] + rx
- @mp_icon3.y = @mp_icon3_org[1] + ry
- end
-
- #--------------------------------------------------------------------------
- # * Update Icon MP EX Anime
- #--------------------------------------------------------------------------
- def update_icon_mp_ex_anime
- return if !MP_ICON_EX_ZOOM_EFFECT
- if @mp_icon3_anime_phase == 0
- @mp_icon3.zoom_x += 0.01
- if @mp_icon3.zoom_x >= 1.30
- @mp_icon3.zoom_x = 1.30
- @mp_icon3_anime_phase = 1
- end
- else
- @mp_icon3.zoom_x -= 0.01
- if @mp_icon3.zoom_x <= 1.05
- @mp_icon3.zoom_x = 1.05
- @mp_icon3_anime_phase = 0
- end
- end
- @mp_icon3.zoom_y = @mp_icon3.zoom_x
- end
-
- #--------------------------------------------------------------------------
- # * Create MP Icon Number
- #--------------------------------------------------------------------------
- def create_mp_icon_number(viewport)
- return if !MP_ICON_NUMBER_VISIBLE
- @mp_icon_number_old = [-1,-1]
- @mp_icon_number = Sprite.new
- @mp_icon_number.bitmap = Bitmap.new(@mp_icon_number_cw * 4,@mp_icon_number_ch)
- @mp_icon_number.z = HUD_Z + MP_ICON_NUMBER_Z
- @mp_icon_number.x = @hud_position[0] + MP_ICON_NUMBER_POSITION[0]
- @mp_icon_number.y = @hud_position[1] + MP_ICON_NUMBER_POSITION[1]
- @mp_icon_number.viewport = viewport
- @mp_icon_number.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * Refresh Icon Number MP
- #--------------------------------------------------------------------------
- def refresh_icon_number_mp
- @mp_icon_number_old[0] = @actor.mp
- @mp_icon_number_old[1] = @actor.mmp
- @mp_icon_number.bitmap.clear
- value = ((@actor.mp - 1) / @mp_icon_col_max) / @mp_icon_row_max
- value = 0 if value < 0
- number_value = value.truncate.abs.to_s.split(//)
- for r in 0..number_value.size - 1
- number_value_abs = number_value[r].to_i
- nsrc_rect = Rect.new(@mp_icon_number_cw * number_value_abs, 0, @mp_icon_number_cw, @mp_icon_number_ch)
- @mp_icon_number.bitmap.blt(@mp_icon_number_cw * r, 0, @mp_icon_number_image, nsrc_rect)
- end
- cx = (number_value.size * @mp_icon_number_cw)
- case MP_ICON_NUMBER_ALIGN_TYPE
- when 0; @mp_icon_number.x = @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
-
- #--------------------------------------------------------------------------
- # * Create TP Number
- #--------------------------------------------------------------------------
- def create_tp_number(viewport)
- return if !TP_NUMBER_VISIBLE
- @tp_number = Sprite.new
- @tp_number.bitmap = Bitmap.new(@tp_number_cw * 6, @tp_number_ch)
- @tp_number.z = HUD_Z + TP_NUMBER_Z
- @tp_number.x = @hud_position[0] + TP_NUMBER_POSITION[0]
- @tp_number.y = @hud_position[1] + TP_NUMBER_POSITION[1]
- @tp_number.viewport = viewport
- @tp_number.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * Create TP Number MAX
- #--------------------------------------------------------------------------
- def create_tp_number_max(viewport)
- return if !TP_NUMBER_MAX_VISIBLE
- @tp_number2 = Sprite.new
- @tp_number2.bitmap = Bitmap.new(@tp_number2_cw * 6, @tp_number2_ch)
- @tp_number2.z = HUD_Z + TP_NUMBER_Z
- @tp_number2.x = @hud_position[0] + TP_NUMBER_MAX_POSITION[0]
- @tp_number2.y = @hud_position[1] + TP_NUMBER_MAX_POSITION[1]
- @tp_number2.viewport = viewport
- @tp_number2.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * Create TP Meter
- #--------------------------------------------------------------------------
- def create_tp_meter(viewport)
- return if !TP_METER_VISIBLE
- @tp_flow_max = @tp_meter_cw * 2
- @tp_flow = rand(@tp_flow_max)
- @tp_meter = Sprite.new
- @tp_meter.bitmap = Bitmap.new(@tp_meter_cw,@tp_meter_ch)
- @tp_meter.z = HUD_Z + TP_METER_Z
- @tp_meter.x = @hud_position[0] + TP_METER_POSITION[0]
- @tp_meter.y = @hud_position[1] + TP_METER_POSITION[1]
- @tp_meter.angle = TP_METER_ANGLE
- @tp_meter.mirror = TP_METER_MIRROR_EFFECT
- @tp_meter.viewport = viewport
- @tp_meter.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # ● Update Flow TP
- #--------------------------------------------------------------------------
- def update_flow_tp
- @tp_meter.bitmap.clear
- @tp_flow = 0 if !TP_METER_GRADIENT_ANIMATION
- meter_width = @tp_meter_cw * @actor.tp / @actor.max_tp rescue nil
- meter_width = 0 if meter_width == nil
- execute_tp_damage_flow(meter_width)
- meter_src_rect = Rect.new(@tp_flow, 0,meter_width, @tp_meter_ch)
- @tp_meter.bitmap.blt(0,0, @tp_meter_image, meter_src_rect)
- @tp_flow += 1
- @tp_flow = 0 if @tp_flow >= @tp_flow_max
- end
-
- #--------------------------------------------------------------------------
- # ● Execute TP Damage Flow
- #--------------------------------------------------------------------------
- def execute_tp_damage_flow(meter_width)
- return if !TP_METER_REDUCTION_ANIMATION
- return if @tp_old_meter == meter_width
- n = (@tp_old_meter - meter_width).abs * 3 / 100
- damage_flow = [[n, 2].min,0.5].max
- @tp_old_meter -= damage_flow
- @tp_old_meter = meter_width if @tp_old_meter <= meter_width
- src_rect_old = Rect.new(0,@tp_meter_ch, @tp_old_meter, @tp_meter_ch)
- @tp_meter.bitmap.blt(0,0, @tp_meter_image, src_rect_old)
- end
- #--------------------------------------------------------------------------
- # * Create TP Icon
- #--------------------------------------------------------------------------
- def create_tp_icon(viewport)
- return if !TP_ICON_VISIBLE
- @tp_icon = Sprite.new
- icon_width = @tp_icon_col_max * (@tp_icon_cw + TP_ICON_SPACE[0].abs)
- icon_height = @tp_icon_row_max * (@tp_icon_ch + TP_ICON_SPACE[1].abs)
- @tp_icon.bitmap = Bitmap.new(icon_width,icon_height)
- @tp_icon.z = HUD_Z + TP_ICON_Z
- @tp_icon.x = @hud_position[0] + TP_ICON_POSITION[0]
- @tp_icon.y = @hud_position[1] + TP_ICON_POSITION[1]
- @tp_icon.viewport = viewport
- @tp_icon.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * Refresh TP Icon
- #--------------------------------------------------------------------------
- def refresh_tp_icon
- @tp_icon_old = @actor.tp
- @tp_icon.bitmap.clear
- max_value = (@actor.max_tp / @tp_icon_real_max) * @tp_icon_real_max
- if @actor.mp > max_value
- icon_max = icon_limit(@actor.max_tp,@tp_icon_real_max)
- else
- icon_max = @actor.max_tp
- end
- for i in 0...icon_max
- break if (i / @tp_icon_col_max) >= @tp_icon_row_max
- rx = (i * (@tp_icon_cw + TP_ICON_SPACE[0]) ) - ((i / @tp_icon_col_max) * (@tp_icon_cw + TP_ICON_SPACE[0]) * @tp_icon_col_max)
- ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
- i_scr = Rect.new(0,0,@tp_icon_cw,@tp_icon_ch)
- @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
- end
- icon_max = icon_limit(@actor.tp,@tp_icon_real_max)
- rx = 0
- ry = 0
- for i in 0...icon_max
- break if (i / @tp_icon_col_max) >= @tp_icon_row_max
- rx = (i * (@tp_icon_cw + TP_ICON_SPACE[0]) ) - ((i / @tp_icon_col_max) * (@tp_icon_cw + TP_ICON_SPACE[0]) * @tp_icon_col_max)
- ry = (i / @tp_icon_col_max) * (@tp_icon_ch + TP_ICON_SPACE[1])
- i_scr = Rect.new(@mp_icon_cw,0,@tp_icon_cw,@tp_icon_ch)
- @tp_icon.bitmap.blt(rx,ry,@tp_icon_image ,i_scr )
- end
- refresh_tp_icon_ex(rx,ry)
- end
-
- #--------------------------------------------------------------------------
- # * Create TP Icon EX
- #--------------------------------------------------------------------------
- def create_tp_icon_ex(viewport)
- return if !TP_ICON_EX_VISIBLE
- @tp_icon3_anime_phase = 0
- @tp_icon3 = Sprite.new
- @tp_icon3.bitmap = Bitmap.new(@tp_icon2_cw,@tp_icon2_ch)
- @tp_icon3.ox = @tp_icon3.bitmap.width / 2
- @tp_icon3.oy = @tp_icon3.bitmap.height / 2
- @tp_icon3.z = HUD_Z + TP_ICON_Z + 2
- @tp_icon3_org = [@hud_position[0] + TP_ICON_POSITION[0] + TP_ICON_EX_POSITION[0] + @tp_icon3.ox,
- @hud_position[1] + TP_ICON_POSITION[1] + TP_ICON_EX_POSITION[1] + @tp_icon3.oy]
- @tp_icon3.x = @tp_icon3_org[0]
- @tp_icon3.y = @tp_icon3_org[1]
- @tp_icon3.viewport = viewport
- @tp_icon3.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * Refresh TP Icon EX
- #--------------------------------------------------------------------------
- def refresh_tp_icon_ex(rx,ry)
- return if @tp_icon3 == nil
- @tp_icon3.bitmap.clear
- return if @actor.tp == 0
- i_scr = Rect.new(0,0,@tp_icon2_cw,@tp_icon2_ch)
- @tp_icon3.bitmap.blt(0,0, @tp_icon2_image ,i_scr )
- @tp_icon3.x = @tp_icon3_org[0] + rx
- @tp_icon3.y = @tp_icon3_org[1] + ry
- end
-
- #--------------------------------------------------------------------------
- # * Update Icon TP EX Anime
- #--------------------------------------------------------------------------
- def update_icon_tp_ex_anime
- return if !MP_ICON_EX_ZOOM_EFFECT
- if @tp_icon3_anime_phase == 0
- @tp_icon3.zoom_x += 0.01
- if @tp_icon3.zoom_x >= 1.30
- @tp_icon3.zoom_x = 1.30
- @tp_icon3_anime_phase = 1
- end
- else
- @tp_icon3.zoom_x -= 0.01
- if @tp_icon3.zoom_x <= 1.05
- @tp_icon3.zoom_x = 1.05
- @tp_icon3_anime_phase = 0
- end
- end
- @tp_icon3.zoom_y = @tp_icon3.zoom_x
- end
-
- #--------------------------------------------------------------------------
- # * Create HP Icon Number
- #--------------------------------------------------------------------------
- def create_tp_icon_number(viewport)
- return if !TP_ICON_NUMBER_VISIBLE
- @tp_icon_number_old = [-1,-1]
- @tp_icon_number = Sprite.new
- @tp_icon_number.bitmap = Bitmap.new(@tp_icon_number_cw * 3,@tp_icon_number_ch)
- @tp_icon_number.z = HUD_Z + TP_ICON_NUMBER_Z
- @tp_icon_number.x = @hud_position[0] + TP_ICON_NUMBER_POSITION[0]
- @tp_icon_number.y = @hud_position[1] + TP_ICON_NUMBER_POSITION[1]
- @tp_icon_number.viewport = viewport
- @tp_icon_number.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * Refresh Icon Number TP
- #--------------------------------------------------------------------------
- def refresh_icon_number_tp
- @tp_icon_number_old[0] = @actor.tp
- @tp_icon_number_old[1] = @actor.max_tp
- @tp_icon_number.bitmap.clear
- value = ((@actor.tp - 1) / @tp_icon_col_max) / @tp_icon_row_max
- value = 0 if value < 0
- number_value = value.truncate.abs.to_s.split(//)
- for r in 0..number_value.size - 1
- number_value_abs = number_value[r].to_i
- nsrc_rect = Rect.new(@tp_icon_number_cw * number_value_abs, 0, @tp_icon_number_cw, @tp_icon_number_ch)
- @tp_icon_number.bitmap.blt(@tp_icon_number_cw * r, 0, @tp_icon_number_image, nsrc_rect)
- end
- cx = (number_value.size * @tp_icon_number_cw)
- case TP_ICON_NUMBER_ALIGN_TYPE
- when 0; @tp_icon_number.x = @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
-
- #--------------------------------------------------------------------------
- # * Create AT Number
- #--------------------------------------------------------------------------
- def create_at_number(viewport)
- return if !AT_NUMBER_VISIBLE
- @at_number = Sprite.new
- @at_number.bitmap = Bitmap.new(@at_number_cw * 4,@at_number_ch)
- @at_number.z = HUD_Z + AT_NUMBER_Z
- @at_number.x = @hud_position[0] + AT_NUMBER_POSITION[0]
- @at_number.y = @hud_position[1] + AT_NUMBER_POSITION[1]
- @at_number.viewport = viewport
- @at_number.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * Create AT Number Max
- #--------------------------------------------------------------------------
- def create_at_number_max(viewport)
- return if !AT_NUMBER_MAX_VISIBLE
- @at_number2 = Sprite.new
- @at_number2.bitmap = Bitmap.new(@at_number2_cw * 4,@at_number2_ch)
- @at_number2.z = HUD_Z + AT_NUMBER_Z
- @at_number2.x = @hud_position[0] + AT_NUMBER_MAX_POSITION[0]
- @at_number2.y = @hud_position[1] + AT_NUMBER_MAX_POSITION[1]
- @at_number2.viewport = viewport
- @at_number2.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * Create AT Meter
- #--------------------------------------------------------------------------
- def create_at_meter(viewport)
- return if !AT_METER_VISIBLE
- @at_flow_max = @at_meter_cw * 2
- @at_flow = rand(@at_flow_max)
- @at_meter = Sprite.new
- @at_meter.bitmap = Bitmap.new(@at_meter_cw,@at_meter_ch)
- @at_meter.z = HUD_Z + AT_METER_Z
- @at_meter.x = @hud_position[0] + AT_METER_POSITION[0]
- @at_meter.y = @hud_position[1] + AT_METER_POSITION[1]
- @at_meter.angle = AT_METER_ANGLE
- @at_meter.mirror = AT_METER_MIRROR_EFFECT
- @at_meter.viewport = viewport
- @at_meter.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # ● Update Flow AT
- #--------------------------------------------------------------------------
- def update_flow_at
- @at_meter.bitmap.clear
- @at_flow = 0 if !AT_METER_GRADIENT_ANIMATION
- if actor_cast?
- meter_width = @at_meter_cw * actor_cast / actor_max_cast rescue nil
- meter_width = 0 if meter_width == nil
- ch = @at_meter_ch * 2
- else
- meter_width = @at_meter_cw * actor_at / actor_max_at rescue nil
- meter_width = 0 if meter_width == nil
- ch = actor_at >= actor_max_at ? @at_meter_ch : 0
- end
- meter_src_rect = Rect.new(@at_flow, ch,meter_width, @at_meter_ch)
- @at_meter.bitmap.blt(0,0, @at_meter_image, meter_src_rect)
- @at_flow += 1
- @at_flow = 0 if @at_flow >= @at_flow_max
- end
-
- #--------------------------------------------------------------------------
- # * 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
-
- #--------------------------------------------------------------------------
- # * Create Level Number
- #--------------------------------------------------------------------------
- def create_level_number(viewport)
- return if !LEVEL_NUMBER_VISIBLE
- @old_level = -1
- @lv_number = Sprite.new
- @lv_number.bitmap = Bitmap.new(@lv_number_cw * 2, @lv_number_ch)
- @lv_number.z = HUD_Z + LEVEL_NUMBER_Z
- @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
- @lv_number.y = @hud_position[1] + LEVEL_NUMBER_POSITION[1]
- @lv_number.viewport = viewport
- @lv_number.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * Refresh Level Number
- #--------------------------------------------------------------------------
- def refresh_level_number
- @lv_number.bitmap.clear
- @old_level = @actor.level
- number_value = @actor.level.abs.to_s.split(//)
- for r in 0..number_value.size - 1
- number_value_abs = number_value[r].to_i
- nsrc_rect = Rect.new(@lv_number_cw * number_value_abs, 0, @lv_number_cw, @lv_number_ch)
- @lv_number.bitmap.blt(@lv_number_cw * r, 0, @lv_number_image, nsrc_rect)
- end
- cx = (number_value.size * @lv_number_cw)
- case LEVEL_NUMBER_ALIGN_TYPE
- when 0; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0]
- when 1; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - (cx / 2)
- when 2; @lv_number.x = @hud_position[0] + LEVEL_NUMBER_POSITION[0] - cx
- end
- end
-
- #--------------------------------------------------------------------------
- # * Update Level
- #--------------------------------------------------------------------------
- def update_level
- return if @lv_number == nil
- sprite_visible(@lv_number)
- refresh_level_number if @old_level != @actor.level
- end
-
- end
- #==============================================================================
- #==============================================================================
- # ** Battle Hud EX
- #==============================================================================
- #==============================================================================
- class Battle_Hud_EX
-
- #--------------------------------------------------------------------------
- # * Create States
- #--------------------------------------------------------------------------
- def create_states(viewport)
- return if !STATES_VISIBLE
- @status_old = nil
- @status_flow = [-24,0]
- @status_size_real = 0
- @status = Sprite.new
- @status.bitmap = Bitmap.new(24,24)
- @status.x = @hud_position[0] + STATES_POSITION[0]
- @status.y = @hud_position[1] + STATES_POSITION[1]
- @status.z = HUD_Z + STATES_Z
- @status.angle = STATE_ANGLE
- @status.viewport = viewport
- @status.opacity = 0
- end
-
- #--------------------------------------------------------------------------
- # * 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
-
- #--------------------------------------------------------------------------
- # * Create Face
- #--------------------------------------------------------------------------
- def create_face(viewport)
- return if !FACE_VISIBLE
- @face_old_hp = @actor.hp
- @face_old_mp = @actor.mp
- @face_old_tp = @actor.tp
- @face_name = ""
- @face = Sprite.new
- @face_org = [@hud_position[0] + FACE_POSITION[0], @hud_position[1] + FACE_POSITION[1]]
- @face.x = @face_org[0]
- @face.y = @face_org[1]
- @face.z = HUD_Z + FACE_Z
- @face.viewport = viewport
- @face.opacity = 0
- refresh_face_name
- end
- #--------------------------------------------------------------------------
- # * Refresh Face Name
- #--------------------------------------------------------------------------
- def refresh_face_name
- @face_image.dispose if @face_image != nil
- @face.bitmap.dispose if @face.bitmap != nil
- return if @actor == nil or @actor.id == nil
- @face_image = Cache.battle_hud(@actor.battler_face_name.to_s) rescue nil
- @face_image = Bitmap.new(32,32) if @face_image == nil
- @face_cw = FACE_ANIMATION ? @face_image.width / 5 : @face_image.width
- @face_ch = @face_image.height
- @face.ox = @face_cw / 2
- @face.oy = @face_ch / 2
- @face.bitmap = Bitmap.new(@face_cw,@face_ch)
- @face_org = [@hud_position[0] + FACE_POSITION[0],
- @hud_position[1] + @face.oy + FACE_POSITION[1]]
- if $game_temp.battler_face_pos[@actor_index] == nil
- $game_temp.battler_face_pos[@actor_index] = []
- end
- @face.x = @face_org[0]
- @face.y = @face_org[1]
- limit_Y = (@hud_position[1] + FACE_POSITION[1] + @face_image.height)
- fy = @face_org[1]
- if limit_Y > Graphics.height
- @face.y = Graphics.height - (@face_image.height - @face.oy)
- fy = Graphics.height - 16
- @face_org[1] = @face.y
- end
- $game_temp.battler_face_pos[@actor_index][0] = @face_org[0]
- $game_temp.battler_face_pos[@actor_index][1] = fy
- $game_temp.battler_face_pos[@actor_index][2] = @face.z
- clear_face_index
- end
- #--------------------------------------------------------------------------
- # * 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_end
- mog_battle_hud_battle_process_victory
- end
-
- #--------------------------------------------------------------------------
- # ● Execute Face Effect End
- #--------------------------------------------------------------------------
- def execute_face_effect_end
- $game_temp.battle_end = true
- 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_temp.battle_end = true
- mog_battle_hud_ex_message_battle_process_defeat
- end
-
- #--------------------------------------------------------------------------
- # * Process Abort
- #--------------------------------------------------------------------------
- alias mog_battle_hud_ex_process_abort process_abort
- def process_abort
- $game_temp.battle_end = true
- mog_battle_hud_ex_process_abort
- 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
- #--------------------------------------------------------------------------
- def dispose
- terminate
- dispose_layout
- dispose_layout_2
- dispose_name
- dispose_face
- dispose_hp_number
- dispose_hp_number_max
- dispose_hp_meter
- dispose_hp_icon
- dispose_hp_icon_ex
- dispose_hp_icon_number
- dispose_mp_number
- dispose_mp_number_max
- dispose_mp_meter
- dispose_mp_icon
- dispose_mp_icon_ex
- dispose_mp_icon_number
- dispose_tp_number
- dispose_tp_number_max
- dispose_tp_meter
- dispose_tp_icon
- dispose_tp_icon_ex
- dispose_tp_icon_number
- dispose_at_number
- dispose_at_number_max
- dispose_at_meter
- dispose_lv_number
- dispose_states
- end
-
- #--------------------------------------------------------------------------
- # * 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
-
- #--------------------------------------------------------------------------
- # * Update
- #--------------------------------------------------------------------------
- def update
- return if @actor == nil
- @sprite_visible = sprite_visible?
- @sprite_visitle_wait -= 1 if @sprite_visitle_wait > 0
- update_layout ; update_layout_2 ; update_name
- update_face ; update_hp ; update_mp ; update_tp
- update_at ; update_level ; update_states
- end
-
- end
- #==============================================================================
- # ■ Sprite Battler
- #==============================================================================
- class Sprite_Battler < Sprite_Base
- #--------------------------------------------------------------------------
- # ● Set AV
- #--------------------------------------------------------------------------
- def set_av(a_viewport)
- @viewport_cm = a_viewport
- end
-
- #--------------------------------------------------------------------------
- # ● Dispose
- #--------------------------------------------------------------------------
- alias mog_bc_dispose dispose
- def dispose
- mog_bc_dispose
- @viewport_cm.dispose if @viewport_cm != nil
- end
-
- #--------------------------------------------------------------------------
- # ● Maker Animation Sprites
- #--------------------------------------------------------------------------
- alias mog_bc_make_animation_sprites make_animation_sprites
- def make_animation_sprites
- mog_bc_make_animation_sprites
- set_cm_viewport if $imported[:mog_battle_camera]
- end
-
- #--------------------------------------------------------------------------
- # ● Set CM Viewpor
- #--------------------------------------------------------------------------
- def set_cm_viewport
- return if @viewport_cm == nil
- return if @ani_sprites == nil
- if @battler.is_a?(Game_Actor) and SceneManager.face_battler?
- @ani_sprites.each {|sprite| sprite.viewport = nil; sprite.z = 100}
- return
- end
- @ani_sprites.each {|sprite| sprite.viewport = @viewport_cm; sprite.z = 100}
- end
-
- end
- #==============================================================================
- # ■ Game Temp
- #==============================================================================
- class Spriteset_Battle
-
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- alias mog_bc_sp_initialize initialize
- def initialize
- mog_bc_sp_initialize
- if $imported[:mog_battle_camera] and @viewport_cm != nil
- battler_sprites.each do |sprite| sprite.set_av(@viewport_cm) end
- end
- end
- #--------------------------------------------------------------------------
- # ● Create Viewports
- #--------------------------------------------------------------------------
- alias mog_bc_create_viewports create_viewports
- def create_viewports
- mog_bc_create_viewports
- if $imported[:mog_battle_camera]
- @viewport_cm = Viewport.new
- @viewport_cm.z = 100
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Dispose Viewports
- #--------------------------------------------------------------------------
- alias mog_bc_dispose_viewports dispose_viewports
- def dispose_viewports
- mog_bc_dispose_viewports
- @viewport_cm.dispose if $imported[:mog_battle_camera] and @viewport_cm != nil
- end
-
- #--------------------------------------------------------------------------
- # ● Update Viewports
- #--------------------------------------------------------------------------
- alias mog_bcf_update_viewports update_viewports
- def update_viewports
- mog_bcf_update_viewports
- update_viewport_cm if $imported[:mog_battle_camera]
- end
- #--------------------------------------------------------------------------
- # ● Update Viewport CM
- #--------------------------------------------------------------------------
- def update_viewport_cm
- return if @viewport_cm == nil
- @viewport_cm.ox = $game_troop.screen.shake + $game_temp.bc_data[0]
- @viewport_cm.oy = $game_temp.bc_data[1]
- @viewport_cm.update
- end
-
- end
复制代码
|
|