#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
#==============================================================================
# 自定义战斗渐变图 by 沉影不器
#------------------------------------------------------------------------------
# 功能描述: ① 允许用户指定战斗渐变图
# ② 容错处理: 未指定战斗渐变图,或者指定图未找到时,随机抽取渐变图
# 使用方法: ① 复制脚本,插入到Main之前
# ② 在Graphics文件夹下新建Transitions文件夹并存放渐变图
# 您也可以在脚本第12行自行设定路径
# ③ 在战斗前使用事件脚本输入 trans_file file_name指定渐变图
# 例: trans_file "001-Blind01.png"
#------------------------------------------------------------------------------
PATH = "Graphics/Transitions/" # 设定渐变图存储路径
#==============================================================================
# ■ Game_Temp
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# ● 读写定义
#--------------------------------------------------------------------------
attr_accessor :trans_file
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
alias trans_ini initialize
def initialize
trans_ini
@trans_file = ""
end
end
#==============================================================================
# ■ Scene_Map
#==============================================================================
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# ● 执行战斗前变换
#--------------------------------------------------------------------------
def perform_battle_transition
if $game_temp.trans_file == ""
file = Dir.entries(T_PATH)
file.delete(".");file.delete("..")
$game_temp.trans_file = file[rand(file.size)]
end
Graphics.transition(80, T_PATH + $game_temp.trans_file, 80)
$game_temp.trans_file = ""
Graphics.freeze
end
end
#--------------------------------------------------------------------------
# ● 自定义战斗渐变图
#--------------------------------------------------------------------------
def trans_file(file_name)
# 未找到所指定的渐变图时,不赋值
$game_temp.trans_file = file_name if FileTest.exist?(PATH + file_name)
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================