Guest User

Untitled

a guest
Feb 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.78 KB | None | 0 0
  1. #==============================================================================
  2. # ** TK - TK - Status Gauges
  3. #------------------------------------------------------------------------------
  4. # Autor: Takkun (a.k.a Faalco)
  5. # Create: 07/02/2018
  6. # Version: 1.0a
  7. #==============================================================================
  8. # * Instructions & Info:
  9. # -----------------------------------------------------------------------------
  10. # Paste the script above the main of your project, and make the necessary
  11. # settings.
  12. #
  13. # This script (Only the TK - Status Gauges) can be used for commercial and
  14. # non-commercial purposes, credits are welcome but not required.
  15. #
  16. # Any problems before the script can be taken on the topics of the same or by
  17. # personal message us forums in which I participate.
  18. #
  19. #==============================================================================
  20. ($imported ||= {})["TK - Status Gauges"] = true
  21. #==============================================================================
  22. # ** Colors
  23. #------------------------------------------------------------------------------
  24. # The RGBA color Module.
  25. #==============================================================================
  26. module Colors
  27. #--------------------------------------------------------------------------
  28. # * Color1 (Darker)
  29. #--------------------------------------------------------------------------
  30. Color1 = [
  31. Color.new(255, 140, 0), #MHP
  32. Color.new(65, 105, 225), #MMP
  33. Color.new(220,20,60), #ATK
  34. Color.new(34, 139, 34), #DEF
  35. Color.new(255, 20, 147), #MAT
  36. Color.new(153, 50, 204) #MDF
  37. ]
  38. #--------------------------------------------------------------------------
  39. # * Color2 (Light)
  40. #--------------------------------------------------------------------------
  41. Color2 = [
  42. Color.new(255, 165, 0), #MHP
  43. Color.new(135, 206, 250), #MMP
  44. Color.new(255, 0, 0), #ATK
  45. Color.new(144, 238, 144), #DEF
  46. Color.new(255, 182, 193), #MAT
  47. Color.new(218, 112, 214) #MDF
  48. ]
  49. end
  50. #==============================================================================
  51. # ** Game_BattlerBase
  52. #------------------------------------------------------------------------------
  53. # This base class handles battlers. It mainly contains methods for calculating
  54. # parameters. It is used as a super class of the Game_Battler class.
  55. #==============================================================================
  56.  
  57. class Game_BattlerBase
  58. #--------------------------------------------------------------------------
  59. # * Get Maximum Value of Parameter
  60. #--------------------------------------------------------------------------
  61. def param_max(param_id)
  62. return 999999 if param_id == 0 # MHP
  63. return 9999 if param_id == 1 # MMP
  64. return 500
  65. end
  66. end
  67. #==============================================================================
  68. # ** Window_Base
  69. #------------------------------------------------------------------------------
  70. # This is a super class of all windows within the game.
  71. #==============================================================================
  72.  
  73. class Window_Base < Window
  74. #--------------------------------------------------------------------------
  75. # * Draw Gauge
  76. # rate : Rate (full at 1.0)
  77. # color1 : Left side gradation
  78. # color2 : Right side gradation
  79. #--------------------------------------------------------------------------
  80. def draw_gauge(x, y, width, rate, color1, color2)
  81. fill_w = (width * rate).to_i
  82. gauge_y = y + line_height - 8
  83. contents.fill_rect(x - 2, gauge_y - 2, width + 4, 10, Color.new(0, 0, 0))
  84. contents.fill_rect(x - 1, gauge_y - 1, width + 2, 8, Color.new(255, 255, 255))
  85. contents.fill_rect(x, gauge_y, width, 6, gauge_back_color)
  86. contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2)
  87. end
  88. end
  89. #==============================================================================
  90. # ** Window_Status
  91. #------------------------------------------------------------------------------
  92. # This window displays full status specs on the status screen.
  93. #==============================================================================
  94.  
  95. class Window_Status < Window_Selectable
  96. #--------------------------------------------------------------------------
  97. # * Draw Parameters
  98. #--------------------------------------------------------------------------
  99. def draw_parameters(x, y)
  100. 6.times { |i|
  101. draw_gauge(
  102. x,
  103. y + line_height * i,
  104. 164,
  105. @actor.param(i).to_f / @actor.param_max(i).to_f,
  106. Colors::Color1[i],
  107. Colors::Color2[i]
  108. )
  109. change_color(system_color)
  110. draw_text(x, y + line_height * i, 50, line_height, Vocab::param(i))
  111. draw_current_and_max_values(x, y + line_height * i, 164, @actor.param(i), @actor.param_max(i),
  112. hp_color(@actor), normal_color)
  113. }
  114. end
  115. end
Add Comment
Please, Sign In to add comment