Project1
标题:
求人把“动作重复”脚本里的“战斗/逃跑”选项去掉
[打印本页]
作者:
angelwangm
时间:
2009-2-3 03:35
标题:
求人把“动作重复”脚本里的“战斗/逃跑”选项去掉
我照着主站上的教程去老是出错,求人帮忙去一下
#==============================================================================
# 本脚本来自www.66rpg.com,转载和使用请保留此信息
#重复上回合动作 v1.1
#by 叶子 Date: 12-12-2005
#QQ:121058265
#本脚本根据66rpg的站长柳柳提出的思路制作
#如发现有bug请与作者联系或上66rpg发贴说明
#==============================================================================
#当战斗时按下T键,
#当前角色就会重复上回合的动作(包括攻击,特技,防御,物品)。
#当战斗时按下R键,
#所有角色就会重复上回合的动作。
#当战斗时按下F键,
#所有角色就会普通攻击同一个敌人。
#脚本占用了第一号开关。
#当第一号开关打开时,重复上回合动作功能关闭。
#如果想用其他开关,改第130,263,323行中相应内容。
#--------------------------------------------------------------------------
class Game_Battler
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
@battler_name = ""
@battler_hue = 0
@hp = 0
@sp = 0
@states = []
@states_turn = {}
@maxhp_plus = 0
@maxsp_plus = 0
@str_plus = 0
@dex_plus = 0
@agi_plus = 0
@int_plus = 0
@hidden = false
@immortal = false
@damage_pop = false
@damage = nil
@critical = false
@animation_id = 0
@animation_hit = false
@white_flash = false
@blink = false
@current_action = Game_BattleAction.new
@last_action = Game_BattleAction.new
end
#--------------------------------------------------------------------------
# ● 获取前一回合的动作
#--------------------------------------------------------------------------
def last_action
return @last_action
end
end
class Game_Party
def last_actions
for actor in @actors
actor.last_action.kind = actor.current_action.kind
actor.last_action.basic = actor.current_action.basic
actor.last_action.forcing = actor.current_action.forcing
actor.last_action.target_index = actor.current_action.target_index
actor.last_action.skill_id = actor.current_action.skill_id
actor.last_action.item_id = actor.current_action.item_id
end
end
end
class Scene_Battle
#--------------------------------------------------------------------------
# ● 开始同伴命令回合
#--------------------------------------------------------------------------
def start_phase2
# 转移到回合 2
@phase = 2
# 设置角色为非选择状态
@actor_index = -1
@active_battler = nil
# 有效化同伴指令窗口
@party_command_window.active = true
@party_command_window.visible = true
# 无效化角色指令窗口
@actor_command_window.active = false
@actor_command_window.visible = false
# 清除主回合标志
$game_temp.battle_main_phase = false
# 记录行动
$game_party.last_actions
# 清除全体同伴的行动
$game_party.clear_actions
# 不能输入命令的情况下
unless $game_party.inputable?
# 开始主回合
start_phase4
end
end
#--------------------------------------------------------------------------
# ● 刷新画面 (同伴命令回合)
#--------------------------------------------------------------------------
def update_phase2
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 同伴指令窗口光标位置分支
case @party_command_window.index
when 0 # 战斗
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 开始角色的命令回合
start_phase3
when 1 # 逃跑
# 不能逃跑的情况下
if $game_temp.battle_can_escape == false
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 逃走处理
update_phase2_escape
end
return
end
#------------------------------
# 按下 R 键的情况下
#------------------------------
if Kboard.keyboard($R_Key_R)
#如果一号开关打开就禁止重复上回合动作
if $game_switches[51] == true #开关号可以改,把那个1改成你要的开关号
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
for a in $game_party.actors
if a.inputable?
case a.last_action.kind
when 0 # 攻击,防御
#防御
if a.last_action.basic == 1
# 设置行动
a.current_action.kind = 0
a.current_action.basic = 1
#攻击
else
# 设置行动
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = a.last_action.target_index
end
when 1 # 特技
skill_id = a.last_action.skill_id
if a.skill_learn?(skill_id) and a.skill_can_use?(skill_id)
# 设置行动
a.current_action.kind = 1
a.current_action.skill_id = a.last_action.skill_id
a.current_action.target_index = a.last_action.target_index
else
# 不能使用就攻击
if $data_skills[skill_id].scope < 3
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = a.last_action.target_index
else
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = 0
end
end
when 2 # 物品
item_id = a.last_action.item_id
if $game_party.item_can_use?(item_id)
# 设置行动
a.current_action.kind = 2
a.current_action.item_id = a.last_action.item_id
a.current_action.target_index = a.last_action.target_index
else
# 不能使用就攻击
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = 0
end
end
end
end
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
start_phase4
return
end
#------------------------------
# 按下 F 键的情况下
#------------------------------
if Kboard.keyboard($R_Key_T)
for a in $game_party.actors
if a.inputable?
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = 0
end
end
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
start_phase4
return
end
end
#--------------------------------------------------------------------------
# ● 刷新画面 (角色命令回合 : 基本命令)
#--------------------------------------------------------------------------
def update_phase3_basic_command
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 转向前一个角色的指令输入
phase3_prior_actor
return
end
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 角色指令窗口光标位置分之
case @actor_command_window.index
when 0 # 攻击
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
# 开始选择敌人
start_enemy_select
when 1 # 特技
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 1
# 开始选择特技
start_skill_select
when 2 # 防御
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 1
# 转向下一位角色的指令输入
phase3_next_actor
when 3 # 物品
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 2
# 开始选择物品
start_item_select
end
return
end
#------------------------------
# 按下 T 建的情况下
#------------------------------
if Kboard.keyboard($R_Key_T)
#如果一号开关打开就禁止重复上回合动作
if $game_switches[51] == true #开关号可以改,把那个1改成你要的开关号
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
case @active_battler.last_action.kind
when 0 # 攻击,防御
#防御
if @active_battler.last_action.basic == 1
# 设置行动
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 1
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
phase3_next_actor
#攻击
else
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
@active_battler.current_action.target_index = @active_battler.last_action.target_index
phase3_next_actor
end
when 1 # 特技
skill_id = @active_battler.last_action.skill_id
if @active_battler.skill_learn?(skill_id) and @active_battler.skill_can_use?(skill_id)
# 设置行动
@active_battler.current_action.kind = 1
@active_battler.current_action.skill_id = @active_battler.last_action.skill_id
@active_battler.current_action.target_index = @active_battler.last_action.target_index
phase3_next_actor
else
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
end
when 2 # 物品
item_id = @active_battler.last_action.item_id
if $game_party.item_can_use?(item_id)
# 设置行动
@active_battler.current_action.kind = 2
@active_battler.current_action.item_id = @active_battler.last_action.item_id
@active_battler.current_action.target_index = @active_battler.last_action.target_index
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
phase3_next_actor
else
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
end
end
return
end
#------------------------------
# 按下 R 键的情况下
#------------------------------
if Kboard.keyboard($R_Key_R)
#如果一号开关打开就禁止重复上回合动作
if $game_switches[51] == true #开关号可以改,把那个1改成你要的开关号
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
for a in $game_party.actors
if a.inputable?
case a.last_action.kind
when 0 # 攻击,防御
#防御
if a.last_action.basic == 1
# 设置行动
a.current_action.kind = 0
a.current_action.basic = 1
#攻击
else
# 设置行动
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = a.last_action.target_index
end
when 1 # 特技
skill_id = a.last_action.skill_id
if a.skill_learn?(skill_id) and a.skill_can_use?(skill_id)
# 设置行动
a.current_action.kind = 1
a.current_action.skill_id = a.last_action.skill_id
a.current_action.target_index = a.last_action.target_index
elsif
# 不能使用就攻击
if $data_skills[skill_id].scope < 3
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = a.last_action.target_index
else
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = 0
end
end
when 2 # 物品
item_id = a.last_action.item_id
if $game_party.item_can_use?(item_id)
# 设置行动
a.current_action.kind = 2
a.current_action.item_id = a.last_action.item_id
a.current_action.target_index = a.last_action.target_index
else
# 不能使用就攻击
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = 0
end
end
end
# 角色的明灭效果 OFF
if a != nil
a.blink = false
end
end
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
start_phase4
return
end
#------------------------------
# 按下 F 键的情况下
#------------------------------
if Kboard.keyboard($R_Key_F)
for a in $game_party.actors
if a.inputable?
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = 0
end
# 角色的明灭效果 OFF
if a != nil
a.blink = false
end
end
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
start_phase4
return
end
end
end
#==============================================================================
# 本脚本来自www.66rpg.com,转载和使用请保留此信息
#==============================================================================
复制代码
[LINE]1,#dddddd[/LINE]
版务信息:本贴由楼主自主结贴~
作者:
紫林心情
时间:
2009-2-3 04:35
提示:
作者被禁止或删除 内容自动屏蔽
作者:
angelwangm
时间:
2009-2-3 05:03
好像不行啊{/pz}
作者:
angelwangm
时间:
2009-2-3 19:11
顶上去
作者:
hgfor
时间:
2009-2-5 20:03
#==============================================================================
# 本脚本来自www.66rpg.com,转载和使用请保留此信息
#重复上回合动作 v1.1
#by 叶子 Date: 12-12-2005
#QQ:121058265
#本脚本根据66rpg的站长柳柳提出的思路制作
#如发现有bug请与作者联系或上66rpg发贴说明
#==============================================================================
#当战斗时按下T键,
#当前角色就会重复上回合的动作(包括攻击,特技,防御,物品)。
#当战斗时按下R键,
#所有角色就会重复上回合的动作。
#当战斗时按下F键,
#所有角色就会普通攻击同一个敌人。
#脚本占用了第一号开关。
#当第一号开关打开时,重复上回合动作功能关闭。
#如果想用其他开关,改第130,263,323行中相应内容。
#--------------------------------------------------------------------------
class Game_Battler
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
@battler_name = ""
@battler_hue = 0
@hp = 0
@sp = 0
@states = []
@states_turn = {}
@maxhp_plus = 0
@maxsp_plus = 0
@str_plus = 0
@dex_plus = 0
@agi_plus = 0
@int_plus = 0
@hidden = false
@immortal = false
@damage_pop = false
@damage = nil
@critical = false
@animation_id = 0
@animation_hit = false
@white_flash = false
@blink = false
@current_action = Game_BattleAction.new
@last_action = Game_BattleAction.new
end
#--------------------------------------------------------------------------
# ● 获取前一回合的动作
#--------------------------------------------------------------------------
def last_action
return @last_action
end
end
class Game_Party
def last_actions
for actor in @actors
actor.last_action.kind = actor.current_action.kind
actor.last_action.basic = actor.current_action.basic
actor.last_action.forcing = actor.current_action.forcing
actor.last_action.target_index = actor.current_action.target_index
actor.last_action.skill_id = actor.current_action.skill_id
actor.last_action.item_id = actor.current_action.item_id
end
end
end
class Scene_Battle
#--------------------------------------------------------------------------
# ● 开始同伴命令回合
#--------------------------------------------------------------------------
def start_phase2
# 转移到回合 2
@phase = 2
# 设置角色为非选择状态
@actor_index = -1
@active_battler = nil
# 有效化同伴指令窗口
# @party_command_window.active = true
# @party_command_window.visible = true
# 无效化角色指令窗口
@actor_command_window.active = false
@actor_command_window.visible = false
# 清除主回合标志
$game_temp.battle_main_phase = false
# 记录行动
$game_party.last_actions
# 清除全体同伴的行动
$game_party.clear_actions
# 不能输入命令的情况下
unless $game_party.inputable?
# 开始主回合
start_phase4
end
end
#--------------------------------------------------------------------------
# ● 刷新画面 (同伴命令回合)
#--------------------------------------------------------------------------
def update_phase2
#------------------------------
# 按下 R 键的情况下
#------------------------------
if Kboard.keyboard($R_Key_R)
#如果一号开关打开就禁止重复上回合动作
if $game_switches[51] == true #开关号可以改,把那个1改成你要的开关号
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
for a in $game_party.actors
if a.inputable?
case a.last_action.kind
when 0 # 攻击,防御
#防御
if a.last_action.basic == 1
# 设置行动
a.current_action.kind = 0
a.current_action.basic = 1
#攻击
else
# 设置行动
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = a.last_action.target_index
end
when 1 # 特技
skill_id = a.last_action.skill_id
if a.skill_learn?(skill_id) and a.skill_can_use?(skill_id)
# 设置行动
a.current_action.kind = 1
a.current_action.skill_id = a.last_action.skill_id
a.current_action.target_index = a.last_action.target_index
else
# 不能使用就攻击
if $data_skills[skill_id].scope < 3
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = a.last_action.target_index
else
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = 0
end
end
when 2 # 物品
item_id = a.last_action.item_id
if $game_party.item_can_use?(item_id)
# 设置行动
a.current_action.kind = 2
a.current_action.item_id = a.last_action.item_id
a.current_action.target_index = a.last_action.target_index
else
# 不能使用就攻击
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = 0
end
end
end
end
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
start_phase4
return
end
#------------------------------
# 按下 F 键的情况下
#------------------------------
if Kboard.keyboard($R_Key_T)
for a in $game_party.actors
if a.inputable?
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = 0
end
end
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
start_phase4
return
end
end
#--------------------------------------------------------------------------
# ● 刷新画面 (角色命令回合 : 基本命令)
#--------------------------------------------------------------------------
def update_phase3_basic_command
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 转向前一个角色的指令输入
phase3_prior_actor
return
end
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 角色指令窗口光标位置分之
case @actor_command_window.index
when 0 # 攻击
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
# 开始选择敌人
start_enemy_select
when 1 # 特技
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 1
# 开始选择特技
start_skill_select
when 2 # 防御
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 1
# 转向下一位角色的指令输入
phase3_next_actor
when 3 # 物品
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 2
# 开始选择物品
start_item_select
end
return
end
#------------------------------
# 按下 T 建的情况下
#------------------------------
if Kboard.keyboard($R_Key_T)
#如果一号开关打开就禁止重复上回合动作
if $game_switches[51] == true #开关号可以改,把那个1改成你要的开关号
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
case @active_battler.last_action.kind
when 0 # 攻击,防御
#防御
if @active_battler.last_action.basic == 1
# 设置行动
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 1
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
phase3_next_actor
#攻击
else
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
@active_battler.current_action.target_index = @active_battler.last_action.target_index
phase3_next_actor
end
when 1 # 特技
skill_id = @active_battler.last_action.skill_id
if @active_battler.skill_learn?(skill_id) and @active_battler.skill_can_use?(skill_id)
# 设置行动
@active_battler.current_action.kind = 1
@active_battler.current_action.skill_id = @active_battler.last_action.skill_id
@active_battler.current_action.target_index = @active_battler.last_action.target_index
phase3_next_actor
else
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
end
when 2 # 物品
item_id = @active_battler.last_action.item_id
if $game_party.item_can_use?(item_id)
# 设置行动
@active_battler.current_action.kind = 2
@active_battler.current_action.item_id = @active_battler.last_action.item_id
@active_battler.current_action.target_index = @active_battler.last_action.target_index
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
phase3_next_actor
else
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
end
end
return
end
#------------------------------
# 按下 R 键的情况下
#------------------------------
if Kboard.keyboard($R_Key_R)
#如果一号开关打开就禁止重复上回合动作
if $game_switches[51] == true #开关号可以改,把那个1改成你要的开关号
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
for a in $game_party.actors
if a.inputable?
case a.last_action.kind
when 0 # 攻击,防御
#防御
if a.last_action.basic == 1
# 设置行动
a.current_action.kind = 0
a.current_action.basic = 1
#攻击
else
# 设置行动
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = a.last_action.target_index
end
when 1 # 特技
skill_id = a.last_action.skill_id
if a.skill_learn?(skill_id) and a.skill_can_use?(skill_id)
# 设置行动
a.current_action.kind = 1
a.current_action.skill_id = a.last_action.skill_id
a.current_action.target_index = a.last_action.target_index
elsif
# 不能使用就攻击
if $data_skills[skill_id].scope < 3
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = a.last_action.target_index
else
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = 0
end
end
when 2 # 物品
item_id = a.last_action.item_id
if $game_party.item_can_use?(item_id)
# 设置行动
a.current_action.kind = 2
a.current_action.item_id = a.last_action.item_id
a.current_action.target_index = a.last_action.target_index
else
# 不能使用就攻击
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = 0
end
end
end
# 角色的明灭效果 OFF
if a != nil
a.blink = false
end
end
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
start_phase4
return
end
#------------------------------
# 按下 F 键的情况下
#------------------------------
if Kboard.keyboard($R_Key_F)
for a in $game_party.actors
if a.inputable?
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = 0
end
# 角色的明灭效果 OFF
if a != nil
a.blink = false
end
end
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
start_phase4
return
end
end
end
#==============================================================================
# 本脚本来自www.66rpg.com,转载和使用请保留此信息
#==============================================================================
复制代码
作者:
angelwangm
时间:
2009-2-5 22:16
楼上谢谢你的回答,本以为没人解答了我都快放弃了。
那个战斗/逃跑选项确实去掉了,但是战斗菜单也去掉了,不知能否再修改一下{/fd}
当然,如果要是没有人再修改的话,今天晚上我就结贴认可你的答案!
作者:
IamI
时间:
2009-2-5 22:53
#==============================================================================
# 本脚本来自www.66rpg.com,转载和使用请保留此信息
#重复上回合动作 v1.1
#by 叶子 Date: 12-12-2005
#QQ:121058265
#本脚本根据66rpg的站长柳柳提出的思路制作
#如发现有bug请与作者联系或上66rpg发贴说明
#==============================================================================
#当战斗时按下T键,
#当前角色就会重复上回合的动作(包括攻击,特技,防御,物品)。
#当战斗时按下R键,
#所有角色就会重复上回合的动作。
#当战斗时按下F键,
#所有角色就会普通攻击同一个敌人。
#脚本占用了第一号开关。
#当第一号开关打开时,重复上回合动作功能关闭。
#如果想用其他开关,改第130,263,323行中相应内容。
#--------------------------------------------------------------------------
class Game_Battler
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
@battler_name = ""
@battler_hue = 0
@hp = 0
@sp = 0
@states = []
@states_turn = {}
@maxhp_plus = 0
@maxsp_plus = 0
@str_plus = 0
@dex_plus = 0
@agi_plus = 0
@int_plus = 0
@hidden = false
@immortal = false
@damage_pop = false
@damage = nil
@critical = false
@animation_id = 0
@animation_hit = false
@white_flash = false
@blink = false
@current_action = Game_BattleAction.new
@last_action = Game_BattleAction.new
end
#--------------------------------------------------------------------------
# ● 获取前一回合的动作
#--------------------------------------------------------------------------
def last_action
return @last_action
end
end
class Game_Party
def last_actions
for actor in @actors
actor.last_action.kind = actor.current_action.kind
actor.last_action.basic = actor.current_action.basic
actor.last_action.forcing = actor.current_action.forcing
actor.last_action.target_index = actor.current_action.target_index
actor.last_action.skill_id = actor.current_action.skill_id
actor.last_action.item_id = actor.current_action.item_id
end
end
end
class Scene_Battle
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
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.draw_item(4, $game_temp.battle_can_escape ? @actor_command_window.normal_color : @actor_command_window.disabled_color)
@actor_command_window.y = 128
@actor_command_window.back_opacity = 160
@actor_command_window.active = false
@actor_command_window.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
@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 start_phase2
# 转移到回合 2
@phase = 2
# 设置角色为非选择状态
@actor_index = -1
@active_battler = nil
# 有效化同伴指令窗口
# @party_command_window.active = true
# @party_command_window.visible = true
# 无效化角色指令窗口
@actor_command_window.active = false
@actor_command_window.visible = false
# 清除主回合标志
$game_temp.battle_main_phase = false
# 记录行动
$game_party.last_actions
# 清除全体同伴的行动
$game_party.clear_actions
# 不能输入命令的情况下
unless $game_party.inputable?
# 开始主回合
start_phase4
end
end
#--------------------------------------------------------------------------
# ● 刷新画面 (同伴命令回合)
#--------------------------------------------------------------------------
#该更新已删除,因为跳过了Phase2,所以也就没有存在的意义。
def update_phase2
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 开始角色的命令回合
start_phase3
end
#--------------------------------------------------------------------------
# ● 刷新画面 (角色命令回合 : 基本命令)
#--------------------------------------------------------------------------
def update_phase3_basic_command
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 转向前一个角色的指令输入
phase3_prior_actor
return
end
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 角色指令窗口光标位置分之
case @actor_command_window.index
when 0 # 攻击
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
# 开始选择敌人
start_enemy_select
when 1 # 特技
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 1
# 开始选择特技
start_skill_select
when 2 # 防御
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 1
# 转向下一位角色的指令输入
phase3_next_actor
when 3 # 物品
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 2
# 开始选择物品
start_item_select
when 4 #逃跑
# 不能逃跑的情况下
if $game_temp.battle_can_escape == false
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 逃走处理
update_phase2_escape
end
return
end
#------------------------------
# 按下 T 建的情况下
#------------------------------
if Kboard.keyboard($R_Key_T)
#如果一号开关打开就禁止重复上回合动作
if $game_switches[51] == true #开关号可以改,把那个1改成你要的开关号
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
case @active_battler.last_action.kind
when 0 # 攻击,防御
#防御
if @active_battler.last_action.basic == 1
# 设置行动
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 1
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
phase3_next_actor
#攻击
else
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 设置行动
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
@active_battler.current_action.target_index = @active_battler.last_action.target_index
phase3_next_actor
end
when 1 # 特技
skill_id = @active_battler.last_action.skill_id
if @active_battler.skill_learn?(skill_id) and @active_battler.skill_can_use?(skill_id)
# 设置行动
@active_battler.current_action.kind = 1
@active_battler.current_action.skill_id = @active_battler.last_action.skill_id
@active_battler.current_action.target_index = @active_battler.last_action.target_index
phase3_next_actor
else
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
end
when 2 # 物品
item_id = @active_battler.last_action.item_id
if $game_party.item_can_use?(item_id)
# 设置行动
@active_battler.current_action.kind = 2
@active_battler.current_action.item_id = @active_battler.last_action.item_id
@active_battler.current_action.target_index = @active_battler.last_action.target_index
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
phase3_next_actor
else
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
end
end
return
end
#------------------------------
# 按下 R 键的情况下
#------------------------------
if Kboard.keyboard($R_Key_R)
#如果一号开关打开就禁止重复上回合动作
if $game_switches[51] == true #开关号可以改,把那个1改成你要的开关号
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
for a in $game_party.actors
if a.inputable?
case a.last_action.kind
when 0 # 攻击,防御
#防御
if a.last_action.basic == 1
# 设置行动
a.current_action.kind = 0
a.current_action.basic = 1
#攻击
else
# 设置行动
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = a.last_action.target_index
end
when 1 # 特技
skill_id = a.last_action.skill_id
if a.skill_learn?(skill_id) and a.skill_can_use?(skill_id)
# 设置行动
a.current_action.kind = 1
a.current_action.skill_id = a.last_action.skill_id
a.current_action.target_index = a.last_action.target_index
elsif
# 不能使用就攻击
if $data_skills[skill_id].scope < 3
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = a.last_action.target_index
else
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = 0
end
end
when 2 # 物品
item_id = a.last_action.item_id
if $game_party.item_can_use?(item_id)
# 设置行动
a.current_action.kind = 2
a.current_action.item_id = a.last_action.item_id
a.current_action.target_index = a.last_action.target_index
else
# 不能使用就攻击
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = 0
end
end
end
# 角色的明灭效果 OFF
if a != nil
a.blink = false
end
end
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
start_phase4
return
end
#------------------------------
# 按下 F 键的情况下
#------------------------------
if Kboard.keyboard($R_Key_F)
for a in $game_party.actors
if a.inputable?
a.current_action.kind = 0
a.current_action.basic = 0
a.current_action.target_index = 0
end
# 角色的明灭效果 OFF
if a != nil
a.blink = false
end
end
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
start_phase4
return
end
end
end
#==============================================================================
# 本脚本来自www.66rpg.com,转载和使用请保留此信息
#==============================================================================
复制代码
完成了= =跳过了Phase2也就不需要Phase2判定了吧。 [LINE]1,#dddddd[/LINE]
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者:
angelwangm
时间:
2009-2-5 22:55
非常感谢
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1