#针对544*460分辨率游戏状态栏添加TP与经验槽显示的脚本
#原脚本作者:Taroxd
#修改:兮焉贤
#原功能:在人物选择栏和状态栏添加TP值显示
#添加功能:在人物选择栏和状态栏添加以图形形式存在的经验条并将HP、MP与TP在状态栏
#的样式修改为适应544*460分辨率的表现形式
#本脚本经过游戏作者的大幅度改造,需要在配合大量特定脚本与修改系统本身脚本的情况
#下使用,否则会出现一系列问题
#本脚本为544*460分辨率游戏量身打造,在默认分辨率下使用游戏会出错
#如需要使用,请添加Taroxd基础脚本,并把游戏分辨率设为544*460
#由于游戏使用了额外的LNX11_XP战斗脚本,因而无法确定在基础的战斗系统之下是否会有
#显示错误
#==============================================================================
# ●設定區域
#==============================================================================
module WD
module Exp_Gauge
#EXP條COLOR,請修改成TEXT文字
EXP_GAUGE_COLOR1 = 6
EXP_GAUGE_COLOR2 = 14
#EXP條文字顯示設定,true為打開,false為關閉
EXP_TEXT_DISPLAY = true
end
end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# ゲーム中の全てのウィンドウのスーパークラスです。
#==============================================================================
class Window_Base < Window
include WD::Exp_Gauge
def exp_gauge_color1; text_color(EXP_GAUGE_COLOR1); end; # EXP ゲージ 1
def exp_gauge_color2; text_color(EXP_GAUGE_COLOR2); end; # EXP ゲージ 2
#--------------------------------------------------------------------------
# ● HP の描画(针对544*460的视觉效果修改)
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 204)
draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
change_color(system_color)
draw_text(x, y, 30, line_height, Vocab::hp_a)
draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
hp_color(actor), normal_color)
end
#--------------------------------------------------------------------------
# ● MP の描画(针对544*460的视觉效果修改)
#--------------------------------------------------------------------------
def draw_actor_mp(actor, x, y, width = 124)
draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
change_color(system_color)
draw_text(x, y, 30, line_height, Vocab::mp_a)
draw_current_and_max_values(x, y, width, actor.mp, actor.mmp,
mp_color(actor), normal_color)
end
#--------------------------------------------------------------------------
# ● TP の描画(针对544*460的视觉效果修改)
#--------------------------------------------------------------------------
def draw_actor_tp(actor, x, y, width = 124)
draw_gauge(x, y, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
change_color(system_color)
draw_text(x, y, 30, line_height, Vocab::tp_a)
change_color(tp_color(actor))
draw_text(x + width - 42, y, 42, line_height, actor.tp.to_i, 2)
end
#-----------------------------------------------------------------------------
# ● シンプルなステータスの描画(针对544*460的视觉效果修改)
#-----------------------------------------------------------------------------
Taroxd::MenuTP = true
def draw_actor_simple_status(actor, x, y)
draw_actor_name(actor, x, y + line_height * 0.5)
draw_actor_level(actor, x, y - line_height * 0.5)
draw_actor_icons(actor, x, y + line_height * 1.5)
draw_actor_class(actor, x + 120, y - line_height * 0.5)
draw_actor_hp(actor, x + 120, y + line_height * 0.5)
draw_actor_mp(actor, x + 120, y + line_height * 1.5, 100)
draw_actor_tp(actor, x + 224, y + line_height * 1.5, 100)
draw_actor_exp(actor, x, y + line_height * 2.5, EXP_TEXT_DISPLAY)
end
end
class Window_Status < Window_Selectable
def_chain :draw_basic_info do |old, x, y|
draw_actor_level(@actor, x, y)
draw_actor_icons(@actor, x, y + line_height)
draw_actor_hp(@actor, x, y + line_height * 0.9)
draw_actor_mp(@actor, x, y + line_height * 1.9, 100)
draw_actor_tp(@actor, x + 104, y + line_height * 1.9, 100)
draw_actor_exp2(@actor, x, y + line_height * 3, EXP_TEXT_DISPLAY)
end
end
#--------------------------------------------------------------------------
# ● 経験値情報の描画(针对544*460的视觉效果修改)
#--------------------------------------------------------------------------
def draw_exp_info(x, y)
s1 = @actor.max_level? ? "-------" : @actor.exp
s2 = @actor.max_level? ? "-------" : @actor.next_level_exp - @actor.exp
s_next = sprintf(Vocab::ExpNext, Vocab::level)
change_color(system_color)
draw_text(x+80, y + line_height * 0, 180, line_height, Vocab::ExpTotal)
draw_text(x+80, y + line_height * 1.2, 180, line_height, s_next)
change_color(normal_color)
draw_text(x+100, y + line_height * 0.6, 180, line_height, s1, 2)
draw_text(x+100, y + line_height * 1.8, 180, line_height, s2, 2)
end
#--------------------------------------------------------------------------
# ● EXP の描画(针对544*460的视觉效果修改)
#--------------------------------------------------------------------------
def draw_actor_exp(actor, x, y, display = true, width = 328)
this_level = actor.exp - actor.past_level_exp
next_level = actor.next_level_exp - actor.past_level_exp
draw_gauge(x, y, width, actor.exp_rate, exp_gauge_color1, exp_gauge_color2)
change_color(system_color)
if display
draw_text(x, y, 30, line_height, "EXP")
draw_current_and_max_values(x, y, width, this_level, next_level, mp_color(actor), normal_color)
end
end
def draw_actor_exp2(actor, x, y, display = true, width = 448)
this_level = actor.exp - actor.past_level_exp
next_level = actor.next_level_exp - actor.past_level_exp
draw_gauge(x, y, width, actor.exp_rate, exp_gauge_color1, exp_gauge_color2)
change_color(system_color)
if display
draw_text(x, y, 30, line_height, "EXP")
draw_current_and_max_values(x, y, width, this_level, next_level, mp_color(actor), normal_color)
end
end
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● EXP の割合を取得
#--------------------------------------------------------------------------
def exp_rate
this_level = exp - past_level_exp
next_level = next_level_exp - past_level_exp
next_level > 0 ? this_level.to_f / next_level : 0
end
#--------------------------------------------------------------------------
# ● 前のレベルの経験値を取得
#--------------------------------------------------------------------------
def past_level_exp
@level > 1 ? exp_for_level(@level - 1) : 0
end
end