Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Shanghai Simple Script - Equipment Skills
- # Last Date Updated: 2010.05.25
- # Level: Normal
- #
- # Equip a weapon or armor to have a skill appear in your actors' skill lists.
- # Take off the equipment and it's gone. Simple as that.
- #===============================================================================
- # Instructions
- # -----------------------------------------------------------------------------
- # To install this script, open up your script editor and copy/paste this script
- # to an open slot below ▼ Materials but above ▼ Main. Remember to save.
- #
- # <equipskill: x>
- # <equipskill: x, x, x>
- # This gives the skill x for equipping the piece of equipment. Works only on
- # equipment noteboxes obviously.
- #===============================================================================
- $imported = {} if $imported == nil
- $imported["EquipmentSkills"] = true
- #==============================================================================
- # RPG::BaseItem
- #==============================================================================
- class RPG::BaseItem
- #--------------------------------------------------------------------------
- # skills
- #--------------------------------------------------------------------------
- def skills
- return @equipment_skills if @equipment_skills != nil
- @equipment_skills = []
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<(?:EQUIPMENTSKILL|equipskill):[ ](\d+(?:\s*,\s*\d+)*)>/i
- $1.scan(/\d+/).each { |num|
- @equipment_skills.push($data_skills[num.to_i]) if num.to_i > 0 }
- end
- }
- return @equipment_skills
- end
- end
- #==============================================================================
- # Game Actor
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # skills
- #--------------------------------------------------------------------------
- alias skills_sss_equipment_skills skills unless $@
- def skills
- list = skills_sss_equipment_skills
- for equip in equips.compact
- next if equip == nil
- list += equip.skills
- end
- return list.uniq
- end
- #--------------------------------------------------------------------------
- # skill_can_use?
- #--------------------------------------------------------------------------
- def skill_can_use?(skill)
- return super(skill)
- end
- end
- #===============================================================================
- #
- # END OF FILE
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement