Advertisement
LiTTleDRAgo

[RGSS] DRG Item Passive Stat

Feb 20th, 2013
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.43 KB | None | 0 0
  1. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
  2. # DRG Item Passive Stat
  3. # Version: 1.12
  4. # Author : LiTTleDRAgo
  5. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
  6. #==============================================================================
  7. # ** Game_Party
  8. #------------------------------------------------------------------------------
  9. #  This class handles the party. It includes information on amount of gold
  10. #  and items. Refer to "$game_party" for the instance of this class.
  11. #==============================================================================
  12.  
  13. class Game_Party
  14.   #--------------------------------------------------------------------------
  15.   # * ITEM STAT
  16.   #--------------------------------------------------------------------------
  17.   ITEM_STAT = {
  18.   :id => [ :hp, :sp, :str, :dex, :agi, :int, :atk, :pdef, :mdef, :eva],
  19.     1 => [   0,   0,    0,    1,    1,    0,    0,     1,     0,   10],
  20.     2 => [   0,   0,    0,    1,    1,    0,    0,     1,     0,   10],
  21.   }
  22.   #--------------------------------------------------------------------------
  23.   # * ARMOR AND WEAPON
  24.   #--------------------------------------------------------------------------
  25.   WEAPON_STAT = {
  26.     1 => [  30,   0,    0,    0,    0,   40,   53,    34,    30,   10],
  27.   }
  28.   ARMOR_STAT = {
  29.     1 => [ 300,   0,    0,    0,    0,   40,   53,    34,    30,   10],
  30.   }
  31.   #--------------------------------------------------------------------------
  32.   # * END CONFIG
  33.   #--------------------------------------------------------------------------
  34.  
  35.   #--------------------------------------------------------------------------
  36.   # * Item Stat Plus
  37.   #--------------------------------------------------------------------------
  38.   def item_stat_plus
  39.     summ = Array.new(12,0)
  40.     summ.each_index {|s|
  41.     @items.each_pair  {|x,y| summ[s]+=((ITEM_STAT[x]||[])[s]||0)  *@items[x]  }
  42.     @weapons.each_pair{|x,y| summ[s]+=((WEAPON_STAT[x]||[])[s]||0)*@weapons[x]}
  43.     @armors.each_pair {|x,y| summ[s]+=((ARMOR_STAT[x]||[])[s]||0) *@armors[x] }
  44.     @actors.each{|actor| summ[s]+=((WEAPON_STAT[actor.weapon_id]||[])[s]||0)
  45.                          summ[s]+=((ARMOR_STAT[actor.armor1_id]||[])[s]||0)
  46.                          summ[s]+=((ARMOR_STAT[actor.armor2_id]||[])[s]||0)
  47.                          summ[s]+=((ARMOR_STAT[actor.armor3_id]||[])[s]||0)
  48.                          summ[s]+=((ARMOR_STAT[actor.armor4_id]||[])[s]||0)}}
  49.     return summ
  50.   end  
  51. end
  52. #==============================================================================
  53. # ** Game_Actor
  54. #------------------------------------------------------------------------------
  55. #  This class handles the actor. It's used within the Game_Actors class
  56. #  ($game_actors) and refers to the Game_Party class ($game_party).
  57. #==============================================================================
  58. class Game_Actor
  59.   #--------------------------------------------------------------------------
  60.   # * Alias Method
  61.   #--------------------------------------------------------------------------
  62.   [:maxhp,:maxsp,:str,:dex,:agi,:int,:atk,:pdef,:mdef,:eva].each_with_index do |m,i|
  63.     alias_method(:"drg190_#{m}", :"#{m}")unless method_defined?(:"drg190_#{m}")  
  64.     define_method(:"#{m}") do |*args|
  65.       stat, ex = $game_party.item_stat_plus, [0,1].include?(i) ? 9999 : 999
  66.       [[send(:"drg190_#{m}",*args) + stat[i],1].max, ex].min
  67.     end
  68.   end
  69. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement