module BattleCommand_Custom
ACTOR_COMMAND_LIST = [:attack, :skill, :rout, :guard, :item, :escape]
end
module Text
ZHU_ID=[]
SKILL_ID=[]
#副武器ID#
FU_ROUT_ID=[5,44,47]
#副武器无法ID#
WU_FU_ROUT_RATES=[92,70,71]
#主武器ID#
ZHU_ROUT_ID=[158,166,167,168]
#主武器状态ID(比如你通过技能获得状态判断其状态和武器ID更改技能)#
ZHU_ROUT_RATES=[106,116,117,118]
#主武器状态无法ID#
WU_ZHU_ROUT_RATES=[107,108,109,110]
#其他主武器ID(比如单个武器的ID)#
ZHU_DAN_ROUT_ID=[169,187]
#其他主武器无法状态ID#
WU_ZHU_DAN_RATES=[111,124]
#副武器数据库ID#
SKILL_I=[1,2,3]
SKILL_ID[1]=["霰弹击溃",69]
SKILL_ID[2]=["枪火击溃",70]
SKILL_ID[3]=["枪火击溃",71]
#主武器数据库ID#
ZHU_II=[1,2,3,4]
ZHU_ID[1]=["炮火击溃",126]
ZHU_ID[2]=["炮火击溃",127]
ZHU_ID[3]=["炮火击溃",128]
ZHU_ID[4]=["炮火击溃",129]
ZHU_ID[5]=["炮火击溃",130]
ZHU_ID[6]=["法术轰击",169]
#空手的ID#
ROUT_ID=["弱点击溃",27]
WU_ROUT_RATES=[86]
end
#获得技能ID#
class Game_Actor < Game_Battler
@weapon_num=0
@fu_weapon_num=0
@qi_weapon_num=0
Text::ZHU_ROUT_ID.each {|w| @weapon_num+=1}
Text::FU_ROUT_ID.each {|w| @fu_weapon_num+=1}
Text::ZHU_DAN_ROUT_ID.each {|w| @qi_weapon_num+=1}
@weapon_num=Array.new(@weapon_num){|w|w.to_i+1}
@fu_weapon_num=Array.new(@weapon_num){|w|w.to_i+1}
@qi_weapon_num=Array.new(@weapon_num){|w|w.to_i+1}
def weapon_id?(item_id)
@equips[0].include?($data_weapons[item_id])
unless @equips[0].include?($data_weapons[item_id])==true
@equips[1].include?($data_armors[item_id])
end
end
end
class NilClass
def method_missing(m, *args, &block)
self
end
end
class Game_Action
def rout?
item == $data_skills[subject.rout_skill_id]
end
def set_rout
set_skill(subject.rout_skill_id)
self
end
end
class Game_BattlerBase
def get_rout_skill
@rout_skill_id=0
@weapon_num.each do |w|
if $game_party.battle_members[0].weapon_id?(Text::ZHU_ROUT_ID[w])==true && $game_actors[$game_variables[14]].state?(Text::ZHU_ROUT_RATES[w-1])== true
@rout_skill_id=Text::ZHU_ROUT_ID[w] if $game_party.battle_members[0].weapon_id?(Text::ZHU_ROUT_ID[w])==true && $game_actors[$game_variables[14]].state?(Text::ZHU_ROUT_RATES[w-1])== true
end
@fu_weapon_num.each do |w|
if $game_party.battle_members[1].weapon_id?(Text::FU_ROUT_ID[w])==true
@rout_skill_id=Text::FU_ROUT_ID[w] if $game_party.battle_members[1].weapon_id?(Text::FU_ROUT_ID[w])==true
end
@qi_weapon_num.each do |w|
if $game_party.battle_members[0].weapon_id?(Text::ZHU_DAN_ROUT_ID[w])==true
@rout_skill_id=Text::ZHU_DAN_ROUT_ID[w] if $game_party.battle_members[0].weapon_id?(Text::ZHU_DAN_ROUT_ID[w])==true
end
end
def rout_skill_id
get_rout_skill
return @rout_skill_id if @rout_skill_id >=0
unless @rout_skill_id !=0
return Text::ROUT_ID[1]
end
end
#判定技能使用
def rout_usable?
usable?($data_skills[rout_skill_id])
end
end
class Window_ActorCommand < Window_Command
def make_command_list_by_symbol(symbol)
case symbol
when :attack ; add_attack_command
when :skill ; add_skill_commands
when :rout ;add_rout_command
when :guard ; add_guard_command
when :item ; add_item_command
when :escape ; add_escape_command
when :CW_party ; add_CW_party_command
when :DA_party ; add_DA_party_command
end
end
def add_rout_command
add_command(Vocab::rout, :rout, @actor.rout_usable?)
end
end
class Scene_Battle < Scene_Base
def command_rout
BattleManager.actor.input.set_rout
select_enemy_selection
end
end
#以上为谈话技能选项的前台,不能显示谈判选项
class Game_Temp
attr_accessor :battle_rout
alias initialize_battle_rout initialize
def initialize
initialize_battle_rout
end
end
class Window_ActorCommand < Window_Command
def add_rout_command
Text::SKILL_I.each do |w|
return add_command([Text::SKILL_ID[w][0], nil], :rout, true) if $game_party.battle_members[0].equips[1].id == Text::SKILL_ID[w][1]
end
Text::ZHU_II.each do |w|
return add_command([Text::SKILL_ID[w][0], nil], :rout, true) if $game_party.battle_members[0].equips[1].id == Text::ZHU_ID[w][1]
end
return add_command([Text::ZHU_ID[5][0], nil], :rout, true) if $game_party.battle_members[0].equips[0].id == Text::ZHU_ID[5][1]
####
return add_command([Text::ZHU_ID[6][0], nil], :rout, true) if $game_party.battle_members[0].equips[0].id == Text::ZHU_ID[6][1]
####
return add_command(Text::ROUT_ID, :rout, true)
end
def set_up(a)
@actor=a
clear_command_list
make_command_list
refresh
select(0)
activate
open
end
end
class Game_Battler < Game_BattlerBase
def attack_apply(attacker)
item_apply(attacker, $data_skills[attacker.rout_skill_id])
end
end
class Scene_Battle < Scene_Base
alias create_all_windows_rout create_all_windows
def create_all_windows
create_all_windows_rout
end
alias create_actor_command_window_rout create_actor_command_window
def create_actor_command_window
create_actor_command_window_rout
@actor_command_window.set_handler(:rout, method(:command_rout))
end
#--------------------------------------------------------------------------
# ● 确定敌人
#--------------------------------------------------------------------------
def on_enemy_ok
BattleManager.actor.input.target_index = @enemy_window.enemy.index
@enemy_window.hide
@skill_window.hide
@item_window.hide
next_command
end
#--------------------------------------------------------------------------
# ● 敌人“取消”
#--------------------------------------------------------------------------
alias rout_on_enemy_cancel on_enemy_cancel
def on_enemy_cancel
case @actor_command_window.current_symbol
when :rout
@actor_command_window.activate
end
rout_on_enemy_cancel
end
end
#--------------------------------------------------------------------------
# ● 技能无法使用
#--------------------------------------------------------------------------
class Window_Command < Window_Selectable
def command_enabled?(index)
if(@list[index][:name][0] == Text::SKILL_ID[1][0] &&$game_party.battle_members[0].equips[1].id == Text::SKILL_ID[1][1] && $game_actors[$game_variables[14]].state?(Text::WU_FU_ROUT_RATES[0])== true)
@list[index][:enabled] = false
elsif(@list[index][:name][0] == Text::SKILL_ID[2][0] &&$game_party.battle_members[0].equips[1].id == Text::SKILL_ID[2][1] && $game_actors[$game_variables[14]].state?(Text::WU_FU_ROUT_RATES[1])== true)
@list[index][:enabled] = false
elsif(@list[index][:name][0] == Text::SKILL_ID[3][0] &&$game_party.battle_members[0].equips[1].id == Text::SKILL_ID[3][1] && $game_actors[$game_variables[14]].state?(Text::WU_FU_ROUT_RATES[2])== true)
@list[index][:enabled] = false
####
elsif(@list[index][:name][0] == Text::ZHU_ID[1][0] &&$game_party.battle_members[0].equips[0].id == Text::ZHU_ID[1][1] && $game_actors[$game_variables[14]].state?(Text::WU_ZHU_ROUT_RATES[0])== true)
@list[index][:enabled] = false
elsif(@list[index][:name][0] == Text::ZHU_ID[2][0] &&$game_party.battle_members[0].equips[0].id == Text::ZHU_ID[2][1] && $game_actors[$game_variables[14]].state?(Text::WU_ZHU_ROUT_RATES[1])== true)
@list[index][:enabled] = false
elsif(@list[index][:name][0] == Text::ZHU_ID[3][0] &&$game_party.battle_members[0].equips[0].id == Text::ZHU_ID[3][1] && $game_actors[$game_variables[14]].state?(Text::WU_ZHU_ROUT_RATES[2])== true)
@list[index][:enabled] = false
elsif(@list[index][:name][0] == Text::ZHU_ID[4][0] &&$game_party.battle_members[0].equips[0].id == Text::ZHU_ID[4][1] && $game_actors[$game_variables[14]].state?(Text::WU_ZHU_ROUT_RATES[3])== true)
@list[index][:enabled] = false
elsif(@list[index][:name][0] == Text::ZHU_ID[5][0] &&$game_party.battle_members[0].equips[0].id == Text::ZHU_ID[5][1] && $game_actors[$game_variables[14]].state?(Text::ZHU_DAN_ROUT_ID[0])== true)
@list[index][:enabled] = false
####
elsif(@list[index][:name][0] == Text::ZHU_ID[6][0] &&$game_party.battle_members[0].equips[0].id == Text::ZHU_ID[6][1] && $game_actors[$game_variables[14]].state?(Text::ZHU_DAN_ROUT_ID[1])== true)
@list[index][:enabled] = false
####
elsif(@list[index][:name][0] == Text::ROUT_ID[0] && $game_actors[$game_variables[14]].state?(Text::WU_ROUT_RATES[0])== true)
@list[index][:enabled] = false
end
@list[index][:enabled]
end
end