Advertisement
AlliedG

Untitled

Feb 9th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. #==============================================================================
  2. # ** Game_BattlerBase
  3. #------------------------------------------------------------------------------
  4. # This base class handles battlers. It mainly contains methods for calculating
  5. # parameters. It is used as a super class of the Game_Battler class.
  6. #==============================================================================
  7.  
  8. class Game_BattlerBase
  9. #--------------------------------------------------------------------------
  10. # * Get Rate of Change Due to Parameter Buff/Debuff
  11. #--------------------------------------------------------------------------
  12. def additive_buff_rate(param_id)
  13. @buffs[param_id] * 0.25
  14. end
  15. #--------------------------------------------------------------------------
  16. # * Get Rate of Parameter Change
  17. #--------------------------------------------------------------------------
  18. def additive_param_rate(param_id)
  19. features_with_id(FEATURE_PARAM, param_id).inject(0.0) {|r, ft| r += (ft.value - 1.0) }
  20. end
  21. #--------------------------------------------------------------------------
  22. # * Get Parameter
  23. #--------------------------------------------------------------------------
  24. def param(param_id)
  25. value = param_base(param_id) + param_plus(param_id)
  26. value += param_base(param_id) * additive_param_rate(param_id)
  27. value += param_base(param_id) * additive_buff_rate(param_id)
  28. [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  29. end
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement