class Scene_Map
#--------------------------------------------------------------------------
# ● 调用战斗
#--------------------------------------------------------------------------
alias call_new call_battle
def call_battle
call_new
$status_window_contents = 0
end
end
#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
# 处理战斗画面的类。
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ● 设置角色指令窗口
#--------------------------------------------------------------------------
alias:phase3_setup_command_window_2:phase3_setup_command_window
def phase3_setup_command_window
phase3_setup_command_window_2
# 设置角色指令窗口的位置
@actor_command_window.x = 0
end
#--------------------------------------------------------------------------
# ● 开始同伴命令回合
#--------------------------------------------------------------------------
alias start_phase2_2 start_phase2
def start_phase2
$status_window_contents = 0
@status_window.refresh
start_phase2_2
end
#--------------------------------------------------------------------------
# ● 转到输入下一个角色的命令
#--------------------------------------------------------------------------
def phase3_next_actor
if @actor_index > -1 and @actor_index < $game_party.actors.size - 1
$status_window_contents = @actor_index + 1
@status_window.refresh
end
# 循环
begin
# 角色的明灭效果 OFF
if @active_battler != nil
@active_battler.blink = false
end
# 最后的角色的情况
if @actor_index == $game_party.actors.size - 1
# 开始主回合
start_phase4
return
end
# 推进角色索引
@actor_index += 1
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
# 如果角色是在无法接受指令的状态就再试
end until @active_battler.inputable?
# 设置角色的命令窗口
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# ● 转向前一个角色的命令输入
#--------------------------------------------------------------------------
def phase3_prior_actor
if @actor_index > 0
$status_window_contents = @actor_index - 1
@status_window.refresh
end
# 循环
begin
# 角色的明灭效果 OFF
if @active_battler != nil
@active_battler.blink = false
end
# 最初的角色的情况下
if @actor_index == 0
# 开始同伴指令回合
start_phase2
return
end
# 返回角色索引
@actor_index -= 1
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
# 如果角色是在无法接受指令的状态就再试
end until @active_battler.inputable?
# 设置角色的命令窗口
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# ● 刷新画面 (主回合步骤 1 : 准备行动)
#--------------------------------------------------------------------------
def update_phase4_step1
# 隐藏帮助窗口
@help_window.visible = false
# 判定胜败
if judge
# 胜利或者失败的情况下 : 过程结束
return
end
# 强制行动的战斗者不存在的情况下
if $game_temp.forcing_battler == nil
# 设置战斗事件
setup_battle_event
# 执行战斗事件中的情况下
if $game_system.battle_interpreter.running?
return
end
end
# 强制行动的战斗者存在的情况下
if $game_temp.forcing_battler != nil
# 在头部添加后移动
@action_battlers.delete($game_temp.forcing_battler)
@action_battlers.unshift($game_temp.forcing_battler)
end
# 未行动的战斗者不存在的情况下 (全员已经行动)
if @action_battlers.size == 0
# 开始同伴命令回合
start_phase2
return
end
# 初始化动画 ID 和公共事件 ID
@animation1_id = 0
@animation2_id = 0
@common_event_id = 0
# 未行动的战斗者移动到序列的头部
@active_battler = @action_battlers.shift
# 如果已经在战斗之外的情况下
if @active_battler.index == nil
return
end
# 连续伤害
if @active_battler.hp > 0 and @active_battler.slip_damage?
@active_battler.slip_damage_effect
@active_battler.damage_pop = true
end
# 自然解除状态
@active_battler.remove_states_auto
if @active_battler.is_a?(Game_Actor)
$status_window_contents = @active_battler.index
end
# 刷新状态窗口
@status_window.refresh
# 移至步骤 2
@phase4_step = 2
end
end
正常从头测试时没有问题,但如果用战斗测试的话就显示脚本错误
155行TypeError
no implicit conversion fron nil to imteger作者: 小小毓 时间: 2007-7-29 17:13
我还使用了物品获得后自动显示的脚本