#==============================================================================#
# ※ 后知后觉横版战斗模板 增强补丁
#------------------------------------------------------------------------------#
# 添加了战斗时角色脚下的血槽
# 此脚本为定制脚本
# 影月千秋
# 2014.01.27 #
#==============================================================================#
#==============================================================================
# ■ Hzhj::HorizontalBattleSystem
#------------------------------------------------------------------------------
# 只在这里进行编辑
#==============================================================================
module Hzhj::HorizontalBattleSystem
MoGB_LOC_X = "index * 30 + 300"
MoGB_LOC_Y = "index * 45 + 20"
# 值槽位置计算公式
# ·关于图片
# 放在Graphics\System下
# ·图片名
# Mo_Hzhj_HBS_GB_B.png 背景
# Mo_Hzhj_HBS_GB_F.png 槽图
# 值槽左上角与图片左上角位置差
# 分别为横纵坐标之差
MoGB_ADD_X = 1
MoGB_ADD_Y = 4
end
#==============================================================================
# ■ SpriteSet_MoGagueBar_ForHzhjHBS
#==============================================================================
class SpriteSet_Mo_GB_HzhjHBS
include Hzhj::HorizontalBattleSystem
#--------------------------------------------------------------------------
# ● 初始化
#--------------------------------------------------------------------------
def initialize(viewport, battler)
[url=home.php?mod=space&uid=133701]@battler[/url] = battler
return if @battler.nil? || !@battler.actor?
@back = Sprite_Base.new(viewport)
@back.bitmap = Cache.system("Mo_Hzhj_HBS_GB_B") rescue nil
@back.x = eval("battler.#{MoGB_LOC_X}")
@back.y = eval("battler.#{MoGB_LOC_Y}")
@back.z = battler.screen_z + 5 - battler.index
@fore = Sprite_Base.new(viewport)
@fore.bitmap = Cache.system("Mo_Hzhj_HBS_GB_F") rescue nil
@fore.x = @back.x + MoGB_ADD_X
@fore.y = @back.y + MoGB_ADD_Y
@fore.z = @back.z + 1
@rate = @battler.hp_rate
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def update
refresh if @rate != @battler.hp_rate
end
#--------------------------------------------------------------------------
# ● 描绘
#--------------------------------------------------------------------------
def refresh
@rate = @battler.hp_rate
@fore.zoom_x = @rate
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
@fore.bitmap.dispose if @back.bitmap
@fore.dispose
@back.bitmap.dispose if @back.bitmap
@back.dispose
end
end
#==============================================================================
# ■ Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ● 生成角色活动块
#--------------------------------------------------------------------------
alias :mo_gb_hzhjHBS_create_actors :create_actors
def create_actors
mo_gb_hzhjHBS_create_actors
create_mo_hzhjHBS_gb
end
#--------------------------------------------------------------------------
# ● 释放角色活动块
#--------------------------------------------------------------------------
def create_mo_hzhjHBS_gb
@mo_actor_gague_bar = Array.new(4){|i|
SpriteSet_Mo_GB_HzhjHBS.new(@viewport1, $game_party.battle_members[i])
}
end
#--------------------------------------------------------------------------
# ● 释放角色活动块
#--------------------------------------------------------------------------
alias :mo_gb_hzhjHBS_dispose_actors :dispose_actors
def dispose_actors
mo_gb_hzhjHBS_dispose_actors
dispose_mo_hzhjHBS_gb
end
#--------------------------------------------------------------------------
# ● 释放值槽活动块
#--------------------------------------------------------------------------
def dispose_mo_hzhjHBS_gb
@mo_actor_gague_bar.each{|gb| gb.dispose}
end
#--------------------------------------------------------------------------
# ● 更新值槽活动块
#--------------------------------------------------------------------------
def update_mo_hzhjHBS_gb
@mo_actor_gague_bar.each{|gb| gb.update}
end
end
#==============================================================================
# ■ Window_BattleStatus
#==============================================================================
class Window_BattleStatus
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
alias :mo_gb_hzhjHBS_refresh :refresh
def refresh
mo_gb_hzhjHBS_refresh
SceneManager.scene.instance_variable_get("@spriteset").update_mo_hzhjHBS_gb
end
end