Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
Rozdawanie punktów co poziom
Autor Wiadomość
Lartarin 




Ranga RM:
4 gry

Pomogła: 3 razy
Dołączyła: 20 Wrz 2007
Posty: 233
Skąd: Ergard
Wysłany: Pią 23 Paź, 2009 07:50
Rozdawanie punktów co poziom
Aloha!

Kolejny dzisiaj skrypt :lartarin:
Skrypt do RPG Makera XP daje nam możliwość większego wpływu na rozwój bohaterów.
Co ich poziom mamy do rozdysponowania określoną na początku liczbę punktów, za które możemy zwiększać ich statsy ^@^
Możemy zwiększać im cztery główne statsy; czyli siłę, inteligencję, zręczność i szybkość.
O punktach które możemy rozdać informuje nas ikonka poziomu pokazująca się na ekranie. Możemy ją ofkors wyłączyć ;-)



Skrypt wywołujemy kodem:
Kod:
$scene = Scene_Points.new


Aha, wklejamy go nad Main :lartarin:

A oto on:
Spoiler:

Kod:
#====================================================================
# Edited by Lartarin the Super Pig ^@^
#====================================================================
module BlizzCFG
#====================================================================
  STARTING_POINTS = 10 # ilość punktów startowych
  POINTS_PER_LEVEL = 5 # punkty do rozdania co poziom
  DISPLAY_ICON = true # wyświetl ikonę  true/false
  ICON_DATA = [612, 452, 192]
  EVASION = 'Unik'
  STR_LIMIT = 999 # max. siły
  DEX_LIMIT = 999 # max. zręczności
  AGI_LIMIT = 999 # max.szybkości
  INT_LIMIT = 999 # max.inteligencji
  WINDOW_MODE = true # true/false
  AUTOMATIC_CALL = false # true/false
  AUTOMATIC_MAP_CALL = false # true/false
#====================================================================
  ATTR_LIMITS = [STR_LIMIT, DEX_LIMIT, AGI_LIMIT, INT_LIMIT]
#====================================================================
  end
#====================================================================
class Array
 
  def sum
    result = 0
    self.each {|i| result += i if i.is_a?(Numeric)}
    return result
  end
 
end
#==================================================================== 
class Game_Actor < Game_Battler
#==================================================================== 
  attr_reader :points
 
  alias setup_sds_later setup
  def setup(actor_id)
    @points = BlizzCFG::STARTING_POINTS
    setup_sds_later(actor_id)
  end
 
  alias exp_sds_later exp=
  def exp=(exp)
    old_level = @level
    exp_sds_later(exp)
    add_stat_points((@level - old_level) * BlizzCFG::POINTS_PER_LEVEL)
  end
 
  def add_stat_points(val)
    @points += val if val > 0
  end
 
  def remove_stat_points(val)
    @points = [@points-val, 0].max
  end
 
end

#====================================================================
class Window_Base < Window
#==================================================================== 
  def draw_actor_battler(actor, x, y)
    bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
    cw, ch = bitmap.width, bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x - cw/2, y - ch/2, bitmap, src_rect)
  end
 
  alias draw_actor_parameter_sds_later draw_actor_parameter
  def draw_actor_parameter(actor, x, y, type)
    if type == 7
      self.contents.font.color = system_color
      self.contents.draw_text(x, y, 120, 32, BlizzCFG::EVASION)
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 120, y, 36, 32, actor.eva.to_s, 2)
    else
      draw_actor_parameter_sds_later(actor, x, y, type)
    end
  end
 
end

#====================================================================
class Window_Distribution_Status < Window_Base
#==================================================================== 
  attr_accessor :actor
 
  def initialize(actor)
    super(BlizzCFG::WINDOW_MODE ? 160 : 0, 0, 480, 480)
    @actor = actor
    self.contents = Bitmap.new(width - 32, height - 32)
    if $fontface != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
    elsif $defaultfonttype != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
    end
    refresh
  end
 
  def refresh
    self.contents.clear
    unless @actor == nil
      draw_actor_battler(@actor, 280, 120)
      draw_actor_name(@actor, 4, 0)
      draw_actor_class(@actor, 4, 32)
      draw_actor_level(@actor, 4, 64)
      draw_actor_state(@actor, 4, 96)
      self.contents.font.color = system_color
      self.contents.draw_text(4, 128, 80, 32, 'Doś.')
      self.contents.draw_text(4, 160, 80, 32, 'nast. poz.')
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 128, 156, 32, @actor.exp_s, 2)
      self.contents.draw_text(4, 160, 156, 32, @actor.next_rest_exp_s, 2)
      draw_actor_hp(@actor, 4, 224, 172)
      draw_actor_sp(@actor, 4, 256, 172)
      draw_actor_parameter(@actor, 4, 320, 0)
      draw_actor_parameter(@actor, 4, 352, 1)
      draw_actor_parameter(@actor, 4, 384, 2)
      draw_actor_parameter(@actor, 4, 416, 7)
      self.contents.font.color = system_color
      self.contents.draw_text(240, 240, 96, 32, 'Ekwipunek')
      draw_item_name($data_weapons[@actor.weapon_id], 240, 288)
      draw_item_name($data_armors[@actor.armor1_id], 240, 320)
      draw_item_name($data_armors[@actor.armor2_id], 240, 352)
      draw_item_name($data_armors[@actor.armor3_id], 240, 384)
      draw_item_name($data_armors[@actor.armor4_id], 240, 416)
    end
  end
 
end
 
#====================================================================
class Window_Distribution < Window_Selectable
#==================================================================== 
  attr_accessor :actor
  attr_reader   :points
 
  def initialize(actor)
    super(BlizzCFG::WINDOW_MODE ? 0 : 480, 160, 160, 320)
    self.contents = Bitmap.new(width - 32, height - 32)
    if $fontface != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
      elsif $defaultfonttype != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
    end
    self.active, self.index, = false, 0
    @item_max, @actor, @att, @points = 4, actor, [0, 0, 0, 0], 0
    refresh
  end
 
  def set_new_attributes
    @actor.str += @att[0]
    @actor.dex += @att[1]
    @actor.agi += @att[2]
    @actor.int += @att[3]
    @actor.remove_stat_points(@points)
  end
 
  def actor=(actor)
    @actor = actor
    @att[0] = @att[1] = @att[2] = @att[3] = @points = 0
  end
 
  def refresh
    self.contents.clear
    unless @actor == nil
      self.contents.font.color = system_color
      self.contents.draw_text(52, 0, 72, 32, 'Pkt.', 2)
      self.contents.draw_text(4, 32, 120, 32, $data_system.words.str)
      self.contents.draw_text(4, 96, 120, 32, $data_system.words.dex)
      self.contents.draw_text(4, 160, 120, 32, $data_system.words.agi)
      self.contents.draw_text(4, 224, 120, 32, $data_system.words.int)
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, 48, 32, "#{actor.points-@points}", 2)
      self.contents.draw_text(36, 64, 56, 32, "#{@actor.str+@att[0]}", 2)
      self.contents.draw_text(36, 128, 56, 32, "#{@actor.dex+@att[1]}", 2)
      self.contents.draw_text(36, 192, 56, 32, "#{@actor.agi+@att[2]}", 2)
      self.contents.draw_text(36, 256, 56, 32, "#{@actor.int+@att[3]}", 2)
      self.contents.font.size += 8
      self.contents.font.bold = true
      (0...4).each {|i|
          self.contents.draw_text(0, (i + 1) * 64 - 8, 32, 42, '&#171;', 2)
          self.contents.draw_text(96, (i + 1) * 64 - 8, 32, 42, '&#187;')}
      self.contents.font.bold = false
      self.contents.font.size -= 8
    end
  end
 
  def add_points(num)
    attr = [@actor.str, @actor.dex, @actor.agi, @actor.int]
    if @points < @actor.points &&
        attr[index]+@att[index] < BlizzCFG::ATTR_LIMITS[index]
      @points = [@points + num, @actor.points].min
      @att[index] = [@att[index]+num, @points+@att[index]-@att.sum].min
      return true
    end
    return false
  end
 
  def remove_points(num)
    if @points > 0 && @att[index] > 0
      @points = [@points - num, 0].max
      @att[index] = [@att[index] - num, 0].max
      return true
    end
    return false
  end
 
  def update
    super
    return unless self.active
    if Input.press?(Input::R)
      if Input.repeat?(Input::RIGHT)
        if add_points(100)
          $game_system.se_play($data_system.cursor_se)
          refresh
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      elsif Input.repeat?(Input::LEFT)
        if remove_points(100)
          $game_system.se_play($data_system.cursor_se)
          refresh
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      end
    elsif Input.press?(Input::L)
      if Input.repeat?(Input::RIGHT)
        if add_points(10)
          $game_system.se_play($data_system.cursor_se)
          refresh
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      elsif Input.repeat?(Input::LEFT)
        if remove_points(10)
          $game_system.se_play($data_system.cursor_se)
          refresh
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      end
    elsif Input.repeat?(Input::RIGHT)
      if add_points(1)
        $game_system.se_play($data_system.cursor_se)
        refresh
      else
        $game_system.se_play($data_system.buzzer_se)
      end
    elsif Input.repeat?(Input::LEFT)
      if remove_points(1)
        $game_system.se_play($data_system.cursor_se)
        refresh
      else
        $game_system.se_play($data_system.buzzer_se)
      end
    end
  end
 
  def update_cursor_rect
    if @index < 0 || !self.active
      self.cursor_rect.empty
    else
      self.cursor_rect.set(32, (@index+1)*64, 64, 32)
    end
  end
 
end
 
#====================================================================
class Window_Sure < Window_Command
#==================================================================== 
  attr_accessor :actor
 
  def initialize(width, commands)
    commands.push('')
    super
    @item_max, self.index = commands.size - 1, 0
    self.x, self.y, self.z = 320-self.width/2, 240-self.height/2, 10000
    refresh
  end
 
  def refresh
    super
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, self.contents.width - 8, 32, 'Jesteś pewien?', 1)
  end
 
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(4, 32 * (index+1), self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], 1)
  end
 
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(32, (@index+1)*32, self.contents.width - 64, 32)
    end
  end
 
end

#==================================================================== 
class Scene_Points
#==================================================================== 
  def initialize
    @actor, @scene = $game_party.actors[0], $scene.class
  end
 
  def main
    commands = ['Rozdaj', 'Następny', 'Poprzedni', 'Koniec']
    @command_window = Window_Command.new(160, commands)
    @command_window.x = (BlizzCFG::WINDOW_MODE ? 0 : 480)
    @status_window = Window_Distribution_Status.new(@actor)
    @distro_window = Window_Distribution.new(@actor)
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      break if $scene != self
    end
    Graphics.freeze
    [@command_window, @status_window, @distro_window].each {|win| win.dispose}
  end
 
  def make_sure_window
    commands = ['Nie', 'Akceptuj zmiany', 'Odrzuć zmiany']
    @sure_window = Window_Sure.new(256, commands)
  end
 
  def update
    if @command_window.active
      @command_window.update
      update_main_command
    elsif @sure_window != nil
      @sure_window.update
      update_sure
    elsif @distro_window.active
      @distro_window.update
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        @command_window.active, @distro_window.active = true, false
      end
    end
  end
 
  def update_main_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      if @distro_window.points != 0
        @command_window.index, @command_window.active = 3, false
        make_sure_window
      else
        $scene = @scene.new
      end
    elsif Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      case @command_window.index
      when 0 then @command_window.active, @distro_window.active = false, true
      when 1
        if @distro_window.points != 0
          @command_window.active = false
          make_sure_window
        else
          i = (@actor.index+1) % $game_party.actors.size
          @actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
          [@status_window, @distro_window].each {|win| win.refresh}
          @distro_window.index = 0
        end
      when 2
        if @distro_window.points != 0
          @command_window.active = false
          make_sure_window
        else
          i = (@actor.index+$game_party.actors.size-1) % $game_party.actors.size
          @actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
          [@status_window, @distro_window].each {|win| win.refresh}
          @distro_window.index = 0
        end
      when 3
        if @distro_window.points != 0
          @command_window.active = false
          make_sure_window
        else
          $scene = @scene.new
        end
      end
    end
  end
 
  def update_sure
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @sure_window.dispose
      @sure_window, @command_window.active = nil, true
    elsif Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      case @command_window.index
      when 1
        if @sure_window.index > 0
          @distro_window.set_new_attributes if @sure_window.index == 1
          i = (@actor.index+1) % $game_party.actors.size
          @actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
          [@status_window, @distro_window].each {|win| win.refresh}
        end
        @sure_window.dispose
        @sure_window, @command_window.active = nil, true
      when 2
        if @sure_window.index > 0
          @distro_window.set_new_attributes if @sure_window.index == 1
          i = (@actor.index+$game_party.actors.size-1) % $game_party.actors.size
          @actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
          [@status_window, @distro_window].each {|win| win.refresh}
        end
        @sure_window.dispose
        @sure_window, @command_window.active = nil, true
      when 3
        if @sure_window.index > 0
          @distro_window.set_new_attributes if @sure_window.index == 1
          $scene = @scene.new
        end
        @sure_window.dispose
        @sure_window, @command_window.active = nil, true
      end
    end
  end
 
end

#====================================================================
class Scene_Battle
#==================================================================== 
  alias main_sds_later main
  def main
    main_sds_later
    if BlizzCFG::AUTOMATIC_CALL &&
        $game_party.actors.any? {|actor| actor.points > 0}
      $scene = Scene_Points.new
    end
  end
 
end

#====================================================================
class Scene_Map
#====================================================================
  alias main_sds_later main
  def main
    main_sds_later
    @notify.dispose if @notify != nil
  end
 
  alias upd_sds_later update
  def update
    check_icon if BlizzCFG::DISPLAY_ICON
    upd_sds_later
    if BlizzCFG::AUTOMATIC_MAP_CALL &&
        $game_party.actors.any? {|actor| actor.points > 0}
      $scene = Scene_Points.new
    end
  end
  def check_icon
    if $game_party.actors.any? {|actor| actor.points > 0}
      if @notify == nil
        @notify = RPG::Sprite.new
       
        else
          @notify.bitmap = Bitmap.new(24, 24)
          @notify.bitmap.fill_rect(0, 0, 24, 24, Color.new(255, 255, 255))
          @notify.bitmap.fill_rect(22, 1, 2, 23, Color.new(0, 0, 0))
          @notify.bitmap.fill_rect(1, 22, 23, 2, Color.new(0, 0, 0))
          @notify.bitmap.set_pixel(23, 0, Color.new(0, 0, 0))
          @notify.bitmap.set_pixel(0, 23, Color.new(0, 0, 0))
          @notify.bitmap.fill_rect(2, 2, 20, 20, Color.new(0, 0, 224))
          @notify.bitmap.fill_rect(4, 10, 16, 4, Color.new(255, 255, 255))
          @notify.bitmap.fill_rect(10, 4, 4, 16, Color.new(255, 255, 255))
          @notify.opacity = BlizzCFG::ICON_DATA[2]
        end
        @notify.x, @notify.y = BlizzCFG::ICON_DATA[0, 2]
        @notify.z = 5000
        @notify.blink_on
      end
      @notify.update
   
  end
end
#====================================================================
# www.ultimateam.pl
#====================================================================

________________________

 
 
 
Cyklop 




Nagrody:
UFT3 Winner

Ranga RM:
1 gra

Dołączył: 03 Sie 2008
Posty: 54
Skąd: ???
Wysłany: Pią 23 Paź, 2009 19:03
Świetne, takie coś przydałoby się jeszvze do VX. Pozdro dla Fire Pig :P
 
 
Unnamed 




Preferowany:
RPG Maker XP

Dołączył: 29 Lip 2009
Posty: 59
Skąd: from Hell
Wysłany: Sob 24 Paź, 2009 16:56
Spoko skrypt. Widzialem juz kiedys podobny ale nie mozna bylo ustawic maxa dla statystyk. Dzienks, przyda sie na pewno ale znowu bede musial zmienic mechanike gry. Trudno :)
________________________
Time to Play :!:

 
 
Kaz 



Preferowany:
RPG Maker VX

Dołączył: 28 Paź 2009
Posty: 1
Wysłany: Sob 31 Paź, 2009 08:54
Da się zrobić, by ten sposób działał również przy level-upach nie wywoływanych przez $scene = Scene_Points.new?
 
 
Lartarin 




Ranga RM:
4 gry

Pomogła: 3 razy
Dołączyła: 20 Wrz 2007
Posty: 233
Skąd: Ergard
Wysłany: Sob 31 Paź, 2009 09:11
Aloha!
W skrypcie wystąpił mały błąd, oto poprawna wersja:

Spoiler:

Kod:
#====================================================================
# Edited by Lartarin the Super Pig ^@^
#====================================================================
module BlizzCFG
#====================================================================
  STARTING_POINTS = 10 # ilość punktów startowych
  POINTS_PER_LEVEL = 5 # punkty do rozdania co poziom
  DISPLAY_ICON = true # wyświetl ikonę  true/false
  ICON_DATA = [612, 452, 192]
  EVASION = 'Unik'
  STR_LIMIT = 999 # max. siły
  DEX_LIMIT = 999 # max. zręczności
  AGI_LIMIT = 999 # max.szybkości
  INT_LIMIT = 999 # max.inteligencji
  WINDOW_MODE = true # true/false
  AUTOMATIC_CALL = true # true/false
  AUTOMATIC_MAP_CALL = false # true/false
#====================================================================
  ATTR_LIMITS = [STR_LIMIT, DEX_LIMIT, AGI_LIMIT, INT_LIMIT]
#====================================================================
  end
#====================================================================
class Array
 
  def sum
    result = 0
    self.each {|i| result += i if i.is_a?(Numeric)}
    return result
  end
 
end
#====================================================================
class Game_Actor < Game_Battler
#====================================================================
  attr_reader :points
 
  alias setup_sds_later setup
  def setup(actor_id)
    @points = BlizzCFG::STARTING_POINTS
    setup_sds_later(actor_id)
  end
 
  alias exp_sds_later exp=
  def exp=(exp)
    old_level = @level
    exp_sds_later(exp)
    add_stat_points((@level - old_level) * BlizzCFG::POINTS_PER_LEVEL)
  end
 
  def add_stat_points(val)
    @points += val if val > 0
  end
 
  def remove_stat_points(val)
    @points = [@points-val, 0].max
  end
 
end

#====================================================================
class Window_Base < Window
#====================================================================
  def draw_actor_battler(actor, x, y)
    bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
    cw, ch = bitmap.width, bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x - cw/2, y - ch/2, bitmap, src_rect)
  end
 
  alias draw_actor_parameter_sds_later draw_actor_parameter
  def draw_actor_parameter(actor, x, y, type)
    if type == 7
      self.contents.font.color = system_color
      self.contents.draw_text(x, y, 120, 32, BlizzCFG::EVASION)
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 120, y, 36, 32, actor.eva.to_s, 2)
    else
      draw_actor_parameter_sds_later(actor, x, y, type)
    end
  end
 
end

#====================================================================
class Window_Distribution_Status < Window_Base
#====================================================================
  attr_accessor :actor
 
  def initialize(actor)
    super(BlizzCFG::WINDOW_MODE ? 160 : 0, 0, 480, 480)
    @actor = actor
    self.contents = Bitmap.new(width - 32, height - 32)
    if $fontface != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
    elsif $defaultfonttype != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
    end
    refresh
  end
 
  def refresh
    self.contents.clear
    unless @actor == nil
      draw_actor_battler(@actor, 280, 120)
      draw_actor_name(@actor, 4, 0)
      draw_actor_class(@actor, 4, 32)
      draw_actor_level(@actor, 4, 64)
      draw_actor_state(@actor, 4, 96)
      self.contents.font.color = system_color
      self.contents.draw_text(4, 128, 80, 32, 'Doś.')
      self.contents.draw_text(4, 160, 80, 32, 'nast. poz.')
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 128, 156, 32, @actor.exp_s, 2)
      self.contents.draw_text(4, 160, 156, 32, @actor.next_rest_exp_s, 2)
      draw_actor_hp(@actor, 4, 224, 172)
      draw_actor_sp(@actor, 4, 256, 172)
      draw_actor_parameter(@actor, 4, 320, 0)
      draw_actor_parameter(@actor, 4, 352, 1)
      draw_actor_parameter(@actor, 4, 384, 2)
      draw_actor_parameter(@actor, 4, 416, 7)
      self.contents.font.color = system_color
      self.contents.draw_text(240, 240, 96, 32, 'Ekwipunek')
      draw_item_name($data_weapons[@actor.weapon_id], 240, 288)
      draw_item_name($data_armors[@actor.armor1_id], 240, 320)
      draw_item_name($data_armors[@actor.armor2_id], 240, 352)
      draw_item_name($data_armors[@actor.armor3_id], 240, 384)
      draw_item_name($data_armors[@actor.armor4_id], 240, 416)
    end
  end
 
end
 
#====================================================================
class Window_Distribution < Window_Selectable
#====================================================================
  attr_accessor :actor
  attr_reader   :points
 
  def initialize(actor)
    super(BlizzCFG::WINDOW_MODE ? 0 : 480, 160, 160, 320)
    self.contents = Bitmap.new(width - 32, height - 32)
    if $fontface != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
      elsif $defaultfonttype != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
    end
    self.active, self.index, = false, 0
    @item_max, @actor, @att, @points = 4, actor, [0, 0, 0, 0], 0
    refresh
  end
 
  def set_new_attributes
    @actor.str += @att[0]
    @actor.dex += @att[1]
    @actor.agi += @att[2]
    @actor.int += @att[3]
    @actor.remove_stat_points(@points)
  end
 
  def actor=(actor)
    @actor = actor
    @att[0] = @att[1] = @att[2] = @att[3] = @points = 0
  end
 
  def refresh
    self.contents.clear
    unless @actor == nil
      self.contents.font.color = system_color
      self.contents.draw_text(52, 0, 72, 32, 'Pkt.', 2)
      self.contents.draw_text(4, 32, 120, 32, $data_system.words.str)
      self.contents.draw_text(4, 96, 120, 32, $data_system.words.dex)
      self.contents.draw_text(4, 160, 120, 32, $data_system.words.agi)
      self.contents.draw_text(4, 224, 120, 32, $data_system.words.int)
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, 48, 32, "#{actor.points-@points}", 2)
      self.contents.draw_text(36, 64, 56, 32, "#{@actor.str+@att[0]}", 2)
      self.contents.draw_text(36, 128, 56, 32, "#{@actor.dex+@att[1]}", 2)
      self.contents.draw_text(36, 192, 56, 32, "#{@actor.agi+@att[2]}", 2)
      self.contents.draw_text(36, 256, 56, 32, "#{@actor.int+@att[3]}", 2)
      self.contents.font.size += 8
      self.contents.font.bold = true
      (0...4).each {|i|
          self.contents.draw_text(0, (i + 1) * 64 - 8, 32, 42, '>>', 2)
          self.contents.draw_text(96, (i + 1) * 64 - 8, 32, 42, '<<')}
      self.contents.font.bold = false
      self.contents.font.size -= 8
    end
  end
 
  def add_points(num)
    attr = [@actor.str, @actor.dex, @actor.agi, @actor.int]
    if @points < @actor.points &&
        attr[index]+@att[index] < BlizzCFG::ATTR_LIMITS[index]
      @points = [@points + num, @actor.points].min
      @att[index] = [@att[index]+num, @points+@att[index]-@att.sum].min
      return true
    end
    return false
  end
 
  def remove_points(num)
    if @points > 0 && @att[index] > 0
      @points = [@points - num, 0].max
      @att[index] = [@att[index] - num, 0].max
      return true
    end
    return false
  end
 
  def update
    super
    return unless self.active
    if Input.press?(Input::R)
      if Input.repeat?(Input::RIGHT)
        if add_points(100)
          $game_system.se_play($data_system.cursor_se)
          refresh
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      elsif Input.repeat?(Input::LEFT)
        if remove_points(100)
          $game_system.se_play($data_system.cursor_se)
          refresh
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      end
    elsif Input.press?(Input::L)
      if Input.repeat?(Input::RIGHT)
        if add_points(10)
          $game_system.se_play($data_system.cursor_se)
          refresh
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      elsif Input.repeat?(Input::LEFT)
        if remove_points(10)
          $game_system.se_play($data_system.cursor_se)
          refresh
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      end
    elsif Input.repeat?(Input::RIGHT)
      if add_points(1)
        $game_system.se_play($data_system.cursor_se)
        refresh
      else
        $game_system.se_play($data_system.buzzer_se)
      end
    elsif Input.repeat?(Input::LEFT)
      if remove_points(1)
        $game_system.se_play($data_system.cursor_se)
        refresh
      else
        $game_system.se_play($data_system.buzzer_se)
      end
    end
  end
 
  def update_cursor_rect
    if @index < 0 || !self.active
      self.cursor_rect.empty
    else
      self.cursor_rect.set(32, (@index+1)*64, 64, 32)
    end
  end
 
end
 
#====================================================================
class Window_Sure < Window_Command
#====================================================================
  attr_accessor :actor
 
  def initialize(width, commands)
    commands.push('')
    super
    @item_max, self.index = commands.size - 1, 0
    self.x, self.y, self.z = 320-self.width/2, 240-self.height/2, 10000
    refresh
  end
 
  def refresh
    super
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, self.contents.width - 8, 32, 'Jesteś pewien?', 1)
  end
 
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(4, 32 * (index+1), self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], 1)
  end
 
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(32, (@index+1)*32, self.contents.width - 64, 32)
    end
  end
 
end

#====================================================================
class Scene_Points
#====================================================================
  def initialize
    @actor, @scene = $game_party.actors[0], $scene.class
  end
 
  def main
    commands = ['Rozdaj', 'Następny', 'Poprzedni', 'Koniec']
    @command_window = Window_Command.new(160, commands)
    @command_window.x = (BlizzCFG::WINDOW_MODE ? 0 : 480)
    @status_window = Window_Distribution_Status.new(@actor)
    @distro_window = Window_Distribution.new(@actor)
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      break if $scene != self
    end
    Graphics.freeze
    [@command_window, @status_window, @distro_window].each {|win| win.dispose}
  end
 
  def make_sure_window
    commands = ['Nie', 'Akceptuj zmiany', 'Odrzuć zmiany']
    @sure_window = Window_Sure.new(256, commands)
  end
 
  def update
    if @command_window.active
      @command_window.update
      update_main_command
    elsif @sure_window != nil
      @sure_window.update
      update_sure
    elsif @distro_window.active
      @distro_window.update
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        @command_window.active, @distro_window.active = true, false
      end
    end
  end
 
  def update_main_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      if @distro_window.points != 0
        @command_window.index, @command_window.active = 3, false
        make_sure_window
      else
        $scene = @scene.new
      end
    elsif Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      case @command_window.index
      when 0 then @command_window.active, @distro_window.active = false, true
      when 1
        if @distro_window.points != 0
          @command_window.active = false
          make_sure_window
        else
          i = (@actor.index+1) % $game_party.actors.size
          @actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
          [@status_window, @distro_window].each {|win| win.refresh}
          @distro_window.index = 0
        end
      when 2
        if @distro_window.points != 0
          @command_window.active = false
          make_sure_window
        else
          i = (@actor.index+$game_party.actors.size-1) % $game_party.actors.size
          @actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
          [@status_window, @distro_window].each {|win| win.refresh}
          @distro_window.index = 0
        end
      when 3
        if @distro_window.points != 0
          @command_window.active = false
          make_sure_window
        else
          $scene = @scene.new
        end
      end
    end
  end
 
  def update_sure
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @sure_window.dispose
      @sure_window, @command_window.active = nil, true
    elsif Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      case @command_window.index
      when 1
        if @sure_window.index > 0
          @distro_window.set_new_attributes if @sure_window.index == 1
          i = (@actor.index+1) % $game_party.actors.size
          @actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
          [@status_window, @distro_window].each {|win| win.refresh}
        end
        @sure_window.dispose
        @sure_window, @command_window.active = nil, true
      when 2
        if @sure_window.index > 0
          @distro_window.set_new_attributes if @sure_window.index == 1
          i = (@actor.index+$game_party.actors.size-1) % $game_party.actors.size
          @actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
          [@status_window, @distro_window].each {|win| win.refresh}
        end
        @sure_window.dispose
        @sure_window, @command_window.active = nil, true
      when 3
        if @sure_window.index > 0
          @distro_window.set_new_attributes if @sure_window.index == 1
          $scene = @scene.new
        end
        @sure_window.dispose
        @sure_window, @command_window.active = nil, true
      end
    end
  end
 
end

#====================================================================
class Scene_Battle
#====================================================================
  alias main_sds_later main
  def main
    main_sds_later
    if BlizzCFG::AUTOMATIC_CALL &&
        $game_party.actors.any? {|actor| actor.points > 0}
      $scene = Scene_Points.new
    end
  end
 
end

#====================================================================
class Scene_Map
#====================================================================
  alias main_sds_later main
  def main
    main_sds_later
    @notify.dispose if @notify != nil
  end
 
  alias upd_sds_later update
  def update
    check_icon if BlizzCFG::DISPLAY_ICON
    upd_sds_later
    if BlizzCFG::AUTOMATIC_MAP_CALL &&
        $game_party.actors.any? {|actor| actor.points > 0}
      $scene = Scene_Points.new
    end
  end
  def check_icon
    if $game_party.actors.any? {|actor| actor.points > 0}
      if @notify == nil
        @notify = RPG::Sprite.new
       
        else
          @notify.bitmap = Bitmap.new(24, 24)
          @notify.bitmap.fill_rect(0, 0, 24, 24, Color.new(255, 255, 255))
          @notify.bitmap.fill_rect(22, 1, 2, 23, Color.new(0, 0, 0))
          @notify.bitmap.fill_rect(1, 22, 23, 2, Color.new(0, 0, 0))
          @notify.bitmap.set_pixel(23, 0, Color.new(0, 0, 0))
          @notify.bitmap.set_pixel(0, 23, Color.new(0, 0, 0))
          @notify.bitmap.fill_rect(2, 2, 20, 20, Color.new(0, 0, 224))
          @notify.bitmap.fill_rect(4, 10, 16, 4, Color.new(255, 255, 255))
          @notify.bitmap.fill_rect(10, 4, 4, 16, Color.new(255, 255, 255))
          @notify.opacity = BlizzCFG::ICON_DATA[2]
        end
        @notify.x, @notify.y = BlizzCFG::ICON_DATA[0, 2]
        @notify.z = 5000
        @notify.blink_on
      end
      @notify.update
   
  end
end
#====================================================================
# www.ultimateam.pl
#====================================================================



Co do wywołania automatycznego, to zmień to:
Kod:
AUTOMATIC_CALL = true # true/false
________________________

 
 
 
Azsak von Triger 




Preferowany:
RPG Maker VX

Ranga RM:
1 gra

Dołączył: 29 Paź 2009
Posty: 48
Skąd: Gdynia
Wysłany: Sob 31 Paź, 2009 09:32
Zaraz dodam do vx rozdawanie punktów :)
 
 
 
dawidos989 




Preferowany:
RPG Maker VX

Pomógł: 6 razy
Dołączył: 04 Lis 2009
Posty: 87
Skąd: z tond
Wysłany: Pią 06 Lis, 2009 16:29
możecie dokładnie powiedzieć gdzie wpisać ten kod bo nie wiem jestem nowy
________________________
Pomogłem? Daj "
 
 
Lartarin 




Ranga RM:
4 gry

Pomogła: 3 razy
Dołączyła: 20 Wrz 2007
Posty: 233
Skąd: Ergard
Wysłany: Sob 07 Lis, 2009 10:33
Aloha!



Zaznaczona na czerwono ikonka to script editor, wejdź w niego i zjedź na sam dół.
Skrypt wklej nad Main.
Main jest na samym dole.
________________________

 
 
 
Bulooo 




Preferowany:
RPG Maker XP

Pomógł: 3 razy
Dołączył: 27 Gru 2009
Posty: 79
Skąd: Wodzisław Śląski
Wysłany: Pon 28 Gru, 2009 15:13



Proszę o pomoc ;-(
 
 
alintes 




Preferowany:
RPG Maker XP

Dołączył: 20 Gru 2009
Posty: 41
Skąd: Strzelin
Wysłany: Pon 28 Gru, 2009 16:51
mi to samo wyskakuje help!!!!!!!!! ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-(
________________________
http://footballteam.pl/in...olecil=108205#v
 
 
 
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Pon 28 Gru, 2009 17:44
Z powyższego skryptu usuńcie linijkę 497 z:
Kod:
@notify.update


Wszystko powinno działać.
________________________


 
 
 
Bulooo 




Preferowany:
RPG Maker XP

Pomógł: 3 razy
Dołączył: 27 Gru 2009
Posty: 79
Skąd: Wodzisław Śląski
Wysłany: Pon 28 Gru, 2009 17:55
Wielkie dzięki już wszystko działa :))
________________________

Wiem że chcesz zagrać, a nie chce ci się przepisywać ip, Skopiuj: 80.72.37.12:27025

http://grawbank.tk/276/bulo < Zbieram na xBoxa
 
 
adek16 




Preferowany:
RPG Maker XP

Dołączył: 29 Gru 2009
Posty: 11
Skąd: namysłów
Wysłany: Sro 30 Gru, 2009 20:26
mi wyskakuje ten sam błąd przy odpalaniu zapisu gry jeżeli daje nowa gra to tak nie ma.

usuwałem już ze skryptu linijkę 497 ale dalej nie działa.proszę o pomoc :cry: :cry:
________________________
wwe całe moje życie :-) rey mysterio rządzi
 
 
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Sro 30 Gru, 2009 20:56
To dlatego, że zapis gry musi zawierać skrypt... innymi słowy, dopiero po umieszczeniu skryptu powinieneś zapisać grę, a wtedy bez problemu się wczyta.
________________________


 
 
 
adek16 




Preferowany:
RPG Maker XP

Dołączył: 29 Gru 2009
Posty: 11
Skąd: namysłów
Wysłany: Czw 31 Gru, 2009 09:23
czyli że od nowa mam robić 53 lvl / :-)
________________________
wwe całe moje życie :-) rey mysterio rządzi
 
 
Wyświetl posty z ostatnich:   
Odpowiedz do tematu
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene