class Game_BattlerBase
def skill_conditions_met?(skill)
usable_item_conditions_met?(skill) &&
skill_wtype_ok?(skill) && skill_cost_payable?(skill) &&
!skill_sealed?(skill.id) && !skill_type_sealed?(skill.stype_id) && skill_zh?(skill.id)
end
def skill_zh?(id)
if $data_skills[id].note.include?("<组合>")
return false unless ($zuhe && $zuhe[id])
if $game_party.battle_members.include?($zuhe[id][0]) && $game_party.battle_members.include?($zuhe[id][1])
return true
else
return false
end
end
return true
end
end
class Window_SkillList < Window_Selectable
def enable?(item)
true
end
end
class Window_BattleSkill < Window_SkillList
def enable?(item)
@actor && @actor.usable?(item)
end
end
class Window_SC < Window_Command
def initialize
super(0, 0)
select(0)
end
def window_width
return 160
end
def visible_line_number
2
end
def make_command_list
add_command("使用", :iuse,iuse_en?)
add_command("组合", :zuhe)
end
def set_item(item)
@item = item
end
def iuse_en?
$game_party.usable?(@item)
end
end
class Window_SCA < Window_MenuStatus
def window_width
100
end
def draw_item(index)
actor = $game_party.all_members[index]
enabled = $game_party.members.include?(actor)
rect = item_rect(index)
draw_item_background(index)
draw_actor_graphic(actor, rect.x+50, rect.y+50)
end
def process_ok
$zuhe[$id] << $game_party.all_members[index]
$game_party.remove_actor($game_party.all_members[index].id)
refresh
if (@cy.size - 2) >= $game_party.all_members.size
hide
end
call_ok_handler
end
def hide
super
return unless @cy
loop do
break if @cy == []
$game_party.add_actor(@cy[0].id)
@cy.delete_at(0)
end
if $zuhe[$id] && $zuhe[$id].size < 2
$zuhe[$id] = []
end
end
def show
super
$zuhe[$id] = []
@cy = $game_party.all_members
refresh
end
def process_cancel
super
hide
end
end
class Scene_Title < Scene_Base
def command_new_game
DataManager.setup_new_game
close_command_window
fadeout_all
$game_map.autoplay
$zuhe = {}
SceneManager.goto(Scene_Map)
end
end
class Scene_Skill
def start
super
create_help_window
create_command_window
create_status_window
create_item_window
c_cw
c_sca
end
def c_cw
@choicew = Window_SC.new
@choicew.set_item(@item_window.index)
@choicew.set_handler(:iuse, method(:command_iuse))
@choicew.set_handler(:zuhe, method(:command_zuhe))
@choicew.set_handler(:cancel, method(:c_c))
@choicew.z = 999
@choicew.hide
end
def c_sca
@sca = Window_SCA.new(@item_window.index%2==0 ? 0 : 400,0)
@sca.set_handler(:ok, method(:scaok))
@sca.set_handler(:cancel, method(:scacancel))
@sca.hide
@sca.z = 999
end
def scaok
@sca.activate
@item_window.activate if @sca.visible == false
@choicew.hide if @sca.visible == false
end
def scacancel
@sca.hide
@choicew.activate
end
def on_item_ok
@choicew.show
@choicew.activate
end
def command_iuse
@actor.last_skill.object = item
determine_item
end
def c_c
@choicew.hide
@item_window.activate
end
def command_zuhe
@actor.last_skill.object = item
$id = item.id
@sca.show
@sca.activate
@sca.select(0)
end
end