Advertisement
AngryPacman

[VXA] Change Gauge Display

Jan 28th, 2012
2,351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 7.76 KB | None | 0 0
  1. #=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です==
  2. #
  3. # Change Gauge Display (2.0)
  4. # 29/1/2012
  5. # By Pacman
  6. # This script allows you to change if TP is displayed throughout the game. You
  7. # can also set actors to not have their TP, HP or MP gauges drawn in battle.
  8. # To change the displaying of TP, use the following script call:
  9. # change_tp_display(true / false)
  10. # Putting the argument as true will make the TP display, false will make it not
  11. # display. Having no argument will simply toggle it.
  12. # To have an actor's TP not drawn in battle, place the following tag in their
  13. # notebox:
  14. # \no_tp_display
  15. # Similarly, to have an actor's HP or MP not drawn in battle, place the
  16. # following tags in their notebox, respectively:
  17. # \no_hp_display
  18. # \no_mp_display
  19. #
  20. #=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です==
  21.  
  22. #==============================================================================
  23. # ** RPG::Actor
  24. #------------------------------------------------------------------------------
  25. #  Data class for actors. Subclass of RPG::BaseItem. Some Japanese twaddle.
  26. #==============================================================================
  27.  
  28. class RPG::Actor < RPG::BaseItem
  29.   #--------------------------------------------------------------------------
  30.   # * Don't display actor's TP?
  31.   #--------------------------------------------------------------------------
  32.   def no_tp_display?
  33.     return !self.note[/\\no[_ ]?tp[_ ]?display/i].nil?
  34.   end
  35.   #--------------------------------------------------------------------------
  36.   # * Don't display actor's MP?
  37.   #--------------------------------------------------------------------------
  38.   def no_mp_display?
  39.     return !self.note[/\\no[_ ]?mp[_ ]?display/i].nil?
  40.   end
  41.   #--------------------------------------------------------------------------
  42.   # * Don't display actor's HP?
  43.   #--------------------------------------------------------------------------
  44.   def no_hp_display?
  45.     return !self.note[/\\no[_ ]?hp[_ ]?display/i].nil?
  46.   end
  47. end
  48.  
  49. #==============================================================================
  50. # ** Game_System
  51. #------------------------------------------------------------------------------
  52. # Something in Japanese, desu desu desu.
  53. #==============================================================================
  54.  
  55. class Game_System
  56.   #--------------------------------------------------------------------------
  57.   # Puclic Instance Variables no desu
  58.   #--------------------------------------------------------------------------
  59.   attr_accessor :opt_display_tp
  60.   #--------------------------------------------------------------------------
  61.   # Alias listing desu
  62.   #--------------------------------------------------------------------------
  63.   alias tp_change_init initialize
  64.   #--------------------------------------------------------------------------
  65.   # * Object Initialization
  66.   #--------------------------------------------------------------------------
  67.   def initialize(*args) # Desu
  68.     @opt_display_tp = $data_system.opt_display_tp
  69.     tp_change_init(*args)
  70.   end
  71. end
  72.  
  73. #==============================================================================
  74. # ** Game_Interpreter
  75. #------------------------------------------------------------------------------
  76. #  どのように私はこの日本殴り書きを読むのですか desu?
  77. #==============================================================================
  78.  
  79. class Game_Interpreter
  80.   #--------------------------------------------------------------------------
  81.   # * Alter displaying of TP
  82.   #     boo : Argument to decide the state of TP. If left out, desu.
  83.   #--------------------------------------------------------------------------
  84.   def change_tp_display(boo = nil)
  85.     $game_system.opt_display_tp = boo == nil ? !$game_system.opt_display_tp :
  86.     boo
  87.   end
  88. end
  89.  
  90. #=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  91. # ** Window_BattleStatus
  92. #!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~
  93. #  です です です です です です です です です です です です です です です です です です です
  94. #=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  95.  
  96. class Window_BattleStatus < Window_Selectable
  97.   #--------------------------------------------------------------------------
  98.   # * Draw Actor Gauges です
  99.   #--------------------------------------------------------------------------
  100.   def draw_gauge_area(rect, actor, *a)
  101.     if $game_system.opt_display_tp && !actor.actor.no_tp_display?
  102.       if actor.actor.no_mp_display? && !actor.actor.no_hp_display?
  103.         draw_gauge_area_without_mp(rect, actor, *a)
  104.       elsif actor.actor.no_hp_display? && !actor.actor.no_mp_display?
  105.         draw_gauge_area_without_hp(rect, actor, *a)
  106.       elsif actor.actor.no_hp_display? && actor.actor.no_mp_display?
  107.         draw_gauge_area_without_mp_hp(rect, actor, *a)
  108.       else
  109.         draw_gauge_area_with_tp(rect, actor, *a)
  110.       end
  111.     else
  112.       if actor.actor.no_mp_display? && !actor.actor.no_hp_display?
  113.         draw_gauge_area_without_tp_mp(rect, actor, *a)
  114.       elsif actor.actor.no_hp_display? && !actor.actor.no_mp_display?
  115.         draw_gauge_area_without_tp_hp(rect, actor, *a)
  116.       elsif actor.actor.no_hp_display? && actor.actor.no_mp_display?
  117.         draw_gauge_area_blank(rect, actor, *a)
  118.       else
  119.         draw_gauge_area_without_tp(rect, actor, *a)
  120.       end
  121.     end
  122.   end
  123.   #--------------------------------------------------------------------------
  124.   # * Draw without MP
  125.   #--------------------------------------------------------------------------
  126.   def draw_gauge_area_without_mp(rect, actor)
  127.     draw_actor_hp(actor, rect.x + 0, rect.y, 134)
  128.     draw_actor_tp(actor, rect.x + 144, rect.y, 76)
  129.   end
  130.   #--------------------------------------------------------------------------
  131.   # * Draw without HP
  132.   #--------------------------------------------------------------------------
  133.   def draw_gauge_area_without_hp(rect, actor)
  134.     draw_actor_mp(actor, rect.x + 0, rect.y, 134)
  135.     draw_actor_tp(actor, rect.x + 144, rect.y, 76)
  136.   end
  137.   #--------------------------------------------------------------------------
  138.   # * Draw without TP and HP
  139.   #--------------------------------------------------------------------------
  140.   def draw_gauge_area_without_tp_hp(rect, actor)
  141.     draw_actor_mp(actor, rect.x + 0, rect.y, rect.width)
  142.   end
  143.   #--------------------------------------------------------------------------
  144.   # * Draw without MP and HP
  145.   #--------------------------------------------------------------------------
  146.   def draw_gauge_area_without_mp_hp(rect, actor)
  147.     draw_actor_tp(actor, rect.x + 0, rect.y, rect.width)
  148.   end
  149.   #--------------------------------------------------------------------------
  150.   # * Draw without TP and MP
  151.   #--------------------------------------------------------------------------
  152.   def draw_gauge_area_without_tp_mp(rect, actor)
  153.     draw_actor_hp(actor, rect.x + 0, rect.y, rect.width)
  154.   end
  155.   #--------------------------------------------------------------------------
  156.   # * Draw blank (useless method ;])
  157.   #--------------------------------------------------------------------------
  158.   def draw_gauge_area_blank(*a)
  159.   end
  160. end
  161.  
  162. $imported ||= {}
  163. $imported[:pac_gauge_change] = [2.0]
  164.  
  165. #=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です==
  166. #
  167. # END OF SCRIPT. です.
  168. #
  169. #=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です=です==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement