#==============================================================================
# 本脚本由ikki0531 转载于[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#==============================================================================
# ■ ターンの表示(ver 0.98)
#==============================================================================
#==============================================================================
# □ 自定义内容
#==============================================================================
module PLAN_TURN
TURN_STR = "第{turn}回合" # 回合的显示文字({turn}中有回合数)
STR_COLOR = Color.new(255, 0, 0) # 文字颜色
FRAME_COLOR = Color.new(0, 0, 0) # 边缘颜色
FONT_NAME = ["汉仪行楷简","黑体","楷体","宋体"]# 格式导出文件时,将会显示此对话框
FONT_SIZE = 92 # 字体大小
FONT_BOLD = false # 太字
FONT_ITALIC = false # 斜体
CENTER_WAIT = 30 # 中心权重
STR_SPEED = 64 # 文字流动速度
KEY_WAIT = false # 回合显示中的按键输入
TURN_STR_Z = 100 # Z 座標(100中敌人与窗口之间)
RETURN = true # 把掉头的文字放回流动的方向
end
#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
# 处理战斗画面的类。
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
alias plan_turn_main main
def main
# 创建精灵
@turn_sprite = Sprite.new
@turn_sprite.bitmap = Bitmap.new(32, 32)
@turn_sprite.z = PLAN_TURN::TURN_STR_Z
# 临时放置在看不见的位置
center_x = 640 / 2 - @turn_sprite.bitmap.width / 2
@turn_out = -(640 / PLAN_TURN::STR_SPEED)
@turn_sprite_pos = @turn_out
@turn_sprite.x = 640
@turn_wait = 0
# 还原为原始方法
plan_turn_main
# 释放原始精灵
@turn_sprite.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
alias plan_turn_update update
def update
center_x = 640 / 3 - @turn_sprite.bitmap.width / 3
if @turn_sprite_pos > @turn_out
if @turn_sprite_pos == -1 and @turn_wait > 0
@turn_wait -= 1
else
pos = PLAN_TURN::RETURN ? @turn_sprite_pos.abs: @turn_sprite_pos
@turn_sprite.x = center_x + pos * PLAN_TURN::STR_SPEED
@turn_sprite_pos -= 1
@turn_sprite.update
end
# 没有回合显示中的按键输入则结束
return if PLAN_TURN::KEY_WAIT
end
# 还原为原始方法
plan_turn_update
end
#--------------------------------------------------------------------------
# ● 命令阶段开始
#--------------------------------------------------------------------------
alias plan_turn_start_phase2 start_phase2
def start_phase2
if @old_turn != $game_temp.battle_turn + 1
@old_turn = $game_temp.battle_turn + 1
turn = $game_temp.battle_turn + 1
turn_str = PLAN_TURN::TURN_STR.gsub("{turn}") {|s| turn.to_s }
# 精灵宽度和高度
bitmap = Bitmap.new(1024, 768)
bitmap.font.name = PLAN_TURN::FONT_NAME
bitmap.font.size = PLAN_TURN::FONT_SIZE
bitmap.font.bold = PLAN_TURN::FONT_BOLD
rect = bitmap.text_size(turn_str)
bitmap.dispose
bitmap = nil
@turn_sprite.bitmap.dispose
@turn_sprite.bitmap = nil
@turn_sprite.bitmap = Bitmap.new(rect.width, rect.height)
@turn_sprite.bitmap.font.name = PLAN_TURN::FONT_NAME
@turn_sprite.bitmap.font.size = PLAN_TURN::FONT_SIZE
@turn_sprite.bitmap.font.bold = PLAN_TURN::FONT_BOLD
@turn_sprite.bitmap.font.italic = PLAN_TURN::FONT_ITALIC
@turn_sprite.bitmap.font.color = PLAN_TURN::FRAME_COLOR
if defined?(@turn_sprite.bitmap.draw_text_plan_frame)
@turn_sprite.bitmap.draw_text_plan_frame(0, 0, rect.width, rect.height, turn_str)
@turn_sprite.bitmap.draw_text_plan_frame(2, 0, rect.width, rect.height, turn_str)
@turn_sprite.bitmap.draw_text_plan_frame(0, 2, rect.width, rect.height, turn_str)
@turn_sprite.bitmap.draw_text_plan_frame(2, 2, rect.width, rect.height, turn_str)
@turn_sprite.bitmap.font.color = PLAN_TURN::STR_COLOR
@turn_sprite.bitmap.draw_text_plan_frame(1, 1, rect.width, rect.height, turn_str)
else
@turn_sprite.bitmap.draw_text(0, 0, rect.width, rect.height, turn_str)
@turn_sprite.bitmap.draw_text(2, 0, rect.width, rect.height, turn_str)
@turn_sprite.bitmap.draw_text(0, 2, rect.width, rect.height, turn_str)
@turn_sprite.bitmap.draw_text(2, 2, rect.width, rect.height, turn_str)
@turn_sprite.bitmap.font.color = PLAN_TURN::STR_COLOR
@turn_sprite.bitmap.draw_text(-1, 1, rect.width, rect.height, turn_str)
end
center_x = 640 / 2 - @turn_sprite.bitmap.width / 2
@turn_out = -(640 / PLAN_TURN::STR_SPEED)
@turn_sprite_pos = (640 - center_x) / PLAN_TURN::STR_SPEED
@turn_sprite.x = 1024
@turn_sprite.y = 300 / 2 - rect.height / 2
@turn_wait = PLAN_TURN::CENTER_WAIT
end
# 还原为原始方法
plan_turn_start_phase2
end
end
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================