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

Project1

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

[已经解决] 求个人物仓库。

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
59
在线时间
536 小时
注册时间
2010-6-20
帖子
1489
跳转到指定楼层
1
发表于 2011-8-30 12:22:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

我想要个人物仓库

谁能给我个??

Lv2.观梦者

梦石
0
星屑
381
在线时间
1398 小时
注册时间
2010-9-23
帖子
557
2
发表于 2011-8-30 12:42:45 | 只看该作者
本帖最后由 黑崎一护 于 2011-8-30 12:44 编辑

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/    ◆ 多人数パーティ - KGC_LargeParty ◆ VX ◆
#_/    ◇ Last update : 2008/04/27 ◇
#_/----------------------------------------------------------------------------
#_/  5人以上の大規模パーティを構築可能にします。
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================
# ★ カスタマイズ項目 - Customize ★
#==============================================================================

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

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

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

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

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

  # ◆ 戦闘中にパーティ編成コマンドを使用する
  #  追加する場所は、パーティコマンドの最下部(「逃げる」の下)です。
  USE_BATTLE_PARTYFORM   = false
  # ◆ 戦闘中のパーティ編成コマンドの名称
  VOCAB_BATTLE_PARTYFORM = "替换"

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

  # ◆ 編成画面のキャプションウィンドウの幅
  CAPTION_WINDOW_WIDTH  = 192
  # ◆ 編成画面の戦闘メンバーウィンドウのキャプション
  BATTLE_MEMBER_CAPTION = "战斗队员"

  if SHOW_BATTLE_MEMBER_IN_PARTY
    # ◆ 編成画面のパーティメンバーウィンドウのキャプション
    #  SHOW_BATTLE_MEMBER_IN_PARTY = true のとき
    PARTY_MEMBER_CAPTION = "队员"
  else
    # ◆ 編成画面のパーティメンバーウィンドウのキャプション
    #  SHOW_BATTLE_MEMBER_IN_PARTY = false のとき
    PARTY_MEMBER_CAPTION = "待机"
  end

  # ◆ 編成確認ウィンドウの幅
  CONFIRM_WINDOW_WIDTH    = 160
  # ◆ 編成確認ウィンドウの文字列
  #  ※コマンド数・順番を変更するとバグります。
  CONFIRM_WINDOW_COMMANDS = ["完成编队", "终止编队", "取消"]

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

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

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

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

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# □ KGC::Commands
#==============================================================================

module KGC
module Commands
  # メンバーのソート形式
  SORT_BY_ID    = 0  # ID順
  SORT_BY_NAME  = 1  # 名前順
  SORT_BY_LEVEL = 2  # レベル順

  module_function
  #--------------------------------------------------------------------------
  # ○ パーティ編成画面の呼び出し
  #--------------------------------------------------------------------------
  def call_partyform
    return if $game_temp.in_battle
    $game_temp.next_scene = :partyform
  end
  #--------------------------------------------------------------------------
  # ○ 戦闘メンバー最大数を設定
  #     value : 人数 (省略した場合はデフォルト値を使用)
  #--------------------------------------------------------------------------
  def set_max_battle_member_count(value = nil)
    $game_party.max_battle_member_count = value
  end
  #--------------------------------------------------------------------------
  # ○ パーティ人数が一杯か
  #--------------------------------------------------------------------------
  def party_full?
    return $game_party.full?
  end
  #--------------------------------------------------------------------------
  # ○ パーティ編成可否を設定
  #     enabled : 有効フラグ (省略時 : true)
  #--------------------------------------------------------------------------
  def permit_partyform(enabled = true)
    $game_switches[KGC::LargeParty::PARTYFORM_SWITCH] = enabled
  end
  #--------------------------------------------------------------------------
  # ○ 戦闘中のパーティ編成可否を設定
  #     enabled : 有効フラグ (省略時 : true)
  #--------------------------------------------------------------------------
  def permit_battle_partyform(enabled = true)
    $game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH] = enabled
  end
  #--------------------------------------------------------------------------
  # ○ アクターの固定状態を設定
  #     actor_id : アクター ID
  #     fixed    : 固定フラグ (省略時 : true)
  #--------------------------------------------------------------------------
  def fix_actor(actor_id, fixed = true)
    $game_party.fix_actor(actor_id, fixed)
  end
  #--------------------------------------------------------------------------
  # ○ 並び替え
  #    メンバーの index1 番目と index2 番目を入れ替える
  #--------------------------------------------------------------------------
  def change_party_shift(index1, index2)
    $game_party.change_shift(index1, index2)
  end
  #--------------------------------------------------------------------------
  # ○ メンバー整列 (昇順)
  #     sort_type : ソート形式 (SORT_BY_xxx)
  #     reverse   : true だと降順
  #--------------------------------------------------------------------------
  def sort_party_member(sort_type = SORT_BY_ID, reverse = false)
    $game_party.sort_member(sort_type, reverse)
  end
  #--------------------------------------------------------------------------
  # ○ 待機メンバーの ID を取得
  #--------------------------------------------------------------------------
  def get_stand_by_member_ids
    result = []
    $game_party.stand_by_members.each { |actor| result << actor.id }
    return result
  end
  #--------------------------------------------------------------------------
  # ○ アクターが待機メンバーか
  #     actor_id : アクター ID
  #--------------------------------------------------------------------------
  def stand_by_member?(actor_id)
    return get_stand_by_member_ids.include?(actor_id)
  end
  #--------------------------------------------------------------------------
  # ○ アクターを戦闘メンバーに加える
  #     actor_id : アクター ID
  #     index    : 追加位置 (省略時は最後尾)
  #--------------------------------------------------------------------------
  def add_battle_member(actor_id, index = nil)
    $game_party.add_battle_member(actor_id, index)
  end
  #--------------------------------------------------------------------------
  # ○ アクターを戦闘メンバーから外す
  #     actor_id : アクター ID
  #--------------------------------------------------------------------------
  def remove_battle_member(actor_id)
    $game_party.remove_battle_member(actor_id)
  end
  #--------------------------------------------------------------------------
  # ○ 固定アクター以外を戦闘メンバーから外す
  #--------------------------------------------------------------------------
  def remove_all_battle_member
    $game_party.all_members.each { |actor|
      $game_party.remove_battle_member(actor.id)
    }
  end
  #--------------------------------------------------------------------------
  # ○ ランダム出撃
  #--------------------------------------------------------------------------
  def random_launch
    new_battle_members = $game_party.fixed_members
    candidates = $game_party.all_members - new_battle_members
    num = [$game_party.max_battle_member_count - new_battle_members.size,
      candidates.size].min
    return if num <= 0

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

class Game_Interpreter
  include KGC::Commands
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Vocab
#==============================================================================

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

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

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ○ パーティ内インデックス取得
  #--------------------------------------------------------------------------
  def party_index
    return $game_party.all_members.index(self)
  end
  #--------------------------------------------------------------------------
  # ○ 戦闘メンバーか判定
  #--------------------------------------------------------------------------
  def battle_member?
    return $game_party.battle_members.include?(self)
  end
  #--------------------------------------------------------------------------
  # ○ 固定メンバーか判定
  #--------------------------------------------------------------------------
  def fixed_member?
    return $game_party.fixed_members.include?(self)
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_Party
#==============================================================================

class Game_Party
  #--------------------------------------------------------------------------
  # ● 定数
  #--------------------------------------------------------------------------
  MAX_MEMBERS = KGC::LargeParty::MAX_MEMBERS  # 最大パーティ人数
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias initialize_KGC_LargeParty initialize
  def initialize
    initialize_KGC_LargeParty

    @max_battle_member_count = nil
    @battle_member_count = 0
    @fixed_actors = []
  end
  #--------------------------------------------------------------------------
  # ○ 戦闘メンバー最大数取得
  #--------------------------------------------------------------------------
  def max_battle_member_count
    if @max_battle_member_count == nil
      return KGC::LargeParty::MAX_BATTLE_MEMBERS
    else
      return @max_battle_member_count
    end
  end
  #--------------------------------------------------------------------------
  # ○ 戦闘メンバー最大数変更
  #--------------------------------------------------------------------------
  def max_battle_member_count=(value)
    if value.is_a?(Integer)
      value = [value, 1].max
    end
    @max_battle_member_count = value
  end
  #--------------------------------------------------------------------------
  # ○ 戦闘メンバー数取得
  #--------------------------------------------------------------------------
  def battle_member_count
    if @battle_member_count == nil
      @battle_member_count = @actors.size
    end
    @battle_member_count =
      [@battle_member_count, @actors.size, max_battle_member_count].min
    return @battle_member_count
  end
  #--------------------------------------------------------------------------
  # ○ 戦闘メンバー数設定
  #--------------------------------------------------------------------------
  def battle_member_count=(value)
    @battle_member_count = [[value, 0].max,
      @actors.size, max_battle_member_count].min
  end
  #--------------------------------------------------------------------------
  # ● メンバーの取得
  #--------------------------------------------------------------------------
  alias members_KGC_LargeParty members
  def members
    if $game_temp.in_battle ||
        !KGC::LargeParty::SHOW_STAND_BY_MEMBER_NOT_IN_BATTLE
      return battle_members
    else
      return members_KGC_LargeParty
    end
  end
  #--------------------------------------------------------------------------
  # ○ 全メンバーの取得
  #--------------------------------------------------------------------------
  def all_members
    return members_KGC_LargeParty
  end
  #--------------------------------------------------------------------------
  # ○ 戦闘メンバーの取得
  #--------------------------------------------------------------------------
  def battle_members
    result = []
    battle_member_count.times { |i| result << $game_actors[@actors] }
    return result
  end
  #--------------------------------------------------------------------------
  # ○ 待機メンバーの取得
  #--------------------------------------------------------------------------
  def stand_by_members
    return (all_members - battle_members)
  end
  #--------------------------------------------------------------------------
  # ○ 固定メンバーの取得
  #--------------------------------------------------------------------------
  def fixed_members
    result = []
    @fixed_actors.each { |i| result << $game_actors }
    return result
  end
  #--------------------------------------------------------------------------
  # ● 初期パーティのセットアップ
  #--------------------------------------------------------------------------
  alias setup_starting_members_KGC_LargeParty setup_starting_members
  def setup_starting_members
    setup_starting_members_KGC_LargeParty

    self.battle_member_count = @actors.size
  end
  #--------------------------------------------------------------------------
  # ● 戦闘テスト用パーティのセットアップ
  #--------------------------------------------------------------------------
  alias setup_battle_test_members_KGC_LargeParty setup_battle_test_members
  def setup_battle_test_members
    setup_battle_test_members_KGC_LargeParty

    self.battle_member_count = @actors.size
  end
  #--------------------------------------------------------------------------
  # ○ メンバーの新規設定
  #     new_member : 新しいメンバー
  #--------------------------------------------------------------------------
  def set_member(new_member)
    @actors = []
    new_member.each { |actor| @actors << actor.id }
  end
  #--------------------------------------------------------------------------
  # ○ 戦闘メンバーの新規設定
  #     new_member : 新しい戦闘メンバー
  #--------------------------------------------------------------------------
  def set_battle_member(new_member)
    new_battle_member = []
    new_member.each { |actor|
      @actors.delete(actor.id)
      new_battle_member << actor.id
    }
    @actors = new_battle_member + @actors
    self.battle_member_count = new_member.size
  end
  #--------------------------------------------------------------------------
  # ○ パーティ編成を許可しているか判定
  #--------------------------------------------------------------------------
  def partyform_enable?
    return $game_switches[KGC::LargeParty::PARTYFORM_SWITCH]
  end
  #--------------------------------------------------------------------------
  # ○ 戦闘中のパーティ編成を許可しているか判定
  #--------------------------------------------------------------------------
  def battle_partyform_enable?
    return false unless partyform_enable?
    return $game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH]
  end
  #--------------------------------------------------------------------------
  # ○ メンバーが一杯か判定
  #--------------------------------------------------------------------------
  def full?
    return (@actors.size >= MAX_MEMBERS)
  end
  #--------------------------------------------------------------------------
  # ○ 固定アクターか判定
  #     actor_id : 判定するアクターの ID
  #--------------------------------------------------------------------------
  def actor_fixed?(actor_id)
    return @fixed_actors.include?(actor_id)
  end
  #--------------------------------------------------------------------------
  # ● アクターを加える
  #     actor_id : アクター ID
  #--------------------------------------------------------------------------
  alias add_actor_KGC_LargeParty add_actor
  def add_actor(actor_id)
    last_size = @actors.size

    add_actor_KGC_LargeParty(actor_id)

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

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

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

    if fixed
      # 固定
      unless @fixed_actors.include?(actor_id)
        @fixed_actors << actor_id
        unless battle_members.include?($game_actors[actor_id])
          self.battle_member_count += 1
        end
      end
      # 強制出撃
      apply_force_launch
    else
      # 固定解除
      @fixed_actors.delete(actor_id)
    end
    $game_player.refresh
  end
  #--------------------------------------------------------------------------
  # ○ 強制出撃適用
  #--------------------------------------------------------------------------
  def apply_force_launch
    while (fixed_members - battle_members).size > 0
      # 固定状態でないメンバーを適当に持ってきて入れ替え
      actor1 = stand_by_members.find { |a| @fixed_actors.include?(a.id) }
      actor2 = battle_members.reverse.find { |a| !@fixed_actors.include?(a.id) }
      index1 = @actors.index(actor1.id)
      index2 = @actors.index(actor2.id)
      @actors[index1], @actors[index2] = @actors[index2], @actors[index1]

      # 戦闘メンバーが全員固定されたら戻る (無限ループ防止)
      all_fixed = true
      battle_members.each { |actor|
        unless actor.fixed_member?
          all_fixed = false
          break
        end
      }
      break if all_fixed
    end
  end
  #--------------------------------------------------------------------------
  # ○ メンバー整列 (昇順)
  #     sort_type : ソート形式 (SORT_BY_xxx)
  #     reverse   : true だと降順
  #--------------------------------------------------------------------------
  def sort_member(sort_type = KGC::Commands::SORT_BY_ID,
                  reverse = false)
    # バッファを準備
    b_actors = battle_members
    actors = all_members - b_actors
    f_actors = fixed_members
    # 固定キャラはソートしない
    if KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED
      actors -= f_actors
      b_actors -= f_actors
    end

    # ソート
    case sort_type
    when KGC::Commands::SORT_BY_ID     # ID順
      actors.sort!   { |a, b| a.id <=> b.id }
      b_actors.sort! { |a, b| a.id <=> b.id }
    when KGC::Commands::SORT_BY_NAME   # 名前順
      actors.sort!   { |a, b| a.name <=> b.name }
      b_actors.sort! { |a, b| a.name <=> b.name }
    when KGC::Commands::SORT_BY_LEVEL  # レベル順
      actors.sort!   { |a, b| a.level <=> b.level }
      b_actors.sort! { |a, b| a.level <=> b.level }
    end
    # 反転
    if reverse
      actors.reverse!
      b_actors.reverse!
    end

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

    # 復帰
    set_member(actors)
    set_battle_member(b_actors)

    apply_force_launch
    $game_player.refresh
  end
  #--------------------------------------------------------------------------
  # ○ 並び替え
  #    戦闘メンバーの index1 番目と index2 番目を入れ替える
  #--------------------------------------------------------------------------
  def change_shift(index1, index2)
    size = @actors.size
    if index1 >= size || index2 >= size
      return
    end
    buf = @actors[index1]
    @actors[index1] = @actors[index2]
    @actors[index2] = buf
    $game_player.refresh
  end
  #--------------------------------------------------------------------------
  # ● 戦闘用ステートの解除 (戦闘終了時に呼び出し)
  #--------------------------------------------------------------------------
  def remove_states_battle
    for actor in all_members
      actor.remove_states_battle
    end
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Window_Command
#==============================================================================

class Window_Command < Window_Selectable
  unless method_defined?(:add_command)
  #--------------------------------------------------------------------------
  # ○ コマンドを追加
  #    追加した位置を返す
  #--------------------------------------------------------------------------
  def add_command(command)
    @commands << command
    @item_max = @commands.size
    item_index = @item_max - 1
    refresh_command
    draw_item(item_index)
    return item_index
  end
  #--------------------------------------------------------------------------
  # ○ コマンドをリフレッシュ
  #--------------------------------------------------------------------------
  def refresh_command
    buf = self.contents.clone
    self.height = [self.height, row_max * WLH + 32].max
    create_contents
    self.contents.blt(0, 0, buf, buf.rect)
    buf.dispose
  end
  #--------------------------------------------------------------------------
  # ○ コマンドを挿入
  #--------------------------------------------------------------------------
  def insert_command(index, command)
    @commands.insert(index, command)
    @item_max = @commands.size
    refresh_command
    refresh
  end
  #--------------------------------------------------------------------------
  # ○ コマンドを削除
  #--------------------------------------------------------------------------
  def remove_command(command)
    @commands.delete(command)
    @item_max = @commands.size
    refresh
  end
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Window_MenuStatus
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 定数
  #--------------------------------------------------------------------------
  STATUS_HEIGHT = 96  # ステータス一人分の高さ
  #--------------------------------------------------------------------------
  # ● ウィンドウ内容の作成
  #--------------------------------------------------------------------------
  def create_contents
    self.contents.dispose
    self.contents = Bitmap.new(width - 32,
      [height - 32, row_max * STATUS_HEIGHT].max)
  end
  #--------------------------------------------------------------------------
  # ● 先頭の行の取得
  #--------------------------------------------------------------------------
  def top_row
    return self.oy / STATUS_HEIGHT
  end
  #--------------------------------------------------------------------------
  # ● 先頭の行の設定
  #     row : 先頭に表示する行
  #--------------------------------------------------------------------------
  def top_row=(row)
    super(row)
    self.oy = self.oy / WLH * STATUS_HEIGHT
  end
  #--------------------------------------------------------------------------
  # ● 1 ページに表示できる行数の取得
  #--------------------------------------------------------------------------
  def page_row_max
    return (self.height - 32) / STATUS_HEIGHT
  end
  #--------------------------------------------------------------------------
  # ● 項目を描画する矩形の取得
  #     index : 項目番号
  #--------------------------------------------------------------------------
  def item_rect(index)
    rect = super(index)
    rect.height = STATUS_HEIGHT
    rect.y = index / @column_max * STATUS_HEIGHT
    return rect
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    @item_max = $game_party.members.size
    create_contents
    fill_stand_by_background
    draw_member
  end
  #--------------------------------------------------------------------------
  # ○ パーティメンバー描画
  #--------------------------------------------------------------------------
  def draw_member
    for actor in $game_party.members
      draw_actor_face(actor, 2, actor.party_index * 96 + 2, 92)
      x = 104
      y = actor.party_index * 96 + WLH / 2
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 120, y)
      draw_actor_level(actor, x, y + WLH * 1)
      draw_actor_state(actor, x, y + WLH * 2)
      draw_actor_hp(actor, x + 120, y + WLH * 1)
      draw_actor_mp(actor, x + 120, y + WLH * 2)
    end
  end
  #--------------------------------------------------------------------------
  # ○ 待機メンバーの背景色を塗る
  #--------------------------------------------------------------------------
  def fill_stand_by_background
    color = KGC::LargeParty::STAND_BY_COLOR
    dy = STATUS_HEIGHT * $game_party.battle_members.size
    dh = STATUS_HEIGHT * $game_party.stand_by_members.size
    if dh > 0
      self.contents.fill_rect(0, dy, self.width - 32, dh, color)
    end
  end
  #--------------------------------------------------------------------------
  # ● カーソルの更新
  #--------------------------------------------------------------------------
  def update_cursor
    if @index < 0               # カーソルなし
      self.cursor_rect.empty
    elsif @index < @item_max    # 通常
      super
    elsif @index >= 100         # 自分
      self.cursor_rect.set(0, (@index - 100) * STATUS_HEIGHT,
        contents.width, STATUS_HEIGHT)
    else                        # 全体
      self.cursor_rect.set(0, 0, contents.width, @item_max * STATUS_HEIGHT)
    end
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Window_ShopStatus
#==============================================================================

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

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Window_BattleStatus
#==============================================================================

class Window_BattleStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # ● ウィンドウ内容の作成
  #--------------------------------------------------------------------------
  def create_contents
    self.contents.dispose
    self.contents = Bitmap.new(width - 32,
      [WLH * $game_party.members.size, height - 32].max)
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  alias refresh_KGC_LargeParty refresh
  def refresh
    create_contents

    refresh_KGC_LargeParty
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

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

class Window_PartyFormCaption < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     caption : 表示するキャプション
  #--------------------------------------------------------------------------
  def initialize(caption = "")
    super(0, 0, KGC::LargeParty::CAPTION_WINDOW_WIDTH, WLH + 32)
    @caption = caption
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.draw_text(0, 0, width - 32, WLH, @caption)
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

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

class Window_PartyFormMember < Window_Selectable
  #--------------------------------------------------------------------------
  # ○ 定数
  #--------------------------------------------------------------------------
  DRAW_SIZE = KGC::LargeParty::PARTY_FORM_CHARACTER_SIZE
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :selected_index           # 選択済みインデックス
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     x       : ウィンドウの X 座標
  #     y       : ウィンドウの Y 座標
  #     width   : ウィンドウの幅
  #     height  : ウィンドウの高さ
  #     spacing : 横に項目が並ぶときの空白の幅
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height, spacing = 8)
    super(x, y, width, height, spacing)
  end
  #--------------------------------------------------------------------------
  # ● ウィンドウ内容の作成
  #--------------------------------------------------------------------------
  def create_contents
    self.contents.dispose
    self.contents = Bitmap.new(width - 32,
      [height - 32, row_max * DRAW_SIZE[1]].max)
  end
  #--------------------------------------------------------------------------
  # ● 先頭の行の取得
  #--------------------------------------------------------------------------
  def top_row
    return self.oy / DRAW_SIZE[1]
  end
  #--------------------------------------------------------------------------
  # ● 先頭の行の設定
  #     row : 先頭に表示する行
  #--------------------------------------------------------------------------
  def top_row=(row)
    super(row)
    self.oy = self.oy / WLH * DRAW_SIZE[1]
  end
  #--------------------------------------------------------------------------
  # ● 1 ページに表示できる行数の取得
  #--------------------------------------------------------------------------
  def page_row_max
    return (self.height - 32) / DRAW_SIZE[1]
  end
  #--------------------------------------------------------------------------
  # ● 項目を描画する矩形の取得
  #     index : 項目番号
  #--------------------------------------------------------------------------
  def item_rect(index)
    rect = super(index)
    rect.width = DRAW_SIZE[0]
    rect.height = DRAW_SIZE[1]
    rect.y = index / @column_max * DRAW_SIZE[1]
    return rect
  end
  #--------------------------------------------------------------------------
  # ○ 選択アクター取得
  #--------------------------------------------------------------------------
  def actor
    return @actors[self.index]
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    restore_member_list
    draw_member
  end
  #--------------------------------------------------------------------------
  # ○ メンバーリスト修復
  #--------------------------------------------------------------------------
  def restore_member_list
    # 継承先で定義
  end
  #--------------------------------------------------------------------------
  # ○ メンバー描画
  #--------------------------------------------------------------------------
  def draw_member
    # 継承先で定義
  end
  #--------------------------------------------------------------------------
  # ○ 空欄アクター描画
  #     index : 項目番号
  #--------------------------------------------------------------------------
  def draw_empty_actor(index)
    # 継承先で定義
  end
  #--------------------------------------------------------------------------
  # ○ 固定キャラ背景描画
  #     index : 項目番号
  #--------------------------------------------------------------------------
  def draw_fixed_back(index)
    rect = item_rect(index)
    self.contents.fill_rect(rect, KGC::LargeParty::FIXED_COLOR)
  end
  #--------------------------------------------------------------------------
  # ○ 選択中キャラ背景描画
  #     index : 項目番号
  #--------------------------------------------------------------------------
  def draw_selected_back(index)
    rect = item_rect(index)
    self.contents.fill_rect(rect, KGC::LargeParty::SELECTED_COLOR)
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

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

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

    @item_max = $game_party.max_battle_member_count
    @column_max = width / column_width
    @selected_index = nil
    create_contents
    refresh
    self.active = true
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # ○ メンバーリスト修復
  #--------------------------------------------------------------------------
  def restore_member_list
    @actors = $game_party.battle_members
  end
  #--------------------------------------------------------------------------
  # ○ メンバー描画
  #--------------------------------------------------------------------------
  def draw_member
    @item_max.times { |i|
      actor = @actors
      if actor == nil
        draw_empty_actor(i)
      else
        if i == @selected_index
          draw_selected_back(i)
        elsif $game_party.actor_fixed?(actor.id)
          draw_fixed_back(i)
        end
        rect = item_rect(i)
        draw_actor_graphic(actor,
          rect.x + DRAW_SIZE[0] / 2,
          rect.y + DRAW_SIZE[1] - 4)
      end
    }
  end
  #--------------------------------------------------------------------------
  # ○ 空欄アクター描画
  #     index : 項目番号
  #--------------------------------------------------------------------------
  def draw_empty_actor(index)
    rect = item_rect(index)
    self.contents.font.color = system_color
    self.contents.draw_text(rect, KGC::LargeParty::BATTLE_MEMBER_BLANK_TEXT, 1)
    self.contents.font.color = normal_color
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

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

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

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

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

    create_contents
    refresh
    self.active = false
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # ○ 選択しているアクターのインデックス取得
  #--------------------------------------------------------------------------
  def actor_index
    return @index_offset + self.index
  end
  #--------------------------------------------------------------------------
  # ○ メンバーリスト修復
  #--------------------------------------------------------------------------
  def restore_member_list
    if KGC::LargeParty::SHOW_BATTLE_MEMBER_IN_PARTY
      @actors = $game_party.all_members
      @index_offset = 0
    else
      @actors = $game_party.stand_by_members
      @index_offset = $game_party.battle_members.size
    end
  end
  #--------------------------------------------------------------------------
  # ○ メンバー描画
  #--------------------------------------------------------------------------
  def draw_member
    @item_max.times { |i|
      actor = @actors
      if actor == nil
        draw_empty_actor(i)
        next
      end

      if $game_party.actor_fixed?(actor.id)
        draw_fixed_back(i)
      end
      rect = item_rect(i)
      opacity = ($game_party.battle_members.include?(actor) ? 96 : 255)
      draw_actor_graphic(actor,
        rect.x + DRAW_SIZE[0] / 2,
        rect.y + DRAW_SIZE[1] - 4,
        opacity)
    }
  end
  #--------------------------------------------------------------------------
  # ● アクターの歩行グラフィック描画
  #     actor   : アクター
  #     x       : 描画先 X 座標
  #     y       : 描画先 Y 座標
  #     opacity : 不透明度
  #--------------------------------------------------------------------------
  def draw_actor_graphic(actor, x, y, opacity = 255)
    draw_character(actor.character_name, actor.character_index, x, y, opacity)
  end
  #--------------------------------------------------------------------------
  # ● 歩行グラフィックの描画
  #     character_name  : 歩行グラフィック ファイル名
  #     character_index : 歩行グラフィック インデックス
  #     x               : 描画先 X 座標
  #     y               : 描画先 Y 座標
  #     opacity         : 不透明度
  #--------------------------------------------------------------------------
  def draw_character(character_name, character_index, x, y, opacity = 255)
    return if character_name == nil
    bitmap = Cache.character(character_name)
    sign = character_name[/^[\!\$]./]
    if sign != nil and sign.include?(')
      cw = bitmap.width / 3
      ch = bitmap.height / 4
    else
      cw = bitmap.width / 12
      ch = bitmap.height / 8
    end
    n = character_index
    src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
  end
  #--------------------------------------------------------------------------
  # ○ 空欄アクター描画
  #     index : 項目番号
  #--------------------------------------------------------------------------
  def draw_empty_actor(index)
    rect = item_rect(index)
    self.contents.font.color = system_color
    self.contents.draw_text(rect, KGC::LargeParty::PARTY_MEMBER_BLANK_TEXT, 1)
    self.contents.font.color = normal_color
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

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

class Window_PartyFormStatus < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 384, 128)
    self.z = 1000
    @actor = nil
    refresh
  end
  #--------------------------------------------------------------------------
  # ○ アクター設定
  #--------------------------------------------------------------------------
  def set_actor(actor)
    if @actor != actor
      @actor = actor
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if @actor == nil
      return
    end

    draw_actor_face(@actor, 0, 0)
    dx = 104
    draw_actor_name(@actor, dx, 0)
    draw_actor_level(@actor, dx, WLH * 1)
    draw_actor_hp(@actor, dx, WLH * 2)
    draw_actor_mp(@actor, dx, WLH * 3)
    4.times { |i|
      draw_actor_parameter(@actor, dx + 128, WLH * i, i, 120)
    }
  end
  #--------------------------------------------------------------------------
  # ● 能力値の描画
  #     actor : アクター
  #     x     : 描画先 X 座標
  #     y     : 描画先 Y 座標
  #     type  : 能力値の種類 (0~3)
  #     width : 描画幅
  #--------------------------------------------------------------------------
  def draw_actor_parameter(actor, x, y, type, width = 156)
    case type
    when 0
      parameter_name = Vocab::atk
      parameter_value = actor.atk
    when 1
      parameter_name = Vocab::def
      parameter_value = actor.def
    when 2
      parameter_name = Vocab::spi
      parameter_value = actor.spi
    when 3
      parameter_name = Vocab::agi
      parameter_value = actor.agi
    end
    nw = width - 36
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, nw, WLH, parameter_name)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + nw, y, 36, WLH, parameter_value, 2)
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

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

class Window_PartyFormControl < Window_Base
  #--------------------------------------------------------------------------
  # ○ 定数
  #--------------------------------------------------------------------------
  MODE_BATTLE_MEMBER = 0
  MODE_SHIFT_CHANGE  = 1
  MODE_PARTY_MEMBER  = 2
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, Graphics.width - 384, 128)
    self.z = 1000
    @mode = MODE_BATTLE_MEMBER
    refresh
  end
  #--------------------------------------------------------------------------
  # ○ モード変更
  #--------------------------------------------------------------------------
  def mode=(value)
    @mode = value
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    case @mode
    when MODE_BATTLE_MEMBER  # 戦闘メンバー
      buttons = [
        "A: 排除",
        "B: 结束",
        "C: 决定",
        "X: 替换"
      ]
    when MODE_SHIFT_CHANGE   # 並び替え
      buttons = [
        "B: 取消",
        "C: 决定",
        "X: 决定"
      ]
    when MODE_PARTY_MEMBER   # パーティメンバー
      buttons = [
        "B: 取消",
        "C: 决定"
      ]
    else
      return
    end

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

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_Title
#==============================================================================

class Scene_Title < Scene_Base
  #--------------------------------------------------------------------------
  # ● 各種ゲームオブジェクトの作成
  #--------------------------------------------------------------------------
  alias create_game_objects_KGC_LargeParty create_game_objects
  def create_game_objects
    create_game_objects_KGC_LargeParty

    if KGC::LargeParty::DEFAULT_PARTYFORM_ENABLED
      $game_switches[KGC::LargeParty::PARTYFORM_SWITCH] = true
      $game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH] = true
    end
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_Map
#==============================================================================

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

    if $game_temp.next_scene == :partyform
      call_partyform
      return
    end

    update_scene_change_KGC_LargeParty
  end
  #--------------------------------------------------------------------------
  # ○ パーティ編成画面への切り替え
  #--------------------------------------------------------------------------
  def call_partyform
    $game_temp.next_scene = nil
    $scene = Scene_PartyForm.new(0, Scene_PartyForm::HOST_MAP)
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_Menu
#==============================================================================

class Scene_Menu < Scene_Base
  if KGC::LargeParty::USE_MENU_PARTYFORM_COMMAND
  #--------------------------------------------------------------------------
  # ● コマンドウィンドウの作成
  #--------------------------------------------------------------------------
  alias create_command_window_KGC_LargeParty create_command_window
  def create_command_window
    create_command_window_KGC_LargeParty

    return if $imported["CustomMenuCommand"]

    @__command_partyform_index =
      @command_window.add_command(Vocab.partyform)
    @command_window.draw_item(@__command_partyform_index,
      $game_party.partyform_enable?)
    if @command_window.oy > 0
      @command_window.oy -= Window_Base::WLH
    end
    @command_window.index = @menu_index
  end
  end
  #--------------------------------------------------------------------------
  # ● コマンド選択の更新
  #--------------------------------------------------------------------------
  alias update_command_selection_KGC_LargeParty update_command_selection
  def update_command_selection
    current_menu_index = @__command_partyform_index
    call_partyform_flag = false

    if Input.trigger?(Input::C)
      case @command_window.index
      when @__command_partyform_index  # パーティ編成
        call_partyform_flag = true
      end
    # パーティ編成ボタン押下
    elsif KGC::LargeParty::MENU_PARTYFORM_BUTTON != nil &&
        Input.trigger?(KGC::LargeParty::MENU_PARTYFORM_BUTTON)
      call_partyform_flag = true
      current_menu_index = @command_window.index if current_menu_index == nil
    end

    # パーティ編成画面に移行
    if call_partyform_flag
      if $game_party.members.size == 0 || !$game_party.partyform_enable?
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      $scene = Scene_PartyForm.new(current_menu_index)
      return
    end

    update_command_selection_KGC_LargeParty
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_Shop
#==============================================================================

unless $imported["HelpExtension"]
class Scene_Shop < Scene_Base
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias udpate_KGC_LargeParty update
  def update
    # スクロール判定
    if !@command_window.active &&
        KGC::LargeParty::SHOP_STATUS_SCROLL_BUTTON != nil &&
        Input.press?(KGC::LargeParty::SHOP_STATUS_SCROLL_BUTTON)
      super
      update_menu_background
      update_scroll_status
      return
    else
      @status_window.cursor_rect.empty
    end

    udpate_KGC_LargeParty
  end
  #--------------------------------------------------------------------------
  # ○ ステータスウィンドウのスクロール処理
  #--------------------------------------------------------------------------
  def update_scroll_status
    # ステータスウィンドウにカーソルを表示
    @status_window.cursor_rect.width = @status_window.contents.width
    @status_window.cursor_rect.height = @status_window.height - 32
    @status_window.update

    if Input.press?(Input::UP)
      @status_window.oy = [@status_window.oy - 4, 0].max
    elsif Input.press?(Input::DOWN)
      max_pos = [@status_window.contents.height -
        (@status_window.height - 32), 0].max
      @status_window.oy = [@status_window.oy + 4, max_pos].min
    end
  end
end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

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

class Scene_PartyForm < Scene_Base
  #--------------------------------------------------------------------------
  # ○ 定数
  #--------------------------------------------------------------------------
  CAPTION_OFFSET = 40  # キャプションウィンドウの位置補正
  HOST_MENU   = 0      # 呼び出し元 : メニュー
  HOST_MAP    = 1      # 呼び出し元 : マップ
  HOST_BATTLE = 2      # 呼び出し元 : 戦闘
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     menu_index : コマンドのカーソル初期位置
  #     host_scene : 呼び出し元 (0..メニュー  1..マップ  2..戦闘)
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0, host_scene = HOST_MENU)
    @menu_index = menu_index
    @host_scene = host_scene
  end
  #--------------------------------------------------------------------------
  # ● 開始処理
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background

    create_windows
    create_confirm_window
    adjust_window_location

    # 編成前のパーティを保存
    @battle_actors = $game_party.battle_members.dup
    @party_actors = $game_party.all_members.dup
  end
  #--------------------------------------------------------------------------
  # ○ ウィンドウの作成
  #--------------------------------------------------------------------------
  def create_windows
    # 編成用ウィンドウを作成
    @battle_member_window = Window_PartyFormBattleMember.new
    @party_member_window = Window_PartyFormAllMember.new
    @status_window = Window_PartyFormStatus.new
    @status_window.set_actor(@battle_member_window.actor)

    # その他のウィンドウを作成
    @battle_member_caption_window =
      Window_PartyFormCaption.new(KGC::LargeParty::BATTLE_MEMBER_CAPTION)
    @party_member_caption_window =
      Window_PartyFormCaption.new(KGC::LargeParty::PARTY_MEMBER_CAPTION)
    @control_window = Window_PartyFormControl.new
  end
  #--------------------------------------------------------------------------
  # ○ 確認ウィンドウの作成
  #--------------------------------------------------------------------------
  def create_confirm_window
    commands = KGC::LargeParty::CONFIRM_WINDOW_COMMANDS
    @confirm_window =
      Window_Command.new(KGC::LargeParty::CONFIRM_WINDOW_WIDTH, commands)
    @confirm_window.index = 0
    @confirm_window.openness = 0
    @confirm_window.active = false
  end
  #--------------------------------------------------------------------------
  # ○ ウィンドウの座標調整
  #--------------------------------------------------------------------------
  def adjust_window_location
    # 基準座標を計算
    base_x = [@battle_member_window.width, @party_member_window.width].max
    base_x = [(Graphics.width - base_x) / 2, 0].max
    base_y = @battle_member_window.height + @party_member_window.height +
      @status_window.height + CAPTION_OFFSET * 2
    base_y = [(Graphics.height - base_y) / 2, 0].max
    base_z = @menuback_sprite.z + 1000

    # 編成用ウィンドウの座標をセット
    @battle_member_window.x = base_x
    @battle_member_window.y = base_y + CAPTION_OFFSET
    @battle_member_window.z = base_z
    @party_member_window.x = base_x
    @party_member_window.y = @battle_member_window.y +
      @battle_member_window.height + CAPTION_OFFSET
    @party_member_window.z = base_z
    @status_window.x = 0
    @status_window.y = @party_member_window.y + @party_member_window.height
    @status_window.z = base_z

    # その他のウィンドウの座標をセット
    @battle_member_caption_window.x = [base_x - 16, 0].max
    @battle_member_caption_window.y = @battle_member_window.y - CAPTION_OFFSET
    @battle_member_caption_window.z = base_z + 500
    @party_member_caption_window.x = [base_x - 16, 0].max
    @party_member_caption_window.y = @party_member_window.y - CAPTION_OFFSET
    @party_member_caption_window.z = base_z + 500
    @control_window.x = @status_window.width
    @control_window.y = @status_window.y
    @control_window.z = base_z

    @confirm_window.x = (Graphics.width - @confirm_window.width) / 2
    @confirm_window.y = (Graphics.height - @confirm_window.height) / 2
    @confirm_window.z = base_z + 1000
  end
  #--------------------------------------------------------------------------
  # ● 終了処理
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @battle_member_window.dispose
    @party_member_window.dispose
    @status_window.dispose
    @battle_member_caption_window.dispose
    @party_member_caption_window.dispose
    @control_window.dispose
    @confirm_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● メニュー画面系の背景作成
  #--------------------------------------------------------------------------
  def create_menu_background
    super
    @menuback_sprite.z = 20000
  end
  #--------------------------------------------------------------------------
  # ● 元の画面へ戻る
  #--------------------------------------------------------------------------
  def return_scene
    case @host_scene
    when HOST_MENU
      $scene = Scene_Menu.new(@menu_index)
    when HOST_MAP
      $scene = Scene_Map.new
    when HOST_BATTLE
      $scene = Scene_Battle.new
    end
    $game_player.refresh
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    update_window
    if @battle_member_window.active
      update_battle_member
    elsif @party_member_window.active
      update_party_member
    elsif @confirm_window.active
      update_confirm
    end
  end
  #--------------------------------------------------------------------------
  # ○ ウィンドウ更新
  #--------------------------------------------------------------------------
  def update_window
    @battle_member_window.update
    @party_member_window.update
    @status_window.update
    @battle_member_caption_window.update
    @party_member_caption_window.update
    @control_window.update
    @confirm_window.update
  end
  #--------------------------------------------------------------------------
  # ○ ウィンドウ再描画
  #--------------------------------------------------------------------------
  def refresh_window
    @battle_member_window.refresh
    @party_member_window.refresh
  end
  #--------------------------------------------------------------------------
  # ○ フレーム更新 (戦闘メンバーウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_battle_member
    @status_window.set_actor(@battle_member_window.actor)
    if Input.trigger?(Input::A)
      if @battle_member_window.selected_index == nil  # 並び替え中でない
        actor = @battle_member_window.actor
        # アクターを外せない場合
        if actor == nil || $game_party.actor_fixed?(actor.id)
          Sound.play_buzzer
          return
        end
        # アクターを外す
        Sound.play_decision
        actors = $game_party.battle_members
        actors.delete_at(@battle_member_window.index)
        $game_party.set_battle_member(actors)
        refresh_window
      end
    elsif Input.trigger?(Input::B)
      if @battle_member_window.selected_index == nil  # 並び替え中でない
        # 確認ウィンドウに切り替え
        Sound.play_cancel
        show_confirm_window
      else                                            # 並び替え中
        # 並び替え解除
        Sound.play_cancel
        @battle_member_window.selected_index = nil
        @battle_member_window.refresh
        @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
      end
    elsif Input.trigger?(Input::C)
      if @battle_member_window.selected_index == nil  # 並び替え中でない
        actor = @battle_member_window.actor
        # アクターを外せない場合
        if actor != nil && $game_party.actor_fixed?(actor.id)
          Sound.play_buzzer
          return
        end
        # パーティメンバーウィンドウに切り替え
        Sound.play_decision
        @battle_member_window.active = false
        @party_member_window.active = true
        @control_window.mode = Window_PartyFormControl::MODE_PARTY_MEMBER
      else                                            # 並び替え中
        unless can_change_shift?(@battle_member_window.actor)
          Sound.play_buzzer
          return
        end
        # 並び替え実行
        Sound.play_decision
        index1 = @battle_member_window.selected_index
        index2 = @battle_member_window.index
        change_shift(index1, index2)
        @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
      end
    elsif Input.trigger?(Input::X)
      # 並び替え不可能な場合
      unless can_change_shift?(@battle_member_window.actor)
        Sound.play_buzzer
        return
      end
      if @battle_member_window.selected_index == nil  # 並び替え中でない
        # 並び替え開始
        Sound.play_decision
        @battle_member_window.selected_index = @battle_member_window.index
        @battle_member_window.refresh
        @control_window.mode = Window_PartyFormControl::MODE_SHIFT_CHANGE
      else                                            # 並び替え中
        # 並び替え実行
        Sound.play_decision
        index1 = @battle_member_window.selected_index
        index2 = @battle_member_window.index
        change_shift(index1, index2)
        @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
      end
    end
  end
  #--------------------------------------------------------------------------
  # ○ 並び替え可否判定
  #--------------------------------------------------------------------------
  def can_change_shift?(actor)
    # 選択したアクターが存在しない、または並び替え不能な場合
    if actor == nil ||
        (KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED &&
         $game_party.actor_fixed?(actor.id))
      return false
    end
    return true
  end
  #--------------------------------------------------------------------------
  # ○ 並び替え
  #--------------------------------------------------------------------------
  def change_shift(index1, index2)
    # 位置を入れ替え
    $game_party.change_shift(index1, index2)
    # 選択済みインデックスをクリア
    @battle_member_window.selected_index = nil
    refresh_window
  end
  #--------------------------------------------------------------------------
  # ○ フレーム更新 (パーティウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_party_member
    @status_window.set_actor(@party_member_window.actor)
    if Input.trigger?(Input::B)
      Sound.play_cancel
      # 戦闘メンバーウィンドウに切り替え
      @battle_member_window.active = true
      @party_member_window.active = false
        @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
    elsif Input.trigger?(Input::C)
      actor = @party_member_window.actor
      # アクターが戦闘メンバーに含まれる場合
      if $game_party.battle_members.include?(actor)
        Sound.play_buzzer
        return
      end
      # アクターを入れ替え
      Sound.play_decision
      actors = $game_party.all_members
      battle_actors = $game_party.battle_members
      if @battle_member_window.actor != nil
        actors[@party_member_window.actor_index] = @battle_member_window.actor
        actors[@battle_member_window.index] = actor
        $game_party.set_member(actors.compact)
      end
      battle_actors[@battle_member_window.index] = actor
      $game_party.set_battle_member(battle_actors.compact)
      refresh_window
      # 戦闘メンバーウィンドウに切り替え
      @battle_member_window.active = true
      @party_member_window.active = false
      @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
    end
  end
  #--------------------------------------------------------------------------
  # ○ フレーム更新 (確認ウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_confirm
    if Input.trigger?(Input::B)
      Sound.play_cancel
      hide_confirm_window
    elsif Input.trigger?(Input::C)
      case @confirm_window.index
      when 0  # 編成完了
        # パーティが無効の場合
        unless battle_member_valid?
          Sound.play_buzzer
          return
        end
        Sound.play_decision
        return_scene
      when 1  # 編成中断
        Sound.play_decision
        # パーティを編成前の状態に戻す
        $game_party.set_member(@party_actors)
        $game_party.set_battle_member(@battle_actors)
        return_scene
      when 2  # キャンセル
        Sound.play_cancel
        hide_confirm_window
      end
    end
  end
  #--------------------------------------------------------------------------
  # ○ 戦闘メンバー有効判定
  #--------------------------------------------------------------------------
  def battle_member_valid?
    return false if $game_party.battle_members.size == 0  # 戦闘メンバーが空
    $game_party.battle_members.each { |actor|
      return true if actor.exist?  # 生存者がいればOK
    }
    return false
  end
  #--------------------------------------------------------------------------
  # ○ 確認ウィンドウの表示
  #--------------------------------------------------------------------------
  def show_confirm_window
    if @battle_member_window.active
      @last_active_window = @battle_member_window
    else
      @last_active_window = @party_member_window
    end
    @battle_member_window.active = false
    @party_member_window.active = false

    @confirm_window.draw_item(0, battle_member_valid?)
    @confirm_window.open
    @confirm_window.active = true
  end
  #--------------------------------------------------------------------------
  # ○ 確認ウィンドウの非表示
  #--------------------------------------------------------------------------
  def hide_confirm_window
    @confirm_window.active = false
    @confirm_window.close
    @last_active_window.active = true
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_Battle
#==============================================================================

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

    wait_for_message_KGC_LargeParty
  end
  #--------------------------------------------------------------------------
  # ● レベルアップの表示
  #--------------------------------------------------------------------------
  alias display_level_up_KGC_LargeParty display_level_up
  def display_level_up
    @ignore_wait_for_message = true

    display_level_up_KGC_LargeParty

    exp = $game_troop.exp_total * KGC::LargeParty::STAND_BY_EXP_RATE / 1000
    $game_party.stand_by_members.each { |actor|
      if actor.exist?
        actor.gain_exp(exp, KGC::LargeParty::SHOW_STAND_BY_LEVEL_UP)
      end
    }
    @ignore_wait_for_message = false
    wait_for_message
  end
  #--------------------------------------------------------------------------
  # ● パーティコマンド選択の開始
  #--------------------------------------------------------------------------
  alias start_party_command_selection_KGC_LargeParty start_party_command_selection
  def start_party_command_selection
    if $game_temp.in_battle
      @status_window.index = 0
    end

    start_party_command_selection_KGC_LargeParty
  end

  if KGC::LargeParty::USE_BATTLE_PARTYFORM
  #--------------------------------------------------------------------------
  # ● 情報表示ビューポートの作成
  #--------------------------------------------------------------------------
  alias create_info_viewport_KGC_LargeParty create_info_viewport
  def create_info_viewport
    create_info_viewport_KGC_LargeParty

    @__command_partyform_index =
      @party_command_window.add_command(Vocab.partyform_battle)
    @party_command_window.draw_item(@__command_partyform_index,
      $game_party.battle_partyform_enable?)
  end
  #--------------------------------------------------------------------------
  # ● パーティコマンド選択の更新
  #--------------------------------------------------------------------------
  alias update_party_command_selection_KGC_LargeParty update_party_command_selection
  def update_party_command_selection
    if Input.trigger?(Input::C)
      case @party_command_window.index
      when @__command_partyform_index  # パーティ編成
        unless $game_party.battle_partyform_enable?
          Sound.play_buzzer
          return
        end
        Sound.play_decision
        process_partyform
        return
      end
    end

    update_party_command_selection_KGC_LargeParty
  end
  #--------------------------------------------------------------------------
  # ○ パーティ編成の処理
  #--------------------------------------------------------------------------
  def process_partyform
    Graphics.freeze
    snapshot_for_background
    $scene = Scene_PartyForm.new(0, Scene_PartyForm::HOST_BATTLE)
    $scene.main
    $scene = self
    @status_window.refresh
    perform_transition
  end
  end
end

点评

请用代码括起来。不然途中出来的表情很囧  发表于 2011-8-30 19:52

评分

参与人数 1星屑 +90 收起 理由
流星的瞬间 + 90 谢谢~~

查看全部评分

回复

使用道具 举报

Lv2.观梦者

千纸鹤的魔法少女

梦石
0
星屑
893
在线时间
2869 小时
注册时间
2010-11-20
帖子
4160

开拓者贵宾

3
发表于 2011-8-31 09:03:51 | 只看该作者
我这里有个汉化了一部分的(在6R善用搜索功能找到的),不过部分文字显示被我改了。(比如说队友管理被我改成了“马车”……以前用来做DQ同人改的= =)但是对脚本使用并无影响。
下面是脚本:
(PS1:部分# 后面的注释有讲到那里的文字是怎么回事之类的)
(PS2:脚本过长,我分成了几段,使用方法是按顺序复制到工程的“脚本”的Main前)
  1. #==============================================================================
  2. # ■ 战斗队伍设置
  3. #------------------------------------------------------------------------------
  4. #  菜单中添加战斗队伍设置
  5. #==============================================================================

  6. #==============================================================================
  7. # ● 设置
  8. #==============================================================================

  9. module KGC
  10. module LargeParty
  11.   # ◆ 使用准许的开关
  12.   PARTYFORM_SWITCH          = 3
  13.   # ◆ 战斗中允许的开关
  14.   BATTLE_PARTYFORM_SWITCH   = 4
  15.   # ◆ 自动打开许可
  16.   #  true的时候,「开始游戏」选取时
  17.   #  自动打开
  18.   DEFAULT_PARTYFORM_ENABLED = true

  19.   # ◆ 战斗最大人数 (配合战斗人数)
  20.   MAX_BATTLE_MEMBERS = 4
  21.   # ◆ 人员数上限
  22.   MAX_MEMBERS = 10

  23.   # ◆ 固定排列,禁止成员
  24.   FORBID_CHANGE_SHIFT_FIXED = true

  25.   # ◆ 待机成员的背景颜色
  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.   #  部使用请填 nil
  34.   MENU_PARTYFORM_BUTTON      = nil
  35.   # ◆ 菜单画面中是否自动添加选择
  36.   USE_MENU_PARTYFORM_COMMAND = true
  37.   # ◆ 菜单的选择名称
  38.   VOCAB_MENU_PARTYFORM       = "马车"

  39.   # ◆ 战斗中能否换人
  40.   #  添加在“逃跑”之下
  41.   USE_BATTLE_PARTYFORM   = true
  42.   # ◆ 战斗中该选择的名称
  43.   VOCAB_BATTLE_PARTYFORM = "马车"

  44.   # ◆ 人物走行图的大小[长, 高]
  45.   #  重写人物走行图的大小
  46.   PARTY_FORM_CHARACTER_SIZE   = [40, 48]
  47.   # ◆ 战斗部队栏位空时候显示的文字
  48.   BATTLE_MEMBER_BLANK_TEXT    = "空"
  49.   # ◆ 编制组队的最大行数
  50.   PARTY_MEMBER_WINDOW_ROW_MAX = 4
  51.   # ◆ 編成画面のパーティメンバーウィンドウに戦闘メンバーを表示する
  52.   SHOW_BATTLE_MEMBER_IN_PARTY = false
  53.   # ◆ 待机人员栏位空时候显示的文字
  54.   PARTY_MEMBER_BLANK_TEXT     = "-"

  55.   # ◆ 編成画面のキャプションウィンドウの幅
  56.   CAPTION_WINDOW_WIDTH  = 192
  57.   # ◆ 上面的战斗人物
  58.   BATTLE_MEMBER_CAPTION = "参战人物"

  59.   if SHOW_BATTLE_MEMBER_IN_PARTY
  60.     # ◆ 下边的待机人物
  61.     PARTY_MEMBER_CAPTION = "待机人物"
  62.   else
  63.     # ◆ 下边的待机人物
  64.     PARTY_MEMBER_CAPTION = "待机人物"
  65.   end

  66.   # ◆ 編成確認ウィンドウの幅
  67.   CONFIRM_WINDOW_WIDTH    = 160
  68.   # ◆ 編成確認ウィンドウの文字列
  69.   #  ※コマンド数?順番を変更するとバグります。
  70.   CONFIRM_WINDOW_COMMANDS = ["编成完毕", "不保存退出", "取消"]

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

  76.   # ◆ 待機メンバー獲得経験値割合【単位:‰(千分率 1‰=0.1%)】
  77.   #  500 なら 50.0% です。
  78.   STAND_BY_EXP_RATE = 900
  79.   # ◆ リザルト画面で待機メンバーのレベルアップを表示する
  80.   #  false にすると、戦闘メンバーのみ表示します。
  81.   SHOW_STAND_BY_LEVEL_UP = false
  82.   # ◆ 戦闘以外でも待機メンバーを表示する
  83.   #  true  : 戦闘以外では常に全員を表示。
  84.   #  false : 入れ替え時以外は、待機メンバーをいないものとして扱う。
  85.   SHOW_STAND_BY_MEMBER_NOT_IN_BATTLE = true
  86. end
  87. end

  88. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  89. $imported = {} if $imported == nil
  90. $imported["LargeParty"] = true

  91. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  92. #==============================================================================
  93. # □ KGC::Commands
  94. #==============================================================================

  95. module KGC::Commands
  96.   # 排列
  97.   SORT_BY_ID    = 0  # ID順
  98.   SORT_BY_NAME  = 1  # 名前順
  99.   SORT_BY_LEVEL = 2  # 水平

  100.   module_function
  101.   #--------------------------------------------------------------------------
  102.   # ○ 呼叫屏幕
  103.   #--------------------------------------------------------------------------
  104.   def call_partyform
  105.     return if $game_temp.in_battle
  106.     $game_temp.next_scene = :partyform
  107.   end
  108.   #--------------------------------------------------------------------------
  109.   # ○ 战斗最大人数設定
  110.   #--------------------------------------------------------------------------
  111.   def set_max_battle_member_count(value = nil)
  112.     $game_party.max_battle_member_count = value
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ○ 判定是否满人
  116.   #--------------------------------------------------------------------------
  117.   def party_full?
  118.     return $game_party.full?
  119.   end
  120.   #--------------------------------------------------------------------------
  121.   # ○ 平时能否编辑設定
  122.   #     enabled : 有効标志 (省略時 : true)
  123.   #--------------------------------------------------------------------------
  124.   def permit_partyform(enabled = true)
  125.     $game_switches[KGC::LargeParty::PARTYFORM_SWITCH] = enabled
  126.   end
  127.   #--------------------------------------------------------------------------
  128.   # ○ 战斗时能否编辑的設定
  129.   #     enabled : 有効标志 (省略時 : true)
  130.   #--------------------------------------------------------------------------
  131.   def permit_battle_partyform(enabled = true)
  132.     $game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH] = enabled
  133.   end
  134.   #--------------------------------------------------------------------------
  135.   # ○ 绘画人物状态
  136.   #     actor_id : 人物 ID
  137.   #     fixed    : 固定标志 (省略時 : true)
  138.   #--------------------------------------------------------------------------
  139.   def fix_actor(actor_id, fixed = true)
  140.     $game_party.fix_actor(actor_id, fixed)
  141.   end
  142.   #--------------------------------------------------------------------------
  143.   # ○ 排序设定
  144.   #    使 index1 和 index2 交替
  145.   #--------------------------------------------------------------------------
  146.   def change_party_shift(index1, index2)
  147.     $game_party.change_shift(index1, index2)
  148.   end
  149.   #--------------------------------------------------------------------------
  150.   # ○ 人员编号排列 (升)
  151.   #     sort_type : 排序形式 (SORT_BY_xxx)
  152.   #     reverse   : true 降
  153.   #--------------------------------------------------------------------------
  154.   def sort_party_member(sort_type = SORT_BY_ID, reverse = false)
  155.     $game_party.sort_member(sort_type, reverse)
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # ○ 待機人员 ID 取得
  159.   #--------------------------------------------------------------------------
  160.   def get_stand_by_member_ids
  161.     result = []
  162.     $game_party.stand_by_members.each { |actor| result << actor.id }
  163.     return result
  164.   end
  165.   #--------------------------------------------------------------------------
  166.   # ○ 待机人员
  167.   #     actor_id : 人物 ID
  168.   #--------------------------------------------------------------------------
  169.   def stand_by_member?(actor_id)
  170.     return get_stand_by_member_ids.include?(actor_id)
  171.   end
  172.   #--------------------------------------------------------------------------
  173.   # ○ 成员加入临死状态
  174.   #     actor_id : ア人物 ID
  175.   #     index    : 追加位置 (默认底部)
  176.   #--------------------------------------------------------------------------
  177.   def add_battle_member(actor_id, index = nil)
  178.     $game_party.add_battle_member(actor_id, index)
  179.   end
  180.   #--------------------------------------------------------------------------
  181.   # ○ 重置被击倒人员
  182.   #     actor_id : 人物 ID
  183.   #--------------------------------------------------------------------------
  184.   def remove_battle_member(actor_id)
  185.     $game_party.remove_battle_member(actor_id)
  186.   end
  187.   #--------------------------------------------------------------------------
  188.   # ○ 重置被击倒意外的所有人员
  189.   #--------------------------------------------------------------------------
  190.   def remove_all_battle_member
  191.     $game_party.all_members.each { |actor|
  192.       $game_party.remove_battle_member(actor.id)
  193.     }
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # ○ 随即出击
  197.   #--------------------------------------------------------------------------
  198.   def random_launch
  199.     new_battle_members = $game_party.fixed_members
  200.     candidates = $game_party.all_members - new_battle_members
  201.     num = [$game_party.max_battle_member_count - new_battle_members.size,
  202.       candidates.size].min
  203.     return if num <= 0

  204.     # 随即选择
  205.     ary = (0...candidates.size).to_a.sort_by { rand }
  206.     ary[0...num].each { |i| new_battle_members << candidates[i] }
  207.     $game_party.set_battle_member(new_battle_members)
  208.   end
  209. end

  210. class Game_Interpreter
  211.   include KGC::Commands
  212. end

  213. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  214. #==============================================================================
  215. # ■ Vocab
  216. #==============================================================================

  217. module Vocab
  218.   # 「パーティ編成」コマンド名 (メニュー)
  219.   def self.partyform
  220.     return KGC::LargeParty::VOCAB_MENU_PARTYFORM
  221.   end

  222.   # 「パーティ編成」コマンド名 (戦闘)
  223.   def self.partyform_battle
  224.     return KGC::LargeParty::VOCAB_BATTLE_PARTYFORM
  225.   end
  226. end

  227. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  228. #==============================================================================
  229. # ■ Game_Actor
  230. #==============================================================================

  231. class Game_Actor < Game_Battler
  232.   #--------------------------------------------------------------------------
  233.   # ○ パーティ内インデックス取得
  234.   #--------------------------------------------------------------------------
  235.   def party_index
  236.     return $game_party.all_members.index(self)
  237.   end
  238.   #--------------------------------------------------------------------------
  239.   # ○ 戦闘メンバーか判定
  240.   #--------------------------------------------------------------------------
  241.   def battle_member?
  242.     return $game_party.battle_members.include?(self)
  243.   end
  244.   #--------------------------------------------------------------------------
  245.   # ○ 固定メンバーか判定
  246.   #--------------------------------------------------------------------------
  247.   def fixed_member?
  248.     return $game_party.fixed_members.include?(self)
  249.   end
  250. end

  251. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  252. #==============================================================================
  253. # ■ Game_Party
  254. #==============================================================================

  255. class Game_Party
  256.   #--------------------------------------------------------------------------
  257.   # ● 定数
  258.   #--------------------------------------------------------------------------
  259.   MAX_MEMBERS = KGC::LargeParty::MAX_MEMBERS  # 最大パーティ人数
  260.   #--------------------------------------------------------------------------
  261.   # ● オブジェクト初期化
  262.   #--------------------------------------------------------------------------
  263.   alias initialize_KGC_LargeParty initialize
  264.   def initialize
  265.     initialize_KGC_LargeParty

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

  353.     self.battle_member_count = @actors.size
  354.   end
  355.   #--------------------------------------------------------------------------
  356.   # ● 戦闘テスト用パーティのセットアップ
  357.   #--------------------------------------------------------------------------
  358.   alias setup_battle_test_members_KGC_LargeParty setup_battle_test_members
  359.   def setup_battle_test_members
  360.     setup_battle_test_members_KGC_LargeParty

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

  417.     add_actor_KGC_LargeParty(actor_id)

  418.     if last_size < @actors.size
  419.       self.battle_member_count += 1
  420.     end
  421.   end
  422.   #--------------------------------------------------------------------------
  423.   # ○ アクターを戦闘メンバーに加える
  424.   #     actor_id : アクター ID
  425.   #     index    : 追加位置 (省略時は最後尾)
  426.   #--------------------------------------------------------------------------
  427.   def add_battle_member(actor_id, index = nil)
  428.     return unless @actors.include?(actor_id)  # パーティにいない
  429.     if index == nil
  430.       return if battle_members.include?($game_actors[actor_id])  # 出撃済み
  431.       return if battle_member_count == max_battle_member_count   # 人数が最大
  432.       index = battle_member_count
  433.     end

  434.     @actors.delete(actor_id)
  435.     @actors.insert(index, actor_id)
  436.     self.battle_member_count += 1
  437.   end
  438.   #--------------------------------------------------------------------------
  439.   # ○ アクターを戦闘メンバーから外す
  440.   #     actor_id : アクター ID
  441.   #--------------------------------------------------------------------------
  442.   def remove_battle_member(actor_id)
  443.     return unless @actors.include?(actor_id)  # パーティにいない
  444.     return if actor_fixed?(actor_id)          # 固定済み
  445.     return if stand_by_members.include?($game_actors[actor_id])  # 待機中

  446.     @actors.delete(actor_id)
  447.     @actors.push(actor_id)
  448.     self.battle_member_count -= 1
  449.   end
  450.   #--------------------------------------------------------------------------
  451.   # ○ アクターの固定状態を設定
  452.   #     actor_id : アクター ID
  453.   #     fixed    : 固定フラグ (省略時 : false)
  454.   #--------------------------------------------------------------------------
  455.   def fix_actor(actor_id, fixed = false)
  456.     return unless @actors.include?(actor_id)  # パーティにいない

  457.     if fixed
  458.       # 固定
  459.       unless @fixed_actors.include?(actor_id)
  460.         @fixed_actors << actor_id
  461.         unless battle_members.include?($game_actors[actor_id])
  462.           self.battle_member_count += 1
  463.         end
  464.       end
  465.       # 強制出撃
  466.       apply_force_launch
  467.     else
  468.       # 固定解除
  469.       @fixed_actors.delete(actor_id)
  470.     end
  471.     $game_player.refresh
  472.   end
  473.   #--------------------------------------------------------------------------
  474.   # ○ 強制出撃適用
  475.   #--------------------------------------------------------------------------
  476.   def apply_force_launch
  477.     while (fixed_members - battle_members).size > 0
  478.       # 固定状態でないメンバーを適当に持ってきて入れ替え
  479.       actor1 = stand_by_members.find { |a| @fixed_actors.include?(a.id) }
  480.       actor2 = battle_members.reverse.find { |a| !@fixed_actors.include?(a.id) }
  481.       index1 = @actors.index(actor1.id)
  482.       index2 = @actors.index(actor2.id)
  483.       @actors[index1], @actors[index2] = @actors[index2], @actors[index1]

  484.       # 戦闘メンバーが全員固定されたら戻る (無限ループ防止)
  485.       all_fixed = true
  486.       battle_members.each { |actor|
  487.         unless actor.fixed_member?
  488.           all_fixed = false
  489.           break
  490.         end
  491.       }
  492.       break if all_fixed
  493.     end
  494.   end
  495.   #--------------------------------------------------------------------------
  496.   # ○ メンバー整列 (昇順)
  497.   #     sort_type : ソート形式 (SORT_BY_xxx)
  498.   #     reverse   : true だと降順
  499.   #--------------------------------------------------------------------------
  500.   def sort_member(sort_type = KGC::Commands::SORT_BY_ID,
  501.                   reverse = false)
  502.     # バッファを準備
  503.     b_actors = battle_members
  504.     actors = all_members - b_actors
  505.     f_actors = fixed_members
  506.     # 固定キャラはソートしない
  507.     if KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED
  508.       actors -= f_actors
  509.       b_actors -= f_actors
  510.     end

  511.     # ソート
  512.     case sort_type
  513.     when KGC::Commands::SORT_BY_ID     # ID順
  514.       actors.sort!   { |a, b| a.id <=> b.id }
  515.       b_actors.sort! { |a, b| a.id <=> b.id }
  516.     when KGC::Commands::SORT_BY_NAME   # 名前順
  517.       actors.sort!   { |a, b| a.name <=> b.name }
  518.       b_actors.sort! { |a, b| a.name <=> b.name }
  519.     when KGC::Commands::SORT_BY_LEVEL  # レベル順
  520.       actors.sort!   { |a, b| a.level <=> b.level }
  521.       b_actors.sort! { |a, b| a.level <=> b.level }
  522.     end
  523.     # 反転
  524.     if reverse
  525.       actors.reverse!
  526.       b_actors.reverse!
  527.     end

  528.     # 固定キャラを先頭に持ってくる
  529.     if KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED
  530.       actors = f_actors + actors
  531.       b_actors = f_actors + b_actors
  532.     end

  533.     # 復帰
  534.     set_member(actors)
  535.     set_battle_member(b_actors)

  536.     apply_force_launch
  537.     $game_player.refresh
  538.   end
  539.   #--------------------------------------------------------------------------
  540.   # ○ 並び替え
  541.   #    戦闘メンバーの index1 番目と index2 番目を入れ替える
  542.   #--------------------------------------------------------------------------
  543.   def change_shift(index1, index2)
  544.     size = @actors.size
  545.     if index1 >= size || index2 >= size
  546.       return
  547.     end
  548.     buf = @actors[index1]
  549.     @actors[index1] = @actors[index2]
  550.     @actors[index2] = buf
  551.     $game_player.refresh
  552.   end
  553.   #--------------------------------------------------------------------------
  554.   # ● 戦闘用ステートの解除 (戦闘終了時に呼び出し)
  555.   #--------------------------------------------------------------------------
  556.   def remove_states_battle
  557.     for actor in all_members
  558.       actor.remove_states_battle
  559.     end
  560.   end
  561. end

  562. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  563. #==============================================================================
  564. # ■ Window_Command
  565. #==============================================================================

  566. class Window_Command < Window_Selectable
  567.   unless method_defined?(:add_command)
  568.   #--------------------------------------------------------------------------
  569.   # ○ コマンドを追加
  570.   #    追加した位置を返す
  571.   #--------------------------------------------------------------------------
  572.   def add_command(command)
  573.     @commands << command
  574.     @item_max = @commands.size
  575.     item_index = @item_max - 1
  576.     refresh_command
  577.     draw_item(item_index)
  578.     return item_index
  579.   end
  580.   #--------------------------------------------------------------------------
  581.   # ○ コマンドをリフレッシュ
  582.   #--------------------------------------------------------------------------
  583.   def refresh_command
  584.     buf = self.contents.clone
  585.     self.height = [self.height, row_max * WLH + 32].max
  586.     create_contents
  587.     self.contents.blt(0, 0, buf, buf.rect)
  588.     buf.dispose
  589.   end
  590.   #--------------------------------------------------------------------------
  591.   # ○ コマンドを挿入
  592.   #--------------------------------------------------------------------------
  593.   def insert_command(index, command)
  594.     @commands.insert(index, command)
  595.     @item_max = @commands.size
  596.     refresh_command
  597.     refresh
  598.   end
  599.   #--------------------------------------------------------------------------
  600.   # ○ コマンドを削除
  601.   #--------------------------------------------------------------------------
  602.   def remove_command(command)
  603.     @commands.delete(command)
  604.     @item_max = @commands.size
  605.     refresh
  606.   end
  607.   end
  608. end

  609. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  610. #==============================================================================
  611. # ■ Window_MenuStatus
  612. #==============================================================================

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

  726. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  727. #==============================================================================
  728. # ■ Window_ShopStatus
  729. #==============================================================================

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

  740. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  741. #==============================================================================
  742. # ■ Window_BattleStatus
  743. #==============================================================================

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

  759.     refresh_KGC_LargeParty
  760.   end
  761. end

  762. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

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

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

  787. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  788. #==============================================================================
  789. # □ Window_PartyFormMember
  790. #------------------------------------------------------------------------------
  791. #  パーティ編成画面でメンバーを表示するウィンドウです。
  792. #==============================================================================

  793. class Window_PartyFormMember < Window_Selectable
  794.   #--------------------------------------------------------------------------
  795.   # ○ 定数
  796.   #--------------------------------------------------------------------------
  797.   DRAW_SIZE = KGC::LargeParty::PARTY_FORM_CHARACTER_SIZE
  798.   #--------------------------------------------------------------------------
  799.   # ● 公開インスタンス変数
  800.   #--------------------------------------------------------------------------
  801.   attr_accessor :selected_index           # 選択済みインデックス
  802.   #--------------------------------------------------------------------------
  803.   # ● オブジェクト初期化
  804.   #     x       : ウィンドウの X 座標
  805.   #     y       : ウィンドウの Y 座標
  806.   #     width   : ウィンドウの幅
  807.   #     height  : ウィンドウの高さ
  808.   #     spacing : 横に項目が並ぶときの空白の幅
  809.   #--------------------------------------------------------------------------
  810.   def initialize(x, y, width, height, spacing = 8)
  811.     super(x, y, width, height, spacing)
  812.     self.z = 1000
  813.   end
  814.   #--------------------------------------------------------------------------
  815.   # ● ウィンドウ内容の作成
  816.   #--------------------------------------------------------------------------
  817.   def create_contents
  818.     self.contents.dispose
  819.     self.contents = Bitmap.new(width - 32,
  820.       [height - 32, row_max * DRAW_SIZE[1]].max)
  821.   end
  822.   #--------------------------------------------------------------------------
  823.   # ● 先頭の行の取得
  824.   #--------------------------------------------------------------------------
  825.   def top_row
  826.     return self.oy / DRAW_SIZE[1]
  827.   end
  828.   #--------------------------------------------------------------------------
  829.   # ● 先頭の行の設定
  830.   #     row : 先頭に表示する行
  831.   #--------------------------------------------------------------------------
  832.   def top_row=(row)
  833.     super(row)
  834.     self.oy = self.oy / WLH * DRAW_SIZE[1]
  835.   end
  836.   #--------------------------------------------------------------------------
  837.   # ● 1 ページに表示できる行数の取得
  838.   #--------------------------------------------------------------------------
  839.   def page_row_max
  840.     return (self.height - 32) / DRAW_SIZE[1]
  841.   end
  842.   #--------------------------------------------------------------------------
  843.   # ● 項目を描画する矩形の取得
  844.   #     index : 項目番号
  845.   #--------------------------------------------------------------------------
  846.   def item_rect(index)
  847.     rect = super(index)
  848.     rect.width = DRAW_SIZE[0]
  849.     rect.height = DRAW_SIZE[1]
  850.     rect.y = index / @column_max * DRAW_SIZE[1]
  851.     return rect
  852.   end
  853.   #--------------------------------------------------------------------------
  854.   # ○ 選択アクター取得
  855.   #--------------------------------------------------------------------------
  856.   def actor
  857.     return @actors[self.index]
  858.   end
  859.   #--------------------------------------------------------------------------
  860.   # ● リフレッシュ
  861.   #--------------------------------------------------------------------------
  862.   def refresh
  863.     self.contents.clear
  864.     restore_member_list
  865.     draw_member
  866.   end
  867.   #--------------------------------------------------------------------------
  868.   # ○ メンバーリスト修復
  869.   #--------------------------------------------------------------------------
  870.     def restore_member_list
  871.     # 継承先で定義
  872.   end
复制代码
  1.   # ○ メンバー描画
  2.   #--------------------------------------------------------------------------
  3.   def draw_member
  4.     # 継承先で定義
  5.   end
  6.   #--------------------------------------------------------------------------
  7.   # ○ 空欄アクター描画
  8.   #     index : 項目番号
  9.   #--------------------------------------------------------------------------
  10.   def draw_empty_actor(index)
  11.     # 継承先で定義
  12.   end
  13.   #--------------------------------------------------------------------------
  14.   # ○ 固定キャラ背景描画
  15.   #     index : 項目番号
  16.   #--------------------------------------------------------------------------
  17.   def draw_fixed_back(index)
  18.     rect = item_rect(index)
  19.     self.contents.fill_rect(rect, KGC::LargeParty::FIXED_COLOR)
  20.   end
  21.   #--------------------------------------------------------------------------
  22.   # ○ 選択中キャラ背景描画
  23.   #     index : 項目番号
  24.   #--------------------------------------------------------------------------
  25.   def draw_selected_back(index)
  26.     rect = item_rect(index)
  27.     self.contents.fill_rect(rect, KGC::LargeParty::SELECTED_COLOR)
  28.   end
  29. end

  30. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  31. #==============================================================================
  32. # □ Window_PartyFormBattleMember
  33. #------------------------------------------------------------------------------
  34. #  パーティ編成画面で戦闘メンバーを表示するウィンドウです。
  35. #==============================================================================

  36. class Window_PartyFormBattleMember < Window_PartyFormMember
  37.   #--------------------------------------------------------------------------
  38.   # ● 公開インスタンス変数
  39.   #--------------------------------------------------------------------------
  40.   attr_accessor :selected_index           # 選択済みインデックス
  41.   #--------------------------------------------------------------------------
  42.   # ● オブジェクト初期化
  43.   #--------------------------------------------------------------------------
  44.   def initialize
  45.     super(0, 0, 64, DRAW_SIZE[1] + 32)
  46.     column_width = DRAW_SIZE[0] + @spacing
  47.     nw = [column_width * $game_party.max_battle_member_count + 32,
  48.       Graphics.width].min
  49.     self.width = nw

  50.     @item_max = $game_party.max_battle_member_count
  51.     @column_max = width / column_width
  52.     @selected_index = nil
  53.     create_contents
  54.     refresh
  55.     self.active = true
  56.     self.index = 0
  57.   end
  58.   #--------------------------------------------------------------------------
  59.   # ○ メンバーリスト修復
  60.   #--------------------------------------------------------------------------
  61.   def restore_member_list
  62.     @actors = $game_party.battle_members
  63.   end
  64.   #--------------------------------------------------------------------------
  65.   # ○ メンバー描画
  66.   #--------------------------------------------------------------------------
  67.   def draw_member
  68.     @item_max.times { |i|
  69.       actor = @actors[i]
  70.       if actor == nil
  71.         draw_empty_actor(i)
  72.       else
  73.         if i == @selected_index
  74.           draw_selected_back(i)
  75.         elsif $game_party.actor_fixed?(actor.id)
  76.           draw_fixed_back(i)
  77.         end
  78.         rect = item_rect(i)
  79.         draw_actor_graphic(actor,
  80.           rect.x + DRAW_SIZE[0] / 2,
  81.           rect.y + DRAW_SIZE[1] - 4)
  82.       end
  83.     }
  84.   end
  85.   #--------------------------------------------------------------------------
  86.   # ○ 空欄アクター描画
  87.   #     index : 項目番号
  88.   #--------------------------------------------------------------------------
  89.   def draw_empty_actor(index)
  90.     rect = item_rect(index)
  91.     self.contents.font.color = system_color
  92.     self.contents.draw_text(rect, KGC::LargeParty::BATTLE_MEMBER_BLANK_TEXT, 1)
  93.     self.contents.font.color = normal_color
  94.   end
  95. end

  96. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  97. #==============================================================================
  98. # □ Window_PartyFormAllMember
  99. #------------------------------------------------------------------------------
  100. #  パーティ編成画面で全メンバーを表示するウィンドウです。
  101. #==============================================================================

  102. class Window_PartyFormAllMember < Window_PartyFormMember
  103.   #--------------------------------------------------------------------------
  104.   # ● オブジェクト初期化
  105.   #--------------------------------------------------------------------------
  106.   def initialize
  107.     super(0, 0, 64, 64)
  108.     restore_member_list
  109.     @item_max = $game_party.all_members.size

  110.     # 各種サイズ計算
  111.     column_width = DRAW_SIZE[0] + @spacing
  112.     sw = [@item_max * column_width + 32, Graphics.width].min
  113.     @column_max = (sw - 32) / column_width
  114.     sh = ([@item_max - 1, 0].max / @column_max + 1) * DRAW_SIZE[1] + 32
  115.     sh = [sh, DRAW_SIZE[1] * KGC::LargeParty::PARTY_MEMBER_WINDOW_ROW_MAX + 32].min

  116.     # 座標?サイズ調整
  117.     self.y += DRAW_SIZE[1] + 32
  118.     self.width = sw
  119.     self.height = sh

  120.     create_contents
  121.     refresh
  122.     self.active = false
  123.     self.index = 0
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # ○ 選択しているアクターのインデックス取得
  127.   #--------------------------------------------------------------------------
  128.   def actor_index
  129.     return @index_offset + self.index
  130.   end
  131.   #--------------------------------------------------------------------------
  132.   # ○ メンバーリスト修復
  133.   #--------------------------------------------------------------------------
  134.   def restore_member_list
  135.     if KGC::LargeParty::SHOW_BATTLE_MEMBER_IN_PARTY
  136.       @actors = $game_party.all_members
  137.       @index_offset = 0
  138.     else
  139.       @actors = $game_party.stand_by_members
  140.       @index_offset = $game_party.battle_members.size
  141.     end
  142.   end
  143.   #--------------------------------------------------------------------------
  144.   # ○ メンバー描画
  145.   #--------------------------------------------------------------------------
  146.   def draw_member
  147.     @item_max.times { |i|
  148.       actor = @actors[i]
  149.       if actor == nil
  150.         draw_empty_actor(i)
  151.         next
  152.       end

  153.       if $game_party.actor_fixed?(actor.id)
  154.         draw_fixed_back(i)
  155.       end
  156.       rect = item_rect(i)
  157.       opacity = ($game_party.battle_members.include?(actor) ? 96 : 255)
  158.       draw_actor_graphic(actor,
  159.         rect.x + DRAW_SIZE[0] / 2,
  160.         rect.y + DRAW_SIZE[1] - 4,
  161.         opacity)
  162.     }
  163.   end
  164.   #--------------------------------------------------------------------------
  165.   # ● アクターの歩行グラフィック描画
  166.   #     actor   : アクター
  167.   #     x       : 描画先 X 座標
  168.   #     y       : 描画先 Y 座標
  169.   #     opacity : 不透明度
  170.   #--------------------------------------------------------------------------
  171.   def draw_actor_graphic(actor, x, y, opacity = 255)
  172.     draw_character(actor.character_name, actor.character_index, x, y, opacity)
  173.   end
  174.   #--------------------------------------------------------------------------
  175.   # ● 歩行グラフィックの描画
  176.   #     character_name  : 歩行グラフィック ファイル名
  177.   #     character_index : 歩行グラフィック インデックス
  178.   #     x               : 描画先 X 座標
  179.   #     y               : 描画先 Y 座標
  180.   #     opacity         : 不透明度
  181.   #--------------------------------------------------------------------------
  182.   def draw_character(character_name, character_index, x, y, opacity = 255)
  183.     return if character_name == nil
  184.     bitmap = Cache.character(character_name)
  185.     sign = character_name[/^[\!\$]./]
  186.     if sign != nil and sign.include?('$')
  187.       cw = bitmap.width / 3
  188.       ch = bitmap.height / 4
  189.     else
  190.       cw = bitmap.width / 12
  191.       ch = bitmap.height / 8
  192.     end
  193.     n = character_index
  194.     src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  195.     self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
  196.   end
  197.   #--------------------------------------------------------------------------
  198.   # ○ 空欄アクター描画
  199.   #     index : 項目番号
  200.   #--------------------------------------------------------------------------
  201.   def draw_empty_actor(index)
  202.     rect = item_rect(index)
  203.     self.contents.font.color = system_color
  204.     self.contents.draw_text(rect, KGC::LargeParty::PARTY_MEMBER_BLANK_TEXT, 1)
  205.     self.contents.font.color = normal_color
  206.   end
  207. end

  208. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  209. #==============================================================================
  210. # □ Window_PartyFormStatus
  211. #------------------------------------------------------------------------------
  212. #  パーティ編成画面でアクターのステータスを表示するウィンドウです。
  213. #==============================================================================

  214. class Window_PartyFormStatus < Window_Base
  215.   #--------------------------------------------------------------------------
  216.   # ● オブジェクト初期化
  217.   #--------------------------------------------------------------------------
  218.   def initialize
  219.     super(0, 0, 384, 128)
  220.     self.z = 1000
  221.     @actor = nil
  222.     refresh
  223.   end
  224.   #--------------------------------------------------------------------------
  225.   # ○ アクター設定
  226.   #--------------------------------------------------------------------------
  227.   def set_actor(actor)
  228.     if @actor != actor
  229.       @actor = actor
  230.       refresh
  231.     end
  232.   end
  233.   #--------------------------------------------------------------------------
  234.   # ● リフレッシュ
  235.   #--------------------------------------------------------------------------
  236.   def refresh
  237.     self.contents.clear
  238.     if @actor == nil
  239.       return
  240.     end

  241.     draw_actor_face(@actor, 0, 0)
  242.     dx = 104
  243.     draw_actor_name(@actor, dx, 0)
  244.     draw_actor_level(@actor, dx, WLH * 1)
  245.     draw_actor_hp(@actor, dx, WLH * 2)
  246.     draw_actor_mp(@actor, dx, WLH * 3)
  247.     4.times { |i|
  248.       draw_actor_parameter(@actor, dx + 128, WLH * i, i, 120)
  249.     }
  250.   end
  251.   #--------------------------------------------------------------------------
  252.   # ● 能力値の描画
  253.   #     actor : アクター
  254.   #     x     : 描画先 X 座標
  255.   #     y     : 描画先 Y 座標
  256.   #     type  : 能力値の種類 (0~3)
  257.   #     width : 描画幅
  258.   #--------------------------------------------------------------------------
  259.   def draw_actor_parameter(actor, x, y, type, width = 156)
  260.     case type
  261.     when 0
  262.       parameter_name = Vocab::atk
  263.       parameter_value = actor.atk
  264.     when 1
  265.       parameter_name = Vocab::def
  266.       parameter_value = actor.def
  267.     when 2
  268.       parameter_name = Vocab::spi
  269.       parameter_value = actor.spi
  270.     when 3
  271.       parameter_name = Vocab::agi
  272.       parameter_value = actor.agi
  273.     end
  274.     nw = width - 36
  275.     self.contents.font.color = system_color
  276.     self.contents.draw_text(x, y, nw, WLH, parameter_name)
  277.     self.contents.font.color = normal_color
  278.     self.contents.draw_text(x + nw, y, 36, WLH, parameter_value, 2)
  279.   end
  280. end

  281. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  282. #==============================================================================
  283. # □ Window_PartyFormControl
  284. #------------------------------------------------------------------------------
  285. #  パーティ編成画面で操作方法を表示するウィンドウです。
  286. #==============================================================================

  287. class Window_PartyFormControl < Window_Base
  288.   #--------------------------------------------------------------------------
  289.   # ○ 定数
  290.   #--------------------------------------------------------------------------
  291.   MODE_BATTLE_MEMBER = 0
  292.   MODE_SHIFT_CHANGE  = 1
  293.   MODE_PARTY_MEMBER  = 2
  294.   #--------------------------------------------------------------------------
  295.   # ● オブジェクト初期化
  296.   #--------------------------------------------------------------------------
  297.   def initialize
  298.     super(0, 0, Graphics.width - 384, 128)
  299.     self.z = 1000
  300.     @mode = MODE_BATTLE_MEMBER
  301.     refresh
  302.   end
  303.   #--------------------------------------------------------------------------
  304.   # ○ モード変更
  305.   #--------------------------------------------------------------------------
  306.   def mode=(value)
  307.     @mode = value
  308.     refresh
  309.   end
  310.   #--------------------------------------------------------------------------
  311.   # ● リフレッシュ
  312.   #--------------------------------------------------------------------------
  313.   def refresh
  314.     self.contents.clear
  315.     case @mode
  316.     when MODE_BATTLE_MEMBER  # 戦闘メンバー
  317.       buttons = [
  318.         "A: 并列替换",
  319.         "ESC: 终了",
  320.         "回车: 决定",
  321.       ]
  322.     when MODE_SHIFT_CHANGE   # 並び替え
  323.       buttons = [
  324.         "ESC: 取消",
  325.         "回车: 决定",
  326.       ]
  327.     when MODE_PARTY_MEMBER   # パーティメンバー
  328.       buttons = [
  329.         "ESC: 取消",
  330.         "回车: 决定"
  331.       ]
  332.     else
  333.       return
  334.     end

  335.     buttons.each_with_index { |c, i|
  336.       self.contents.draw_text(0, WLH * i, width - 32, WLH, c)
  337.     }
  338.   end
  339. end

  340. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  341. #==============================================================================
  342. # ■ Scene_Title
  343. #==============================================================================

  344. class Scene_Title < Scene_Base
  345.   #--------------------------------------------------------------------------
  346.   # ● 各種ゲームオブジェクトの作成
  347.   #--------------------------------------------------------------------------
  348.   alias create_game_objects_KGC_LargeParty create_game_objects
  349.   def create_game_objects
  350.     create_game_objects_KGC_LargeParty

  351.     if KGC::LargeParty::DEFAULT_PARTYFORM_ENABLED
  352.       $game_switches[KGC::LargeParty::PARTYFORM_SWITCH] = true
  353.       $game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH] = true
  354.     end
  355.   end
  356. end

  357. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  358. #==============================================================================
  359. # ■ Scene_Map
  360. #==============================================================================

  361. class Scene_Map < Scene_Base
  362.   #--------------------------------------------------------------------------
  363.   # ● 画面切り替えの実行
  364.   #--------------------------------------------------------------------------
  365.   alias update_scene_change_KGC_LargeParty update_scene_change
  366.   def update_scene_change
  367.     return if $game_player.moving?    # プレイヤーの移動中?

  368.     if $game_temp.next_scene == :partyform
  369.       call_partyform
  370.       return
  371.     end

  372.     update_scene_change_KGC_LargeParty
  373.   end
  374.   #--------------------------------------------------------------------------
  375.   # ○ パーティ編成画面への切り替え
  376.   #--------------------------------------------------------------------------
  377.   def call_partyform
  378.     $game_temp.next_scene = nil
  379.     $scene = Scene_PartyForm.new(0, Scene_PartyForm::HOST_MAP)
  380.   end
  381. end

  382. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  383. #==============================================================================
  384. # ■ Scene_Menu
  385. #==============================================================================

  386. class Scene_Menu < Scene_Base
  387.   if KGC::LargeParty::USE_MENU_PARTYFORM_COMMAND
  388.   #--------------------------------------------------------------------------
  389.   # ● コマンドウィンドウの作成
  390.   #--------------------------------------------------------------------------
  391.   alias create_command_window_KGC_LargeParty create_command_window
  392.   def create_command_window
  393.     create_command_window_KGC_LargeParty

  394.     return if $imported["CustomMenuCommand"]

  395.     @__command_partyform_index =
  396.       @command_window.add_command(Vocab.partyform)
  397.     @command_window.draw_item(@__command_partyform_index,
  398.       $game_party.partyform_enable?)
  399.     if @command_window.oy > 0
  400.       @command_window.oy -= Window_Base::WLH
  401.     end
  402.     @command_window.index = @menu_index
  403.   end
  404.   end
  405.   #--------------------------------------------------------------------------
  406.   # ● コマンド選択の更新
  407.   #--------------------------------------------------------------------------
  408.   alias update_command_selection_KGC_LargeParty update_command_selection
  409.   def update_command_selection
  410.     current_menu_index = @__command_partyform_index
  411.     call_partyform_flag = false

  412.     if Input.trigger?(Input::C)
  413.       case @command_window.index
  414.       when @__command_partyform_index  # パーティ編成
  415.         call_partyform_flag = true
  416.       end
  417.     # パーティ編成ボタン押下
  418.     elsif KGC::LargeParty::MENU_PARTYFORM_BUTTON != nil &&
  419.         Input.trigger?(KGC::LargeParty::MENU_PARTYFORM_BUTTON)
  420.       call_partyform_flag = true
  421.       current_menu_index = @command_window.index if current_menu_index == nil
  422.     end

  423.     # パーティ編成画面に移行
  424.     if call_partyform_flag
  425.       if $game_party.members.size == 0 || !$game_party.partyform_enable?
  426.         Sound.play_buzzer
  427.         return
  428.       end
  429.       Sound.play_decision
  430.       $scene = Scene_PartyForm.new(current_menu_index)
  431.       return
  432.     end

  433.     update_command_selection_KGC_LargeParty
  434.   end
  435. end

  436. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  437. #==============================================================================
  438. # ■ Scene_Shop
  439. #==============================================================================

  440. unless $imported["HelpExtension"]
  441. class Scene_Shop < Scene_Base
  442.   #--------------------------------------------------------------------------
  443.   # ● フレーム更新
  444.   #--------------------------------------------------------------------------
  445.   alias udpate_KGC_LargeParty update
  446.   def update
  447.     # スクロール判定
  448.     if !@command_window.active &&
  449.         KGC::LargeParty::SHOP_STATUS_SCROLL_BUTTON != nil &&
  450.         Input.press?(KGC::LargeParty::SHOP_STATUS_SCROLL_BUTTON)
  451.       super
  452.       update_menu_background
  453.       update_scroll_status
  454.       return
  455.     else
  456.       @status_window.cursor_rect.empty
  457.     end

  458.     udpate_KGC_LargeParty
  459.   end
  460.   #--------------------------------------------------------------------------
  461.   # ○ ステータスウィンドウのスクロール処理
  462.   #--------------------------------------------------------------------------
  463.   def update_scroll_status
  464.     # ステータスウィンドウにカーソルを表示
  465.     @status_window.cursor_rect.width = @status_window.contents.width
  466.     @status_window.cursor_rect.height = @status_window.height - 32
  467.     @status_window.update

  468.     if Input.press?(Input::UP)
  469.       @status_window.oy = [@status_window.oy - 4, 0].max
  470.     elsif Input.press?(Input::DOWN)
  471.       max_pos = [@status_window.contents.height -
  472.         (@status_window.height - 32), 0].max
  473.       @status_window.oy = [@status_window.oy + 4, max_pos].min
  474.     end
  475.   end
  476. end
  477. end

  478. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  479. #==============================================================================
  480. # □ Scene_PartyForm
  481. #------------------------------------------------------------------------------
  482. #  パーティ編成画面の処理を行うクラスです。
  483. #==============================================================================

  484. class Scene_PartyForm < Scene_Base
  485.   #--------------------------------------------------------------------------
  486.   # ○ 定数
  487.   #--------------------------------------------------------------------------
  488.   CAPTION_OFFSET = 40  # キャプションウィンドウの位置補正
  489.   HOST_MENU   = 0      # 呼び出し元 : メニュー
  490.   HOST_MAP    = 1      # 呼び出し元 : マップ
  491.   HOST_BATTLE = 2      # 呼び出し元 : 戦闘
  492.   #--------------------------------------------------------------------------
  493.   # ● オブジェクト初期化
  494.   #     menu_index : コマンドのカーソル初期位置
  495.   #     host_scene : 呼び出し元 (0..メニュー  1..マップ  2..戦闘)
  496.   #--------------------------------------------------------------------------
  497.   def initialize(menu_index = 0, host_scene = HOST_MENU)
  498.     @menu_index = menu_index
  499.     @host_scene = host_scene
  500.   end
  501.   #--------------------------------------------------------------------------
  502.   # ● 開始処理
  503.   #--------------------------------------------------------------------------
  504.   def start
  505.     super
  506.     create_menu_background

  507.     create_windows
  508.     create_confirm_window
  509.     adjust_window_location

  510.     # 編成前のパーティを保存
  511.     @battle_actors = $game_party.battle_members.dup
  512.     @party_actors = $game_party.all_members.dup
  513.   end
  514.   #--------------------------------------------------------------------------
  515.   # ○ ウィンドウの作成
  516.   #--------------------------------------------------------------------------
  517.   def create_windows
  518.     # 編成用ウィンドウを作成
  519.     @battle_member_window = Window_PartyFormBattleMember.new
  520.     @party_member_window = Window_PartyFormAllMember.new
  521.     @status_window = Window_PartyFormStatus.new
  522.     @status_window.set_actor(@battle_member_window.actor)

  523.     # その他のウィンドウを作成
  524.     @battle_member_caption_window =
  525.       Window_PartyFormCaption.new(KGC::LargeParty::BATTLE_MEMBER_CAPTION)
  526.     @party_member_caption_window =
  527.       Window_PartyFormCaption.new(KGC::LargeParty::PARTY_MEMBER_CAPTION)
  528.     @control_window = Window_PartyFormControl.new
  529.   end
  530.   #--------------------------------------------------------------------------
  531.   # ○ 確認ウィンドウの作成
  532.   #--------------------------------------------------------------------------
  533.   def create_confirm_window
  534.     commands = KGC::LargeParty::CONFIRM_WINDOW_COMMANDS
  535.     @confirm_window =
  536.       Window_Command.new(KGC::LargeParty::CONFIRM_WINDOW_WIDTH, commands)
  537.     @confirm_window.index = 0
  538.     @confirm_window.x = (Graphics.width - @confirm_window.width) / 2
  539.     @confirm_window.y = (Graphics.height - @confirm_window.height) / 2
  540.     @confirm_window.z = 2000
  541.     @confirm_window.openness = 0
  542.     @confirm_window.active = false
  543.   end
  544.   #--------------------------------------------------------------------------
  545.   # ○ ウィンドウの座標調整
  546.   #--------------------------------------------------------------------------
  547.   def adjust_window_location
  548.     # 基準座標を計算
  549.     base_x = [@battle_member_window.width, @party_member_window.width].max
  550.     base_x = [(Graphics.width - base_x) / 2, 0].max
  551.     base_y = @battle_member_window.height + @party_member_window.height +
  552.       @status_window.height + CAPTION_OFFSET * 2
  553.     base_y = [(Graphics.height - base_y) / 2, 0].max

  554.     # 編成用ウィンドウの座標をセット
  555.     @battle_member_window.x = base_x
  556.     @battle_member_window.y = base_y + CAPTION_OFFSET
  557.     @party_member_window.x = base_x
  558.     @party_member_window.y = @battle_member_window.y +
  559.       @battle_member_window.height + CAPTION_OFFSET
  560.     @status_window.x = 0
  561.     @status_window.y = @party_member_window.y + @party_member_window.height

  562.     # その他のウィンドウの座標をセット
  563.     @battle_member_caption_window.x = [base_x - 16, 0].max
  564.     @battle_member_caption_window.y = @battle_member_window.y - CAPTION_OFFSET
  565.     @party_member_caption_window.x = [base_x - 16, 0].max
  566.     @party_member_caption_window.y = @party_member_window.y - CAPTION_OFFSET
  567.     @control_window.x = @status_window.width
  568.     @control_window.y = @status_window.y
  569.   end
  570.   #--------------------------------------------------------------------------
  571.   # ● 終了処理
  572.   #--------------------------------------------------------------------------
  573.   def terminate
  574.     super
  575.     dispose_menu_background
  576.     @battle_member_window.dispose
  577.     @party_member_window.dispose
  578.     @status_window.dispose
  579.     @battle_member_caption_window.dispose
  580.     @party_member_caption_window.dispose
  581.     @control_window.dispose
  582.     @confirm_window.dispose
  583.   end
  584.   #--------------------------------------------------------------------------
  585.   # ● メニュー画面系の背景作成
  586.   #--------------------------------------------------------------------------
  587.   def create_menu_background
  588.     super
  589.     @menuback_sprite.z = 500
  590.   end
  591.   #--------------------------------------------------------------------------
  592.   # ● 元の画面へ戻る
  593.   #--------------------------------------------------------------------------
  594.   def return_scene
  595.     case @host_scene
  596.     when HOST_MENU
  597.       $scene = Scene_Menu.new(@menu_index)
  598.     when HOST_MAP
  599.       $scene = Scene_Map.new
  600.     when HOST_BATTLE
  601.       $scene = Scene_Battle.new
  602.     end
  603.     $game_player.refresh
  604.   end
  605.   #--------------------------------------------------------------------------
  606.   # ● フレーム更新
  607.   #--------------------------------------------------------------------------
  608.   def update
  609.     super
  610.     update_menu_background
  611.     update_window
  612.     if @battle_member_window.active
  613.       update_battle_member
  614.     elsif @party_member_window.active
  615.       update_party_member
  616.     elsif @confirm_window.active
  617.       update_confirm
  618.     end
  619.   end
  620.   #--------------------------------------------------------------------------
  621.   # ○ ウィンドウ更新
  622.   #--------------------------------------------------------------------------
  623.   def update_window
  624.     @battle_member_window.update
  625.     @party_member_window.update
  626.     @status_window.update
  627.     @battle_member_caption_window.update
  628.     @party_member_caption_window.update
  629.     @control_window.update
  630.     @confirm_window.update
  631.   end
  632.   #--------------------------------------------------------------------------
  633.   # ○ ウィンドウ再描画
  634.   #--------------------------------------------------------------------------
  635.   def refresh_window
  636.     @battle_member_window.refresh
  637.     @party_member_window.refresh
  638.   end
  639.   #--------------------------------------------------------------------------
  640.   # ○ フレーム更新 (戦闘メンバーウィンドウがアクティブの場合)
  641.   #--------------------------------------------------------------------------
  642.   def update_battle_member
  643.     @status_window.set_actor(@battle_member_window.actor)
  644.     if Input.trigger?(Input::A)
  645.       if @battle_member_window.selected_index == nil  # 並び替え中でない
  646.         actor = @battle_member_window.actor
  647.         # アクターを外せない場合
  648.         if actor == nil || $game_party.actor_fixed?(actor.id)
  649.           Sound.play_buzzer
  650.           return
  651.         end
  652.         # アクターを外す
  653.         Sound.play_decision
  654.         actors = $game_party.battle_members
  655.         actors.delete_at(@battle_member_window.index)
  656.         $game_party.set_battle_member(actors)
  657.         refresh_window
  658.       end
  659.     elsif Input.trigger?(Input::B)
  660.       if @battle_member_window.selected_index == nil  # 並び替え中でない
  661.         # 確認ウィンドウに切り替え
  662.         Sound.play_cancel
  663.         show_confirm_window
  664.       else                                            # 並び替え中
  665.         # 並び替え解除
  666.         Sound.play_cancel
  667.         @battle_member_window.selected_index = nil
  668.         @battle_member_window.refresh
  669.         @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  670.       end
  671.     elsif Input.trigger?(Input::C)
  672.       if @battle_member_window.selected_index == nil  # 並び替え中でない
  673.         actor = @battle_member_window.actor
  674.         # アクターを外せない場合
  675.         if actor != nil && $game_party.actor_fixed?(actor.id)
  676.           Sound.play_buzzer
  677.           return
  678.         end
  679.         # パーティメンバーウィンドウに切り替え
  680.         Sound.play_decision
  681.         @battle_member_window.active = false
  682.         @party_member_window.active = true
  683.         @control_window.mode = Window_PartyFormControl::MODE_PARTY_MEMBER
  684.       else                                            # 並び替え中
  685.         unless can_change_shift?(@battle_member_window.actor)
  686.           Sound.play_buzzer
  687.           return
  688.         end
  689.         # 並び替え実行
  690.         Sound.play_decision
  691.         index1 = @battle_member_window.selected_index
  692.         index2 = @battle_member_window.index
  693.         change_shift(index1, index2)
  694.         @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  695.       end
  696.     elsif Input.trigger?(Input::X)
  697.       # 並び替え不可能な場合
  698.       unless can_change_shift?(@battle_member_window.actor)
  699.         Sound.play_buzzer
  700.         return
  701.       end
  702.       if @battle_member_window.selected_index == nil  # 並び替え中でない
  703.         # 並び替え開始
  704.         Sound.play_decision
  705.         @battle_member_window.selected_index = @battle_member_window.index
  706.         @battle_member_window.refresh
  707.         @control_window.mode = Window_PartyFormControl::MODE_SHIFT_CHANGE
  708.       else                                            # 並び替え中
  709.         # 並び替え実行
  710.         Sound.play_decision
  711.         index1 = @battle_member_window.selected_index
  712.         index2 = @battle_member_window.index
  713.         change_shift(index1, index2)
  714.         @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  715.       end
  716.     end
  717.   end
  718.   #--------------------------------------------------------------------------
  719.   # ○ 並び替え可否判定
  720.   #--------------------------------------------------------------------------
  721.   def can_change_shift?(actor)
  722.     # 選択したアクターが存在しない、または並び替え不能な場合
  723.     if actor == nil ||
  724.         (KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED &&
  725.          $game_party.actor_fixed?(actor.id))
  726.       return false
  727.     end
  728.     return true
  729.   end
  730.   #--------------------------------------------------------------------------
  731.   # ○ 並び替え
  732.   #--------------------------------------------------------------------------
  733.   def change_shift(index1, index2)
  734.     # 位置を入れ替え
  735.     $game_party.change_shift(index1, index2)
  736.     # 選択済みインデックスをクリア
  737.     @battle_member_window.selected_index = nil
  738.     refresh_window
  739.   end
  740.   #--------------------------------------------------------------------------
  741.   # ○ フレーム更新 (パーティウィンドウがアクティブの場合)
  742.   #--------------------------------------------------------------------------
  743.   def update_party_member
  744.     @status_window.set_actor(@party_member_window.actor)
  745.     if Input.trigger?(Input::B)
  746.       Sound.play_cancel
  747.       # 戦闘メンバーウィンドウに切り替え
  748.       @battle_member_window.active = true
  749.       @party_member_window.active = false
  750.         @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  751.     elsif Input.trigger?(Input::C)
  752.       actor = @party_member_window.actor
  753.       # アクターが戦闘メンバーに含まれる場合
  754.       if $game_party.battle_members.include?(actor)
  755.         Sound.play_buzzer
  756.         return
  757.       end
  758.       # アクターを入れ替え
  759.       Sound.play_decision
  760.       actors = $game_party.all_members
  761.       battle_actors = $game_party.battle_members
  762.       if @battle_member_window.actor != nil
  763.         actors[@party_member_window.actor_index] = @battle_member_window.actor
  764.         actors[@battle_member_window.index] = actor
  765.         $game_party.set_member(actors.compact)
  766.       end
  767.       battle_actors[@battle_member_window.index] = actor
  768.       $game_party.set_battle_member(battle_actors.compact)
  769.       refresh_window
  770.       # 戦闘メンバーウィンドウに切り替え
  771.       @battle_member_window.active = true
  772.       @party_member_window.active = false
  773.       @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  774.     end
  775.   end
  776.   #--------------------------------------------------------------------------
  777.   # ○ フレーム更新 (確認ウィンドウがアクティブの場合)
  778.   #--------------------------------------------------------------------------
  779.   def update_confirm
  780.     if Input.trigger?(Input::B)
  781.       Sound.play_cancel
  782.       hide_confirm_window
  783.     elsif Input.trigger?(Input::C)
  784.       case @confirm_window.index
  785.       when 0  # 編成完了
  786.         # パーティが無効の場合
  787.         unless battle_member_valid?
  788.           Sound.play_buzzer
  789.           return
  790.         end
  791.         Sound.play_decision
  792.         return_scene
  793.       when 1  # 編成中断
  794.         Sound.play_decision
  795.         # パーティを編成前の状態に戻す
  796.         $game_party.set_member(@party_actors)
  797.         $game_party.set_battle_member(@battle_actors)
  798.         return_scene
  799.       when 2  # キャンセル
  800.         Sound.play_cancel
  801.         hide_confirm_window
  802.       end
  803.     end
  804.   end
  805.   #--------------------------------------------------------------------------
  806.   # ○ 戦闘メンバー有効判定
  807.   #--------------------------------------------------------------------------
  808.   def battle_member_valid?
  809.     return false if $game_party.battle_members.size == 0  # 戦闘メンバーが空
  810.     $game_party.battle_members.each { |actor|
  811.       return true if actor.exist?  # 生存者がいればOK
  812.     }
  813.     return false
  814.   end
  815.   #--------------------------------------------------------------------------
  816.   # ○ 確認ウィンドウの表示
  817.   #--------------------------------------------------------------------------
  818.   def show_confirm_window
  819.     if @battle_member_window.active
  820.       @last_active_window = @battle_member_window
  821.     else
  822.       @last_active_window = @party_member_window
  823.     end
  824.     @battle_member_window.active = false
  825.     @party_member_window.active = false

  826.     @confirm_window.draw_item(0, battle_member_valid?)
  827.     @confirm_window.open
  828.     @confirm_window.active = true
  829.   end
  830.   #--------------------------------------------------------------------------
  831.   # ○ 確認ウィンドウの非表示
  832.   #--------------------------------------------------------------------------
  833.   def hide_confirm_window
  834.     @confirm_window.active = false
  835.     @confirm_window.close
  836.     @last_active_window.active = true
  837.   end
  838. end

  839. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  840. #==============================================================================
  841. # ■ Scene_Battle
  842. #==============================================================================

  843. class Scene_Battle < Scene_Base
  844.   #--------------------------------------------------------------------------
  845.   # ● メッセージ表示が終わるまでウェイト
  846.   #--------------------------------------------------------------------------
  847.   alias wait_for_message_KGC_LargeParty wait_for_message
  848.   def wait_for_message
  849.     return if @ignore_wait_for_message  # メッセージ終了までのウェイトを無視

  850.     wait_for_message_KGC_LargeParty
  851.   end
  852.   #--------------------------------------------------------------------------
  853.   # ● レベルアップの表示
  854.   #--------------------------------------------------------------------------
  855.   alias display_level_up_KGC_LargeParty display_level_up
  856.   def display_level_up
  857.     @ignore_wait_for_message = true

  858.     display_level_up_KGC_LargeParty

  859.     exp = $game_troop.exp_total * KGC::LargeParty::STAND_BY_EXP_RATE / 1000
  860.     $game_party.stand_by_members.each { |actor|
  861.       if actor.exist?
  862.         actor.gain_exp(exp, KGC::LargeParty::SHOW_STAND_BY_LEVEL_UP)
  863.       end
  864.     }
  865.     @ignore_wait_for_message = false
  866.     wait_for_message
  867.   end
  868.   #--------------------------------------------------------------------------
  869.   # ● パーティコマンド選択の開始
  870.   #--------------------------------------------------------------------------
  871.   alias start_party_command_selection_KGC_LargeParty start_party_command_selection
  872.   def start_party_command_selection
  873.     if $game_temp.in_battle
  874.       @status_window.index = 0
  875.     end

  876.     start_party_command_selection_KGC_LargeParty
  877.   end

  878.   if KGC::LargeParty::USE_BATTLE_PARTYFORM
  879.   #--------------------------------------------------------------------------
  880.   # ● 情報表示ビューポートの作成
  881.   #--------------------------------------------------------------------------
  882.   alias create_info_viewport_KGC_LargeParty create_info_viewport
  883.   def create_info_viewport
  884.     create_info_viewport_KGC_LargeParty

  885.     @__command_partyform_index =
  886.       @party_command_window.add_command(Vocab.partyform_battle)
  887.     @party_command_window.draw_item(@__command_partyform_index,
  888.       $game_party.battle_partyform_enable?)
  889.   end
  890.   #--------------------------------------------------------------------------
  891.   # ● パーティコマンド選択の更新
  892.   #--------------------------------------------------------------------------
  893.   alias update_party_command_selection_KGC_LargeParty update_party_command_selection
  894.   def update_party_command_selection
  895.     if Input.trigger?(Input::C)
  896.       case @party_command_window.index
  897.       when @__command_partyform_index  # パーティ編成
  898.         unless $game_party.battle_partyform_enable?
  899.           Sound.play_buzzer
  900.           return
  901.         end
  902.         Sound.play_decision
  903.         process_partyform
  904.         return
  905.       end
  906.     end

  907.     update_party_command_selection_KGC_LargeParty
  908.   end
  909.   #--------------------------------------------------------------------------
  910.   # ○ パーティ編成の処理
  911.   #--------------------------------------------------------------------------
  912.   def process_partyform
  913.     Graphics.freeze
  914.     snapshot_for_background
  915.     $scene = Scene_PartyForm.new(0, Scene_PartyForm::HOST_BATTLE)
  916.     $scene.main
  917.     $scene = self
  918.     @status_window.refresh
  919.     perform_transition
  920.   end
  921.   end
  922. end
复制代码
↖这家伙今天还没画画还敢上论坛
开了一个RMMV的坑,不知道什么时候能填完
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-27 22:31

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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