vindaca510

V's Best Class Stats v1.0

Dec 10th, 2013
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 8.24 KB | None | 0 0
  1. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  2. #                                                                              #
  3. #                             V's Best Class Stats                             #
  4. #                                 Version  1.0                                 #
  5. #                                                                              #
  6. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  7. #                                Written By:  V                                #
  8. #                        Last Edited:  December 9, 2013                        #
  9. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  10. #                                                                              #
  11. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  12.  
  13.  
  14. #==============================================================================#
  15. #------------------------------------------------------------------------------#
  16. # ** Disclaimer                                                                #
  17. #------------------------------------------------------------------------------#
  18. #                                                                              #
  19. # This script was intended for Non-commercial use only, if you wish to use     #
  20. # this script in a commercial game please PM me at which ever site you found   #
  21. # this script. Either way please give me credit in your game script as the     #
  22. # writer of this script, and send me a PM abuot the release of the game/demo.  #
  23. #                                                                              #
  24. #------------------------------------------------------------------------------#
  25. # ** How To Use                                                                #
  26. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  27. #                                                                              #
  28. # * This script is Plug & Play.                                                #
  29. #                                                                              #
  30. #------------------------------------------------------------------------------#
  31. # ** Description                                                               #
  32. #------------------------------------------------------------------------------#
  33. #                                                                              #
  34. #  v0.1                                                                        #
  35. # ~=~=~=~                                                                      #
  36. #  * This script automatically finds the highest stat for each of the actors   #
  37. #    classes. This includes params, xparams, sparams, atk speed, atk times,    #
  38. #    action times, equip weapon types and equip armor types.                   #
  39. #                                                                              #
  40. #------------------------------------------------------------------------------#
  41. #==============================================================================#
  42. #==============================================================================
  43. # ** V's Best Class Stats
  44. #==============================================================================
  45. #==============================================================================
  46. # ** Game_Actor
  47. #------------------------------------------------------------------------------
  48. #  This class handles actors. It is used within the Game_Actors class
  49. # ($game_actors) and is also referenced from the Game_Party class ($game_party).
  50. #==============================================================================
  51.  
  52. class Game_Actor < Game_Battler
  53.  
  54.   #--------------------------------------------------------------------------
  55.   # * Object Initialization
  56.   #--------------------------------------------------------------------------
  57.   alias :i473453380004404400 :initialize
  58.  
  59.   #--------------------------------------------------------------------------
  60.   # * Object Initialization
  61.   #--------------------------------------------------------------------------
  62.   def initialize(actor_id)
  63.     i473453380004404400(actor_id)
  64.     @atks = 0.0
  65.     @atkt = 0.0
  66.   end
  67.  
  68.   #--------------------------------------------------------------------------
  69.   # * Returns All Of The Actor Classes
  70.   #--------------------------------------------------------------------------
  71.   def classes
  72.     classes = []
  73.     @exp.each { |i, v| classes.push i}
  74.     return classes
  75.   end
  76.  
  77.   #--------------------------------------------------------------------------
  78.   # * Get Parameter
  79.   #--------------------------------------------------------------------------
  80.   def param(param_id)
  81.     param = 0
  82.     classes.each { |i|
  83.       param = $data_classes[i].params[param_id, @level] if $data_classes[i].params[param_id, @level] > param
  84.     }
  85.     value = param + param_plus(param_id)
  86.     value *= param_rate(param_id) * param_buff_rate(param_id)
  87.     [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  88.   end
  89.  
  90.   #--------------------------------------------------------------------------
  91.   # * Get Ex-Parameter
  92.   #--------------------------------------------------------------------------
  93.   def xparam(xparam_id)
  94.     xparam = 0.0
  95.     classes.each { |i|
  96.       $data_classes[i].features.each { |f|
  97.         if f.code == 22 && f.data_id == xparam_id
  98.           xparam = f.value if f.value > xparam_id
  99.         end
  100.       }
  101.     }
  102.     return xparam
  103.   end
  104.  
  105.   #--------------------------------------------------------------------------
  106.   # * Get Sp-Parameter
  107.   #--------------------------------------------------------------------------
  108.   def sparam(sparam_id)
  109.     sparam = 0.0
  110.     classes.each { |i|
  111.       $data_classes[i].features.each { |f|
  112.         if f.code == 23 && f.data_id == sparam_id
  113.           sparam = f.value if f.value > sparam_id
  114.         end
  115.       }
  116.     }
  117.     return sparam
  118.   end
  119.  
  120.   #--------------------------------------------------------------------------
  121.   # * Determine Action Times
  122.   #--------------------------------------------------------------------------
  123.   def make_action_times
  124.     actp = 1.0
  125.     classes.each { |i|
  126.       $data_classes[i].features.each { |f|
  127.         if f.code == 61
  128.           actp = f.value if f.value > actp
  129.         end
  130.       }
  131.     }
  132.     return actp
  133.   end
  134.  
  135.   #--------------------------------------------------------------------------
  136.   # * Attack Speed
  137.   #--------------------------------------------------------------------------
  138.   def atk_speed
  139.     atkt = 0.0
  140.     classes.each { |i|
  141.       $data_classes[i].features.each { |f|
  142.         if f.code == 34
  143.           atkt = f.value if f.value > atkt
  144.         end
  145.       }
  146.     }
  147.     return atkt
  148.   end
  149.  
  150.   #--------------------------------------------------------------------------
  151.   # * Change Additional Attack Times
  152.   #--------------------------------------------------------------------------
  153.   def atk_times_add
  154.     atks = 0.0
  155.     classes.each { |i|
  156.       $data_classes[i].features.each { |f|
  157.         if f.code == 33
  158.           atks = f.value if f.value > atks
  159.         end
  160.       }
  161.     }
  162.     return atks
  163.   end
  164.  
  165.   #--------------------------------------------------------------------------
  166.   # * Determine if Weapon Can Be Equipped
  167.   #--------------------------------------------------------------------------
  168.   def equip_wtype_ok?(wtype_id)
  169.     enabled = false
  170.     classes.each { |i|
  171.       $data_classes[i].features.each { |f|
  172.         if f.code == 51 && f.data_id == wtype_id
  173.           enabled = true
  174.           return enabled
  175.         end
  176.       }
  177.     }
  178.     return enabled
  179.   end
  180.  
  181.   #--------------------------------------------------------------------------
  182.   # * Determine if Armor Can Be Equipped
  183.   #--------------------------------------------------------------------------
  184.   def equip_atype_ok?(atype_id)
  185.     enabled = false
  186.     classes.each { |i|
  187.       $data_classes[i].features.each { |f|
  188.         if f.code == 52 && f.data_id == atype_id
  189.           enabled = true
  190.           return enabled
  191.         end
  192.       }
  193.     }
  194.     return enabled
  195.   end
  196.    
  197. end#<-- End Class===============================================================
Advertisement
Add Comment
Please, Sign In to add comment