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

Project1

 找回密码
 注册会员
搜索
查看: 1719|回复: 4

[已经解决] vx横版战斗 队伍人数想突破4个 该怎么修改啊

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1914
在线时间
211 小时
注册时间
2009-11-10
帖子
234
发表于 2016-3-19 17:23:51 | 显示全部楼层 |阅读模式

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

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

x
谢谢各位大神 请教一个问题

vx横版战斗 队伍人数想突破4个 该怎么修改啊

Lv1.梦旅人

梦石
0
星屑
50
在线时间
53 小时
注册时间
2016-2-10
帖子
21
发表于 2016-3-19 18:33:10 | 显示全部楼层
安装KGC_LargeParty
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
53 小时
注册时间
2016-2-10
帖子
21
发表于 2016-3-19 18:40:01 | 显示全部楼层
本帖最后由 丿梁丶小柒 于 2016-3-22 14:47 编辑

帮你翻译了一下
RUBY 代码复制
  1. module KGC
  2. module LargeParty
  3.   # ◆ 队伍编成许可表示开关号码
  4.   #  这个开关ON / OFF在队伍编成的许可/不许可转换。
  5.   PARTYFORM_SWITCH          = 30
  6.   # ◆ 战斗中的队伍编成许可表示开关号码
  7.   #  ↑不同的号码和指定,在战斗中只更换可否可以设定。
  8.   BATTLE_PARTYFORM_SWITCH   = 29
  9.   # ◆ 默认许可(新游戏自动打开这些开关)
  10.   DEFAULT_PARTYFORM_ENABLED = false
  11.  
  12.   # ◆ 战斗成员最大数(默认值)
  13.   #  5以上的话,战斗画面的状态稍微看辣。
  14.   MAX_BATTLE_MEMBERS = 4
  15.   # ◆ 队友最大数
  16.   #  Game_Party::MAX_MEMBERS を上書きします。
  17.   #  100 以上にすると [Window_MenuStatus] がバグります。
  18.   MAX_MEMBERS = 8
  19.  
  20.   # ◆ 固定成员的排序禁止
  21.   #  脚本操作以外排序不了啦。
  22.   FORBID_CHANGE_SHIFT_FIXED = true
  23.  
  24.   # ◆ 待机成员的背景色
  25.   #  不改变颜色时  Color.new(0, 0, 0, 0)
  26.   STAND_BY_COLOR = Color.new(0, 0, 0, 128)
  27.   # ◆ 固定成员的背景色
  28.   FIXED_COLOR    = Color.new(255, 128, 64, 96)
  29.   # ◆ 排序时的背景色
  30.   SELECTED_COLOR = Color.new(64, 255, 128, 128)
  31.  
  32.   # ◆ 队伍编成按钮(菜单画面用)
  33.   #  菜单画面上按下这个按钮,队伍编成画面转移。
  34.   #  使用しない場合は nil
  35.   MENU_PARTYFORM_BUTTON      = Input::A
  36.   # ◆ 菜单画面追加队伍编成的指令
  37.   #  追加的地方,菜单命令的底部。
  38.   #  其他部分增加的话,≪自定义菜单命令≫请利用。
  39.   USE_MENU_PARTYFORM_COMMAND = true
  40.   # ◆ 菜单画面的队伍编成的指令卡的名称
  41.   VOCAB_MENU_PARTYFORM       = "队伍"
  42.  
  43.   # ◆ 战斗中使用队伍编成的指令
  44.   #  追加的地方,聚会指令的底部(“逃走”下)。
  45.   USE_BATTLE_PARTYFORM   = false
  46.   # ◆ 战斗中的队伍编成的指令卡的名称
  47.   VOCAB_BATTLE_PARTYFORM = "交换"
  48.  
  49.   # ◆ 全灭的自动出击时使用
  50.   #   true  : 更换,如果可能的话:幸存者出击(战斗中的编制需要)许可
  51.   #   false : 全灭的话就结束
  52.   ENABLE_DEFEAT_LAUNCH  = false
  53.   # ◆ 全灭时更换信息
  54.   #  %s : 出撃者名
  55.   DEFEAT_LAUNCH_MESSAGE = "%s继续加入战斗!"
  56.  
  57.   # ◆ 编成画面的角色绘图尺寸[宽度,高度]
  58.   #  角色的步行图形的尺寸请根据改写。
  59.   PARTY_FORM_CHARACTER_SIZE   = [40, 48]
  60.   # ◆ 编成画面的战斗成员窗口的空栏显示文本
  61.   BATTLE_MEMBER_BLANK_TEXT    = "EMPTY"
  62.   # ◆ 编成画面的队友窗口的最大行数
  63.   #  状态窗口从画面中挤出时,这个值为1。
  64.   PARTY_MEMBER_WINDOW_ROW_MAX = 2
  65.   # ◆ 编成画面的队友窗口战斗成员表示
  66.   SHOW_BATTLE_MEMBER_IN_PARTY = false
  67.   # ◆ 编成画面的队伍成员的空栏显示文本窗口
  68.   PARTY_MEMBER_BLANK_TEXT     = "-"
  69.  
  70.   # ◆ 编成画面的字幕窗口的宽度
  71.   CAPTION_WINDOW_WIDTH  = 192
  72.   # ◆ 编成画面的战斗成员窗口的字幕
  73.   BATTLE_MEMBER_CAPTION = "战斗成员"
  74.  
  75.   if SHOW_BATTLE_MEMBER_IN_PARTY
  76.     # ◆ 编成画面的队友窗口的字幕
  77.     #  SHOW_BATTLE_MEMBER_IN_PARTY = true のとき
  78.     PARTY_MEMBER_CAPTION = "队友"
  79.   else
  80.     # ◆ 编成画面的队友窗口的字幕
  81.     #  SHOW_BATTLE_MEMBER_IN_PARTY = false のとき
  82.     PARTY_MEMBER_CAPTION = "待机成员"
  83.   end
  84.  
  85.   # ◆ 编成确认窗口的宽度
  86.   CONFIRM_WINDOW_WIDTH    = 160
  87.   # ◆ 编成确认窗口的文字列
  88.   #  ※コマンド数・順番を変更するとバグります。
  89.   CONFIRM_WINDOW_COMMANDS = ["编组完毕", "编组中止", "取消"]
  90.  
  91.   # ◆ 商店画面的状态窗口滚动的时候使用的按钮
  92.   #  按这个按钮的时候,上下滚动按钮。
  93.   #  滚动无效的场合nil指定。
  94.   #  ≪帮助窗口功能扩展≫两用的时候,上引进的东西优先
  95.   SHOP_STATUS_SCROLL_BUTTON = Input::A
  96.  
  97.   # ◆ 待机成员获得经验值比例【单位:‰(千分率 1‰=0.1%)】
  98.   #  500话50.0 %。
  99.   STAND_BY_EXP_RATE = 50
  100.   # ◆ 结果画面待机成员的升级显示
  101.   #  true  : 待机成员的升级显示
  102.   #  false : 战斗成员仅显示。
  103.   SHOW_STAND_BY_LEVEL_UP = true
  104.   # ◆ 战斗以外也待机成员表示
  105.   #  true  : 战斗以外总是全部显示。
  106.   #  false : 替换以外的时间,待机成员没有的东西来对待。
  107.   SHOW_STAND_BY_MEMBER_NOT_IN_BATTLE = false
  108. end
  109. end
  110.  
  111. #==============================================================================
  112. # ☆ カスタマイズ項目終了 - Customize END ☆
  113. #==============================================================================
  114.  
  115. $imported = {} if $imported == nil
  116. $imported["LargeParty"] = true
  117.  
  118. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  119.  
  120. #==============================================================================
  121. # □ KGC::Commands
  122. #==============================================================================
  123.  
  124. module KGC
  125. module Commands
  126.   # メンバーのソート形式
  127.   SORT_BY_ID    = 0  # ID順
  128.   SORT_BY_NAME  = 1  # 名前順
  129.   SORT_BY_LEVEL = 2  # レベル順
  130.  
  131.   module_function
  132.   #--------------------------------------------------------------------------
  133.   # ○ パーティ編成画面の呼び出し
  134.   #--------------------------------------------------------------------------
  135.   def call_partyform
  136.     return if $game_temp.in_battle
  137.     $game_temp.next_scene = :partyform
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   # ○ 戦闘メンバー最大数を設定
  141.   #     value : 人数 (省略した場合はデフォルト値を使用)
  142.   #--------------------------------------------------------------------------
  143.   def set_max_battle_member_count(value = nil)
  144.     $game_party.max_battle_member_count = value
  145.   end
  146.   #--------------------------------------------------------------------------
  147.   # ○ 全メンバー数取得
  148.   #     variable_id : 取得した値を代入する変数の ID
  149.   #--------------------------------------------------------------------------
  150.   def get_all_member_count(variable_id = 0)
  151.     n = $game_party.all_members.size
  152.     if variable_id > 0
  153.       $game_variables[variable_id] = n
  154.       $game_map.need_refresh = true
  155.     end
  156.     return n
  157.   end
  158.   #--------------------------------------------------------------------------
  159.   # ○ 戦闘メンバー数取得
  160.   #     variable_id : 取得した値を代入する変数の ID
  161.   #--------------------------------------------------------------------------
  162.   def get_battle_member_count(variable_id = 0)
  163.     n = $game_party.battle_members.size
  164.     if variable_id > 0
  165.       $game_variables[variable_id] = n
  166.       $game_map.need_refresh = true
  167.     end
  168.     return n
  169.   end
  170.   #--------------------------------------------------------------------------
  171.   # ○ 待機メンバー数取得
  172.   #     variable_id : 取得した値を代入する変数の ID
  173.   #--------------------------------------------------------------------------
  174.   def get_stand_by_member_count(variable_id = 0)
  175.     n = $game_party.stand_by_members.size
  176.     if variable_id > 0
  177.       $game_variables[variable_id] = n
  178.       $game_map.need_refresh = true
  179.     end
  180.     return n
  181.   end
  182.   #--------------------------------------------------------------------------
  183.   # ○ パーティ人数が一杯か
  184.   #--------------------------------------------------------------------------
  185.   def party_full?
  186.     return $game_party.full?
  187.   end
  188.   #--------------------------------------------------------------------------
  189.   # ○ パーティ編成可否を設定
  190.   #     enabled : 有効フラグ (省略時 : true)
  191.   #--------------------------------------------------------------------------
  192.   def permit_partyform(enabled = true)
  193.     $game_switches[KGC::LargeParty::PARTYFORM_SWITCH] = enabled
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # ○ 戦闘中のパーティ編成可否を設定
  197.   #     enabled : 有効フラグ (省略時 : true)
  198.   #--------------------------------------------------------------------------
  199.   def permit_battle_partyform(enabled = true)
  200.     $game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH] = enabled
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # ○ アクターの固定状態を設定
  204.   #     actor_id : アクター ID
  205.   #     fixed    : 固定フラグ (省略時 : true)
  206.   #--------------------------------------------------------------------------
  207.   def fix_actor(actor_id, fixed = true)
  208.     $game_party.fix_actor(actor_id, fixed)
  209.   end
  210.   #--------------------------------------------------------------------------
  211.   # ○ 並び替え
  212.   #    メンバーの index1 番目と index2 番目を入れ替える
  213.   #--------------------------------------------------------------------------
  214.   def change_party_shift(index1, index2)
  215.     $game_party.change_shift(index1, index2)
  216.   end
  217.   #--------------------------------------------------------------------------
  218.   # ○ メンバー整列 (昇順)
  219.   #     sort_type : ソート形式 (SORT_BY_xxx)
  220.   #     reverse   : true だと降順
  221.   #--------------------------------------------------------------------------
  222.   def sort_party_member(sort_type = SORT_BY_ID, reverse = false)
  223.     $game_party.sort_member(sort_type, reverse)
  224.   end
  225.   #--------------------------------------------------------------------------
  226.   # ○ 待機メンバーの ID を取得
  227.   #--------------------------------------------------------------------------
  228.   def get_stand_by_member_ids
  229.     result = []
  230.     $game_party.stand_by_members.each { |actor| result << actor.id }
  231.     return result
  232.   end
  233.   #--------------------------------------------------------------------------
  234.   # ○ アクターが待機メンバーか
  235.   #     actor_id : アクター ID
  236.   #--------------------------------------------------------------------------
  237.   def stand_by_member?(actor_id)
  238.     return get_stand_by_member_ids.include?(actor_id)
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # ○ アクターを戦闘メンバーに加える
  242.   #     actor_id : アクター ID
  243.   #     index    : 追加位置 (省略時は最後尾)
  244.   #--------------------------------------------------------------------------
  245.   def add_battle_member(actor_id, index = nil)
  246.     $game_party.add_battle_member(actor_id, index)
  247.   end
  248.   #--------------------------------------------------------------------------
  249.   # ○ アクターを戦闘メンバーから外す
  250.   #     actor_id : アクター ID
  251.   #--------------------------------------------------------------------------
  252.   def remove_battle_member(actor_id)
  253.     $game_party.remove_battle_member(actor_id)
  254.   end
  255.   #--------------------------------------------------------------------------
  256.   # ○ 固定アクター以外を戦闘メンバーから外す
  257.   #--------------------------------------------------------------------------
  258.   def remove_all_battle_member
  259.     $game_party.remove_all_battle_member
  260.   end
  261.   #--------------------------------------------------------------------------
  262.   # ○ ランダム出撃
  263.   #--------------------------------------------------------------------------
  264.   def random_launch
  265.     new_battle_members = $game_party.fixed_members
  266.     candidates = $game_party.all_members - new_battle_members
  267.     num = [$game_party.max_battle_member_count - new_battle_members.size,
  268.       candidates.size].min
  269.     return if num <= 0
  270.  
  271.     # ランダムに選ぶ
  272.     ary = (0...candidates.size).to_a.sort_by { rand }
  273.     ary[0...num].each { |i| new_battle_members << candidates[i] }
  274.     $game_party.set_battle_member(new_battle_members)
  275.   end
  276. end
  277. end
  278.  
  279. class Game_Interpreter
  280.   include KGC::Commands
  281. end
  282.  
  283. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  284.  
  285. #==============================================================================
  286. # ■ Vocab
  287. #==============================================================================
  288.  
  289. module Vocab
  290.   # 全滅時の入れ替えメッセージ
  291.   DefeatLaunch = KGC::LargeParty::DEFEAT_LAUNCH_MESSAGE
  292.  
  293.   # 「パーティ編成」コマンド名 (メニュー)
  294.   def self.partyform
  295.     return KGC::LargeParty::VOCAB_MENU_PARTYFORM
  296.   end
  297.  
  298.   # 「パーティ編成」コマンド名 (戦闘)
  299.   def self.partyform_battle
  300.     return KGC::LargeParty::VOCAB_BATTLE_PARTYFORM
  301.   end
  302. end
  303.  
  304. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  305.  
  306. #==============================================================================
  307. # ■ Game_Actor
  308. #==============================================================================
  309.  
  310. class Game_Actor < Game_Battler
  311.   #--------------------------------------------------------------------------
  312.   # ○ パーティ内インデックス取得
  313.   #--------------------------------------------------------------------------
  314.   def party_index
  315.     return $game_party.all_members.index(self)
  316.   end
  317.   #--------------------------------------------------------------------------
  318.   # ○ 戦闘メンバーか判定
  319.   #--------------------------------------------------------------------------
  320.   def battle_member?
  321.     return $game_party.battle_members.include?(self)
  322.   end
  323.   #--------------------------------------------------------------------------
  324.   # ○ 固定メンバーか判定
  325.   #--------------------------------------------------------------------------
  326.   def fixed_member?
  327.     return $game_party.fixed_members.include?(self)
  328.   end
  329. end
  330.  
  331. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  332.  
  333. #==============================================================================
  334. # ■ Game_Party
  335. #==============================================================================
  336.  
  337. class Game_Party
  338.   #--------------------------------------------------------------------------
  339.   # ● 定数
  340.   #--------------------------------------------------------------------------
  341.   MAX_MEMBERS = KGC::LargeParty::MAX_MEMBERS  # 最大パーティ人数
  342.   #--------------------------------------------------------------------------
  343.   # ● オブジェクト初期化
  344.   #--------------------------------------------------------------------------
  345.   alias initialize_KGC_LargeParty initialize
  346.   def initialize
  347.     initialize_KGC_LargeParty
  348.  
  349.     @max_battle_member_count = nil
  350.     @battle_member_count = 0
  351.     @fixed_actors = []
  352.   end
  353.   #--------------------------------------------------------------------------
  354.   # ○ 戦闘メンバー最大数取得
  355.   #--------------------------------------------------------------------------
  356.   def max_battle_member_count
  357.     if @max_battle_member_count == nil
  358.       return KGC::LargeParty::MAX_BATTLE_MEMBERS
  359.     else
  360.       return @max_battle_member_count
  361.     end
  362.   end
  363.   #--------------------------------------------------------------------------
  364.   # ○ 戦闘メンバー最大数変更
  365.   #--------------------------------------------------------------------------
  366.   def max_battle_member_count=(value)
  367.     if value.is_a?(Integer)
  368.       value = [value, 1].max
  369.     end
  370.     @max_battle_member_count = value
  371.   end
  372.   #--------------------------------------------------------------------------
  373.   # ○ 戦闘メンバー数取得
  374.   #--------------------------------------------------------------------------
  375.   def battle_member_count
  376.     if @battle_member_count == nil
  377.       @battle_member_count = @actors.size
  378.     end
  379.     @battle_member_count =
  380.       [@battle_member_count, @actors.size, max_battle_member_count].min
  381.     return @battle_member_count
  382.   end
  383.   #--------------------------------------------------------------------------
  384.   # ○ 戦闘メンバー数設定
  385.   #--------------------------------------------------------------------------
  386.   def battle_member_count=(value)
  387.     @battle_member_count = [[value, 0].max,
  388.       @actors.size, max_battle_member_count].min
  389.   end
  390.   #--------------------------------------------------------------------------
  391.   # ● メンバーの取得
  392.   #--------------------------------------------------------------------------
  393.   alias members_KGC_LargeParty members
  394.   def members
  395.     if $game_temp.in_battle ||
  396.         !KGC::LargeParty::SHOW_STAND_BY_MEMBER_NOT_IN_BATTLE
  397.       return battle_members
  398.     else
  399.       return members_KGC_LargeParty
  400.     end
  401.   end
  402.   #--------------------------------------------------------------------------
  403.   # ○ 全メンバーの取得
  404.   #--------------------------------------------------------------------------
  405.   def all_members
  406.     return members_KGC_LargeParty
  407.   end
  408.   #--------------------------------------------------------------------------
  409.   # ○ 戦闘メンバーの取得
  410.   #--------------------------------------------------------------------------
  411.   def battle_members
  412.     result = []
  413.     battle_member_count.times { |i| result << $game_actors[@actors[i]] }
  414.     return result
  415.   end
  416.   #--------------------------------------------------------------------------
  417.   # ○ 待機メンバーの取得
  418.   #--------------------------------------------------------------------------
  419.   def stand_by_members
  420.     return (all_members - battle_members)
  421.   end
  422.   #--------------------------------------------------------------------------
  423.   # ○ 固定メンバーの取得
  424.   #--------------------------------------------------------------------------
  425.   def fixed_members
  426.     result = []
  427.     @fixed_actors.each { |i| result << $game_actors[i] }
  428.     return result
  429.   end
  430.   #--------------------------------------------------------------------------
  431.   # ● 初期パーティのセットアップ
  432.   #--------------------------------------------------------------------------
  433.   alias setup_starting_members_KGC_LargeParty setup_starting_members
  434.   def setup_starting_members
  435.     setup_starting_members_KGC_LargeParty
  436.  
  437.     self.battle_member_count = @actors.size
  438.   end
  439.   #--------------------------------------------------------------------------
  440.   # ● 戦闘テスト用パーティのセットアップ
  441.   #--------------------------------------------------------------------------
  442.   alias setup_battle_test_members_KGC_LargeParty setup_battle_test_members
  443.   def setup_battle_test_members
  444.     setup_battle_test_members_KGC_LargeParty
  445.  
  446.     self.battle_member_count = @actors.size
  447.   end
  448.   #--------------------------------------------------------------------------
  449.   # ○ メンバーの新規設定
  450.   #     new_member : 新しいメンバー
  451.   #--------------------------------------------------------------------------
  452.   def set_member(new_member)
  453.     @actors = []
  454.     new_member.each { |actor| @actors << actor.id }
  455.   end
  456.   #--------------------------------------------------------------------------
  457.   # ○ 戦闘メンバーの新規設定
  458.   #     new_member : 新しい戦闘メンバー
  459.   #--------------------------------------------------------------------------
  460.   def set_battle_member(new_member)
  461.     new_battle_member = []
  462.     new_member.each { |actor|
  463.       @actors.delete(actor.id)
  464.       new_battle_member << actor.id
  465.     }
  466.     @actors = new_battle_member + @actors
  467.     self.battle_member_count = new_member.size
  468.   end
  469.   #--------------------------------------------------------------------------
  470.   # ○ パーティ編成を許可しているか判定
  471.   #--------------------------------------------------------------------------
  472.   def partyform_enable?
  473.     return $game_switches[KGC::LargeParty::PARTYFORM_SWITCH]
  474.   end
  475.   #--------------------------------------------------------------------------
  476.   # ○ 戦闘中のパーティ編成を許可しているか判定
  477.   #--------------------------------------------------------------------------
  478.   def battle_partyform_enable?
  479.     return false unless partyform_enable?
  480.     return $game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH]
  481.   end
  482.   #--------------------------------------------------------------------------
  483.   # ○ メンバーが一杯か判定
  484.   #--------------------------------------------------------------------------
  485.   def full?
  486.     return (@actors.size >= MAX_MEMBERS)
  487.   end
  488.   #--------------------------------------------------------------------------
  489.   # ○ 出撃中か判定
  490.   #     actor_id : 判定するアクターの ID
  491.   #--------------------------------------------------------------------------
  492.   def actor_launched?(actor_id)
  493.     return battle_members.include?($game_actors[actor_id])
  494.   end
  495.   #--------------------------------------------------------------------------
  496.   # ○ 固定アクターか判定
  497.   #     actor_id : 判定するアクターの ID
  498.   #--------------------------------------------------------------------------
  499.   def actor_fixed?(actor_id)
  500.     return @fixed_actors.include?(actor_id)
  501.   end
  502.   #--------------------------------------------------------------------------
  503.   # ● アクターを加える
  504.   #     actor_id : アクター ID
  505.   #--------------------------------------------------------------------------
  506.   alias add_actor_KGC_LargeParty add_actor
  507.   def add_actor(actor_id)
  508.     last_size = @actors.size
  509.  
  510.     add_actor_KGC_LargeParty(actor_id)
  511.  
  512.     if last_size < @actors.size
  513.       self.battle_member_count += 1
  514.     end
  515.   end
  516.   #--------------------------------------------------------------------------
  517.   # ○ アクターを戦闘メンバーに加える
  518.   #     actor_id : アクター ID
  519.   #     index    : 追加位置 (省略時は最後尾)
  520.   #--------------------------------------------------------------------------
  521.   def add_battle_member(actor_id, index = nil)
  522.     return unless @actors.include?(actor_id)  # パーティにいない
  523.     if index == nil
  524.       return if battle_members.include?($game_actors[actor_id])  # 出撃済み
  525.       return if battle_member_count == max_battle_member_count   # 人数が最大
  526.       index = battle_member_count
  527.     end
  528.  
  529.     @actors.delete(actor_id)
  530.     @actors.insert(index, actor_id)
  531.     self.battle_member_count += 1
  532.   end
  533.   #--------------------------------------------------------------------------
  534.   # ○ アクターを戦闘メンバーから外す
  535.   #     actor_id : アクター ID
  536.   #--------------------------------------------------------------------------
  537.   def remove_battle_member(actor_id)
  538.     return unless @actors.include?(actor_id)  # パーティにいない
  539.     return if actor_fixed?(actor_id)          # 固定済み
  540.     return unless actor_launched?(actor_id)   # 待機中
  541.  
  542.     @actors.delete(actor_id)
  543.     @actors.push(actor_id)
  544.     self.battle_member_count -= 1
  545.   end
  546.   #--------------------------------------------------------------------------
  547.   # ○ アクターの固定状態を設定
  548.   #     actor_id : アクター ID
  549.   #     fixed    : 固定フラグ (省略時 : false)
  550.   #--------------------------------------------------------------------------
  551.   def fix_actor(actor_id, fixed = false)
  552.     return unless @actors.include?(actor_id)  # パーティにいない
  553.  
  554.     if fixed
  555.       # 固定
  556.       unless @fixed_actors.include?(actor_id)
  557.         @fixed_actors << actor_id
  558.         unless battle_members.include?($game_actors[actor_id])
  559.           self.battle_member_count += 1
  560.         end
  561.       end
  562.       # 強制出撃
  563.       apply_force_launch
  564.     else
  565.       # 固定解除
  566.       @fixed_actors.delete(actor_id)
  567.     end
  568.     $game_player.refresh
  569.   end
  570.   #--------------------------------------------------------------------------
  571.   # ○ 強制出撃適用
  572.   #--------------------------------------------------------------------------
  573.   def apply_force_launch
  574.     while (fixed_members - battle_members).size > 0
  575.       # 固定状態でないメンバーを適当に持ってきて入れ替え
  576.       actor1 = stand_by_members.find { |a| @fixed_actors.include?(a.id) }
  577.       actor2 = battle_members.reverse.find { |a| !@fixed_actors.include?(a.id) }
  578.       index1 = @actors.index(actor1.id)
  579.       index2 = @actors.index(actor2.id)
  580.       @actors[index1], @actors[index2] = @actors[index2], @actors[index1]
  581.  
  582.       # 戦闘メンバーが全員固定されたら戻る (無限ループ防止)
  583.       all_fixed = true
  584.       battle_members.each { |actor|
  585.         unless actor.fixed_member?
  586.           all_fixed = false
  587.           break
  588.         end
  589.       }
  590.       break if all_fixed
  591.     end
  592.   end
  593.   #--------------------------------------------------------------------------
  594.   # ○ 固定アクター以外を戦闘メンバーから外す
  595.   #--------------------------------------------------------------------------
  596.   def remove_all_battle_member
  597.     all_members.each { |actor|
  598.       remove_battle_member(actor.id) if actor_launched?(actor.id)
  599.     }
  600.   end
  601.   #--------------------------------------------------------------------------
  602.   # ○ メンバー整列 (昇順)
  603.   #     sort_type : ソート形式 (SORT_BY_xxx)
  604.   #     reverse   : true だと降順
  605.   #--------------------------------------------------------------------------
  606.   def sort_member(sort_type = KGC::Commands::SORT_BY_ID,
  607.                   reverse = false)
  608.     # バッファを準備
  609.     b_actors = battle_members
  610.     actors   = all_members - b_actors
  611.     f_actors = fixed_members
  612.     # 固定キャラはソートしない
  613.     if KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED
  614.       actors   -= f_actors
  615.       b_actors -= f_actors
  616.     end
  617.  
  618.     # ソート
  619.     case sort_type
  620.     when KGC::Commands::SORT_BY_ID     # ID順
  621.       actors.sort!   { |a, b| a.id <=> b.id }
  622.       b_actors.sort! { |a, b| a.id <=> b.id }
  623.     when KGC::Commands::SORT_BY_NAME   # 名前順
  624.       actors.sort!   { |a, b| a.name <=> b.name }
  625.       b_actors.sort! { |a, b| a.name <=> b.name }
  626.     when KGC::Commands::SORT_BY_LEVEL  # レベル順
  627.       actors.sort!   { |a, b| a.level <=> b.level }
  628.       b_actors.sort! { |a, b| a.level <=> b.level }
  629.     end
  630.     # 反転
  631.     if reverse
  632.       actors.reverse!
  633.       b_actors.reverse!
  634.     end
  635.  
  636.     # 固定キャラを先頭に持ってくる
  637.     if KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED
  638.       actors   = f_actors + actors
  639.       b_actors = f_actors + b_actors
  640.     end
  641.  
  642.     # 復帰
  643.     set_member(actors)
  644.     set_battle_member(b_actors)
  645.  
  646.     apply_force_launch
  647.     $game_player.refresh
  648.   end
  649.   #--------------------------------------------------------------------------
  650.   # ○ 並び替え
  651.   #    戦闘メンバーの index1 番目と index2 番目を入れ替える
  652.   #--------------------------------------------------------------------------
  653.   def change_shift(index1, index2)
  654.     size = @actors.size
  655.     if index1 >= size || index2 >= size
  656.       return
  657.     end
  658.     buf = @actors[index1]
  659.     @actors[index1] = @actors[index2]
  660.     @actors[index2] = buf
  661.     $game_player.refresh
  662.   end
  663.   #--------------------------------------------------------------------------
  664.   # ● 戦闘用ステートの解除 (戦闘終了時に呼び出し)
  665.   #--------------------------------------------------------------------------
  666.   def remove_states_battle
  667.     (1...$data_actors.size).each { |i|
  668.       $game_actors[i].remove_states_battle
  669.     }
  670.   end
  671. end
  672.  
  673. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  674.  
  675. #==============================================================================
  676. # ■ Window_Command
  677. #==============================================================================
  678.  
  679. class Window_Command < Window_Selectable
  680.   unless method_defined?(:add_command)
  681.   #--------------------------------------------------------------------------
  682.   # ○ コマンドを追加
  683.   #    追加した位置を返す
  684.   #--------------------------------------------------------------------------
  685.   def add_command(command)
  686.     @commands << command
  687.     @item_max = @commands.size
  688.     item_index = @item_max - 1
  689.     refresh_command
  690.     draw_item(item_index)
  691.     return item_index
  692.   end
  693.   #--------------------------------------------------------------------------
  694.   # ○ コマンドをリフレッシュ
  695.   #--------------------------------------------------------------------------
  696.   def refresh_command
  697.     buf = self.contents.clone
  698.     self.height = [self.height, row_max * WLH + 32].max
  699.     create_contents
  700.     self.contents.blt(0, 0, buf, buf.rect)
  701.     buf.dispose
  702.   end
  703.   #--------------------------------------------------------------------------
  704.   # ○ コマンドを挿入
  705.   #--------------------------------------------------------------------------
  706.   def insert_command(index, command)
  707.     @commands.insert(index, command)
  708.     @item_max = @commands.size
  709.     refresh_command
  710.     refresh
  711.   end
  712.   #--------------------------------------------------------------------------
  713.   # ○ コマンドを削除
  714.   #--------------------------------------------------------------------------
  715.   def remove_command(command)
  716.     @commands.delete(command)
  717.     @item_max = @commands.size
  718.     refresh
  719.   end
  720.   end
  721. end
  722.  
  723. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  724.  
  725. #==============================================================================
  726. # ■ Window_MenuStatus
  727. #==============================================================================
  728.  
  729. class Window_MenuStatus < Window_Selectable
  730.   #--------------------------------------------------------------------------
  731.   # ● 定数
  732.   #--------------------------------------------------------------------------
  733.   STATUS_HEIGHT = 96  # ステータス一人分の高さ
  734.   #--------------------------------------------------------------------------
  735.   # ● ウィンドウ内容の作成
  736.   #--------------------------------------------------------------------------
  737.   def create_contents
  738.     self.contents.dispose
  739.     self.contents = Bitmap.new(width - 32,
  740.       [height - 32, row_max * STATUS_HEIGHT].max)
  741.   end
  742.   #--------------------------------------------------------------------------
  743.   # ● 先頭の行の取得
  744.   #--------------------------------------------------------------------------
  745.   def top_row
  746.     return self.oy / STATUS_HEIGHT
  747.   end
  748.   #--------------------------------------------------------------------------
  749.   # ● 先頭の行の設定
  750.   #     row : 先頭に表示する行
  751.   #--------------------------------------------------------------------------
  752.   def top_row=(row)
  753.     super(row)
  754.     self.oy = self.oy / WLH * STATUS_HEIGHT
  755.   end
  756.   #--------------------------------------------------------------------------
  757.   # ● 1 ページに表示できる行数の取得
  758.   #--------------------------------------------------------------------------
  759.   def page_row_max
  760.     return (self.height - 32) / STATUS_HEIGHT
  761.   end
  762.   #--------------------------------------------------------------------------
  763.   # ● 項目を描画する矩形の取得
  764.   #     index : 項目番号
  765.   #--------------------------------------------------------------------------
  766.   def item_rect(index)
  767.     rect = super(index)
  768.     rect.height = STATUS_HEIGHT
  769.     rect.y = index / @column_max * STATUS_HEIGHT
  770.     return rect
  771.   end
  772.   #--------------------------------------------------------------------------
  773.   # ● リフレッシュ
  774.   #--------------------------------------------------------------------------
  775.   def refresh
  776.     @item_max = $game_party.members.size
  777.     create_contents
  778.     fill_stand_by_background
  779.     draw_member
  780.   end
  781.   #--------------------------------------------------------------------------
  782.   # ○ パーティメンバー描画
  783.   #--------------------------------------------------------------------------
  784.   def draw_member
  785.     for actor in $game_party.members
  786.       draw_actor_face(actor, 2, actor.party_index * 96 + 2, 92)
  787.       x = 104
  788.       y = actor.party_index * 96 + WLH / 2
  789.       draw_actor_name(actor, x, y)
  790.       draw_actor_class(actor, x + 120, y)
  791.       draw_actor_level(actor, x, y + WLH * 1)
  792.       draw_actor_state(actor, x, y + WLH * 2)
  793.       draw_actor_hp(actor, x + 120, y + WLH * 1)
  794.       draw_actor_mp(actor, x + 120, y + WLH * 2)
  795.     end
  796.   end
  797.   #--------------------------------------------------------------------------
  798.   # ○ 待機メンバーの背景色を塗る
  799.   #--------------------------------------------------------------------------
  800.   def fill_stand_by_background
  801.     color = KGC::LargeParty::STAND_BY_COLOR
  802.     dy = STATUS_HEIGHT * $game_party.battle_members.size
  803.     dh = STATUS_HEIGHT * $game_party.stand_by_members.size
  804.     if dh > 0
  805.       self.contents.fill_rect(0, dy, self.width - 32, dh, color)
  806.     end
  807.   end
  808.   #--------------------------------------------------------------------------
  809.   # ● カーソルの更新
  810.   #--------------------------------------------------------------------------
  811.   def update_cursor
  812.     if @index < 0               # カーソルなし
  813.       self.cursor_rect.empty
  814.     elsif @index < @item_max    # 通常
  815.       super
  816.     elsif @index >= 100         # 自分
  817.       self.cursor_rect.set(0, (@index - 100) * STATUS_HEIGHT,
  818.         contents.width, STATUS_HEIGHT)
  819.     else                        # 全体
  820.       self.cursor_rect.set(0, 0, contents.width, @item_max * STATUS_HEIGHT)
  821.     end
  822.   end
  823. end
  824.  
  825. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  826.  
  827. #==============================================================================
  828. # ■ Window_ShopStatus
  829. #==============================================================================
  830.  
  831. class Window_ShopStatus < Window_Base
  832.   #--------------------------------------------------------------------------
  833.   # ● ウィンドウ内容の作成
  834.   #--------------------------------------------------------------------------
  835.   def create_contents
  836.     self.contents.dispose
  837.     self.contents = Bitmap.new(width - 32,
  838.       WLH * ($game_party.members.size + 1) * 2)
  839.   end
  840. end
  841.  
  842. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  843.  
  844. #==============================================================================
  845. # ■ Window_BattleStatus
  846. #==============================================================================
  847.  
  848. class Window_BattleStatus < Window_Selectable
  849.   #--------------------------------------------------------------------------
  850.   # ● ウィンドウ内容の作成
  851.   #--------------------------------------------------------------------------
  852.   def create_contents
  853.     self.contents.dispose
  854.     self.contents = Bitmap.new(width - 32,
  855.       [WLH * $game_party.members.size, height - 32].max)
  856.   end
  857.   #--------------------------------------------------------------------------
  858.   # ● リフレッシュ
  859.   #--------------------------------------------------------------------------
  860.   alias refresh_KGC_LargeParty refresh
  861.   def refresh
  862.     create_contents
  863.  
  864.     refresh_KGC_LargeParty
  865.   end
  866. end
  867.  
  868. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  869.  
  870. #==============================================================================
  871. # □ Window_PartyFormCaption
  872. #------------------------------------------------------------------------------
  873. #  パーティ編成画面でウィンドウのキャプションを表示するウィンドウです。
  874. #==============================================================================
  875.  
  876. class Window_PartyFormCaption < Window_Base
  877.   #--------------------------------------------------------------------------
  878.   # ● オブジェクト初期化
  879.   #     caption : 表示するキャプション
  880.   #--------------------------------------------------------------------------
  881.   def initialize(caption = "")
  882.     super(0, 0, KGC::LargeParty::CAPTION_WINDOW_WIDTH, WLH + 32)
  883.     @caption = caption
  884.     refresh
  885.   end
  886.   #--------------------------------------------------------------------------
  887.   # ● リフレッシュ
  888.   #--------------------------------------------------------------------------
  889.   def refresh
  890.     self.contents.clear
  891.     self.contents.draw_text(0, 0, width - 32, WLH, @caption)
  892.   end
  893. end
  894.  
  895. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  896.  
  897. #==============================================================================
  898. # □ Window_PartyFormMember
  899. #------------------------------------------------------------------------------
  900. #  パーティ編成画面でメンバーを表示するウィンドウです。
  901. #==============================================================================
  902.  
  903. class Window_PartyFormMember < Window_Selectable
  904.   #--------------------------------------------------------------------------
  905.   # ○ 定数
  906.   #--------------------------------------------------------------------------
  907.   DRAW_SIZE = KGC::LargeParty::PARTY_FORM_CHARACTER_SIZE
  908.   #--------------------------------------------------------------------------
  909.   # ● 公開インスタンス変数
  910.   #--------------------------------------------------------------------------
  911.   attr_accessor :selected_index           # 選択済みインデックス
  912.   #--------------------------------------------------------------------------
  913.   # ● オブジェクト初期化
  914.   #     x       : ウィンドウの X 座標
  915.   #     y       : ウィンドウの Y 座標
  916.   #     width   : ウィンドウの幅
  917.   #     height  : ウィンドウの高さ
  918.   #     spacing : 横に項目が並ぶときの空白の幅
  919.   #--------------------------------------------------------------------------
  920.   def initialize(x, y, width, height, spacing = 8)
  921.     super(x, y, width, height, spacing)
  922.   end
  923.   #--------------------------------------------------------------------------
  924.   # ● ウィンドウ内容の作成
  925.   #--------------------------------------------------------------------------
  926.   def create_contents
  927.     self.contents.dispose
  928.     self.contents = Bitmap.new(width - 32,
  929.       [height - 32, row_max * DRAW_SIZE[1]].max)
  930.   end
  931.   #--------------------------------------------------------------------------
  932.   # ● 先頭の行の取得
  933.   #--------------------------------------------------------------------------
  934.   def top_row
  935.     return self.oy / DRAW_SIZE[1]
  936.   end
  937.   #--------------------------------------------------------------------------
  938.   # ● 先頭の行の設定
  939.   #     row : 先頭に表示する行
  940.   #--------------------------------------------------------------------------
  941.   def top_row=(row)
  942.     super(row)
  943.     self.oy = self.oy / WLH * DRAW_SIZE[1]
  944.   end
  945.   #--------------------------------------------------------------------------
  946.   # ● 1 ページに表示できる行数の取得
  947.   #--------------------------------------------------------------------------
  948.   def page_row_max
  949.     return (self.height - 32) / DRAW_SIZE[1]
  950.   end
  951.   #--------------------------------------------------------------------------
  952.   # ● 項目を描画する矩形の取得
  953.   #     index : 項目番号
  954.   #--------------------------------------------------------------------------
  955.   def item_rect(index)
  956.     rect = super(index)
  957.     rect.width = DRAW_SIZE[0]
  958.     rect.height = DRAW_SIZE[1]
  959.     rect.y = index / @column_max * DRAW_SIZE[1]
  960.     return rect
  961.   end
  962.   #--------------------------------------------------------------------------
  963.   # ○ 選択アクター取得
  964.   #--------------------------------------------------------------------------
  965.   def actor
  966.     return @actors[self.index]
  967.   end
  968.   #--------------------------------------------------------------------------
  969.   # ● リフレッシュ
  970.   #--------------------------------------------------------------------------
  971.   def refresh
  972.     self.contents.clear
  973.     restore_member_list
  974.     draw_member
  975.   end
  976.   #--------------------------------------------------------------------------
  977.   # ○ メンバーリスト修復
  978.   #--------------------------------------------------------------------------
  979.   def restore_member_list
  980.     # 継承先で定義
  981.   end
  982.   #--------------------------------------------------------------------------
  983.   # ○ メンバー描画
  984.   #--------------------------------------------------------------------------
  985.   def draw_member
  986.     # 継承先で定義
  987.   end
  988.   #--------------------------------------------------------------------------
  989.   # ○ 空欄アクター描画
  990.   #     index : 項目番号
  991.   #--------------------------------------------------------------------------
  992.   def draw_empty_actor(index)
  993.     # 継承先で定義
  994.   end
  995.   #--------------------------------------------------------------------------
  996.   # ○ 固定キャラ背景描画
  997.   #     index : 項目番号
  998.   #--------------------------------------------------------------------------
  999.   def draw_fixed_back(index)
  1000.     rect = item_rect(index)
  1001.     self.contents.fill_rect(rect, KGC::LargeParty::FIXED_COLOR)
  1002.   end
  1003.   #--------------------------------------------------------------------------
  1004.   # ○ 選択中キャラ背景描画
  1005.   #     index : 項目番号
  1006.   #--------------------------------------------------------------------------
  1007.   def draw_selected_back(index)
  1008.     rect = item_rect(index)
  1009.     self.contents.fill_rect(rect, KGC::LargeParty::SELECTED_COLOR)
  1010.   end
  1011. end
  1012.  
  1013. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  1014.  
  1015. #==============================================================================
  1016. # □ Window_PartyFormBattleMember
  1017. #------------------------------------------------------------------------------
  1018. #  パーティ編成画面で戦闘メンバーを表示するウィンドウです。
  1019. #==============================================================================
  1020.  
  1021. class Window_PartyFormBattleMember < Window_PartyFormMember
  1022.   #--------------------------------------------------------------------------
  1023.   # ● 公開インスタンス変数
  1024.   #--------------------------------------------------------------------------
  1025.   attr_accessor :selected_index           # 選択済みインデックス
  1026.   #--------------------------------------------------------------------------
  1027.   # ● オブジェクト初期化
  1028.   #--------------------------------------------------------------------------
  1029.   def initialize
  1030.     super(0, 0, 64, DRAW_SIZE[1] + 32)
  1031.     column_width = DRAW_SIZE[0] + @spacing
  1032.     nw = [column_width * $game_party.max_battle_member_count + 32,
  1033.       Graphics.width].min
  1034.     self.width = nw
  1035.  
  1036.     @item_max = $game_party.max_battle_member_count
  1037.     @column_max = width / column_width
  1038.     @selected_index = nil
  1039.     create_contents
  1040.     refresh
  1041.     self.active = true
  1042.     self.index = 0
  1043.   end
  1044.   #--------------------------------------------------------------------------
  1045.   # ○ メンバーリスト修復
  1046.   #--------------------------------------------------------------------------
  1047.   def restore_member_list
  1048.     @actors = $game_party.battle_members
  1049.   end
  1050.   #--------------------------------------------------------------------------
  1051.   # ○ メンバー描画
  1052.   #--------------------------------------------------------------------------
  1053.   def draw_member
  1054.     @item_max.times { |i|
  1055.       actor = @actors[i]
  1056.       if actor == nil
  1057.         draw_empty_actor(i)
  1058.       else
  1059.         if i == @selected_index
  1060.           draw_selected_back(i)
  1061.         elsif $game_party.actor_fixed?(actor.id)
  1062.           draw_fixed_back(i)
  1063.         end
  1064.         rect = item_rect(i)
  1065.         draw_actor_graphic(actor,
  1066.           rect.x + DRAW_SIZE[0] / 2,
  1067.           rect.y + DRAW_SIZE[1] - 4)
  1068.       end
  1069.     }
  1070.   end
  1071.   #--------------------------------------------------------------------------
  1072.   # ○ 空欄アクター描画
  1073.   #     index : 項目番号
  1074.   #--------------------------------------------------------------------------
  1075.   def draw_empty_actor(index)
  1076.     rect = item_rect(index)
  1077.     self.contents.font.color = system_color
  1078.     self.contents.draw_text(rect, KGC::LargeParty::BATTLE_MEMBER_BLANK_TEXT, 1)
  1079.     self.contents.font.color = normal_color
  1080.   end
  1081. end
  1082.  
  1083. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  1084.  
  1085. #==============================================================================
  1086. # □ Window_PartyFormAllMember
  1087. #------------------------------------------------------------------------------
  1088. #  パーティ編成画面で全メンバーを表示するウィンドウです。
  1089. #==============================================================================
  1090.  
  1091. class Window_PartyFormAllMember < Window_PartyFormMember
  1092.   #--------------------------------------------------------------------------
  1093.   # ● オブジェクト初期化
  1094.   #--------------------------------------------------------------------------
  1095.   def initialize
  1096.     super(0, 0, 64, 64)
  1097.     restore_member_list
  1098.     @item_max = $game_party.all_members.size
  1099.  
  1100.     # 各種サイズ計算
  1101.     column_width = DRAW_SIZE[0] + @spacing
  1102.     sw = [@item_max * column_width + 32, Graphics.width].min
  1103.     @column_max = (sw - 32) / column_width
  1104.     sh = ([@item_max - 1, 0].max / @column_max + 1) * DRAW_SIZE[1] + 32
  1105.     sh = [sh, DRAW_SIZE[1] * KGC::LargeParty::PARTY_MEMBER_WINDOW_ROW_MAX + 32].min
  1106.  
  1107.     # 座標・サイズ調整
  1108.     self.y += DRAW_SIZE[1] + 32
  1109.     self.width = sw
  1110.     self.height = sh
  1111.  
  1112.     create_contents
  1113.     refresh
  1114.     self.active = false
  1115.     self.index = 0
  1116.   end
  1117.   #--------------------------------------------------------------------------
  1118.   # ○ 選択しているアクターのインデックス取得
  1119.   #--------------------------------------------------------------------------
  1120.   def actor_index
  1121.     return @index_offset + self.index
  1122.   end
  1123.   #--------------------------------------------------------------------------
  1124.   # ○ メンバーリスト修復
  1125.   #--------------------------------------------------------------------------
  1126.   def restore_member_list
  1127.     if KGC::LargeParty::SHOW_BATTLE_MEMBER_IN_PARTY
  1128.       @actors = $game_party.all_members
  1129.       @index_offset = 0
  1130.     else
  1131.       @actors = $game_party.stand_by_members
  1132.       @index_offset = $game_party.battle_members.size
  1133.     end
  1134.   end
  1135.   #--------------------------------------------------------------------------
  1136.   # ○ メンバー描画
  1137.   #--------------------------------------------------------------------------
  1138.   def draw_member
  1139.     @item_max.times { |i|
  1140.       actor = @actors[i]
  1141.       if actor == nil
  1142.         draw_empty_actor(i)
  1143.         next
  1144.       end
  1145.  
  1146.       if $game_party.actor_fixed?(actor.id)
  1147.         draw_fixed_back(i)
  1148.       end
  1149.       rect = item_rect(i)
  1150.       opacity = ($game_party.battle_members.include?(actor) ? 96 : 255)
  1151.       draw_actor_graphic(actor,
  1152.         rect.x + DRAW_SIZE[0] / 2,
  1153.         rect.y + DRAW_SIZE[1] - 4,
  1154.         opacity)
  1155.     }
  1156.   end
  1157.   #--------------------------------------------------------------------------
  1158.   # ● アクターの歩行グラフィック描画
  1159.   #     actor   : アクター
  1160.   #     x       : 描画先 X 座標
  1161.   #     y       : 描画先 Y 座標
  1162.   #     opacity : 不透明度
  1163.   #--------------------------------------------------------------------------
  1164.   def draw_actor_graphic(actor, x, y, opacity = 255)
  1165.     draw_character(actor.character_name, actor.character_index, x, y, opacity)
  1166.   end
  1167.   #--------------------------------------------------------------------------
  1168.   # ● 歩行グラフィックの描画
  1169.   #     character_name  : 歩行グラフィック ファイル名
  1170.   #     character_index : 歩行グラフィック インデックス
  1171.   #     x               : 描画先 X 座標
  1172.   #     y               : 描画先 Y 座標
  1173.   #     opacity         : 不透明度
  1174.   #--------------------------------------------------------------------------
  1175.   def draw_character(character_name, character_index, x, y, opacity = 255)
  1176.     return if character_name == nil
  1177.     bitmap = Cache.character(character_name)
  1178.     sign = character_name[/^[\!\$]./]
  1179.     if sign != nil and sign.include?('$')
  1180.       cw = bitmap.width / 3
  1181.       ch = bitmap.height / 4
  1182.     else
  1183.       cw = bitmap.width / 12
  1184.       ch = bitmap.height / 8
  1185.     end
  1186.     n = character_index
  1187.     src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  1188.     self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
  1189.   end
  1190.   #--------------------------------------------------------------------------
  1191.   # ○ 空欄アクター描画
  1192.   #     index : 項目番号
  1193.   #--------------------------------------------------------------------------
  1194.   def draw_empty_actor(index)
  1195.     rect = item_rect(index)
  1196.     self.contents.font.color = system_color
  1197.     self.contents.draw_text(rect, KGC::LargeParty::PARTY_MEMBER_BLANK_TEXT, 1)
  1198.     self.contents.font.color = normal_color
  1199.   end
  1200. end
  1201.  
  1202. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  1203.  
  1204. #==============================================================================
  1205. # □ Window_PartyFormStatus
  1206. #------------------------------------------------------------------------------
  1207. #  パーティ編成画面でアクターのステータスを表示するウィンドウです。
  1208. #==============================================================================
  1209.  
  1210. class Window_PartyFormStatus < Window_Base
  1211.   #--------------------------------------------------------------------------
  1212.   # ● オブジェクト初期化
  1213.   #--------------------------------------------------------------------------
  1214.   def initialize
  1215.     super(0, 0, 384, 128)
  1216.     self.z = 1000
  1217.     @actor = nil
  1218.     refresh
  1219.   end
  1220.   #--------------------------------------------------------------------------
  1221.   # ○ アクター設定
  1222.   #--------------------------------------------------------------------------
  1223.   def set_actor(actor)
  1224.     if @actor != actor
  1225.       @actor = actor
  1226.       refresh
  1227.     end
  1228.   end
  1229.   #--------------------------------------------------------------------------
  1230.   # ● リフレッシュ
  1231.   #--------------------------------------------------------------------------
  1232.   def refresh
  1233.     self.contents.clear
  1234.     if @actor == nil
  1235.       return
  1236.     end
  1237.  
  1238.     draw_actor_face(@actor, 0, 0)
  1239.     dx = 104
  1240.     draw_actor_name(@actor, dx, 0)
  1241.     draw_actor_level(@actor, dx, WLH * 1)
  1242.     draw_actor_hp(@actor, dx, WLH * 2)
  1243.     draw_actor_mp(@actor, dx, WLH * 3)
  1244.     4.times { |i|
  1245.       draw_actor_parameter(@actor, dx + 128, WLH * i, i, 120)
  1246.     }
  1247.   end
  1248.   #--------------------------------------------------------------------------
  1249.   # ● 能力値の描画
  1250.   #     actor : アクター
  1251.   #     x     : 描画先 X 座標
  1252.   #     y     : 描画先 Y 座標
  1253.   #     type  : 能力値の種類 (0~3)
  1254.   #     width : 描画幅
  1255.   #--------------------------------------------------------------------------
  1256.   def draw_actor_parameter(actor, x, y, type, width = 156)
  1257.     case type
  1258.     when 0
  1259.       parameter_name = Vocab::atk
  1260.       parameter_value = actor.atk
  1261.     when 1
  1262.       parameter_name = Vocab::def
  1263.       parameter_value = actor.def
  1264.     when 2
  1265.       parameter_name = Vocab::spi
  1266.       parameter_value = actor.spi
  1267.     when 3
  1268.       parameter_name = Vocab::agi
  1269.       parameter_value = actor.agi
  1270.     end
  1271.     nw = width - 36
  1272.     self.contents.font.color = system_color
  1273.     self.contents.draw_text(x, y, nw, WLH, parameter_name)
  1274.     self.contents.font.color = normal_color
  1275.     self.contents.draw_text(x + nw, y, 36, WLH, parameter_value, 2)
  1276.   end
  1277. end
  1278.  
  1279. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  1280.  
  1281. #==============================================================================
  1282. # □ Window_PartyFormControl
  1283. #------------------------------------------------------------------------------
  1284. #  パーティ編成画面で操作方法を表示するウィンドウです。
  1285. #==============================================================================
  1286.  
  1287. class Window_PartyFormControl < Window_Base
  1288.   #--------------------------------------------------------------------------
  1289.   # ○ 定数
  1290.   #--------------------------------------------------------------------------
  1291.   MODE_BATTLE_MEMBER = 0
  1292.   MODE_SHIFT_CHANGE  = 1
  1293.   MODE_PARTY_MEMBER  = 2
  1294.   #--------------------------------------------------------------------------
  1295.   # ● オブジェクト初期化
  1296.   #--------------------------------------------------------------------------
  1297.   def initialize
  1298.     super(0, 0, Graphics.width - 384, 128)
  1299.     self.z = 1000
  1300.     @mode = MODE_BATTLE_MEMBER
  1301.     refresh
  1302.   end
  1303.   #--------------------------------------------------------------------------
  1304.   # ○ モード変更
  1305.   #--------------------------------------------------------------------------
  1306.   def mode=(value)
  1307.     @mode = value
  1308.     refresh
  1309.   end
  1310.   #--------------------------------------------------------------------------
  1311.   # ● リフレッシュ
  1312.   #--------------------------------------------------------------------------
  1313.   def refresh
  1314.     self.contents.clear
  1315.     case @mode
  1316.     when MODE_BATTLE_MEMBER  # 戦闘メンバー
  1317.       buttons = [
  1318.         "A: 离开",
  1319.         "B: 结束",
  1320.         "C: 确认",
  1321.         "X: 替换排列"
  1322.       ]
  1323.     when MODE_SHIFT_CHANGE   # 並び替え
  1324.       buttons = [
  1325.         "B: 取消",
  1326.         "C: 确认",
  1327.         "X: 确认"
  1328.       ]
  1329.     when MODE_PARTY_MEMBER   # パーティメンバー
  1330.       buttons = [
  1331.         "B: 取消",
  1332.         "C: 确认"
  1333.       ]
  1334.     else
  1335.       return
  1336.     end
  1337.  
  1338.     buttons.each_with_index { |c, i|
  1339.       self.contents.draw_text(0, WLH * i, width - 32, WLH, c)
  1340.     }
  1341.   end
  1342. end
  1343.  
  1344. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  1345.  
  1346. #==============================================================================
  1347. # ■ Scene_Title
  1348. #==============================================================================
  1349.  
  1350. class Scene_Title < Scene_Base
  1351.   #--------------------------------------------------------------------------
  1352.   # ● 各種ゲームオブジェクトの作成
  1353.   #--------------------------------------------------------------------------
  1354.   alias create_game_objects_KGC_LargeParty create_game_objects
  1355.   def create_game_objects
  1356.     create_game_objects_KGC_LargeParty
  1357.  
  1358.     if KGC::LargeParty::DEFAULT_PARTYFORM_ENABLED
  1359.       $game_switches[KGC::LargeParty::PARTYFORM_SWITCH] = true
  1360.       $game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH] = true
  1361.     end
  1362.   end
  1363. end
  1364.  
  1365. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  1366.  
  1367. #==============================================================================
  1368. # ■ Scene_Map
  1369. #==============================================================================
  1370.  
  1371. class Scene_Map < Scene_Base
  1372.   #--------------------------------------------------------------------------
  1373.   # ● 画面切り替えの実行
  1374.   #--------------------------------------------------------------------------
  1375.   alias update_scene_change_KGC_LargeParty update_scene_change
  1376.   def update_scene_change
  1377.     return if $game_player.moving?    # プレイヤーの移動中?
  1378.  
  1379.     if $game_temp.next_scene == :partyform
  1380.       call_partyform
  1381.       return
  1382.     end
  1383.  
  1384.     update_scene_change_KGC_LargeParty
  1385.   end
  1386.   #--------------------------------------------------------------------------
  1387.   # ○ パーティ編成画面への切り替え
  1388.   #--------------------------------------------------------------------------
  1389.   def call_partyform
  1390.     $game_temp.next_scene = nil
  1391.     $scene = Scene_PartyForm.new(0, Scene_PartyForm::HOST_MAP)
  1392.   end
  1393. end
  1394.  
  1395. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  1396.  
  1397. #==============================================================================
  1398. # ■ Scene_Menu
  1399. #==============================================================================
  1400.  
  1401. class Scene_Menu < Scene_Base
  1402.   if KGC::LargeParty::USE_MENU_PARTYFORM_COMMAND
  1403.   #--------------------------------------------------------------------------
  1404.   # ● コマンドウィンドウの作成
  1405.   #--------------------------------------------------------------------------
  1406.   alias create_command_window_KGC_LargeParty create_command_window
  1407.   def create_command_window
  1408.     create_command_window_KGC_LargeParty
  1409.  
  1410.     return if $imported["CustomMenuCommand"]
  1411.  
  1412.     @__command_partyform_index =
  1413.       @command_window.add_command(Vocab.partyform)
  1414.     @command_window.draw_item(@__command_partyform_index,
  1415.       $game_party.partyform_enable?)
  1416.     if @command_window.oy > 0
  1417.       @command_window.oy -= Window_Base::WLH
  1418.     end
  1419.     @command_window.index = @menu_index
  1420.   end
  1421.   end
  1422.   #--------------------------------------------------------------------------
  1423.   # ● コマンド選択の更新
  1424.   #--------------------------------------------------------------------------
  1425.   alias update_command_selection_KGC_LargeParty update_command_selection
  1426.   def update_command_selection
  1427.     current_menu_index = @__command_partyform_index
  1428.     call_partyform_flag = false
  1429.  
  1430.     if Input.trigger?(Input::C)
  1431.       case @command_window.index
  1432.       when @__command_partyform_index  # パーティ編成
  1433.         call_partyform_flag = true
  1434.       end
  1435.     # パーティ編成ボタン押下
  1436.     elsif KGC::LargeParty::MENU_PARTYFORM_BUTTON != nil &&
  1437.         Input.trigger?(KGC::LargeParty::MENU_PARTYFORM_BUTTON)
  1438.       call_partyform_flag = true
  1439.       current_menu_index = @command_window.index if current_menu_index == nil
  1440.     end
  1441.  
  1442.     # パーティ編成画面に移行
  1443.     if call_partyform_flag
  1444.       if $game_party.members.size == 0 || !$game_party.partyform_enable?
  1445.         Sound.play_buzzer
  1446.         return
  1447.       end
  1448.       Sound.play_decision
  1449.       $scene = Scene_PartyForm.new(current_menu_index)
  1450.       return
  1451.     end
  1452.  
  1453.     update_command_selection_KGC_LargeParty
  1454.   end
  1455. end
  1456.  
  1457. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  1458.  
  1459. #==============================================================================
  1460. # ■ Scene_Shop
  1461. #==============================================================================
  1462.  
  1463. unless $imported["HelpExtension"]
  1464. class Scene_Shop < Scene_Base
  1465.   #--------------------------------------------------------------------------
  1466.   # ● フレーム更新
  1467.   #--------------------------------------------------------------------------
  1468.   alias udpate_KGC_LargeParty update
  1469.   def update
  1470.     # スクロール判定
  1471.     if !@command_window.active &&
  1472.         KGC::LargeParty::SHOP_STATUS_SCROLL_BUTTON != nil &&
  1473.         Input.press?(KGC::LargeParty::SHOP_STATUS_SCROLL_BUTTON)
  1474.       super
  1475.       update_menu_background
  1476.       update_scroll_status
  1477.       return
  1478.     else
  1479.       @status_window.cursor_rect.empty
  1480.     end
  1481.  
  1482.     udpate_KGC_LargeParty
  1483.   end
  1484.   #--------------------------------------------------------------------------
  1485.   # ○ ステータスウィンドウのスクロール処理
  1486.   #--------------------------------------------------------------------------
  1487.   def update_scroll_status
  1488.     # ステータスウィンドウにカーソルを表示
  1489.     @status_window.cursor_rect.width = @status_window.contents.width
  1490.     @status_window.cursor_rect.height = @status_window.height - 32
  1491.     @status_window.update
  1492.  
  1493.     if Input.press?(Input::UP)
  1494.       @status_window.oy = [@status_window.oy - 4, 0].max
  1495.     elsif Input.press?(Input::DOWN)
  1496.       max_pos = [@status_window.contents.height -
  1497.         (@status_window.height - 32), 0].max
  1498.       @status_window.oy = [@status_window.oy + 4, max_pos].min
  1499.     end
  1500.   end
  1501. end
  1502. end
  1503.  
  1504. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  1505.  
  1506. #==============================================================================
  1507. # □ Scene_PartyForm
  1508. #------------------------------------------------------------------------------
  1509. #  パーティ編成画面の処理を行うクラスです。
  1510. #==============================================================================
  1511.  
  1512. class Scene_PartyForm < Scene_Base
  1513.   #--------------------------------------------------------------------------
  1514.   # ○ 定数
  1515.   #--------------------------------------------------------------------------
  1516.   CAPTION_OFFSET = 40  # キャプションウィンドウの位置補正
  1517.   HOST_MENU   = 0      # 呼び出し元 : メニュー
  1518.   HOST_MAP    = 1      # 呼び出し元 : マップ
  1519.   HOST_BATTLE = 2      # 呼び出し元 : 戦闘
  1520.   #--------------------------------------------------------------------------
  1521.   # ● オブジェクト初期化
  1522.   #     menu_index : コマンドのカーソル初期位置
  1523.   #     host_scene : 呼び出し元 (0..メニュー  1..マップ  2..戦闘)
  1524.   #--------------------------------------------------------------------------
  1525.   def initialize(menu_index = 0, host_scene = HOST_MENU)
  1526.     @menu_index = menu_index
  1527.     @host_scene = host_scene
  1528.   end
  1529.   #--------------------------------------------------------------------------
  1530.   # ● 開始処理
  1531.   #--------------------------------------------------------------------------
  1532.   def start
  1533.     super
  1534.     create_menu_background
  1535.  
  1536.     create_windows
  1537.     create_confirm_window
  1538.     adjust_window_location
  1539.  
  1540.     # 編成前のパーティを保存
  1541.     @battle_actors = $game_party.battle_members.dup
  1542.     @party_actors  = $game_party.all_members.dup
  1543.   end
  1544.   #--------------------------------------------------------------------------
  1545.   # ○ ウィンドウの作成
  1546.   #--------------------------------------------------------------------------
  1547.   def create_windows
  1548.     # 編成用ウィンドウを作成
  1549.     @battle_member_window = Window_PartyFormBattleMember.new
  1550.     @party_member_window  = Window_PartyFormAllMember.new
  1551.     @status_window        = Window_PartyFormStatus.new
  1552.     @status_window.set_actor(@battle_member_window.actor)
  1553.  
  1554.     # その他のウィンドウを作成
  1555.     @battle_member_caption_window =
  1556.       Window_PartyFormCaption.new(KGC::LargeParty::BATTLE_MEMBER_CAPTION)
  1557.     @party_member_caption_window =
  1558.       Window_PartyFormCaption.new(KGC::LargeParty::PARTY_MEMBER_CAPTION)
  1559.     @control_window = Window_PartyFormControl.new
  1560.   end
  1561.   #--------------------------------------------------------------------------
  1562.   # ○ 確認ウィンドウの作成
  1563.   #--------------------------------------------------------------------------
  1564.   def create_confirm_window
  1565.     commands = KGC::LargeParty::CONFIRM_WINDOW_COMMANDS
  1566.     @confirm_window =
  1567.       Window_Command.new(KGC::LargeParty::CONFIRM_WINDOW_WIDTH, commands)
  1568.     @confirm_window.index    = 0
  1569.     @confirm_window.openness = 0
  1570.     @confirm_window.active   = false
  1571.   end
  1572.   #--------------------------------------------------------------------------
  1573.   # ○ ウィンドウの座標調整
  1574.   #--------------------------------------------------------------------------
  1575.   def adjust_window_location
  1576.     # 基準座標を計算
  1577.     base_x = [@battle_member_window.width, @party_member_window.width].max
  1578.     base_x = [(Graphics.width - base_x) / 2, 0].max
  1579.     base_y = @battle_member_window.height + @party_member_window.height +
  1580.       @status_window.height + CAPTION_OFFSET * 2
  1581.     base_y = [(Graphics.height - base_y) / 2, 0].max
  1582.     base_z = @menuback_sprite.z + 1000
  1583.  
  1584.     # 編成用ウィンドウの座標をセット
  1585.     @battle_member_window.x = base_x
  1586.     @battle_member_window.y = base_y + CAPTION_OFFSET
  1587.     @battle_member_window.z = base_z
  1588.     @party_member_window.x = base_x
  1589.     @party_member_window.y = @battle_member_window.y +
  1590.       @battle_member_window.height + CAPTION_OFFSET
  1591.     @party_member_window.z = base_z
  1592.     @status_window.x = 0
  1593.     @status_window.y = @party_member_window.y + @party_member_window.height
  1594.     @status_window.z = base_z
  1595.  
  1596.     # その他のウィンドウの座標をセット
  1597.     @battle_member_caption_window.x = [base_x - 16, 0].max
  1598.     @battle_member_caption_window.y = @battle_member_window.y - CAPTION_OFFSET
  1599.     @battle_member_caption_window.z = base_z + 500
  1600.     @party_member_caption_window.x = [base_x - 16, 0].max
  1601.     @party_member_caption_window.y = @party_member_window.y - CAPTION_OFFSET
  1602.     @party_member_caption_window.z = base_z + 500
  1603.     @control_window.x = @status_window.width
  1604.     @control_window.y = @status_window.y
  1605.     @control_window.z = base_z
  1606.  
  1607.     @confirm_window.x = (Graphics.width - @confirm_window.width) / 2
  1608.     @confirm_window.y = (Graphics.height - @confirm_window.height) / 2
  1609.     @confirm_window.z = base_z + 1000
  1610.   end
  1611.   #--------------------------------------------------------------------------
  1612.   # ● 終了処理
  1613.   #--------------------------------------------------------------------------
  1614.   def terminate
  1615.     super
  1616.     dispose_menu_background
  1617.     @battle_member_window.dispose
  1618.     @party_member_window.dispose
  1619.     @status_window.dispose
  1620.     @battle_member_caption_window.dispose
  1621.     @party_member_caption_window.dispose
  1622.     @control_window.dispose
  1623.     @confirm_window.dispose
  1624.   end
  1625.   #--------------------------------------------------------------------------
  1626.   # ● メニュー画面系の背景作成
  1627.   #--------------------------------------------------------------------------
  1628.   def create_menu_background
  1629.     super
  1630.     @menuback_sprite.z = 20000
  1631.   end
  1632.   #--------------------------------------------------------------------------
  1633.   # ● 元の画面へ戻る
  1634.   #--------------------------------------------------------------------------
  1635.   def return_scene
  1636.     case @host_scene
  1637.     when HOST_MENU
  1638.       $scene = Scene_Menu.new(@menu_index)
  1639.     when HOST_MAP
  1640.       $scene = Scene_Map.new
  1641.     when HOST_BATTLE
  1642.       $scene = Scene_Battle.new
  1643.     end
  1644.     $game_player.refresh
  1645.   end
  1646.   #--------------------------------------------------------------------------
  1647.   # ● フレーム更新
  1648.   #--------------------------------------------------------------------------
  1649.   def update
  1650.     super
  1651.     update_menu_background
  1652.     update_window
  1653.     if @battle_member_window.active
  1654.       update_battle_member
  1655.     elsif @party_member_window.active
  1656.       update_party_member
  1657.     elsif @confirm_window.active
  1658.       update_confirm
  1659.     end
  1660.   end
  1661.   #--------------------------------------------------------------------------
  1662.   # ○ ウィンドウ更新
  1663.   #--------------------------------------------------------------------------
  1664.   def update_window
  1665.     @battle_member_window.update
  1666.     @party_member_window.update
  1667.     @status_window.update
  1668.     @battle_member_caption_window.update
  1669.     @party_member_caption_window.update
  1670.     @control_window.update
  1671.     @confirm_window.update
  1672.   end
  1673.   #--------------------------------------------------------------------------
  1674.   # ○ ウィンドウ再描画
  1675.   #--------------------------------------------------------------------------
  1676.   def refresh_window
  1677.     @battle_member_window.refresh
  1678.     @party_member_window.refresh
  1679.   end
  1680.   #--------------------------------------------------------------------------
  1681.   # ○ フレーム更新 (戦闘メンバーウィンドウがアクティブの場合)
  1682.   #--------------------------------------------------------------------------
  1683.   def update_battle_member
  1684.     @status_window.set_actor(@battle_member_window.actor)
  1685.     if Input.trigger?(Input::A)
  1686.       if @battle_member_window.selected_index == nil  # 並び替え中でない
  1687.         actor = @battle_member_window.actor
  1688.         # アクターを外せない場合
  1689.         if actor == nil || $game_party.actor_fixed?(actor.id)
  1690.           Sound.play_buzzer
  1691.           return
  1692.         end
  1693.         # アクターを外す
  1694.         Sound.play_decision
  1695.         actors = $game_party.battle_members
  1696.         actors.delete_at(@battle_member_window.index)
  1697.         $game_party.set_battle_member(actors)
  1698.         refresh_window
  1699.       end
  1700.     elsif Input.trigger?(Input::B)
  1701.       if @battle_member_window.selected_index == nil  # 並び替え中でない
  1702.         # 確認ウィンドウに切り替え
  1703.         Sound.play_cancel
  1704.         show_confirm_window
  1705.       else                                            # 並び替え中
  1706.         # 並び替え解除
  1707.         Sound.play_cancel
  1708.         @battle_member_window.selected_index = nil
  1709.         @battle_member_window.refresh
  1710.         @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  1711.       end
  1712.     elsif Input.trigger?(Input::C)
  1713.       if @battle_member_window.selected_index == nil  # 並び替え中でない
  1714.         actor = @battle_member_window.actor
  1715.         # アクターを外せない場合
  1716.         if actor != nil && $game_party.actor_fixed?(actor.id)
  1717.           Sound.play_buzzer
  1718.           return
  1719.         end
  1720.         # パーティメンバーウィンドウに切り替え
  1721.         Sound.play_decision
  1722.         @battle_member_window.active = false
  1723.         @party_member_window.active = true
  1724.         @control_window.mode = Window_PartyFormControl::MODE_PARTY_MEMBER
  1725.       else                                            # 並び替え中
  1726.         unless can_change_shift?(@battle_member_window.actor)
  1727.           Sound.play_buzzer
  1728.           return
  1729.         end
  1730.         # 並び替え実行
  1731.         Sound.play_decision
  1732.         index1 = @battle_member_window.selected_index
  1733.         index2 = @battle_member_window.index
  1734.         change_shift(index1, index2)
  1735.         @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  1736.       end
  1737.     elsif Input.trigger?(Input::X)
  1738.       # 並び替え不可能な場合
  1739.       unless can_change_shift?(@battle_member_window.actor)
  1740.         Sound.play_buzzer
  1741.         return
  1742.       end
  1743.       if @battle_member_window.selected_index == nil  # 並び替え中でない
  1744.         # 並び替え開始
  1745.         Sound.play_decision
  1746.         @battle_member_window.selected_index = @battle_member_window.index
  1747.         @battle_member_window.refresh
  1748.         @control_window.mode = Window_PartyFormControl::MODE_SHIFT_CHANGE
  1749.       else                                            # 並び替え中
  1750.         # 並び替え実行
  1751.         Sound.play_decision
  1752.         index1 = @battle_member_window.selected_index
  1753.         index2 = @battle_member_window.index
  1754.         change_shift(index1, index2)
  1755.         @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  1756.       end
  1757.     end
  1758.   end
  1759.   #--------------------------------------------------------------------------
  1760.   # ○ 並び替え可否判定
  1761.   #--------------------------------------------------------------------------
  1762.   def can_change_shift?(actor)
  1763.     # 選択したアクターが存在しない、または並び替え不能な場合
  1764.     if actor == nil ||
  1765.         (KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED &&
  1766.          $game_party.actor_fixed?(actor.id))
  1767.       return false
  1768.     end
  1769.     return true
  1770.   end
  1771.   #--------------------------------------------------------------------------
  1772.   # ○ 並び替え
  1773.   #--------------------------------------------------------------------------
  1774.   def change_shift(index1, index2)
  1775.     # 位置を入れ替え
  1776.     $game_party.change_shift(index1, index2)
  1777.     # 選択済みインデックスをクリア
  1778.     @battle_member_window.selected_index = nil
  1779.     refresh_window
  1780.   end
  1781.   #--------------------------------------------------------------------------
  1782.   # ○ フレーム更新 (パーティウィンドウがアクティブの場合)
  1783.   #--------------------------------------------------------------------------
  1784.   def update_party_member
  1785.     @status_window.set_actor(@party_member_window.actor)
  1786.     if Input.trigger?(Input::B)
  1787.       Sound.play_cancel
  1788.       # 戦闘メンバーウィンドウに切り替え
  1789.       @battle_member_window.active = true
  1790.       @party_member_window.active = false
  1791.         @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  1792.     elsif Input.trigger?(Input::C)
  1793.       actor = @party_member_window.actor
  1794.       # アクターが戦闘メンバーに含まれる場合
  1795.       if $game_party.battle_members.include?(actor)
  1796.         Sound.play_buzzer
  1797.         return
  1798.       end
  1799.       # アクターを入れ替え
  1800.       Sound.play_decision
  1801.       actors = $game_party.all_members
  1802.       battle_actors = $game_party.battle_members
  1803.       if @battle_member_window.actor != nil
  1804.         actors[@party_member_window.actor_index] = @battle_member_window.actor
  1805.         actors[@battle_member_window.index] = actor
  1806.         $game_party.set_member(actors.compact)
  1807.       end
  1808.       battle_actors[@battle_member_window.index] = actor
  1809.       $game_party.set_battle_member(battle_actors.compact)
  1810.       refresh_window
  1811.       # 戦闘メンバーウィンドウに切り替え
  1812.       @battle_member_window.active = true
  1813.       @party_member_window.active = false
  1814.       @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  1815.     end
  1816.   end
  1817.   #--------------------------------------------------------------------------
  1818.   # ○ フレーム更新 (確認ウィンドウがアクティブの場合)
  1819.   #--------------------------------------------------------------------------
  1820.   def update_confirm
  1821.     if Input.trigger?(Input::B)
  1822.       Sound.play_cancel
  1823.       hide_confirm_window
  1824.     elsif Input.trigger?(Input::C)
  1825.       case @confirm_window.index
  1826.       when 0  # 編成完了
  1827.         # パーティが無効の場合
  1828.         unless battle_member_valid?
  1829.           Sound.play_buzzer
  1830.           return
  1831.         end
  1832.         Sound.play_decision
  1833.         return_scene
  1834.       when 1  # 編成中断
  1835.         Sound.play_decision
  1836.         # パーティを編成前の状態に戻す
  1837.         $game_party.set_member(@party_actors)
  1838.         $game_party.set_battle_member(@battle_actors)
  1839.         return_scene
  1840.       when 2  # キャンセル
  1841.         Sound.play_cancel
  1842.         hide_confirm_window
  1843.       end
  1844.     end
  1845.   end
  1846.   #--------------------------------------------------------------------------
  1847.   # ○ 戦闘メンバー有効判定
  1848.   #--------------------------------------------------------------------------
  1849.   def battle_member_valid?
  1850.     return false if $game_party.battle_members.size == 0  # 戦闘メンバーが空
  1851.     $game_party.battle_members.each { |actor|
  1852.       return true if actor.exist?  # 生存者がいればOK
  1853.     }
  1854.     return false
  1855.   end
  1856.   #--------------------------------------------------------------------------
  1857.   # ○ 確認ウィンドウの表示
  1858.   #--------------------------------------------------------------------------
  1859.   def show_confirm_window
  1860.     if @battle_member_window.active
  1861.       @last_active_window = @battle_member_window
  1862.     else
  1863.       @last_active_window = @party_member_window
  1864.     end
  1865.     @battle_member_window.active = false
  1866.     @party_member_window.active = false
  1867.  
  1868.     @confirm_window.draw_item(0, battle_member_valid?)
  1869.     @confirm_window.open
  1870.     @confirm_window.active = true
  1871.   end
  1872.   #--------------------------------------------------------------------------
  1873.   # ○ 確認ウィンドウの非表示
  1874.   #--------------------------------------------------------------------------
  1875.   def hide_confirm_window
  1876.     @confirm_window.active = false
  1877.     @confirm_window.close
  1878.     @last_active_window.active = true
  1879.   end
  1880. end
  1881.  
  1882. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  1883.  
  1884. #==============================================================================
  1885. # ■ Scene_Battle
  1886. #==============================================================================
  1887.  
  1888. class Scene_Battle < Scene_Base
  1889.   #--------------------------------------------------------------------------
  1890.   # ● メッセージ表示が終わるまでウェイト
  1891.   #--------------------------------------------------------------------------
  1892.   alias wait_for_message_KGC_LargeParty wait_for_message
  1893.   def wait_for_message
  1894.     return if @ignore_wait_for_message  # メッセージ終了までのウェイトを無視
  1895.  
  1896.     wait_for_message_KGC_LargeParty
  1897.   end
  1898.   #--------------------------------------------------------------------------
  1899.   # ● レベルアップの表示
  1900.   #--------------------------------------------------------------------------
  1901.   alias display_level_up_KGC_LargeParty display_level_up
  1902.   def display_level_up
  1903.     @ignore_wait_for_message = true
  1904.  
  1905.     display_level_up_KGC_LargeParty
  1906.  
  1907.     exp = $game_troop.exp_total * KGC::LargeParty::STAND_BY_EXP_RATE / 1000
  1908.     $game_party.stand_by_members.each { |actor|
  1909.       if actor.exist?
  1910.         actor.gain_exp(exp, KGC::LargeParty::SHOW_STAND_BY_LEVEL_UP)
  1911.       end
  1912.     }
  1913.     @ignore_wait_for_message = false
  1914.     wait_for_message
  1915.   end
  1916.   #--------------------------------------------------------------------------
  1917.   # ● パーティコマンド選択の開始
  1918.   #--------------------------------------------------------------------------
  1919.   alias start_party_command_selection_KGC_LargeParty start_party_command_selection
  1920.   def start_party_command_selection
  1921.     if $game_temp.in_battle
  1922.       @status_window.index = 0
  1923.     end
  1924.  
  1925.     start_party_command_selection_KGC_LargeParty
  1926.   end
  1927.  
  1928.   if KGC::LargeParty::USE_BATTLE_PARTYFORM
  1929.  
  1930.   #--------------------------------------------------------------------------
  1931.   # ● 情報表示ビューポートの作成
  1932.   #--------------------------------------------------------------------------
  1933.   alias create_info_viewport_KGC_LargeParty create_info_viewport
  1934.   def create_info_viewport
  1935.     create_info_viewport_KGC_LargeParty
  1936.  
  1937.     @__command_partyform_index =
  1938.       @party_command_window.add_command(Vocab.partyform_battle)
  1939.     @party_command_window.draw_item(@__command_partyform_index,
  1940.       $game_party.battle_partyform_enable?)
  1941.   end
  1942.   #--------------------------------------------------------------------------
  1943.   # ● パーティコマンド選択の更新
  1944.   #--------------------------------------------------------------------------
  1945.   alias update_party_command_selection_KGC_LargeParty update_party_command_selection
  1946.   def update_party_command_selection
  1947.     if Input.trigger?(Input::C)
  1948.       case @party_command_window.index
  1949.       when @__command_partyform_index  # パーティ編成
  1950.         unless $game_party.battle_partyform_enable?
  1951.           Sound.play_buzzer
  1952.           return
  1953.         end
  1954.         Sound.play_decision
  1955.         process_partyform
  1956.         return
  1957.       end
  1958.     end
  1959.  
  1960.     update_party_command_selection_KGC_LargeParty
  1961.   end
  1962.   #--------------------------------------------------------------------------
  1963.   # ○ パーティ編成の処理
  1964.   #--------------------------------------------------------------------------
  1965.   def process_partyform
  1966.     prev_party_command_active = @party_command_window.active
  1967.     @party_command_window.active = false
  1968.     Graphics.freeze
  1969.     snapshot_for_background
  1970.     $scene = Scene_PartyForm.new(0, Scene_PartyForm::HOST_BATTLE)
  1971.     $scene.main
  1972.     $scene = self
  1973.     @spriteset.update_actors
  1974.     @status_window.refresh
  1975.     @party_command_window.active = prev_party_command_active
  1976.     Window_Base.show_cursor_animation if $imported["CursorAnimation"]
  1977.     perform_transition
  1978.   end
  1979.   #--------------------------------------------------------------------------
  1980.   # ● 敗北の処理
  1981.   #--------------------------------------------------------------------------
  1982.   alias process_defeat_KGC_LargeParty process_defeat
  1983.   def process_defeat
  1984.     process_defeat_launch
  1985.  
  1986.     process_defeat_KGC_LargeParty if $game_party.all_dead?
  1987.   end
  1988.   #--------------------------------------------------------------------------
  1989.   # ○ 全滅時の入れ替え処理
  1990.   #--------------------------------------------------------------------------
  1991.   def process_defeat_launch
  1992.     while @spriteset.animation?
  1993.       update_basic
  1994.     end
  1995.  
  1996.     return unless KGC::LargeParty::ENABLE_DEFEAT_LAUNCH
  1997.     return unless $game_party.partyform_enable?
  1998.  
  1999.     exist = false
  2000.     $game_party.all_members.each { |actor| exist |= actor.exist? }
  2001.     return unless exist  # 生存者なし
  2002.  
  2003.     @info_viewport.visible  = false
  2004.     @message_window.visible = true
  2005.  
  2006.     # 戦闘可能者を出撃 (固定アクターは残す)
  2007.     $game_party.remove_all_battle_member
  2008.     max = $game_party.max_battle_member_count
  2009.     while ($game_party.battle_members.size < max)
  2010.       actor = $game_party.stand_by_members.find { |a| a.exist? }
  2011.       break if actor == nil
  2012.       $game_party.add_battle_member(actor.id)
  2013.       @status_window.refresh
  2014.       display_launch(actor)
  2015.     end
  2016.  
  2017.     @info_viewport.visible  = true
  2018.     @message_window.visible = false
  2019.     @message_window.clear
  2020.   end
  2021.   #--------------------------------------------------------------------------
  2022.   # ○ 出撃の表示
  2023.   #     target : 対象者 (アクター)
  2024.   #--------------------------------------------------------------------------
  2025.   def display_launch(target)
  2026.     text = sprintf(Vocab::DefeatLaunch, target.name)
  2027.     @message_window.add_instant_text(text)
  2028.     wait(40)
  2029.   end
  2030.  
  2031.   end  # <-- if KGC::LargeParty::USE_BATTLE_PARTYFORM
  2032. end[/box]

评分

参与人数 1梦石 +1 收起 理由
丿梁丶小柒 + 1 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1914
在线时间
211 小时
注册时间
2009-11-10
帖子
234
 楼主| 发表于 2016-3-20 16:41:55 | 显示全部楼层
谢谢大神 太厉害了
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1914
在线时间
211 小时
注册时间
2009-11-10
帖子
234
 楼主| 发表于 2018-4-12 17:37:19 | 显示全部楼层
Rivendell 发表于 2016-3-19 18:40
帮你翻译了一下
module KGC
module LargeParty

大神 有没有 横版战斗 突破4人的范例啊 最好是窗口都规划好了的 ,va 的也可以啊,谢谢了大神。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-18 18:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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