AccueilAccueil  PortailPortail  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  ConnexionConnexion  



-40%
Le deal à ne pas rater :
-40% sur le Pack Gaming Mario PDP Manette filaire + Casque filaire ...
29.99 € 49.99 €
Voir le deal

Partagez
 

 [VX] Distribution de l'expérience

Voir le sujet précédent Voir le sujet suivant Aller en bas 
Aller à la page : 1, 2  Suivant
AuteurMessage
Goldenflame
Citadin Lv.7
Citadin Lv.7
Goldenflame


Masculin Age : 30
Inscrit le : 13/05/2008
Messages : 151

[VX] Distribution de l'expérience Empty
MessageSujet: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMar 24 Juin 2008 - 11:07

Il n'y a pas longtemps je demandais un script pour distribuer l'expérience quand on gagnais un niveau au lieu que ce soit automatique (agilité, force, défence,...) et j'ai trouver le script permettant de faire sa et on peut remercier KGC Software pour en étre l'auteur : (script trouver sur RPG créative)

Les 5 parties sont a mettre a la suite mais fautes de place je doit faire plusieurs messages :

Code:
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/    ◆ パラメータ振り分け - 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  = "RP"
  # ◆ RP の名称 (略)
  VOCAB_RP_A = "RP_A"

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

  # ◆ パラメータ名
  #  ≪拡張装備画面≫ と併用した場合、下に導入した方を優先。
  VOCAB_PARAM = {
    :hit => "Coup",        # Puissance d'un coup donné
    :eva => "Fuite",        # % de chance de fuire
    :cri => "Critique",  # Puisance d'un coup critique/% de chance de faire un coup critique
  }  # ← この } は消さないこと!
  # ◆ パラメータ振り分け画面上部のテキスト
  DISTRIBUTE_SCENE_CAPTION = "Veuillez distribuer les points S\'il vous plait"

  # ◆ 振り分けゲージの開始色
  #  数値  : \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      = "Distribution"

  # ◆ 振り分け解除を許可
  #  true  : ← or A ボタンでパラメータを下げ、RP を取り戻せる。
  #  false : 一度振り分けたら変更できない。
  ENABLE_REVERSE_DISTRIBUTE = true
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
#==============================================================================
Revenir en haut Aller en bas
Goldenflame
Citadin Lv.7
Citadin Lv.7
Goldenflame


Masculin Age : 30
Inscrit le : 13/05/2008
Messages : 151

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMar 24 Juin 2008 - 11:11

Script suite :


Code:
module KGC::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

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
Revenir en haut Aller en bas
Goldenflame
Citadin Lv.7
Citadin Lv.7
Goldenflame


Masculin Age : 30
Inscrit le : 13/05/2008
Messages : 151

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMar 24 Juin 2008 - 11:12

Script partie 2 :

Code:
  #--------------------------------------------------------------------------
  # ● 回避率の取得
  #--------------------------------------------------------------------------
  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
Revenir en haut Aller en bas
Goldenflame
Citadin Lv.7
Citadin Lv.7
Goldenflame


Masculin Age : 30
Inscrit le : 13/05/2008
Messages : 151

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMar 24 Juin 2008 - 11:13

Script partie 3 :

Code:
  #--------------------------------------------------------------------------
  # ○ コマンドをリフレッシュ
  #--------------------------------------------------------------------------
  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
 
Revenir en haut Aller en bas
Goldenflame
Citadin Lv.7
Citadin Lv.7
Goldenflame


Masculin Age : 30
Inscrit le : 13/05/2008
Messages : 151

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMar 24 Juin 2008 - 11:13

Script partie 4 : (aller courage :p )

Code:
  #--------------------------------------------------------------------------
  # ○ コマンドをリフレッシュ
  #--------------------------------------------------------------------------
  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

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
Revenir en haut Aller en bas
Goldenflame
Citadin Lv.7
Citadin Lv.7
Goldenflame


Masculin Age : 30
Inscrit le : 13/05/2008
Messages : 151

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMar 24 Juin 2008 - 11:15

Dernière partie de script Very Happy :

Code:
#==============================================================================
# ■ 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


Hey voila ! encore merci a KGC Software !


Dernière édition par Goldenflame le Jeu 26 Juin 2008 - 14:40, édité 2 fois
Revenir en haut Aller en bas
Soshi
Vagabond Lv.5
Vagabond Lv.5
Soshi


Masculin Avertissements : 3
Inscrit le : 15/03/2008
Messages : 80

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMar 24 Juin 2008 - 13:29

Merci mais j'ai une erreur à la ligne 921, syntax error.

la ligne en question :

Citation :
end

... Smile
Revenir en haut Aller en bas
fabY
dYeu retraité prématurément
dYeu retraité prématurément
fabY


Masculin Age : 28
Inscrit le : 09/02/2008
Messages : 5357

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMar 24 Juin 2008 - 15:40

Supprime le end et voila xD .

Bon script Wink
Revenir en haut Aller en bas
https://rpg-maker-vx.bbactif.com/
OR-K
Prêtre Lv13
Prêtre Lv13
avatar


Masculin Age : 31
Inscrit le : 19/06/2008
Messages : 877

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMar 24 Juin 2008 - 15:43

Hé pas bête le script!
Merci du partage [VX] Distribution de l'expérience 710625 :YES:
Revenir en haut Aller en bas
Kamachi-Kuno
Seigneur Lv.18
Seigneur Lv.18
Kamachi-Kuno


Masculin Age : 30
Inscrit le : 06/06/2008
Messages : 2005

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMar 24 Juin 2008 - 15:49

Merci du script !
Revenir en haut Aller en bas
Goldenflame
Citadin Lv.7
Citadin Lv.7
Goldenflame


Masculin Age : 30
Inscrit le : 13/05/2008
Messages : 151

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMar 24 Juin 2008 - 16:33

De rien Wink

Je pouvais bien donner sa car avec tout les scripts que j'ai demander !
Malgrés que l'on ne ma jamais répondu :/
Revenir en haut Aller en bas
Soshi
Vagabond Lv.5
Vagabond Lv.5
Soshi


Masculin Avertissements : 3
Inscrit le : 15/03/2008
Messages : 80

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMar 24 Juin 2008 - 16:42

fabY a écrit:
Supprime le end et voila xD .

Sauf qu'après j'ai une autre erreur etc...
C'est pas la meilleur façon de faire planter un script ? silent

Vous avez pas cette erreur vous ?
Revenir en haut Aller en bas
Goldenflame
Citadin Lv.7
Citadin Lv.7
Goldenflame


Masculin Age : 30
Inscrit le : 13/05/2008
Messages : 151

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMar 24 Juin 2008 - 16:47

Si ( Neutral j'ai la même erreur :/ ) mince qui peut nous aider ?
Revenir en haut Aller en bas
fabY
dYeu retraité prématurément
dYeu retraité prématurément
fabY


Masculin Age : 28
Inscrit le : 09/02/2008
Messages : 5357

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMar 24 Juin 2008 - 18:17

Qu'est ce que t'est malin Goldenflame xDDD.

Nous poster un script pour qu'on se rende compte qu'il ne marche pas et que l'on puisse t'aider x). J'avoue j'aurai jamais pensé à ça, bravo Razz .
Bon, je suis pas scripteur alors je pourrai surement pas résoudre le probl...
Revenir en haut Aller en bas
https://rpg-maker-vx.bbactif.com/
Invité
Invité
avatar



[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMar 24 Juin 2008 - 18:20

yark c'est tout un statagème [VX] Distribution de l'expérience 362633
Revenir en haut Aller en bas
Gothor
Chevalier Lv.17
Chevalier Lv.17
Gothor


Masculin Age : 31
Inscrit le : 27/04/2008
Messages : 1835

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMer 25 Juin 2008 - 7:38

la flemme de lire le script... essayez de rajouter un end avant ou après le end bugger en question....
Revenir en haut Aller en bas
Vorg-sama
Voyageur Lv.10
Voyageur Lv.10
Vorg-sama


Masculin Inscrit le : 16/03/2008
Messages : 408

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMer 25 Juin 2008 - 9:25

Gothor a écrit:
la flemme de lire le script... essayez de rajouter un end avant ou après le end bugger en question....

Super, quel est l'intérêt de ton poste ? Si tu as la flemme de lire bah c'est bien, pas la peine de nous le partager, tu pouvais simplement dire que tu n'avais pas envie d'aider ...

De plus quel est l'intérêt d'ajouter un end après ou avant apart de bousiler le script ... Rolling Eyes
Revenir en haut Aller en bas
Gothor
Chevalier Lv.17
Chevalier Lv.17
Gothor


Masculin Age : 31
Inscrit le : 27/04/2008
Messages : 1835

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMer 25 Juin 2008 - 9:50

le scripteur peut avoir oublier un end... ça m'est déjà arrivé de nombreuses fois ce genre de situation...

et toi? as-tu lu le script en entier???
Revenir en haut Aller en bas
Vorg-sama
Voyageur Lv.10
Voyageur Lv.10
Vorg-sama


Masculin Inscrit le : 16/03/2008
Messages : 408

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMer 25 Juin 2008 - 10:04

Non, je ne suis pas scripteur donc je ne pourrais pas l'aider davantage.

Mais moi, je ne partage pas à tout le monde le fait que je n'ai pas lu le script car j'ai la flemme, bien que je suis scripteur et que je peux aider comme tu l'as si bien fait ...
Revenir en haut Aller en bas
Gothor
Chevalier Lv.17
Chevalier Lv.17
Gothor


Masculin Age : 31
Inscrit le : 27/04/2008
Messages : 1835

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMer 25 Juin 2008 - 10:11

Alors cessons donc le flood, et aide...
Revenir en haut Aller en bas
Vorg-sama
Voyageur Lv.10
Voyageur Lv.10
Vorg-sama


Masculin Inscrit le : 16/03/2008
Messages : 408

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMer 25 Juin 2008 - 10:32

Comme je l'ai dit plus haut, je ne pourrais pas aider davantage comme je ne suis pas scripteur ...
Revenir en haut Aller en bas
Gothor
Chevalier Lv.17
Chevalier Lv.17
Gothor


Masculin Age : 31
Inscrit le : 27/04/2008
Messages : 1835

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMer 25 Juin 2008 - 11:22

Bon, en fait ligne 921, il suffit d'enlever un end... mais ça me fait une autre erreur, je vais chercher un peu...
Revenir en haut Aller en bas
LOD
Illusionniste Lv.12
Illusionniste Lv.12
LOD


Masculin Age : 29
Inscrit le : 16/03/2008
Messages : 666

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMer 25 Juin 2008 - 12:51

Haaa trop long comme script.

Bon normal que le codeur est oublier des End ou fait des erreurs , a ce niveau c'est normal xD.
Bonne chance les gars!
Revenir en haut Aller en bas
Kamachi-Kuno
Seigneur Lv.18
Seigneur Lv.18
Kamachi-Kuno


Masculin Age : 30
Inscrit le : 06/06/2008
Messages : 2005

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeMer 25 Juin 2008 - 18:23

Erf dommage j'en avais besoin. Une fois que j'ai supprimer le "end" à la ligne 921, à la ligne 849 ils me disent aussi qu'il y a erreur.


if $game_temp.next_scene == :distribute_parameter
Revenir en haut Aller en bas
Gothor
Chevalier Lv.17
Chevalier Lv.17
Gothor


Masculin Age : 31
Inscrit le : 27/04/2008
Messages : 1835

[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitimeJeu 26 Juin 2008 - 9:31

oui il me le fait aussi ^^
Revenir en haut Aller en bas
Contenu sponsorisé




[VX] Distribution de l'expérience Empty
MessageSujet: Re: [VX] Distribution de l'expérience   [VX] Distribution de l'expérience Icon_minitime

Revenir en haut Aller en bas
 

[VX] Distribution de l'expérience

Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 2Aller à la page : 1, 2  Suivant

 Sujets similaires

-
» Distribution de l'expérience
» [VX] Distribution des points de Caractéristique
» [Résolu][Script]Probleme avec KGC Distribution de AP + resistance

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
RPG Maker VX :: Entraide :: Scripts :: Scripts VX - RGSS2 :: Héros et équipe-
Créer un forum | ©phpBB | Forum gratuit d'entraide | Signaler un abus | Forum gratuit