Advertisement
roninator2

Black Morning Status - KMS Generic Gauge

Nov 21st, 2024
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 10.79 KB | None | 0 0
  1. # ╔═══════════════════════════════════════════════╦════════════════════╗
  2. # ║ Title: BM Status Addon for KMS Generic Gauge  ║  Version: 1.00     ║
  3. # ║ Author: Roninator2                            ║                    ║
  4. # ╠═══════════════════════════════════════════════╬════════════════════╣
  5. # ║ Function:                                     ║   Date Created     ║
  6. # ║                                               ╠════════════════════╣
  7. # ║   Compatibility Patch                         ║    08 Oct 2020     ║
  8. # ╚═══════════════════════════════════════════════╩════════════════════╝
  9. # ╔════════════════════════════════════════════════════════════════════╗
  10. # ║ Requires: BlackMorning Status Addon                                ║
  11. # ║           KMS Generic Gauge                                        ║
  12. # ╚════════════════════════════════════════════════════════════════════╝
  13. # ╔════════════════════════════════════════════════════════════════════╗
  14. # ║ Brief Description:                                                 ║
  15. # ║       Compatibility addon                                          ║
  16. # ╚════════════════════════════════════════════════════════════════════╝
  17. # ╔════════════════════════════════════════════════════════════════════╗
  18. # ║ Instructions:                                                      ║
  19. # ║   Configure settings below                                         ║
  20. # ║   Added option to use different images for stats                   ║
  21. # ╚════════════════════════════════════════════════════════════════════╝
  22. # ╔════════════════════════════════════════════════════════════════════╗
  23. # ║ Updates:                                                           ║
  24. # ║ 1.00 - 08 Oct 2020 - Script finished                               ║
  25. # ║                                                                    ║
  26. # ╚════════════════════════════════════════════════════════════════════╝
  27. # ╔════════════════════════════════════════════════════════════════════╗
  28. # ║ Credits and Thanks:                                                ║
  29. # ║   Roninator2                                                       ║
  30. # ║   Mr. Bubble                                                       ║
  31. # ╚════════════════════════════════════════════════════════════════════╝
  32. # ╔════════════════════════════════════════════════════════════════════╗
  33. # ║ Terms of use:                                                      ║
  34. # ║  Follow the original Authors terms of use where applicable         ║
  35. # ║    - When not made by me (Roninator2)                              ║
  36. # ║  Free for all uses in RPG Maker except nudity                      ║
  37. # ║  Anyone using this script in their project before these terms      ║
  38. # ║  were changed are allowed to use this script even if it conflicts  ║
  39. # ║  with these new terms. New terms effective 03 Apr 2024             ║
  40. # ║  No part of this code can be used with AI programs or tools        ║
  41. # ║  Credit must be given                                              ║
  42. # ╚════════════════════════════════════════════════════════════════════╝
  43.  
  44. module Bubs
  45.   module BMPatch
  46.     # * Gauge File Names
  47.     #  Images must be placed in the "Graphics/System" folder of your project
  48.     BMSTATUS_STAT_IMAGE = "GaugeBlue"
  49.     BMSTATUS_EXP_IMAGE = "GaugeEXP"
  50.     # Use a different image for each stat?
  51.     STAT_COLOR = true
  52.     BMSTATUS_ATK_IMAGE = "GaugeBGM"
  53.     BMSTATUS_MAT_IMAGE = "GaugeBGS"
  54.     BMSTATUS_AGI_IMAGE = "GaugeGreen"
  55.     BMSTATUS_DEF_IMAGE = "GaugeMP"
  56.     BMSTATUS_MDF_IMAGE = "GaugeHP"
  57.     BMSTATUS_LUK_IMAGE = "GaugeEXP"
  58.    
  59.     # * Gauge Position Offset [x, y]
  60.     BMSTATUS_STAT_OFFSET = [-23, -2]
  61.  
  62.     # * Gauge Length Adjustment
  63.     BMSTATUS_STAT_LENGTH = -4
  64.  
  65.     # * Gauge Length Adjustment
  66.     BMSTATUS_EXP_LENGTH = -30
  67.     # adjust the exp x gauge position
  68.     BMSTATUS_EXP_XPOS = 5
  69.  
  70.     # * Gauge Slope
  71.     #   Must be between -89 ~ 89 degrees
  72.     BMSTATUS_STAT_SLOPE = 30
  73.   end
  74. end
  75.  
  76. # ╔════════════════════════════════════════════════════════════════════╗
  77. # ║                      End of editable region                        ║
  78. # ╚════════════════════════════════════════════════════════════════════╝
  79.  
  80. $imported = {} if $imported.nil?
  81. $kms_imported = {} if $kms_imported.nil?
  82.  
  83. #==============================================================================
  84. # ■ Window_MainMenuStatus
  85. #==============================================================================
  86.  
  87. if $imported[:bm_status] && $kms_imported["GenericGauge"]
  88. class Window_StatusItem < Window_Base
  89.  
  90.   def draw_general_parameters(dx)
  91.     actor = @actor
  92.     dy = line_height * 3 / 2
  93.     dw = (contents.width - dx) / 3 - 6    
  94.     xpos = Bubs::BMPatch::BMSTATUS_EXP_XPOS
  95.     draw_actor_level(dx + dw * 0, line_height * 0 + dy, dw)
  96.     draw_actor_exp(dx + dw * 1 + 6, line_height * 0 + dy, (dw + 3)*2)
  97.     draw_actor_exp_gauge(actor, dx + dw + xpos, line_height * 0.7 + dy, (dw+15)*2) if BM::STATUS::GAUGE[:exp]
  98.     draw_actor_param(0, dx + dw * 0, line_height * 2 + dy, dw)
  99.     draw_actor_hp_gauge(actor, dx + dw * 0, line_height * 2.7 + dy, dw) if BM::STATUS::GAUGE[:hp]
  100.     draw_actor_param(1, dx + dw * 1 + 6, line_height * 2 + dy, dw)
  101.     draw_actor_mp_gauge(actor, dx + dw * 1 + 6, line_height * 2.7 + dy, dw) if BM::STATUS::GAUGE[:mp]
  102.     draw_actor_tp(@actor, dx + dw * 2 + 12, line_height * 2 + dy, dw)
  103.     draw_actor_tp_gauge(actor, dx + dw * 2 + 12, line_height * 2.7 + dy, dw) if BM::STATUS::GAUGE[:tp]
  104.    
  105.     draw_actor_param(2, dx + dw * 0, line_height * 4 + dy, dw)
  106.     draw_actor_param(4, dx + dw * 1 + 6, line_height * 4 + dy, dw)
  107.     draw_actor_param(6, dx + dw * 2 + 12, line_height * 4 + dy, dw)
  108.     dy += 6
  109.     draw_actor_param(3, dx + dw * 0, line_height * 5 + dy, dw)
  110.     draw_actor_param(5, dx + dw * 1 + 6, line_height * 5 + dy, dw)
  111.     draw_actor_param(7, dx + dw * 2 + 12, line_height * 5 + dy, dw)
  112.     if BM::STATUS::GAUGE[:param]
  113.       if Bubs::BMPatch::STAT_COLOR == false
  114.         file = Bubs::BMPatch::BMSTATUS_STAT_IMAGE
  115.         offset = Bubs::BMPatch::BMSTATUS_STAT_OFFSET
  116.         len_offset = Bubs::BMPatch::BMSTATUS_STAT_LENGTH
  117.         slope = Bubs::BMPatch::BMSTATUS_STAT_SLOPE
  118.         draw_generic_gauge(file, dx + dw * 0, line_height * 4.1 + dy, dw, param_ratio(@actor,2), offset, len_offset, slope)
  119.         draw_generic_gauge(file, dx + dw * 1+6, line_height * 4.1 + dy, dw, param_ratio(@actor,4), offset, len_offset, slope)
  120.         draw_generic_gauge(file, dx + dw * 2+12, line_height * 4.1 + dy, dw, param_ratio(@actor,6), offset, len_offset, slope)
  121.         dy += 6
  122.         draw_generic_gauge(file, dx + dw * 0, line_height * 5.1 + dy, dw, param_ratio(@actor,3), offset, len_offset, slope)
  123.         draw_generic_gauge(file, dx + dw * 1+6, line_height * 5.1 + dy, dw, param_ratio(@actor,5), offset, len_offset, slope)
  124.         draw_generic_gauge(file, dx + dw * 2+12, line_height * 5.1 + dy, dw, param_ratio(@actor,7), offset, len_offset, slope)
  125.       else
  126.         offset = Bubs::BMPatch::BMSTATUS_STAT_OFFSET
  127.         len_offset = Bubs::BMPatch::BMSTATUS_STAT_LENGTH
  128.         slope = Bubs::BMPatch::BMSTATUS_STAT_SLOPE
  129.         draw_generic_gauge(Bubs::BMPatch::BMSTATUS_ATK_IMAGE, dx + dw * 0, line_height * 4.1 + dy, dw, param_ratio(@actor,2), offset, len_offset, slope)
  130.         draw_generic_gauge(Bubs::BMPatch::BMSTATUS_MAT_IMAGE, dx + dw * 1+6, line_height * 4.1 + dy, dw, param_ratio(@actor,4), offset, len_offset, slope)
  131.         draw_generic_gauge(Bubs::BMPatch::BMSTATUS_AGI_IMAGE, dx + dw * 2+12, line_height * 4.1 + dy, dw, param_ratio(@actor,6), offset, len_offset, slope)
  132.         dy += 6
  133.         draw_generic_gauge(Bubs::BMPatch::BMSTATUS_DEF_IMAGE, dx + dw * 0, line_height * 5.1 + dy, dw, param_ratio(@actor,3), offset, len_offset, slope)
  134.         draw_generic_gauge(Bubs::BMPatch::BMSTATUS_MDF_IMAGE, dx + dw * 1+6, line_height * 5.1 + dy, dw, param_ratio(@actor,5), offset, len_offset, slope)
  135.         draw_generic_gauge(Bubs::BMPatch::BMSTATUS_LUK_IMAGE, dx + dw * 2+12, line_height * 5.1 + dy, dw, param_ratio(@actor,7), offset, len_offset, slope)
  136.       end
  137.     end
  138.   end
  139.   def draw_actor_exp_gauge(actor, x, y, width = 160)
  140.     draw_generic_gauge(Bubs::BMPatch::BMSTATUS_EXP_IMAGE,
  141.       x, y, width, actor.exp_rate,
  142.       Bubs::BMPatch::BMSTATUS_STAT_OFFSET,
  143.       Bubs::BMPatch::BMSTATUS_EXP_LENGTH,
  144.       Bubs::BMPatch::BMSTATUS_STAT_SLOPE
  145.     )
  146.   end
  147. end
  148. end # if $imported["Galv_Menu_Themes"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement