Vai al contenuto


Toggle Chat RM - Chat Apri la Chat in un popup

E' severamente vietato richiedere supporto su RPG Maker in chat!
@  Pech93 : (23 May 2012 - 08:05 PM) MIk?
@  Melosx : (23 May 2012 - 07:51 PM) VIENI SU MSN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@  Melosx : (23 May 2012 - 07:51 PM) MIIIIIIIIIIIIIIIIIIIKKKKKKKKKKKK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@  Melosx : (23 May 2012 - 07:46 PM) *iù
@  Melosx : (23 May 2012 - 07:38 PM) iu spin mi rai rau bebi rai rau laic a record bebi rau rau rau rau
@  Melosx : (23 May 2012 - 07:37 PM) lalalallalallalallallllllllllalalalallaaaaaaaaaaaaaaaaaaaaaa!!!!!!!!!!!!!!!!!!
@  Melosx : (23 May 2012 - 07:37 PM) lalalalala
@  Melosx : (23 May 2012 - 07:37 PM) naoinvaoèvpodlnvvrovnovnondpppppppppmvdgdvjomvmvpe
@  Melosx : (23 May 2012 - 07:36 PM) che coa che robaé
@  Abadon : (23 May 2012 - 07:34 PM) dopo che il forum è andato fuori servizio si è persa un po' la chat D:
@  NoosiTD : (23 May 2012 - 07:28 PM) Ma c'è nessuno?
@  NoosiTD : (23 May 2012 - 07:25 PM) ma qua rispondono tutti qìcon un ora di distanza xDD
@  Melosx : (23 May 2012 - 07:23 PM) connessione permettendo
@  Melosx : (23 May 2012 - 07:23 PM) ok arrivo
@  NoosiTD : (23 May 2012 - 07:21 PM) gente sono vivo!
@  Abadon : (23 May 2012 - 07:17 PM) mel vieni su msn u.u
@  Melosx : (23 May 2012 - 06:12 PM) @Saul ti ho risposto!
@  Melosx : (23 May 2012 - 06:12 PM) Buonasera a tutti...^.^
@  Saul : (23 May 2012 - 05:16 PM) Tu sei uno dei tanti
@  Night : (23 May 2012 - 04:53 PM) ma quale nuovo utente? parli di me?

Gestione Party


  • Per cortesia connettiti per rispondere
5 risposte a questa discussione

#1 OFFLINE   Ally

Ally

    Fondatori

  • Amministratori
  • 5558 Messaggi:
  • Localitàrpgmkr
  • Ruolo:
    Scripter
  • Progetto VX:
    Essence
  • Tool:
    RM2k/2k3

Inviato 17 August 2011 - 11:38 PM

Nome Script: Gestione Party
Versione: 1.11
Autore/i: Sky00Valentine, Yanfly, OriginalWij

Informazioni:
Come da titolo, uno script per la gestione del Party.

Screenshots:
Spoiler

Istruzioni:
Inserite lo script sotto material.

Script:
#===========================================================================
#
# Sky Script Revolution : Party Manager (SSR) (SSR/PM)
# Version 1.11
# January 20, 2011 Started
# January 22, 2011 Completed
# August 17, 2011 Last Update
#
#===========================================================================
#
# What is Sky Script Revolution (SSR)?
#    It is a revamp of Sky's previous scripts.
# Is that all?
#    No, that is only the beginning. Look for
#    New Scripts as well. Also look forward to
#    the reopenning of script request hall soon.
# What kind of scripts are you planning?
#    I am starting to get into battle system
#    scripting so look for edits.
# Are you supporting old scripts?
#    Some scripts don't need revamping as they
#    work beautifully, so I will update those
#    scripts.
#
#===========================================================================
#
# Features :
#    Version 1.0 - January 22, 2011
#       - Swapping of members available
#       - Searching for party members
#          * Name
#          * Level
#          * Class
#       - Shows Primary Stats and equips
#    Version 1.1 - February 4, 2011
#       - Made Script Independat Compatible
#          * now work with Input Script
#          * still requires SAATW
#       - Sorting Feature Update
#          * now can set which of the 3 sorting features is allowed.
#    Version 1.11 - August 17, 2011
#       - Fix to enable overworld sprite changing after management
#       - Fix to have 4 battlers as long as there are 4 members in whole
#         party.
# 
#===========================================================================
#
# Credit
# Sky00Valentine :creator and editor
#         Yanfly :Game_Party Class to add extra members & switch members.
#                 (I could try changing it but its basically the same so
#                  Yanfly thanks) Also for Input script.
#    OriginalWij :For Input script.
#
#===========================================================================
#
# Terms of Use
# ------------
#
#     Crediting Rpgmakervx.net is the only thing I ask.
#     However feel free to credit Sky00Valentine if you
#     see fit.
#
#===========================================================================
#
# Future improvement
# ------------------
#   
#    - Unknown
#  
#===========================================================================
#
# Instructions & Installation
# ---------------------------
# - Edit modules
# 
# - Get my SAATW edit
# 
# - Get Yanfly and OriginalWij's Keyboard Input Script 
#   and place it before this script (if you want the sorting feature)
#
# - Edit Game_Party's MAX_MEMBERS to be 2, 3, or 4.
#
# - Script commands:
#    (Goes to Party Menu.)
#     -------------------
#      $scene = Scene_Party.new 
#
#    (Locks actor into battle party or reserve even before they party.)
#     ---------------------------------------------------------------
#      $game_actors[id].lock = true 
#      $game_party.all_members[a].lock = true
#      (locks party member in posistion a to where they are
#                 party or reserve.)
#                                 
#
# - You can search through your reserves by typing on the keyboard
#   when the reserve is active.
#   (This is setup for the default Yanfly Input so let me know if 
#    you changed anything and now face problems)
#
# - During your search the TAB key can change sorting method. (sorting only)
#
# - Have Fun
#
#===========================================================================

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

module Sky
  module Party
    RETURN = "Scene_Map.new"    #Change to the returning scene
    WEAPON_ICON = 1           #Icon Number for Weapon Icon
    SHIELD_ICON = 52          #Icon Number for Shield Icon
    HELMET_ICON = 32          #Icon Number for Helmet Icon
    ARMOR_ICON = 44           #Icon Number for Armor Icon
    ACCESSORIES_ICON = 56     #Icon Number for Accessories Icon
    SWITCH_SPRITE = true      #when set to true changes sprite on map to first
                              #member of party's sprite.
    KEY = 'Z'                 #what is your Input::C (by default it is the Z key)
                              #          (note this doesn't change it)
    SEARCH_ON = true          #if this switch is set to false the search feature)
                              #will not work altogether.
    NAME = false              #these next 3 switches handle the sorting type
    CLASS = false             #set any of them to off to not allow that type of
    LEVEL = false             #sorting.

    unless NAME or CLASS or LEVEL
      SEARCH_ON = false
    end
  end
end

class Game_Party < Game_Unit # credit to Yanfly for almost everything following

  #--------------------------------------------------------------------------
  # constants
  #--------------------------------------------------------------------------
  TOTAL_MEMBERS = 99
  MAX_MEMBERS = 4

  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :actors
  attr_accessor :battlers

  #--------------------------------------------------------------------------
  # alias method: members
  #--------------------------------------------------------------------------
  alias members_pss members unless $@
  def members
    if not $scene.is_a?(Scene_Party)
      return battle_members
    else
      result = []
      for member in battle_members
        result.push(member)
      end
      for member in all_members
        result.push(member) unless result.include?(member)
      end
      return result
    end
  end

  def party_members
    result = []
    for member in battle_members
      result.push(member)
    end
    for member in all_members
      result.push(member) unless result.include?(member)
    end
    return result
  end

  #--------------------------------------------------------------------------
  # new method: all_members
  #--------------------------------------------------------------------------
  def all_members; return members_pss.uniq; end

  #--------------------------------------------------------------------------
  # new method: battle_members
  #--------------------------------------------------------------------------
  def battle_members
    if @battlers == nil
      @battlers = [0, 0, 0, 0]
      for i in 0..([@actors.size, MAX_MEMBERS].min - 1)
        @battlers[i] = @actors[i]
      end
    end
    result = []
    for id in @battlers
      result.push($game_actors[id]) unless $game_actors[id] == nil
    end
    return result
  end

  def battle_party_size
    return MAX_MEMBERS
  end

  def add_actor(actor_id)
    if @actors.size < TOTAL_MEMBERS and not @actors.include?(actor_id)
      @actors.push(actor_id)
      $game_player.refresh
    end
  end

  #--------------------------------------------------------------------------
  # new method: set_battlers
  #--------------------------------------------------------------------------
  def set_battlers(n1 = 0, n2 = 0, n3 = 0, n4 = 0)
    battle_members if @battlers == nil
    n1 = @battlers[0] unless @actors.include?(n1)
    n2 = @battlers[1] unless @actors.include?(n2)
    n3 = @battlers[2] unless @actors.include?(n3)
    n4 = @battlers[3] unless @actors.include?(n4)
    @battlers = [n1, n2, n3, n4]
    $game_player.refresh
  end

  #--------------------------------------------------------------------------
  # alias method: add_actor
  #--------------------------------------------------------------------------
  alias add_actor_pss add_actor unless $@
  def add_actor(actor_id)
    last_size = @actors.size
    add_actor_pss(actor_id)
    if last_size < @actors.size
      battle_members if @battlers == nil
      for i in 0..(@battlers.size-1)
        if @battlers[i] == 0
          @battlers[i] = actor_id unless battle_members.size == battle_party_size
          break
        end
      end
    end
  end

  #--------------------------------------------------------------------------
  # alias method: remove_actor
  #--------------------------------------------------------------------------
  alias remove_actor_pss remove_actor unless $@
  def remove_actor(actor_id)
    battle_members if @battlers == nil
    index = -1
    if @battlers.include?(actor_id)
      @battlers[@battlers.index(actor_id)] = 0 
      index = @battlers.index(actor_id)
    end
    remove_actor_pss(actor_id)
    if party_members.size >=4 and index != -1
      @battlers.push(party_members[3].id)
      @battlers.delete(0)
    end
  end

end # Game_Party

class Game_Actor
  attr_accessor :lock

  alias setup_ssr setup
  def setup(actor_id)
    @lock = false
    setup_ssr(actor_id)
  end
end

class Scene_Party < Scene_Base

  def initialize
    unless $game_party.battle_party_size <= 1 or $game_party.battle_party_size > 4
      create_menu_background
      @count = 0
      @reserve = Reserve_Window.new
      @party = Party_Window.new(@reserve.height)
      @stats_1 = Window_Base.new(@party.width,@reserve.height,(Graphics.width - @party.width) / 2,Graphics.height - @reserve.height)
      @stats_2 = Window_Base.new(@stats_1.x+@stats_1.width,@reserve.height,@stats_1.width,@stats_1.height)
      stats_update
      @key = Window_Base.new(100,100,272,56)
      @question = Window_Base.new(102,110,340,56)
      @question.z = 202
      @question.openness = 0
      @answer = Window_Answer.new(0,@reserve.height+@party.height,@stats_1.x,Graphics.height - @reserve.height-@party.height)
      @answer.openness = 0
      @key.z = 201
      @key.opacity = 0
      @key.contents_opacity = 0
      Sky::Party::NAME ? @sort = "Name" : 
      Sky::Party::CLASS ? @sort = "Class" : @sort = "Level"
      @find = ""
      @reserve.index = -1
      @reserve.active = false
      @party.index = 0
    end
  end

  def dispose
    @reserve.dispose
    @party.dispose
    @key.dispose
    @stats_1.dispose
    @stats_2.dispose
    @answer.dispose
    @question.dispose
  end

  def create_menu_background
    @menuback_sprite = Spriteset_Map.new
  end

  def reserve_update
    @reserve.update
    @reserve.ox = ([@reserve.index,0].max / 7) *  7 * (64 + 11)
  end

  def stats_update
    @stats_1.contents.clear
    @stats_2.contents.clear
    @stats_1.contents.font.name = "Calibri"
    @stats_2.contents.font.name = "Calibri"
    width = @stats_1.width - 32
    party_c = $game_party.battle_members[[@party.index,0].max]
    unless party_c == nil
      @stats_1.contents.draw_icon(Sky::Party::WEAPON_ICON, 0, 154, enabled = true)
      @stats_1.contents.draw_icon(Sky::Party::SHIELD_ICON, 0, 176, enabled = true)
      @stats_1.contents.draw_icon(Sky::Party::HELMET_ICON, 0, 198, enabled = true)
      @stats_1.contents.draw_icon(Sky::Party::ARMOR_ICON, 0, 220, enabled = true)
      @stats_1.contents.draw_icon(Sky::Party::ACCESSORIES_ICON, 0, 242, enabled = true)
      @stats_1.contents.draw_text(0,0,width,24,party_c.name,2)
      @stats_1.contents.draw_text(0,22,width,24,"Atk")
      @stats_1.contents.draw_text(0,44,width,24,"Def")
      @stats_1.contents.draw_text(0,66,width,24,"Spi")
      @stats_1.contents.draw_text(0,88,width,24,"Agi")
      @stats_1.contents.draw_text(0,110,width,24,"Eva")
      @stats_1.contents.draw_text(0,132,width,24,"Cri")
      @stats_1.contents.draw_text(0,22,width,24,party_c.atk,2)
      @stats_1.contents.draw_text(0,44,width,24,party_c.def,2)
      @stats_1.contents.draw_text(0,66,width,24,party_c.spi,2)
      @stats_1.contents.draw_text(0,88,width,24,party_c.agi,2)
      @stats_1.contents.draw_text(0,110,width,24,party_c.eva,2)
      @stats_1.contents.draw_text(0,132,width,24,party_c.cri,2)
      for i in 0...party_c.weapons.size
        string = party_c.weapons[i] == nil ? "- Empty -" : party_c.weapons[i].name
        @stats_1.contents.draw_text(0,(22 * (i + 7)),width,24,string,2)
      end
      for i in 0...party_c.armors.size
        string = party_c.armors[i] == nil ? "- Empty -" : party_c.armors[i].name
        @stats_1.contents.draw_text(0,(22 * (i + 7 + party_c.weapons.size)),width,24,string,2) 
      end
    end
    unless @reserve.index < 0
      unless @reserve.char(@reserve.index) == nil
        reserve_c = @reserve.char(@reserve.index) 
        @stats_2.contents.draw_icon(Sky::Party::WEAPON_ICON, 0, 154, enabled = true)
        @stats_2.contents.draw_icon(Sky::Party::SHIELD_ICON, 0, 176, enabled = true)
        @stats_2.contents.draw_icon(Sky::Party::HELMET_ICON, 0, 198, enabled = true)
        @stats_2.contents.draw_icon(Sky::Party::ARMOR_ICON, 0, 220, enabled = true)
        @stats_2.contents.draw_icon(Sky::Party::ACCESSORIES_ICON, 0, 242, enabled = true)
        @stats_2.contents.draw_text(0,0,width,24,reserve_c.name,2)
        @stats_2.contents.draw_text(0,22,width,24,"Atk")
        @stats_2.contents.draw_text(0,44,width,24,"Def")
        @stats_2.contents.draw_text(0,66,width,24,"Spi")
        @stats_2.contents.draw_text(0,88,width,24,"Agi")
        @stats_2.contents.draw_text(0,110,width,24,"Eva")
        @stats_2.contents.draw_text(0,132,width,24,"Cri")
        @stats_2.contents.draw_text(0,22,width,24,reserve_c.atk,2)
        @stats_2.contents.draw_text(0,44,width,24,reserve_c.def,2)
        @stats_2.contents.draw_text(0,66,width,24,reserve_c.spi,2)
        @stats_2.contents.draw_text(0,88,width,24,reserve_c.agi,2)
        @stats_2.contents.draw_text(0,110,width,24,reserve_c.eva,2)
        @stats_2.contents.draw_text(0,132,width,24,reserve_c.cri,2)
        for i in 0...reserve_c.weapons.size
          string = reserve_c.weapons[i] == nil ? "- Empty -" : reserve_c.weapons[i].name
          @stats_2.contents.draw_text(0,(22 * (i + 7)),width,24,string,2)
        end
        for i in 0...reserve_c.armors.size
          string = reserve_c.armors[i] == nil ? "- Empty -" : reserve_c.armors[i].name
          @stats_2.contents.draw_text(0,(22 * (i + 7 + reserve_c.weapons.size)),width,24,string,2) 
        end
      end
    end
  end

  def update_key
    @key.contents.clear
    @key.contents_opacity = 255 unless @party.active
    @key.opacity = 255 unless @party.active
    @key.contents.draw_wrap_text(0,0,Graphics.width - 32,24,@sort)
    @key.contents.draw_wrap_text(56,0,Graphics.width - 32,24,"|")
    @key.contents.draw_wrap_text(70,0,Graphics.width - 32,24,@find)
    @reserve.key(@find)
    @reserve.sort(@sort)
    @reserve.refresh
    @reserve.index = @reserve.item_max == 0 ? -1 : 0
    stats_update
  end

  def working?
    if $game_party.battle_party_size <= 1
      raise Exception.new("Your MAX_MEMBERS size is too small")
    elsif $game_party.battle_party_size > 4
      raise Exception.new("Your MAX_MEMBERS size is too large")
    end
  end

  def update
    working?
    reserve_update
    @party.update
    @answer.update
    @question.update
    @count += 1 unless @count == 1
    if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN) or Input.trigger?(Input::LEFT) or Input.trigger?(Input::RIGHT)
      stats_update
    end
    if @key.opacity > 0
      @key.opacity -= (255.0/180.0)
      @key.contents_opacity -= (255.0/180.0)
    end
    if @party.active
      if $imported["KeyboardInput"]
        if Input.trigger?(Input::ESC)
          dispose
          Sound.play_cancel
          $scene = eval(Sky::Party::RETURN)
        end
      end
      if Input.trigger?(Input::B )
        dispose
        Sound.play_cancel
        $scene = eval(Sky::Party::RETURN)
      elsif Input.trigger?(Input::C)
        if $game_party.battlers[@party.index] != 0
          unless $game_actors[$game_party.battlers[@party.index]].lock
            @party.active = false
            Sound.play_decision
            @answer.redo(["Switch","Arrange"])
            @answer.index = 0
            @answer.active = true
            @answer.open
          else
            Sound.play_buzzer
          end
        else
          @party.active = false
          Sound.play_decision
          @reserve.active = true
          @reserve.index = 0
        end
      end
    elsif @answer.active
      if @answer.number == 1
        arry = []
        for i in 0...[$game_party.battle_members.size,$game_party.battle_party_size].min
          if i == 0
            arry.push("First")
          elsif i == 1
            arry.push("Second")
          elsif i == 2
            arry.push("Third")
          else
            arry.push("Fourth")
          end
        end
        if $game_party.all_members.size <= $game_party.battle_party_size
          @answer.next
          @answer.p(@party.index)
          @answer.redo(arry)
          @question.contents.clear
          @question.contents.draw_text(0,0,@question.contents.width,24,"Which Location to Switch With?", 1)
          @question.open
        else
          @question.contents.clear
          @question.contents.draw_text(0,0,@question.contents.width,24,"Switch Battlers or Arrange Party?", 1)
          @question.open
        end
        if Input.trigger?(Input::C)
          Sound.play_decision
          if @answer.index == 0
            @reserve.active = true
            @reserve.index = 0
            @answer.index == 0
            @answer.active = false
            @answer.close
            @question.close
            stats_update
          else
            @answer.p(@party.index)
            @answer.redo(arry)
            @answer.next
            @question.contents.clear
            @question.contents.draw_text(0,0,@question.contents.width,24,"Which Location to Switch With?", 1)
            @answer.index = 0
          end
        elsif Input.trigger?(Input::B )
          Sound.play_cancel
          @question.close
          @answer.close
          @party.active = true
        end
      elsif @answer.number == 2
        if Input.trigger?(Input::C)
          unless @answer.index >= $game_party.members.size
            unless @party.index == @answer.index
              Sound.play_decision
              _temp = $game_party.members[@party.index].id
              $game_party.battlers[@party.index] = $game_party.battlers[@answer.index]
              $game_party.battlers[@answer.index] = _temp
              if @party.index == 0 or @answer.index == 0
                $game_player.set_graphic($game_party.members[0].character_name, $game_party.members[0].character_index) if Sky::Party::SWITCH_SPRITE
              end
              @party.refresh
              @answer.prev
              @party.index = 0
              @party.active = true
              stats_update
              @answer.active = false
              @answer.close
              @question.close
            else
              Sound.play_cancel
            end
          end
        elsif Input.trigger?(Input::B )
          @answer.prev
          Sound.play_cancel
          @party.index = 0
          @party.active = true
          @answer.active = false
          @answer.close
          @question.close
        end
      elsif @answer.number == 3
        if Input.trigger?(Input::C)
          if @answer.index == 0
            Sound.play_decision
            if @reserve.char(@reserve.index) == nil 
              unless $game_party.battle_members.size == 1
                $game_party.battlers[@party.index] = 0
                $game_party.battlers.delete_at(@party.index)
                @party.refresh
                $game_party.battlers.compact!
                $game_party.battlers[3] = 0
                @party.index = 0
                @party.refresh
                @reserve.refresh
                @reserve.active = false
                @party.active = true
                @find = ""
                @sort = "Name"
                update_key
                @reserve.index = -1
                @answer.prev
                @answer.prev
                @answer.index = 0
                @answer.active = false
                @answer.close
                @question.close
                stats_update
              else
                Sound.play_cancel
              end
            else
              n = []
              for i in 0...([$game_party.battle_party_size,$game_party.battle_members.size].min)
                n[i] = $game_party.battle_members[i].id
              end
              n[@party.index] = @reserve.char(@reserve.index).id
              $game_party.set_battlers(n[0],n[1],n[2],n[3])
              $game_player.set_graphic($game_party.members[0].character_name, $game_party.members[0].character_index) if Sky::Party::SWITCH_SPRITE
              @party.index = 0
              @party.refresh
              @reserve.refresh
              @reserve.active = false
              @party.active = true
              @find = ""
              @sort = "Name"
              update_key
              @reserve.index = -1
              @key.opacity = 0
              @key.contents_opacity = 0
              @answer.prev
              @answer.prev
              @answer.index = 0
              @answer.active = false
              @answer.close
              @question.close
              stats_update
            end
          else
            Sound.play_cancel
            @answer.prev
            @answer.prev
            @answer.index = 0
            @answer.active = false
            @answer.close
            @question.close
            @reserve.active = true
          end
        elsif Input.trigger?(Input::B )
          Sound.play_cancel
          @answer.prev
          @answer.prev
          @answer.index = 0
          @answer.active = false
          @answer.close
          @question.close
          @reserve.active = true
        end
      end
    elsif @reserve.active
      if $imported["KeyboardInput"] == true and Sky::Party::SEARCH_ON
        if Input.repeat?(Input::BACK)
          unless @find.size == 0
            @temp = @find[0,@find.size-1] 
            @find = @temp
            update_key
          end
        elsif (Input.trigger?(Input::C)) and not (Input.press?(Input::LETTERS[Sky]))
          unless (@reserve.char(@reserve.index) != nil and @reserve.char(@reserve.index).lock) or (@reserve.char(@reserve.index) == nil and $game_party.battlers[@party.index] == 0)
            Sound.play_decision
            @reserve.active = false
            @answer.redo(["Yes","No"])
            @answer.active = true
            @answer.open
            @question.contents.clear
            @question.contents.draw_text(0,0,@question.contents.width,24,"Switch Out?", 1)
            @question.open
            @answer.next
            @answer.next
          else
            Sound.play_cancel
          end
        elsif Input.trigger?(Input::TAB)
          if @sort == "Name"
            Sky::Party::CLASS ? @sort = "Class" : 
            Sky::Party::LEVEL ? @sort = "Level" : @sort = @sort
          elsif @sort == "Class"
            Sky::Party::LEVEL ? @sort = "Level" : 
            Sky::Party::NAME ? @sort = "Name"   : @sort = @sort
          elsif @sort == "Level"
            Sky::Party::NAME ? @sort = "Name" : 
            Sky::Party::CLASS ? @sort = "Class" : @sort = @sort
          end
          @find = ""
          update_key
        elsif Input.typing? and @find.size < 10
          unless @find.size >= 3 and @sort == "Level"
            @find += Input.key_type
            update_key
          end
        elsif Input.trigger?(Input::ESC)
          Sound.play_cancel
          @reserve.active = false
          @party.active = true
          @find = ""
          @sort = "Name"
          update_key
          @reserve.index = -1
          stats_update
          @key.opacity = 0
          @key.contents_opacity = 0
        end
      else
        if Input.trigger?(Input::B )
          Sound.play_cancel
          @reserve.active = false
          @party.active = true
          @find = ""
          @sort = "Name"
          update_key
          @reserve.index = -1
          stats_update
          @key.opacity = 0
          @key.contents_opacity = 0
        elsif Input.trigger?(Input::C)
          unless (@reserve.char(@reserve.index) != nil and @reserve.char(@reserve.index).lock) or (@reserve.char(@reserve.index) == nil and $game_party.battlers[@party.index] == 0)
            Sound.play_decision
            @reserve.active = false
            @answer.redo(["Yes","No"])
            @answer.active = true
            @answer.open
            @question.contents.clear
            @question.contents.draw_text(0,0,@question.contents.width,24,"Switch Out?", 1)
            @question.open
            @answer.next
            @answer.next
          else
            Sound.play_cancel
          end
        end
      end
    end
  end
end

class Reserve_Window < Window_Selectable
  def initialize
    @key = ""
    @sort = "Name"
    @actor = []
    for i in 0...$game_party.all_members.size
      @actor.push($game_party.members[i]) unless $game_party.battle_members.include?($game_party.members[i])
    end
    bitmap = Cache.character($game_party.members[0].character_name)
    sign = $game_party.members[0].character_name[/^[!$]./]
    if sign != nil and sign.include?('$')
      ch = bitmap.height / 4
      @nw = bitmap.width / 3
    else
      ch = bitmap.height / 8
      @nw = bitmap.width / 12
    end
    super(0,0,Graphics.width,ch + 72)
    @item_max = @actor.size
    @column_max = [@item_max,1].max
    refresh
  end

  def refresh
    self.contents.clear
    @actor = []
    if @key != ""
      for i in 0...$game_party.members.size
        unless $game_party.battle_members.include?($game_party.members[i])
          if @sort == "Name"
            @actor.push($game_party.members[i]) if $game_party.members[i].name[0,@key.size].to_s.upcase == @key.upcase
          elsif @sort == "Class"
            @actor.push($game_party.members[i]) if $game_party.members[i].class.name[0,@key.size].to_s.upcase == @key.upcase
          elsif @sort == "Level"
            @actor.push($game_party.members[i]) if $game_party.members[i].level.to_s[0,@key.size].to_s.upcase == @key.upcase
          end
        end
      end
      @actor.push(nil)
    else
      for i in 0...$game_party.all_members.size
        @actor.push($game_party.party_members[i]) unless $game_party.battle_members.include?($game_party.members[i])
      end
      @actor.push(nil)
    end
    @item_max = @actor.size
    self.contents.dispose
    self.contents = Bitmap.new(((@item_max / 7) + 1) * (Graphics.width - 32),self.height - 32)
    for i in 0...@item_max
      draw_item(i)
    end
  end

  def key(string)
    @key = string
  end

  def sort(string)
    @sort = string
  end

  def char(index)
    return @actor[index] unless @actor[index].nil?
    return nil
  end

  def draw_item(index)
    a = index 
    unless @actor[a] == nil
      name = @actor[a].name
      bitmap = Cache.character(@actor[a].character_name)
      sign = @actor[a].character_name[/^[!$]./]
      _class = @actor[a].class.name
      level = @actor[a].level
      @c_index = @actor[a].character_index
      if sign != nil and sign.include?('$')
        @cw = bitmap.width / 3
        @ch = bitmap.height / 4
      else
        @cw = bitmap.width / 12
        @ch = bitmap.height / 8
      end
      rect = item_rect(index)
      self.contents.clear_rect(rect)
      n = @c_index
      src_rect = Rect.new((n%4*3+1)*@cw, (n/4*4)*@ch, @cw, @ch)
      lock = @actor[a].lock ? 128 : 255
      self.contents.font.color.alpha = @actor[a].lock ? 128 : 255
      self.contents.blt(rect.x+3,rect.y+21,bitmap,src_rect,lock)
      self.contents.font.size = 12
      self.contents.draw_text(rect.x+3,rect.y + 0,rect.width,24,name)
      self.contents.draw_text(rect.x,rect.y+18,rect.width-2,24,"Lv.",2)
      self.contents.draw_text(rect.x,rect.y+28,rect.width-2,24,level,2)
      self.contents.draw_text(rect.x,rect.y + @ch + 17,rect.width-3,24,_class,2)
    end
  end

  def item_rect(index)
    rect = Rect.new(0, 0, 0, 0)
    rect.width = @cw != nil ? (@cw + 32) : 0
    rect.height = @ch != nil ? (@ch + 40) : 0
    rect.x = index * (rect.width + 11)
    rect.y = 0
    return rect
  end

  def update_cursor
    if @index < 0
      self.cursor_rect.empty
    else
      row = @index / @column_max
      if row < top_row
        self.top_row = row
      end
      if row > bottom_row
        self.bottom_row = row
      end
      rect = item_rect(@index)
      rect.y -= self.oy
      rect.x -= self.ox
      self.cursor_rect = rect
    end
  end
end

class Party_Window < Window_Selectable
  def initialize(y)
    @actor = $game_party.battle_members
    bitmap = Cache.character($game_party.members[0].character_name)
    sign = $game_party.members[0].character_name[/^[!$]./]
    if sign != nil and sign.include?('$')
      ch = bitmap.height / 4
      @nw = bitmap.width / 3
    else
      ch = bitmap.height / 8
      @nw = bitmap.width / 12
    end
    @item_max = $game_party.battle_party_size
    super(0,y,(@nw * 2) + 64,((ch + 10) + 4) * $game_party.battle_party_size + 32)
    @item_max = $game_party.battle_party_size 
    refresh
  end

  def refresh
    self.contents.clear
    @actor = $game_party.battle_members
    @item_max = [$game_party.battle_party_size,$game_party.all_members.size].min
    for i in 0...@item_max
      draw_item(i)
    end
  end

  def item_rect(index)
    rect = Rect.new(0, 0, 0, 0)
    rect.width = self.width - 32
    rect.height = @ch + 10
    rect.x = 0
    rect.y = (rect.height + 4) * index
    return rect
  end

  def draw_item(index)
    unless index >= $game_party.battle_members.size
      name = @actor[index].name
      bitmap = Cache.character(@actor[index].character_name)
      sign = @actor[index].character_name[/^[!$]./]
      _class = @actor[index].class.name
      level = @actor[index].level
      @c_index = @actor[index].character_index
      if sign != nil and sign.include?('$')
        @cw = bitmap.width / 3
        @ch = bitmap.height / 4
      else
        @cw = bitmap.width / 12
        @ch = bitmap.height / 8
      end
      rect = item_rect(index)
      self.contents.clear_rect(rect)
      n = @c_index
      src_rect = Rect.new((n%4*3+1)*@cw, (n/4*4)*@ch, @cw, @ch)
      self.contents.blt(rect.x + 2,rect.y + 5,bitmap,src_rect)
      self.contents.font.size = 12
      self.contents.draw_text(rect.x,rect.y + 2,rect.width-4,14,name,2)
      self.contents.draw_text(rect.x,rect.y + 14,rect.width-4,14,_class,2)
      self.contents.draw_text(rect.x,rect.y + 26,rect.width-4,14,"LV" + level.to_s,2)
    end
  end
end

class Window_Answer < Window_Selectable
  WLH = 18
  def initialize(x,y,width,height)
    super(x,y,width,height)
    @text = ['1','2','3','4']
    @question_number = 1
    @item_max = @text.size
    self.active = false
    @p = -1
    refresh
  end

  def page_row_max
    return 4
  end

  def redo(array)
    self.contents.font.name = "Calibri"
    @text = []
    @text = array
    @item_max = @text.size
    if @item_max == 4
      self.contents.font.size = 13
    elsif @item_max == 3
      self.contents.font.size = 14
    else
      self.contents.font.size = 16
    end
    refresh
  end

  def p(index)
    @p = index
  end

  def number
    return @question_number
  end

  def next
    @question_number += 1
  end

  def prev
    @question_number -= 1
  end

  def refresh
    self.contents.clear
    for i in 0...@item_max
      rect = item_rect(i)
      size = @item_max == 4 ? 4 :
      @item_max == 3 ? 1 : (-2)
      self.contents.font.color = normal_color
      self.contents.font.color.alpha = i == @p ? 128 : 255
      self.contents.draw_text(rect.x,rect.y-size,rect.width,24,@text[i],1)
      @p = -1 if i == @p
    end
  end

  def item_rect(index)
    rect = Rect.new(0, 0, 0, 0)
    rect.width = contents.width
    rect.height = (self.height - 32) / @item_max
    rect.x = 0
    rect.y = (self.height - 32) / @item_max  * index
    return rect
  end
end

module Input  
  TAB = 9
  module_function 

  if $imported["KeyboardInput"]
    def press?(key)
      return ow_dt_i_press(key) if key < 30 and not key == 9
      adjusted_key = adjust_key(key)
      return true unless KeyRepeatCounter[adjusted_key].nil?
      return key_pressed?(adjusted_key)
    end

    def trigger?(key)
      return ow_dt_i_trigger(key) if key < 30 and not key == 9
      adjusted_key = adjust_key(key)
      count = KeyRepeatCounter[adjusted_key]
      return ((count == 0) or (count.nil? ? key_pressed?(adjusted_key) : false))
    end

    def repeat?(key)
      return ow_dt_i_repeat(key) if key < 30 and not key == 9
      adjusted_key = adjust_key(key)
      count = KeyRepeatCounter[adjusted_key]
      return true if count == 0
      if count.nil?
        return key_pressed?(adjusted_key)
      else
        return (count >= 23 and (count - 23) % 6 == 0)
      end
    end
  end
end

Immagine inserita
Spoiler

#2 OFFLINE   Edenspring

Edenspring

    RM Avanzato

  • Utenti RM
  • StellettaStellettaStelletta
  • 35 Messaggi:
  • Progetto VX:
    CountdownToCasualty

Inviato 08 February 2012 - 11:55 PM

Volevo sapere se è possibile aggiungere un comando nel menù e se sì, come farlo. Ringrazio in anticipo

#3 OFFLINE   Ally

Ally

    Fondatori

  • Amministratori
  • 5558 Messaggi:
  • Localitàrpgmkr
  • Ruolo:
    Scripter
  • Progetto VX:
    Essence
  • Tool:
    RM2k/2k3

Inviato 09 February 2012 - 01:18 AM

Edenspring, dice:

Volevo sapere se è possibile aggiungere un comando nel menù e se sì, come farlo. Ringrazio in anticipo
Utilizzi il menù di default?
Immagine inserita
Spoiler

#4 OFFLINE   Juunanagou

Juunanagou

    Recensori

  • Recensori
  • 553 Messaggi:
  • Progetto XP:
    Vampire Chronicle
  • Tool:
    Rpg Maker XP

Inviato 09 February 2012 - 11:17 AM

Ho aggiustato il menù per aggiungerti il comando, solo non riesco a testarlo, non trova il metodo draw item e non capisco quale sia il problema °°"
14° screen contest:Immagine inseritaSe vi serve un mapper nel team sentitevi liberi di contattarmi, trovate alcune mie mappe nel mio shop.

#5 OFFLINE   Edenspring

Edenspring

    RM Avanzato

  • Utenti RM
  • StellettaStellettaStelletta
  • 35 Messaggi:
  • Progetto VX:
    CountdownToCasualty

Inviato 15 February 2012 - 06:13 PM

Sì, utilizzo il menu di default.

#6 OFFLINE   Ally

Ally

    Fondatori

  • Amministratori
  • 5558 Messaggi:
  • Localitàrpgmkr
  • Ruolo:
    Scripter
  • Progetto VX:
    Essence
  • Tool:
    RM2k/2k3

Inviato 19 February 2012 - 05:50 PM

Ti posto lo script del menù modificato appena sono a casa ^^
Immagine inserita
Spoiler




1 utente(i) stanno leggendo questa discussione

0 utenti, 1 ospiti, 0 utenti anonimi