king-exit/Scripts/_.27.rb
2024-08-31 14:17:23 -05:00

138 lines
No EOL
3.6 KiB
Ruby
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#==============================================================================
# ■ 第2パーティー作成補助 Ver1.01 by 星潟
#------------------------------------------------------------------------------
# アイテムや装備品等を分けた別PTの作成を容易にします。
#
# 以下、追加されるイベントコマンド(スクリプトで使用)の解説です。
#
# pt_change
#
# 各PT情報を入れ替えます。
#
# pt_combine
#
# 2つのPTを統合します。アクターは現在PTを元に追加されます。
# アイテム所持上限・パーティー人数上限にひっかかった場合は
# 上限値以上のアイテム入手やパーティーメンバー加入は無効化されます。
#
# sec_pt_delete
#
# 第2パーティーの情報アクター配列・所持アイテム全て・所持金を抹消します。
#
#==============================================================================
module DUAL_PT
#各PT別にアクターを分けるか
ACTOR = true
#各PT別にアイテムを分けるか
ITEM = true
#各PT別に武器を分けるか
WEAPON = true
#各PT別に防具を分けるか
ARMOR = true
#各PT別に所持金を分けるか
GOLD = true
end
class Game_Interpreter
def pt_change
$game_party.pt_change
$game_map.need_refresh
$game_player.refresh
end
def pt_combine
$game_party.pt_combine
$game_map.need_refresh
$game_player.refresh
end
def sec_pt_delete
$game_party.sec_pt_delete
end
end
class Game_Party < Game_Unit
def pt_change
if DUAL_PT::ACTOR
@sub_pt_actors = [] if @sub_pt_actors == nil
@actors, @sub_pt_actors = @sub_pt_actors, @actors
end
if DUAL_PT::ITEM
@sub_pt_items = {} if @sub_pt_items == nil
@items, @sub_pt_items = @sub_pt_items, @items
end
if DUAL_PT::WEAPON
@sub_pt_weapons = {} if @sub_pt_weapons == nil
@weapons, @sub_pt_weapons = @sub_pt_weapons, @weapons
end
if DUAL_PT::ARMOR
@sub_pt_armors = {} if @sub_pt_armors == nil
@armors, @sub_pt_armors = @sub_pt_armors, @armors
end
if DUAL_PT::GOLD
@sub_pt_gold = 0 if @sub_pt_gold == nil
@gold, @sub_pt_gold = @sub_pt_gold, @gold
end
end
def pt_combine
if DUAL_PT::ACTOR
ptc_execute(0) if @sub_pt_actors != nil && !@sub_pt_actors.empty?
@sub_pt_actors = []
end
if DUAL_PT::ITEM
ptc_execute(1) if @sub_pt_items != nil
@sub_pt_items = {}
end
if DUAL_PT::WEAPON
ptc_execute(2) if @sub_pt_weapons != nil
@sub_pt_weapons = {}
end
if DUAL_PT::ARMOR
ptc_execute(3) if @sub_pt_armors != nil
@sub_pt_armors = {}
end
if DUAL_PT::GOLD
ptc_execute(4) if @sub_pt_gold != nil
@sub_pt_gold = 0
end
end
def ptc_execute(type_data)
case type_data
when 0
for i in @sub_pt_actors
add_actor(i)
end
when 1
for i in 1...$data_items.size
next if @sub_pt_items[i] == nil
gain_item($data_items[i], @sub_pt_items[i])
end
when 2
for i in 1...$data_weapons.size
next if @sub_pt_weapons[i] == nil
gain_item($data_weapons[i], @sub_pt_weapons[i])
end
when 3
for i in 1...$data_armors.size
next if @sub_pt_armors[i] == nil
gain_item($data_armors[i], @sub_pt_armors[i])
end
when 4
gain_gold(@sub_pt_gold)
end
end
def sec_pt_delete
@sub_pt_actors = []
@sub_pt_items = {}
@sub_pt_weapons = {}
@sub_pt_armors = {}
@sub_pt_gold = 0
end
end