khanhdu

# TheoAllen - Display Parameter Change

Nov 16th, 2017
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.64 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. # (This script documentation is written in informal indonesian language)
  6. # =============================================================================
  7. ($imported ||= {})[:Theo_DisplayParamChange] = true
  8. # =============================================================================
  9. # Change Logs:
  10. # -----------------------------------------------------------------------------
  11. # 2013.11.12 - Finished Script
  12. # =============================================================================
  13. =begin
  14.  
  15.   Perkenalan :
  16.   Script ini membuat kamu tahu berapa perubahaan parameter actor di dalam
  17.   status window
  18.  
  19.   Cara penggunaan :
  20.   Pasang script ini dibawah material namun diatas main.
  21.   Disarankan pasang script ini di bagian atas dari script lain
  22.  
  23.   Terms of use :
  24.   Credit gw, TheoAllen. Kalo semisal u bisa ngedit2 script gw trus jadi lebih
  25.   keren, terserah. Ane bebasin. Asal ngga ngeklaim aja. Kalo semisal mau
  26.   dipake buat komersil, jangan lupa, gw dibagi gratisannya.
  27.  
  28. =end
  29. # =============================================================================
  30. # Tidak ada konfigurasi
  31. # =============================================================================
  32. class Window_Base < Window
  33.   # --------------------------------------------------------------------------
  34.   # Overwrite draw actor param
  35.   # --------------------------------------------------------------------------
  36.   alias theo_show_add_param draw_actor_param
  37.   def draw_actor_param(actor, x, y, param_id, ori_method = false)
  38.     return theo_show_add_param(actor, x,y, param_id) if ori_method
  39.     change_color(system_color)
  40.     draw_text(x, y, 120, line_height, Vocab::param(param_id))
  41.     change_color(normal_color)
  42.     ori_param = actor.param_base(param_id)
  43.     w = text_size(ori_param.to_s).width
  44.     draw_text(x + 120 - w, y, 36, line_height, ori_param, 2)
  45.     param_diff = actor.param_diff(param_id)
  46.     return if param_diff == 0
  47.     if param_diff > 0
  48.       change_color(power_up_color)
  49.     elsif param_diff < 0
  50.       change_color(power_down_color)
  51.     end
  52.     draw_text(x + 120 + w, y, contents.width, line_height,
  53.       actor.param_diff_s(param_id))
  54.   end
  55.  
  56. end
  57.  
  58. class Game_Actor < Game_Battler
  59.  
  60.   def param_diff(param_id)
  61.     param(param_id) - param_base(param_id)
  62.   end
  63.  
  64.   def param_diff_s(param_id)
  65.     value = param_diff(param_id)
  66.     return sprintf("(+%d)", value) if value > 0
  67.     return sprintf("(%d)", value) if value < 0
  68.     return ""
  69.   end
  70.  
  71. end
Add Comment
Please, Sign In to add comment