Bigace360

Battler Stat: Barehand

Feb 11th, 2012
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.63 KB | None | 0 0
  1. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2. # ■ Battler Stat: Barehand
  3. # ■ Author: Bigace360
  4. # ■ Type: Actor Add-on
  5. # ■ Date: Feb, 2. 2012
  6. # ■ Version: 1.0
  7. #
  8. # For those that would like to give their actors stronger strength when no
  9. # weapon is equipped, there is a barehand stat now. You can adjust how strong
  10. # an actor's barehanded multiplier will grow each level so that way, you don't
  11. # have your actors going over the top strong from the beginning.
  12. #
  13. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  14. # Instructions
  15. # Just scroll down below and adjust the rules.
  16. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  17. # Compatibility
  18. # - Alias: Game_Actor: base_atk
  19. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  20. module ACE
  21.     # This is the multiplier given to base attack when no weapon is equipped.
  22.     BAREHAND_BASE_MULTIPLIER = 15
  23.     BAREHAND_PER_LEVEL_BOOST = 10
  24.     BARE_HAND_MAX_MULTIPLIER = 10
  25.     # This is the array listing actors who fight barehanded by default.
  26.     BAREHAND_ACTORS = [1, 2]
  27.     # This is the array of classes that can fight barehanded.
  28.     BAREHAND_CLASSES = [1, 7]
  29. end
  30. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  31. # ** Game_Party
  32. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  33. class Game_Party
  34.     include ACE
  35.     attr_accessor :barehand_actors
  36.     attr_accessor :barehand_classes
  37.     alias initialize_twohands initialize
  38.     def initialize
  39.         initialize_twohands
  40.         @barehand_actors = BAREHAND_ACTORS.dup
  41.         @barehand_classes = BAREHAND_CLASSES.dup
  42.     end
  43. end  
  44. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  45. # ** Game_Actor
  46. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  47. class Game_Actor < Game_Battler
  48.     include ACE
  49.     alias base_atk_bsb base_atk
  50.     def base_atk
  51.         n = base_atk_bsb
  52.         barehand_trait = self.barehanded?
  53.         n = barehanded_multiplier(n) if barehand_trait
  54.         return Integer(n)
  55.     end  
  56.     def weapons
  57.         result = [$data_weapons[@weapon_id]]
  58.         result.delete_if {|x| x == nil }
  59.         return result
  60.     end
  61.     def barehanded_multiplier(value)
  62.         multiplier = BAREHAND_BASE_MULTIPLIER
  63.         multiplier += BAREHAND_PER_LEVEL_BOOST * (@level - 1)
  64.         multiplier = [BARE_HAND_MAX_MULTIPLIER, multiplier].min
  65.         value *= multiplier
  66.         value /= 100
  67.         return value
  68.     end  
  69.     def barehanded?
  70.         if self.weapons == nil
  71.             return true if $game_party.barehand_actors.include?(@actor_id)
  72.             return true if $game_party.barehand_classes.include?(@class_id)
  73.         end
  74.         return false
  75.     end
  76. end
Advertisement
Add Comment
Please, Sign In to add comment