class Scene_Battle
alias start_phase2_old start_phase2
alias start_enemy_select_old start_enemy_select
alias start_actor_select_old start_actor_select
alias start_item_select_old start_item_select
alias start_skill_select_old start_skill_select
alias end_skill_select_old end_skill_select
alias end_item_select_old end_item_select
alias start_phase4_old start_phase4
alias phase3_setup_command_window_old phase3_setup_command_window
def main
$game_temp.in_battle = true
$game_temp.battle_turn = 0
$game_temp.battle_event_flags.clear
$game_temp.battle_abort = false
$game_temp.battle_main_phase = false
$game_temp.battleback_name = $game_map.battleback_name
$game_temp.forcing_battler = nil
$game_system.battle_interpreter.setup(nil, 0)
@troop_id = $game_temp.battle_troop_id
$game_troop.setup(@troop_id)
s1 = $data_system.words.attack
s2 = $data_system.words.skill
s3 = $data_system.words.guard
s4 = $data_system.words.item
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
@actor_command_window.y = 160
@actor_command_window.back_opacity = 0
@actor_command_window.active = false
@actor_command_window.visible = false
# 建立背景图片精灵
@actor_command_window_bg = Sprite.new
@actor_command_window_bg.y = 162
@actor_command_window_bg.z = @actor_command_window.z - 1
@actor_command_window_bg.visible = false
@party_command_window = Window_PartyCommand.new
@help_window = Window_Help.new
@help_window.back_opacity = 160
@help_window.visible = false
@status_window = Window_BattleStatus.new
@message_window = Window_Message.new
# 生成活动块
@spriteset = Spriteset_Battle.new
# 初始化等待计数
@wait_count = 0
# 执行过渡
if $data_system.battle_transition == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$data_system.battle_transition)
end
# 开始自由战斗回合
start_phase1
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果画面切换的话就中断循环
if $scene != self
break
end
end
# 刷新地图
$game_map.refresh
# 准备过渡
Graphics.freeze
# 释放窗口
@actor_command_window.dispose
@actor_command_window_bg.dispose
@party_command_window.dispose
@help_window.dispose
@status_window.dispose
@message_window.dispose
if @skill_window != nil
@skill_window.dispose
end
if @item_window != nil
@item_window.dispose
end
if @result_window != nil
@result_window.dispose
end
# 释放活动块
@spriteset.dispose
# 标题画面切换中的情况
if $scene.is_a?(Scene_Title)
# 淡入淡出画面
Graphics.transition
Graphics.freeze
end
# 战斗测试或者游戏结束以外的画面切换中的情况
if $BTEST and not $scene.is_a?(Scene_Gameover)
$scene = nil
end
end
def phase3_setup_command_window
phase3_setup_command_window_old
@actor_command_window_bg.x = @actor_index * 160 + 2
# 通过战斗中的角色索引判断该显示哪张图片
case @actor_index
when 0
@actor_command_window_bg.bitmap = RPG::Cache.picture("Blue hills.jpg")
when 1
@actor_command_window_bg.bitmap = RPG::Cache.picture("Sunset.jpg")
when 2
@actor_command_window_bg.bitmap = RPG::Cache.picture("Water lilies.jpg")
when 3
@actor_command_window_bg.bitmap = RPG::Cache.picture("Winter.jpg")
end
@actor_command_window_bg.visible = true
end
def start_phase2
@actor_command_window_bg.visible = false
start_phase2_old
end
def start_enemy_select
start_enemy_select_old
@actor_command_window_bg.visible = false
end
def start_actor_select
start_actor_select_old
@actor_command_window_bg.visible = false
end
def start_skill_select
start_skill_select_old
@actor_command_window_bg.visible = false
end
def start_item_select
start_item_select_old
@actor_command_window_bg.visible = false
end
def end_enemy_select
@enemy_arrow.dispose
@enemy_arrow = nil
if @actor_command_window.index == 0
@actor_command_window.active = true
@actor_command_window.visible = true
@actor_command_window_bg.visible = true
@help_window.visible = false
end
end
def end_skill_select
end_skill_select_old
@actor_command_window_bg.visible = true
end
def end_item_select
end_item_select_old
@actor_command_window_bg.visible = true
end
def start_phase4
@actor_command_window_bg.visible = false
start_phase4_old
end
end
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4, "逃跑"])
@actor_command_window.y = 128
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |