Make & Graph
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
-36%
Le deal à ne pas rater :
Aspirateur balai sans fil Dyson V8 Origin
254.99 € 399.01 €
Voir le deal

Vous n'êtes pas connecté. Connectez-vous ou enregistrez-vous

Amélioration d'armes

Aller en bas  Message [Page 1 sur 1]

1RPG Maker XP Amélioration d'armes Dim 19 Oct - 17:13

Zack Fair

Zack Fair
Membre Actif
Membre Actif

Auteur : Charlie Lee

Description + explication :

Avec ce script , vous pouvez améliorer vos armes , en leurs donnant des
attributs (Feu , Glace ...)
Vous pouvez aussi leurs ajouter des stats a infliger (Poison , Someille)
Et enfin , vous vouvez augmanter les charactéristiques de l'arme , comme
l'Attaque , mais aussi la Force , Dexterité .... tout !

Explications :
Créez tout dabord , des attributs dans la base de données , avec les noms
indiquées dans le script :"Enhanced Weapons"
Ensuite , cohez l'arme que vous voulez qu'elle soit améliorée avec des éléments
avec l'attribut : "Arme Améliorable".
Ensuite , crée un élément qui sera l'Amélioration de l'arme .
Si vous voulez qu'il soit fixe (non retirable aprés avoir été placé sur l'arme)
cochez le avec l'attribut :"Amélioration FIXE" sinon , laissez le comme ça.
Si vous voulez qu'il soit spécialement appliqué a un TYPE d'armes :
TYPE Sword
TYPE Axe
TYPE Lance

Donc , il va étre dédié que pour ce type d'armes , cochez le avec l'un d'entre eux
Il peut étre coché avec tout les types.

Vers la fin , ajouter les charactéristiques a cette amélioration , comme pour toutes les
armes . Sachez que les valeurs vont étre ajoutées avec celles de l'arme améliorable.
Vous pouvez ajouter des attributs a cette amélioration comme Feu et tout.

Voila , c'est tout pour les éxplications .
Oh , enfait , pour appeler la Scene :
Inserer un event , et collez ce code dedans (via la commande : Insérer un script)
$scene=Scene_Enhance.new()

En cas de problémes , je suis la .
Bon forum a tous.

Voila les scripts

http://www.google.com

2RPG Maker XP Re: Amélioration d'armes Dim 19 Oct - 17:13

Zack Fair

Zack Fair
Membre Actif
Membre Actif

Code:
#==============================================================================
# ** ENHANCED WEAPONS ver. 0.5                     
#------------------------------------------------------------------------------
# Auteur: Charlie Lee
# Traduction : Aminedbz
#  18 / 10 / 2008
#==============================================================================


#==============================================================================
# CONFIGURATION
#==============================================================================

# Si "true" , vous pouvez améliorer les armes avec des éléments  NON TYPE , (TYPE EPEE par exemple)
ALLOW_UNSPECIFIED_TYPE=false

#Créez des attributs dans la base de données , avec les noms suivants :

# Nom dans la base de données de l'arme améliorable
  EW_NAME = "Arme améliorable"
# Nom de l'élément : Amélioration
  EN_NAME = "Amélioration"
# Nom de l'amélioration fixe
  FIXED_EN_NAME = "Amélioration FIXE"
 
# Eléments qui donne les SLOTS aux équipements : (numéro = numéro des slots que peut posséder
#l'arme)

  ONE_SLOT_NAME = "1"
  TWO_SLOTS_NAME = "2"
  THREE_SLOTS_NAME = "3"
  FOUR_SLOTS_NAME = "4"
  FIVE_SLOTS_NAME = "5"

  DEBUG_EW = false # Ne touchez pas car vous risquez d'endomager le script.
  # A laisser false
 
  # Patch pour  GUILLAUME777's Multi-Slot script (Si vous envisagez l'utiliser , avec se script mettez "true")
  MULTI_SLOT_PATCH = false

 
#==============================================================================
# ENHANCED WEAPONS
#------------------------------------------------------------------------------
 
 
  $data_system = load_data("Data/System.rxdata")
  $ew_element_id = $data_system.elements.index(EW_NAME)
  $enhancement_element_id = $data_system.elements.index(EN_NAME)
  $fixed_enhancement_element_id = $data_system.elements.index(FIXED_EN_NAME)
  $one_slot_element_id = $data_system.elements.index(ONE_SLOT_NAME)
  $two_slots_element_id = $data_system.elements.index(TWO_SLOTS_NAME)
  $three_slots_element_id = $data_system.elements.index(THREE_SLOTS_NAME)
  $four_slots_element_id = $data_system.elements.index(FOUR_SLOTS_NAME)
  $five_slots_element_id = $data_system.elements.index(FIVE_SLOTS_NAME)
 
  $type_elements=[]
  $data_system.elements.each_index do |index| $type_elements.push(index) if ($data_system.elements[index]!=nil and $data_system.elements[index][0,4]=="TYPE") end
 
class Enhanced_Weapon < RPG::Weapon
  attr_accessor  :accessories
  attr_accessor  :slots
  attr_reader    :ref_id
  def initialize(ref_id)
    @ref_id=ref_id
    @id = $game_party.max_used_weapon_id + 1
    # print("creazione nuova arma\nref_id=" + @ref_id.to_s + "\nid=" + @id.to_s)
    $game_party.max_used_weapon_id += 1
    if DEBUG_EW
      @name = $data_weapons[@ref_id].name + " #" + @id.to_s
    else
      @name = $data_weapons[@ref_id].name
    end
    @icon_name = $data_weapons[@ref_id].icon_name
    @description = $data_weapons[@ref_id].description
    @animation1_id = $data_weapons[@ref_id].animation1_id
    @animation2_id = $data_weapons[@ref_id].animation2_id
    @price = $data_weapons[@ref_id].price
    @atk = $data_weapons[@ref_id].atk
    @pdef = $data_weapons[@ref_id].pdef
    @mdef = $data_weapons[@ref_id].mdef
    @str_plus = $data_weapons[@ref_id].str_plus
    @dex_plus = $data_weapons[@ref_id].dex_plus
    @agi_plus = $data_weapons[@ref_id].agi_plus
    @int_plus = $data_weapons[@ref_id].int_plus
    @element_set = $data_weapons[@ref_id].element_set
    @plus_state_set = $data_weapons[@ref_id].plus_state_set
    @minus_state_set = $data_weapons[@ref_id].minus_state_set
    if $data_weapons[ref_id].element_set.include?($one_slot_element_id)
      @slots=1
    end
    if $data_weapons[ref_id].element_set.include?($two_slots_element_id)
      @slots=2
    end
    if $data_weapons[ref_id].element_set.include?($three_slots_element_id)
      @slots=3
    end
    if $data_weapons[ref_id].element_set.include?($four_slots_element_id)
      @slots=4
    end
    if $data_weapons[ref_id].element_set.include?($five_slots_element_id)
      @slots=5
    end
    @accessories={}
    for i in 0...@slots
      @accessories[i] = nil
    end
  end
 
  #============================================================================
  # Statistics
  #============================================================================
  def dex_plus
    result=@dex_plus
    for a in 0...@accessories.size
      result += @accessories[a]!=nil ? @accessories[a].dex_plus : 0
    end
    return result
  end
 
  def str_plus
    result=@str_plus
    for a in 0...@accessories.size
      result += @accessories[a]!=nil ? @accessories[a].str_plus : 0
    end
    return result
  end
 
  def agi_plus
    result=@agi_plus
    for a in 0...@accessories.size
      result += @accessories[a]!=nil ? @accessories[a].agi_plus : 0
    end
    return result
  end
 
  def int_plus
    result=@int_plus
    for a in 0...@accessories.size
      result += @accessories[a]!=nil ? @accessories[a].int_plus : 0
    end
    return result
  end
 
  def atk
    result=@atk
    for a in 0...@accessories.size
      result += @accessories[a]!=nil ? @accessories[a].atk : 0
    end
    return result
  end

  def pdef
    result=@pdef
    for a in 0...@accessories.size
      result += @accessories[a]!=nil ? @accessories[a].pdef : 0
    end
    return result
  end

  def mdef
    result=@mdef
    for a in 0...@accessories.size
      result += @accessories[a]!=nil ? @accessories[a].mdef : 0
    end
    return result
  end

  def element_set
    result=@element_set
    for a in 0...@accessories.size
      if @accessories[a]!=nil
        for e in @accessories[a].element_set
          # cannot add the enhancement element nor the type elements
          if e!=$enhancement_element_id and not $type_elements.include?(e)
            result.push(e) unless result.include?(e)
          end
        end
      end
    end
    return result
  end

  def plus_state_set
    result=@plus_state_set
    for a in 0...@accessories.size
      if @accessories[a]!=nil
        for e in @accessories[a].plus_state_set
          result.push(e) unless result.include?(e)
        end
      end
    end
    return result
  end

  def minus_state_set
    result=@minus_state_set
    for a in 0...@accessories.size
      if @accessories[a]!=nil
        for e in @accessories[a].minus_state_set
          result.push(e) unless result.include?(e)
        end
      end
    end
    return result
  end
 
  #============================================================================
  # Adding/Removing accessories
  #============================================================================
  def add_accessory(pos,accessory)
    result=@accessories[pos]
    @accessories[pos]=accessory
    # update data weapons
    $data_weapons[id]=self
    return result
  end
   
  def remove_accessory(pos)
    result=@accessories[pos]
    @accessories[pos]=nil
    # update data weapons
    $data_weapons[id]=self
    return result
  end
end


#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  This class handles the party. It includes information on amount of gold
#  and items. Refer to "$game_party" for the instance of this class.
#==============================================================================

class Game_Party
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor  :max_used_weapon_id                # max_used_weapon_id
  attr_accessor  :max_database_weapon_id            # max_database_weapon_id
  attr_accessor  :enhanced_weapons                  # enhanced_weapons
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias ew_initialize initialize
  def initialize
    # original call
    ew_initialize
    @max_used_weapon_id=$data_weapons.length-1
    @max_database_weapon_id=$data_weapons.length-1
    @enhanced_weapons = []
  end
  #--------------------------------------------------------------------------
  # * Gain Weapons (or lose)
  #    weapon_id : weapon ID
  #    n        : quantity
  #--------------------------------------------------------------------------
  alias ew_gain_weapon gain_weapon
  def gain_weapon(weapon_id, n)
    #print("gain weapon("+weapon_id.to_s+","+n.to_s+")")
    # arma e non nessun arma
    if weapon_id > 0
      # l'arma appartiene al database
      if weapon_id < @max_database_weapon_id + 1
        # l'arma è di tipo enhanceable
        if $data_weapons[weapon_id].element_set.include?($ew_element_id)
          if n>0
            for i in 1..n
              new_weapon=Enhanced_Weapon.new(weapon_id)
              @enhanced_weapons[new_weapon.id]=new_weapon
              $data_weapons[new_weapon.id]=new_weapon
              @weapons[new_weapon.id] = 1
              # Patch for GUILLAUME777's Multi-Slot
              if MULTI_SLOT_PATCH
                RPG.initialized_item_types=false
                RPG.set_new_item_types
              end
            end
            return
          else
            # print("non si può togliere un'arma enhanced perchè non se ne entra mai in possesso")
            return
          end
        end
      # l'arma è di tipo enhanced
      else
        @weapons[weapon_id] = [[weapon_number(weapon_id) + n, 0].max, 99].min
        return
      end
    end
    ew_gain_weapon(weapon_id, n)
  end
 
  def set_weapons(id, number)
    @weapons[id]=number
  end
end

#==============================================================================
# ** Window_EquipItem
#------------------------------------------------------------------------------
#  This window displays choices when opting to change equipment on the
#  equipment screen.
#==============================================================================

class Window_EquipItem < Window_Selectable

  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # Add equippable weapons
    if @equip_type == 0
      weapon_set = $data_classes[@actor.class_id].weapon_set
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
          @data.push($data_weapons[i])
        end
        # CHARLIE: add new weapons which cannot be part of the weapon set
        if i > $game_party.max_database_weapon_id
          if $game_party.weapon_number(i) > 0 and weapon_set.include?($data_weapons[i].ref_id)
            @data.push($data_weapons[i])
          end
        end
      end
    end
    # Add equippable armor
    if @equip_type != 0
      armor_set = $data_classes[@actor.class_id].armor_set
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0 and armor_set.include?(i)
          if $data_armors[i].kind == @equip_type-1
            @data.push($data_armors[i])
          end
        end
      end
    end
    # Add blank page
    @data.push(nil)
    # Make a bit map and draw all items
    @item_max = @data.size
    self.contents = Bitmap.new(width - 32, row_max * 32)
    for i in 0...@item_max-1
      draw_item(i)
    end
  end
end


#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
#  This class performs load screen processing.
#==============================================================================

class Scene_Load < Scene_File

  #--------------------------------------------------------------------------
  # * Read Save Data
  #    file : file object for reading (opened)
  #--------------------------------------------------------------------------
  alias ew_read_save_data read_save_data
  def read_save_data(file)
    # original call
    ew_read_save_data(file)
    # update $data_weapons
    for ew in $game_party.enhanced_weapons
      if ew!=nil
        $data_weapons[ew.id]=ew
      end
    end
    # Patch for GUILLAUME777's Multi-Slot
    if MULTI_SLOT_PATCH
      RPG.initialized_item_types=false
      RPG.set_new_item_types
    end
  end
end



#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  alias ew_initialize initialize
  def initialize(actor_id)
    @forced_weapon_id=0
    # original call
    ew_initialize(actor_id)
  end
 
 
  def force_weapon_id(new_id)
    # print("forced weapon change")
    @forced_weapon_id=new_id
    @weapon_id=new_id
  end
 
 
  alias ew_setup setup
  def setup(actor_id)
    # original call
    ew_setup(actor_id)
    if @forced_weapon_id>0
      # print("weapon restore")
      @weapon_id=@forced_weapon_id
    end
  end
end

 
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
#  This class performs title screen processing.
#==============================================================================

class Scene_Title
  #--------------------------------------------------------------------------
  # * Command: New Game
  #--------------------------------------------------------------------------
  alias ew_command_new_game command_new_game
  def command_new_game
    # original call
    ew_command_new_game
    # Support for default weapons
    for i in 0...999
      actor = $game_actors[i]
      if actor!=nil
        if actor.weapon_id > 0 and $data_weapons[actor.weapon_id].element_set.include?($ew_element_id)
          new_weapon=Enhanced_Weapon.new(actor.weapon_id)
          $game_party.enhanced_weapons[new_weapon.id]=new_weapon
          $data_weapons[new_weapon.id]=new_weapon
          $game_party.set_weapons(new_weapon.id,0) # this weapon is already equipped         
          actor.force_weapon_id(new_weapon.id)
          # print(actor.weapon_id.to_s)
        end
      end
    end   
    # Patch for GUILLAUME777's Multi-Slot
    if MULTI_SLOT_PATCH
      RPG.initialized_item_types=false
      RPG.set_new_item_types
    end
  end
end

http://www.google.com

3RPG Maker XP Re: Amélioration d'armes Dim 19 Oct - 17:17

Zack Fair

Zack Fair
Membre Actif
Membre Actif

2 : Window
Code:
#==============================================================================
# ** Window_EnhanceSlots_Help
#------------------------------------------------------------------------------
#  This window displays choices when opting to change slots on the
#  enhancement screen.
#==============================================================================

class Window_EnhanceSlots_Help < Window_Base
  attr_accessor :weapon
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize()
#    super(0, 0, 640, 64)
    super(640-160-32, 0, 160+32, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.z=255
    self.back_opacity=0
    self.opacity=0
    self.contents_opacity=255
    @weapon=nil
    @old_weapon=nil
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh()
    self.contents.clear
    if @weapon.is_a?(Enhanced_Weapon)
      @data = []
      for j in 0...$data_weapons[@weapon.id].slots
        # put accessory
        @data.push($data_weapons[@weapon.id].accessories[j])
      end
      for i in 0...$data_weapons[@weapon.id].slots
        tag=Tag.new(i*32,0,28,28,self.contents,"Menu_Face_00")
        tag.refresh
      end
      for i in 0...$data_weapons[@weapon.id].slots
        if @data[i]!=nil
          draw_item(i)
        end
      end
    else
#      self.contents.draw_text(0,0,width-32,32,"No information available")
    end
    @old_weapon=@weapon
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def update()
    if @old_weapon != @weapon
      refresh
    end
  end
 
 
  #--------------------------------------------------------------------------
  # * Draw Item
  #    index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    x = index * 32 + 4
    y = 0
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  end
end

#==============================================================================
# ** Scene_Equip
#------------------------------------------------------------------------------
#  This class performs equipment screen processing.
#==============================================================================

class Scene_Equip
  alias ew_main main
  def main
    @enhance_slots_help_window=Window_EnhanceSlots_Help.new
    # original call
    ew_main
    @enhance_slots_help_window.dispose
  end
 
  alias ew_update update
  def update
    # original call
    ew_update
    @enhance_slots_help_window.weapon=(@right_window.active)?(@right_window.item):(@item_window.item)
    @enhance_slots_help_window.update
    if Input.trigger?(Input::A)
      @enhance_slots_help_window.visible = !@enhance_slots_help_window.visible
    end
  end
end

http://www.google.com

4RPG Maker XP Re: Amélioration d'armes Dim 19 Oct - 17:17

Zack Fair

Zack Fair
Membre Actif
Membre Actif

3 : Scene Partie 1
Code:
#==============================================================================
# ** Scene_Enhance
#------------------------------------------------------------------------------
#  This class performs equipment enhancement processing.
#==============================================================================

FORCE_UPDATE=true

class Scene_Enhance
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize()
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make windows
    @help_window = Window_Help.new()
    @weapons_window = Window_Weapons.new()
    @slots_window = Window_EnhanceSlots.new()
    @enhancements_window = Window_Enhancements.new()
    @weapon_info_window = Window_WeaponInfo.new()
    @enhancement_info_window = Window_EnhancementInfo.new()
    @confirm_window=nil
    @ok_window=nil
   
    # Associate help and info window
    @weapons_window.help_window = @help_window
    @weapons_window.info_window = @weapon_info_window
    @enhancements_window.info_window = @enhancement_info_window
    @slots_window.info_window = @enhancement_info_window
    refresh
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @help_window.dispose
    @weapons_window.dispose
    @slots_window.dispose
    @enhancements_window.dispose
    @weapon_info_window.dispose
    @enhancement_info_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    # If weapon window is active update weapon information
    if @weapons_window.active
      @weapons_window.update_info
    end
    # If slots window is active
    if @slots_window.active
      # Update info for the enhancement in the current slot
      @slots_window.update_info
      # Erase parameters for after enhancement change
      @weapon_info_window.set_new_parameters(nil, nil, nil)
    end
    # If enhancements window is active
    if @enhancements_window.active
      # Update info for the currently selected enhancement
      @enhancements_window.update_info
      # Get currently selected enhancement
      en2 = @enhancements_window.item
      # Change enhancement
      # Get parameters for after enhancement change
      # Return enhancement
      # Draw in weapon_info window
      @weapon_info_window.set_new_parameters(nil,nil,nil)
    end
    # If confirm window is active
    if @confirm_window!= nil and @confirm_window.active
      @confirm_window.refresh
    end
    # If ok window is active
    if @ok_window!= nil and @ok_window.active
      @ok_window.refresh
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @weapons_window.update
    @slots_window.update
    @enhancements_window.update
    @confirm_window.update unless @confirm_window==nil
    refresh
   
    # If weapons_window is active
    if @weapons_window.active
      @slots_window.set_top_row(@weapons_window.get_top_row())
      update_weapons
      return
    end
    # If slots_window is active
    if @slots_window.active
      update_slots
      return
    end
    # If enhancements_window is active
    if @enhancements_window.active
      update_enhancements
      return
    end
    # If confirm_window is active
    if @confirm_window!=nil and @confirm_window.active
      update_confirm
      return
    end
    # If ok_window is active
    if @ok_window!=nil and @ok_window.active
      update_ok
      return
    end
   
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(2)
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when weapons_window is active)
  #--------------------------------------------------------------------------
  def update_weapons
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(2)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Activate slots window
      @weapons_window.active = false
      # Show only compatible enhancement for the selected weapon, disable others
      @enhancements_window.selected_weapon=@weapons_window.item
      @enhancements_window.refresh
      @slots_window.active = true
      @slots_window.index=5*@weapons_window.index
      @slots_window.limit=$game_party.enhanced_weapons[@weapons_window.item.id].slots
      return
    end
    # Show only compatible enhancement for the selected weapon, disable others
    if @old_weapon != @weapons_window.item
      @old_weapon == @weapons_window.item
      @enhancements_window.selected_weapon=@weapons_window.item
      @enhancements_window.refresh
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when slots_window is active)
  #--------------------------------------------------------------------------
  def update_slots
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Activate weapons window
      @weapons_window.active=true
      @slots_window.active=false
      @slots_window.index=-1
      @slots_window.update_info(FORCE_UPDATE)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      if (@slots_window.item!=nil and @slots_window.item.element_set.include?($fixed_enhancement_element_id))
        # Play cancel SE
        $game_system.se_play($data_system.cancel_se)
        @slots_window.active = false
        @ok_window=Window_Ok.new
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Activate enhancements window
      @slots_window.active = false
      @enhancements_window.active = true
      @enhancements_window.index = 0
      @enhancements_window.update_info(FORCE_UPDATE)
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when enhancement window is active)
  #--------------------------------------------------------------------------
  def update_enhancements
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Activate slots window
      @slots_window.active = true
      @enhancements_window.active = false
      @enhancements_window.index = -1
      @slots_window.update_info(FORCE_UPDATE)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Get currently selected data on the enhancements_window
      en = @enhancements_window.item
      # Do nothing if item is disabled
      if @enhancements_window.item_disabled?
        # Play cancel SE
        $game_system.se_play($data_system.cancel_se)
        return
      end
      # Ask confirm if enhancement is fixed type
      if en!= nil and en.element_set.include?($fixed_enhancement_element_id)
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        @enhancements_window.active = false
        @confirm_window=Window_Confirm.new
        return
      end     
      # Play equip SE
      $game_system.se_play($data_system.equip_se)
      # Change enhancement
      $game_party.lose_weapon(en.id,1)
      en2 = $game_party.enhanced_weapons[@weapons_window.item.id].add_accessory(@slots_window.index%5,en)
      $game_party.gain_weapon(en2 == nil ? 0 : en2.id,1)
      # Activate slots window
      @slots_window.active = true
      @enhancements_window.active = false
      @enhancements_window.index = -1
      # Remake slots window and enhancements window contents
      @slots_window.refresh
      @enhancements_window.refresh
      # Update weapon info
      @weapons_window.update_info(FORCE_UPDATE)
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when confirm window is active)
  #-------------------------------------------------------------------------- 
  def update_confirm
    if Input.trigger?(Input::C)
      if @confirm_window.index==0
        # Play some SE
        $game_system.se_play($data_system.equip_se)
        @confirm_window.dispose
        @confirm_window=nil

        en = @enhancements_window.item
        # Change enhancement
        $game_party.lose_weapon(en.id,1)
        en2 = $game_party.enhanced_weapons[@weapons_window.item.id].add_accessory(@slots_window.index%5,en)
        $game_party.gain_weapon(en2 == nil ? 0 : en2.id,1)
        # Activate slots window
        @slots_window.active = true
        @enhancements_window.active = false
        @enhancements_window.index = -1
        # Remake slots window and enhancements window contents
        @slots_window.refresh
        @enhancements_window.refresh
        # Update weapon info
        @weapons_window.update_info(FORCE_UPDATE)
        return
      else
        # Play cancel SE
        $game_system.se_play($data_system.cancel_se)
        @confirm_window.dispose
        @confirm_window=nil
        @enhancements_window.active = true
        return
      end
    end
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      @confirm_window.dispose
      @confirm_window=nil
      @enhancements_window.active = true
      return
    end
  end

  #--------------------------------------------------------------------------
  # * Frame Update (when ok window is active)
  #-------------------------------------------------------------------------- 
  def update_ok
    if Input.trigger?(Input::C)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      @ok_window.dispose
      @ok_window=nil
      # Activate slots window
      @slots_window.active = true
      return
    end
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      @ok_window.dispose
      @ok_window=nil
      # Activate slots window
      @slots_window.active = true
      return
    end
  end
end

http://www.google.com

5RPG Maker XP Re: Amélioration d'armes Dim 19 Oct - 17:18

Zack Fair

Zack Fair
Membre Actif
Membre Actif

Part 2
Code:
#==============================================================================
# ** Window_Weapons
#------------------------------------------------------------------------------
#  This window displays weapons on the
#  enhancement screen.
#==============================================================================

class Window_Weapons < Window_Selectable
  attr_accessor :info_window
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize()
    super(0, 64, 260, 288)
    @column_max = 1
    self.active = false
    self.index = -1
    @info_window=nil
    refresh
  end
  #--------------------------------------------------------------------------
  # * Item Acquisition
  #--------------------------------------------------------------------------
  def item
    return @data[self.index][0]
  end
  #--------------------------------------------------------------------------
  # * Actor Acquisition
  #--------------------------------------------------------------------------
  def actor
    return @data[self.index][1]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # Add weapons
    for i in $game_party.max_database_weapon_id+1...$data_weapons.size
      if $game_party.weapon_number(i) > 0
        @data.push([$data_weapons[i],nil])
      end
      # weapon is currently equipped
      for a in $game_party.actors
        if a.weapon_id==i
          # Patch for GUILLAUME777's Multi-Slot
          if MULTI_SLOT_PATCH
            # do nothing
          else
            @data.push([$data_weapons[i],a])
          end
        end
        # Patch for GUILLAUME777's Multi-Slot
        if MULTI_SLOT_PATCH
          if a.weapon_ids != nil
            for id in a.weapon_ids
              @data.push([$data_weapons[id],a]) if id==i
            end
          end
        end
      end
    end
    # Make a bit map and draw all items
    @item_max = @data.size
    self.contents = Bitmap.new(width - 32, [row_max * 32,32].max)
    for i in 0...@item_max
      draw_item(i)
    end
    if @item_max>0
      self.active = true
      self.index = 0
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #    index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index][0]
    x = 4
    y = index * 32
    #case item
    #when RPG::Weapon
    #  number = $game_party.weapon_number(item.id)
    #when RPG::Armor
    #  number = $game_party.armor_number(item.id)
    #end
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    #self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
    #self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Help Text Update
  #--------------------------------------------------------------------------
  def update_info(force_update=false)
    if @old_item != self.item or force_update
      @info_window.item=self.item
      @info_window.actor=self.actor
      @info_window.refresh
      @old_item = self.item
    end
    #@info_window.set_text(self.item == nil ? "" : self.item.description)
  end
  #--------------------------------------------------------------------------
  # * Help Text Update
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
 
 
 
  def get_top_row()
    return self.top_row
  end
 
end



#==============================================================================
# ** Window_EnhanceSlots
#------------------------------------------------------------------------------
#  This window displays choices when opting to change slots on the
#  enhancement screen.
#==============================================================================

class Window_EnhanceSlots < Window_Selectable
  attr_accessor :limit
  attr_accessor :info_window
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize()
    super(260, 64, 192, 288)
    @column_max = 5
    @info_window=nil
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # * Item Acquisition
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    @limits = []
    row=0
    # Add enhancements
    for i in $game_party.max_database_weapon_id+1...$data_weapons.size
      currently_equipped=false
      for a in $game_party.actors
        if a.weapon_id==i
          currently_equipped=true
        end
        # Patch for GUILLAUME777's Multi-Slot
        if MULTI_SLOT_PATCH
          if a.weapon_ids != nil
            for id in a.weapon_ids
              currently_equipped=true if id==i
            end
          end
        end
      end
      if $game_party.weapon_number(i) > 0 or currently_equipped
        @limits[row]=$data_weapons[i].slots
        for j in 0..4
          # put accessory
          #print(i.to_s)
          if j < $data_weapons[i].slots
            @data.push($data_weapons[i].accessories[j])
          else
          # put disabled slot
            @data.push(nil)
          end
        end
        row+=1
      end
    end
    # Make a bit map and draw all items
    @item_max = @data.size
    self.contents = Bitmap.new(width - 32, [row_max * 32,32].max)
   
    for i in 0...@limits.size
      for j in 0...@limits[i]
        tag=Tag.new(j*32+2,i*32+2,28,28,self.contents,"Menu_Face_00")
        tag.refresh
      end
    end
   
    for i in 0...@item_max
      if @data[i]!=nil
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #    index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    x = 4 + index % 5 * 32
    y = index / 5 * 32
    #case item
    #when RPG::Weapon
    #  number = $game_party.weapon_number(item.id)
    #when RPG::Armor
    #  number = $game_party.armor_number(item.id)
    #end
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    #self.contents.font.color = normal_color
    #self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    #self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
    #self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Help Text Update
  #--------------------------------------------------------------------------
  def update_info(force_update=false)
    if @old_item != self.item or force_update
      @info_window.item=self.item
      @info_window.refresh
      @old_item = self.item
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    myupdate
    # If cursor is movable
    if self.active and @item_max > 0 and self.index >= 0
      # If the right directional button was pressed
      if Input.repeat?(Input::RIGHT)
        if self.index % 5 < @limit-1
          # Move cursor right
          $game_system.se_play($data_system.cursor_se)
          self.index += 1
        end
      end
      # If the left directional button was pressed
      if Input.repeat?(Input::LEFT)
        if self.index % 5 > 0
          # Move cursor left
          $game_system.se_play($data_system.cursor_se)
          self.index -= 1
        end
      end
    end
    # Update help text (update_help is defined by the subclasses)
    if self.active and @help_window != nil
      update_help
    end
    # Update cursor rectangle
    update_cursor_rect
  end
 
  #--------------------------------------------------------------------------
  # * Update Cursor Rectangle
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # If cursor position is less than 0
    if self.index < 0
      self.cursor_rect.empty
      return
    end
    # Get current row
    row = self.index / @column_max
    # If current row is before top row
    if row < self.top_row
      # Scroll so that current row becomes top row
      self.top_row = row
    end
    # If current row is more to back than back row
    if row > self.top_row + (self.page_row_max - 1)
      # Scroll so that current row becomes back row
      self.top_row = row - (self.page_row_max - 1)
    end
    # Calculate cursor width
    cursor_width = 32
    # Calculate cursor coordinates
    x = self.index % @column_max * (cursor_width)
    y = self.index / @column_max * 32 - self.oy
    # Update cursor rectangle
    self.cursor_rect.set(x, y, cursor_width, 32)
  end
 
  def set_top_row(r)
    self.top_row=r
  end
 
end


#==============================================================================
# ** Window_Enhancements
#------------------------------------------------------------------------------
#  This window displays choices when opting to change enhancements on the
#  enhancement screen.
#==============================================================================

class Window_Enhancements < Window_Selectable
  attr_accessor :info_window
  attr_accessor :selected_weapon
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize()
    super(260+192, 64, 188, 288)
    @column_max = 1
    @info_window=nil
    @disabled_enhancements=[]
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # * Item Acquisition
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # Add enhancements
    for i in 1...$data_weapons.size
      if $data_weapons[i].element_set.include?($enhancement_element_id)
        #print(i.to_s + "è un enhancement\nil party ne possiede " + $game_party.weapon_number(i).to_s)
        if $game_party.weapon_number(i) > 0
          @data.push($data_weapons[i])
        end
      end
    end
    # Add blank page
    @data.push(nil)
    # Make a bit map and draw all items
    @item_max = @data.size
    self.contents = Bitmap.new(width - 32, row_max * 32)
    for i in 0...@item_max-1
      if(can_enhance?(@data[i],@selected_weapon))
        draw_item(i)
        @disabled_enhancements[i]=false
      else
        disable_item(i)
        @disabled_enhancements[i]=true
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #    index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    x = 4
    y = index * 32
    case item
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 28, y, 84, 32, item.name, 0)
    self.contents.draw_text(x + 28+80, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 28+80+16, y, 24, 32, number.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Disable Item
  #    index : item number
  #--------------------------------------------------------------------------
  def disable_item(index)
    item = @data[index]
    x = 4
    y = index * 32
    case item
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.font.color = disabled_color
    self.contents.draw_text(x + 28, y, 84, 32, item.name, 0)
    self.contents.draw_text(x + 28+80, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 28+80+16, y, 24, 32, number.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Help Text Update
  #--------------------------------------------------------------------------
  def update_info(force_update=false)
    #@info_window.set_text(self.item == nil ? "" : self.item.description)
    if @old_item != self.item or force_update
      @info_window.item=self.item
      @info_window.refresh
      @old_item = self.item
    end
  end
  #--------------------------------------------------------------------------
  # * Can enhance?
  #--------------------------------------------------------------------------
  def can_enhance?(e,w)
    return true if e==nil or w==nil
    if ALLOW_UNSPECIFIED_TYPE
      # return true if there are no specification on the enhancement or the weapon
      return true if (e.element_set & $type_elements).empty? or (w.element_set & $type_elements).empty?
    end
    # return true if w and e have at least one common TYPE element
    return true if !(e.element_set & w.element_set & $type_elements).empty?
    return false
  end
  #--------------------------------------------------------------------------
  # * Item disabled?
  #--------------------------------------------------------------------------
  def item_disabled?
    return @disabled_enhancements[index]
  end
end

http://www.google.com

6RPG Maker XP Re: Amélioration d'armes Dim 19 Oct - 17:19

Zack Fair

Zack Fair
Membre Actif
Membre Actif

Part 3
Code:
#==============================================================================
# ** Window_WeaponInfo
#------------------------------------------------------------------------------
#  This window shows weapon info.
#==============================================================================

class Window_WeaponInfo < Window_Base
  attr_accessor :item
  attr_accessor :actor
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64+288, 320, 128)
    @item=nil
    self.contents = Bitmap.new(width - 32, height - 32)
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if @item!=nil
      self.contents.font.size=20
      self.contents.font.bold=true
      aw=self.width - 40
      bitmap = RPG::Cache.icon(item.icon_name)
      self.contents.blt(4, 0, bitmap, Rect.new(0, 0, 24, 24))
      # get actor
      actor_str=(actor!=nil)?("  ["+actor.name+"]"):("")
      self.contents.draw_text(4+32, 0, aw-32, 24, @item.name+actor_str)
      self.contents.font.size=18
      self.contents.font.bold=false
      self.contents.draw_text(4, 24, self.width-4, 24, @item.description)
      self.contents.draw_text(4, 48, aw/4-4, 24, "ATK: "+@item.atk.to_s)
      self.contents.draw_text(4+aw/4, 48, aw/4-4, 24, "PDEF: "+@item.pdef.to_s)
      self.contents.draw_text(4+2*aw/4, 48, aw/4-4, 24, "MDEF: "+@item.mdef.to_s)
      self.contents.draw_text(4, 72, aw/4-4, 24, "FOR: "+@item.str_plus.to_s)
      self.contents.draw_text(4+aw/4, 72, aw/4-4, 24, "DEX: "+@item.dex_plus.to_s)
      self.contents.draw_text(4+2*aw/4, 72, aw/4-4, 24, "AGI: "+@item.agi_plus.to_s)
      self.contents.draw_text(4+3*aw/4, 72, aw/4-4, 24, "INT: "+@item.int_plus.to_s)
    end
  end

  def set_new_parameters (a,b,c)
  end
end

#==============================================================================
# ** Window_EnhancementInfo
#------------------------------------------------------------------------------
#  This window shows enhancements explanations.
#==============================================================================

class Window_EnhancementInfo < Window_Base
  attr_accessor :item
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(320, 64+288, 320, 128)
    self.contents = Bitmap.new(width - 32, height - 32)
    @item=nil
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if @item!=nil
      self.contents.font.size=20
      self.contents.font.bold=true
      aw=self.width - 40
      bitmap = RPG::Cache.icon(item.icon_name)
      self.contents.blt(4, 0, bitmap, Rect.new(0, 0, 24, 24))
      self.contents.draw_text(4+32, 0, aw-32, 24, @item.name)
      self.contents.font.size=18
      self.contents.font.bold=false
      self.contents.draw_text(4, 24, self.width-4, 24, @item.description)
      self.contents.draw_text(4, 48, aw/4-4, 24, "ATK: "+@item.atk.to_s)
      self.contents.draw_text(4+aw/4, 48, aw/4-4, 24, "PDEF: "+@item.pdef.to_s)
      self.contents.draw_text(4+2*aw/4, 48, aw/4-4, 24, "MDEF: "+@item.mdef.to_s)
      self.contents.draw_text(4, 72, aw/4-4, 24, "FOR: "+@item.str_plus.to_s)
      self.contents.draw_text(4+aw/4, 72, aw/4-4, 24, "DEX: "+@item.dex_plus.to_s)
      self.contents.draw_text(4+2*aw/4, 72, aw/4-4, 24, "AGI: "+@item.agi_plus.to_s)
      self.contents.draw_text(4+3*aw/4, 72, aw/4-4, 24, "INT: "+@item.int_plus.to_s)
    end
  end

end



#==============================================================================
# ** Window_Confirm
#------------------------------------------------------------------------------
#  This window displays a confirm dialog when putting fixed enhancements in the
#  enhancement screen.
#==============================================================================

DEFAULT_EW_CONFIRM_DIALOG_CHOICE=1
$default_ew_confirm_dialog_choice=DEFAULT_EW_CONFIRM_DIALOG_CHOICE

class Window_Confirm < Window_Selectable
  attr_accessor :answer
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize()
    super(100, 200, 440, 96+32)
    @column_max = 2
    @item_max = 2
    @choiches= ["Continue","Cancel"]
    self.z=999
    self.back_opacity=255
    self.opacity=255
    refresh
    self.active = true
    self.index = $default_ew_confirm_dialog_choice
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.draw_text(0, 0, 408, 32, "ATTENTION : C'est un élément fixe,", 1)
    self.contents.draw_text(0, 32, 408, 32, "vous ne pourriez jamais le retirer.", 1)
    self.contents.draw_text(16, 64, 172, 32, @choiches[0], 1)
    self.contents.draw_text(16+172+32, 64, 172, 32, @choiches[1], 1)
  end
  #--------------------------------------------------------------------------
  # * Update Cursor Rectangle
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # If cursor position is less than 0
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # Get current row
    row = @index / @column_max
    # If current row is before top row
    if row < self.top_row
      # Scroll so that current row becomes top row
      self.top_row = row
    end
    # If current row is more to back than back row
    if row > self.top_row + (self.page_row_max - 1)
      # Scroll so that current row becomes back row
      self.top_row = row - (self.page_row_max - 1)
    end
    # Calculate cursor width
    cursor_width = 180
    # Calculate cursor coordinates
    x = @index==0 ? 16 : 16+172+32
    y = 64
    # Update cursor rectangle
    self.cursor_rect.set(x, y, cursor_width, 32)
  end
 
end



#==============================================================================
# ** Window_ok
#------------------------------------------------------------------------------


#==============================================================================

class Window_Ok < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize()
    super(100, 200, 440, 96+32)
    @column_max = 1
    @item_max = 1
    @choiches= ["OK"]
    self.z=999
    self.back_opacity=255
    self.opacity=255
    refresh
    self.active = true
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.draw_text(0, 0, 408, 32, "C'est un élément fixe,", 1)
    self.contents.draw_text(0, 32, 408, 32, "Impossible de l'enlever.", 1)
    self.contents.draw_text(0, 64, self.width-32, 32, @choiches[0], 1)
  end
  #--------------------------------------------------------------------------
  # * Update Cursor Rectangle
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # If cursor position is less than 0
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # Get current row
    row = @index / @column_max
    # If current row is before top row
    if row < self.top_row
      # Scroll so that current row becomes top row
      self.top_row = row
    end
    # If current row is more to back than back row
    if row > self.top_row + (self.page_row_max - 1)
      # Scroll so that current row becomes back row
      self.top_row = row - (self.page_row_max - 1)
    end
    # Calculate cursor width
    cursor_width = 180
    # Calculate cursor coordinates
    x = (self.width/2)-(cursor_width/2)
    y = 64
    # Update cursor rectangle
    self.cursor_rect.set(x, y, cursor_width, 32)
  end 
end

class Window_Base
  alias myupdate update
end

http://www.google.com

7RPG Maker XP Re: Amélioration d'armes Dim 19 Oct - 17:20

Zack Fair

Zack Fair
Membre Actif
Membre Actif

Puis , ce dernier script nommé TAG :
Code:
class Tag
  attr_accessor :tag_name
  def initialize(x,y,width,height,bitmap,name)
    @x=x
    @y=y
    @width=width
    @height=height
    @bitmap=bitmap
    @tag=RPG::Cache.picture(name)
    @src_tag = Rect.new(0, 0, @tag.width, @tag.height)
  end
 
  def refresh()
    dest = Rect.new(@x, @y, @width, @height)
    @bitmap.stretch_blt(dest, @tag, @src_tag)
  end
end

Voila , si vous trouvez des problémes , n'hésitez pas.

http://www.google.com

Contenu sponsorisé



Revenir en haut  Message [Page 1 sur 1]

Sujets similaires

-

Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum

 

Ne ratez plus aucun deal !
Abonnez-vous pour recevoir par notification une sélection des meilleurs deals chaque jour.
IgnorerAutoriser