TheoAllen

Theo - Display Parameter Change (ENG)

Nov 12th, 2013
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.69 KB | None | 0 0
  1. # =============================================================================
  2. # TheoAllen - Display Parameter Change
  3. # Version : 1.0
  4. # Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
  5. # (English Documentation)
  6. # =============================================================================
  7. ($imported ||= {})[:Theo_DisplayParamChange] = true
  8. # =============================================================================
  9. # Change Logs:
  10. # -----------------------------------------------------------------------------
  11. # 2013.11.12 - Finished Script
  12. # =============================================================================
  13. =begin
  14.  
  15.   Introduction :
  16.   This script show the character original parameter and its additional value
  17.   in the status menu. The additional parameter value is based on status, equip
  18.   and features. While original parameter is based on actor's class
  19.  
  20.   How to use :
  21.   Put this script below material but above main
  22.   It's recommended to puts this script above all others
  23.  
  24.   Terms of use :
  25.   Credit me, TheoAllen. You are free to edit this script by your own. As long
  26.   as you don't claim it yours. For commercial purpose, don't forget to give me
  27.   a free copy of the game.
  28.  
  29. =end
  30. # =============================================================================
  31. # Do not touch pass this line
  32. # =============================================================================
  33. class Window_Base < Window
  34.   # --------------------------------------------------------------------------
  35.   # Overwrite draw actor param
  36.   # --------------------------------------------------------------------------
  37.   alias theo_show_add_param draw_actor_param
  38.   def draw_actor_param(actor, x, y, param_id, ori_method = false)
  39.     return theo_show_add_param(actor, x,y, param_id) if ori_method
  40.     change_color(system_color)
  41.     draw_text(x, y, 120, line_height, Vocab::param(param_id))
  42.     change_color(normal_color)
  43.     ori_param = actor.param_base(param_id)
  44.     w = text_size(ori_param.to_s).width
  45.     draw_text(x + 120 - w, y, 36, line_height, ori_param, 2)
  46.     param_diff = actor.param_diff(param_id)
  47.     return if param_diff == 0
  48.     if param_diff > 0
  49.       change_color(power_up_color)
  50.     elsif param_diff < 0
  51.       change_color(power_down_color)
  52.     end
  53.     draw_text(x + 120 + w, y, contents.width, line_height,
  54.       actor.param_diff_s(param_id))
  55.   end
  56.  
  57. end
  58.  
  59. class Game_Actor < Game_Battler
  60.  
  61.   def param_diff(param_id)
  62.     param(param_id) - param_base(param_id)
  63.   end
  64.  
  65.   def param_diff_s(param_id)
  66.     value = param_diff(param_id)
  67.     return sprintf("(+%d)", value) if value > 0
  68.     return sprintf("(%d)", value) if value < 0
  69.     return ""
  70.   end
  71.  
  72. end
Advertisement
Add Comment
Please, Sign In to add comment