设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1288|回复: 0
打印 上一主题 下一主题

[已经过期] 多人队伍的脚本如何在战斗中不显示更换队友?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
80
在线时间
56 小时
注册时间
2012-3-16
帖子
32
跳转到指定楼层
1
发表于 2012-4-16 12:12:19 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 iisnow 于 2012-4-18 15:59 编辑

新人一只··求助各位大大了···
在那个论坛里找到的多人队伍配合8人菜单那个
如何能在战斗中不能更换队员呢??
希望哪位大大可以帮帮我···
一下是脚本
  1. #_/    ◇ Last update : 2008/04/27 ◇
  2. #_/----------------------------------------------------------------------------
  3. #_/  5人以上の大規模パーティを構築可能にします。
  4. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

  5. #==============================================================================
  6. # ★ カスタマイズ項目 - Customize ★
  7. #==============================================================================

  8. module KGC
  9. module LargeParty
  10.   # ◆ パーティ編成許可を表すスイッチ番号
  11.   #  このスイッチの ON/OFF でパーティ編成の 許可/不許可 を切り替えます。
  12.   PARTYFORM_SWITCH          = 1
  13.   # ◆ 戦闘中のパーティ編成許可を表すスイッチ番号
  14.   #  ↑と異なる番号を指定すると、戦闘中のみの入れ替え可否を設定できます。
  15.   BATTLE_PARTYFORM_SWITCH   = 1
  16.   # ◆ デフォルトの編成許可フラグ
  17.   #  true にすると、「ニューゲーム」選択時に両方のパーティ編成許可スイッチが
  18.   #  自動的に ON になります。
  19.   DEFAULT_PARTYFORM_ENABLED = true

  20.   # ◆ 戦闘メンバー最大数 (デフォルト値)
  21.   #  5 以上にすると、戦闘画面のステータスがやや見辛くなります。
  22.   MAX_BATTLE_MEMBERS = 4
  23.   # ◆ パーティメンバー最大数
  24.   #  Game_Party::MAX_MEMBERS を上書きします。
  25.   #  100 以上にすると [Window_MenuStatus] がバグります。
  26.   MAX_MEMBERS = 99

  27.   # ◆ 固定メンバーの並び替えを禁止
  28.   #  スクリプトからの操作以外では並び替えできなくなります。
  29.   FORBID_CHANGE_SHIFT_FIXED = false

  30.   # ◆ 待機メンバーの背景色
  31.   #  色を変えない場合は  Color.new(0, 0, 0, 0)
  32.   STAND_BY_COLOR = Color.new(0, 0, 0, 128)
  33.   # ◆ 固定メンバーの背景色
  34.   FIXED_COLOR    = Color.new(255, 128, 64, 96)
  35.   # ◆ 並び替え時の背景色
  36.   SELECTED_COLOR = Color.new(64, 255, 128, 128)

  37.   # ◆ パーティ編成ボタン (メニュー画面用)
  38.   #  メニュー画面でこのボタンを押すと、パーティ編成画面に移行します。
  39.   #  使用しない場合は nil
  40.   MENU_PARTYFORM_BUTTON      = Input::A
  41.   # ◆ メニュー画面にパーティ編成コマンドを追加する
  42.   #  追加する場所は、メニューコマンドの最下部です。
  43.   #  他の部分に追加したければ、≪カスタムメニューコマンド≫ をご利用ください。
  44.   USE_MENU_PARTYFORM_COMMAND = true
  45.   # ◆ メニュー画面のパーティ編成コマンドの名称
  46.   VOCAB_MENU_PARTYFORM       = "队伍编辑"
  47.   # ◆ 戦闘中にパーティ編成コマンドを使用する
  48.   #  追加する場所は、パーティコマンドの最下部(「逃げる」の下)です。
  49.   USE_BATTLE_PARTYFORM   = true
  50.   # ◆ 戦闘中のパーティ編成コマンドの名称
  51.   VOCAB_BATTLE_PARTYFORM = ""
  52.   # ◆ 編成画面のキャラクター描画サイズ [幅, 高さ]
  53.   #  アクターの歩行グラフィックのサイズに応じて書き換えてください。
  54.   PARTY_FORM_CHARACTER_SIZE   = [40, 48]
  55.   # ◆ 編成画面の戦闘メンバーウィンドウの空欄に表示するテキスト
  56.   BATTLE_MEMBER_BLANK_TEXT    = "广告位"
  57.   # ◆ 編成画面のパーティメンバーウィンドウの最大行数
  58.   #  ステータスウィンドウが画面からはみ出る場合は、
  59.   #  この値を 1 にしてください。
  60.   PARTY_MEMBER_WINDOW_ROW_MAX = 2
  61.   # ◆ 編成画面のパーティメンバーウィンドウに戦闘メンバーを表示する
  62.   SHOW_BATTLE_MEMBER_IN_PARTY = false
  63.   # ◆ 編成画面のパーティメンバーウィンドウの空欄に表示するテキスト
  64.   PARTY_MEMBER_BLANK_TEXT     = "-"

  65.   # ◆ 編成画面のキャプションウィンドウの幅
  66.   CAPTION_WINDOW_WIDTH  = 192
  67.   # ◆ 編成画面の戦闘メンバーウィンドウのキャプション
  68.   BATTLE_MEMBER_CAPTION = "目前队伍"

  69.   if SHOW_BATTLE_MEMBER_IN_PARTY
  70.     # ◆ 編成画面のパーティメンバーウィンドウのキャプション
  71.     #  SHOW_BATTLE_MEMBER_IN_PARTY = true のとき
  72.     PARTY_MEMBER_CAPTION = "队员"
  73.   else
  74.     # ◆ 編成画面のパーティメンバーウィンドウのキャプション
  75.     #  SHOW_BATTLE_MEMBER_IN_PARTY = false のとき
  76.     PARTY_MEMBER_CAPTION = "等待人物"
  77.   end

  78.   # ◆ 編成確認ウィンドウの幅
  79.   CONFIRM_WINDOW_WIDTH    = 160
  80.   # ◆ 編成確認ウィンドウの文字列
  81.   #  ※コマンド数・順番を変更するとバグります。
  82.   CONFIRM_WINDOW_COMMANDS = ["编辑完毕", "编辑结束", "取消"]

  83.   # ◆ ショップ画面のステータスウィンドウスクロール時に使用するボタン
  84.   #  このボタンを押している間、上下ボタンでスクロールできます。
  85.   #  スクロールを無効にする場合は nil を指定。
  86.   #  ≪ヘルプウィンドウ機能拡張≫併用時は、上に導入したものを優先。
  87.   SHOP_STATUS_SCROLL_BUTTON = Input::A

  88.   # ◆ 待機メンバー獲得経験値割合【単位:‰(千分率 1‰=0.1%)】
  89.   #  500 なら 50.0% です。
  90.   STAND_BY_EXP_RATE = 500
  91.   # ◆ リザルト画面で待機メンバーのレベルアップを表示する
  92.   #  false にすると、戦闘メンバーのみ表示します。
  93.   SHOW_STAND_BY_LEVEL_UP = true
  94.   # ◆ 戦闘以外でも待機メンバーを表示する
  95.   #  true  : 戦闘以外では常に全員を表示。
  96.   #  false : 入れ替え時以外は、待機メンバーをいないものとして扱う。
  97.   SHOW_STAND_BY_MEMBER_NOT_IN_BATTLE = true
  98. end
  99. end

  100. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  101. $imported = {} if $imported == nil
  102. $imported["LargeParty"] = true

  103. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  104. #==============================================================================
  105. # □ KGC::Commands
  106. #==============================================================================

  107. module KGC
  108. module Commands
  109.   # メンバーのソート形式
  110.   SORT_BY_ID    = 0  # ID順
  111.   SORT_BY_NAME  = 1  # 名前順
  112.   SORT_BY_LEVEL = 2  # レベル順

  113.   module_function
  114.   #--------------------------------------------------------------------------
  115.   # ○ パーティ編成画面の呼び出し
  116.   #--------------------------------------------------------------------------
  117.   def call_partyform
  118.     return if $game_temp.in_battle
  119.     $game_temp.next_scene = :partyform
  120.   end
  121.   #--------------------------------------------------------------------------
  122.   # ○ 戦闘メンバー最大数を設定
  123.   #     value : 人数 (省略した場合はデフォルト値を使用)
  124.   #--------------------------------------------------------------------------
  125.   def set_max_battle_member_count(value = nil)
  126.     $game_party.max_battle_member_count = value
  127.   end
  128.   #--------------------------------------------------------------------------
  129.   # ○ パーティ人数が一杯か
  130.   #--------------------------------------------------------------------------
  131.   def party_full?
  132.     return $game_party.full?
  133.   end
  134.   #--------------------------------------------------------------------------
  135.   # ○ パーティ編成可否を設定
  136.   #     enabled : 有効フラグ (省略時 : true)
  137.   #--------------------------------------------------------------------------
  138.   def permit_partyform(enabled = true)
  139.     $game_switches[KGC::LargeParty::PARTYFORM_SWITCH] = enabled
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # ○ 戦闘中のパーティ編成可否を設定
  143.   #     enabled : 有効フラグ (省略時 : true)
  144.   #--------------------------------------------------------------------------
  145.   def permit_battle_partyform(enabled = true)
  146.     $game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH] = enabled
  147.   end
  148.   #--------------------------------------------------------------------------
  149.   # ○ アクターの固定状態を設定
  150.   #     actor_id : アクター ID
  151.   #     fixed    : 固定フラグ (省略時 : true)
  152.   #--------------------------------------------------------------------------
  153.   def fix_actor(actor_id, fixed = true)
  154.     $game_party.fix_actor(actor_id, fixed)
  155.   end
  156.   #--------------------------------------------------------------------------
  157.   # ○ 並び替え
  158.   #    メンバーの index1 番目と index2 番目を入れ替える
  159.   #--------------------------------------------------------------------------
  160.   def change_party_shift(index1, index2)
  161.     $game_party.change_shift(index1, index2)
  162.   end
  163.   #--------------------------------------------------------------------------
  164.   # ○ メンバー整列 (昇順)
  165.   #     sort_type : ソート形式 (SORT_BY_xxx)
  166.   #     reverse   : true だと降順
  167.   #--------------------------------------------------------------------------
  168.   def sort_party_member(sort_type = SORT_BY_ID, reverse = false)
  169.     $game_party.sort_member(sort_type, reverse)
  170.   end
  171.   #--------------------------------------------------------------------------
  172.   # ○ 待機メンバーの ID を取得
  173.   #--------------------------------------------------------------------------
  174.   def get_stand_by_member_ids
  175.     result = []
  176.     $game_party.stand_by_members.each { |actor| result << actor.id }
  177.     return result
  178.   end
  179.   #--------------------------------------------------------------------------
  180.   # ○ アクターが待機メンバーか
  181.   #     actor_id : アクター ID
  182.   #--------------------------------------------------------------------------
  183.   def stand_by_member?(actor_id)
  184.     return get_stand_by_member_ids.include?(actor_id)
  185.   end
  186.   #--------------------------------------------------------------------------
  187.   # ○ アクターを戦闘メンバーに加える
  188.   #     actor_id : アクター ID
  189.   #     index    : 追加位置 (省略時は最後尾)
  190.   #--------------------------------------------------------------------------
  191.   def add_battle_member(actor_id, index = nil)
  192.     $game_party.add_battle_member(actor_id, index)
  193.   end
  194.   #--------------------------------------------------------------------------
  195.   # ○ アクターを戦闘メンバーから外す
  196.   #     actor_id : アクター ID
  197.   #--------------------------------------------------------------------------
  198.   def remove_battle_member(actor_id)
  199.     $game_party.remove_battle_member(actor_id)
  200.   end
  201.   #--------------------------------------------------------------------------
  202.   # ○ 固定アクター以外を戦闘メンバーから外す
  203.   #--------------------------------------------------------------------------
  204.   def remove_all_battle_member
  205.     $game_party.all_members.each { |actor|
  206.       $game_party.remove_battle_member(actor.id)
  207.     }
  208.   end
  209.   #--------------------------------------------------------------------------
  210.   # ○ ランダム出撃
  211.   #--------------------------------------------------------------------------
  212.   def random_launch
  213.     new_battle_members = $game_party.fixed_members
  214.     candidates = $game_party.all_members - new_battle_members
  215.     num = [$game_party.max_battle_member_count - new_battle_members.size,
  216.       candidates.size].min
  217.     return if num <= 0

  218.     # ランダムに選ぶ
  219.     ary = (0...candidates.size).to_a.sort_by { rand }
  220.     ary[0...num].each { |i| new_battle_members << candidates[i] }
  221.     $game_party.set_battle_member(new_battle_members)
  222.   end
  223. end
  224. end

  225. class Game_Interpreter
  226.   include KGC::Commands
  227. end

  228. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  229. #==============================================================================
  230. # ■ Vocab
  231. #==============================================================================

  232. module Vocab
  233.   # 「パーティ編成」コマンド名 (メニュー)
  234.   def self.partyform
  235.     return KGC::LargeParty::VOCAB_MENU_PARTYFORM
  236.   end

  237.   # 「パーティ編成」コマンド名 (戦闘)
  238.   def self.partyform_battle
  239.     return KGC::LargeParty::VOCAB_BATTLE_PARTYFORM
  240.   end
  241. end

  242. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  243. #==============================================================================
  244. # ■ Game_Actor
  245. #==============================================================================

  246. class Game_Actor < Game_Battler
  247.   #--------------------------------------------------------------------------
  248.   # ○ パーティ内インデックス取得
  249.   #--------------------------------------------------------------------------
  250.   def party_index
  251.     return $game_party.all_members.index(self)
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ○ 戦闘メンバーか判定
  255.   #--------------------------------------------------------------------------
  256.   def battle_member?
  257.     return $game_party.battle_members.include?(self)
  258.   end
  259.   #--------------------------------------------------------------------------
  260.   # ○ 固定メンバーか判定
  261.   #--------------------------------------------------------------------------
  262.   def fixed_member?
  263.     return $game_party.fixed_members.include?(self)
  264.   end
  265. end

  266. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  267. #==============================================================================
  268. # ■ Game_Party
  269. #==============================================================================

  270. class Game_Party
  271.   #--------------------------------------------------------------------------
  272.   # ● 定数
  273.   #--------------------------------------------------------------------------
  274.   MAX_MEMBERS = KGC::LargeParty::MAX_MEMBERS  # 最大パーティ人数
  275.   #--------------------------------------------------------------------------
  276.   # ● オブジェクト初期化
  277.   #--------------------------------------------------------------------------
  278.   alias initialize_KGC_LargeParty initialize
  279.   def initialize
  280.     initialize_KGC_LargeParty

  281.     @max_battle_member_count = nil
  282.     @battle_member_count = 0
  283.     @fixed_actors = []
  284.   end
  285.   #--------------------------------------------------------------------------
  286.   # ○ 戦闘メンバー最大数取得
  287.   #--------------------------------------------------------------------------
  288.   def max_battle_member_count
  289.     if @max_battle_member_count == nil
  290.       return KGC::LargeParty::MAX_BATTLE_MEMBERS
  291.     else
  292.       return @max_battle_member_count
  293.     end
  294.   end
  295.   #--------------------------------------------------------------------------
  296.   # ○ 戦闘メンバー最大数変更
  297.   #--------------------------------------------------------------------------
  298.   def max_battle_member_count=(value)
  299.     if value.is_a?(Integer)
  300.       value = [value, 1].max
  301.     end
  302.     @max_battle_member_count = value
  303.   end
  304.   #--------------------------------------------------------------------------
  305.   # ○ 戦闘メンバー数取得
  306.   #--------------------------------------------------------------------------
  307.   def battle_member_count
  308.     if @battle_member_count == nil
  309.       @battle_member_count = @actors.size
  310.     end
  311.     @battle_member_count =
  312.       [@battle_member_count, @actors.size, max_battle_member_count].min
  313.     return @battle_member_count
  314.   end
  315.   #--------------------------------------------------------------------------
  316.   # ○ 戦闘メンバー数設定
  317.   #--------------------------------------------------------------------------
  318.   def battle_member_count=(value)
  319.     @battle_member_count = [[value, 0].max,
  320.       @actors.size, max_battle_member_count].min
  321.   end
  322.   #--------------------------------------------------------------------------
  323.   # ● メンバーの取得
  324.   #--------------------------------------------------------------------------
  325.   alias members_KGC_LargeParty members
  326.   def members
  327.     if $game_temp.in_battle ||
  328.         !KGC::LargeParty::SHOW_STAND_BY_MEMBER_NOT_IN_BATTLE
  329.       return battle_members
  330.     else
  331.       return members_KGC_LargeParty
  332.     end
  333.   end
  334.   #--------------------------------------------------------------------------
  335.   # ○ 全メンバーの取得
  336.   #--------------------------------------------------------------------------
  337.   def all_members
  338.     return members_KGC_LargeParty
  339.   end
  340.   #--------------------------------------------------------------------------
  341.   # ○ 戦闘メンバーの取得
  342.   #--------------------------------------------------------------------------
  343.   def battle_members
  344.     result = []
  345.     battle_member_count.times { |i| result << $game_actors[@actors[i]] }
  346.     return result
  347.   end
  348.   #--------------------------------------------------------------------------
  349.   # ○ 待機メンバーの取得
  350.   #--------------------------------------------------------------------------
  351.   def stand_by_members
  352.     return (all_members - battle_members)
  353.   end
  354.   #--------------------------------------------------------------------------
  355.   # ○ 固定メンバーの取得
  356.   #--------------------------------------------------------------------------
  357.   def fixed_members
  358.     result = []
  359.     @fixed_actors.each { |i| result << $game_actors[i] }
  360.     return result
  361.   end
  362.   #--------------------------------------------------------------------------
  363.   # ● 初期パーティのセットアップ
  364.   #--------------------------------------------------------------------------
  365.   alias setup_starting_members_KGC_LargeParty setup_starting_members
  366.   def setup_starting_members
  367.     setup_starting_members_KGC_LargeParty

  368.     self.battle_member_count = @actors.size
  369.   end
  370.   #--------------------------------------------------------------------------
  371.   # ● 戦闘テスト用パーティのセットアップ
  372.   #--------------------------------------------------------------------------
  373.   alias setup_battle_test_members_KGC_LargeParty setup_battle_test_members
  374.   def setup_battle_test_members
  375.     setup_battle_test_members_KGC_LargeParty

  376.     self.battle_member_count = @actors.size
  377.   end
  378.   #--------------------------------------------------------------------------
  379.   # ○ メンバーの新規設定
  380.   #     new_member : 新しいメンバー
  381.   #--------------------------------------------------------------------------
  382.   def set_member(new_member)
  383.     @actors = []
  384.     new_member.each { |actor| @actors << actor.id }
  385.   end
  386.   #--------------------------------------------------------------------------
  387.   # ○ 戦闘メンバーの新規設定
  388.   #     new_member : 新しい戦闘メンバー
  389.   #--------------------------------------------------------------------------
  390.   def set_battle_member(new_member)
  391.     new_battle_member = []
  392.     new_member.each { |actor|
  393.       @actors.delete(actor.id)
  394.       new_battle_member << actor.id
  395.     }
  396.     @actors = new_battle_member + @actors
  397.     self.battle_member_count = new_member.size
  398.   end
  399.   #--------------------------------------------------------------------------
  400.   # ○ パーティ編成を許可しているか判定
  401.   #--------------------------------------------------------------------------
  402.   def partyform_enable?
  403.     return $game_switches[KGC::LargeParty::PARTYFORM_SWITCH]
  404.   end
  405.   #--------------------------------------------------------------------------
  406.   # ○ 戦闘中のパーティ編成を許可しているか判定
  407.   #--------------------------------------------------------------------------
  408.   def battle_partyform_enable?
  409.     return false unless partyform_enable?
  410.     return $game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH]
  411.   end
  412.   #--------------------------------------------------------------------------
  413.   # ○ メンバーが一杯か判定
  414.   #--------------------------------------------------------------------------
  415.   def full?
  416.     return (@actors.size >= MAX_MEMBERS)
  417.   end
  418.   #--------------------------------------------------------------------------
  419.   # ○ 固定アクターか判定
  420.   #     actor_id : 判定するアクターの ID
  421.   #--------------------------------------------------------------------------
  422.   def actor_fixed?(actor_id)
  423.     return @fixed_actors.include?(actor_id)
  424.   end
  425.   #--------------------------------------------------------------------------
  426.   # ● アクターを加える
  427.   #     actor_id : アクター ID
  428.   #--------------------------------------------------------------------------
  429.   alias add_actor_KGC_LargeParty add_actor
  430.   def add_actor(actor_id)
  431.     last_size = @actors.size

  432.     add_actor_KGC_LargeParty(actor_id)

  433.     if last_size < @actors.size
  434.       self.battle_member_count += 1
  435.     end
  436.   end
  437.   #--------------------------------------------------------------------------
  438.   # ○ アクターを戦闘メンバーに加える
  439.   #     actor_id : アクター ID
  440.   #     index    : 追加位置 (省略時は最後尾)
  441.   #--------------------------------------------------------------------------
  442.   def add_battle_member(actor_id, index = nil)
  443.     return unless @actors.include?(actor_id)  # パーティにいない
  444.     if index == nil
  445.       return if battle_members.include?($game_actors[actor_id])  # 出撃済み
  446.       return if battle_member_count == max_battle_member_count   # 人数が最大
  447.       index = battle_member_count
  448.     end

  449.     @actors.delete(actor_id)
  450.     @actors.insert(index, actor_id)
  451.     self.battle_member_count += 1
  452.   end
  453.   #--------------------------------------------------------------------------
  454.   # ○ アクターを戦闘メンバーから外す
  455.   #     actor_id : アクター ID
  456.   #--------------------------------------------------------------------------
  457.   def remove_battle_member(actor_id)
  458.     return unless @actors.include?(actor_id)  # パーティにいない
  459.     return if actor_fixed?(actor_id)          # 固定済み
  460.     return if stand_by_members.include?($game_actors[actor_id])  # 待機中

  461.     @actors.delete(actor_id)
  462.     @actors.push(actor_id)
  463.     self.battle_member_count -= 1
  464.   end
  465.   #--------------------------------------------------------------------------
  466.   # ○ アクターの固定状態を設定
  467.   #     actor_id : アクター ID
  468.   #     fixed    : 固定フラグ (省略時 : false)
  469.   #--------------------------------------------------------------------------
  470.   def fix_actor(actor_id, fixed = false)
  471.     return unless @actors.include?(actor_id)  # パーティにいない

  472.     if fixed
  473.       # 固定
  474.       unless @fixed_actors.include?(actor_id)
  475.         @fixed_actors << actor_id
  476.         unless battle_members.include?($game_actors[actor_id])
  477.           self.battle_member_count += 1
  478.         end
  479.       end
  480.       # 強制出撃
  481.       apply_force_launch
  482.     else
  483.       # 固定解除
  484.       @fixed_actors.delete(actor_id)
  485.     end
  486.     $game_player.refresh
  487.   end
  488.   #--------------------------------------------------------------------------
  489.   # ○ 強制出撃適用
  490.   #--------------------------------------------------------------------------
  491.   def apply_force_launch
  492.     while (fixed_members - battle_members).size > 0
  493.       # 固定状態でないメンバーを適当に持ってきて入れ替え
  494.       actor1 = stand_by_members.find { |a| @fixed_actors.include?(a.id) }
  495.       actor2 = battle_members.reverse.find { |a| !@fixed_actors.include?(a.id) }
  496.       index1 = @actors.index(actor1.id)
  497.       index2 = @actors.index(actor2.id)
  498.       @actors[index1], @actors[index2] = @actors[index2], @actors[index1]

  499.       # 戦闘メンバーが全員固定されたら戻る (無限ループ防止)
  500.       all_fixed = true
  501.       battle_members.each { |actor|
  502.         unless actor.fixed_member?
  503.           all_fixed = false
  504.           break
  505.         end
  506.       }
  507.       break if all_fixed
  508.     end
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # ○ メンバー整列 (昇順)
  512.   #     sort_type : ソート形式 (SORT_BY_xxx)
  513.   #     reverse   : true だと降順
  514.   #--------------------------------------------------------------------------
  515.   def sort_member(sort_type = KGC::Commands::SORT_BY_ID,
  516.                   reverse = false)
  517.     # バッファを準備
  518.     b_actors = battle_members
  519.     actors = all_members - b_actors
  520.     f_actors = fixed_members
  521.     # 固定キャラはソートしない
  522.     if KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED
  523.       actors -= f_actors
  524.       b_actors -= f_actors
  525.     end

  526.     # ソート
  527.     case sort_type
  528.     when KGC::Commands::SORT_BY_ID     # ID順
  529.       actors.sort!   { |a, b| a.id <=> b.id }
  530.       b_actors.sort! { |a, b| a.id <=> b.id }
  531.     when KGC::Commands::SORT_BY_NAME   # 名前順
  532.       actors.sort!   { |a, b| a.name <=> b.name }
  533.       b_actors.sort! { |a, b| a.name <=> b.name }
  534.     when KGC::Commands::SORT_BY_LEVEL  # レベル順
  535.       actors.sort!   { |a, b| a.level <=> b.level }
  536.       b_actors.sort! { |a, b| a.level <=> b.level }
  537.     end
  538.     # 反転
  539.     if reverse
  540.       actors.reverse!
  541.       b_actors.reverse!
  542.     end

  543.     # 固定キャラを先頭に持ってくる
  544.     if KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED
  545.       actors = f_actors + actors
  546.       b_actors = f_actors + b_actors
  547.     end

  548.     # 復帰
  549.     set_member(actors)
  550.     set_battle_member(b_actors)

  551.     apply_force_launch
  552.     $game_player.refresh
  553.   end
  554.   #--------------------------------------------------------------------------
  555.   # ○ 並び替え
  556.   #    戦闘メンバーの index1 番目と index2 番目を入れ替える
  557.   #--------------------------------------------------------------------------
  558.   def change_shift(index1, index2)
  559.     size = @actors.size
  560.     if index1 >= size || index2 >= size
  561.       return
  562.     end
  563.     buf = @actors[index1]
  564.     @actors[index1] = @actors[index2]
  565.     @actors[index2] = buf
  566.     $game_player.refresh
  567.   end
  568.   #--------------------------------------------------------------------------
  569.   # ● 戦闘用ステートの解除 (戦闘終了時に呼び出し)
  570.   #--------------------------------------------------------------------------
  571.   def remove_states_battle
  572.     for actor in all_members
  573.       actor.remove_states_battle
  574.     end
  575.   end
  576. end

  577. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  578. #==============================================================================
  579. # ■ Window_Command
  580. #==============================================================================

  581. class Window_Command < Window_Selectable
  582.   unless method_defined?(:add_command)
  583.   #--------------------------------------------------------------------------
  584.   # ○ コマンドを追加
  585.   #    追加した位置を返す
  586.   #--------------------------------------------------------------------------
  587.   def add_command(command)
  588.     @commands << command
  589.     @item_max = @commands.size
  590.     item_index = @item_max - 1
  591.     refresh_command
  592.     draw_item(item_index)
  593.     return item_index
  594.   end
  595.   #--------------------------------------------------------------------------
  596.   # ○ コマンドをリフレッシュ
  597.   #--------------------------------------------------------------------------
  598.   def refresh_command
  599.     buf = self.contents.clone
  600.     self.height = [self.height, row_max * WLH + 32].max
  601.     create_contents
  602.     self.contents.blt(0, 0, buf, buf.rect)
  603.     buf.dispose
  604.   end
  605.   #--------------------------------------------------------------------------
  606.   # ○ コマンドを挿入
  607.   #--------------------------------------------------------------------------
  608.   def insert_command(index, command)
  609.     @commands.insert(index, command)
  610.     @item_max = @commands.size
  611.     refresh_command
  612.     refresh
  613.   end
  614.   #--------------------------------------------------------------------------
  615.   # ○ コマンドを削除
  616.   #--------------------------------------------------------------------------
  617.   def remove_command(command)
  618.     @commands.delete(command)
  619.     @item_max = @commands.size
  620.     refresh
  621.   end
  622.   end
  623. end

  624. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  625. #==============================================================================
  626. # ■ Window_MenuStatus
  627. #==============================================================================

  628. class Window_MenuStatus < Window_Selectable
  629.   #--------------------------------------------------------------------------
  630.   # ● 定数
  631.   #--------------------------------------------------------------------------
  632.   STATUS_HEIGHT = 96  # ステータス一人分の高さ
  633.   #--------------------------------------------------------------------------
  634.   # ● ウィンドウ内容の作成
  635.   #--------------------------------------------------------------------------
  636.   def create_contents
  637.     self.contents.dispose
  638.     self.contents = Bitmap.new(width - 32,
  639.       [height - 32, row_max * STATUS_HEIGHT].max)
  640.   end
  641.   #--------------------------------------------------------------------------
  642.   # ● 先頭の行の取得
  643.   #--------------------------------------------------------------------------
  644.   def top_row
  645.     return self.oy / STATUS_HEIGHT
  646.   end
  647.   #--------------------------------------------------------------------------
  648.   # ● 先頭の行の設定
  649.   #     row : 先頭に表示する行
  650.   #--------------------------------------------------------------------------
  651.   def top_row=(row)
  652.     super(row)
  653.     self.oy = self.oy / WLH * STATUS_HEIGHT
  654.   end
  655.   #--------------------------------------------------------------------------
  656.   # ● 1 ページに表示できる行数の取得
  657.   #--------------------------------------------------------------------------
  658.   def page_row_max
  659.     return (self.height - 32) / STATUS_HEIGHT
  660.   end
  661.   #--------------------------------------------------------------------------
  662.   # ● 項目を描画する矩形の取得
  663.   #     index : 項目番号
  664.   #--------------------------------------------------------------------------
  665.   def item_rect(index)
  666.     rect = super(index)
  667.     rect.height = STATUS_HEIGHT
  668.     rect.y = index / @column_max * STATUS_HEIGHT
  669.     return rect
  670.   end
  671.   #--------------------------------------------------------------------------
  672.   # ● リフレッシュ
  673.   #--------------------------------------------------------------------------
  674.   def refresh
  675.     @item_max = $game_party.members.size
  676.     create_contents
  677.     fill_stand_by_background
  678.     draw_member
  679.   end
  680.   #--------------------------------------------------------------------------
  681.   # ○ パーティメンバー描画
  682.   #--------------------------------------------------------------------------
  683.   def draw_member
  684.     for actor in $game_party.members
  685.       draw_actor_face(actor, 2, actor.party_index * 96 + 2, 92)
  686.       x = 104
  687.       y = actor.party_index * 96 + WLH / 2
  688.       draw_actor_name(actor, x, y)
  689.       draw_actor_class(actor, x + 120, y)
  690.       draw_actor_level(actor, x, y + WLH * 1)
  691.       draw_actor_state(actor, x, y + WLH * 2)
  692.       draw_actor_hp(actor, x + 120, y + WLH * 1)
  693.       draw_actor_mp(actor, x + 120, y + WLH * 2)
  694.     end
  695.   end
  696.   #--------------------------------------------------------------------------
  697.   # ○ 待機メンバーの背景色を塗る
  698.   #--------------------------------------------------------------------------
  699.   def fill_stand_by_background
  700.     color = KGC::LargeParty::STAND_BY_COLOR
  701.     dy = STATUS_HEIGHT * $game_party.battle_members.size
  702.     dh = STATUS_HEIGHT * $game_party.stand_by_members.size
  703.     if dh > 0
  704.       self.contents.fill_rect(0, dy, self.width - 32, dh, color)
  705.     end
  706.   end
  707.   #--------------------------------------------------------------------------
  708.   # ● カーソルの更新
  709.   #--------------------------------------------------------------------------
  710.   def update_cursor
  711.     if @index < 0               # カーソルなし
  712.       self.cursor_rect.empty
  713.     elsif @index < @item_max    # 通常
  714.       super
  715.     elsif @index >= 100         # 自分
  716.       self.cursor_rect.set(0, (@index - 100) * STATUS_HEIGHT,
  717.         contents.width, STATUS_HEIGHT)
  718.     else                        # 全体
  719.       self.cursor_rect.set(0, 0, contents.width, @item_max * STATUS_HEIGHT)
  720.     end
  721.   end
  722. end

  723. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  724. #==============================================================================
  725. # ■ Window_ShopStatus
  726. #==============================================================================

  727. class Window_ShopStatus < Window_Base
  728.   #--------------------------------------------------------------------------
  729.   # ● ウィンドウ内容の作成
  730.   #--------------------------------------------------------------------------
  731.   def create_contents
  732.     self.contents.dispose
  733.     self.contents = Bitmap.new(width - 32,
  734.       WLH * ($game_party.members.size + 1) * 2)
  735.   end
  736. end

  737. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  738. #==============================================================================
  739. # ■ Window_BattleStatus
  740. #==============================================================================

  741. class Window_BattleStatus < Window_Selectable
  742.   #--------------------------------------------------------------------------
  743.   # ● ウィンドウ内容の作成
  744.   #--------------------------------------------------------------------------
  745.   def create_contents
  746.     self.contents.dispose
  747.     self.contents = Bitmap.new(width - 32,
  748.       [WLH * $game_party.members.size, height - 32].max)
  749.   end
  750.   #--------------------------------------------------------------------------
  751.   # ● リフレッシュ
  752.   #--------------------------------------------------------------------------
  753.   alias refresh_KGC_LargeParty refresh
  754.   def refresh
  755.     create_contents

  756.     refresh_KGC_LargeParty
  757.   end
  758. end

  759. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  760. #==============================================================================
  761. # □ Window_PartyFormCaption
  762. #------------------------------------------------------------------------------
  763. #  パーティ編成画面でウィンドウのキャプションを表示するウィンドウです。
  764. #==============================================================================

  765. class Window_PartyFormCaption < Window_Base
  766.   #--------------------------------------------------------------------------
  767.   # ● オブジェクト初期化
  768.   #     caption : 表示するキャプション
  769.   #--------------------------------------------------------------------------
  770.   def initialize(caption = "")
  771.     super(0, 0, KGC::LargeParty::CAPTION_WINDOW_WIDTH, WLH + 32)
  772.     @caption = caption
  773.     refresh
  774.   end
  775.   #--------------------------------------------------------------------------
  776.   # ● リフレッシュ
  777.   #--------------------------------------------------------------------------
  778.   def refresh
  779.     self.contents.clear
  780.     self.contents.draw_text(0, 0, width - 32, WLH, @caption)
  781.   end
  782. end

  783. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  784. #==============================================================================
  785. # □ Window_PartyFormMember
  786. #------------------------------------------------------------------------------
  787. #  パーティ編成画面でメンバーを表示するウィンドウです。
  788. #==============================================================================

  789. class Window_PartyFormMember < Window_Selectable
  790.   #--------------------------------------------------------------------------
  791.   # ○ 定数
  792.   #--------------------------------------------------------------------------
  793.   DRAW_SIZE = KGC::LargeParty::PARTY_FORM_CHARACTER_SIZE
  794.   #--------------------------------------------------------------------------
  795.   # ● 公開インスタンス変数
  796.   #--------------------------------------------------------------------------
  797.   attr_accessor :selected_index           # 選択済みインデックス
  798.   #--------------------------------------------------------------------------
  799.   # ● オブジェクト初期化
  800.   #     x       : ウィンドウの X 座標
  801.   #     y       : ウィンドウの Y 座標
  802.   #     width   : ウィンドウの幅
  803.   #     height  : ウィンドウの高さ
  804.   #     spacing : 横に項目が並ぶときの空白の幅
  805.   #--------------------------------------------------------------------------
  806.   def initialize(x, y, width, height, spacing = 8)
  807.     super(x, y, width, height, spacing)
  808.   end
  809.   #--------------------------------------------------------------------------
  810.   # ● ウィンドウ内容の作成
  811.   #--------------------------------------------------------------------------
  812.   def create_contents
  813.     self.contents.dispose
  814.     self.contents = Bitmap.new(width - 32,
  815.       [height - 32, row_max * DRAW_SIZE[1]].max)
  816.   end
  817.   #--------------------------------------------------------------------------
  818.   # ● 先頭の行の取得
  819.   #--------------------------------------------------------------------------
  820.   def top_row
  821.     return self.oy / DRAW_SIZE[1]
  822.   end
  823.   #--------------------------------------------------------------------------
  824.   # ● 先頭の行の設定
  825.   #     row : 先頭に表示する行
  826.   #--------------------------------------------------------------------------
  827.   def top_row=(row)
  828.     super(row)
  829.     self.oy = self.oy / WLH * DRAW_SIZE[1]
  830.   end
  831.   #--------------------------------------------------------------------------
  832.   # ● 1 ページに表示できる行数の取得
  833.   #--------------------------------------------------------------------------
  834.   def page_row_max
  835.     return (self.height - 32) / DRAW_SIZE[1]
  836.   end
  837.   #--------------------------------------------------------------------------
  838.   # ● 項目を描画する矩形の取得
  839.   #     index : 項目番号
  840.   #--------------------------------------------------------------------------
  841.   def item_rect(index)
  842.     rect = super(index)
  843.     rect.width = DRAW_SIZE[0]
  844.     rect.height = DRAW_SIZE[1]
  845.     rect.y = index / @column_max * DRAW_SIZE[1]
  846.     return rect
  847.   end
  848.   #--------------------------------------------------------------------------
  849.   # ○ 選択アクター取得
  850.   #--------------------------------------------------------------------------
  851.   def actor
  852.     return @actors[self.index]
  853.   end
  854.   #--------------------------------------------------------------------------
  855.   # ● リフレッシュ
  856.   #--------------------------------------------------------------------------
  857.   def refresh
  858.     self.contents.clear
  859.     restore_member_list
  860.     draw_member
  861.   end
  862.   #--------------------------------------------------------------------------
  863.   # ○ メンバーリスト修復
  864.   #--------------------------------------------------------------------------
  865.   def restore_member_list
  866.     # 継承先で定義
  867.   end
  868.   #--------------------------------------------------------------------------
  869.   # ○ メンバー描画
  870.   #--------------------------------------------------------------------------
  871.   def draw_member
  872.     # 継承先で定義
  873.   end
  874.   #--------------------------------------------------------------------------
  875.   # ○ 空欄アクター描画
  876.   #     index : 項目番号
  877.   #--------------------------------------------------------------------------
  878.   def draw_empty_actor(index)
  879.     # 継承先で定義
  880.   end
  881.   #--------------------------------------------------------------------------
  882.   # ○ 固定キャラ背景描画
  883.   #     index : 項目番号
  884.   #--------------------------------------------------------------------------
  885.   def draw_fixed_back(index)
  886.     rect = item_rect(index)
  887.     self.contents.fill_rect(rect, KGC::LargeParty::FIXED_COLOR)
  888.   end
  889.   #--------------------------------------------------------------------------
  890.   # ○ 選択中キャラ背景描画
  891.   #     index : 項目番号
  892.   #--------------------------------------------------------------------------
  893.   def draw_selected_back(index)
  894.     rect = item_rect(index)
  895.     self.contents.fill_rect(rect, KGC::LargeParty::SELECTED_COLOR)
  896.   end
  897. end

  898. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  899. #==============================================================================
  900. # □ Window_PartyFormBattleMember
  901. #------------------------------------------------------------------------------
  902. #  パーティ編成画面で戦闘メンバーを表示するウィンドウです。
  903. #==============================================================================

  904. class Window_PartyFormBattleMember < Window_PartyFormMember
  905.   #--------------------------------------------------------------------------
  906.   # ● 公開インスタンス変数
  907.   #--------------------------------------------------------------------------
  908.   attr_accessor :selected_index           # 選択済みインデックス
  909.   #--------------------------------------------------------------------------
  910.   # ● オブジェクト初期化
  911.   #--------------------------------------------------------------------------
  912.   def initialize
  913.     super(0, 0, 64, DRAW_SIZE[1] + 32)
  914.     column_width = DRAW_SIZE[0] + @spacing
  915.     nw = [column_width * $game_party.max_battle_member_count + 32,
  916.       Graphics.width].min
  917.     self.width = nw

  918.     @item_max = $game_party.max_battle_member_count
  919.     @column_max = width / column_width
  920.     @selected_index = nil
  921.     create_contents
  922.     refresh
  923.     self.active = true
  924.     self.index = 0
  925.   end
  926.   #--------------------------------------------------------------------------
  927.   # ○ メンバーリスト修復
  928.   #--------------------------------------------------------------------------
  929.   def restore_member_list
  930.     @actors = $game_party.battle_members
  931.   end
  932.   #--------------------------------------------------------------------------
  933.   # ○ メンバー描画
  934.   #--------------------------------------------------------------------------
  935.   def draw_member
  936.     @item_max.times { |i|
  937.       actor = @actors[i]
  938.       if actor == nil
  939.         draw_empty_actor(i)
  940.       else
  941.         if i == @selected_index
  942.           draw_selected_back(i)
  943.         elsif $game_party.actor_fixed?(actor.id)
  944.           draw_fixed_back(i)
  945.         end
  946.         rect = item_rect(i)
  947.         draw_actor_graphic(actor,
  948.           rect.x + DRAW_SIZE[0] / 2,
  949.           rect.y + DRAW_SIZE[1] - 4)
  950.       end
  951.     }
  952.   end
  953.   #--------------------------------------------------------------------------
  954.   # ○ 空欄アクター描画
  955.   #     index : 項目番号
  956.   #--------------------------------------------------------------------------
  957.   def draw_empty_actor(index)
  958.     rect = item_rect(index)
  959.     self.contents.font.color = system_color
  960.     self.contents.draw_text(rect, KGC::LargeParty::BATTLE_MEMBER_BLANK_TEXT, 1)
  961.     self.contents.font.color = normal_color
  962.   end
  963. end

  964. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  965. #==============================================================================
  966. # □ Window_PartyFormAllMember
  967. #------------------------------------------------------------------------------
  968. #  パーティ編成画面で全メンバーを表示するウィンドウです。
  969. #==============================================================================

  970. class Window_PartyFormAllMember < Window_PartyFormMember
  971.   #--------------------------------------------------------------------------
  972.   # ● オブジェクト初期化
  973.   #--------------------------------------------------------------------------
  974.   def initialize
  975.     super(0, 0, 64, 64)
  976.     restore_member_list
  977.     @item_max = $game_party.all_members.size

  978.     # 各種サイズ計算
  979.     column_width = DRAW_SIZE[0] + @spacing
  980.     sw = [@item_max * column_width + 32, Graphics.width].min
  981.     @column_max = (sw - 32) / column_width
  982.     sh = ([@item_max - 1, 0].max / @column_max + 1) * DRAW_SIZE[1] + 32
  983.     sh = [sh, DRAW_SIZE[1] * KGC::LargeParty::PARTY_MEMBER_WINDOW_ROW_MAX + 32].min

  984.     # 座標・サイズ調整
  985.     self.y += DRAW_SIZE[1] + 32
  986.     self.width = sw
  987.     self.height = sh

  988.     create_contents
  989.     refresh
  990.     self.active = false
  991.     self.index = 0
  992.   end
  993.   #--------------------------------------------------------------------------
  994.   # ○ 選択しているアクターのインデックス取得
  995.   #--------------------------------------------------------------------------
  996.   def actor_index
  997.     return @index_offset + self.index
  998.   end
  999.   #--------------------------------------------------------------------------
  1000.   # ○ メンバーリスト修復
  1001.   #--------------------------------------------------------------------------
  1002.   def restore_member_list
  1003.     if KGC::LargeParty::SHOW_BATTLE_MEMBER_IN_PARTY
  1004.       @actors = $game_party.all_members
  1005.       @index_offset = 0
  1006.     else
  1007.       @actors = $game_party.stand_by_members
  1008.       @index_offset = $game_party.battle_members.size
  1009.     end
  1010.   end
  1011.   #--------------------------------------------------------------------------
  1012.   # ○ メンバー描画
  1013.   #--------------------------------------------------------------------------
  1014.   def draw_member
  1015.     @item_max.times { |i|
  1016.       actor = @actors[i]
  1017.       if actor == nil
  1018.         draw_empty_actor(i)
  1019.         next
  1020.       end

  1021.       if $game_party.actor_fixed?(actor.id)
  1022.         draw_fixed_back(i)
  1023.       end
  1024.       rect = item_rect(i)
  1025.       opacity = ($game_party.battle_members.include?(actor) ? 96 : 255)
  1026.       draw_actor_graphic(actor,
  1027.         rect.x + DRAW_SIZE[0] / 2,
  1028.         rect.y + DRAW_SIZE[1] - 4,
  1029.         opacity)
  1030.     }
  1031.   end
  1032.   #--------------------------------------------------------------------------
  1033.   # ● アクターの歩行グラフィック描画
  1034.   #     actor   : アクター
  1035.   #     x       : 描画先 X 座標
  1036.   #     y       : 描画先 Y 座標
  1037.   #     opacity : 不透明度
  1038.   #--------------------------------------------------------------------------
  1039.   def draw_actor_graphic(actor, x, y, opacity = 255)
  1040.     draw_character(actor.character_name, actor.character_index, x, y, opacity)
  1041.   end
  1042.   #--------------------------------------------------------------------------
  1043.   # ● 歩行グラフィックの描画
  1044.   #     character_name  : 歩行グラフィック ファイル名
  1045.   #     character_index : 歩行グラフィック インデックス
  1046.   #     x               : 描画先 X 座標
  1047.   #     y               : 描画先 Y 座標
  1048.   #     opacity         : 不透明度
  1049.   #--------------------------------------------------------------------------
  1050.   def draw_character(character_name, character_index, x, y, opacity = 255)
  1051.     return if character_name == nil
  1052.     bitmap = Cache.character(character_name)
  1053.     sign = character_name[/^[\!\$]./]
  1054.     if sign != nil and sign.include?('谢谢各位大大了··第一次发帖子···所以木有奖励··非常对不住)
  1055.       cw = bitmap.width / 3
  1056.       ch = bitmap.height / 4
  1057.     else
  1058.       cw = bitmap.width / 12
  1059.       ch = bitmap.height / 8
  1060.     end
  1061.     n = character_index
  1062.     src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  1063.     self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
  1064.   end
  1065.   #--------------------------------------------------------------------------
  1066.   # ○ 空欄アクター描画
  1067.   #     index : 項目番号
  1068.   #--------------------------------------------------------------------------
  1069.   def draw_empty_actor(index)
  1070.     rect = item_rect(index)
  1071.     self.contents.font.color = system_color
  1072.     self.contents.draw_text(rect, KGC::LargeParty::PARTY_MEMBER_BLANK_TEXT, 1)
  1073.     self.contents.font.color = normal_color
  1074.   end
  1075. end

  1076. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  1077. #==============================================================================
  1078. # □ Window_PartyFormStatus
  1079. #------------------------------------------------------------------------------
  1080. #  パーティ編成画面でアクターのステータスを表示するウィンドウです。
  1081. #==============================================================================

  1082. class Window_PartyFormStatus < Window_Base
  1083.   #--------------------------------------------------------------------------
  1084.   # ● オブジェクト初期化
  1085.   #--------------------------------------------------------------------------
  1086.   def initialize
  1087.     super(0, 0, 384, 128)
  1088.     self.z = 1000
  1089.     @actor = nil
  1090.     refresh
  1091.   end
  1092.   #--------------------------------------------------------------------------
  1093.   # ○ アクター設定
  1094.   #--------------------------------------------------------------------------
  1095.   def set_actor(actor)
  1096.     if @actor != actor
  1097.       @actor = actor
  1098.       refresh
  1099.     end
  1100.   end
  1101.   #--------------------------------------------------------------------------
  1102.   # ● リフレッシュ
  1103.   #--------------------------------------------------------------------------
  1104.   def refresh
  1105.     self.contents.clear
  1106.     if @actor == nil
  1107.       return
  1108.     end

  1109.     draw_actor_face(@actor, 0, 0)
  1110.     dx = 104
  1111.     draw_actor_name(@actor, dx, 0)
  1112.     draw_actor_level(@actor, dx, WLH * 1)
  1113.     draw_actor_hp(@actor, dx, WLH * 2)
  1114.     draw_actor_mp(@actor, dx, WLH * 3)
  1115.     4.times { |i|
  1116.       draw_actor_parameter(@actor, dx + 128, WLH * i, i, 120)
  1117.     }
  1118.   end
  1119.   #--------------------------------------------------------------------------
  1120.   # ● 能力値の描画
  1121.   #     actor : アクター
  1122.   #     x     : 描画先 X 座標
  1123.   #     y     : 描画先 Y 座標
  1124.   #     type  : 能力値の種類 (0~3)
  1125.   #     width : 描画幅
  1126.   #--------------------------------------------------------------------------
  1127.   def draw_actor_parameter(actor, x, y, type, width = 156)
  1128.     case type
  1129.     when 0
  1130.       parameter_name = Vocab::atk
  1131.       parameter_value = actor.atk
  1132.     when 1
  1133.       parameter_name = Vocab::def
  1134.       parameter_value = actor.def
  1135.     when 2
  1136.       parameter_name = Vocab::spi
  1137.       parameter_value = actor.spi
  1138.     when 3
  1139.       parameter_name = Vocab::agi
  1140.       parameter_value = actor.agi
  1141.     end
  1142.     nw = width - 36
  1143.     self.contents.font.color = system_color
  1144.     self.contents.draw_text(x, y, nw, WLH, parameter_name)
  1145.     self.contents.font.color = normal_color
  1146.     self.contents.draw_text(x + nw, y, 36, WLH, parameter_value, 2)
  1147.   end
  1148. end

  1149. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  1150. #==============================================================================
  1151. # □ Window_PartyFormControl
  1152. #------------------------------------------------------------------------------
  1153. #  パーティ編成画面で操作方法を表示するウィンドウです。
  1154. #==============================================================================

  1155. class Window_PartyFormControl < Window_Base
  1156.   #--------------------------------------------------------------------------
  1157.   # ○ 定数
  1158.   #--------------------------------------------------------------------------
  1159.   MODE_BATTLE_MEMBER = 0
  1160.   MODE_SHIFT_CHANGE  = 1
  1161.   MODE_PARTY_MEMBER  = 2
  1162.   #--------------------------------------------------------------------------
  1163.   # ● オブジェクト初期化
  1164.   #--------------------------------------------------------------------------
  1165.   def initialize
  1166.     super(0, 0, Graphics.width - 384, 128)
  1167.     self.z = 1000
  1168.     @mode = MODE_BATTLE_MEMBER
  1169.     refresh
  1170.   end
  1171.   #--------------------------------------------------------------------------
  1172.   # ○ モード変更
  1173.   #--------------------------------------------------------------------------
  1174.   def mode=(value)
  1175.     @mode = value
  1176.     refresh
  1177.   end
  1178.   #--------------------------------------------------------------------------
  1179.   # ● リフレッシュ
  1180.   #--------------------------------------------------------------------------
  1181.   def refresh
  1182.     self.contents.clear
  1183.     case @mode
  1184.     when MODE_BATTLE_MEMBER  # 戦闘メンバー
  1185.       buttons = [
  1186.         "X   : 结束",
  1187.         "Z   : 决定",
  1188.         "空格: 等待人物",
  1189.               ]
  1190.     when MODE_SHIFT_CHANGE   # 並び替え
  1191.       buttons = [
  1192.         "X   : 取消",
  1193.         "Z   : 决定"
  1194.       ]
  1195.     when MODE_PARTY_MEMBER   # パーティメンバー
  1196.       buttons = [
  1197.         "X: 取消",
  1198.         "Z: 决定"
  1199.       ]
  1200.     else
  1201.       return
  1202.     end

  1203.     buttons.each_with_index { |c, i|
  1204.       self.contents.draw_text(0, WLH * i, width - 32, WLH, c)
  1205.     }
  1206.   end
  1207. end

  1208. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  1209. #==============================================================================
  1210. # ■ Scene_Title
  1211. #==============================================================================

  1212. class Scene_Title < Scene_Base
  1213.   #--------------------------------------------------------------------------
  1214.   # ● 各種ゲームオブジェクトの作成
  1215.   #--------------------------------------------------------------------------
  1216.   alias create_game_objects_KGC_LargeParty create_game_objects
  1217.   def create_game_objects
  1218.     create_game_objects_KGC_LargeParty

  1219.     if KGC::LargeParty::DEFAULT_PARTYFORM_ENABLED
  1220.       $game_switches[KGC::LargeParty::PARTYFORM_SWITCH] = true
  1221.       $game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH] = true
  1222.     end
  1223.   end
  1224. end

  1225. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  1226. #==============================================================================
  1227. # ■ Scene_Map
  1228. #==============================================================================

  1229. class Scene_Map < Scene_Base
  1230.   #--------------------------------------------------------------------------
  1231.   # ● 画面切り替えの実行
  1232.   #--------------------------------------------------------------------------
  1233.   alias update_scene_change_KGC_LargeParty update_scene_change
  1234.   def update_scene_change
  1235.     return if $game_player.moving?    # プレイヤーの移動中?

  1236.     if $game_temp.next_scene == :partyform
  1237.       call_partyform
  1238.       return
  1239.     end

  1240.     update_scene_change_KGC_LargeParty
  1241.   end
  1242.   #--------------------------------------------------------------------------
  1243.   # ○ パーティ編成画面への切り替え
  1244.   #--------------------------------------------------------------------------
  1245.   def call_partyform
  1246.     $game_temp.next_scene = nil
  1247.     $scene = Scene_PartyForm.new(0, Scene_PartyForm::HOST_MAP)
  1248.   end
  1249. end

  1250. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  1251. #==============================================================================
  1252. # ■ Scene_Menu
  1253. #==============================================================================

  1254. class Scene_Menu < Scene_Base
  1255.   if KGC::LargeParty::USE_MENU_PARTYFORM_COMMAND
  1256.   #--------------------------------------------------------------------------
  1257.   # ● コマンドウィンドウの作成
  1258.   #--------------------------------------------------------------------------
  1259.   alias create_command_window_KGC_LargeParty create_command_window
  1260.   def create_command_window
  1261.     create_command_window_KGC_LargeParty

  1262.     return if $imported["CustomMenuCommand"]

  1263.     @__command_partyform_index =
  1264.       @command_window.add_command(Vocab.partyform)
  1265.     @command_window.draw_item(@__command_partyform_index,
  1266.       $game_party.partyform_enable?)
  1267.     if @command_window.oy > 0
  1268.       @command_window.oy -= Window_Base::WLH
  1269.     end
  1270.     @command_window.index = @menu_index
  1271.   end
  1272.   end
  1273.   #--------------------------------------------------------------------------
  1274.   # ● コマンド選択の更新
  1275.   #--------------------------------------------------------------------------
  1276.   alias update_command_selection_KGC_LargeParty update_command_selection
  1277.   def update_command_selection
  1278.     current_menu_index = @__command_partyform_index
  1279.     call_partyform_flag = false

  1280.     if Input.trigger?(Input::C)
  1281.       case @command_window.index
  1282.       when @__command_partyform_index  # パーティ編成
  1283.         call_partyform_flag = true
  1284.       end
  1285.     # パーティ編成ボタン押下
  1286.     elsif KGC::LargeParty::MENU_PARTYFORM_BUTTON != nil &&
  1287.         Input.trigger?(KGC::LargeParty::MENU_PARTYFORM_BUTTON)
  1288.       call_partyform_flag = true
  1289.       current_menu_index = @command_window.index if current_menu_index == nil
  1290.     end

  1291.     # パーティ編成画面に移行
  1292.     if call_partyform_flag
  1293.       if $game_party.members.size == 0 || !$game_party.partyform_enable?
  1294.         Sound.play_buzzer
  1295.         return
  1296.       end
  1297.       Sound.play_decision
  1298.       $scene = Scene_PartyForm.new(current_menu_index)
  1299.       return
  1300.     end

  1301.     update_command_selection_KGC_LargeParty
  1302.   end
  1303. end

  1304. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  1305. #==============================================================================
  1306. # ■ Scene_Shop
  1307. #==============================================================================

  1308. unless $imported["HelpExtension"]
  1309. class Scene_Shop < Scene_Base
  1310.   #--------------------------------------------------------------------------
  1311.   # ● フレーム更新
  1312.   #--------------------------------------------------------------------------
  1313.   alias udpate_KGC_LargeParty update
  1314.   def update
  1315.     # スクロール判定
  1316.     if !@command_window.active &&
  1317.         KGC::LargeParty::SHOP_STATUS_SCROLL_BUTTON != nil &&
  1318.         Input.press?(KGC::LargeParty::SHOP_STATUS_SCROLL_BUTTON)
  1319.       super
  1320.       update_menu_background
  1321.       update_scroll_status
  1322.       return
  1323.     else
  1324.       @status_window.cursor_rect.empty
  1325.     end

  1326.     udpate_KGC_LargeParty
  1327.   end
  1328.   #--------------------------------------------------------------------------
  1329.   # ○ ステータスウィンドウのスクロール処理
  1330.   #--------------------------------------------------------------------------
  1331.   def update_scroll_status
  1332.     # ステータスウィンドウにカーソルを表示
  1333.     @status_window.cursor_rect.width = @status_window.contents.width
  1334.     @status_window.cursor_rect.height = @status_window.height - 32
  1335.     @status_window.update

  1336.     if Input.press?(Input::UP)
  1337.       @status_window.oy = [@status_window.oy - 4, 0].max
  1338.     elsif Input.press?(Input::DOWN)
  1339.       max_pos = [@status_window.contents.height -
  1340.         (@status_window.height - 32), 0].max
  1341.       @status_window.oy = [@status_window.oy + 4, max_pos].min
  1342.     end
  1343.   end
  1344. end
  1345. end

  1346. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  1347. #==============================================================================
  1348. # □ Scene_PartyForm
  1349. #------------------------------------------------------------------------------
  1350. #  パーティ編成画面の処理を行うクラスです。
  1351. #==============================================================================

  1352. class Scene_PartyForm < Scene_Base
  1353.   #--------------------------------------------------------------------------
  1354.   # ○ 定数
  1355.   #--------------------------------------------------------------------------
  1356.   CAPTION_OFFSET = 40  # キャプションウィンドウの位置補正
  1357.   HOST_MENU   = 0      # 呼び出し元 : メニュー
  1358.   HOST_MAP    = 1      # 呼び出し元 : マップ
  1359.   HOST_BATTLE = 2      # 呼び出し元 : 戦闘
  1360.   #--------------------------------------------------------------------------
  1361.   # ● オブジェクト初期化
  1362.   #     menu_index : コマンドのカーソル初期位置
  1363.   #     host_scene : 呼び出し元 (0..メニュー  1..マップ  2..戦闘)
  1364.   #--------------------------------------------------------------------------
  1365.   def initialize(menu_index = 0, host_scene = HOST_MENU)
  1366.     @menu_index = menu_index
  1367.     @host_scene = host_scene
  1368.   end
  1369.   #--------------------------------------------------------------------------
  1370.   # ● 開始処理
  1371.   #--------------------------------------------------------------------------
  1372.   def start
  1373.     super
  1374.     create_menu_background

  1375.     create_windows
  1376.     create_confirm_window
  1377.     adjust_window_location

  1378.     # 編成前のパーティを保存
  1379.     @battle_actors = $game_party.battle_members.dup
  1380.     @party_actors = $game_party.all_members.dup
  1381.   end
  1382.   #--------------------------------------------------------------------------
  1383.   # ○ ウィンドウの作成
  1384.   #--------------------------------------------------------------------------
  1385.   def create_windows
  1386.     # 編成用ウィンドウを作成
  1387.     @battle_member_window = Window_PartyFormBattleMember.new
  1388.     @party_member_window = Window_PartyFormAllMember.new
  1389.     @status_window = Window_PartyFormStatus.new
  1390.     @status_window.set_actor(@battle_member_window.actor)

  1391.     # その他のウィンドウを作成
  1392.     @battle_member_caption_window =
  1393.       Window_PartyFormCaption.new(KGC::LargeParty::BATTLE_MEMBER_CAPTION)
  1394.     @party_member_caption_window =
  1395.       Window_PartyFormCaption.new(KGC::LargeParty::PARTY_MEMBER_CAPTION)
  1396.     @control_window = Window_PartyFormControl.new
  1397.   end
  1398.   #--------------------------------------------------------------------------
  1399.   # ○ 確認ウィンドウの作成
  1400.   #--------------------------------------------------------------------------
  1401.   def create_confirm_window
  1402.     commands = KGC::LargeParty::CONFIRM_WINDOW_COMMANDS
  1403.     @confirm_window =
  1404.       Window_Command.new(KGC::LargeParty::CONFIRM_WINDOW_WIDTH, commands)
  1405.     @confirm_window.index = 0
  1406.     @confirm_window.openness = 0
  1407.     @confirm_window.active = false
  1408.   end
  1409.   #--------------------------------------------------------------------------
  1410.   # ○ ウィンドウの座標調整
  1411.   #--------------------------------------------------------------------------
  1412.   def adjust_window_location
  1413.     # 基準座標を計算
  1414.     base_x = [@battle_member_window.width, @party_member_window.width].max
  1415.     base_x = [(Graphics.width - base_x) / 2, 0].max
  1416.     base_y = @battle_member_window.height + @party_member_window.height +
  1417.       @status_window.height + CAPTION_OFFSET * 2
  1418.     base_y = [(Graphics.height - base_y) / 2, 0].max
  1419.     base_z = @menuback_sprite.z + 1000

  1420.     # 編成用ウィンドウの座標をセット
  1421.     @battle_member_window.x = base_x
  1422.     @battle_member_window.y = base_y + CAPTION_OFFSET
  1423.     @battle_member_window.z = base_z
  1424.     @party_member_window.x = base_x
  1425.     @party_member_window.y = @battle_member_window.y +
  1426.       @battle_member_window.height + CAPTION_OFFSET
  1427.     @party_member_window.z = base_z
  1428.     @status_window.x = 0
  1429.     @status_window.y = @party_member_window.y + @party_member_window.height
  1430.     @status_window.z = base_z

  1431.     # その他のウィンドウの座標をセット
  1432.     @battle_member_caption_window.x = [base_x - 16, 0].max
  1433.     @battle_member_caption_window.y = @battle_member_window.y - CAPTION_OFFSET
  1434.     @battle_member_caption_window.z = base_z + 500
  1435.     @party_member_caption_window.x = [base_x - 16, 0].max
  1436.     @party_member_caption_window.y = @party_member_window.y - CAPTION_OFFSET
  1437.     @party_member_caption_window.z = base_z + 500
  1438.     @control_window.x = @status_window.width
  1439.     @control_window.y = @status_window.y
  1440.     @control_window.z = base_z

  1441.     @confirm_window.x = (Graphics.width - @confirm_window.width) / 2
  1442.     @confirm_window.y = (Graphics.height - @confirm_window.height) / 2
  1443.     @confirm_window.z = base_z + 1000
  1444.   end
  1445.   #--------------------------------------------------------------------------
  1446.   # ● 終了処理
  1447.   #--------------------------------------------------------------------------
  1448.   def terminate
  1449.     super
  1450.     dispose_menu_background
  1451.     @battle_member_window.dispose
  1452.     @party_member_window.dispose
  1453.     @status_window.dispose
  1454.     @battle_member_caption_window.dispose
  1455.     @party_member_caption_window.dispose
  1456.     @control_window.dispose
  1457.     @confirm_window.dispose
  1458.   end
  1459.   #--------------------------------------------------------------------------
  1460.   # ● メニュー画面系の背景作成
  1461.   #--------------------------------------------------------------------------
  1462.   def create_menu_background
  1463.     super
  1464.     @menuback_sprite.z = 20000
  1465.   end
  1466.   #--------------------------------------------------------------------------
  1467.   # ● 元の画面へ戻る
  1468.   #--------------------------------------------------------------------------
  1469.   def return_scene
  1470.     case @host_scene
  1471.     when HOST_MENU
  1472.       $scene = Scene_Menu.new(@menu_index)
  1473.     when HOST_MAP
  1474.       $scene = Scene_Map.new
  1475.     when HOST_BATTLE
  1476.       $scene = Scene_Battle.new
  1477.     end
  1478.     $game_player.refresh
  1479.   end
  1480.   #--------------------------------------------------------------------------
  1481.   # ● フレーム更新
  1482.   #--------------------------------------------------------------------------
  1483.   def update
  1484.     super
  1485.     update_menu_background
  1486.     update_window
  1487.     if @battle_member_window.active
  1488.       update_battle_member
  1489.     elsif @party_member_window.active
  1490.       update_party_member
  1491.     elsif @confirm_window.active
  1492.       update_confirm
  1493.     end
  1494.   end
  1495.   #--------------------------------------------------------------------------
  1496.   # ○ ウィンドウ更新
  1497.   #--------------------------------------------------------------------------
  1498.   def update_window
  1499.     @battle_member_window.update
  1500.     @party_member_window.update
  1501.     @status_window.update
  1502.     @battle_member_caption_window.update
  1503.     @party_member_caption_window.update
  1504.     @control_window.update
  1505.     @confirm_window.update
  1506.   end
  1507.   #--------------------------------------------------------------------------
  1508.   # ○ ウィンドウ再描画
  1509.   #--------------------------------------------------------------------------
  1510.   def refresh_window
  1511.     @battle_member_window.refresh
  1512.     @party_member_window.refresh
  1513.   end
  1514.   #--------------------------------------------------------------------------
  1515.   # ○ フレーム更新 (戦闘メンバーウィンドウがアクティブの場合)
  1516.   #--------------------------------------------------------------------------
  1517.   def update_battle_member
  1518.     @status_window.set_actor(@battle_member_window.actor)
  1519.     if Input.trigger?(Input::A)
  1520.       if @battle_member_window.selected_index == nil  # 並び替え中でない
  1521.         actor = @battle_member_window.actor
  1522.         # アクターを外せない場合
  1523.         if actor == nil || $game_party.actor_fixed?(actor.id)
  1524.           Sound.play_buzzer
  1525.           return
  1526.         end
  1527.         # アクターを外す
  1528.         Sound.play_decision
  1529.         actors = $game_party.battle_members
  1530.         actors.delete_at(@battle_member_window.index)
  1531.         $game_party.set_battle_member(actors)
  1532.         refresh_window
  1533.       end
  1534.     elsif Input.trigger?(Input::B)
  1535.       if @battle_member_window.selected_index == nil  # 並び替え中でない
  1536.         # 確認ウィンドウに切り替え
  1537.         Sound.play_cancel
  1538.         show_confirm_window
  1539.       else                                            # 並び替え中
  1540.         # 並び替え解除
  1541.         Sound.play_cancel
  1542.         @battle_member_window.selected_index = nil
  1543.         @battle_member_window.refresh
  1544.         @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  1545.       end
  1546.     elsif Input.trigger?(Input::C)
  1547.       if @battle_member_window.selected_index == nil  # 並び替え中でない
  1548.         actor = @battle_member_window.actor
  1549.         # アクターを外せない場合
  1550.         if actor != nil && $game_party.actor_fixed?(actor.id)
  1551.           Sound.play_buzzer
  1552.           return
  1553.         end
  1554.         # パーティメンバーウィンドウに切り替え
  1555.         Sound.play_decision
  1556.         @battle_member_window.active = false
  1557.         @party_member_window.active = true
  1558.         @control_window.mode = Window_PartyFormControl::MODE_PARTY_MEMBER
  1559.       else                                            # 並び替え中
  1560.         unless can_change_shift?(@battle_member_window.actor)
  1561.           Sound.play_buzzer
  1562.           return
  1563.         end
  1564.         # 並び替え実行
  1565.         Sound.play_decision
  1566.         index1 = @battle_member_window.selected_index
  1567.         index2 = @battle_member_window.index
  1568.         change_shift(index1, index2)
  1569.         @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  1570.       end
  1571.     elsif Input.trigger?(Input::X)
  1572.       # 並び替え不可能な場合
  1573.       unless can_change_shift?(@battle_member_window.actor)
  1574.         Sound.play_buzzer
  1575.         return
  1576.       end
  1577.       if @battle_member_window.selected_index == nil  # 並び替え中でない
  1578.         # 並び替え開始
  1579.         Sound.play_decision
  1580.         @battle_member_window.selected_index = @battle_member_window.index
  1581.         @battle_member_window.refresh
  1582.         @control_window.mode = Window_PartyFormControl::MODE_SHIFT_CHANGE
  1583.       else                                            # 並び替え中
  1584.         # 並び替え実行
  1585.         Sound.play_decision
  1586.         index1 = @battle_member_window.selected_index
  1587.         index2 = @battle_member_window.index
  1588.         change_shift(index1, index2)
  1589.         @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  1590.       end
  1591.     end
  1592.   end
  1593.   #--------------------------------------------------------------------------
  1594.   # ○ 並び替え可否判定
  1595.   #--------------------------------------------------------------------------
  1596.   def can_change_shift?(actor)
  1597.     # 選択したアクターが存在しない、または並び替え不能な場合
  1598.     if actor == nil ||
  1599.         (KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED &&
  1600.          $game_party.actor_fixed?(actor.id))
  1601.       return false
  1602.     end
  1603.     return true
  1604.   end
  1605.   #--------------------------------------------------------------------------
  1606.   # ○ 並び替え
  1607.   #--------------------------------------------------------------------------
  1608.   def change_shift(index1, index2)
  1609.     # 位置を入れ替え
  1610.     $game_party.change_shift(index1, index2)
  1611.     # 選択済みインデックスをクリア
  1612.     @battle_member_window.selected_index = nil
  1613.     refresh_window
  1614.   end
  1615.   #--------------------------------------------------------------------------
  1616.   # ○ フレーム更新 (パーティウィンドウがアクティブの場合)
  1617.   #--------------------------------------------------------------------------
  1618.   def update_party_member
  1619.     @status_window.set_actor(@party_member_window.actor)
  1620.     if Input.trigger?(Input::B)
  1621.       Sound.play_cancel
  1622.       # 戦闘メンバーウィンドウに切り替え
  1623.       @battle_member_window.active = true
  1624.       @party_member_window.active = false
  1625.         @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  1626.     elsif Input.trigger?(Input::C)
  1627.       actor = @party_member_window.actor
  1628.       # アクターが戦闘メンバーに含まれる場合
  1629.       if $game_party.battle_members.include?(actor)
  1630.         Sound.play_buzzer
  1631.         return
  1632.       end
  1633.       # アクターを入れ替え
  1634.       Sound.play_decision
  1635.       actors = $game_party.all_members
  1636.       battle_actors = $game_party.battle_members
  1637.       if @battle_member_window.actor != nil
  1638.         actors[@party_member_window.actor_index] = @battle_member_window.actor
  1639.         actors[@battle_member_window.index] = actor
  1640.         $game_party.set_member(actors.compact)
  1641.       end
  1642.       battle_actors[@battle_member_window.index] = actor
  1643.       $game_party.set_battle_member(battle_actors.compact)
  1644.       refresh_window
  1645.       # 戦闘メンバーウィンドウに切り替え
  1646.       @battle_member_window.active = true
  1647.       @party_member_window.active = false
  1648.       @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  1649.     end
  1650.   end
  1651.   #--------------------------------------------------------------------------
  1652.   # ○ フレーム更新 (確認ウィンドウがアクティブの場合)
  1653.   #--------------------------------------------------------------------------
  1654.   def update_confirm
  1655.     if Input.trigger?(Input::B)
  1656.       Sound.play_cancel
  1657.       hide_confirm_window
  1658.     elsif Input.trigger?(Input::C)
  1659.       case @confirm_window.index
  1660.       when 0  # 編成完了
  1661.         # パーティが無効の場合
  1662.         unless battle_member_valid?
  1663.           Sound.play_buzzer
  1664.           return
  1665.         end
  1666.         Sound.play_decision
  1667.         return_scene
  1668.       when 1  # 編成中断
  1669.         Sound.play_decision
  1670.         # パーティを編成前の状態に戻す
  1671.         $game_party.set_member(@party_actors)
  1672.         $game_party.set_battle_member(@battle_actors)
  1673.         return_scene
  1674.       when 2  # キャンセル
  1675.         Sound.play_cancel
  1676.         hide_confirm_window
  1677.       end
  1678.     end
  1679.   end
  1680.   #--------------------------------------------------------------------------
  1681.   # ○ 戦闘メンバー有効判定
  1682.   #--------------------------------------------------------------------------
  1683.   def battle_member_valid?
  1684.     return false if $game_party.battle_members.size == 0  # 戦闘メンバーが空
  1685.     $game_party.battle_members.each { |actor|
  1686.       return true if actor.exist?  # 生存者がいればOK
  1687.     }
  1688.     return false
  1689.   end
  1690.   #--------------------------------------------------------------------------
  1691.   # ○ 確認ウィンドウの表示
  1692.   #--------------------------------------------------------------------------
  1693.   def show_confirm_window
  1694.     if @battle_member_window.active
  1695.       @last_active_window = @battle_member_window
  1696.     else
  1697.       @last_active_window = @party_member_window
  1698.     end
  1699.     @battle_member_window.active = false
  1700.     @party_member_window.active = false

  1701.     @confirm_window.draw_item(0, battle_member_valid?)
  1702.     @confirm_window.open
  1703.     @confirm_window.active = true
  1704.   end
  1705.   #--------------------------------------------------------------------------
  1706.   # ○ 確認ウィンドウの非表示
  1707.   #--------------------------------------------------------------------------
  1708.   def hide_confirm_window
  1709.     @confirm_window.active = false
  1710.     @confirm_window.close
  1711.     @last_active_window.active = true
  1712.   end
  1713. end

  1714. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  1715. #==============================================================================
  1716. # ■ Scene_Battle
  1717. #==============================================================================

  1718. class Scene_Battle < Scene_Base
  1719.   #--------------------------------------------------------------------------
  1720.   # ● メッセージ表示が終わるまでウェイト
  1721.   #--------------------------------------------------------------------------
  1722.   alias wait_for_message_KGC_LargeParty wait_for_message
  1723.   def wait_for_message
  1724.     return if @ignore_wait_for_message  # メッセージ終了までのウェイトを無視

  1725.     wait_for_message_KGC_LargeParty
  1726.   end
  1727.   #--------------------------------------------------------------------------
  1728.   # ● レベルアップの表示
  1729.   #--------------------------------------------------------------------------
  1730.   alias display_level_up_KGC_LargeParty display_level_up
  1731.   def display_level_up
  1732.     @ignore_wait_for_message = true

  1733.     display_level_up_KGC_LargeParty

  1734.     exp = $game_troop.exp_total * KGC::LargeParty::STAND_BY_EXP_RATE / 1000
  1735.     $game_party.stand_by_members.each { |actor|
  1736.       if actor.exist?
  1737.         actor.gain_exp(exp, KGC::LargeParty::SHOW_STAND_BY_LEVEL_UP)
  1738.       end
  1739.     }
  1740.     @ignore_wait_for_message = false
  1741.     wait_for_message
  1742.   end
  1743.   #--------------------------------------------------------------------------
  1744.   # ● パーティコマンド選択の開始
  1745.   #--------------------------------------------------------------------------
  1746.   alias start_party_command_selection_KGC_LargeParty start_party_command_selection
  1747.   def start_party_command_selection
  1748.     if $game_temp.in_battle
  1749.       @status_window.index = 0
  1750.     end

  1751.     start_party_command_selection_KGC_LargeParty
  1752.   end

  1753.   if KGC::LargeParty::USE_BATTLE_PARTYFORM
  1754.   #--------------------------------------------------------------------------
  1755.   # ● 情報表示ビューポートの作成
  1756.   #--------------------------------------------------------------------------
  1757.   alias create_info_viewport_KGC_LargeParty create_info_viewport
  1758.   def create_info_viewport
  1759.     create_info_viewport_KGC_LargeParty

  1760.     @__command_partyform_index =
  1761.       @party_command_window.add_command(Vocab.partyform_battle)
  1762.     @party_command_window.draw_item(@__command_partyform_index,
  1763.       $game_party.battle_partyform_enable?)
  1764.   end
  1765.   #--------------------------------------------------------------------------
  1766.   # ● パーティコマンド選択の更新
  1767.   #--------------------------------------------------------------------------
  1768.   alias update_party_command_selection_KGC_LargeParty update_party_command_selection
  1769.   def update_party_command_selection
  1770.     if Input.trigger?(Input::C)
  1771.       case @party_command_window.index
  1772.       when @__command_partyform_index  # パーティ編成
  1773.         unless $game_party.battle_partyform_enable?
  1774.           Sound.play_buzzer
  1775.           return
  1776.         end
  1777.         Sound.play_decision
  1778.         process_partyform
  1779.         return
  1780.       end
  1781.     end

  1782.     update_party_command_selection_KGC_LargeParty
  1783.   end
  1784.   #--------------------------------------------------------------------------
  1785.   # ○ パーティ編成の処理
  1786.   #--------------------------------------------------------------------------
  1787.   def process_partyform
  1788.     Graphics.freeze
  1789.     snapshot_for_background
  1790.     $scene = Scene_PartyForm.new(0, Scene_PartyForm::HOST_BATTLE)
  1791.     $scene.main
  1792.     $scene = self
  1793.     @status_window.refresh
  1794.     perform_transition
  1795.   end
  1796.   end
  1797. end
复制代码
谢谢各位大大了··第一次发帖子···所以木有奖励··非常对不住

点评

hcm
对不起,刚才好像是我的浏览器O了,现在好了一点,但仍建议用[code]……[/code]。  发表于 2012-4-16 12:24
hcm
拜托,太乱了吧,麻烦整理的好一些。建议使用[code]……[/code]。  发表于 2012-4-16 12:22
坑坑坑坑坑坑坑坑坑坑坑坑坑坑坑
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-3 06:31

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表