Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # Scale Enemy Stats
- #==============================================================================
- # Version 0.0 2012 Sept, 4 by Eshra
- # Compatibility: RPG Maker VX Ace
- # -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
- # About
- # -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
- #
- # This script allows the stats of all of the enemies in the database or all of
- # the members of the current enemies in battle to be modified by a scalar. It
- # might be useful if you feel like the enemies in your game are a bit too weak,
- # a bit too strong, you want to have varying difficulty levels, etc. i.e. you
- # want to modify the stats of all the enemies in your game and you don't want to
- # have to go through your entire database and change the values manually.
- #
- # - NOTE -
- # The modification is being applied directly to the values in $data_enemies and
- # so if temporary results are desired (during runtime), the stats will need to be
- # returned to their original values later.
- #
- # -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
- # How to Use
- # -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
- #
- # Make this script call:
- #
- # EnemyStatScale.mod_stats_scalar(arg)
- # (replace arg with a float)
- #
- # To modify all of the enemies' stats inside $data_enemies by arg.
- #
- # Make this script call:
- #
- # EnemyStatScale.mod_troop_stats(arg)
- # (replace arg with a float)
- #
- # To modify the stats of the current troop the player is battling by arg
- #
- # Auto Scaling:
- # The stats for all enemies in the database can be modified upon loading the
- # game by changing the value of EnemyStatScale::InitScalar
- ($imported ||= {})["Ra Scale Enemy Stats"] = true
- #==============================================================================
- # ** EnemyStatScale
- #------------------------------------------------------------------------------
- # Handles manipulation of enemy.params for each element in $data_enemies
- #==============================================================================
- module EnemyStatScale
- InitScalar = 1 # Change this value to modify all stats upon load
- #
- # * Scales stats for all enemies according to param
- #
- def self.mod_stats_scalar(mod)
- $data_enemies.each{ |foe| mod_params(foe, mod) }
- end # End - mod_stats_scalar
- #
- # * Scale the stats of the current game troop
- #
- def self.mod_troop_stats(mod)
- $game_troop.members.each{|memb| mod_params($data_enemies[memb.enemy_id],mod)}
- end # End - mod_troop_stats
- #
- # * Helper method for mod_troop_stats and mod_stats_scalar
- #
- def self.mod_params(foe, mod)
- foe ? foe.params = foe.params.map{|val| (val*mod).to_i} : nil
- end # End - mod_params
- end # End - EnemyStatScale
- #==============================================================================
- # ** DataManager
- #------------------------------------------------------------------------------
- # Alias Method:
- # load_database - given functionality to apply stat modifications upon
- # loading if desired.
- #==============================================================================
- module DataManager
- class <<self; alias dmang_load_dbase_mod_enemy_stats_9989 load_database; end
- def self.load_database
- dmang_load_dbase_mod_enemy_stats_9989
- EnemyStatScale.mod_stats_scalar(EnemyStatScale::InitScalar)
- end
- end
- #==============================================================================
- # ** RPG::Enemy
- #------------------------------------------------------------------------------
- # The params array is made public
- #==============================================================================
- class RPG::Enemy < RPG::BaseItem
- attr_accessor :params # array = [hp, mp, atk, def, matk, mdef, agi, luck]
- end # End RPG::Enemy
- # End of File
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement