Advertisement
WCouillard

RGSS3: Flashing TP Gauges v1.00

Nov 21st, 2014
584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 15.23 KB | None | 0 0
  1. # ╔══════════════════════════════════════════════════════╤═══════╤════════════╗
  2. # ║ Flashing TP Gauge                                    │ v1.00 │ (11/21/14) ║
  3. # ╠══════════════════════════════════════════════════════╧═══════╧════════════╣
  4. # ║ Author  : William Couillard                                               ║
  5. # ║ Thanks  : Galv (http://galveraxe.wordpress.com)                           ║
  6. # ║ E-Mail  : cooliebk18@yahoo.com                                            ║
  7. # ║ Website : http://ffdiscovery.wikia.com                                    ║
  8. # ╠═══════════════════════════════════════════════════════════════════════════╣
  9. # ║ ABOUT                                                                     ║
  10. # ╠═══════════════════════════════════════════════════════════════════════════╣
  11. # ║ This script changes the behavior of the TP gauge to begin flashing when   ║
  12. # ║ it is filled to a certain amount.                                         ║
  13. # ╠═══════════════════════════════════════════════════════════════════════════╣
  14. # ║ TERMS OF USE                                                              ║
  15. # ╠═══════════════════════════════════════════════════════════════════════════╣
  16. # ║ ► Do not edit the script's header or comments.                            ║
  17. # ║ ► Free to use in commercial projects as long as proper credit is given to ║
  18. # ║   ALL the names in the above header.                                      ║
  19. # ╠═══════════════════════════════════════════════════════════════════════════╣
  20. # ║ FEATURES                                                                  ║
  21. # ╠═══════════════════════════════════════════════════════════════════════════╣
  22. # ║ ► Allow the TP gauge to begin flashing once it reaches a certain amount.  ║
  23. # ║ ► User can set the amount of TP needed to begin flashing.                 ║
  24. # ╠═══════════════════════════════════════════════════════════════════════════╣
  25. # ║ KNOWN ISSUES                                                              ║
  26. # ╠═══════════════════════════════════════════════════════════════════════════╣
  27. # ║ ► This script may not be compatible with scripts that overwrite the       ║
  28. # ║   draw_actor_tp method in Window_Base.                                    ║
  29. # ╠═══════════════════════════════════════════════════════════════════════════╣
  30. # ║ CHANGE LOG                                                                ║
  31. # ╠═════════════════════════════════════════════════════════════════╤═════════╣
  32. # ║ ■ November 21, 2014 : Initial release.                          │ (v1.00) ║
  33. # ╠═════════════════════════════════════════════════════════════════╧═════════╣
  34. # ║ NEXT VERSION                                                              ║
  35. # ╠═══════════════════════════════════════════════════════════════════════════╣
  36. # ║ ■ Compatibility with scripts displaying TP gauges in menus.               ║
  37. # ╠═══════════════════════════════════════════════════════════════════════════╣
  38. # ║ OVERWRITTEN METHODS                                                       ║
  39. # ╠═══════════════════════════════════════════════════════════════════════════╣
  40. # ║   This script overwrites a method in Window_Base.                         ║
  41. # ╟───────────────────────────────────────────────────────────────────────────╢
  42. # ║ ■ class Window_Base < Window                                              ║
  43. # ║    ► def draw_actor_tp                                                    ║
  44. # ╠═══════════════════════════════════════════════════════════════════════════╣
  45. # ║ ALIASED METHODS                                                           ║
  46. # ╠═══════════════════════════════════════════════════════════════════════════╣
  47. # ║   This script alises two methods in Scene_Battle.                         ║
  48. # ╟───────────────────────────────────────────────────────────────────────────╢
  49. # ║ ■ class Scene_Battle < Scene_Base                                         ║
  50. # ║    ► def update                                                           ║
  51. # ║    ► def update_for_wait                                                  ║
  52. # ╠═══════════════════════════════════════════════════════════════════════════╣
  53. # ║ NEW METHODS                                                               ║
  54. # ╠═══════════════════════════════════════════════════════════════════════════╣
  55. # ║   There is a single new method introduced in this script.                 ║
  56. # ╟───────────────────────────────────────────────────────────────────────────╢
  57. # ║ ■ class Window_Base < Window                                              ║
  58. # ║    ► def random_tp_gauge_color                                            ║
  59. # ╠═══════════════════════════════════════════════════════════════════════════╣
  60. # ║ INSTRUCTIONS                                                              ║
  61. # ╠═══════════════════════════════════════════════════════════════════════════╣
  62. # ║ Simply paste this script anywhere ABOVE the Main Process script and BELOW ║
  63. # ║ Scene_Battle.                                                             ║
  64. # ╠═══════════════════════════════════════════════════════════════════════════╣
  65. # ║ IMPORT SETTING                                                            ║
  66. # ╚═══════════════════════════════════════════════════════════════════════════╝
  67. $imported = {} if $imported.nil?        # Do not edit
  68. $imported["WC-Flashing_TP_1.00"] = true # Do not edit
  69. # ╔═══════════════════════════════════════════════════════════════════════════╗
  70. # ║ CUSTOMIZATION MODULE                                                      ║
  71. # ╚═══════════════════════════════════════════════════════════════════════════╝
  72. module COOLIE
  73.   module FLASH_TP
  74.    
  75.   # ╔═══════════════════════════════════════════════════════════════════════╗
  76.   # ║ The color IDs below will make up the flashing gauge                   ║
  77.   # ║ Example: use any IDs from 0 to 31                                     ║
  78.   # ╚═══════════════════════════════════════════════════════════════════════╝
  79.     FLASH_TP_COLORS = [10, 18, 0, 14, 27]
  80.   # ╔═══════════════════════════════════════════════════════════════════════╗
  81.   # ║ The minimum amount of TP needed for the gauge to begin flashing       ║
  82.   # ║ Example: 100                                                          ║
  83.   # ╚═══════════════════════════════════════════════════════════════════════╝
  84.     FLASH_TP_ACTIVATE = 100
  85.    
  86.   end # FLASH_TP
  87. end # COOLIE
  88.  
  89. class Window_Base < Window
  90. # ╔═══════════════════════════════════════════════════════════════════════════╗
  91. # ║ New Method: Random TP Gauge Color                                         ║
  92. # ╚═══════════════════════════════════════════════════════════════════════════╝
  93.   def random_tp_gauge_color
  94.     @cycle = rand(COOLIE::FLASH_TP::FLASH_TP_COLORS.count)
  95.     return COOLIE::FLASH_TP::FLASH_TP_COLORS[@cycle]
  96.   end # random_tp_gauge_color
  97.  
  98. # ╔═══════════════════════════════════════════════════════════════════════════╗
  99. # ║ Overwrite Method: Draw Actor TP                                           ║
  100. # ╚═══════════════════════════════════════════════════════════════════════════╝
  101.   def draw_actor_tp(actor, x, y, width = 124)
  102.     if actor.tp >= COOLIE::FLASH_TP::FLASH_TP_ACTIVATE
  103.       draw_gauge(x, y, width, actor.tp_rate, text_color(random_tp_gauge_color), text_color(random_tp_gauge_color))
  104.     else
  105.       draw_gauge(x, y, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  106.     end # if
  107.     change_color(system_color)
  108.     draw_text(x, y, 30, line_height, Vocab::tp_a)
  109.     change_color(tp_color(actor))
  110.     draw_text(x + width - 42, y, 42, line_height, actor.tp.to_i, 2)
  111.   end # draw_actor_tp
  112. end # Window_Base
  113.  
  114. class Scene_Battle < Scene_Base
  115. # ╔═══════════════════════════════════════════════════════════════════════════╗
  116. # ║ Alias Method: Update                                                      ║
  117. # ╚═══════════════════════════════════════════════════════════════════════════╝
  118.   alias flashing_tp_update update
  119.   def update
  120.     flashing_tp_update
  121.     refresh_status
  122.   end # update
  123.  
  124. # ╔═══════════════════════════════════════════════════════════════════════════╗
  125. # ║ Alias Method: Update For Wait                                             ║
  126. # ╚═══════════════════════════════════════════════════════════════════════════╝
  127.   alias flashing_tp_update_for_wait update_for_wait
  128.   def update_for_wait
  129.     flashing_tp_update_for_wait
  130.     refresh_status
  131.   end # update_for_wait
  132. end # Scene_Battle
  133. # ╔═══════════════════════════════════════════════════════════════════════════╗
  134. # ║ END OF SCRIPT                                                             ║
  135. # ╚═══════════════════════════════════════════════════════════════════════════╝
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement