Guest User

Customizable Holder Battlers

a guest
Mar 8th, 2014
93
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #===============================================================================
  2. # Script: Customizable Holder Battlers
  3. # Author: Selchar
  4. # Requestor: Nosleinad
  5. # Credits: Yami
  6. #===============================================================================
  7. =begin
  8. This is an extention of Yami's Holder Battler addon for Battle Engine Symphony.
  9. It allows for different battlers based on class id, as well as changing it via
  10. scriptcall.  Scriptcall changes take priority over class specific, which takes
  11. priority over the default holder notetag.
  12.  
  13. #-------------------------------------------------------------------------------
  14. # Actor Notetag
  15. #-------------------------------------------------------------------------------
  16. <class holder battler class_id: filename>
  17. <class holder battler class_id: nil> changes back to original class
  18. #-------------------------------------------------------------------------------
  19. # Scriptcall
  20. #-------------------------------------------------------------------------------
  21. $game_actors[actor_id].new_holders_name = 'filename'
  22.  
  23. Replace class_id or actor_id with the relevant number, and filename with the
  24. name of the holder style image you want to use.
  25. =end
  26. #===============================================================================
  27. # The script
  28. #===============================================================================
  29. module Selchar
  30.   module Symphony
  31.     def self.holder_class(class_id)
  32.       /<class[-_ ]?holder[-_ ]?battler[-_ ]?#{class_id}:\s*(.*)\s*>/i
  33.     end
  34.   end
  35. end
  36.  
  37. class Game_Actor < Game_Battler
  38.   attr_accessor :new_holders_name
  39.  
  40.   def holders_name
  41.     if @new_holders_name != nil
  42.       return @new_holders_name if @new_holders_name != ''
  43.     end
  44.     return actor.class_holder_name(@class_id) if actor.class_holder_name(@class_id)
  45.     return actor.holders_name
  46.   end
  47. end
  48.  
  49. class RPG::Actor
  50.   def class_holder_name(class_id)
  51.     if @class_holder_name.nil?
  52.       @class_holder_name = {}
  53.       $data_classes.each do |i|
  54.         next unless i
  55.         @class_holder_name[i.id] = $1 if @note =~ Selchar::Symphony.holder_class(i.id)
  56.       end
  57.     end
  58.     @class_holder_name[class_id]
  59.   end
  60. end
  61. #===============================================================================
  62. # End of File
  63. #===============================================================================
RAW Paste Data