Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # Multi-slot equipment script
- #------------------------------------------------------------------------------
- # Section 1: Modules
- #------------------------------------------------------------------------------
- # Guillaume777
- # 6.2.2
- # 2006/02/14
- #==============================================================================
- # To change slots of character
- # $game_actors[1].weapon_slots = [0,0]
- # $game_actors[1].armor_slots = [2,3,4,5,6,7]
- #
- # To make armor equipable in new slot :
- # Add (5) in its name, where 5 is its slot number
- # To make 2handed weapons :
- # Add an element called 2handed to a weapon
- # or, adds its id in TWO_HANDED_WEAPONS = []
- # or, adds (2handed) in its name
- # To make a weapon double attack
- # Add an element called 2attacks to a weapon
- # or, adds its id in DOUBLE_ATTACK_WEAPONS = []
- # or, adds (2atks) in its name
- # To make a weapon/armor cursed
- # Adds its id in CURSED_WEAPONS or CURSED_ARMORS, or
- # put (cursed) in its name
- # To make a weapon require an offhand instead of any weapon
- # Adds its id in NEEDS_OFFHAND or
- # Adds (needs_offhand) in its name
- #==============================================================================
- # *** MODULE: Guillaume777's Multi-Slot Module
- #------------------------------------------------------------------------------
- # This is the configuration module of the Multi-Slot system. It allows you to
- # set the default names of your slots, tag your weapons and/or armors for many
- # types of enhancements and features, and etc.
- #==============================================================================
- module G7_MS_MOD
- #--------------------------------------------------------------------------
- # * Configuration Section
- #--------------------------------------------------------------------------
- #========Set weapon/armor properties ======================================
- CURSED_WEAPONS = [] # ids of weapons to be cursed
- CURSED_ARMORS = [] # ids of armors to be cursed
- TWO_HANDED_WEAPONS = [] # ids of 2handed weapons
- DOUBLE_ATTACK_WEAPONS = [] # ids of double attack weapons
- NEEDS_OFFHAND = [3,4,5,6,7,8, # ids of weapons requiring an offhand
- 9,10,11,12,
- 25,26,27,28,29,30,31,32,33,34,35,36,37,38]
- SWITCH_EQUIP_WEAPONS = [[38,36], [43,42]] # ids of weapons switched when equipped
- SWITCH_EQUIP_ARMORS = [[41,40], [42,39]] # ids of switched armors(same above)
- # Use 1 array, first value of array = false item, second value = true item
- #
- # First value in the above arrays is displayed in the weapons/armors you can
- # choose. When the weapon/armor is chosen, the second id value IS the weapon
- # or armor that you've chosen. Example: Trick someone to equip a cursed bow.
- #=========Set weapon/armor properties with element tagging and name edit===
- CURSED_STRING = 'cursed' # put (cursed) in item name for it to be cursed
- HANDS_ELEMENT = 'handed' # no. of hands in front of HANDS_ELEMENT in database
- HANDS_STRING = 'handed' # name of string in item name like (2handed)
- MULTI_ATTACK_ELEMENT = 'attacks' # name of element to tag to multi attacks
- # like (2attacks)
- MULTI_ATTACK_STRING = 'atks' # string in item name, like (3atks)
- NEEDS_OFFHAND_STRING = 'needs_offhand' #string in item name if the weapon
- #needs an offhand like (needs_offhand)
- #=====Set character slots properties =======================================
- WEAPON_KINDS = [0, 0] # number of weapons, 0 = weapon
- WEAPON_KIND_NAMES = ['R-Hand', 'L-Hand'] # custom name of extra weapon slots
- WEAPON_KIND_POWERS = [100, 100] # 100 = normal power, 90 = 90% power
- # Leave empty or put nil inside
- # if you want the default names.
- ARMOR_KINDS = [1,2,3,4,5,6,7]
- # 1 = shield
- # 2 = helmet
- # 3 = armor
- # 4 = acc
- # 5 = and more : extra slot
- EXTRA_SLOT_NAMES = ['Gauntlet','Boots','Amulet']
- # Name of the extra slots in equip window
- # You need as many words as there are '5' or more in armor_kinds
- # The first order of the slots names reflect the order of the 5 in armor_kinds
- # Put (5) or more to in the armor name to have it assigned to the extra slot
- #=============Set multi-weapon behavior====================================
- IGNORE_OFFHAND = false # ignore off_hand support
- TWOHANDED_IN_OFFHAND = true # If false don't show two handed weapons in
- # the offhand window
- ALL_WEAPONS_FOR_SKILLS = true # true = combined pwr of all weaps for skills
- # false = only power of first weapon
- SHIELD_HAND_SLOT = 1 # slot number to be used for shield hand
- WEAPON_SHIELD_SHARE = true # if true, can't use a shield and a second
- # weapon at the same time
- SHIELD_HAND_WIELD = true # true = can use shield hand for 2handed weap.
- WEAPON_HAND_WIELD = true # true = can use weapon hand for 2handed weap.
- MULTI_WEAPONS_PENALITY = 0 # percent of atk that will be subtracted if
- # you use two weapons at the same time.
- #============Set appearance properties ====================================
- FONT_NAME = 'Arial' # Font to use
- CURSED_COLOR = Color.new(255, 50, 50) # Color of cursed equiped items
- SHOW_REMOVE = false # Show empty in offhand window
- WINDOWS_STRETCH = true # true : equip_right stretch to adjust to # of slots
- MAX_SHOW_SLOTS = 6 # Maximum number of slots in 1 screen in equip right
- # window. Useless if windows_stretch = false
- HELP_AT_BOTTOM = false # If true, will leave place for help window at bot-
- # tom. Useless if you didn't modify the help window
- # y-coordinate.
- STATUS_WINDOW_ARRANGE = true # If true, you get a new status window.
- STATUS_WINDOW_SPACING = 24 # Space between each item in new status window.
- EVADE = false # If draw_actor_parameter is configured to
- # receive parameter number 7 (evade), then it
- # will show in new status window.
- # EVADE = true has no effect if STATUS_WINDOW_ARRANGE is false
- #================ end of settings =========================================
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- super
- RPG.set_new_item_types #fix armor and weapon properties at start of game
- end
- #--------------------------------------------------------------------------
- # * End of MODULE: Guillaume777's Multi-Slot Module
- #--------------------------------------------------------------------------
- end
- #============================================================================
- # ** MODULE: RPG Module
- #----------------------------------------------------------------------------
- # This sprite is used as an arrow cursor for the battle screen. This class
- # is used as a superclass for the Arrow_Enemy and Arrow_Actor classes.
- #============================================================================
- module RPG
- #--------------------------------------------------------------------------
- # * Set New Item Types
- #--------------------------------------------------------------------------
- def RPG.set_new_item_types
- if @initialized_item_types then return end
- for armor in $data_armors # for each armor
- unless armor == nil # if armor
- armor.set_adv_type # set new type
- armor.set_cursed # set if item is cursed or not
- end
- end
- for weapon in $data_weapons # for each armor
- unless weapon == nil # if armor
- weapon.set_needs_offhand # set if it needs an offhand or not
- weapon.set_nb_hands # set the number of hands to wield it
- weapon.set_nb_attacks # set the number of attacks it can do
- weapon.set_cursed # set if item is cursed or not
- end
- end
- @initialized_item_types = true
- end
- #--------------------------------------------------------------------------
- # * Initialized Item Types
- # bool : boolean value (true/false)
- #--------------------------------------------------------------------------
- def RPG.initialized_item_types=(bool)
- @initialized_item_types = bool
- end
- #==========================================================================
- # ** Armor
- #--------------------------------------------------------------------------
- # Data class for armors, adds new armor types
- #==========================================================================
- class Armor
- attr_accessor :cursed
- #------------------------------------------------------------------------
- # * Set Adv Type
- #------------------------------------------------------------------------
- def set_adv_type
- pattern = /\((\d+)\)/
- if @name.sub!(pattern, '') != nil
- # Set kind to the number in name of armor
- @kind = $1.to_i - 1
- end
- end
- #------------------------------------------------------------------------
- # * Set Cursed
- #------------------------------------------------------------------------
- def set_cursed
- pattern = '('+G7_MS_MOD::CURSED_STRING+')'
- if @name.sub!(pattern, '') != nil then cursed = true end
- if G7_MS_MOD::CURSED_ARMORS.include?(@id) then cursed = true end
- @cursed = cursed
- end
- #------------------------------------------------------------------------
- # * End of Armor Class
- #------------------------------------------------------------------------
- end
- #==========================================================================
- # ** Weapon
- #--------------------------------------------------------------------------
- # Data class for weapons, adds new weapon types
- #==========================================================================
- class Weapon
- #------------------------------------------------------------------------
- # * Public Instance Variables
- #------------------------------------------------------------------------
- attr_accessor :needs_offhand # does it need an offhand weapon
- attr_accessor :nb_hands # numbers of hands it requires
- attr_accessor :nb_attacks # number of attacks it can do
- attr_accessor :cursed # true if item is cursed
- #------------------------------------------------------------------------
- # * Set Cursed
- #------------------------------------------------------------------------
- def set_cursed
- pattern = '('+G7_MS_MOD::CURSED_STRING+')'
- if @name.sub!(pattern, '') != nil then cursed = true end
- if G7_MS_MOD::CURSED_WEAPONS.include?(@id) then cursed = true end
- @cursed = cursed
- end
- #------------------------------------------------------------------------
- # * Set Needs OffHand
- #------------------------------------------------------------------------
- def set_needs_offhand
- pattern = '('+G7_MS_MOD::NEEDS_OFFHAND_STRING+')'
- if @name.sub!(pattern, '') != nil then
- @needs_offhand = true
- elsif G7_MS_MOD::NEEDS_OFFHAND.include?(self.id) then
- @needs_offhand = true
- elsif @needs_offhand== nil then
- @needs_offhand = false
- end
- end
- #------------------------------------------------------------------------
- # * Returns number of hands needed for weapons
- #------------------------------------------------------------------------
- def set_nb_hands
- if G7_MS_MOD::TWO_HANDED_WEAPONS.include?(self.id) then
- nb_hands = 2
- end
- pattern = /\((\d+)#{G7_MS_MOD::HANDS_STRING}\)/
- if @name.sub!(pattern, '') != nil
- nb_hands = $1.downcase.delete('a-z')
- nb_hands = $1.to_i
- end
- # Search through the elements
- for elementnb in self.element_set
- elementname = $data_system.elements[elementnb].downcase
- # If the weapon has an element for another attack
- if elementname.delete('0-9') == G7_MS_MOD::HANDS_ELEMENT.downcase
- # Get the number of attacks
- elementname = elementname.delete('a-z')
- if elementname != '' then
- nb_hands = elementname.to_i
- # Delete the element
- self.element_set.delete(elementnb)
- end
- end
- end
- if nb_hands.is_a?(Integer) == false or nb_hands <= 0 then nb_hands = 1 end
- @nb_hands = nb_hands
- end
- #------------------------------------------------------------------------
- # * Returns the number of attack the weapon can do
- #------------------------------------------------------------------------
- def set_nb_attacks
- if G7_MS_MOD::DOUBLE_ATTACK_WEAPONS.include?(self.id) then
- nb_attacks = 2
- else
- nb_attacks = 1
- end
- pattern = /\((\d+)#{G7_MS_MOD::MULTI_ATTACK_STRING}\)/
- if @name.sub!(pattern, '') != nil
- nb_attacks = $1.downcase.delete('a-z')
- nb_attacks = $1.to_i
- end
- # Search elements that could add more attacks
- for elementnb in self.element_set
- elementname = $data_system.elements[elementnb].downcase
- # If the weapon has an element for another attack
- if elementname.delete('0-9') == G7_MS_MOD::MULTI_ATTACK_ELEMENT.downcase
- # Get the number of attacks
- elementname = elementname.delete('a-z')
- if elementname != '' then
- nb_attacks = elementname.to_i
- # Delete the element
- self.element_set.delete(elementnb)
- end
- end
- end
- if nb_attacks.is_a?(Integer) == false or nb_attacks <= 0 then nb_attacks = 1 end
- @nb_attacks = nb_attacks
- end
- #------------------------------------------------------------------------
- # * End of CLASS: Weapon
- #------------------------------------------------------------------------
- end
- #--------------------------------------------------------------------------
- # * End of MODULE: RPG Module
- #--------------------------------------------------------------------------
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement