Advertisement
Mithran

common troop event pages rmvx

May 14th, 2011
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. # common troop event pages
  2. # by Mithran
  3. # this allows you to set up pages that are in common with every troop
  4. # by using a single blank troop
  5. # place in materials
  6.  
  7. class RPG::Troop
  8. PAGE_REFERRER = 50 # which event page should be copied onto all troop pages?
  9.  
  10. alias pages_commonpage pages unless $@
  11. def pages
  12. extra_pages + pages_commonpage
  13. end
  14.  
  15. def extra_pages
  16. return [] if self.id == PAGE_REFERRER
  17. troop = $data_troops[PAGE_REFERRER]
  18. return [] if troop.nil?
  19. troop.pages
  20. end
  21.  
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement