Guest User

Untitled

a guest
Jan 19th, 2015
175
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #==============================================================================
  2. # ** Game_Event
  3. #------------------------------------------------------------------------------
  4. # Adding methods to check for comments on events.
  5. #==============================================================================
  6. class Game_Event < Game_Character
  7.  
  8. def comment?(comment)
  9. # // Method to check if comment is included in event.
  10. unless empty? or @list.nil?
  11. for evt in @list
  12. if evt.code == 108 or evt.code == 408
  13. if evt.parameters[0].include?(comment)
  14. return true
  15. end
  16. end
  17. end
  18. end
  19. return false
  20. end
  21.  
  22. def comment_int?(comment)
  23. # // Method to check for a integer in event.
  24. unless empty? or @list.nil?
  25. for evt in @list
  26. if evt.code == 108 or evt.code == 408
  27. if evt.parameters[0] =~ /<#{comment}:[ ]?(\d*)>?/
  28. return ($1.to_i > 0 ? $1.to_i : 0)
  29. end
  30. end
  31. end
  32. end
  33. end
  34.  
  35. def comment_string?(comment)
  36. # // Method to check for a string in event.
  37. unless empty? or @list.nil?
  38. for evt in @list
  39. if evt.code == 108 or evt.code == 408
  40. if evt.parameters[0] =~ /<#{comment}:[ ]?(\w*)>?/
  41. return $1.to_s
  42. end
  43. end
  44. end
  45. end
  46. end
  47.  
  48.  
  49. end # END OF FILE
RAW Paste Data