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

Project1

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

[已经解决] 如何在KGC多人脚本里设定强制出击角色?

[复制链接]

Lv2.观梦者

梦石
0
星屑
628
在线时间
2656 小时
注册时间
2010-6-28
帖子
1361

开拓者

跳转到指定楼层
1
发表于 2011-1-14 12:31:14 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 我的米呀 于 2011-1-14 19:24 编辑

RT,另外补充问一下,怎样替换强制出击的角色。谢谢各位了。
  1. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  2. #_/    ◆ 多人数パーティ - KGC_LargeParty ◆ VX ◆
  3. #_/    ◇ Last update : 2009/11/01 ◇
  4. #_/----------------------------------------------------------------------------
  5. #_/  5人以上の大規模パーティを構築可能にします。
  6. #_/============================================================================
  7. #_/ 【特殊システム】≪パーティ編成画面2≫ より上に導入してください。
  8. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

  9. #==============================================================================
  10. # ★ カスタマイズ項目 - Customize BEGIN ★
  11. #==============================================================================

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

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

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

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

  41.   # ◆ パーティ編成ボタン (メニュー画面用)
  42.   #  メニュー画面でこのボタンを押すと、パーティ編成画面に移行します。
  43.   #  使用しない場合は nil
  44.   MENU_PARTYFORM_BUTTON      = Input::A
  45.   # ◆ メニュー画面にパーティ編成コマンドを追加する
  46.   #  追加する場所は、メニューコマンドの最下部です。
  47.   #  他の部分に追加したければ、≪カスタムメニューコマンド≫ をご利用ください。
  48.   USE_MENU_PARTYFORM_COMMAND = true
  49.   # ◆ メニュー画面のパーティ編成コマンドの名称
  50.   VOCAB_MENU_PARTYFORM       = "队伍编成"

  51.   # ◆ 戦闘中にパーティ編成コマンドを使用する
  52.   #  追加する場所は、パーティコマンドの最下部(「逃げる」の下)です。
  53.   USE_BATTLE_PARTYFORM   = true
  54.   # ◆ 戦闘中のパーティ編成コマンドの名称
  55.   VOCAB_BATTLE_PARTYFORM = "人物交替"

  56.   # ◆ 全滅時の自動出撃を使用する
  57.   #   true  : 入れ替え可能なら生存者が出撃 (戦闘中の編成を許可する必要あり)
  58.   #   false : 全滅したら終了
  59.   ENABLE_DEFEAT_LAUNCH  = true
  60.   # ◆ 全滅時の入れ替えメッセージ
  61.   #  %s : 出撃者名
  62.   DEFEAT_LAUNCH_MESSAGE = "%sが飛び出した!"

  63.   # ◆ 編成画面のキャラクター描画サイズ [幅, 高さ]
  64.   #  アクターの歩行グラフィックのサイズに応じて書き換えてください。
  65.   PARTY_FORM_CHARACTER_SIZE   = [40, 48]
  66.   # ◆ 編成画面の戦闘メンバーウィンドウの空欄に表示するテキスト
  67.   BATTLE_MEMBER_BLANK_TEXT    = "EMPTY"
  68.   # ◆ 編成画面のパーティメンバーウィンドウの最大行数
  69.   #  ステータスウィンドウが画面からはみ出る場合は、
  70.   #  この値を 1 にしてください。
  71.   PARTY_MEMBER_WINDOW_ROW_MAX = 2
  72.   # ◆ 編成画面のパーティメンバーウィンドウに戦闘メンバーを表示する
  73.   SHOW_BATTLE_MEMBER_IN_PARTY = false
  74.   # ◆ 編成画面のパーティメンバーウィンドウの空欄に表示するテキスト
  75.   PARTY_MEMBER_BLANK_TEXT     = "-"

  76.   # ◆ 編成画面のキャプションウィンドウの幅
  77.   CAPTION_WINDOW_WIDTH  = 192
  78.   # ◆ 編成画面の戦闘メンバーウィンドウのキャプション
  79.   BATTLE_MEMBER_CAPTION = "战斗人物"

  80.   if SHOW_BATTLE_MEMBER_IN_PARTY
  81.     # ◆ 編成画面のパーティメンバーウィンドウのキャプション
  82.     #  SHOW_BATTLE_MEMBER_IN_PARTY = true のとき
  83.     PARTY_MEMBER_CAPTION = "团队人物"
  84.   else
  85.     # ◆ 編成画面のパーティメンバーウィンドウのキャプション
  86.     #  SHOW_BATTLE_MEMBER_IN_PARTY = false のとき
  87.     PARTY_MEMBER_CAPTION = "待机人物"
  88.   end

  89.   # ◆ 編成確認ウィンドウの幅
  90.   CONFIRM_WINDOW_WIDTH    = 160
  91.   # ◆ 編成確認ウィンドウの文字列
  92.   #  ※コマンド数・順番を変更するとバグります。
  93.   CONFIRM_WINDOW_COMMANDS = ["编成确定", "编成中止", "取消"]

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

  99.   # ◆ 待機メンバー獲得経験値割合【単位:‰(千分率 1‰=0.1%)】
  100.   #  500 なら 50.0% です。
  101.   STAND_BY_EXP_RATE = 500
  102.   # ◆ リザルト画面で待機メンバーのレベルアップを表示する
  103.   #  true  : 待機メンバーのレベルアップを表示。
  104.   #  false : 戦闘メンバーのみ表示。
  105.   SHOW_STAND_BY_LEVEL_UP = true
  106.   # ◆ 戦闘以外でも待機メンバーを表示する
  107.   #  true  : 戦闘以外では常に全員を表示。
  108.   #  false : 入れ替え時以外は、待機メンバーをいないものとして扱う。
  109.   SHOW_STAND_BY_MEMBER_NOT_IN_BATTLE = true
  110. end
  111. end

  112. #==============================================================================
  113. # ☆ カスタマイズ項目終了 - Customize END ☆
  114. #==============================================================================

  115. $imported = {} if $imported == nil
  116. $imported["LargeParty"] = true

  117. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  118. #==============================================================================
  119. # □ KGC::Commands
  120. #==============================================================================

  121. module KGC
  122. module Commands
  123.   # メンバーのソート形式
  124.   SORT_BY_ID    = 0  # ID順
  125.   SORT_BY_NAME  = 1  # 名前順
  126.   SORT_BY_LEVEL = 2  # レベル順

  127.   module_function
  128.   #--------------------------------------------------------------------------
  129.   # ○ パーティ編成画面の呼び出し
  130.   #--------------------------------------------------------------------------
  131.   def call_partyform
  132.     return if $game_temp.in_battle
  133.     $game_temp.next_scene = :partyform
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # ○ 戦闘メンバー最大数を設定
  137.   #     value : 人数 (省略した場合はデフォルト値を使用)
  138.   #--------------------------------------------------------------------------
  139.   def set_max_battle_member_count(value = nil)
  140.     $game_party.max_battle_member_count = value
  141.   end
  142.   #--------------------------------------------------------------------------
  143.   # ○ 全メンバー数取得
  144.   #     variable_id : 取得した値を代入する変数の ID
  145.   #--------------------------------------------------------------------------
  146.   def get_all_member_count(variable_id = 0)
  147.     n = $game_party.all_members.size
  148.     if variable_id > 0
  149.       $game_variables[variable_id] = n
  150.       $game_map.need_refresh = true
  151.     end
  152.     return n
  153.   end
  154.   #--------------------------------------------------------------------------
  155.   # ○ 戦闘メンバー数取得
  156.   #     variable_id : 取得した値を代入する変数の ID
  157.   #--------------------------------------------------------------------------
  158.   def get_battle_member_count(variable_id = 0)
  159.     n = $game_party.battle_members.size
  160.     if variable_id > 0
  161.       $game_variables[variable_id] = n
  162.       $game_map.need_refresh = true
  163.     end
  164.     return n
  165.   end
  166.   #--------------------------------------------------------------------------
  167.   # ○ 待機メンバー数取得
  168.   #     variable_id : 取得した値を代入する変数の ID
  169.   #--------------------------------------------------------------------------
  170.   def get_stand_by_member_count(variable_id = 0)
  171.     n = $game_party.stand_by_members.size
  172.     if variable_id > 0
  173.       $game_variables[variable_id] = n
  174.       $game_map.need_refresh = true
  175.     end
  176.     return n
  177.   end
  178.   #--------------------------------------------------------------------------
  179.   # ○ パーティ人数が一杯か
  180.   #--------------------------------------------------------------------------
  181.   def party_full?
  182.     return $game_party.full?
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # ○ パーティ編成可否を設定
  186.   #     enabled : 有効フラグ (省略時 : true)
  187.   #--------------------------------------------------------------------------
  188.   def permit_partyform(enabled = true)
  189.     $game_switches[KGC::LargeParty::PARTYFORM_SWITCH] = enabled
  190.   end
  191.   #--------------------------------------------------------------------------
  192.   # ○ 戦闘中のパーティ編成可否を設定
  193.   #     enabled : 有効フラグ (省略時 : true)
  194.   #--------------------------------------------------------------------------
  195.   def permit_battle_partyform(enabled = true)
  196.     $game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH] = enabled
  197.   end
  198.   #--------------------------------------------------------------------------
  199.   # ○ アクターの固定状態を設定
  200.   #     actor_id : アクター ID
  201.   #     fixed    : 固定フラグ (省略時 : true)
  202.   #--------------------------------------------------------------------------
  203.   def fix_actor(actor_id, fixed = true)
  204.     $game_party.fix_actor(actor_id, fixed)
  205.   end
  206.   #--------------------------------------------------------------------------
  207.   # ○ 並び替え
  208.   #    メンバーの index1 番目と index2 番目を入れ替える
  209.   #--------------------------------------------------------------------------
  210.   def change_party_shift(index1, index2)
  211.     $game_party.change_shift(index1, index2)
  212.   end
  213.   #--------------------------------------------------------------------------
  214.   # ○ メンバー整列 (昇順)
  215.   #     sort_type : ソート形式 (SORT_BY_xxx)
  216.   #     reverse   : true だと降順
  217.   #--------------------------------------------------------------------------
  218.   def sort_party_member(sort_type = SORT_BY_ID, reverse = false)
  219.     $game_party.sort_member(sort_type, reverse)
  220.   end
  221.   #--------------------------------------------------------------------------
  222.   # ○ 待機メンバーの ID を取得
  223.   #--------------------------------------------------------------------------
  224.   def get_stand_by_member_ids
  225.     result = []
  226.     $game_party.stand_by_members.each { |actor| result << actor.id }
  227.     return result
  228.   end
  229.   #--------------------------------------------------------------------------
  230.   # ○ アクターが待機メンバーか
  231.   #     actor_id : アクター ID
  232.   #--------------------------------------------------------------------------
  233.   def stand_by_member?(actor_id)
  234.     return get_stand_by_member_ids.include?(actor_id)
  235.   end
  236.   #--------------------------------------------------------------------------
  237.   # ○ アクターを戦闘メンバーに加える
  238.   #     actor_id : アクター ID
  239.   #     index    : 追加位置 (省略時は最後尾)
  240.   #--------------------------------------------------------------------------
  241.   def add_battle_member(actor_id, index = nil)
  242.     $game_party.add_battle_member(actor_id, index)
  243.   end
  244.   #--------------------------------------------------------------------------
  245.   # ○ アクターを戦闘メンバーから外す
  246.   #     actor_id : アクター ID
  247.   #--------------------------------------------------------------------------
  248.   def remove_battle_member(actor_id)
  249.     $game_party.remove_battle_member(actor_id)
  250.   end
  251.   #--------------------------------------------------------------------------
  252.   # ○ 固定アクター以外を戦闘メンバーから外す
  253.   #--------------------------------------------------------------------------
  254.   def remove_all_battle_member
  255.     $game_party.remove_all_battle_member
  256.   end
  257.   #--------------------------------------------------------------------------
  258.   # ○ ランダム出撃
  259.   #--------------------------------------------------------------------------
  260.   def random_launch
  261.     new_battle_members = $game_party.fixed_members
  262.     candidates = $game_party.all_members - new_battle_members
  263.     num = [$game_party.max_battle_member_count - new_battle_members.size,
  264.       candidates.size].min
  265.     return if num <= 0

  266.     # ランダムに選ぶ
  267.     ary = (0...candidates.size).to_a.sort_by { rand }
  268.     ary[0...num].each { |i| new_battle_members << candidates[i] }
  269.     $game_party.set_battle_member(new_battle_members)
  270.   end
  271. end
  272. end

  273. class Game_Interpreter
  274.   include KGC::Commands
  275. end

  276. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  277. #==============================================================================
  278. # ■ Vocab
  279. #==============================================================================

  280. module Vocab
  281.   # 全滅時の入れ替えメッセージ
  282.   DefeatLaunch = KGC::LargeParty::DEFEAT_LAUNCH_MESSAGE

  283.   # 「パーティ編成」コマンド名 (メニュー)
  284.   def self.partyform
  285.     return KGC::LargeParty::VOCAB_MENU_PARTYFORM
  286.   end

  287.   # 「パーティ編成」コマンド名 (戦闘)
  288.   def self.partyform_battle
  289.     return KGC::LargeParty::VOCAB_BATTLE_PARTYFORM
  290.   end
  291. end

  292. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  293. #==============================================================================
  294. # ■ Game_Actor
  295. #==============================================================================

  296. class Game_Actor < Game_Battler
  297.   #--------------------------------------------------------------------------
  298.   # ○ パーティ内インデックス取得
  299.   #--------------------------------------------------------------------------
  300.   def party_index
  301.     return $game_party.all_members.index(self)
  302.   end
  303.   #--------------------------------------------------------------------------
  304.   # ○ 戦闘メンバーか判定
  305.   #--------------------------------------------------------------------------
  306.   def battle_member?
  307.     return $game_party.battle_members.include?(self)
  308.   end
  309.   #--------------------------------------------------------------------------
  310.   # ○ 固定メンバーか判定
  311.   #--------------------------------------------------------------------------
  312.   def fixed_member?
  313.     return $game_party.fixed_members.include?(self)
  314.   end
  315. end

  316. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  317. #==============================================================================
  318. # ■ Game_Party
  319. #==============================================================================

  320. class Game_Party
  321.   #--------------------------------------------------------------------------
  322.   # ● 定数
  323.   #--------------------------------------------------------------------------
  324.   MAX_MEMBERS = KGC::LargeParty::MAX_MEMBERS  # 最大パーティ人数
  325.   #--------------------------------------------------------------------------
  326.   # ● オブジェクト初期化
  327.   #--------------------------------------------------------------------------
  328.   alias initialize_KGC_LargeParty initialize
  329.   def initialize
  330.     initialize_KGC_LargeParty

  331.     @max_battle_member_count = nil
  332.     @battle_member_count = 0
  333.     @fixed_actors = []
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # ○ 戦闘メンバー最大数取得
  337.   #--------------------------------------------------------------------------
  338.   def max_battle_member_count
  339.     if @max_battle_member_count == nil
  340.       return KGC::LargeParty::MAX_BATTLE_MEMBERS
  341.     else
  342.       return @max_battle_member_count
  343.     end
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # ○ 戦闘メンバー最大数変更
  347.   #--------------------------------------------------------------------------
  348.   def max_battle_member_count=(value)
  349.     if value.is_a?(Integer)
  350.       value = [value, 1].max
  351.     end
  352.     @max_battle_member_count = value
  353.   end
  354.   #--------------------------------------------------------------------------
  355.   # ○ 戦闘メンバー数取得
  356.   #--------------------------------------------------------------------------
  357.   def battle_member_count
  358.     if @battle_member_count == nil
  359.       @battle_member_count = @actors.size
  360.     end
  361.     @battle_member_count =
  362.       [@battle_member_count, @actors.size, max_battle_member_count].min
  363.     return @battle_member_count
  364.   end
  365.   #--------------------------------------------------------------------------
  366.   # ○ 戦闘メンバー数設定
  367.   #--------------------------------------------------------------------------
  368.   def battle_member_count=(value)
  369.     @battle_member_count = [[value, 0].max,
  370.       @actors.size, max_battle_member_count].min
  371.   end
  372.   #--------------------------------------------------------------------------
  373.   # ● メンバーの取得
  374.   #--------------------------------------------------------------------------
  375.   alias members_KGC_LargeParty members
  376.   def members
  377.     if $game_temp.in_battle ||
  378.         !KGC::LargeParty::SHOW_STAND_BY_MEMBER_NOT_IN_BATTLE
  379.       return battle_members
  380.     else
  381.       return members_KGC_LargeParty
  382.     end
  383.   end
  384.   #--------------------------------------------------------------------------
  385.   # ○ 全メンバーの取得
  386.   #--------------------------------------------------------------------------
  387.   def all_members
  388.     return members_KGC_LargeParty
  389.   end
  390.   #--------------------------------------------------------------------------
  391.   # ○ 戦闘メンバーの取得
  392.   #--------------------------------------------------------------------------
  393.   def battle_members
  394.     result = []
  395.     battle_member_count.times { |i| result << $game_actors[@actors[i]] }
  396.     return result
  397.   end
  398.   #--------------------------------------------------------------------------
  399.   # ○ 待機メンバーの取得
  400.   #--------------------------------------------------------------------------
  401.   def stand_by_members
  402.     return (all_members - battle_members)
  403.   end
  404.   #--------------------------------------------------------------------------
  405.   # ○ 固定メンバーの取得
  406.   #--------------------------------------------------------------------------
  407.   def fixed_members
  408.     result = []
  409.     @fixed_actors.each { |i| result << $game_actors[i] }
  410.     return result
  411.   end
  412.   #--------------------------------------------------------------------------
  413.   # ● 初期パーティのセットアップ
  414.   #--------------------------------------------------------------------------
  415.   alias setup_starting_members_KGC_LargeParty setup_starting_members
  416.   def setup_starting_members
  417.     setup_starting_members_KGC_LargeParty

  418.     self.battle_member_count = @actors.size
  419.   end
  420.   #--------------------------------------------------------------------------
  421.   # ● 戦闘テスト用パーティのセットアップ
  422.   #--------------------------------------------------------------------------
  423.   alias setup_battle_test_members_KGC_LargeParty setup_battle_test_members
  424.   def setup_battle_test_members
  425.     setup_battle_test_members_KGC_LargeParty

  426.     self.battle_member_count = @actors.size
  427.   end
  428.   #--------------------------------------------------------------------------
  429.   # ○ メンバーの新規設定
  430.   #     new_member : 新しいメンバー
  431.   #--------------------------------------------------------------------------
  432.   def set_member(new_member)
  433.     @actors = []
  434.     new_member.each { |actor| @actors << actor.id }
  435.   end
  436.   #--------------------------------------------------------------------------
  437.   # ○ 戦闘メンバーの新規設定
  438.   #     new_member : 新しい戦闘メンバー
  439.   #--------------------------------------------------------------------------
  440.   def set_battle_member(new_member)
  441.     new_battle_member = []
  442.     new_member.each { |actor|
  443.       @actors.delete(actor.id)
  444.       new_battle_member << actor.id
  445.     }
  446.     @actors = new_battle_member + @actors
  447.     self.battle_member_count = new_member.size
  448.   end
  449.   #--------------------------------------------------------------------------
  450.   # ○ パーティ編成を許可しているか判定
  451.   #--------------------------------------------------------------------------
  452.   def partyform_enable?
  453.     return $game_switches[KGC::LargeParty::PARTYFORM_SWITCH]
  454.   end
  455.   #--------------------------------------------------------------------------
  456.   # ○ 戦闘中のパーティ編成を許可しているか判定
  457.   #--------------------------------------------------------------------------
  458.   def battle_partyform_enable?
  459.     return false unless partyform_enable?
  460.     return $game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH]
  461.   end
  462.   #--------------------------------------------------------------------------
  463.   # ○ メンバーが一杯か判定
  464.   #--------------------------------------------------------------------------
  465.   def full?
  466.     return (@actors.size >= MAX_MEMBERS)
  467.   end
  468.   #--------------------------------------------------------------------------
  469.   # ○ 出撃中か判定
  470.   #     actor_id : 判定するアクターの ID
  471.   #--------------------------------------------------------------------------
  472.   def actor_launched?(actor_id)
  473.     return battle_members.include?($game_actors[actor_id])
  474.   end
  475.   #--------------------------------------------------------------------------
  476.   # ○ 固定アクターか判定
  477.   #     actor_id : 判定するアクターの ID
  478.   #--------------------------------------------------------------------------
  479.   def actor_fixed?(actor_id)
  480.     return @fixed_actors.include?(actor_id)
  481.   end
  482.   #--------------------------------------------------------------------------
  483.   # ● アクターを加える
  484.   #     actor_id : アクター ID
  485.   #--------------------------------------------------------------------------
  486.   alias add_actor_KGC_LargeParty add_actor
  487.   def add_actor(actor_id)
  488.     last_size = @actors.size

  489.     add_actor_KGC_LargeParty(actor_id)

  490.     if last_size < @actors.size
  491.       self.battle_member_count += 1
  492.     end
  493.   end
  494.   #--------------------------------------------------------------------------
  495.   # ○ アクターを戦闘メンバーに加える
  496.   #     actor_id : アクター ID
  497.   #     index    : 追加位置 (省略時は最後尾)
  498.   #--------------------------------------------------------------------------
  499.   def add_battle_member(actor_id, index = nil)
  500.     return unless @actors.include?(actor_id)  # パーティにいない
  501.     if index == nil
  502.       return if battle_members.include?($game_actors[actor_id])  # 出撃済み
  503.       return if battle_member_count == max_battle_member_count   # 人数が最大
  504.       index = battle_member_count
  505.     end

  506.     @actors.delete(actor_id)
  507.     @actors.insert(index, actor_id)
  508.     self.battle_member_count += 1
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # ○ アクターを戦闘メンバーから外す
  512.   #     actor_id : アクター ID
  513.   #--------------------------------------------------------------------------
  514.   def remove_battle_member(actor_id)
  515.     return unless @actors.include?(actor_id)  # パーティにいない
  516.     return if actor_fixed?(actor_id)          # 固定済み
  517.     return unless actor_launched?(actor_id)   # 待機中

  518.     @actors.delete(actor_id)
  519.     @actors.push(actor_id)
  520.     self.battle_member_count -= 1
  521.   end
  522.   #--------------------------------------------------------------------------
  523.   # ○ アクターの固定状態を設定
  524.   #     actor_id : アクター ID
  525.   #     fixed    : 固定フラグ (省略時 : false)
  526.   #--------------------------------------------------------------------------
  527.   def fix_actor(actor_id, fixed = false)
  528.     return unless @actors.include?(actor_id)  # パーティにいない

  529.     if fixed
  530.       # 固定
  531.       unless @fixed_actors.include?(actor_id)
  532.         @fixed_actors << actor_id
  533.         unless battle_members.include?($game_actors[actor_id])
  534.           self.battle_member_count += 1
  535.         end
  536.       end
  537.       # 強制出撃
  538.       apply_force_launch
  539.     else
  540.       # 固定解除
  541.       @fixed_actors.delete(actor_id)
  542.     end
  543.     $game_player.refresh
  544.   end
  545.   #--------------------------------------------------------------------------
  546.   # ○ 強制出撃適用
  547.   #--------------------------------------------------------------------------
  548.   def apply_force_launch
  549.     while (fixed_members - battle_members).size > 0
  550.       # 固定状態でないメンバーを適当に持ってきて入れ替え
  551.       actor1 = stand_by_members.find { |a| @fixed_actors.include?(a.id) }
  552.       actor2 = battle_members.reverse.find { |a| !@fixed_actors.include?(a.id) }
  553.       index1 = @actors.index(actor1.id)
  554.       index2 = @actors.index(actor2.id)
  555.       @actors[index1], @actors[index2] = @actors[index2], @actors[index1]

  556.       # 戦闘メンバーが全員固定されたら戻る (無限ループ防止)
  557.       all_fixed = true
  558.       battle_members.each { |actor|
  559.         unless actor.fixed_member?
  560.           all_fixed = false
  561.           break
  562.         end
  563.       }
  564.       break if all_fixed
  565.     end
  566.   end
  567.   #--------------------------------------------------------------------------
  568.   # ○ 固定アクター以外を戦闘メンバーから外す
  569.   #--------------------------------------------------------------------------
  570.   def remove_all_battle_member
  571.     all_members.each { |actor|
  572.       remove_battle_member(actor.id) if actor_launched?(actor.id)
  573.     }
  574.   end
  575.   #--------------------------------------------------------------------------
  576.   # ○ メンバー整列 (昇順)
  577.   #     sort_type : ソート形式 (SORT_BY_xxx)
  578.   #     reverse   : true だと降順
  579.   #--------------------------------------------------------------------------
  580.   def sort_member(sort_type = KGC::Commands::SORT_BY_ID,
  581.                   reverse = false)
  582.     # バッファを準備
  583.     b_actors = battle_members
  584.     actors   = all_members - b_actors
  585.     f_actors = fixed_members
  586.     # 固定キャラはソートしない
  587.     if KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED
  588.       actors   -= f_actors
  589.       b_actors -= f_actors
  590.     end

  591.     # ソート
  592.     case sort_type
  593.     when KGC::Commands::SORT_BY_ID     # ID順
  594.       actors.sort!   { |a, b| a.id <=> b.id }
  595.       b_actors.sort! { |a, b| a.id <=> b.id }
  596.     when KGC::Commands::SORT_BY_NAME   # 名前順
  597.       actors.sort!   { |a, b| a.name <=> b.name }
  598.       b_actors.sort! { |a, b| a.name <=> b.name }
  599.     when KGC::Commands::SORT_BY_LEVEL  # レベル順
  600.       actors.sort!   { |a, b| a.level <=> b.level }
  601.       b_actors.sort! { |a, b| a.level <=> b.level }
  602.     end
  603.     # 反転
  604.     if reverse
  605.       actors.reverse!
  606.       b_actors.reverse!
  607.     end

  608.     # 固定キャラを先頭に持ってくる
  609.     if KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED
  610.       actors   = f_actors + actors
  611.       b_actors = f_actors + b_actors
  612.     end

  613.     # 復帰
  614.     set_member(actors)
  615.     set_battle_member(b_actors)

  616.     apply_force_launch
  617.     $game_player.refresh
  618.   end
  619.   #--------------------------------------------------------------------------
  620.   # ○ 並び替え
  621.   #    戦闘メンバーの index1 番目と index2 番目を入れ替える
  622.   #--------------------------------------------------------------------------
  623.   def change_shift(index1, index2)
  624.     size = @actors.size
  625.     if index1 >= size || index2 >= size
  626.       return
  627.     end
  628.     buf = @actors[index1]
  629.     @actors[index1] = @actors[index2]
  630.     @actors[index2] = buf
  631.     $game_player.refresh
  632.   end
  633.   #--------------------------------------------------------------------------
  634.   # ● 戦闘用ステートの解除 (戦闘終了時に呼び出し)
  635.   #--------------------------------------------------------------------------
  636.   def remove_states_battle
  637.     (1...$data_actors.size).each { |i|
  638.       $game_actors[i].remove_states_battle
  639.     }
  640.   end
  641. end

  642. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  643. #==============================================================================
  644. # ■ Window_Command
  645. #==============================================================================

  646. class Window_Command < Window_Selectable
  647.   unless method_defined?(:add_command)
  648.   #--------------------------------------------------------------------------
  649.   # ○ コマンドを追加
  650.   #    追加した位置を返す
  651.   #--------------------------------------------------------------------------
  652.   def add_command(command)
  653.     @commands << command
  654.     @item_max = @commands.size
  655.     item_index = @item_max - 1
  656.     refresh_command
  657.     draw_item(item_index)
  658.     return item_index
  659.   end
  660.   #--------------------------------------------------------------------------
  661.   # ○ コマンドをリフレッシュ
  662.   #--------------------------------------------------------------------------
  663.   def refresh_command
  664.     buf = self.contents.clone
  665.     self.height = [self.height, row_max * WLH + 32].max
  666.     create_contents
  667.     self.contents.blt(0, 0, buf, buf.rect)
  668.     buf.dispose
  669.   end
  670.   #--------------------------------------------------------------------------
  671.   # ○ コマンドを挿入
  672.   #--------------------------------------------------------------------------
  673.   def insert_command(index, command)
  674.     @commands.insert(index, command)
  675.     @item_max = @commands.size
  676.     refresh_command
  677.     refresh
  678.   end
  679.   #--------------------------------------------------------------------------
  680.   # ○ コマンドを削除
  681.   #--------------------------------------------------------------------------
  682.   def remove_command(command)
  683.     @commands.delete(command)
  684.     @item_max = @commands.size
  685.     refresh
  686.   end
  687.   end
  688. end

  689. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  690. #==============================================================================
  691. # ■ Window_MenuStatus
  692. #==============================================================================

  693. class Window_MenuStatus < Window_Selectable
  694.   #--------------------------------------------------------------------------
  695.   # ● 定数
  696.   #--------------------------------------------------------------------------
  697.   STATUS_HEIGHT = 96  # ステータス一人分の高さ
  698.   #--------------------------------------------------------------------------
  699.   # ● ウィンドウ内容の作成
  700.   #--------------------------------------------------------------------------
  701.   def create_contents
  702.     self.contents.dispose
  703.     self.contents = Bitmap.new(width - 32,
  704.       [height - 32, row_max * STATUS_HEIGHT].max)
  705.   end
  706.   #--------------------------------------------------------------------------
  707.   # ● 先頭の行の取得
  708.   #--------------------------------------------------------------------------
  709.   def top_row
  710.     return self.oy / STATUS_HEIGHT
  711.   end
  712.   #--------------------------------------------------------------------------
  713.   # ● 先頭の行の設定
  714.   #     row : 先頭に表示する行
  715.   #--------------------------------------------------------------------------
  716.   def top_row=(row)
  717.     super(row)
  718.     self.oy = self.oy / WLH * STATUS_HEIGHT
  719.   end
  720.   #--------------------------------------------------------------------------
  721.   # ● 1 ページに表示できる行数の取得
  722.   #--------------------------------------------------------------------------
  723.   def page_row_max
  724.     return (self.height - 32) / STATUS_HEIGHT
  725.   end
  726.   #--------------------------------------------------------------------------
  727.   # ● 項目を描画する矩形の取得
  728.   #     index : 項目番号
  729.   #--------------------------------------------------------------------------
  730.   def item_rect(index)
  731.     rect = super(index)
  732.     rect.height = STATUS_HEIGHT
  733.     rect.y = index / @column_max * STATUS_HEIGHT
  734.     return rect
  735.   end
  736.   #--------------------------------------------------------------------------
  737.   # ● リフレッシュ
  738.   #--------------------------------------------------------------------------
  739.   def refresh
  740.     @item_max = $game_party.members.size
  741.     create_contents
  742.     fill_stand_by_background
  743.     draw_member
  744.   end
  745.   #--------------------------------------------------------------------------
  746.   # ○ パーティメンバー描画
  747.   #--------------------------------------------------------------------------
  748.   def draw_member
  749.     for actor in $game_party.members
  750.       draw_actor_face(actor, 2, actor.party_index * 96 + 2, 92)
  751.       x = 104
  752.       y = actor.party_index * 96 + WLH / 2
  753.       draw_actor_name(actor, x, y)
  754.       draw_actor_class(actor, x + 120, y)
  755.       draw_actor_level(actor, x, y + WLH * 1)
  756.       draw_actor_state(actor, x, y + WLH * 2)
  757.       draw_actor_hp(actor, x + 120, y + WLH * 1)
  758.       draw_actor_mp(actor, x + 120, y + WLH * 2)
  759.     end
  760.   end
  761.   #--------------------------------------------------------------------------
  762.   # ○ 待機メンバーの背景色を塗る
  763.   #--------------------------------------------------------------------------
  764.   def fill_stand_by_background
  765.     color = KGC::LargeParty::STAND_BY_COLOR
  766.     dy = STATUS_HEIGHT * $game_party.battle_members.size
  767.     dh = STATUS_HEIGHT * $game_party.stand_by_members.size
  768.     if dh > 0
  769.       self.contents.fill_rect(0, dy, self.width - 32, dh, color)
  770.     end
  771.   end
  772.   #--------------------------------------------------------------------------
  773.   # ● カーソルの更新
  774.   #--------------------------------------------------------------------------
  775.   def update_cursor
  776.     if @index < 0               # カーソルなし
  777.       self.cursor_rect.empty
  778.     elsif @index < @item_max    # 通常
  779.       super
  780.     elsif @index >= 100         # 自分
  781.       self.cursor_rect.set(0, (@index - 100) * STATUS_HEIGHT,
  782.         contents.width, STATUS_HEIGHT)
  783.     else                        # 全体
  784.       self.cursor_rect.set(0, 0, contents.width, @item_max * STATUS_HEIGHT)
  785.     end
  786.   end
  787. end

  788. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  789. #==============================================================================
  790. # ■ Window_ShopStatus
  791. #==============================================================================

  792. class Window_ShopStatus < Window_Base
  793.   #--------------------------------------------------------------------------
  794.   # ● ウィンドウ内容の作成
  795.   #--------------------------------------------------------------------------
  796.   def create_contents
  797.     self.contents.dispose
  798.     self.contents = Bitmap.new(width - 32,
  799.       WLH * ($game_party.members.size + 1) * 2)
  800.   end
  801. end

  802. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  803. #==============================================================================
  804. # ■ Window_BattleStatus
  805. #==============================================================================

  806. class Window_BattleStatus < Window_Selectable
  807.   #--------------------------------------------------------------------------
  808.   # ● ウィンドウ内容の作成
  809.   #--------------------------------------------------------------------------
  810.   def create_contents
  811.     self.contents.dispose
  812.     self.contents = Bitmap.new(width - 32,
  813.       [WLH * $game_party.members.size, height - 32].max)
  814.   end
  815.   #--------------------------------------------------------------------------
  816.   # ● リフレッシュ
  817.   #--------------------------------------------------------------------------
  818.   alias refresh_KGC_LargeParty refresh
  819.   def refresh
  820.     create_contents

  821.     refresh_KGC_LargeParty
  822.   end
  823. end

  824. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  825. #==============================================================================
  826. # □ Window_PartyFormCaption
  827. #------------------------------------------------------------------------------
  828. #  パーティ編成画面でウィンドウのキャプションを表示するウィンドウです。
  829. #==============================================================================

  830. class Window_PartyFormCaption < Window_Base
  831.   #--------------------------------------------------------------------------
  832.   # ● オブジェクト初期化
  833.   #     caption : 表示するキャプション
  834.   #--------------------------------------------------------------------------
  835.   def initialize(caption = "")
  836.     super(0, 0, KGC::LargeParty::CAPTION_WINDOW_WIDTH, WLH + 32)
  837.     @caption = caption
  838.     refresh
  839.   end
  840.   #--------------------------------------------------------------------------
  841.   # ● リフレッシュ
  842.   #--------------------------------------------------------------------------
  843.   def refresh
  844.     self.contents.clear
  845.     self.contents.draw_text(0, 0, width - 32, WLH, @caption)
  846.   end
  847. end

  848. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  849. #==============================================================================
  850. # □ Window_PartyFormMember
  851. #------------------------------------------------------------------------------
  852. #  パーティ編成画面でメンバーを表示するウィンドウです。
  853. #==============================================================================

  854. class Window_PartyFormMember < Window_Selectable
  855.   #--------------------------------------------------------------------------
  856.   # ○ 定数
  857.   #--------------------------------------------------------------------------
  858.   DRAW_SIZE = KGC::LargeParty::PARTY_FORM_CHARACTER_SIZE
  859.   #--------------------------------------------------------------------------
  860.   # ● 公開インスタンス変数
  861.   #--------------------------------------------------------------------------
  862.   attr_accessor :selected_index           # 選択済みインデックス
  863.   #--------------------------------------------------------------------------
  864.   # ● オブジェクト初期化
  865.   #     x       : ウィンドウの X 座標
  866.   #     y       : ウィンドウの Y 座標
  867.   #     width   : ウィンドウの幅
  868.   #     height  : ウィンドウの高さ
  869.   #     spacing : 横に項目が並ぶときの空白の幅
  870.   #--------------------------------------------------------------------------
  871.   def initialize(x, y, width, height, spacing = 8)
  872.     super(x, y, width, height, spacing)
  873.   end
  874.   #--------------------------------------------------------------------------
  875.   # ● ウィンドウ内容の作成
  876.   #--------------------------------------------------------------------------
  877.   def create_contents
  878.     self.contents.dispose
  879.     self.contents = Bitmap.new(width - 32,
  880.       [height - 32, row_max * DRAW_SIZE[1]].max)
  881.   end
  882.   #--------------------------------------------------------------------------
  883.   # ● 先頭の行の取得
  884.   #--------------------------------------------------------------------------
  885.   def top_row
  886.     return self.oy / DRAW_SIZE[1]
  887.   end
  888.   #--------------------------------------------------------------------------
  889.   # ● 先頭の行の設定
  890.   #     row : 先頭に表示する行
  891.   #--------------------------------------------------------------------------
  892.   def top_row=(row)
  893.     super(row)
  894.     self.oy = self.oy / WLH * DRAW_SIZE[1]
  895.   end
  896.   #--------------------------------------------------------------------------
  897.   # ● 1 ページに表示できる行数の取得
  898.   #--------------------------------------------------------------------------
  899.   def page_row_max
  900.     return (self.height - 32) / DRAW_SIZE[1]
  901.   end
  902.   #--------------------------------------------------------------------------
  903.   # ● 項目を描画する矩形の取得
  904.   #     index : 項目番号
  905.   #--------------------------------------------------------------------------
  906.   def item_rect(index)
  907.     rect = super(index)
  908.     rect.width = DRAW_SIZE[0]
  909.     rect.height = DRAW_SIZE[1]
  910.     rect.y = index / @column_max * DRAW_SIZE[1]
  911.     return rect
  912.   end
  913.   #--------------------------------------------------------------------------
  914.   # ○ 選択アクター取得
  915.   #--------------------------------------------------------------------------
  916.   def actor
  917.     return @actors[self.index]
  918.   end
  919.   #--------------------------------------------------------------------------
  920.   # ● リフレッシュ
  921.   #--------------------------------------------------------------------------
  922.   def refresh
  923.     self.contents.clear
  924.     restore_member_list
  925.     draw_member
  926.   end
  927.   #--------------------------------------------------------------------------
  928.   # ○ メンバーリスト修復
  929.   #--------------------------------------------------------------------------
  930.   def restore_member_list
  931.     # 継承先で定義
  932.   end
  933.   #--------------------------------------------------------------------------
  934.   # ○ メンバー描画
  935.   #--------------------------------------------------------------------------
  936.   def draw_member
  937.     # 継承先で定義
  938.   end
  939.   #--------------------------------------------------------------------------
  940.   # ○ 空欄アクター描画
  941.   #     index : 項目番号
  942.   #--------------------------------------------------------------------------
  943.   def draw_empty_actor(index)
  944.     # 継承先で定義
  945.   end
  946.   #--------------------------------------------------------------------------
  947.   # ○ 固定キャラ背景描画
  948.   #     index : 項目番号
  949.   #--------------------------------------------------------------------------
  950.   def draw_fixed_back(index)
  951.     rect = item_rect(index)
  952.     self.contents.fill_rect(rect, KGC::LargeParty::FIXED_COLOR)
  953.   end
  954.   #--------------------------------------------------------------------------
  955.   # ○ 選択中キャラ背景描画
  956.   #     index : 項目番号
  957.   #--------------------------------------------------------------------------
  958.   def draw_selected_back(index)
  959.     rect = item_rect(index)
  960.     self.contents.fill_rect(rect, KGC::LargeParty::SELECTED_COLOR)
  961.   end
  962. end

  963. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

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

  969. class Window_PartyFormBattleMember < Window_PartyFormMember
  970.   #--------------------------------------------------------------------------
  971.   # ● 公開インスタンス変数
  972.   #--------------------------------------------------------------------------
  973.   attr_accessor :selected_index           # 選択済みインデックス
  974.   #--------------------------------------------------------------------------
  975.   # ● オブジェクト初期化
  976.   #--------------------------------------------------------------------------
  977.   def initialize
  978.     super(0, 0, 64, DRAW_SIZE[1] + 32)
  979.     column_width = DRAW_SIZE[0] + @spacing
  980.     nw = [column_width * $game_party.max_battle_member_count + 32,
  981.       Graphics.width].min
  982.     self.width = nw

  983.     @item_max = $game_party.max_battle_member_count
  984.     @column_max = width / column_width
  985.     @selected_index = nil
  986.     create_contents
  987.     refresh
  988.     self.active = true
  989.     self.index = 0
  990.   end
  991.   #--------------------------------------------------------------------------
  992.   # ○ メンバーリスト修復
  993.   #--------------------------------------------------------------------------
  994.   def restore_member_list
  995.     @actors = $game_party.battle_members
  996.   end
  997.   #--------------------------------------------------------------------------
  998.   # ○ メンバー描画
  999.   #--------------------------------------------------------------------------
  1000.   def draw_member
  1001.     @item_max.times { |i|
  1002.       actor = @actors[i]
  1003.       if actor == nil
  1004.         draw_empty_actor(i)
  1005.       else
  1006.         if i == @selected_index
  1007.           draw_selected_back(i)
  1008.         elsif $game_party.actor_fixed?(actor.id)
  1009.           draw_fixed_back(i)
  1010.         end
  1011.         rect = item_rect(i)
  1012.         draw_actor_graphic(actor,
  1013.           rect.x + DRAW_SIZE[0] / 2,
  1014.           rect.y + DRAW_SIZE[1] - 4)
  1015.       end
  1016.     }
  1017.   end
  1018.   #--------------------------------------------------------------------------
  1019.   # ○ 空欄アクター描画
  1020.   #     index : 項目番号
  1021.   #--------------------------------------------------------------------------
  1022.   def draw_empty_actor(index)
  1023.     rect = item_rect(index)
  1024.     self.contents.font.color = system_color
  1025.     self.contents.draw_text(rect, KGC::LargeParty::BATTLE_MEMBER_BLANK_TEXT, 1)
  1026.     self.contents.font.color = normal_color
  1027.   end
  1028. end

  1029. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
复制代码
  1. ==============================================================================
  2. # □ Window_PartyFormAllMember
  3. #------------------------------------------------------------------------------
  4. #  パーティ編成画面で全メンバーを表示するウィンドウです。
  5. #==============================================================================

  6. class Window_PartyFormAllMember < Window_PartyFormMember
  7.   #--------------------------------------------------------------------------
  8.   # ● オブジェクト初期化
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     super(0, 0, 64, 64)
  12.     restore_member_list
  13.     @item_max = $game_party.all_members.size

  14.     # 各種サイズ計算
  15.     column_width = DRAW_SIZE[0] + @spacing
  16.     sw = [@item_max * column_width + 32, Graphics.width].min
  17.     @column_max = (sw - 32) / column_width
  18.     sh = ([@item_max - 1, 0].max / @column_max + 1) * DRAW_SIZE[1] + 32
  19.     sh = [sh, DRAW_SIZE[1] * KGC::LargeParty::PARTY_MEMBER_WINDOW_ROW_MAX + 32].min

  20.     # 座標・サイズ調整
  21.     self.y += DRAW_SIZE[1] + 32
  22.     self.width = sw
  23.     self.height = sh

  24.     create_contents
  25.     refresh
  26.     self.active = false
  27.     self.index = 0
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ○ 選択しているアクターのインデックス取得
  31.   #--------------------------------------------------------------------------
  32.   def actor_index
  33.     return @index_offset + self.index
  34.   end
  35.   #--------------------------------------------------------------------------
  36.   # ○ メンバーリスト修復
  37.   #--------------------------------------------------------------------------
  38.   def restore_member_list
  39.     if KGC::LargeParty::SHOW_BATTLE_MEMBER_IN_PARTY
  40.       @actors = $game_party.all_members
  41.       @index_offset = 0
  42.     else
  43.       @actors = $game_party.stand_by_members
  44.       @index_offset = $game_party.battle_members.size
  45.     end
  46.   end
  47.   #--------------------------------------------------------------------------
  48.   # ○ メンバー描画
  49.   #--------------------------------------------------------------------------
  50.   def draw_member
  51.     @item_max.times { |i|
  52.       actor = @actors[i]
  53.       if actor == nil
  54.         draw_empty_actor(i)
  55.         next
  56.       end

  57.       if $game_party.actor_fixed?(actor.id)
  58.         draw_fixed_back(i)
  59.       end
  60.       rect = item_rect(i)
  61.       opacity = ($game_party.battle_members.include?(actor) ? 96 : 255)
  62.       draw_actor_graphic(actor,
  63.         rect.x + DRAW_SIZE[0] / 2,
  64.         rect.y + DRAW_SIZE[1] - 4,
  65.         opacity)
  66.     }
  67.   end
  68.   #--------------------------------------------------------------------------
  69.   # ● アクターの歩行グラフィック描画
  70.   #     actor   : アクター
  71.   #     x       : 描画先 X 座標
  72.   #     y       : 描画先 Y 座標
  73.   #     opacity : 不透明度
  74.   #--------------------------------------------------------------------------
  75.   def draw_actor_graphic(actor, x, y, opacity = 255)
  76.     draw_character(actor.character_name, actor.character_index, x, y, opacity)
  77.   end
  78.   #--------------------------------------------------------------------------
  79.   # ● 歩行グラフィックの描画
  80.   #     character_name  : 歩行グラフィック ファイル名
  81.   #     character_index : 歩行グラフィック インデックス
  82.   #     x               : 描画先 X 座標
  83.   #     y               : 描画先 Y 座標
  84.   #     opacity         : 不透明度
  85.   #--------------------------------------------------------------------------
  86.   def draw_character(character_name, character_index, x, y, opacity = 255)
  87.     return if character_name == nil
  88.     bitmap = Cache.character(character_name)
  89.     sign = character_name[/^[\!\$]./]
  90.     if sign != nil and sign.include?('$')
  91.       cw = bitmap.width / 3
  92.       ch = bitmap.height / 4
  93.     else
  94.       cw = bitmap.width / 12
  95.       ch = bitmap.height / 8
  96.     end
  97.     n = character_index
  98.     src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  99.     self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # ○ 空欄アクター描画
  103.   #     index : 項目番号
  104.   #--------------------------------------------------------------------------
  105.   def draw_empty_actor(index)
  106.     rect = item_rect(index)
  107.     self.contents.font.color = system_color
  108.     self.contents.draw_text(rect, KGC::LargeParty::PARTY_MEMBER_BLANK_TEXT, 1)
  109.     self.contents.font.color = normal_color
  110.   end
  111. end

  112. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  113. #==============================================================================
  114. # □ Window_PartyFormStatus
  115. #------------------------------------------------------------------------------
  116. #  パーティ編成画面でアクターのステータスを表示するウィンドウです。
  117. #==============================================================================

  118. class Window_PartyFormStatus < Window_Base
  119.   #--------------------------------------------------------------------------
  120.   # ● オブジェクト初期化
  121.   #--------------------------------------------------------------------------
  122.   def initialize
  123.     super(0, 0, 384, 128)
  124.     self.z = 1000
  125.     @actor = nil
  126.     refresh
  127.   end
  128.   #--------------------------------------------------------------------------
  129.   # ○ アクター設定
  130.   #--------------------------------------------------------------------------
  131.   def set_actor(actor)
  132.     if @actor != actor
  133.       @actor = actor
  134.       refresh
  135.     end
  136.   end
  137.   #--------------------------------------------------------------------------
  138.   # ● リフレッシュ
  139.   #--------------------------------------------------------------------------
  140.   def refresh
  141.     self.contents.clear
  142.     if @actor == nil
  143.       return
  144.     end

  145.     draw_actor_face(@actor, 0, 0)
  146.     dx = 104
  147.     draw_actor_name(@actor, dx, 0)
  148.     draw_actor_level(@actor, dx, WLH * 1)
  149.     draw_actor_hp(@actor, dx, WLH * 2)
  150.     draw_actor_mp(@actor, dx, WLH * 3)
  151.     4.times { |i|
  152.       draw_actor_parameter(@actor, dx + 128, WLH * i, i, 120)
  153.     }
  154.   end
  155.   #--------------------------------------------------------------------------
  156.   # ● 能力値の描画
  157.   #     actor : アクター
  158.   #     x     : 描画先 X 座標
  159.   #     y     : 描画先 Y 座標
  160.   #     type  : 能力値の種類 (0~3)
  161.   #     width : 描画幅
  162.   #--------------------------------------------------------------------------
  163.   def draw_actor_parameter(actor, x, y, type, width = 156)
  164.     case type
  165.     when 0
  166.       parameter_name = Vocab::atk
  167.       parameter_value = actor.atk
  168.     when 1
  169.       parameter_name = Vocab::def
  170.       parameter_value = actor.def
  171.     when 2
  172.       parameter_name = Vocab::spi
  173.       parameter_value = actor.spi
  174.     when 3
  175.       parameter_name = Vocab::agi
  176.       parameter_value = actor.agi
  177.     end
  178.     nw = width - 36
  179.     self.contents.font.color = system_color
  180.     self.contents.draw_text(x, y, nw, WLH, parameter_name)
  181.     self.contents.font.color = normal_color
  182.     self.contents.draw_text(x + nw, y, 36, WLH, parameter_value, 2)
  183.   end
  184. end

  185. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  186. #==============================================================================
  187. # □ Window_PartyFormControl
  188. #------------------------------------------------------------------------------
  189. #  パーティ編成画面で操作方法を表示するウィンドウです。
  190. #==============================================================================

  191. class Window_PartyFormControl < Window_Base
  192.   #--------------------------------------------------------------------------
  193.   # ○ 定数
  194.   #--------------------------------------------------------------------------
  195.   MODE_BATTLE_MEMBER = 0
  196.   MODE_SHIFT_CHANGE  = 1
  197.   MODE_PARTY_MEMBER  = 2
  198.   #--------------------------------------------------------------------------
  199.   # ● オブジェクト初期化
  200.   #--------------------------------------------------------------------------
  201.   def initialize
  202.     super(0, 0, Graphics.width - 384, 128)
  203.     self.z = 1000
  204.     @mode = MODE_BATTLE_MEMBER
  205.     refresh
  206.   end
  207.   #--------------------------------------------------------------------------
  208.   # ○ モード変更
  209.   #--------------------------------------------------------------------------
  210.   def mode=(value)
  211.     @mode = value
  212.     refresh
  213.   end
  214.   #--------------------------------------------------------------------------
  215.   # ● リフレッシュ
  216.   #--------------------------------------------------------------------------
  217.   def refresh
  218.     self.contents.clear
  219.     case @mode
  220.     when MODE_BATTLE_MEMBER  # 戦闘メンバー
  221.       buttons = [
  222.         "A: 离队",
  223.         "B: 结束",
  224.         "C: 编成",
  225.         "X: 排序"
  226.       ]
  227.     when MODE_SHIFT_CHANGE   # 並び替え
  228.       buttons = [
  229.         "B: 取消",
  230.         "C: 确定",
  231.         "X: 确定"
  232.       ]
  233.     when MODE_PARTY_MEMBER   # パーティメンバー
  234.       buttons = [
  235.         "B: 取消",
  236.         "C: 确定"
  237.       ]
  238.     else
  239.       return
  240.     end

  241.     buttons.each_with_index { |c, i|
  242.       self.contents.draw_text(0, WLH * i, width - 32, WLH, c)
  243.     }
  244.   end
  245. end

  246. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  247. #==============================================================================
  248. # ■ Scene_Title
  249. #==============================================================================

  250. class Scene_Title < Scene_Base
  251.   #--------------------------------------------------------------------------
  252.   # ● 各種ゲームオブジェクトの作成
  253.   #--------------------------------------------------------------------------
  254.   alias create_game_objects_KGC_LargeParty create_game_objects
  255.   def create_game_objects
  256.     create_game_objects_KGC_LargeParty

  257.     if KGC::LargeParty::DEFAULT_PARTYFORM_ENABLED
  258.       $game_switches[KGC::LargeParty::PARTYFORM_SWITCH] = true
  259.       $game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH] = true
  260.     end
  261.   end
  262. end

  263. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  264. #==============================================================================
  265. # ■ Scene_Map
  266. #==============================================================================

  267. class Scene_Map < Scene_Base
  268.   #--------------------------------------------------------------------------
  269.   # ● 画面切り替えの実行
  270.   #--------------------------------------------------------------------------
  271.   alias update_scene_change_KGC_LargeParty update_scene_change
  272.   def update_scene_change
  273.     return if $game_player.moving?    # プレイヤーの移動中?

  274.     if $game_temp.next_scene == :partyform
  275.       call_partyform
  276.       return
  277.     end

  278.     update_scene_change_KGC_LargeParty
  279.   end
  280.   #--------------------------------------------------------------------------
  281.   # ○ パーティ編成画面への切り替え
  282.   #--------------------------------------------------------------------------
  283.   def call_partyform
  284.     $game_temp.next_scene = nil
  285.     $scene = Scene_PartyForm.new(0, Scene_PartyForm::HOST_MAP)
  286.   end
  287. end

  288. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  289. #==============================================================================
  290. # ■ Scene_Menu
  291. #==============================================================================

  292. class Scene_Menu < Scene_Base
  293.   if KGC::LargeParty::USE_MENU_PARTYFORM_COMMAND
  294.   #--------------------------------------------------------------------------
  295.   # ● コマンドウィンドウの作成
  296.   #--------------------------------------------------------------------------
  297.   alias create_command_window_KGC_LargeParty create_command_window
  298.   def create_command_window
  299.     create_command_window_KGC_LargeParty

  300.     return if $imported["CustomMenuCommand"]

  301.     @__command_partyform_index =
  302.       @command_window.add_command(Vocab.partyform)
  303.     @command_window.draw_item(@__command_partyform_index,
  304.       $game_party.partyform_enable?)
  305.     if @command_window.oy > 0
  306.       @command_window.oy -= Window_Base::WLH
  307.     end
  308.     @command_window.index = @menu_index
  309.   end
  310.   end
  311.   #--------------------------------------------------------------------------
  312.   # ● コマンド選択の更新
  313.   #--------------------------------------------------------------------------
  314.   alias update_command_selection_KGC_LargeParty update_command_selection
  315.   def update_command_selection
  316.     current_menu_index = @__command_partyform_index
  317.     call_partyform_flag = false

  318.     if Input.trigger?(Input::C)
  319.       case @command_window.index
  320.       when @__command_partyform_index  # パーティ編成
  321.         call_partyform_flag = true
  322.       end
  323.     # パーティ編成ボタン押下
  324.     elsif KGC::LargeParty::MENU_PARTYFORM_BUTTON != nil &&
  325.         Input.trigger?(KGC::LargeParty::MENU_PARTYFORM_BUTTON)
  326.       call_partyform_flag = true
  327.       current_menu_index = @command_window.index if current_menu_index == nil
  328.     end

  329.     # パーティ編成画面に移行
  330.     if call_partyform_flag
  331.       if $game_party.members.size == 0 || !$game_party.partyform_enable?
  332.         Sound.play_buzzer
  333.         return
  334.       end
  335.       Sound.play_decision
  336.       $scene = Scene_PartyForm.new(current_menu_index)
  337.       return
  338.     end

  339.     update_command_selection_KGC_LargeParty
  340.   end
  341. end

  342. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  343. #==============================================================================
  344. # ■ Scene_Shop
  345. #==============================================================================

  346. unless $imported["HelpExtension"]
  347. class Scene_Shop < Scene_Base
  348.   #--------------------------------------------------------------------------
  349.   # ● フレーム更新
  350.   #--------------------------------------------------------------------------
  351.   alias udpate_KGC_LargeParty update
  352.   def update
  353.     # スクロール判定
  354.     if !@command_window.active &&
  355.         KGC::LargeParty::SHOP_STATUS_SCROLL_BUTTON != nil &&
  356.         Input.press?(KGC::LargeParty::SHOP_STATUS_SCROLL_BUTTON)
  357.       super
  358.       update_menu_background
  359.       update_scroll_status
  360.       return
  361.     else
  362.       @status_window.cursor_rect.empty
  363.     end

  364.     udpate_KGC_LargeParty
  365.   end
  366.   #--------------------------------------------------------------------------
  367.   # ○ ステータスウィンドウのスクロール処理
  368.   #--------------------------------------------------------------------------
  369.   def update_scroll_status
  370.     # ステータスウィンドウにカーソルを表示
  371.     @status_window.cursor_rect.width = @status_window.contents.width
  372.     @status_window.cursor_rect.height = @status_window.height - 32
  373.     @status_window.update

  374.     if Input.press?(Input::UP)
  375.       @status_window.oy = [@status_window.oy - 4, 0].max
  376.     elsif Input.press?(Input::DOWN)
  377.       max_pos = [@status_window.contents.height -
  378.         (@status_window.height - 32), 0].max
  379.       @status_window.oy = [@status_window.oy + 4, max_pos].min
  380.     end
  381.   end
  382. end
  383. end

  384. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  385. #==============================================================================
  386. # □ Scene_PartyForm
  387. #------------------------------------------------------------------------------
  388. #  パーティ編成画面の処理を行うクラスです。
  389. #==============================================================================

  390. class Scene_PartyForm < Scene_Base
  391.   #--------------------------------------------------------------------------
  392.   # ○ 定数
  393.   #--------------------------------------------------------------------------
  394.   CAPTION_OFFSET = 40  # キャプションウィンドウの位置補正
  395.   HOST_MENU   = 0      # 呼び出し元 : メニュー
  396.   HOST_MAP    = 1      # 呼び出し元 : マップ
  397.   HOST_BATTLE = 2      # 呼び出し元 : 戦闘
  398.   #--------------------------------------------------------------------------
  399.   # ● オブジェクト初期化
  400.   #     menu_index : コマンドのカーソル初期位置
  401.   #     host_scene : 呼び出し元 (0..メニュー  1..マップ  2..戦闘)
  402.   #--------------------------------------------------------------------------
  403.   def initialize(menu_index = 0, host_scene = HOST_MENU)
  404.     @menu_index = menu_index
  405.     @host_scene = host_scene
  406.   end
  407.   #--------------------------------------------------------------------------
  408.   # ● 開始処理
  409.   #--------------------------------------------------------------------------
  410.   def start
  411.     super
  412.     create_menu_background

  413.     create_windows
  414.     create_confirm_window
  415.     adjust_window_location

  416.     # 編成前のパーティを保存
  417.     @battle_actors = $game_party.battle_members.dup
  418.     @party_actors  = $game_party.all_members.dup
  419.   end
  420.   #--------------------------------------------------------------------------
  421.   # ○ ウィンドウの作成
  422.   #--------------------------------------------------------------------------
  423.   def create_windows
  424.     # 編成用ウィンドウを作成
  425.     @battle_member_window = Window_PartyFormBattleMember.new
  426.     @party_member_window  = Window_PartyFormAllMember.new
  427.     @status_window        = Window_PartyFormStatus.new
  428.     @status_window.set_actor(@battle_member_window.actor)

  429.     # その他のウィンドウを作成
  430.     @battle_member_caption_window =
  431.       Window_PartyFormCaption.new(KGC::LargeParty::BATTLE_MEMBER_CAPTION)
  432.     @party_member_caption_window =
  433.       Window_PartyFormCaption.new(KGC::LargeParty::PARTY_MEMBER_CAPTION)
  434.     @control_window = Window_PartyFormControl.new
  435.   end
  436.   #--------------------------------------------------------------------------
  437.   # ○ 確認ウィンドウの作成
  438.   #--------------------------------------------------------------------------
  439.   def create_confirm_window
  440.     commands = KGC::LargeParty::CONFIRM_WINDOW_COMMANDS
  441.     @confirm_window =
  442.       Window_Command.new(KGC::LargeParty::CONFIRM_WINDOW_WIDTH, commands)
  443.     @confirm_window.index    = 0
  444.     @confirm_window.openness = 0
  445.     @confirm_window.active   = false
  446.   end
  447.   #--------------------------------------------------------------------------
  448.   # ○ ウィンドウの座標調整
  449.   #--------------------------------------------------------------------------
  450.   def adjust_window_location
  451.     # 基準座標を計算
  452.     base_x = [@battle_member_window.width, @party_member_window.width].max
  453.     base_x = [(Graphics.width - base_x) / 2, 0].max
  454.     base_y = @battle_member_window.height + @party_member_window.height +
  455.       @status_window.height + CAPTION_OFFSET * 2
  456.     base_y = [(Graphics.height - base_y) / 2, 0].max
  457.     base_z = @menuback_sprite.z + 1000

  458.     # 編成用ウィンドウの座標をセット
  459.     @battle_member_window.x = base_x
  460.     @battle_member_window.y = base_y + CAPTION_OFFSET
  461.     @battle_member_window.z = base_z
  462.     @party_member_window.x = base_x
  463.     @party_member_window.y = @battle_member_window.y +
  464.       @battle_member_window.height + CAPTION_OFFSET
  465.     @party_member_window.z = base_z
  466.     @status_window.x = 0
  467.     @status_window.y = @party_member_window.y + @party_member_window.height
  468.     @status_window.z = base_z

  469.     # その他のウィンドウの座標をセット
  470.     @battle_member_caption_window.x = [base_x - 16, 0].max
  471.     @battle_member_caption_window.y = @battle_member_window.y - CAPTION_OFFSET
  472.     @battle_member_caption_window.z = base_z + 500
  473.     @party_member_caption_window.x = [base_x - 16, 0].max
  474.     @party_member_caption_window.y = @party_member_window.y - CAPTION_OFFSET
  475.     @party_member_caption_window.z = base_z + 500
  476.     @control_window.x = @status_window.width
  477.     @control_window.y = @status_window.y
  478.     @control_window.z = base_z

  479.     @confirm_window.x = (Graphics.width - @confirm_window.width) / 2
  480.     @confirm_window.y = (Graphics.height - @confirm_window.height) / 2
  481.     @confirm_window.z = base_z + 1000
  482.   end
  483.   #--------------------------------------------------------------------------
  484.   # ● 終了処理
  485.   #--------------------------------------------------------------------------
  486.   def terminate
  487.     super
  488.     dispose_menu_background
  489.     @battle_member_window.dispose
  490.     @party_member_window.dispose
  491.     @status_window.dispose
  492.     @battle_member_caption_window.dispose
  493.     @party_member_caption_window.dispose
  494.     @control_window.dispose
  495.     @confirm_window.dispose
  496.   end
  497.   #--------------------------------------------------------------------------
  498.   # ● メニュー画面系の背景作成
  499.   #--------------------------------------------------------------------------
  500.   def create_menu_background
  501.     super
  502.     @menuback_sprite.z = 20000
  503.   end
  504.   #--------------------------------------------------------------------------
  505.   # ● 元の画面へ戻る
  506.   #--------------------------------------------------------------------------
  507.   def return_scene
  508.     case @host_scene
  509.     when HOST_MENU
  510.       $scene = Scene_Menu.new(@menu_index)
  511.     when HOST_MAP
  512.       $scene = Scene_Map.new
  513.     when HOST_BATTLE
  514.       $scene = Scene_Battle.new
  515.     end
  516.     $game_player.refresh
  517.   end
  518.   #--------------------------------------------------------------------------
  519.   # ● フレーム更新
  520.   #--------------------------------------------------------------------------
  521.   def update
  522.     super
  523.     update_menu_background
  524.     update_window
  525.     if @battle_member_window.active
  526.       update_battle_member
  527.     elsif @party_member_window.active
  528.       update_party_member
  529.     elsif @confirm_window.active
  530.       update_confirm
  531.     end
  532.   end
  533.   #--------------------------------------------------------------------------
  534.   # ○ ウィンドウ更新
  535.   #--------------------------------------------------------------------------
  536.   def update_window
  537.     @battle_member_window.update
  538.     @party_member_window.update
  539.     @status_window.update
  540.     @battle_member_caption_window.update
  541.     @party_member_caption_window.update
  542.     @control_window.update
  543.     @confirm_window.update
  544.   end
  545.   #--------------------------------------------------------------------------
  546.   # ○ ウィンドウ再描画
  547.   #--------------------------------------------------------------------------
  548.   def refresh_window
  549.     @battle_member_window.refresh
  550.     @party_member_window.refresh
  551.   end
  552.   #--------------------------------------------------------------------------
  553.   # ○ フレーム更新 (戦闘メンバーウィンドウがアクティブの場合)
  554.   #--------------------------------------------------------------------------
  555.   def update_battle_member
  556.     @status_window.set_actor(@battle_member_window.actor)
  557.     if Input.trigger?(Input::A)
  558.       if @battle_member_window.selected_index == nil  # 並び替え中でない
  559.         actor = @battle_member_window.actor
  560.         # アクターを外せない場合
  561.         if actor == nil || $game_party.actor_fixed?(actor.id)
  562.           Sound.play_buzzer
  563.           return
  564.         end
  565.         # アクターを外す
  566.         Sound.play_decision
  567.         actors = $game_party.battle_members
  568.         actors.delete_at(@battle_member_window.index)
  569.         $game_party.set_battle_member(actors)
  570.         refresh_window
  571.       end
  572.     elsif Input.trigger?(Input::B)
  573.       if @battle_member_window.selected_index == nil  # 並び替え中でない
  574.         # 確認ウィンドウに切り替え
  575.         Sound.play_cancel
  576.         show_confirm_window
  577.       else                                            # 並び替え中
  578.         # 並び替え解除
  579.         Sound.play_cancel
  580.         @battle_member_window.selected_index = nil
  581.         @battle_member_window.refresh
  582.         @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  583.       end
  584.     elsif Input.trigger?(Input::C)
  585.       if @battle_member_window.selected_index == nil  # 並び替え中でない
  586.         actor = @battle_member_window.actor
  587.         # アクターを外せない場合
  588.         if actor != nil && $game_party.actor_fixed?(actor.id)
  589.           Sound.play_buzzer
  590.           return
  591.         end
  592.         # パーティメンバーウィンドウに切り替え
  593.         Sound.play_decision
  594.         @battle_member_window.active = false
  595.         @party_member_window.active = true
  596.         @control_window.mode = Window_PartyFormControl::MODE_PARTY_MEMBER
  597.       else                                            # 並び替え中
  598.         unless can_change_shift?(@battle_member_window.actor)
  599.           Sound.play_buzzer
  600.           return
  601.         end
  602.         # 並び替え実行
  603.         Sound.play_decision
  604.         index1 = @battle_member_window.selected_index
  605.         index2 = @battle_member_window.index
  606.         change_shift(index1, index2)
  607.         @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  608.       end
  609.     elsif Input.trigger?(Input::X)
  610.       # 並び替え不可能な場合
  611.       unless can_change_shift?(@battle_member_window.actor)
  612.         Sound.play_buzzer
  613.         return
  614.       end
  615.       if @battle_member_window.selected_index == nil  # 並び替え中でない
  616.         # 並び替え開始
  617.         Sound.play_decision
  618.         @battle_member_window.selected_index = @battle_member_window.index
  619.         @battle_member_window.refresh
  620.         @control_window.mode = Window_PartyFormControl::MODE_SHIFT_CHANGE
  621.       else                                            # 並び替え中
  622.         # 並び替え実行
  623.         Sound.play_decision
  624.         index1 = @battle_member_window.selected_index
  625.         index2 = @battle_member_window.index
  626.         change_shift(index1, index2)
  627.         @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  628.       end
  629.     end
  630.   end
  631.   #--------------------------------------------------------------------------
  632.   # ○ 並び替え可否判定
  633.   #--------------------------------------------------------------------------
  634.   def can_change_shift?(actor)
  635.     # 選択したアクターが存在しない、または並び替え不能な場合
  636.     if actor == nil ||
  637.         (KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED &&
  638.          $game_party.actor_fixed?(actor.id))
  639.       return false
  640.     end
  641.     return true
  642.   end
  643.   #--------------------------------------------------------------------------
  644.   # ○ 並び替え
  645.   #--------------------------------------------------------------------------
  646.   def change_shift(index1, index2)
  647.     # 位置を入れ替え
  648.     $game_party.change_shift(index1, index2)
  649.     # 選択済みインデックスをクリア
  650.     @battle_member_window.selected_index = nil
  651.     refresh_window
  652.   end
  653.   #--------------------------------------------------------------------------
  654.   # ○ フレーム更新 (パーティウィンドウがアクティブの場合)
  655.   #--------------------------------------------------------------------------
  656.   def update_party_member
  657.     @status_window.set_actor(@party_member_window.actor)
  658.     if Input.trigger?(Input::B)
  659.       Sound.play_cancel
  660.       # 戦闘メンバーウィンドウに切り替え
  661.       @battle_member_window.active = true
  662.       @party_member_window.active = false
  663.         @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  664.     elsif Input.trigger?(Input::C)
  665.       actor = @party_member_window.actor
  666.       # アクターが戦闘メンバーに含まれる場合
  667.       if $game_party.battle_members.include?(actor)
  668.         Sound.play_buzzer
  669.         return
  670.       end
  671.       # アクターを入れ替え
  672.       Sound.play_decision
  673.       actors = $game_party.all_members
  674.       battle_actors = $game_party.battle_members
  675.       if @battle_member_window.actor != nil
  676.         actors[@party_member_window.actor_index] = @battle_member_window.actor
  677.         actors[@battle_member_window.index] = actor
  678.         $game_party.set_member(actors.compact)
  679.       end
  680.       battle_actors[@battle_member_window.index] = actor
  681.       $game_party.set_battle_member(battle_actors.compact)
  682.       refresh_window
  683.       # 戦闘メンバーウィンドウに切り替え
  684.       @battle_member_window.active = true
  685.       @party_member_window.active = false
  686.       @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  687.     end
  688.   end
  689.   #--------------------------------------------------------------------------
  690.   # ○ フレーム更新 (確認ウィンドウがアクティブの場合)
  691.   #--------------------------------------------------------------------------
  692.   def update_confirm
  693.     if Input.trigger?(Input::B)
  694.       Sound.play_cancel
  695.       hide_confirm_window
  696.     elsif Input.trigger?(Input::C)
  697.       case @confirm_window.index
  698.       when 0  # 編成完了
  699.         # パーティが無効の場合
  700.         unless battle_member_valid?
  701.           Sound.play_buzzer
  702.           return
  703.         end
  704.         Sound.play_decision
  705.         return_scene
  706.       when 1  # 編成中断
  707.         Sound.play_decision
  708.         # パーティを編成前の状態に戻す
  709.         $game_party.set_member(@party_actors)
  710.         $game_party.set_battle_member(@battle_actors)
  711.         return_scene
  712.       when 2  # キャンセル
  713.         Sound.play_cancel
  714.         hide_confirm_window
  715.       end
  716.     end
  717.   end
  718.   #--------------------------------------------------------------------------
  719.   # ○ 戦闘メンバー有効判定
  720.   #--------------------------------------------------------------------------
  721.   def battle_member_valid?
  722.     return false if $game_party.battle_members.size == 0  # 戦闘メンバーが空
  723.     $game_party.battle_members.each { |actor|
  724.       return true if actor.exist?  # 生存者がいればOK
  725.     }
  726.     return false
  727.   end
  728.   #--------------------------------------------------------------------------
  729.   # ○ 確認ウィンドウの表示
  730.   #--------------------------------------------------------------------------
  731.   def show_confirm_window
  732.     if @battle_member_window.active
  733.       @last_active_window = @battle_member_window
  734.     else
  735.       @last_active_window = @party_member_window
  736.     end
  737.     @battle_member_window.active = false
  738.     @party_member_window.active = false

  739.     @confirm_window.draw_item(0, battle_member_valid?)
  740.     @confirm_window.open
  741.     @confirm_window.active = true
  742.   end
  743.   #--------------------------------------------------------------------------
  744.   # ○ 確認ウィンドウの非表示
  745.   #--------------------------------------------------------------------------
  746.   def hide_confirm_window
  747.     @confirm_window.active = false
  748.     @confirm_window.close
  749.     @last_active_window.active = true
  750.   end
  751. end

  752. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  753. #==============================================================================
  754. # ■ Scene_Battle
  755. #==============================================================================

  756. class Scene_Battle < Scene_Base
  757.   #--------------------------------------------------------------------------
  758.   # ● メッセージ表示が終わるまでウェイト
  759.   #--------------------------------------------------------------------------
  760.   alias wait_for_message_KGC_LargeParty wait_for_message
  761.   def wait_for_message
  762.     return if @ignore_wait_for_message  # メッセージ終了までのウェイトを無視

  763.     wait_for_message_KGC_LargeParty
  764.   end
  765.   #--------------------------------------------------------------------------
  766.   # ● レベルアップの表示
  767.   #--------------------------------------------------------------------------
  768.   alias display_level_up_KGC_LargeParty display_level_up
  769.   def display_level_up
  770.     @ignore_wait_for_message = true

  771.     display_level_up_KGC_LargeParty

  772.     exp = $game_troop.exp_total * KGC::LargeParty::STAND_BY_EXP_RATE / 1000
  773.     $game_party.stand_by_members.each { |actor|
  774.       if actor.exist?
  775.         actor.gain_exp(exp, KGC::LargeParty::SHOW_STAND_BY_LEVEL_UP)
  776.       end
  777.     }
  778.     @ignore_wait_for_message = false
  779.     wait_for_message
  780.   end
  781.   #--------------------------------------------------------------------------
  782.   # ● パーティコマンド選択の開始
  783.   #--------------------------------------------------------------------------
  784.   alias start_party_command_selection_KGC_LargeParty start_party_command_selection
  785.   def start_party_command_selection
  786.     if $game_temp.in_battle
  787.       @status_window.index = 0
  788.     end

  789.     start_party_command_selection_KGC_LargeParty
  790.   end

  791.   if KGC::LargeParty::USE_BATTLE_PARTYFORM

  792.   #--------------------------------------------------------------------------
  793.   # ● 情報表示ビューポートの作成
  794.   #--------------------------------------------------------------------------
  795.   alias create_info_viewport_KGC_LargeParty create_info_viewport
  796.   def create_info_viewport
  797.     create_info_viewport_KGC_LargeParty

  798.     @__command_partyform_index =
  799.       @party_command_window.add_command(Vocab.partyform_battle)
  800.     @party_command_window.draw_item(@__command_partyform_index,
  801.       $game_party.battle_partyform_enable?)
  802.   end
  803.   #--------------------------------------------------------------------------
  804.   # ● パーティコマンド選択の更新
  805.   #--------------------------------------------------------------------------
  806.   alias update_party_command_selection_KGC_LargeParty update_party_command_selection
  807.   def update_party_command_selection
  808.     if Input.trigger?(Input::C)
  809.       case @party_command_window.index
  810.       when @__command_partyform_index  # パーティ編成
  811.         unless $game_party.battle_partyform_enable?
  812.           Sound.play_buzzer
  813.           return
  814.         end
  815.         Sound.play_decision
  816.         process_partyform
  817.         return
  818.       end
  819.     end

  820.     update_party_command_selection_KGC_LargeParty
  821.   end
  822.   #--------------------------------------------------------------------------
  823.   # ○ パーティ編成の処理
  824.   #--------------------------------------------------------------------------
  825.   def process_partyform
  826.     prev_party_command_active = @party_command_window.active
  827.     @party_command_window.active = false
  828.     Graphics.freeze
  829.     snapshot_for_background
  830.     $scene = Scene_PartyForm.new(0, Scene_PartyForm::HOST_BATTLE)
  831.     $scene.main
  832.     $scene = self
  833.     @spriteset.update_actors
  834.     @status_window.refresh
  835.     @party_command_window.active = prev_party_command_active
  836.     Window_Base.show_cursor_animation if $imported["CursorAnimation"]
  837.     perform_transition
  838.   end
  839.   #--------------------------------------------------------------------------
  840.   # ● 敗北の処理
  841.   #--------------------------------------------------------------------------
  842.   alias process_defeat_KGC_LargeParty process_defeat
  843.   def process_defeat
  844.     process_defeat_launch

  845.     process_defeat_KGC_LargeParty if $game_party.all_dead?
  846.   end
  847.   #--------------------------------------------------------------------------
  848.   # ○ 全滅時の入れ替え処理
  849.   #--------------------------------------------------------------------------
  850.   def process_defeat_launch
  851.     while @spriteset.animation?
  852.       update_basic
  853.     end

  854.     return unless KGC::LargeParty::ENABLE_DEFEAT_LAUNCH
  855.     return unless $game_party.partyform_enable?

  856.     exist = false
  857.     $game_party.all_members.each { |actor| exist |= actor.exist? }
  858.     return unless exist  # 生存者なし

  859.     @info_viewport.visible  = false
  860.     @message_window.visible = true

  861.     # 戦闘可能者を出撃 (固定アクターは残す)
  862.     $game_party.remove_all_battle_member
  863.     max = $game_party.max_battle_member_count
  864.     while ($game_party.battle_members.size < max)
  865.       actor = $game_party.stand_by_members.find { |a| a.exist? }
  866.       break if actor == nil
  867.       $game_party.add_battle_member(actor.id)
  868.       @status_window.refresh
  869.       display_launch(actor)
  870.     end

  871.     @info_viewport.visible  = true
  872.     @message_window.visible = false
  873.     @message_window.clear
  874.   end
  875.   #--------------------------------------------------------------------------
  876.   # ○ 出撃の表示
  877.   #     target : 対象者 (アクター)
  878.   #--------------------------------------------------------------------------
  879.   def display_launch(target)
  880.     text = sprintf(Vocab::DefeatLaunch, target.name)
  881.     @message_window.add_instant_text(text)
  882.     wait(40)
  883.   end

  884.   end  # <-- if KGC::LargeParty::USE_BATTLE_PARTYFORM
  885. end
复制代码

点评

= =发现了……好象是因为脚本太长的关系……  发表于 2011-1-14 12:41
= =|| 脚本框是空的~~  发表于 2011-1-14 12:37

                 无从有中来,有从无中生。

Lv4.逐梦者

弓箭手?剑兰

梦石
0
星屑
5119
在线时间
833 小时
注册时间
2010-11-17
帖子
1140
2
发表于 2011-1-14 13:34:57 | 只看该作者
# 固定固定某一个角色
fix_actor(角色编号, true)
fix_actor(角色编号)

# 解除固定某一个角色
fix_actor(角色编号, false)

点评

成功了,非常谢谢你~认可答案。  发表于 2011-1-14 19:22
好乱~不要管下面的话  发表于 2011-1-14 16:11
无奈,把标题改了,我这个答案无效了~(我怒~)  发表于 2011-1-14 16:08
这是在事件里的脚本用法  发表于 2011-1-14 13:48

评分

参与人数 1星屑 +700 收起 理由
小幽的马甲 + 700 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
5 小时
注册时间
2011-1-8
帖子
5
3
发表于 2011-1-14 14:48:17 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
518 小时
注册时间
2010-6-16
帖子
1073
4
发表于 2011-1-14 15:54:33 | 只看该作者
这是我自己翻译的用法……
将就着看吧……
  1. call_partyform
  2. #呼叫 队员变更

  3. set_max_battle_member_count(value)
  4. #改变战斗的最大人数

  5. set_max_battle_member_count(10)
  6. # 更改战斗成员至10人

  7. set_max_battle_member_count
  8. # 恢复默认

  9. get_all_member_count[(variable_id)]
  10. #战斗成员ID总数

  11. get_all_member_count(30)
  12. # 取得战斗人数至变量[30]

  13. get_battle_member_count[(variable_id)]
  14. #搞不懂这是啥……

  15. get_stand_by_member_count[(variable_id)]
  16. #使用变量来指定战斗人数

  17. get_stand_by_member_count(32)
  18. # 取得待机人数至变量[32]

  19. party_full?
  20. #队伍已满?(用在分支)

  21. permit_partyform(enabled)
  22. #是否允许更换队员

  23. permit_partyform(true)
  24. # 队员编织许可

  25. permit_partyform(false)
  26. # 队员编织禁止

  27. fix_actor(actor_id[, fixed])
  28. #固定成员不能移除

  29. # 固定7号角色(同理)
  30. fix_actor(7, true)
  31. fix_actor(7)
  32. # 解除固定7号角色
  33. fix_actor(7, false)

  34. change_party_shift(index1, index2)
  35. #队员排列

  36. # 1号角色和2号角色更换
  37. change_party_shift(0, 1)
  38. # 2号和4号更换
  39. change_party_shift(1, 3)

  40. sort_party_member[(sort_type[, reverse])]
  41. #队员整理

  42. # 编号顺序
  43. sort_party_member
  44. sort_party_member(SORT_BY_ID)
  45. # 编号逆序
  46. sort_party_member(SORT_BY_ID, true)
  47. # 名称顺序
  48. sort_party_member(SORT_BY_NAME)
  49. # 等级顺序
  50. sort_party_member(SORT_BY_LEVEL, true)

  51. get_stand_by_member_ids
  52. #获得待机人员ID

  53. stand_by_member?(actor_id)
  54. #待机中?(用在分支)

  55. add_battle_member(actor_id, [index])
  56. #加入战斗中
  57. # 战斗开始增加战斗角色
  58. add_battle_member(3, 0)
  59. # 战斗最后增加战斗角色
  60. add_battle_member(6)

  61. remove_battle_member(actor_id)
  62. #去除战斗成员
  63. # 去除3号战斗角色
  64. remove_battle_member(3)

  65. remove_all_battle_member
  66. #去除所有战斗成员

  67. random_launch
  68. #随机战斗成员
复制代码
看完后懂得使用法了吧?
先在事件脚本中用
  1. remove_all_battle_member
复制代码
来去除所有战斗队员,
然后再用
  1. add_battle_member(actor_id, [index])
复制代码
来加入需要的战斗队员即可……

点评

好全……0 0,认可答案,非常谢谢你~  发表于 2011-1-14 19:23

评分

参与人数 1星屑 +700 收起 理由
小幽的马甲 + 700 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-9-25 02:13

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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