- ms22Membre
- Nombre de messages : 12
Age : 33
Localisation : Québec
Distinction : aucune
Date d'inscription : 13/10/2011
Avoir plus de 1 accessoire. [Résolu]
Jeu 13 Oct 2011 - 8:27
Bonjour la communauté! je voulais savoir s'il existait un moyen d'avoir plus de 1 accessoire dans vx. Je sais que dans XP on le peu à l'aide d'un script mais dans VX, je n'en trouve aucun. Avez vous une solution?
- ClashMembre
- Nombre de messages : 1023
Age : 27
Distinction : aucune
Date d'inscription : 12/10/2011
Re: Avoir plus de 1 accessoire. [Résolu]
Jeu 13 Oct 2011 - 9:58
Tiens, voila un script que j'utilise. Tu peux non seulement avoir plusieurs accessoires, mais aussi plusieurs épées, armures etc... Tu peux rajouter des bottes,des gants, enfin tout ce que tu veux.
Le script est en 4 parties.
Crédits: DerVVulfman
J'ai pas le temps de t'expliquer comment l'utiliser, je dois aller en cours là. Mais si tu y arrivs pas, je t'expliquerai cet après-midi.
Le script est en 4 parties.
Crédits: DerVVulfman
J'ai pas le temps de t'expliquer comment l'utiliser, je dois aller en cours là. Mais si tu y arrivs pas, je t'expliquerai cet après-midi.
- Spoiler:
- p#==============================================================================
# ** Multi-Slot Equipment VX
#------------------------------------------------------------------------------
# by DerVVulfman
# based on Guillaume777's original system.
# version 1.4
# 06-29-2008
# RGSS2 / RPGMaker VX
#==============================================================================
# Section 0: Credits
#==============================================================================
#
# CONFIGURABLE:
# * Create new armor slots and name them.
# * Define 'Cursed' weapons and armor and a special 'color' for its display.
# * Enable 'Switched' equipment, usable for disguising 'Cursed' equipment.
#
# IN GAME:
# * You can re-order and rename your slots for each character.
# * You can change a character from a 'dual-wielder' to 'sword/shield' user.
# * You can reset all this back to the 'configured' settings in-game.
#
# NOT INCLUDED (from Guillaume777's original RMXP system):
# * Custom Fonts in window - That actually confused some people
# * New Weapon Slots - Anyone have MORE than two hands?
# * Two-Handed and Double Attack weapons - Already built into VX
# * Off-Hand and Off-Hand penalties - Possible upgrade. Lefthanded???
# * 'Stretched' Status Window - Possible upgrade.
#
#==============================================================================
#
# THE CONFIGURATION SECTION:
#
# 1) SETTING ARMOR SLOTS:
#
# This system allows you to modify the order of your armor/equipment in
# your project and to add additional 'armor' slots to your actors list
# of gear. You do this by modifying the ARMOR_KINDS array as shown below:
#
# ARMOR_KINDS = [ 0, 1, 2, 3, 4, 5, 6 ]
#
# It matches each number in this array to a corresponding 'armor' type as
# you see in the following list:
# 0 = shield
# 1 = helmet
# 2 = armor
# 3 = accessory
# 4+ = The 'extra' armor slots...
#
# As such, the above example uses the default 4 armor slots and adds three
# additional slots.
#
# Technically speaking, you could add/remove/change the way the armor is
# listed as the following example will show:
#
# ARMOR_KINDS = [ 0, 1, 1, 4, 5, 3 ]
#
# This example will start your characters with a 'shield', two 'helmets'
# (which would be weird unless your characters have two heads), then it
# will be followed by two different 'extra' slots, and finally the 'ac-
# cessory' slot.
#
# NOTE: After configuring the slots, you will need to define the names
# of these new 'extra' slots (next section).
#
#------------------------------------------------------------------------------
#
# 2) NAMING ARMOR SLOTS:
#
# After defining your additional 'armor' slots, you will have to create
# names for them as they will appear in your game. These names are stored
# within the EXTRA_SLOT_NAMES array as shown below. And for every first
# instance of an extra slot you set in the above 'ACTOR_KINDS' array, you
# have to define a matching name.
#
# EXTRA_SLOT_NAMES = ["Gauntlet", "Boots", "Amulet"]
#
# The above array assumes you created three (3) new armor slot types:
# slots 4, 5 and 6. Again, You will need as many 'names' within this array
# as you have created in the ARMOR_KINDS array...
#
# But this precludes DUPLICATE entries of a slot in the ARMOR_KINDS list:
#
# ARMOR_KINDS = [ 0, 1, 4, 4, 4, 5, 5, 6 ]
#
# While this makes 6 new slots available for your actors, there are only
# three new slot types... slots 4, 5, and 6. As such, you still only need
# to make three slot names in the EXTRA_SLOT_NAMES array.
#
# NOTE: The 'names' you create here are used to link the new armor types
# to their slots. This is done through the armor's 'NOTE' field in
# the RMVX Armor database. See 'Armor Note Linking'.
#
#------------------------------------------------------------------------------
#
# 3) CURSED EQUIPMENT: (optional)
#
# This is an optional feature, but a rather interesting one. You have the
# ability to create 'irremovable' weapons and/or armor... referred to as
# 'Cursed' equipment. You can define the individual weapons and/or armor
# by listing them within their respective arrays as shown below:
#
# CURSED_WEAPONS = [1, 2, 4]
# CURSED_ARMOR = [20]
#
# The above example has flagged the 'Club', 'Long Sword' and 'Long Bow' as
# 'Cursed' weapons and the 'Saint Robe' as 'Cursed' armor.
#
# One more feature to note is that you can specify the 'color' used to
# identify the cursed item in your character's equipped inventory. The
# item will not be shown in the specified color in your item listing but
# will show up as that set color when it is equipped. To set the color,
# just set up the following value as shown in either of the two examples:
#
# CURSED_COLOR = 30
# -or-
# CURSED_COLOR = [255, 192, 0]
#
# The first example uses the color of the 31th block in your game's win-
# dowskin. I say 31st and not 30th as it follows the same number conven-
# tion as the message window's color system (0 to 31). Using the default
# windowskin, this example displays 'cursed' items with purple text.
#
# The second example uses the classic 'red, green, blue' system to define
# the color you wish to use rather one from the windowskin itself. This
# example creates a nice golden orange color for your 'cursed' items.
#
# NOTE: It is typically considered that 'Cursed' artifacts give the user
# no benefits of any sort or do some level of harm to the user even
# if the item is powerful.
#
#------------------------------------------------------------------------------
#
# 4) SWITCHED EQUIPMENT: (optional)
#
# This is another optional feature, but a rather fun and interesting one.
# It allows you to 'substitute' armor and/or weapons with that of other
# like gear until it is 'equipped' by the player. It is very useful for
# game developers who wish to hide the names of so-called 'cursed' items
# until after they're equipped. To perform the 'switch' on your weapons
# and/or armors, use the following two arrays as shown:
#
# SWITCH_EQUIP_WEAPONS = [ [ 10, 21 ], [ 23, 12 ] ]
# SWITCH_EQUIP_ARMORS = [ [ 28, 30] ]
#
# The two above arrays hold the ID values of 'fake' and 'new' gear within
# their own little array. Sort of like: [fake, real], [fake,real], ...
# continuing as long as you desire.
#
# The first array shown is the one that switches 'Weapons' around. Within
# this example there are two sets of swapped weapons. The first set of
# swapped weapons shown is Weapon #10(Bastard Sword) & #21(Mithril Blade).
# And the second weapon set shown is #23(Great Axe) & #12(Battle Axe).
#
# Now, when the player finds and picks up the 'Bastard Sword', it will
# show in his inventory as such, a Bastard Sword. But upon equipping it,
# this system will switch the weapon with the 'Mithril Blade'. Likewise,
# if the player finds the 'Great Axe' and attempts to equip it, the wea-
# pon will be switched with a 'Battle Axe'.
#
# (So you can substitute good items with bad and visa versa. ^_^ )
#
# Oh, and the second array shown is the one that switches 'Armors' around.
# It operates just like the WEAPONS array, but in this case I have merely
# set it to switch Armor #28(Fairy Boots) with #30(Sage's Ring).
#
# NOTE: The newly 'switched' armor will adopt and use the armor slot of
# the armor it is substituting, even if the newly 'switched' armor
# is accidentally set to a different slot.
#
# It is an unusual and unexpected side-effect of the 'switching'
# proceedure, but I like it. ^_^ But to keep things consistant,
# you should ensure that only 'LIKE' items are swapped.
#
#
#==============================================================================
#
# ARMOR NOTE LINKING
#
# This a relatively EASY procedure and is directly related to the ARMOR_KINDS
# and EXTRA_SLOT_NAMES arrays... moreso to EXTRA_SLOT_NAMES.
#
# Using the names of the slots you created within the EXTRA_SLOT_NAMES, you
# add these names into the 'note' block of your respective armor(s).
#
# ** That's the big square box in the bottom right of the screen, friend. **
#
# I say to 'add these names into the note block' to make it easy to grasp for
# the new users of this system, but in truth, you have to enter it with the
# following prefix: 'Multi-Slot: '
#
# As such, assuming you have the following slot-names:
#
# EXTRA_SLOT_NAMES = ["Gauntlet", "Boots", "Amulet"]
#
# You should enter following text into the 'Fairy Boots' note block...
#
# Multi-Slot: Boots
#
# ...and the Fairy Boots will be available to the Boots slot.
#
# * * * * *
#
# There are a few facts to consider:
#
# 1) Armor may only be usable in slots that use their 'slot' name.
# IE: Items with Multi-Slot: Chains are usable in 'Chains' slots.
#
# 2) You CAN have two or more slots that use the same name. As such, armor
# so tagged could be applied to any of those slots. So you could create
# numerous 'ring' slots and have rings that fit on any finger.
# IE: Items with Multi-Slot: Rings are usable in ANY 'Rings' slots.
#
# 3) The names of the equipment slots can be changed in-game, but it won't
# affect the initial setup prior to the name change. As such, any names
# changed with the 'extra_slot_names' script call will NOT prevent your
# items from working properly.
#
#
#==============================================================================
#
# SCRIPT CALLS:
#
# 1) ARMOR SLOTS
#
# This script call is useful to re-add, remove or reorder the slots for a
# single player character. The only caveat is that you cannot create newer
# slots to the game than the ones already defined in the 'CONFIGURATION'
# section.
#
# Syntax: $game_actors[n].armor_slots = array...
#
# Where the 'n' is the ID number of the actor in your database, and the
# array is the array of available armor types.
#
# EX: $game_actors[1].armor_slots = [0,1,2,3,4,5,6]
#
#------------------------------------------------------------------------------
#
# 2) WEAPON SLOT NAMES
#
# This script call is useful to change the displayed name of the weapon
# slots in your Equipment menu.
#
# Syntax: $game_actors[n].weapon_slot_names = array...
#
# Where the 'n' is the ID number of the actor in your database, and the
# array is an array that holds the redefined weapon slot names
#
# EX: $game_actors[1].weapon_slot_names = ["Right Hand", "Left Hand"]
#
# NOTE: If you type in only one (1) weapon name and the character can
# double-wield, the 2nd weapon slot will use the previous slot
# name.
#
#------------------------------------------------------------------------------
#
# 3) ARMOR SLOT NAMES
#
# This script call is useful to change the displayed name of the armor
# slots in your Equipment menu.
#
# Syntax: $game_actors[n].armor_slot_names = array...
#
# Where the 'n' is the ID number of the actor in your database, and the
# array is an array that holds the redefined armor slot names
#
# EX: $game_actors[1].armor_slot_names = ["Buckler","Hat","Gear","Chain"]
#
# NOTE: If you enter fewer 'names' than you have default armor slots,
# then the previously used slot name will be used in its place.
#
#------------------------------------------------------------------------------
#
# 4) EXTRA SLOT NAMES
#
# This script call is useful to change the displayed name of any additio-
# nal armor slots in your Equipment menu.
#
# Syntax: $game_actors[n].extra_slot_names = array...
#
# Where the 'n' is the ID number of the actor in your database, and the
# array is the array of available armor types.
#
# EX: $game_actors[1].armor_slots = [ "Rings", "Belt"]
#
# NOTE: If you enter fewer slot names than you have extra armor slots,
# then the previously used slot name will be used in its place.
#
#------------------------------------------------------------------------------
#
# 5) TWO SWORDS STYLE
#
# This script call allows you to 'change' whether a character can dual
# wield or use the Sword/Shield style of combat. Without this script
# call, you were at the mercy of the RMVX database and only having one
# predefined setting for a character at the game's start.
#
# Now it can be changed in-game. ^_^
#
# Syntax: $game_actors[n].two_swords_style = flag
#
# Where the 'n' is the ID number of the actor in your database, and the
# flag is the either a true/false/nil value.
#
# true = Uses up to 'two' weapons at the same time. No shield.
# false = Uses only 1 weapon and one shield.
# nil = {Reset} Whatever is defined in the RMVX database.
#
#
#------------------------------------------------------------------------------
#
# 6) RESET ALL SLOTS
#
# This script call allows you to reset a character's weapon/armor slots
# back to the initial values as they're laid out in the 'CONFIGURATION'
# section. It even resets the 'Two Swords Style' setting back to that in
# the RMVX Actor's database.
#
# Syntax: $game_actors[n].reset_all_slots
#
# Where the 'n' is the ID number of the actor in your database.
#
#==============================================================================
#
# CREDITS AND THANKS:
# To Guillaume777 himself, and to RPG Advocate who coded or posted some of
# the original scripts that he used for some key features. Also thanks to
# @speed of RPG Revolution for noting an incompatability issue with the
# Party Manager system by Prexus, to Lettuce of a glitch in reference to
# the default class changing system, and to MysteryMan23 for a bug I crea-
# ted when initially fixing the Party Manager glitch. It works better now.
#
#==============================================================================
- Spoiler:
#==============================================================================
# ** Multi-Elot Equipment VX
#------------------------------------------------------------------------------
# Section 1: Modules
#==============================================================================
module MS_MOD
#==============================================================================
# *** C O N F I G U R A T I O N S E C T I O N *** #
#==============================================================================
ARMOR_KINDS = [0, 1, 2, 3, 4, 5, 6]
EXTRA_SLOT_NAMES = ["Gants", "Bottes", "Amulette"]
CURSED_WEAPONS = []
CURSED_ARMOR = []
CURSED_COLOR = 30
SWITCH_EQUIP_WEAPONS = []
SWITCH_EQUIP_ARMORS = [ [] ]
end
#==============================================================================
# ** TAG CONSTANT
#------------------------------------------------------------------------------
# Constant value(s) used to gain data from the 'note' section.
#==============================================================================
# Used for 'note-tagged' Multi-Slot Equipment
SLOT_KIND = /(?:SLOT_KIND|Multi-Slot:)\s*(.+)/i
#==============================================================================
# ** RPG
#------------------------------------------------------------------------------
# A module containing RPGVX Data Structures.
#==============================================================================
module RPG
#============================================================================
# ** Armor
#----------------------------------------------------------------------------
# Data class for armor.
#============================================================================
class Armor < RPG::BaseItem
#------------------------------------------------------------------------
# * Alias Listings
#------------------------------------------------------------------------
alias ms_module_kind kind
#------------------------------------------------------------------------
# * Set New Item Types
#------------------------------------------------------------------------
def set_new_item_types
@__type = -1
self.note.split(/[\r\n]+/).each { |line|
if line =~ SLOT_KIND
line_index = MS_MOD::EXTRA_SLOT_NAMES.index($1)
next if line_index == nil
@__type = line_index + 4
end }
end
#------------------------------------------------------------------------
# * Set Advanced 'Slot' Type
#------------------------------------------------------------------------
def type
set_new_item_types if @__type == nil
return (@__type == -1 ? ms_module_kind : @__type)
end
end
end
#==============================================================================
# ** Multi-Slot Equipment VX
#------------------------------------------------------------------------------
# Section 2: Actors
#==============================================================================
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias ms_actor_setup setup
alias ms_actor_armors armors
alias ms_actor_change_equip change_equip
alias ms_actor_discard_equip discard_equip
alias ms_actor_class_id class_id=
alias ms_two_swords_style two_swords_style
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_writer :equip_type # equipment type
attr_accessor :armor_array # addtl armor array
attr_accessor :weapon_slot_names # Optional weapon slot names
attr_accessor :armor_slot_names # Optional armor slot names
attr_accessor :extra_slot_names # Optional extra slot names
attr_accessor :extra_two_swords_style # Optional two sword style changer
#--------------------------------------------------------------------------
# * Setup
# actor_id : actor ID
#--------------------------------------------------------------------------
def setup(actor_id)
actor = $data_actors[actor_id]
@extra_armor_id = []
# Perform the original call
ms_actor_setup(actor_id)
# Restore extra slot equipment
equipment_restore
end
#--------------------------------------------------------------------------
# * Get Armor Object Array
#--------------------------------------------------------------------------
def armors
# Obtain the original call's result
result = ms_actor_armors
# Sort through additional armors
extra_armor_slot.times { |i|
armor_id = extra_armor_id[i]
result << (armor_id == nil ? nil : $data_armors[armor_id]) }
return result
end
#--------------------------------------------------------------------------
# * Reset all slot data to default one
#--------------------------------------------------------------------------
def reset_all_slots
self.armor_slots = MS_MOD::ARMOR_KINDS
self.armor_slot_names = []
self.weapon_slot_names = []
self.extra_slot_names = []
self.extra_two_swords_style = nil
end
#--------------------------------------------------------------------------
# * Change Armor Slots
# array : Array for armor slots
#--------------------------------------------------------------------------
def armor_slots=(array)
return if actor == nil
@equip_type = array
equip_type
end
#--------------------------------------------------------------------------
# * Change Weapon Slot Names
# array : Array for weapon slot names
#--------------------------------------------------------------------------
def weapon_slot_names=(array)
@weapon_slot_names = nil
return if actor == nil
@weapon_slot_names = array
end
#--------------------------------------------------------------------------
# * Change Armor Slot Names
# array : Array for armor slot names
#--------------------------------------------------------------------------
def armor_slot_names=(array)
@armor_slot_names = nil
return if actor == nil
@armor_slot_names = array
end
#--------------------------------------------------------------------------
# * Change Extra Armor Slot Names
# array : Array for extra slot names
#--------------------------------------------------------------------------
def extra_slot_names=(array)
@extra_slot_names = nil
return if actor == nil
@extra_slot_names = array
end
#--------------------------------------------------------------------------
# * Change Two Swords Style
# flag : true/false flag
#--------------------------------------------------------------------------
def two_swords_style=(flag)
return if actor == nil
@extra_two_swords_style = flag
end
#--------------------------------------------------------------------------
# * Get [Dual Wield] Option
#--------------------------------------------------------------------------
def two_swords_style
ms_return = ms_two_swords_style
ms_return = @extra_two_swords_style if @extra_two_swords_style != nil
return ms_return
end
#--------------------------------------------------------------------------
# * Change Equipment (designate object)
# equip_type : Equip region (0..4)
# item : Weapon or armor (nil is used to unequip)
# test : Test flag (for battle test or temporary equipment)
#--------------------------------------------------------------------------
def change_equip(equip_type, item, test = false)
# Prevent use if game party not formed (party changer fix)
return if item == nil && $game_party == nil
# Perform the original call
ms_actor_change_equip(equip_type, item, test)
# If an additional slot
if extra_armor_slot > 0
item_id = item == nil ? 0 : item.id
case equip_type
when 5..armor_slot
@extra_armor_id = [] if @extra_armor_id == nil
@extra_armor_id[equip_type - 5] = item_id
end
end
end
#--------------------------------------------------------------------------
# * Discard Equipment
# item : Weapon or armor to be discarded.
# Used when the "Include Equipment" option is enabled.
#--------------------------------------------------------------------------
def discard_equip(item)
# Store original armor IDs
last_armors = [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
# Perform the original call
ms_actor_discard_equip(item)
# Store current armor IDs
curr_armors = [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
return unless item.is_a?(RPG::Armor)
return if last_armors != curr_armors
# Sort through and remove armor
extra_armor_slot.times { |i|
if extra_armor_id[i] == item.id
@extra_armor_id[i] = 0
break
end }
end
#--------------------------------------------------------------------------
# * Switch Items. Switches equipment to fool a player.
# item : item (Weapon or Armor
#--------------------------------------------------------------------------
def switch_items(item)
id = item.id
if item.is_a?(RPG::Weapon)
for i in 0...MS_MOD::SWITCH_EQUIP_WEAPONS.size
if MS_MOD::SWITCH_EQUIP_WEAPONS[i][0] == id
id = MS_MOD::SWITCH_EQUIP_WEAPONS[i][1]
end
end
end
if item.is_a?(RPG::Armor)
for i in 0...MS_MOD::SWITCH_EQUIP_ARMORS.size
if MS_MOD::SWITCH_EQUIP_ARMORS[i][0] == id
id = MS_MOD::SWITCH_EQUIP_ARMORS[i][1]
end
end
end
# Return the id value
return id
end
#--------------------------------------------------------------------------
# * Change Class ID
# class_id : New class ID
#--------------------------------------------------------------------------
def class_id=(class_id)
# Perform the original call
ms_actor_class_id(class_id)
return if extra_armor_slot == 0 # Only if no additional slots
# Sort through slots
for i in 5..armor_slot
change_equip(i, nil) unless equippable?(equips[i])
end
end
#--------------------------------------------------------------------------
# * Equipment Type
#--------------------------------------------------------------------------
def equip_type
if @equip_type.is_a?(Array)
return @equip_type
else
return MS_MOD::ARMOR_KINDS
end
end
#--------------------------------------------------------------------------
# * Return number of slots
#--------------------------------------------------------------------------
def armor_slot
return equip_type.size
end
#--------------------------------------------------------------------------
# * Return @extra_armor_slot
#--------------------------------------------------------------------------
def extra_armor_slot
return [armor_slot - 4, 0].max
end
#--------------------------------------------------------------------------
# # Return armor slot ID
#--------------------------------------------------------------------------
def extra_armor_id
@extra_armor_id = [] if @extra_armor_id == nil
return @extra_armor_id
end
#--------------------------------------------------------------------------
# * Restore equipment
#--------------------------------------------------------------------------
def equipment_restore
return if @__last_equip_type == equip_type
# Store previous values
last_equips = equips
last_hp = self.hp
last_mp = self.mp
# Change all equipment
last_equips.each_index { |i| change_equip(i, nil) }
last_equips.compact.each { |item| equip_legal_slot(item) }
self.hp = last_hp
self.mp = last_mp
@__last_equip_type = equip_type.clone
Graphics.frame_reset
end
#--------------------------------------------------------------------------
# * Order Items
# item : Weapon or Armor
#--------------------------------------------------------------------------
def equip_legal_slot(item)
if item.is_a?(RPG::Weapon)
if @weapon_id == 0
# Weapon #1
change_equip(0, item)
elsif two_swords_style && @armor1_id == 0
# Weapon #2 (Two-Sword style)
change_equip(1, item)
end
elsif item.is_a?(RPG::Armor)
if !two_swords_style && item.type == equip_type[0] && @armor1_id == 0
# Shield
change_equip(1, item)
else
# Set Equipment Order
list = [-1, @armor2_id, @armor3_id, @armor4_id]
list += extra_armor_id
# Compress the Equipment List
equip_type.each_with_index { |type, i|
if type == item.type && list[i] == 0
change_equip(i + 1, item)
break
end }
end
end
end
#--------------------------------------------------------------------------
# * Return Equipment ID
# equip_type : Equip region (0 or higher)
#--------------------------------------------------------------------------
def return_equip_id(equip_type)
returned = 0
case equip_type
when 0 # Weapon
returned = @weapon_id
when 1 # Shield
returned = @armor1_id
when 2 # Head
returned = @armor2_id
when 3 # Body
returned = @armor3_id
when 4 # Accessory
returned = @armor4_id
when 5..armor_slot
returned = @extra_armor_id[equip_type - 5]
end
return returned
end
end
- Spoiler:
#==============================================================================
# ** Multi-Slot Equipment VX
#------------------------------------------------------------------------------
# Section 3: Windows
#==============================================================================
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This is a superclass of all windows in the game.
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Get Cursed Color
#--------------------------------------------------------------------------
def cursed_color
if MS_MOD::CURSED_COLOR.is_a?(Array)
return Color.new( MS_MOD::CURSED_COLOR[0],
MS_MOD::CURSED_COLOR[1],
MS_MOD::CURSED_COLOR[2])
else
return text_color(MS_MOD::CURSED_COLOR)
end
end
end
#==============================================================================
# ** Window_Equip
#------------------------------------------------------------------------------
# This window displays items the actor is currently equipped with on the
# equipment screen.
#==============================================================================
class Window_Equip < Window_Selectable
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@data = @actor.equips.clone
@item_max = [@data.size, @actor.armor_slot + 1].min
create_contents
# Weapon_Names
ms_weapon = Vocab::weapon
ms_weapon1 = Vocab::weapon1
ms_weapon2 = Vocab::weapon2
# Substitute Names
unless @actor.weapon_slot_names == nil
ms_weapon = @actor.weapon_slot_names[0] if @actor.weapon_slot_names[0] != nil
ms_weapon1 = @actor.weapon_slot_names[0] if @actor.weapon_slot_names[0] != nil
ms_weapon2 = @actor.weapon_slot_names[1] if @actor.weapon_slot_names[1] != nil
end
# Basic weapon-slot handlings
self.contents.font.color = system_color
if @actor.two_swords_style
self.contents.draw_text(4, WLH * 0, 92, WLH, ms_weapon1)
self.contents.draw_text(4, WLH * 1, 92, WLH, ms_weapon2)
else
self.contents.draw_text(4, WLH * 0, 92, WLH, ms_weapon)
name = armor_slot_name(@actor.equip_type[0])
self.contents.draw_text(4, WLH * 1, 92, WLH, name)
end
for i in 1...@actor.armor_slot
name = armor_slot_name(@actor.equip_type[i])
self.contents.draw_text(4, WLH * (i + 1), 92, WLH, name)
end
# Draw Additional armor slots
rect = Rect.new(92, 0, self.width - 128, WLH)
@item_max.times { |i| rect.y = WLH * i
draw_item_name(@data[i], rect.x, rect.y) }
end
#--------------------------------------------------------------------------
# * Draw Item Name
# item : Item (skill, weapon, armor are also possible)
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# enabled : Enabled flag. When false, draw semi-transparently.
#--------------------------------------------------------------------------
def draw_item_name(item, x, y, enabled = true)
if item != nil
draw_icon(item.icon_index, x, y, enabled)
self.contents.font.color = normal_color
if item.is_a?(RPG::Weapon) && MS_MOD::CURSED_WEAPONS.include?(item.id)
self.contents.font.color = cursed_color
end
if item.is_a?(RPG::Armor) && MS_MOD::CURSED_ARMOR.include?(item.id)
self.contents.font.color = cursed_color
end
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(x + 24, y, 172, WLH, item.name)
end
end
#--------------------------------------------------------------------------
# * Armor Slot Names
# type : armor type
#--------------------------------------------------------------------------
def armor_slot_name(type)
case type
when 0..3
ms_armor = eval("Vocab.armor#{type + 1}")
unless @actor.armor_slot_names == nil
ms_armor = @actor.armor_slot_names[type] if @actor.armor_slot_names[type] != nil
end
else
ms_armor = MS_MOD::EXTRA_SLOT_NAMES[type - 4]
unless @actor.extra_slot_names == nil
ms_armor = @actor.extra_slot_names[type-4] if @actor.extra_slot_names[type-4] != nil
end
end
return ms_armor
end
end
#==============================================================================
# ** Window_EquipItem
#------------------------------------------------------------------------------
# This window displays choices when opting to change equipment on the
# equipment screen.
#==============================================================================
class Window_EquipItem < Window_Item
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
@item_enabled = []
super
@data.each { |item| @item_enabled << enable?(item) }
end
#--------------------------------------------------------------------------
# * Secondary Refresh
# equip_type : Equip region (0..4)
#--------------------------------------------------------------------------
def second_refresh(equip_type)
# Modifying the equipment region temporarily
last_equip_type = @equip_type
@equip_type = equip_type
@data.each_with_index { |item, i|
# Redraw when the item changes
if enable?(item) != @item_enabled[i]
draw_item(i)
@item_enabled[i] = enable?(item)
end
}
# Reset the equipment region
@equip_type = last_equip_type
end
#--------------------------------------------------------------------------
# * Whether to include item in list
# item : item
#--------------------------------------------------------------------------
def include?(item)
return true if item == nil
if @equip_type == 0
return false unless item.is_a?(RPG::Weapon)
else
return false unless item.is_a?(RPG::Armor)
return false unless item.type == @equip_type - 1
end
return @actor.equippable?(item)
end
#--------------------------------------------------------------------------
# * Whether to display item in enabled state
# item : item
#--------------------------------------------------------------------------
def enable?(item)
return false unless @actor.equippable?(item)
return true
end
end
#==============================================================================
# ** Window_Status
#------------------------------------------------------------------------------
# This window displays full status specs on the status screen.
#==============================================================================
class Window_Status < Window_Base
#--------------------------------------------------------------------------
# * Draw Equipment
# x : Draw spot X coordinate
# y : Draw spot Y coordinate
#--------------------------------------------------------------------------
def draw_equipments(x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, WLH, Vocab::equip)
item_number = [@actor.equips.size, @actor.armor_slot + 1].min
item_number.times { |i|
draw_item_name(@actor.equips[i], x + 16, y + WLH * (i + 1)) }
end
end
#==============================================================================
# ** Window_ShopStatus
#------------------------------------------------------------------------------
# This window displays number of items in possession and the actor's equipment
# on the shop screen.
#==============================================================================
class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
# * Draw Actor's Current Equipment and Parameters
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_parameter_change(actor, x, y)
return if @item.is_a?(RPG::Item)
enabled = actor.equippable?(@item)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(x, y, 200, WLH, actor.name)
if @item.is_a?(RPG::Weapon)
item1 = weaker_weapon(actor)
elsif actor.two_swords_style and @item.type == 0
item1 = nil
else
index = actor.equip_type.index(@item.type)
item1 = (index != nil ? actor.equips[1 + index] : nil)
end
if enabled
if @item.is_a?(RPG::Weapon)
atk1 = item1 == nil ? 0 : item1.atk
atk2 = @item == nil ? 0 : @item.atk
change = atk2 - atk1
else
def1 = item1 == nil ? 0 : item1.def
def2 = @item == nil ? 0 : @item.def
change = def2 - def1
end
self.contents.draw_text(x, y, 200, WLH, sprintf("%+d", change), 2)
end
draw_item_name(item1, x, y + WLH, enabled)
end
end
- Spoiler:
#==============================================================================
# ** Multi-Slot Equipment VX
#------------------------------------------------------------------------------
# Section 4: Other
#==============================================================================
#==============================================================================
# ** Scene_Equip
#------------------------------------------------------------------------------
# This class performs the equipment screen processing.
#==============================================================================
class Scene_Equip < Scene_Base
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias ms_scene_initialize initialize
alias ms_scene_create_item_windows create_item_windows
alias ms_scene_update_item_selection update_item_selection
alias ms_scene_update_equip_selection update_equip_selection
#--------------------------------------------------------------------------
# * Constants
#--------------------------------------------------------------------------
EQUIP_TYPE_MAX = MS_MOD::EXTRA_SLOT_NAMES.size + 5
#--------------------------------------------------------------------------
# * Object Initialization
# actor_index : actor index
# equip_index : equipment index
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0)
ms_scene_initialize(actor_index, equip_index)
actor = $game_party.members[actor_index]
@equip_index = [@equip_index, actor.armor_slot].min
end
#--------------------------------------------------------------------------
# * Create Item Window
#--------------------------------------------------------------------------
def create_item_windows
# Perform the original call
ms_scene_create_item_windows
type = equip_type(@equip_index)
EQUIP_TYPE_MAX.times { |i| @item_windows[i].visible = (type == i) }
end
#--------------------------------------------------------------------------
# * Update Item Window
#--------------------------------------------------------------------------
def update_item_windows
type = equip_type(@equip_window.index)
for i in 0...EQUIP_TYPE_MAX
@item_windows[i].visible = (type == i)
@item_windows[i].update
end
@item_window = @item_windows[type]
@item_window.second_refresh(@equip_window.index)
end
#--------------------------------------------------------------------------
# * Get the Equipment Type
# index : Index
#--------------------------------------------------------------------------
def equip_type(index)
if index == 0
return 0
else
return @actor.equip_type[index - 1] + 1
end
end
#--------------------------------------------------------------------------
# * Update Status Window
#--------------------------------------------------------------------------
def update_status_window
if @equip_window.active
@status_window.set_new_parameters(nil, nil, nil, nil)
elsif @item_window.active
temp_actor = Marshal.load(Marshal.dump(@actor))
temp_actor.change_equip(@equip_window.index, @item_window.item, true)
new_atk = temp_actor.atk
new_def = temp_actor.def
new_spi = temp_actor.spi
new_agi = temp_actor.agi
@status_window.set_new_parameters(new_atk, new_def, new_spi, new_agi)
end
@status_window.update
end
#--------------------------------------------------------------------------
# * Update Equip Region Selection
#--------------------------------------------------------------------------
def update_equip_selection
if Input.trigger?(Input::C)
# Regular gear
w = @actor.weapon_id
a1 = @actor.armor1_id
a2 = @actor.armor2_id
a3 = @actor.armor3_id
a4 = @actor.armor4_id
# Additional slots
slotarray = []
for i in 0...EQUIP_TYPE_MAX - 5
slotarray[i] = @actor.extra_armor_id[i]
end
# If already fixed
if @actor.fix_equipment
Sound.play_buzzer
return
end
# Go through generic gear
if @equip_window.index == 0 && MS_MOD::CURSED_WEAPONS.include?(w)
Sound.play_buzzer
return
elsif @equip_window.index == 1
if @actor.two_swords_style && MS_MOD::CURSED_WEAPONS.include?(a1)
Sound.play_buzzer
return
elsif !@actor.two_swords_style && MS_MOD::CURSED_ARMOR.include?(a1)
Sound.play_buzzer
return
end
elsif @equip_window.index == 2 && MS_MOD::CURSED_ARMOR.include?(a2)
Sound.play_buzzer
return
elsif @equip_window.index == 3 && MS_MOD::CURSED_ARMOR.include?(a3)
Sound.play_buzzer
return
elsif @equip_window.index == 4 && MS_MOD::CURSED_ARMOR.include?(a4)
Sound.play_buzzer
return
end
# Go through extra slots
for i in 0...EQUIP_TYPE_MAX-5
if @equip_window.index == 5 + i && MS_MOD::CURSED_ARMOR.include?(slotarray[i])
Sound.play_buzzer
return
end
end
end
# Perform the original call
ms_scene_update_equip_selection
end
#--------------------------------------------------------------------------
# * Update Item Selection
#--------------------------------------------------------------------------
def update_item_selection
if Input.trigger?(Input::C)
# Return if invalid selection
index = @equip_window.index
current_item = @item_window.item
unless current_item == nil || @actor.equippable?(current_item)
Sound.play_buzzer
return
end
unless current_item == nil
switched = @actor.switch_items(current_item)
end
end
# Perform the original call
ms_scene_update_item_selection
if Input.trigger?(Input::C)
unless switched == nil
if current_item.is_a?(RPG::Weapon)
gained_item= $data_weapons[switched]
else
gained_item = $data_armors[switched]
end
$game_party.gain_item(gained_item, 1, true)
@actor.change_equip_by_id(@equip_window.index, switched)
@equip_window.refresh
$game_party.lose_item(current_item, 1, true)
end
end
end
end
#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
# This class performs the save and load screen processing.
#==============================================================================
class Scene_File < Scene_Base
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias ms_scene_read_save_data read_save_data
#--------------------------------------------------------------------------
# * Restore Equipment
#--------------------------------------------------------------------------
def equipment_restore
(1...$data_actors.size).each { |i| actor = $game_actors[i]
actor.equipment_restore }
end
#--------------------------------------------------------------------------
# * Read Save Data
# file : file object for reading (opened)
#--------------------------------------------------------------------------
def read_save_data(file)
# Perform the original call
ms_scene_read_save_data(file)
# Restore extra slot equipment
equipment_restore
# Reset Graphics
Graphics.frame_reset
end
end
- TTTMembre
- Nombre de messages : 855
Distinction : Trou du cul d'la mère Camu!
Elle est morte! Elle est morte!
Trou du cul d'la mère Camu!
Elle est morte, elle pétera plus!
Date d'inscription : 23/06/2009
Re: Avoir plus de 1 accessoire. [Résolu]
Jeu 13 Oct 2011 - 12:23
- PharazonStaffeux retraité
- Nombre de messages : 1701
Age : 37
Localisation : Au Pays des Bisounours
Distinction : Super distinction!
[Coco' ]
Date d'inscription : 14/04/2010
Re: Avoir plus de 1 accessoire. [Résolu]
Jeu 13 Oct 2011 - 19:17
Tiens, très intéressant ce script.
Moi qui donne des objets clairement différent à mes persos, ça m'intéresse.
J'ai l'impression qu'on peut à la fois rajouter, mais carrément modifier tout les slots de persos. Est-ce que c'est paramétrable pour chaque héros ?
du genre : mon mage n'équipe que des capes et de bâtons, mais mon guerrier peut mettre des épées, des casques, des armures et des bottes.
Moi qui donne des objets clairement différent à mes persos, ça m'intéresse.
J'ai l'impression qu'on peut à la fois rajouter, mais carrément modifier tout les slots de persos. Est-ce que c'est paramétrable pour chaque héros ?
du genre : mon mage n'équipe que des capes et de bâtons, mais mon guerrier peut mettre des épées, des casques, des armures et des bottes.
- ms22Membre
- Nombre de messages : 12
Age : 33
Localisation : Québec
Distinction : aucune
Date d'inscription : 13/10/2011
Re: Avoir plus de 1 accessoire. [Résolu]
Jeu 13 Oct 2011 - 22:50
Merci beaucoup clash et désolé pour le mauvais type de post, vous ne reverrez pas ce genre de chose à l'avenir.
- ClashMembre
- Nombre de messages : 1023
Age : 27
Distinction : aucune
Date d'inscription : 12/10/2011
Re: Avoir plus de 1 accessoire. [Résolu]
Sam 15 Oct 2011 - 13:40
Est-ce que c'est paramétrable pour chaque héros ?
Euh... oui, c'est surement faisable, mais je sais pas le faire.
En attendant que quelqu'un d'autre te le fasse, tu peux toujours choisir dans la Base de Données, à l'onglet Classes, de quoi peuvent s'équiper chaque personnage.
- PharazonStaffeux retraité
- Nombre de messages : 1701
Age : 37
Localisation : Au Pays des Bisounours
Distinction : Super distinction!
[Coco' ]
Date d'inscription : 14/04/2010
Re: Avoir plus de 1 accessoire. [Résolu]
Sam 15 Oct 2011 - 13:51
Oui, ça je sais faire^^
mais ce que j'aurais voulu, c'est ne voir apparaitre que le genre d'équipement associé à chaque personnage.
en gros, j'ai un perso qui ne porte que deux type d'objet, un autre 3, et le dernier un seul.
et ce ne sont pas du tout les même.
au final, quand on ouvre l'onglet equipement d'un perso, j'aimerais qu'il ne soit visible que ses potentiels équipement.
(ex : mon guerrier ne peut porter que des épées et des armures / si j'ouvre son onglet equip., je ne veux voir que épées et armures, et non pas ensuite capes, chapeaux, bâtons, accessoires, bottes, etc...).
----
j'ai essayé de tester ton script hier, et je n'ai pas réussi à faire ça. à chaque fois, les personnages avaient tout les types d'items possible d'affichés dans leur onglet equip.
mais ce que j'aurais voulu, c'est ne voir apparaitre que le genre d'équipement associé à chaque personnage.
en gros, j'ai un perso qui ne porte que deux type d'objet, un autre 3, et le dernier un seul.
et ce ne sont pas du tout les même.
au final, quand on ouvre l'onglet equipement d'un perso, j'aimerais qu'il ne soit visible que ses potentiels équipement.
(ex : mon guerrier ne peut porter que des épées et des armures / si j'ouvre son onglet equip., je ne veux voir que épées et armures, et non pas ensuite capes, chapeaux, bâtons, accessoires, bottes, etc...).
----
j'ai essayé de tester ton script hier, et je n'ai pas réussi à faire ça. à chaque fois, les personnages avaient tout les types d'items possible d'affichés dans leur onglet equip.
- ClashMembre
- Nombre de messages : 1023
Age : 27
Distinction : aucune
Date d'inscription : 12/10/2011
Re: Avoir plus de 1 accessoire. [Résolu]
Sam 15 Oct 2011 - 14:35
oui oui, j'ai bien compris ce que tu veux, mais je sais pas le faire, je suis encore un débutant en ruby. Pourtant ça doit être un truc tout con genre une condition "si le personnage sélectionné est un mage, alors afficher les onglets cape et bâton."etc
Peut-être que quelqu'un d'autre pourra te faire ça.
Ou peut-être que c'est moi qui te le ferait, mais ça m'étonnerait.
Peut-être que quelqu'un d'autre pourra te faire ça.
Ou peut-être que c'est moi qui te le ferait, mais ça m'étonnerait.
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|