Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
- # Enhanced Item Description
- # Author: ForeverZer0
- # Version: 1.0
- # Date: 5.14.2011
- #=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
- #
- # Introduction:
- # This is a small, very basic script I wrote a while back, but never released.
- # It allows for you to use the same type of commands you can use in event
- # "Show Message" commands, but within the descriptions of Weapons, Armors, and
- # Items. Review the commands below, they will be substituted in the actual
- # text to display the respective value.
- #
- # Commands:
- # \v[ID] = Replaces with value of game variable with ID
- # \n[ID] = Replaces with name of actor that has ID
- # \sw[ID] = Replaces with value of switch withg ID (ON/OFF)
- # \g = Replaces with amount of gold party has
- # \st = Replaces with step count
- #
- # Author's Notes:
- # I can add more at request. Only values that are global to the RTP scripts
- # and cannot be easily accessed will be added to the script, though I can
- # still give someone a one line of code they can add themselves for custom
- # commands.
- #
- #=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
- module RPG
- def self.substitute_text(message)
- text = message.clone
- text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
- text.gsub!(/\\[Nn]\[([0-9]+)\]/) {
- $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : '' }
- text.gsub!(/\\[Gg]/) { $game_party.gold }
- text.gsub!(/\\[Ss][Tt]/) { $game_party.steps }
- text.gsub!(/\\[Ss][Ww]\[([0-9]+)\]/) {
- $game_switches[$1.to_i] ? 'ON' : 'OFF' }
- return text
- end
- class Weapon
- def description
- return RPG.substitute_text(@description)
- end
- end
- class Armor
- def description
- return RPG.substitute_text(@description)
- end
- end
- class Item
- def description
- return RPG.substitute_text(@description)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement