Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ** Game_Event
- #------------------------------------------------------------------------------
- # Adding methods to check for comments on events.
- #==============================================================================
- class Game_Event < Game_Character
- def comment?(comment)
- # // Method to check if comment is included in event.
- unless empty? or @list.nil?
- for evt in @list
- if evt.code == 108 or evt.code == 408
- if evt.parameters[0].include?(comment)
- return true
- end
- end
- end
- end
- return false
- end
- def comment_int?(comment)
- # // Method to check for a integer in event.
- unless empty? or @list.nil?
- for evt in @list
- if evt.code == 108 or evt.code == 408
- if evt.parameters[0] =~ /<#{comment}:[ ]?(\d*)>?/
- return ($1.to_i > 0 ? $1.to_i : 0)
- end
- end
- end
- end
- end
- def comment_string?(comment)
- # // Method to check for a string in event.
- unless empty? or @list.nil?
- for evt in @list
- if evt.code == 108 or evt.code == 408
- if evt.parameters[0] =~ /<#{comment}:[ ]?(\w*)>?/
- return $1.to_s
- end
- end
- end
- end
- end
- end # END OF FILE
RAW Paste Data