RPGVX.net

  RPG-Maker VX => VX Skripte [Fertiger Code] => Thema gestartet von: Master-M am Juni 15, 2008, 15:44:04

Titel: Punkteverteiling
Beitrag von: Master-M am Juni 15, 2008, 15:44:04
Moin alle miteinander,
Das ist mein (eigentlich) 1 Beitrag hier im Forum und ich wollte euch das Skript "Punkte Verteilung" vorstellen. Also: Das Skript bringt das unter Beenden/Ende ein neuer Menü Punkt erscheint. Ich hab den Level Up Punkte genant. Jedes mal wenn ihr ein lvl Up habt kriegt ihr automatisch Punkte. Ich hab jetzt 3 Punkte eingestellt und, dass soweit ich das sehe, richtig Übersetzt.
Falls ihr immernoch nicht Wisst was damit gemeint ist hier eine Demo(PS: Die Map kommt aus meinen Jetztigen Projekt):
http://rapidshare.com/files/122614715/Level_Up_System.exe (http://rapidshare.com/files/122614715/Level_Up_System.exe)
Hier meine Version:
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/    ? ????????? - KGC_DistributeParameter ? VX ?
#_/    ? Last update : 2008/02/23 ?
#_/    Criador:KGC Softwares
#_/    Traduzido por:NaRuToMaKer
#_/----------------------------------------------------------------------------
#_/  Cria uma opção no menu de upgrade de atributos
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================
# Customização
#==============================================================================

module KGC
module DistributeParameter
 
#~   Defina do seguinte modo
#~   :maxhp => [1, 30, 50]
#~   :maxhp => [RP que consome,quantidade do parametro que aumenta,maximo de pontos]
  
  GAIN_PARAMETER = {
    :maxhp => [1, 30, 500],  # MaxHP
    :maxmp => [1,  3, 500],  # MaxMP
    :atk   => [1,  2, 500],  # ???
    :def   => [1,  2, 500],  # ???
    :spi   => [1,  2, 500],  # ???
    :agi   => [1,  2, 500],  # ???
    :hit   => [3,  1, 200],  # ???
    :eva   => [3,  1, 200],  # ???
    :cri   => [3,  1, 200],  # ???????
  }  # ? ?? } ????????

  # ? RP (Reinforce Point) ???
  VOCAB_RP   = "Punkte"
  # ? RP ??? (?)
  VOCAB_RP_A = "Kosten"

#~   Pontos para distribuir
#~   ao aumentar de level
  GAIN_RP_EXP = "3"
  #  ????? 10% + 1 ???????
  # GAIN_RP_EXP = "level / 10 + 1"


#~   Vocabulario
  VOCAB_PARAM = {
    :hit => "Schlag",        # ???
    :eva => "Fliehen/Ausweihen",        # ???
    :cri => "Kritische Schläge",  # ???????
  }  
  DISTRIBUTE_SCENE_CAPTION = ""

#~   Cores para a barrinha
#~  
#~   Quando estiver enchendo
  GAUGE_START_COLOR = 28
#~   Quando estiver cheia
  GAUGE_END_COLOR   = 29

#~   Vai pararecer no menu?
  USE_MENU_DISTRIBUTE_PARAMETER_COMMAND = true
  # ? ?????????????????????????
  VOCAB_MENU_DISTRIBUTE_PARAMETER       = "Level up Punkte"

#~   Pode retirar pontos?
  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
#==============================================================================

module KGC::Commands
  module_function
  #--------------------------------------------------------------------------
  # ? ???????????????????
  #--------------------------------------------------------------------------
  def check_distribution_values
    (1...$data_actors.size).each { |i|
      $game_actors.check_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_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
  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
end

#???????????????????????????????????????

#==============================================================================
# ? Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ? ??????
  #     actor_id : ???? ID
  #--------------------------------------------------------------------------
  alias setup_KGC_DistributeParameter setup
  def setup(actor_id)
    setup_KGC_DistributeParameter(actor_id)

    @rp = calc_init_rp
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #     param : ?????? Symbol
  #--------------------------------------------------------------------------
  def distributed_param(param)
    n = KGC::DistributeParameter::GAIN_PARAMETER[param][1]
    return n * distributed_count(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
  #--------------------------------------------------------------------------
  # ? RP ???
  #--------------------------------------------------------------------------
  def rp
    @rp = calc_init_rp if @rp == nil
    return @rp
  end
  #--------------------------------------------------------------------------
  # ? RP ??????
  #--------------------------------------------------------------------------
  def calc_init_rp
    n = 0
    rp_exp = KGC::DistributeParameter::GAIN_RP_EXP.gsub(/level/) { "i" }
    (1...level).each { |i| n += [Integer(eval(rp_exp)), 0].max }
    return n
  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)
    @rp = [self.rp + value, 0].max
  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
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  alias level_up_KGC_DistributeParameter level_up
  def level_up
    level_up_KGC_DistributeParameter

    gain_level_up_rp
  end
  #--------------------------------------------------------------------------
  # ? ????????? RP ???
  #--------------------------------------------------------------------------
  def gain_level_up_rp
    n = [Integer(eval(KGC::DistributeParameter::GAIN_RP_EXP)), 0].max
    gain_rp(n)
  end
  #--------------------------------------------------------------------------
  # ? RP ?????????????
  #     param   : ?????????? (Symbol)
  #     reverse : ??????? true
  #--------------------------------------------------------------------------
  def rp_growth_effect(param, reverse = false)
    gain = KGC::DistributeParameter::GAIN_PARAMETER[param]
    return if gain == nil  # ????????

    if reverse
      return if distributed_count(param) == 0  # ?????
    else
      return unless can_distribute?(param)
    end

    gain_rp(gain[0] * (reverse ? 1 : -1))
    gain_distributed_count(param, reverse ? -1 : 1)
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #     param   : ?????????? (Symbol)
  #--------------------------------------------------------------------------
  def can_distribute?(param)
    gain = KGC::DistributeParameter::GAIN_PARAMETER[param]
    return false if gain == nil                          # ????????
    return false if self.rp < gain[0]                    # RP ??
    return false if gain[2] <= distributed_count(param)  # ????

    return true
  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)
    self.contents.font.color = rp_color(actor)
    xr = x + width
    self.contents.draw_text(xr - 40, y, 40, WLH, actor.rp, 2)
    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 = KGC::DistributeParameter::GAIN_PARAMETER[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, 80)
  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 = KGC::DistributeParameter::GAIN_PARAMETER
    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)) }
  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, "Parameter")
    self.contents.draw_text(120, 0, 40, WLH, Vocab.rp, 2)
    self.contents.draw_text(170, 0, 60, WLH, "Gewinnung", 2)
    self.contents.draw_text(240, 0, 80, WLH, "Maximum", 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 = KGC::DistributeParameter::GAIN_PARAMETER[type]
    self.contents.draw_text(x + 120, y, 40, WLH, gain[0], 2)
    value = sprintf("%+d", gain[1])
    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, "Parameter", 1)
    self.contents.font.color = normal_color
    dy = WLH
    gain_params = KGC::DistributeParameter::GAIN_PARAMETER
    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::cool.gif\" style=\"vertical-align:middle\" emoid=\"B)\" border=\"0\" alt=\"cool.gif\" /]
      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

Und hier noch 2 Screens:
Wie das im Menü ausieht (Natürlich habt ihr noch euer altes Menü das ist bloß meins)
(http://img517.imageshack.us/img517/9732/immeneg0.th.jpg) (http://img517.imageshack.us/my.php?image=immeneg0.jpg)
Und so sieht das im System aus:
(http://img517.imageshack.us/img517/4177/dassystemhd1.th.jpg) (http://img517.imageshack.us/my.php?image=dassystemhd1.jpg)
Hoffe das System Lohnt sich für euch.

Credit an KGC Software und Narutomaker
Titel: Punkteverteiling
Beitrag von: Jisatsu am Juni 15, 2008, 16:07:32
Sieht schon mal klasse aus und ist eine echte Bereicherung für den Maker. Werd's vielleicht auch in meinem Projekt verwenden.
Titel: Punkteverteiling
Beitrag von: SatansRightHand am Juni 15, 2008, 17:08:19
lol...
ganeu nach sowas suche ich seid tagen
Titel: Punkteverteiling
Beitrag von: Master-M am Juni 15, 2008, 18:45:44
Ich bin froh das es hilft.
Titel: Punkteverteiling
Beitrag von: eugene222 am Juni 15, 2008, 19:50:22
Kannst du bitte auch erwähnen an wen man Credits geben soll?
Titel: Punkteverteiling
Beitrag von: Master-M am Juni 15, 2008, 19:54:49
Ich kann kein Potugisches huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /] , aber ich glaub an "NaRuToMaKeR"
Doch ist schon richtig soweit ich jetzt lese (auf Deutsch^^)
Créditos:KGC Softwares e NaRuToMaKeR por traduzir!
Titel: Punkteverteiling
Beitrag von: OceanBlue am Juni 15, 2008, 20:06:05
Nö, Credit an KGC Software (Narutomaker hat's nur übersetzt)
Titel: Punkteverteiling
Beitrag von: Kenshin am Juni 16, 2008, 17:43:53
geil habe ich grad eingefügt
  cool.gif\" style=\"vertical-align:middle\" emoid=\"B)\" border=\"0\" alt=\"cool.gif\" /]
Titel: Punkteverteiling
Beitrag von: luffy am Juni 16, 2008, 20:36:16
http://www.creationasylum.net/index.php?sh...=22427&st=0 (http://www.creationasylum.net/index.php?showtopic=22427&st=0)

hier eine schönere alternative!
Titel: Punkteverteiling
Beitrag von: Master-M am Juni 18, 2008, 14:43:04
Ja ich Kenn das aber finde meins besser weil man sonst wenn man schon ein extra Status Menü gemacht hat das auch noch ändern muss.
Titel: Punkteverteiling
Beitrag von: Kenshin am Juni 18, 2008, 16:58:23
Deins ist auch bessa  dry.gif\" style=\"vertical-align:middle\" emoid=\"<_<\" border=\"0\" alt=\"dry.gif\" /]
Titel: Punkteverteiling
Beitrag von: Redeemer am Juni 25, 2008, 09:43:57
Top script kann man wirklich mal gebrauchen.

Gut gemacht Master-M. ;)
Titel: Re: Punkteverteiling
Beitrag von: Spawn am August 02, 2008, 13:22:14
Kann man auch Variablen skillen anstat MaxHp oder Atk ?

wenn ja, kann mir jemand diesen skript genauer erklären ^^ ?
Titel: Re: Punkteverteiling
Beitrag von: Duke am September 23, 2008, 23:04:29
Huhu,

ich hoffe mal, dass der Post jetzt nicht unter's Necroposting fällt! xD
Aber nen neues Thema hierzu aufzumachen wär ja Unfug.^^

Naja, hab bezüglich dieses Scripts ein Anliegen, bzw. eine Frage.^^

Also:
Ist ja schön und gut, dass die Punktverteilung im Menü stattfindet,
allerdings nutzt ich das MOG Menu Yui ...
Jetzt wollte ich die Punktverteilung durch ein Call-Script starten,
allerdings komm ich auf keinen konkreten Befehl dazu--- :(

Ich würde mir auch im MOG Menu Yui eine neue Scene für
die Punkteverteilung anlegen, allerdings bin ich hierzu auch zu doof! :D
Also mit dem XP konnte ich neue Szenen im Mogmenü erstllen...
Entweder hab ich's vergessen oder RGSS2 ist da ein wenig anders. D:

Ich wäre also froh, wenn mir jemand den Befehl zum Aufrufen per Call-Script
oder eben eine Erklärung zum Erstellen einer neuen Scene im Menü geben könnte.^^

MfG,
Duke

Hier nochmal der Link zum Mog Menü: http://www.atelier-rgss.com/RGSS/Menu/VX_Menu03.html
Hatte ich vergessen...^^"

Edit II:
Hat sich erledigt!^^
Titel: Re: Punkteverteiling
Beitrag von: Sk!p am September 23, 2008, 23:14:37
Wow das sieht klasse aus.
Ich denke das werde ich auf jeden Fall benutzen.
Mann kann nie genug vom Standart wegkommen. Top!

Sk!p
Titel: Re: Punkteverteiling
Beitrag von: Agorax am September 30, 2008, 17:26:59
Ich finde das Menü auch echt supa aber kann mir einer verraten wofür das Schlag bei den auswählbaren Punkten steht?
Titel: Re: Punkteverteiling
Beitrag von: Kasaar am Oktober 01, 2008, 17:51:33
Also so wie ich das verstehe soll das so ne Art "Zusatzschaden" sein, den dein Charakter mit einem Angriff macht...
Aber das Menü ist wirklich saubere Arbeit :)
Titel: Re: Punkteverteiling
Beitrag von: Shinji am Dezember 07, 2008, 14:47:11
Sorry das ich den Thread aus denTiefen wieder ans Licht hole...

aber kann man das Attributmenü für einen bestimmten Zeitpunkt deaktivieren?
So wie man das Speichern verbieten kann.
Also dass man da nicht drauf zugreifen kann. Am liebsten wäre mir ein Callscript.

mfg
Titel: Re: Punkteverteiling
Beitrag von: Master-M am Dezember 07, 2008, 17:37:37
Also ich wüsste jetzt nix evtl könnte dir hellMinor helfen. Er kennt sich besser mit Skripts aus.
mfg. Master-M
Titel: Re: Punkteverteiling
Beitrag von: shichi_aoi am Dezember 07, 2008, 19:44:25
Also da ich Probleme hatte, das Script in das "erweiterte Menü" von Moghunter reinzubekommen (geht halt nicht weil, kein Platz mehr), hab ichs als Item probiert. ($scene= Scene_DistributeParameter.new über Common Event)
Nun hab ich aber das Problem, dass ich beim Punkteverteilen nicht mehr zwischen den verschiedenen Partymitgliedern wechseln kann, weil man dass ja eigentlich im Menü, bevor man in die Punkteverteilung geht, macht. D.h. ich kann nur einem Helden einem Punkte zuweisen. :/

Jetzt wollte ich hier mal fragen ob jemand mir das Script vll so umschreiben könnte, dass man wie bei dem...

[url]http://www.creationasylum.net/index.php?sh...=22427&st=0[/url] ([url]http://www.creationasylum.net/index.php?showtopic=22427&st=0[/url])

hier eine schönere alternative!


...innerhalb des Punkeverteilungswindows zwischen den Helden wechseln kann. Am besten indem man den Bereich, in dem Heldenname, Level, vorhandene Punkte usw. steht, auswählbar macht, und da dann per linkem/ rechten Pfeil zwischen den Helden wechselt. =)

(http://u1.ipernity.com/10/18/58/3581858.cfbaeb8a.png)

also der rot umrandete Bereich so auswählbar wie HP, MP usw...
Titel: Re: Punkteverteiling
Beitrag von: Shinji am Dezember 07, 2008, 20:31:28
Du kannst mit Q(Links) und W(Rechts) zwischen den Helden wechseln.

in Zeile 916
    elsif Input.trigger?(Input::R)
      Sound.play_cursor
      next_actor
    elsif Input.trigger?(Input::L)
      Sound.play_cursor
      prev_actor
    end
  end
lässt sich das anpassen.

also so abändern:
    elsif Input.trigger?(Input::RIGHT)
      Sound.play_cursor
      next_actor
    elsif Input.trigger?(Input::LEFT)
      Sound.play_cursor
      prev_actor
    end
  end
Titel: Re: Punkteverteiling
Beitrag von: shichi_aoi am Dezember 07, 2008, 20:44:51
Ah ok. Das man das schon kann wusste ich nicht x)
Dann braucht man das ja auch nicht in Links/Rechts ändern, sonst überschneidet sich das ja...
Aber Q/W ist mir zu weit weg, also hab ichs jetzt auf Shift gemacht =)
Vielen Dank ^^
Titel: Re: Punkteverteiling
Beitrag von: misterblueeye am Dezember 07, 2008, 20:59:03
Das Skipt is der HAMMA!!!

Danke vielmals fürs erstellen :D
Titel: Re: Punkteverteiling
Beitrag von: Twonky am Dezember 16, 2008, 10:15:41
Wenn das jemand gebrauchen kann ich habe das nochmal im Code geschrieben:

Anzeigen
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/    ? ????????? - KGC_DistributeParameter ? VX ?
#_/    ? Last update : 2008/02/23 ?
#_/    Criador:KGC Softwares
#_/    Traduzido por:NaRuToMaKer
#_/----------------------------------------------------------------------------
#_/  Cria uma opção no menu de upgrade de atributos
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================
# Customização
#==============================================================================

module KGC
module DistributeParameter
 
#~   Defina do seguinte modo
#~   :maxhp => [1, 30, 50]
#~   :maxhp => [RP que consome,quantidade do parametro que aumenta,maximo de pontos]
 
  GAIN_PARAMETER = {
    :maxhp => [1, 30, 500],  # MaxHP
    :maxmp => [1,  3, 500],  # MaxMP
    :atk   => [1,  2, 500],  # ???
    :def   => [1,  2, 500],  # ???
    :spi   => [1,  2, 500],  # ???
    :agi   => [1,  2, 500],  # ???
    :hit   => [3,  1, 200],  # ???
    :eva   => [3,  1, 200],  # ???
    :cri   => [3,  1, 200],  # ???????
  }  # ? ?? } ????????

  # ? RP (Reinforce Point) ???
  VOCAB_RP   = "Punkte"
  # ? RP ??? (?)
  VOCAB_RP_A = "Kosten"

#~   Pontos para distribuir
#~   ao aumentar de level
  GAIN_RP_EXP = "3"
  #  ????? 10% + 1 ???????
  # GAIN_RP_EXP = "level / 10 + 1"


#~   Vocabulario
  VOCAB_PARAM = {
    :hit => "Schlag",        # ???
    :eva => "Fliehen/Ausweihen",        # ???
    :cri => "Kritische Schläge",  # ???????
  } 
  DISTRIBUTE_SCENE_CAPTION = ""

#~   Cores para a barrinha
#~ 
#~   Quando estiver enchendo
  GAUGE_START_COLOR = 28
#~   Quando estiver cheia
  GAUGE_END_COLOR   = 29

#~   Vai pararecer no menu?
  USE_MENU_DISTRIBUTE_PARAMETER_COMMAND = true
  # ? ?????????????????????????
  VOCAB_MENU_DISTRIBUTE_PARAMETER       = "Level up Punkte"

#~   Pode retirar pontos?
  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
#==============================================================================

module KGC::Commands
  module_function
  #--------------------------------------------------------------------------
  # ? ???????????????????
  #--------------------------------------------------------------------------
  def check_distribution_values
    (1...$data_actors.size).each { |i|
      $game_actors.check_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_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
  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
end

#???????????????????????????????????????

#==============================================================================
# ? Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ? ??????
  #     actor_id : ???? ID
  #--------------------------------------------------------------------------
  alias setup_KGC_DistributeParameter setup
  def setup(actor_id)
    setup_KGC_DistributeParameter(actor_id)

    @rp = calc_init_rp
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #     param : ?????? Symbol
  #--------------------------------------------------------------------------
  def distributed_param(param)
    n = KGC::DistributeParameter::GAIN_PARAMETER[param][1]
    return n * distributed_count(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
  #--------------------------------------------------------------------------
  # ? RP ???
  #--------------------------------------------------------------------------
  def rp
    @rp = calc_init_rp if @rp == nil
    return @rp
  end
  #--------------------------------------------------------------------------
  # ? RP ??????
  #--------------------------------------------------------------------------
  def calc_init_rp
    n = 0
    rp_exp = KGC::DistributeParameter::GAIN_RP_EXP.gsub(/level/) { "i" }
    (1...level).each { |i| n += [Integer(eval(rp_exp)), 0].max }
    return n
  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)
    @rp = [self.rp + value, 0].max
  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
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  alias level_up_KGC_DistributeParameter level_up
  def level_up
    level_up_KGC_DistributeParameter

    gain_level_up_rp
  end
  #--------------------------------------------------------------------------
  # ? ????????? RP ???
  #--------------------------------------------------------------------------
  def gain_level_up_rp
    n = [Integer(eval(KGC::DistributeParameter::GAIN_RP_EXP)), 0].max
    gain_rp(n)
  end
  #--------------------------------------------------------------------------
  # ? RP ?????????????
  #     param   : ?????????? (Symbol)
  #     reverse : ??????? true
  #--------------------------------------------------------------------------
  def rp_growth_effect(param, reverse = false)
    gain = KGC::DistributeParameter::GAIN_PARAMETER[param]
    return if gain == nil  # ????????

    if reverse
      return if distributed_count(param) == 0  # ?????
    else
      return unless can_distribute?(param)
    end

    gain_rp(gain[0] * (reverse ? 1 : -1))
    gain_distributed_count(param, reverse ? -1 : 1)
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #     param   : ?????????? (Symbol)
  #--------------------------------------------------------------------------
  def can_distribute?(param)
    gain = KGC::DistributeParameter::GAIN_PARAMETER[param]
    return false if gain == nil                          # ????????
    return false if self.rp < gain[0]                    # RP ??
    return false if gain[2] <= distributed_count(param)  # ????

    return true
  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)
    self.contents.font.color = rp_color(actor)
    xr = x + width
    self.contents.draw_text(xr - 40, y, 40, WLH, actor.rp, 2)
    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 = KGC::DistributeParameter::GAIN_PARAMETER[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, 80)
  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 = KGC::DistributeParameter::GAIN_PARAMETER
    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)) }
  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, "Parameter")
    self.contents.draw_text(120, 0, 40, WLH, Vocab.rp, 2)
    self.contents.draw_text(170, 0, 60, WLH, "Gewinnung", 2)
    self.contents.draw_text(240, 0, 80, WLH, "Maximum", 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 = KGC::DistributeParameter::GAIN_PARAMETER[type]
    self.contents.draw_text(x + 120, y, 40, WLH, gain[0], 2)
    value = sprintf("%+d", gain[1])
    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, "Parameter", 1)
    self.contents.font.color = normal_color
    dy = WLH
    gain_params = KGC::DistributeParameter::GAIN_PARAMETER
    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::cool.gif\" style=\"vertical-align:middle\" emoid=\"B)\" border=\"0\" alt=\"cool.gif\" /]
      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

Ich finde den Script super!
Titel: Re: Punkteverteiling
Beitrag von: Sk!p am Dezember 16, 2008, 11:46:52
Kannst du mir verraten warum du den Code nochmals postetst?
Meinst du jmd ist zu dumm die erste Seite anzuklicken und inn dort
zu nehmen?

Solche Aktionen sind echt überflüssig. Ich habe jetzt echt die Schnauze
voll von deinem ewigen Rumgespamme <.<

Edit:
Auch das ist oben gezeigt.
So schwer kann das ja nicht sein sich einen zweiten Post anzusehen.
Das ist einfach nur Spamming was der Kollege hier größtenterils fabriziert.

Sk!p

sei mal ne so aggro skip und entspann dich hmkay?
vllt meinte ers nur nett? dein post is mehr spam als seiner
 ~hell
Titel: Re: Punkteverteiling
Beitrag von: Shinji am Dezember 16, 2008, 13:34:20
Nein, er hat auch die Tasten zum Actor wechseln geändert.
Titel: Re: Punkteverteiling
Beitrag von: ohm1 am Dezember 31, 2008, 19:53:30
Hi wenn ich mein spiel damit starten will bekomme ich immer ein fehler

Line943 :SyntaxError occured

was kann ich dagegen machen ?thx schon ma
Titel: Re: Punkteverteiling
Beitrag von: D.N.S am Januar 01, 2009, 05:25:25
@Twonky:
Danke das du das Gemacht hast aber Bitte schreib nächstes mal dazu wenn du etwas an einem Skript
änderst, verbessert usw...

@Skip:
Hell hat schon alles gesagt...

@ohm1:
Wo hast du das Skript den eingefügt? Hast noch andere Skripts drinn?




WS
     D.N.S
Titel: Re: Punkteverteiling
Beitrag von: PalaserGmbH am Januar 26, 2009, 15:39:04
Also,ich hab dieses Skript in meinem Spiel und finde es einfach geil !
Titel: Re: Punkteverteiling
Beitrag von: Prince am Januar 30, 2009, 18:31:53
Wie kann ich das Script per Common Event verwenden??? Ich kenn mich da ned so gut aus also thx im Vorraus.

MfG
Titel: Re: Punkteverteiling
Beitrag von: Ðeity am Januar 30, 2009, 21:17:44
Erster Post ;)
Erstmal schöner Script :)
@ohm1
Verwende am besten den Script aus der Demo,
da die Scripts, die im Forum reinkopiert wurden bearbeitet sind und Fehler beeinhalten.
Selbes Problem gehabt aber durch den Script in der Demo behoben.

@Prince
Du öffnest den Befehl : Script ... und fügst
"$scene = Scene_DistributeParameter.new(0)" ( ohne " )
ein, wobei die 0 die Nummer des Charackters ist, bei dem das Menü starten soll.

Btw bin neu und hoffe dass wir eine "gute Zeit" haben werden!
(Vielleicht sollte ich erwähnen, dass ich das Forum schon seit ca 2 Monaten nutze ^^)



MfG

Deity
Titel: Re: Punkteverteiling
Beitrag von: Prince am Januar 30, 2009, 21:19:37
Danke schöööööööööööööön. Ich brauchte das Skript nämlich wirklich dringend und kenn mich mit sowas Nüsse aus, also nochmal danke!!!

edit:
Wenn ichs so schreibe: "$scene = Scene_DistributeParameter.new(1)" ( ohne " )
dann steht SyntaxError occured while running Script

Wenn ichs so schreibe: "$scene = Scene_DistributeParameter.new(1)"
dann gehts gar nicht auf o.O

HEEEEEEEEEEEEELLLLLLLLLLLLLPPPPPPPPPPP
Titel: Re: Punkteverteiling
Beitrag von: Ðeity am Januar 30, 2009, 21:22:06
Ich hoffe das gilt nicht als Spamm und bitte bin selber noch ein Anfänger in Sachen "scripten", aber sogut wie alle Scripts lassen sich durch $scene = .... öffnen vllt kannst du so in Zukunft die befehle schneller finden. =)

MfG

Deity

EDIT:
Dein Rechner, Ruby und so zimmlich alle Programme fangen nicht bei 1 an zu zählen sondern bei 0 also wenn du keinen 2ten Spieler im Team hast wird es bei der Zahl 1 einen Fehler geben und kopier einfach was in der nächsten Reihe steht müsste gehen :
$scene = Scene_DistributeParameter.new(0)

erneut MfG

Deity
Titel: Re: Punkteverteiling
Beitrag von: Prince am Januar 30, 2009, 21:35:55
Immernoch Syntax Error
Titel: Re: Punkteverteiling
Beitrag von: Ðeity am Januar 30, 2009, 22:00:13
Versuche es ohne die sogenannten "Gänsefüschen", Anführungsstriche oben" ( <- echt kA wie mans sonst nennen soll^^)
Also direkt;

$scene = Scene_DistributeParameter.new(0)

und überprüf ob du das Script aus der Demo oder direkt aus diesem Forum hast, wie oben gesagt hat es Unterschiede, aber theoretisch lassen sich beide mit dem selben Befehl öffnen...

MfG

Deity
Titel: Re: Punkteverteiling
Beitrag von: Prince am Januar 30, 2009, 22:07:27
Hab ich schon vor dem Post hier von dir ausprobiert nachdem es mit dem Monsteralbum geklappt hatte. Und es hat gefunzt.

MfG
Titel: Re: Punkteverteiling
Beitrag von: Prince am Februar 08, 2009, 11:40:07
Ich hätte noch eine Frage, gibt es eine Möglichkeit die Punkte zu erhähen mit nem Event??
Titel: Re: Punkteverteiling
Beitrag von: Master-M am Februar 08, 2009, 11:50:12
Soweit ich weiß eigentlich nur per lvl up. Sonst müsste man das Skript ummodifizieren.
Aber ich kenne mich ja mit der Skript Sprache nicht soooooo gut aus. Evtl. ist die Funktion ja schon drinnen.
Müsste sich mal hM oder ein anderer Scripter mit Beschäftigen.
mfg. Master-M
Titel: Re: Punkteverteiling
Beitrag von: Lennineso am Juli 25, 2009, 00:04:36
der sagt bei mir:cript. 'Punkteverteilung' line 951: SyntaxError occured. 
Was soll ich machen?
Titel: Re: Punkteverteiling
Beitrag von: Melmier am November 08, 2009, 18:26:37
Gibt es auch eine Möglichkeit die Punkte püer Script neu zu verteilen. Z.B. bei einem Klassenwechsel, wenn man beispielsweise Lvl 30 ist, und dann seine 90 Punkte neu verteilen kann. Macht am meisten Sinn bei Klassenwechsel von Kriegerähnlicher zu Magiernahen Klasse.
Titel: Re: Punkteverteiling
Beitrag von: Scobidoo am November 09, 2009, 14:01:13
ALso ich benutze das FF 9 Menü (das das Speichern, Beenden etc. rechts ist) und wollte fragen wie man das nach rechts halt bekommt.

Screen:
(http://imagesload.net/daten_no/1223200484_ff9menu.jpg)

MFG Scobi

EDIT: Erledigt :D
Titel: Re: Punkteverteiling
Beitrag von: Franky am November 09, 2009, 19:47:39
Also bei mir erscheint eine Fehlermeldung in Line 951 Syntay Error!
(direkt nach dem Einfügen)
Titel: Re: Punkteverteiling
Beitrag von: DarkestHate am November 09, 2009, 19:50:12
genau dasselbe kommt bei mir auch xD
Titel: Re: Punkteverteiling
Beitrag von: Golderdbeere am November 09, 2009, 23:11:40
Das liegt sicher daran, dass im 1. Beiträg der Code nicht in [ code ]-Tags ist. Ladet euch doch die Demo runter und kopiert dann daraus das Skript in euer Projekt.
Titel: Re: Punkteverteiling
Beitrag von: PD am Juli 17, 2010, 08:49:40
Meine Frage zu dem Script,
wenn ich es per Event öffne un dann aus der verteilung rausgehe komme
ich wieder ins Menü. Wie kann ich des ändern, dass es das net tut?

Also man spricht ne Person an un dann öffnets un wenn ichs schließ soll man
einfach vor der person stehen ohne dass es das Menü öffnet.
Titel: Re: Punkteverteiling
Beitrag von: Vizard am Juli 17, 2010, 10:40:31
hastes mal mit einer switchkombination versucht?sollte dann rein von der logik her so aussehn:
_______________________________
page1:
control self switch: A=off

DEIN TEXT PROGRAMM USW

control self switch: A=on

________________________________

Page 2: geht nur mit selfswitch A=on

-dein text programm usw-

control self switch: A=off

________________________________

ich hatte immer bei den events die parallel ablaufen das problem dass sie sich immer weiederholten, bis man nen switch einbaut :D

also das ist das was mir dazu grade einfällt.kann sein dass es garnicht klappt, aber nen versuch ist es wert;)
Titel: Re: Punkteverteiling
Beitrag von: FlipelyFlip am Juli 17, 2010, 11:31:41
@Beck: Nein nein, er hat nich das problem das das Menü aktiv wird, sondern das das Script zurück ins Menü verweist. Am besten beim Aufrufen so machen:

$scene = Scene_(wie auch immer, weiß es grad nich auswendig).new(id) = 1

dann dürfte es dich danach auf die Map wieder bringen, bin mir aber grad nich sicher obs auch klappt.

lg flip
Titel: Re: Punkteverteiling
Beitrag von: PD am Juli 17, 2010, 11:54:35
@FlipelyFlip: Genau des meinte ich ^^
Habs ma so versucht, kommt dann aber Syntax Error
Titel: Re: Punkteverteiling
Beitrag von: FlipelyFlip am Juli 17, 2010, 12:26:17
hab doch grad ne kleine andere lösung gefunden^^"

um es von der Map aufzurufen gibst du folgendes ein:

$scene = Scene_DistributeParameter2.new(actor_id)
actor_id natürlich mit der ID des Helden aus der party ersetzen (= zB. 0 für Ralph, 1 für Ulrike, 2 für Benette und 3 für Ylva)

das Skript ausm Spoiler dafür aber verwenden (=

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/    ? ????????? - KGC_DistributeParameter ? VX ?
#_/    ? Last update : 2008/02/23 ?
#_/    Criador:KGC Softwares
#_/    Traduzido por:NaRuToMaKer
#_/----------------------------------------------------------------------------
#_/  Cria uma opção no menu de upgrade de atributos
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================
# Customização
#==============================================================================

module KGC
module DistributeParameter
 
#~   Defina do seguinte modo
#~   :maxhp => [1, 30, 50]
#~   :maxhp => [RP que consome,quantidade do parametro que aumenta,maximo de pontos]
 
  GAIN_PARAMETER = {
    :maxhp => [1, 30, 500],  # MaxHP
    :maxmp => [1,  3, 500],  # MaxMP
    :atk   => [1,  2, 500],  # ???
    :def   => [1,  2, 500],  # ???
    :spi   => [1,  2, 500],  # ???
    :agi   => [1,  2, 500],  # ???
    :hit   => [3,  1, 200],  # ???
    :eva   => [3,  1, 200],  # ???
    :cri   => [3,  1, 200],  # ???????
  }  # ? ?? } ????????

  # ? RP (Reinforce Point) ???
  VOCAB_RP   = "Punkte"
  # ? RP ??? (?)
  VOCAB_RP_A = "Kosten"

#~   Pontos para distribuir
#~   ao aumentar de level
  GAIN_RP_EXP = "3"
  #  ????? 10% + 1 ???????
  # GAIN_RP_EXP = "level / 10 + 1"


#~   Vocabulario
  VOCAB_PARAM = {
    :hit => "Schlag",        # ???
    :eva => "Fliehen/Ausweihen",        # ???
    :cri => "Kritische Schläge",  # ???????
  } 
  DISTRIBUTE_SCENE_CAPTION = ""

#~   Cores para a barrinha
#~ 
#~   Quando estiver enchendo
  GAUGE_START_COLOR = 28
#~   Quando estiver cheia
  GAUGE_END_COLOR   = 29

#~   Vai pararecer no menu?
  USE_MENU_DISTRIBUTE_PARAMETER_COMMAND = true
  # ? ?????????????????????????
  VOCAB_MENU_DISTRIBUTE_PARAMETER       = "Level up Punkte"

#~   Pode retirar pontos?
  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
#==============================================================================

module KGC::Commands
  module_function
  #--------------------------------------------------------------------------
  # ? ???????????????????
  #--------------------------------------------------------------------------
  def check_distribution_values
    (1...$data_actors.size).each { |i|
      $game_actors.check_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_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
  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
end

#???????????????????????????????????????

#==============================================================================
# ? Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ? ??????
  #     actor_id : ???? ID
  #--------------------------------------------------------------------------
  alias setup_KGC_DistributeParameter setup
  def setup(actor_id)
    setup_KGC_DistributeParameter(actor_id)

    @rp = calc_init_rp
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #     param : ?????? Symbol
  #--------------------------------------------------------------------------
  def distributed_param(param)
    n = KGC::DistributeParameter::GAIN_PARAMETER[param][1]
    return n * distributed_count(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
  #--------------------------------------------------------------------------
  # ? RP ???
  #--------------------------------------------------------------------------
  def rp
    @rp = calc_init_rp if @rp == nil
    return @rp
  end
  #--------------------------------------------------------------------------
  # ? RP ??????
  #--------------------------------------------------------------------------
  def calc_init_rp
    n = 0
    rp_exp = KGC::DistributeParameter::GAIN_RP_EXP.gsub(/level/) { "i" }
    (1...level).each { |i| n += [Integer(eval(rp_exp)), 0].max }
    return n
  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)
    @rp = [self.rp + value, 0].max
  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
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  alias level_up_KGC_DistributeParameter level_up
  def level_up
    level_up_KGC_DistributeParameter

    gain_level_up_rp
  end
  #--------------------------------------------------------------------------
  # ? ????????? RP ???
  #--------------------------------------------------------------------------
  def gain_level_up_rp
    n = [Integer(eval(KGC::DistributeParameter::GAIN_RP_EXP)), 0].max
    gain_rp(n)
  end
  #--------------------------------------------------------------------------
  # ? RP ?????????????
  #     param   : ?????????? (Symbol)
  #     reverse : ??????? true
  #--------------------------------------------------------------------------
  def rp_growth_effect(param, reverse = false)
    gain = KGC::DistributeParameter::GAIN_PARAMETER[param]
    return if gain == nil  # ????????

    if reverse
      return if distributed_count(param) == 0  # ?????
    else
      return unless can_distribute?(param)
    end

    gain_rp(gain[0] * (reverse ? 1 : -1))
    gain_distributed_count(param, reverse ? -1 : 1)
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #     param   : ?????????? (Symbol)
  #--------------------------------------------------------------------------
  def can_distribute?(param)
    gain = KGC::DistributeParameter::GAIN_PARAMETER[param]
    return false if gain == nil                          # ????????
    return false if self.rp < gain[0]                    # RP ??
    return false if gain[2] <= distributed_count(param)  # ????

    return true
  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)
    self.contents.font.color = rp_color(actor)
    xr = x + width
    self.contents.draw_text(xr - 40, y, 40, WLH, actor.rp, 2)
    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 = KGC::DistributeParameter::GAIN_PARAMETER[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, 80)
  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 = KGC::DistributeParameter::GAIN_PARAMETER
    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)) }
  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, "Parameter")
    self.contents.draw_text(120, 0, 40, WLH, Vocab.rp, 2)
    self.contents.draw_text(170, 0, 60, WLH, "Gewinnung", 2)
    self.contents.draw_text(240, 0, 80, WLH, "Maximum", 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 = KGC::DistributeParameter::GAIN_PARAMETER[type]
    self.contents.draw_text(x + 120, y, 40, WLH, gain[0], 2)
    value = sprintf("%+d", gain[1])
    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, "Parameter", 1)
    self.contents.font.color = normal_color
    dy = WLH
    gain_params = KGC::DistributeParameter::GAIN_PARAMETER
    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

#==============================================================================
# ? Scene_DistributeParameter
#------------------------------------------------------------------------------
#   ???????????????????????
#==============================================================================

class Scene_DistributeParameter2 < 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_MAP)
    @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

lg flipely
Titel: Re: Punkteverteiling
Beitrag von: PD am Juli 17, 2010, 12:36:10
Nein. Man soll die Punkte nur bei einer bestimmten Person
verteilen können.
Titel: Re: Punkteverteiling
Beitrag von: FlipelyFlip am Juli 17, 2010, 13:02:02
achso okö, dann is das ja noch leichter^^"

da brauchste dann mein Script gar nich wirklich, da musste nur dieses einfügen:

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/    ? ????????? - KGC_DistributeParameter ? VX ?
#_/    ? Last update : 2008/02/23 ?
#_/    Criador:KGC Softwares
#_/    Traduzido por:NaRuToMaKer
#_/----------------------------------------------------------------------------
#_/  Cria uma opção no menu de upgrade de atributos
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================
# Customização
#==============================================================================

module KGC
module DistributeParameter
 
#~   Defina do seguinte modo
#~   :maxhp => [1, 30, 50]
#~   :maxhp => [RP que consome,quantidade do parametro que aumenta,maximo de pontos]
 
  GAIN_PARAMETER = {
    :maxhp => [1, 30, 500],  # MaxHP
    :maxmp => [1,  3, 500],  # MaxMP
    :atk   => [1,  2, 500],  # ???
    :def   => [1,  2, 500],  # ???
    :spi   => [1,  2, 500],  # ???
    :agi   => [1,  2, 500],  # ???
    :hit   => [3,  1, 200],  # ???
    :eva   => [3,  1, 200],  # ???
    :cri   => [3,  1, 200],  # ???????
  }  # ? ?? } ????????

  # ? RP (Reinforce Point) ???
  VOCAB_RP   = "Punkte"
  # ? RP ??? (?)
  VOCAB_RP_A = "Kosten"

#~   Pontos para distribuir
#~   ao aumentar de level
  GAIN_RP_EXP = "3"
  #  ????? 10% + 1 ???????
  # GAIN_RP_EXP = "level / 10 + 1"


#~   Vocabulario
  VOCAB_PARAM = {
    :hit => "Schlag",        # ???
    :eva => "Fliehen/Ausweihen",        # ???
    :cri => "Kritische Schläge",  # ???????
  } 
  DISTRIBUTE_SCENE_CAPTION = ""

#~   Cores para a barrinha
#~ 
#~   Quando estiver enchendo
  GAUGE_START_COLOR = 28
#~   Quando estiver cheia
  GAUGE_END_COLOR   = 29

#~   Vai pararecer no menu?
  USE_MENU_DISTRIBUTE_PARAMETER_COMMAND = true
  # ? ?????????????????????????
  VOCAB_MENU_DISTRIBUTE_PARAMETER       = "Level up Punkte"

#~   Pode retirar pontos?
  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
#==============================================================================

module KGC::Commands
  module_function
  #--------------------------------------------------------------------------
  # ? ???????????????????
  #--------------------------------------------------------------------------
  def check_distribution_values
    (1...$data_actors.size).each { |i|
      $game_actors.check_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_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
  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
end

#???????????????????????????????????????

#==============================================================================
# ? Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ? ??????
  #     actor_id : ???? ID
  #--------------------------------------------------------------------------
  alias setup_KGC_DistributeParameter setup
  def setup(actor_id)
    setup_KGC_DistributeParameter(actor_id)

    @rp = calc_init_rp
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #     param : ?????? Symbol
  #--------------------------------------------------------------------------
  def distributed_param(param)
    n = KGC::DistributeParameter::GAIN_PARAMETER[param][1]
    return n * distributed_count(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
  #--------------------------------------------------------------------------
  # ? RP ???
  #--------------------------------------------------------------------------
  def rp
    @rp = calc_init_rp if @rp == nil
    return @rp
  end
  #--------------------------------------------------------------------------
  # ? RP ??????
  #--------------------------------------------------------------------------
  def calc_init_rp
    n = 0
    rp_exp = KGC::DistributeParameter::GAIN_RP_EXP.gsub(/level/) { "i" }
    (1...level).each { |i| n += [Integer(eval(rp_exp)), 0].max }
    return n
  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)
    @rp = [self.rp + value, 0].max
  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
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  alias level_up_KGC_DistributeParameter level_up
  def level_up
    level_up_KGC_DistributeParameter

    gain_level_up_rp
  end
  #--------------------------------------------------------------------------
  # ? ????????? RP ???
  #--------------------------------------------------------------------------
  def gain_level_up_rp
    n = [Integer(eval(KGC::DistributeParameter::GAIN_RP_EXP)), 0].max
    gain_rp(n)
  end
  #--------------------------------------------------------------------------
  # ? RP ?????????????
  #     param   : ?????????? (Symbol)
  #     reverse : ??????? true
  #--------------------------------------------------------------------------
  def rp_growth_effect(param, reverse = false)
    gain = KGC::DistributeParameter::GAIN_PARAMETER[param]
    return if gain == nil  # ????????

    if reverse
      return if distributed_count(param) == 0  # ?????
    else
      return unless can_distribute?(param)
    end

    gain_rp(gain[0] * (reverse ? 1 : -1))
    gain_distributed_count(param, reverse ? -1 : 1)
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #     param   : ?????????? (Symbol)
  #--------------------------------------------------------------------------
  def can_distribute?(param)
    gain = KGC::DistributeParameter::GAIN_PARAMETER[param]
    return false if gain == nil                          # ????????
    return false if self.rp < gain[0]                    # RP ??
    return false if gain[2] <= distributed_count(param)  # ????

    return true
  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)
    self.contents.font.color = rp_color(actor)
    xr = x + width
    self.contents.draw_text(xr - 40, y, 40, WLH, actor.rp, 2)
    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 = KGC::DistributeParameter::GAIN_PARAMETER[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, 80)
  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 = KGC::DistributeParameter::GAIN_PARAMETER
    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)) }
  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, "Parameter")
    self.contents.draw_text(120, 0, 40, WLH, Vocab.rp, 2)
    self.contents.draw_text(170, 0, 60, WLH, "Gewinnung", 2)
    self.contents.draw_text(240, 0, 80, WLH, "Maximum", 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 = KGC::DistributeParameter::GAIN_PARAMETER[type]
    self.contents.draw_text(x + 120, y, 40, WLH, gain[0], 2)
    value = sprintf("%+d", gain[1])
    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, "Parameter", 1)
    self.contents.font.color = normal_color
    dy = WLH
    gain_params = KGC::DistributeParameter::GAIN_PARAMETER
    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_MAP)
    @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

mit dem script is das aufrufen so wie gewohnt (=

lg flip
Titel: Re: Punkteverteiling
Beitrag von: PD am Juli 17, 2010, 13:21:15
Klappt bestens :)
Un somit zur letzten Frage diesbezüglich...
Wie stell ich die Funktion aus, dass man mit Q un W hin un her
schalten kann? Für jede Klasse soll es einen Lehrer geben,
deshalb is es unpraktisch, wenn man beim Krieger Punte für den
Magier verteilen kann ^^
Titel: Re: Punkteverteiling
Beitrag von: FlipelyFlip am Juli 17, 2010, 17:05:24
einfach nur mehr einfügen, hat sich nur in dem sinn geändert, dass man nich mehr mit Q und W wechseln kann ;)

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/    ? ????????? - KGC_DistributeParameter ? VX ?
#_/    ? Last update : 2008/02/23 ?
#_/    Criador:KGC Softwares
#_/    Traduzido por:NaRuToMaKer
#_/----------------------------------------------------------------------------
#_/  Cria uma opção no menu de upgrade de atributos
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================
# Customização
#==============================================================================

module KGC
module DistributeParameter
 
#~   Defina do seguinte modo
#~   :maxhp => [1, 30, 50]
#~   :maxhp => [RP que consome,quantidade do parametro que aumenta,maximo de pontos]
 
  GAIN_PARAMETER = {
    :maxhp => [1, 30, 500],  # MaxHP
    :maxmp => [1,  3, 500],  # MaxMP
    :atk   => [1,  2, 500],  # ???
    :def   => [1,  2, 500],  # ???
    :spi   => [1,  2, 500],  # ???
    :agi   => [1,  2, 500],  # ???
    :hit   => [3,  1, 200],  # ???
    :eva   => [3,  1, 200],  # ???
    :cri   => [3,  1, 200],  # ???????
  }  # ? ?? } ????????

  # ? RP (Reinforce Point) ???
  VOCAB_RP   = "Punkte"
  # ? RP ??? (?)
  VOCAB_RP_A = "Kosten"

#~   Pontos para distribuir
#~   ao aumentar de level
  GAIN_RP_EXP = "3"
  #  ????? 10% + 1 ???????
  # GAIN_RP_EXP = "level / 10 + 1"


#~   Vocabulario
  VOCAB_PARAM = {
    :hit => "Schlag",        # ???
    :eva => "Fliehen/Ausweihen",        # ???
    :cri => "Kritische Schläge",  # ???????
  } 
  DISTRIBUTE_SCENE_CAPTION = ""

#~   Cores para a barrinha
#~ 
#~   Quando estiver enchendo
  GAUGE_START_COLOR = 28
#~   Quando estiver cheia
  GAUGE_END_COLOR   = 29

#~   Vai pararecer no menu?
  USE_MENU_DISTRIBUTE_PARAMETER_COMMAND = true
  # ? ?????????????????????????
  VOCAB_MENU_DISTRIBUTE_PARAMETER       = "Level up Punkte"

#~   Pode retirar pontos?
  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
#==============================================================================

module KGC::Commands
  module_function
  #--------------------------------------------------------------------------
  # ? ???????????????????
  #--------------------------------------------------------------------------
  def check_distribution_values
    (1...$data_actors.size).each { |i|
      $game_actors.check_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_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
  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
end

#???????????????????????????????????????

#==============================================================================
# ? Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ? ??????
  #     actor_id : ???? ID
  #--------------------------------------------------------------------------
  alias setup_KGC_DistributeParameter setup
  def setup(actor_id)
    setup_KGC_DistributeParameter(actor_id)

    @rp = calc_init_rp
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #     param : ?????? Symbol
  #--------------------------------------------------------------------------
  def distributed_param(param)
    n = KGC::DistributeParameter::GAIN_PARAMETER[param][1]
    return n * distributed_count(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
  #--------------------------------------------------------------------------
  # ? RP ???
  #--------------------------------------------------------------------------
  def rp
    @rp = calc_init_rp if @rp == nil
    return @rp
  end
  #--------------------------------------------------------------------------
  # ? RP ??????
  #--------------------------------------------------------------------------
  def calc_init_rp
    n = 0
    rp_exp = KGC::DistributeParameter::GAIN_RP_EXP.gsub(/level/) { "i" }
    (1...level).each { |i| n += [Integer(eval(rp_exp)), 0].max }
    return n
  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)
    @rp = [self.rp + value, 0].max
  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
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  alias level_up_KGC_DistributeParameter level_up
  def level_up
    level_up_KGC_DistributeParameter

    gain_level_up_rp
  end
  #--------------------------------------------------------------------------
  # ? ????????? RP ???
  #--------------------------------------------------------------------------
  def gain_level_up_rp
    n = [Integer(eval(KGC::DistributeParameter::GAIN_RP_EXP)), 0].max
    gain_rp(n)
  end
  #--------------------------------------------------------------------------
  # ? RP ?????????????
  #     param   : ?????????? (Symbol)
  #     reverse : ??????? true
  #--------------------------------------------------------------------------
  def rp_growth_effect(param, reverse = false)
    gain = KGC::DistributeParameter::GAIN_PARAMETER[param]
    return if gain == nil  # ????????

    if reverse
      return if distributed_count(param) == 0  # ?????
    else
      return unless can_distribute?(param)
    end

    gain_rp(gain[0] * (reverse ? 1 : -1))
    gain_distributed_count(param, reverse ? -1 : 1)
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #     param   : ?????????? (Symbol)
  #--------------------------------------------------------------------------
  def can_distribute?(param)
    gain = KGC::DistributeParameter::GAIN_PARAMETER[param]
    return false if gain == nil                          # ????????
    return false if self.rp < gain[0]                    # RP ??
    return false if gain[2] <= distributed_count(param)  # ????

    return true
  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)
    self.contents.font.color = rp_color(actor)
    xr = x + width
    self.contents.draw_text(xr - 40, y, 40, WLH, actor.rp, 2)
    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 = KGC::DistributeParameter::GAIN_PARAMETER[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, 80)
  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 = KGC::DistributeParameter::GAIN_PARAMETER
    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)) }
  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, "Parameter")
    self.contents.draw_text(120, 0, 40, WLH, Vocab.rp, 2)
    self.contents.draw_text(170, 0, 60, WLH, "Gewinnung", 2)
    self.contents.draw_text(240, 0, 80, WLH, "Maximum", 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 = KGC::DistributeParameter::GAIN_PARAMETER[type]
    self.contents.draw_text(x + 120, y, 40, WLH, gain[0], 2)
    value = sprintf("%+d", gain[1])
    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, "Parameter", 1)
    self.contents.font.color = normal_color
    dy = WLH
    gain_params = KGC::DistributeParameter::GAIN_PARAMETER
    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_MAP)
    @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
    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

lg flipely
Titel: Re: Punkteverteiling
Beitrag von: PD am Juli 17, 2010, 18:55:04
Danke, jetzt is es so wie ichs brauch ^^
SimplePortal 2.3.3 © 2008-2010, SimplePortal