#==============================================================================
# 本脚本来自[url=http://www.66rpg.com]www.66rpg.com[/url],转载和使用请保留此信息
#重复上回合动作 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
@pp = 0
@states = []
@states_turn = {}
@maxhp_plus = 0
@maxsp_plus = 0
@maxpp_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[1] == 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[1] == 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[1] == 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
#==============================================================================
# 本脚本来自[url=http://www.66rpg.com]www.66rpg.com[/url],转载和使用请保留此信息
#==============================================================================