IceDragon200

IMS001-VariableStat

Aug 11th, 2011
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.59 KB | None | 0 0
  1. # Icy Mini Scripts
  2. module IMS
  3.   module EnemyVariableStat
  4.     STATS = {}
  5.     STATS[:maxhp] = 10
  6.     STATS[:maxmp] = 10
  7.     STATS[:atk]   = 10
  8.     STATS[:def]   = 10
  9.     STATS[:spi]   = 10
  10.     STATS[:agi]   = 10
  11.   end
  12. end
  13.  
  14. class Game_Enemy < Game_Battler
  15.  
  16.   IMS::EnemyVariableStat::STATS.each_pair { |m, v|
  17.     str = %Q(
  18.       alias :ims001_gmen_#{m.to_s} :#{m.to_s} unless $@
  19.       def #{m.to_s}( *args, &block )
  20.         n = ims001_gmen_#{m.to_s}( *args, &block )
  21.         return Integer(n.to_f * $game_variables[v].to_f / 100.0)
  22.       end
  23.     )
  24.     module_eval( str )
  25.   }
  26.  
  27. end
Advertisement
Add Comment
Please, Sign In to add comment