질문과 답변

Extra Form

스텟포인트 방식의 스크립트를 사용하는데요

 

종료보다 아래에 생성이 되어서 뭔가 보기 안좋네요

 

순서를 변경할 수 있을까요?

 

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/    ◆ パラメータ振り分け - KGC_DistributeParameter ◆ VX ◆
#_/    ◇ Last update : 2008/04/19 ◇
#_/----------------------------------------------------------------------------
#_/  パラメータ振り分け機能を作成します。
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

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

module KGC
module DistributeParameter
  # ◆ パラメータ増加量
  #  振り分け時の増加量を
  #   :パラメータ => [消費 RP, 上昇量, 回数上限, 消費 RP 補正, 上昇量補正],
  #  この書式で指定。
  #  「回数上限」以外は小数でもOK。
  #  「消費 RP 補正」と「上昇量補正」は省略可。省略時は 0。
  #  振り分け禁止パラメータには nil を指定。
  GAIN_PARAMETER = {
    :maxhp => [1, 30, 30, 0.4,   2],  # MaxHP
    :maxmp => [1,  5, 30, 0.4, 0.5],  # MaxMP
    :atk   => [1,  2, 30, 0.4, 0.5],  # 攻撃力
    :def   => [1,  2, 30, 0.4, 0.5],  # 防御力
    :spi   => [1,  2, 30, 0.4, 0.5],  # 精神力
    :agi   => [1,  2, 30, 0.4, 0.5],  # 敏捷性
    :hit   => [1,  1, 20, 0.7],       # 命中率
    :eva   => [1,  1, 20, 0.7],       # 回避率
    :cri   => [1,  1, 20, 0.7],       # クリティカル率
  }  # ← この } は消さないこと!

  # ◆ アクター固有のパラメータ増加量
  PERSONAL_GAIN_PARAMETER = []
  #  ここから下に、アクターごとの振り分け時の増加量を
  #   PERSONAL_GAIN_PARAMETER[アクター ID] = { 増加量 }
  #  という書式で指定。
  #  「増加量」は GAIN_PARAMETER と同様の書式。
  #  指定しなかったパラメータ/アクターは GAIN_PARAMETER を使用。
  #
  # <例> アクター1の MaxHP, ATK を個別に指定。
#~   PERSONAL_GAIN_PARAMETER[1] = {
#~     :maxhp => [1, 50, 30, 0.4,   3],
#~     :atk   => [1,  6, 30, 0.4, 0.6],
#~   }

  # ◆ 職業固有のパラメータ増加量
  CLASS_GAIN_PARAMETER = []
  #  ここから下に、職業ごとの振り分け時の増加量を
  #   CLASS_GAIN_PARAMETER[職業 ID] = { 増加量 }
  #  という書式で指定。
  #  その他はアクター固有の設定と同様。
  #  (優先度は  職業 > アクター > デフォルト)

  # ◆ RP (Reinforce Point) の名称
  VOCAB_RP   = "S P"
  # ◆ RP の名称 (略)
  VOCAB_RP_A = "능력치포인트"

  # ◆ MaxRP 計算式
  #   level .. レベル
  #  結果が小数になってもOK(自動で整数に変換)。
  MAXRP_EXP = "(level ** 0.25 + 2.0) * level"

  # ◆ パラメータ名
  #  ≪拡張装備画面≫ と併用した場合、下に導入した方を優先。
  VOCAB_PARAM = {
    :hit => "명중율",        # 命中率
    :eva => "회피율",        # 回避率
    :cri => "치명타율",  # クリティカル率
  }  # ← この } は消さないこと!
  # ◆ パラメータ振り分け画面上部のテキスト
  DISTRIBUTE_SCENE_CAPTION = "능력치를 배분해 주세요."

  # ◆ 振り分けゲージの開始色
  #  数値  : C[n] と同じ色。
  #  Color : 指定した色。 ( Color.new(255, 128, 128) など )
  GAUGE_START_COLOR = 28
  # ◆ 振り分けゲージの終了色
  GAUGE_END_COLOR   = 29

  # ◆ メニュー画面に「パラメータ振り分け」コマンドを追加する
  #  追加する場所は、メニューコマンドの最下部です。
  #  他の部分に追加したければ、≪カスタムメニューコマンド≫ をご利用ください。
  USE_MENU_DISTRIBUTE_PARAMETER_COMMAND = true
  # ◆ メニュー画面の「パラメータ振り分け」コマンドの名称
  VOCAB_MENU_DISTRIBUTE_PARAMETER       = "능력치배분"

  # ◆ 振り分け解除を許可
  #  true  : ← or A ボタンでパラメータを下げ、RP を取り戻せる。
  #  false : 一度振り分けたら変更できない。
  ENABLE_REVERSE_DISTRIBUTE = false
end
end

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

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

module KGC::DistributeParameter
  # 振り分け対象パラメータ
  PARAMS = [:maxhp, :maxmp, :atk, :def, :spi, :agi, :hit, :eva, :cri]
end

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

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

module Vocab
  # 命中率
  def self.hit
    return KGC::DistributeParameter::VOCAB_PARAM[:hit]
  end

  # 回避率
  def self.eva
    return KGC::DistributeParameter::VOCAB_PARAM[:eva]
  end

  # クリティカル率
  def self.cri
    return KGC::DistributeParameter::VOCAB_PARAM[:cri]
  end

  # RP
  def self.rp
    return KGC::DistributeParameter::VOCAB_RP
  end

  # RP (略)
  def self.rp_a
    return KGC::DistributeParameter::VOCAB_RP_A
  end

  # パラメータ振り分け
  def self.distribute_parameter
    return KGC::DistributeParameter::VOCAB_MENU_DISTRIBUTE_PARAMETER
  end
end

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

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

module KGC
module Commands
  module_function
  #--------------------------------------------------------------------------
  # ○ パラメータ振り分けに関する値をチェック
  #--------------------------------------------------------------------------
  def check_distribution_values
    (1...$data_actors.size).each { |i|
      actor = $game_actors[i]
      actor.check_distribution_values
      actor.restore_distribution_values
    }
  end
  #--------------------------------------------------------------------------
  # ○ RP の増減
  #     actor_id : アクター ID
  #     value    : 増減量
  #--------------------------------------------------------------------------
  def gain_rp(actor_id, value)
    actor = $game_actors[actor_id]
    return if actor == nil
    actor.gain_rp(value)
  end
  #--------------------------------------------------------------------------
  # ○ 振り分け回数をリセット
  #     actor_id : アクター ID
  #--------------------------------------------------------------------------
  def reset_distributed_count(actor_id)
    actor = $game_actors[actor_id]
    return if actor == nil
    actor.clear_distribution_values
    actor.restore_distribution_values
  end
  #--------------------------------------------------------------------------
  # ○ パラメータ振り分け画面の呼び出し
  #     actor_index : アクターインデックス
  #--------------------------------------------------------------------------
  def call_distribute_parameter(actor_index = 0)
    return if $game_temp.in_battle
    $game_temp.next_scene = :distribute_parameter
    $game_temp.next_scene_actor_index = actor_index
  end
end
end

class Game_Interpreter
  include KGC::Commands
end

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

#==============================================================================
# ■ Game_Battler
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # ● 能力値に加算する値をクリア
  #--------------------------------------------------------------------------
  alias clear_extra_values_KGC_DistributeParameter clear_extra_values
  def clear_extra_values
    clear_extra_values_KGC_DistributeParameter

    clear_distribution_values
    calc_distribution_values
  end
  #--------------------------------------------------------------------------
  # ○ パラメータ振り分けに関する値をクリア
  #--------------------------------------------------------------------------
  def clear_distribution_values
    @distributed_count = {}
    KGC::DistributeParameter::PARAMS.each { |param|
      @distributed_count[param] = 0
    }
  end
  #--------------------------------------------------------------------------
  # ○ パラメータ振り分けに関する値をチェック
  #--------------------------------------------------------------------------
  def check_distribution_values
    last_distributed_count = @distributed_count

    clear_distribution_values

    @distributed_count = last_distributed_count if last_distributed_count != nil
  end
  #--------------------------------------------------------------------------
  # ○ 各種修正値を計算
  #--------------------------------------------------------------------------
  def calc_distribution_values
    # 継承先で定義
  end
end

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

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

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     actor_id : アクター ID
  #--------------------------------------------------------------------------
  alias initialize_KGC_DistributeParameter initialize
  def initialize(actor_id)
    @actor_id = actor_id
    @class_id = $data_actors[actor_id].class_id

    initialize_KGC_DistributeParameter(actor_id)
  end
  #--------------------------------------------------------------------------
  # ○ パラメータ増加量を取得
  #--------------------------------------------------------------------------
  def gain_parameter_list
    result = KGC::DistributeParameter::GAIN_PARAMETER
    # アクター固有
    list = KGC::DistributeParameter::PERSONAL_GAIN_PARAMETER[self.id]
    result = result.merge(list) if list != nil
    # 職業固有
    list = KGC::DistributeParameter::CLASS_GAIN_PARAMETER[self.class_id]
    result = result.merge(list) if list != nil

    return result
  end
  #--------------------------------------------------------------------------
  # ○ 各種修正値を計算
  #--------------------------------------------------------------------------
  def calc_distribution_values
    @rp_cost = 0
    @distributed_param = {}
    gain_parameter_list.each { |k, v|
      next if v == nil
      cost = 0
      param = 0
      distributed_count(k).times { |i|
        cost_plus   = v[0]
        cost_plus  += v[3] * i if v[3] != nil
        param_plus  = v[1]
        param_plus += v[4] * i if v[4] != nil
        cost  += Integer(cost_plus)
        param += Integer(param_plus)
      }
      @rp_cost += [cost, 0].max
      @distributed_param[k] = param
    }
  end
  #--------------------------------------------------------------------------
  # ○ 各種修正値を修復
  #--------------------------------------------------------------------------
  def restore_distribution_values
    calc_distribution_values
    self.hp = self.hp
    self.mp = self.mp
  end
  #--------------------------------------------------------------------------
  # ○ 振り分けによる上昇値を取得
  #     param : パラメータの Symbol
  #--------------------------------------------------------------------------
  def distributed_param(param)
    return 0 if @distributed_param == nil
    return 0 if @distributed_param[param] == nil
    return @distributed_param[param]
  end
  #--------------------------------------------------------------------------
  # ● 基本 MaxHP の取得
  #--------------------------------------------------------------------------
  alias base_maxhp_KGC_DistributeParameter base_maxhp
  def base_maxhp
    n = base_maxhp_KGC_DistributeParameter + distributed_param(:maxhp)
    return n
  end
  #--------------------------------------------------------------------------
  # ● 基本 MaxMP の取得
  #--------------------------------------------------------------------------
  alias base_maxmp_KGC_DistributeParameter base_maxmp
  def base_maxmp
    n = base_maxmp_KGC_DistributeParameter + distributed_param(:maxmp)
    return n
  end
  #--------------------------------------------------------------------------
  # ● 基本攻撃力の取得
  #--------------------------------------------------------------------------
  alias base_atk_KGC_DistributeParameter base_atk
  def base_atk
    n = base_atk_KGC_DistributeParameter + distributed_param(:atk)
    return n
  end
  #--------------------------------------------------------------------------
  # ● 基本防御力の取得
  #--------------------------------------------------------------------------
  alias base_def_KGC_DistributeParameter base_def
  def base_def
    n = base_def_KGC_DistributeParameter + distributed_param(:def)
    return n
  end
  #--------------------------------------------------------------------------
  # ● 基本精神力の取得
  #--------------------------------------------------------------------------
  alias base_spi_KGC_DistributeParameter base_spi
  def base_spi
    n = base_spi_KGC_DistributeParameter + distributed_param(:spi)
    return n
  end
  #--------------------------------------------------------------------------
  # ● 基本敏捷性の取得
  #--------------------------------------------------------------------------
  alias base_agi_KGC_DistributeParameter base_agi
  def base_agi
    n = base_agi_KGC_DistributeParameter + distributed_param(:agi)
    return n
  end
  #--------------------------------------------------------------------------
  # ● 命中率の取得
  #--------------------------------------------------------------------------
  alias hit_KGC_DistributeParameter hit
  def hit
    n = hit_KGC_DistributeParameter + distributed_param(:hit)
    return n
  end
  #--------------------------------------------------------------------------
  # ● 回避率の取得
  #--------------------------------------------------------------------------
  alias eva_KGC_DistributeParameter eva
  def eva
    n = eva_KGC_DistributeParameter + distributed_param(:eva)
    return n
  end
  #--------------------------------------------------------------------------
  # ● クリティカル率の取得
  #--------------------------------------------------------------------------
  alias cri_KGC_DistributeParameter cri
  def cri
    n = cri_KGC_DistributeParameter + distributed_param(:cri)
    return n
  end
  #--------------------------------------------------------------------------
  # ○ MaxRP の取得
  #--------------------------------------------------------------------------
  def maxrp
    n = Integer(eval(KGC::DistributeParameter::MAXRP_EXP))
    return [n + maxrp_plus, 0].max
  end
  #--------------------------------------------------------------------------
  # ○ MaxRP 補正値の取得
  #--------------------------------------------------------------------------
  def maxrp_plus
    @maxrp_plus = 0 if @maxrp_plus == nil
    return @maxrp_plus
  end
  #--------------------------------------------------------------------------
  # ○ RP の取得
  #--------------------------------------------------------------------------
  def rp
    return [maxrp - @rp_cost, 0].max
  end
  #--------------------------------------------------------------------------
  # ○ 振り分け回数の取得
  #     param : 振り分け先パラメータ (Symbol)
  #--------------------------------------------------------------------------
  def distributed_count(param)
    clear_distribution_values if @distributed_count == nil
    @distributed_count[param] = 0 if @distributed_count[param] == nil
    return @distributed_count[param]
  end
  #--------------------------------------------------------------------------
  # ○ RP の増減
  #     value : 増減量
  #--------------------------------------------------------------------------
  def gain_rp(value)
    @maxrp_plus = maxrp_plus + value
  end
  #--------------------------------------------------------------------------
  # ○ 振り分け回数の増減
  #     param : 振り分け先パラメータ (Symbol)
  #     value : 増減量
  #--------------------------------------------------------------------------
  def gain_distributed_count(param, value = 1)
    n = distributed_count(param)
    @distributed_count[param] += value if n.is_a?(Integer)
  end
  #--------------------------------------------------------------------------
  # ○ RP 振り分けによる成長効果適用
  #     param   : 振り分け先パラメータ (Symbol)
  #     reverse : 逆加算のときは true
  #--------------------------------------------------------------------------
  def rp_growth_effect(param, reverse = false)
    gain = gain_parameter_list[param]
    return if gain == nil  # 無効なパラメータ

    if reverse
      return if distributed_count(param) == 0  # 逆加算不可
    else
      return unless can_distribute?(param)
    end

    gain_distributed_count(param, reverse ? -1 : 1)
    restore_distribution_values
  end
  #--------------------------------------------------------------------------
  # ○ パラメータ振り分け可否判定
  #     param : 振り分け先パラメータ (Symbol)
  #--------------------------------------------------------------------------
  def can_distribute?(param)
    gain = gain_parameter_list[param]
    return false if gain == nil                          # 無効なパラメータ
    return false if self.rp < distribute_cost(param)     # RP 不足
    return false if gain[2] <= distributed_count(param)  # 回数上限

    return true
  end
  #--------------------------------------------------------------------------
  # ○ パラメータ振り分けコスト計算
  #     param : 振り分け先パラメータ (Symbol)
  #--------------------------------------------------------------------------
  def distribute_cost(param)
    gain = gain_parameter_list[param]
    return 0 if gain == nil  # 無効なパラメータ

    n = gain[0]
    n += gain[3] * distributed_count(param) if gain[3] != nil
    return [Integer(n), 0].max
  end
  #--------------------------------------------------------------------------
  # ○ パラメータ振り分け時の増加量計算
  #     param : 振り分け先パラメータ (Symbol)
  #--------------------------------------------------------------------------
  def distribute_gain(param)
    gain = gain_parameter_list[param]
    return 0 if gain == nil  # 無効なパラメータ

    n = gain[1]
    n += gain[4] * distributed_count(param) if gain[4] != nil
    return Integer(n)
  end
end

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

#==============================================================================
# ■ Window_Base
#==============================================================================

class Window_Base < Window
  #--------------------------------------------------------------------------
  # ○ RP の文字色を取得
  #     actor : アクター
  #--------------------------------------------------------------------------
  def rp_color(actor)
    return (actor.rp == 0 ? knockout_color : normal_color)
  end
  #--------------------------------------------------------------------------
  # ○ 振り分けゲージの色 1 の取得
  #--------------------------------------------------------------------------
  def distribute_gauge_color1
    color = KGC::DistributeParameter::GAUGE_START_COLOR
    return (color.is_a?(Integer) ? text_color(color) : color)
  end
  #--------------------------------------------------------------------------
  # ○ 振り分けゲージの色 2 の取得
  #--------------------------------------------------------------------------
  def distribute_gauge_color2
    color = KGC::DistributeParameter::GAUGE_END_COLOR
    return (color.is_a?(Integer) ? text_color(color) : color)
  end
  #--------------------------------------------------------------------------
  # ○ RP の描画
  #     actor : アクター
  #     x     : 描画先 X 座標
  #     y     : 描画先 Y 座標
  #     width : 幅
  #--------------------------------------------------------------------------
  def draw_actor_rp(actor, x, y, width = 120)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 40, WLH, Vocab::rp_a)
    self.contents.font.color = rp_color(actor)
    xr = x + width
    if width < 120
      self.contents.draw_text(xr - 40, y, 40, WLH, actor.rp, 2)
    else
      self.contents.draw_text(xr - 90, y, 40, WLH, actor.rp, 2)
      self.contents.font.color = normal_color
      self.contents.draw_text(xr - 50, y, 10, WLH, "/", 2)
      self.contents.draw_text(xr - 40, y, 40, WLH, actor.maxrp, 2)
    end
    self.contents.font.color = normal_color
  end
  #--------------------------------------------------------------------------
  # ○ 振り分けゲージの描画
  #     actor : アクター
  #     param : パラメータ
  #     x     : 描画先 X 座標
  #     y     : 描画先 Y 座標
  #     width : 幅
  #--------------------------------------------------------------------------
  def draw_actor_distribute_gauge(actor, param, x, y, width = 120)
    gain = actor.gain_parameter_list[param]
    return if gain == nil
    gw = width * actor.distributed_count(param) / [gain[2], 1].max
    gc1 = distribute_gauge_color1
    gc2 = distribute_gauge_color2
    self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
    self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  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_DistributeParameterActor
#------------------------------------------------------------------------------
#   振り分け画面で、アクターの情報を表示するウィンドウです。
#==============================================================================

class Window_DistributeParameterActor < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     x     : ウィンドウの X 座標
  #     y     : ウィンドウの Y 座標
  #     actor : アクター
  #--------------------------------------------------------------------------
  def initialize(x, y, actor)
    super(x, y, Graphics.width, WLH + 32)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 4, 0)
    draw_actor_level(@actor, 140, 0)
    draw_actor_rp(@actor, 240, 0)
  end
end

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

#==============================================================================
# □ Window_DistributeParameterList
#------------------------------------------------------------------------------
#   振り分け画面で、成長させるパラメータを選択するウィンドウです。
#==============================================================================

class Window_DistributeParameterList < Window_Selectable
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     actor : アクター
  #--------------------------------------------------------------------------
  def initialize(actor)
    off_h = (WLH + 32) * 2
    super(0, off_h, Graphics.width / 2 + 80, Graphics.height - off_h)
    @actor = actor
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # ○ 選択中のパラメータの Symbol を取得
  #--------------------------------------------------------------------------
  def parameter_symbol
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    @data = []
    gain_params = @actor.gain_parameter_list
    KGC::DistributeParameter::PARAMS.each { |param|
      next if gain_params[param] == nil
      @data << param
    }
    @item_max = @data.size
    create_contents
    draw_caption
    @item_max.times { |i| draw_item(i, @actor.can_distribute?(@data[i])) }
  end
  #--------------------------------------------------------------------------
  # ● 項目を描画する矩形の取得
  #     index : 項目番号
  #--------------------------------------------------------------------------
  def item_rect(index)
    rect = super(index)
    rect.y += WLH
    return rect
  end
  #--------------------------------------------------------------------------
  # ○ 見出しの描画
  #--------------------------------------------------------------------------
  def draw_caption
    self.contents.font.color = system_color
    self.contents.draw_text(  4, 0, 96, WLH, "파라미터")
    self.contents.draw_text(120, 0, 40, WLH, Vocab.rp, 2)
    self.contents.draw_text(170, 0, 60, WLH, "상승량", 2)
    self.contents.draw_text(240, 0, 80, WLH, "회수", 2)
    self.contents.font.color = normal_color
  end
  #--------------------------------------------------------------------------
  # ○ 項目の描画
  #     index   : 項目番号
  #     enabled : 有効フラグ
  #--------------------------------------------------------------------------
  def draw_item(index, enabled = true)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    item = @data[index]
    if item != nil
      draw_parameter(rect.x, rect.y, @data[index], enabled)
    end
  end
  #--------------------------------------------------------------------------
  # ○ 能力値の描画
  #     x       : 描画先 X 座標
  #     y       : 描画先 Y 座標
  #     type    : 能力値の種類
  #     enabled : 有効フラグ
  #--------------------------------------------------------------------------
  def draw_parameter(x, y, type, enabled)
    case type
    when :maxhp
      name  = Vocab.hp
    when :maxmp
      name  = Vocab.mp
    when :atk
      name  = Vocab.atk
    when :def
      name  = Vocab.def
    when :spi
      name  = Vocab.spi
    when :agi
      name  = Vocab.agi
    when :hit
      name  = Vocab.hit
    when :eva
      name  = Vocab.eva
    when :cri
      name  = Vocab.cri
    else
      return
    end

    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(x + 4, y, 96, WLH, name)

    gain = @actor.gain_parameter_list[type]
    value = @actor.distribute_cost(type)
    self.contents.draw_text(x + 120, y, 40, WLH, value, 2)
    value = sprintf("%+d", @actor.distribute_gain(type))
    self.contents.draw_text(x + 190, y, 40, WLH, value, 2)
    value = sprintf("%3d/%3d", @actor.distributed_count(type), gain[2])
    self.contents.draw_text(x + 236, y, 80, WLH, value, 2)
    self.contents.font.color = normal_color
  end
end

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

#==============================================================================
# □ Window_DistributeParameterStatus
#------------------------------------------------------------------------------
#   振り分け画面で、アクターのステータスを表示するウィンドウです。
#==============================================================================

class Window_DistributeParameterStatus < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     actor : アクター
  #--------------------------------------------------------------------------
  def initialize(actor)
    dx = Graphics.width / 2 + 80
    off_h = (WLH + 32) * 2
    super(dx, off_h, Graphics.width - dx, Graphics.height - off_h)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, width - 32, WLH, "파라미터", 1)
    self.contents.font.color = normal_color
    dy = WLH
    gain_params = @actor.gain_parameter_list
    KGC::DistributeParameter::PARAMS.each { |param|
      next if gain_params[param] == nil
      draw_parameter(0, dy, param)
      dy += WLH
    }
  end
  #--------------------------------------------------------------------------
  # ○ 能力値の描画
  #     x    : 描画先 X 座標
  #     y    : 描画先 Y 座標
  #     type : 能力値の種類
  #--------------------------------------------------------------------------
  def draw_parameter(x, y, type)
    case type
    when :maxhp
      name  = Vocab.hp
      value = @actor.maxhp
    when :maxmp
      name  = Vocab.mp
      value = @actor.maxmp
    when :atk
      name  = Vocab.atk
      value = @actor.atk
    when :def
      name  = Vocab.def
      value = @actor.def
    when :spi
      name  = Vocab.spi
      value = @actor.spi
    when :agi
      name  = Vocab.agi
      value = @actor.agi
    when :hit
      name  = Vocab.hit
      value = @actor.hit
    when :eva
      name  = Vocab.eva
      value = @actor.eva
    when :cri
      name  = Vocab.cri
      value = @actor.cri
    else
      return
    end
    draw_actor_distribute_gauge(@actor, type, x + 106, y, 48)
    self.contents.font.color = system_color
    self.contents.draw_text(x + 4, y, 96, WLH, name)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 106, y, 48, WLH, value, 2)
  end
end

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

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

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

    if $game_temp.next_scene == :distribute_parameter
      call_distribute_parameter
      return
    end

    update_scene_change_KGC_DistributeParameter
  end
  #--------------------------------------------------------------------------
  # ○ パラメータ振り分け画面への切り替え
  #--------------------------------------------------------------------------
  def call_distribute_parameter
    $game_temp.next_scene = nil
    $scene = Scene_DistributeParameter.new(
      $game_temp.next_scene_actor_index,
      0,
      Scene_DistributeParameter::HOST_MAP)
  end
end

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

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

class Scene_Menu < Scene_Base
  if KGC::DistributeParameter::USE_MENU_DISTRIBUTE_PARAMETER_COMMAND
  #--------------------------------------------------------------------------
  # ● コマンドウィンドウの作成
  #--------------------------------------------------------------------------
  alias create_command_window_KGC_DistributeParameter create_command_window
  def create_command_window
    create_command_window_KGC_DistributeParameter

    return if $imported["CustomMenuCommand"]

    @__command_distribute_parameter_index =
      @command_window.add_command(Vocab.distribute_parameter)
    if @command_window.oy > 0
      @command_window.oy -= Window_Base::WLH
    end
    @command_window.index = @menu_index
  end
  end
  #--------------------------------------------------------------------------
  # ● コマンド選択の更新
  #--------------------------------------------------------------------------
  alias update_command_selection_KGC_DistributeParameter update_command_selection
  def update_command_selection
    call_distribute_parameter_flag = false
    if Input.trigger?(Input::C)
      case @command_window.index
      when @__command_distribute_parameter_index  # パラメータ振り分け
        call_distribute_parameter_flag = true
      end
    end

    # パラメータ振り分け画面に移行
    if call_distribute_parameter_flag
      if $game_party.members.size == 0
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      start_actor_selection
      return
    end

    update_command_selection_KGC_DistributeParameter
  end
  #--------------------------------------------------------------------------
  # ● アクター選択の更新
  #--------------------------------------------------------------------------
  alias update_actor_selection_KGC_DistributeParameter update_actor_selection
  def update_actor_selection
    if Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when @__command_distribute_parameter_index  # パラメータ振り分け
        $scene = Scene_DistributeParameter.new(
          @status_window.index,
          @__command_distribute_parameter_index,
          Scene_DistributeParameter::HOST_MENU)
        return
      end
    end

    update_actor_selection_KGC_DistributeParameter
  end
end

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

#==============================================================================
# □ Scene_DistributeParameter
#------------------------------------------------------------------------------
#   パラメータ振り分け画面の処理を行うクラスです。
#==============================================================================

class Scene_DistributeParameter < Scene_Base
  #--------------------------------------------------------------------------
  # ○ 定数
  #--------------------------------------------------------------------------
  HOST_MENU   = 0  # 呼び出し元 : メニュー
  HOST_MAP    = 1  # 呼び出し元 : マップ
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     actor_index : アクターインデックス
  #     menu_index  : コマンドのカーソル初期位置
  #     host_scene  : 呼び出し元 (0..メニュー  1..マップ)
  #--------------------------------------------------------------------------
  def initialize(actor_index = 0, menu_index = 0, host_scene = HOST_MENU)
    @actor_index = actor_index
    @menu_index = menu_index
    @host_scene = host_scene
  end
  #--------------------------------------------------------------------------
  # ● 開始処理
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background

    @actor = $game_party.members[@actor_index]
    create_windows
  end
  #--------------------------------------------------------------------------
  # ○ ウィンドウ作成
  #--------------------------------------------------------------------------
  def create_windows
    @help_window = Window_Help.new
    @help_window.set_text(KGC::DistributeParameter::DISTRIBUTE_SCENE_CAPTION)
    dy = @help_window.height
    @actor_window = Window_DistributeParameterActor.new(0, dy, @actor)
    @parameter_window = Window_DistributeParameterList.new(@actor)
    @status_window = Window_DistributeParameterStatus.new(@actor)
  end
  #--------------------------------------------------------------------------
  # ● 終了処理
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @help_window.dispose
    @actor_window.dispose
    @parameter_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # ○ 元の画面へ戻る
  #--------------------------------------------------------------------------
  def return_scene
    case @host_scene
    when HOST_MENU
      $scene = Scene_Menu.new(@menu_index)
    when HOST_MAP
      $scene = Scene_Map.new
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    update_window
    if @parameter_window.active
      update_parameter_list
    end
  end
  #--------------------------------------------------------------------------
  # ○ ウィンドウ更新
  #--------------------------------------------------------------------------
  def update_window
    @help_window.update
    @actor_window.update
    @parameter_window.update
    @status_window.update
  end
  #--------------------------------------------------------------------------
  # ○ ウィンドウ再描画
  #--------------------------------------------------------------------------
  def refresh_window
    @actor_window.refresh
    @parameter_window.refresh
    @status_window.refresh
    Graphics.frame_reset
  end
  #--------------------------------------------------------------------------
  # ○ 次のアクターの画面に切り替え
  #--------------------------------------------------------------------------
  def next_actor
    @actor_index += 1
    @actor_index %= $game_party.members.size
    $scene = Scene_DistributeParameter.new(@actor_index,
      @menu_index, @host_scene)
  end
  #--------------------------------------------------------------------------
  # ○ 前のアクターの画面に切り替え
  #--------------------------------------------------------------------------
  def prev_actor
    @actor_index += $game_party.members.size - 1
    @actor_index %= $game_party.members.size
    $scene = Scene_DistributeParameter.new(@actor_index,
      @menu_index, @host_scene)
  end
  #--------------------------------------------------------------------------
  # ○ フレーム更新 (パラメータウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_parameter_list
    if Input.trigger?(Input::B)
      Sound.play_cancel
      return_scene
    elsif input_growth?
      # 加算
      param = @parameter_window.parameter_symbol
      unless @actor.can_distribute?(param)
        Sound.play_buzzer
        return
      end
      Input.repeat?(Input::C) ? Sound.play_decision : Sound.play_cursor
      @actor.rp_growth_effect(param)
      refresh_window
    elsif input_reverse_growth?
      # 減算
      param = @parameter_window.parameter_symbol
      if @actor.distributed_count(param) == 0
        Sound.play_buzzer
        return
      end
      Input.repeat?(Input::A) ? Sound.play_decision : Sound.play_cursor
      @actor.rp_growth_effect(param, true)
      refresh_window
    elsif Input.trigger?(Input::R)
      Sound.play_cursor
      next_actor
    elsif Input.trigger?(Input::L)
      Sound.play_cursor
      prev_actor
    end
  end
  #--------------------------------------------------------------------------
  # ○ 加算入力
  #--------------------------------------------------------------------------
  def input_growth?
    if KGC::DistributeParameter::ENABLE_REVERSE_DISTRIBUTE
      return Input.repeat?(Input::C) || Input.repeat?(Input::RIGHT)
    else
      return Input.trigger?(Input::C)
    end
  end
  #--------------------------------------------------------------------------
  # ○ 減算入力
  #--------------------------------------------------------------------------
  def input_reverse_growth?
    if KGC::DistributeParameter::ENABLE_REVERSE_DISTRIBUTE
      return Input.repeat?(Input::A) || Input.repeat?(Input::LEFT)
    else
      return false
    end
  end
end

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

#==============================================================================
# ■ Scene_File
#==============================================================================

class Scene_File < Scene_Base
  #--------------------------------------------------------------------------
  # ● セーブデータの読み込み
  #     file : 読み込み用ファイルオブジェクト (オープン済み)
  #--------------------------------------------------------------------------
  alias read_save_data_KGC_DistributeParameter read_save_data
  def read_save_data(file)
    read_save_data_KGC_DistributeParameter(file)

    KGC::Commands.check_distribution_values
    Graphics.frame_reset
  end
end

Comment '3'
  • ?
    아이미르 2011.07.02 19:50

    스크립트에서 KGC 커스텀메뉴 스크립트인가 검색해보셔요

     

    메뉴 순서는 물론 추가로 집어넣을수도 있습니다.

  • ?
    우아니아랱치 2011.07.02 19:52

    감사합니다!!!!

  • ?
    우아니아랱치 2011.07.02 23:33

    크으 죄송한데 어디 있는지 알수 있을까요? 찾을수가 없네요


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12391
RMXP 게임만들려고 하는데 모르는게 있어요 9 로돌프 2011.07.02 1444
RMVX 아이템에 커먼이벤트 부여하기 2 프라임헌터즈 2011.07.02 1286
기타 우리나라 알만툴 제작 게임 중에 보드게임은 없나요? 1 카리아인 2011.07.02 1207
RMVX vx맵칩은 5개가 한계인가요? 3 unuseid 2011.07.02 1656
RMXP 맵칩과 기타 공백이 전부 검은색으로 변했어요 2 file 공개아이디 2011.07.02 2027
RMVX 스텟포인트 스크립트 사용시 메뉴에서 위치 변경 3 우아니아랱치 2011.07.02 554
라이선스 기타 게임 배경음 저작권에 대해서 1 elsamaria 2011.07.01 1232
RMVX 액알만드는데 몹이안죽습니다 2 file unuseid 2011.07.01 1200
RMXP 동굴에서 화면을 어둡게 하는 방법 2 ssbest1015 2011.07.01 1588
RMXP 움직이는 포그방법 1 ssbest1015 2011.07.01 1844
RMXP 암호화보다 보안적인 암호화하는법 ssbest1015 2011.07.01 1794
RMXP 온라인 스크립트 추천 IU[아이유] 2011.07.01 1729
RMVX 게임만드는데 많은질문 2 고자몬 2011.07.01 958
RMXP 몬스터공격시대미지없음 1 file 대작만들거임 2011.07.01 1663
RMXP 턴알에서 여러번때리는스크립트;;RTABㅜ 1 느껴봐 2011.07.01 1981
사이트 이용 RPG XP 다운로드 하는 곳이나 방법 좀 알려주새요.^^ 3 file qkrrudwls945 2011.07.01 2768
RMVX 게임 만드려고 하는 데 궁금증들.. 2 울랑 2011.07.01 909
RMXP 맨 처음에 하얀게 안나오고 검은게 나옵니다. 2 file 울랑 2011.07.01 1834
RMVX 커먼 이벤트 병렬처리시에요 file 아옹쿸 2011.07.01 889
RMVX VX 스크립트 미니맵에 대해서.. 2 우아니아랱치 2011.07.01 743
Board Pagination Prev 1 ... 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 ... 516 Next
/ 516