Advertisement
roninator2

Blackmorning Status addon - KMS gauges

Dec 5th, 2024
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 5.80 KB | None | 0 0
  1. #==============================================================================
  2. # Compatibility Patch :                                        v1.01 (05/10/20)
  3. #   BlackMorning Status Addon + KMS Generic Gauge
  4. #==============================================================================
  5. # Script by:
  6. #     Mr. Bubble - recreated by Roninator2
  7. #--------------------------------------------------------------------------
  8. # Place this script below both BlackMorning Status Addon and KMS Generic Gauge
  9. # in your script edtior.
  10. #
  11. #==============================================================================
  12. # Updtae: 2020/10/08 Added option to use different images for stats
  13. #==============================================================================
  14.  
  15. $imported = {} if $imported.nil?
  16. $kms_imported = {} if $kms_imported.nil?
  17.  
  18. module Bubs
  19.   module BMPatch
  20.     # * Gauge File Names
  21.     #  Images must be placed in the "Graphics/System" folder of your project
  22.     BMSTATUS_STAT_IMAGE = "GaugeBlue"
  23.     BMSTATUS_EXP_IMAGE = "GaugeEXP"
  24.     # Use a different image for each stat?
  25.     STAT_COLOR = true
  26.     BMSTATUS_ATK_IMAGE = "GaugeBGM"
  27.     BMSTATUS_MAT_IMAGE = "GaugeBGS"
  28.     BMSTATUS_AGI_IMAGE = "GaugeGreen"
  29.     BMSTATUS_DEF_IMAGE = "GaugeMP"
  30.     BMSTATUS_MDF_IMAGE = "GaugeHP"
  31.     BMSTATUS_LUK_IMAGE = "GaugeEXP"
  32.    
  33.     # * Gauge Position Offset [x, y]
  34.     BMSTATUS_STAT_OFFSET = [-23, -2]
  35.  
  36.     # * Gauge Length Adjustment
  37.     BMSTATUS_STAT_LENGTH = -4
  38.  
  39.     # * Gauge Length Adjustment
  40.     BMSTATUS_EXP_LENGTH = -30
  41.     # adjust the exp x gauge position
  42.     BMSTATUS_EXP_XPOS = 5
  43.  
  44.     # * Gauge Slope
  45.     #   Must be between -89 ~ 89 degrees
  46.     BMSTATUS_STAT_SLOPE = 30
  47.   end
  48. end
  49.  
  50. #==============================================================================
  51. # ■ Window_MainMenuStatus
  52. #==============================================================================
  53.  
  54. if $imported[:bm_status] && $kms_imported["GenericGauge"]
  55. class Window_StatusItem < Window_Base
  56.  
  57.   def draw_general_parameters(dx)
  58.     actor = @actor
  59.     dy = line_height * 3 / 2
  60.     dw = (contents.width - dx) / 3 - 6    
  61.     xpos = Bubs::BMPatch::BMSTATUS_EXP_XPOS
  62.     draw_actor_level(dx + dw * 0, line_height * 0 + dy, dw)
  63.     draw_actor_exp(dx + dw * 1 + 6, line_height * 0 + dy, (dw + 3)*2)
  64.     draw_actor_exp_gauge(actor, dx + dw + xpos, line_height * 0.7 + dy, (dw+15)*2) if BM::STATUS::GAUGE[:exp]
  65.     draw_actor_param(0, dx + dw * 0, line_height * 2 + dy, dw)
  66.     draw_actor_hp_gauge(actor, dx + dw * 0, line_height * 2.7 + dy, dw) if BM::STATUS::GAUGE[:hp]
  67.     draw_actor_param(1, dx + dw * 1 + 6, line_height * 2 + dy, dw)
  68.     draw_actor_mp_gauge(actor, dx + dw * 1 + 6, line_height * 2.7 + dy, dw) if BM::STATUS::GAUGE[:mp]
  69.     draw_actor_tp(@actor, dx + dw * 2 + 12, line_height * 2 + dy, dw)
  70.     draw_actor_tp_gauge(actor, dx + dw * 2 + 12, line_height * 2.7 + dy, dw) if BM::STATUS::GAUGE[:tp]
  71.    
  72.     draw_actor_param(2, dx + dw * 0, line_height * 4 + dy, dw)
  73.     draw_actor_param(4, dx + dw * 1 + 6, line_height * 4 + dy, dw)
  74.     draw_actor_param(6, dx + dw * 2 + 12, line_height * 4 + dy, dw)
  75.     dy += 6
  76.     draw_actor_param(3, dx + dw * 0, line_height * 5 + dy, dw)
  77.     draw_actor_param(5, dx + dw * 1 + 6, line_height * 5 + dy, dw)
  78.     draw_actor_param(7, dx + dw * 2 + 12, line_height * 5 + dy, dw)
  79.     if BM::STATUS::GAUGE[:param]
  80.       if Bubs::BMPatch::STAT_COLOR == false
  81.         file = Bubs::BMPatch::BMSTATUS_STAT_IMAGE
  82.         offset = Bubs::BMPatch::BMSTATUS_STAT_OFFSET
  83.         len_offset = Bubs::BMPatch::BMSTATUS_STAT_LENGTH
  84.         slope = Bubs::BMPatch::BMSTATUS_STAT_SLOPE
  85.         draw_generic_gauge(file, dx + dw * 0, line_height * 4.1 + dy, dw, param_ratio(@actor,2), offset, len_offset, slope)
  86.         draw_generic_gauge(file, dx + dw * 1+6, line_height * 4.1 + dy, dw, param_ratio(@actor,4), offset, len_offset, slope)
  87.         draw_generic_gauge(file, dx + dw * 2+12, line_height * 4.1 + dy, dw, param_ratio(@actor,6), offset, len_offset, slope)
  88.         dy += 6
  89.         draw_generic_gauge(file, dx + dw * 0, line_height * 5.1 + dy, dw, param_ratio(@actor,3), offset, len_offset, slope)
  90.         draw_generic_gauge(file, dx + dw * 1+6, line_height * 5.1 + dy, dw, param_ratio(@actor,5), offset, len_offset, slope)
  91.         draw_generic_gauge(file, dx + dw * 2+12, line_height * 5.1 + dy, dw, param_ratio(@actor,7), offset, len_offset, slope)
  92.       else
  93.         offset = Bubs::BMPatch::BMSTATUS_STAT_OFFSET
  94.         len_offset = Bubs::BMPatch::BMSTATUS_STAT_LENGTH
  95.         slope = Bubs::BMPatch::BMSTATUS_STAT_SLOPE
  96.         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)
  97.         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)
  98.         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)
  99.         dy += 6
  100.         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)
  101.         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)
  102.         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)
  103.       end
  104.     end
  105.   end
  106.   def draw_actor_exp_gauge(actor, x, y, width = 160)
  107.     draw_generic_gauge(Bubs::BMPatch::BMSTATUS_EXP_IMAGE,
  108.       x, y, width, actor.exp_rate,
  109.       Bubs::BMPatch::BMSTATUS_STAT_OFFSET,
  110.       Bubs::BMPatch::BMSTATUS_EXP_LENGTH,
  111.       Bubs::BMPatch::BMSTATUS_STAT_SLOPE
  112.     )
  113.   end
  114. end
  115. end # if $imported["Galv_Menu_Themes"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement