Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if true # << Make true to use this script, false to disable.
- #===============================================================================
- #
- # ☆ $D13x - EVIV Stats
- # -- Author : Dekita
- # -- Version : 1.1
- # -- Level : Hard / Extreme
- # -- Requires : $D13x Core v2.7
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:EVIV_Stats]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # 19/o4/2o14 - Finished,
- # ??/o4/2o14 - Released Test / Beta Version to some friends,
- # o4/o4/2o14 - Started
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # This script replicates the Ev / Iv feature from the pokemon game series.
- # For those that do not know here is a short explanation...
- #
- # When each Actor / Enemy is initialized it gains a random IV value for
- # each of its stats. Enemies EV values are also randomized.
- # Each time you defeat an enemy, it will give you some Ev points - based on the
- # type of enemy.
- # These new Ev and Iv values are then used to dramatically alter the 'base stat'
- # value. ('base stat' is your original param value.)
- #
- # Obviously, cause I could, I enabled this feature for EVERY SINGLE STAT!!
- # - including all stats created by my scripts.
- # This means the stats you can now control using Ev / Iv values are...
- # Params - Only requires $D13x - Core Script
- # xParams - Requires Statistic Control
- # sParams - Requires Statistic Control
- # Atk Ele - Requires Elements Control
- # Def Ele - Requires Elements Control
- # Parent stats - Requires ISPDS
- # Atk Lvl - Requires Atk | Def Levels
- # Def Lvl - Requires Atk | Def Levels
- # Max TP - Requires Max TP Control
- #
- # You can use various script calls / notetags to change EV values.
- #
- # You can use all new variables in stat formula's / Conditional branches and
- # things like that..
- #
- # And finally...
- # You can FULLY CUSTOMIZE EVERY SINGLE EV/IV CALCULATION - this means...
- # you can easily create your own custom stat calculation for all stats without
- # any coding knowledge at all!!
- #
- # #ImSoPro-DidntYouKnow?
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- #===============================================================================
- # 1. You MUST give credit to "Dekita" !!
- # 2. You are NOT allowed to repost this script.(or modified versions)
- # 3. You are NOT allowed to convert this script.
- # 4. You are NOT allowed to use this script for Commercial games.
- # 5. ENJOY!
- #
- # "FINE PRINT"
- # By using this script you hereby agree to the above terms and conditions,
- # if any violation of the above terms occurs "legal action" may be taken.
- # Not understanding the above terms and conditions does NOT mean that
- # they do not apply to you.
- # If you wish to discuss the terms and conditions in further detail you can
- # contact me at http://dekitarpg.wordpress.com/
- #
- #===============================================================================
- # ☆ Instructions
- #-------------------------------------------------------------------------------
- # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
- #
- #===============================================================================
- # ☆ Script Calls
- #-------------------------------------------------------------------------------
- # ACTOR.param_ev_gain(id,gain)
- # ACTOR.xparam_ev_gain(id,gain)
- # ACTOR.sparam_ev_gain(id,gain)
- # ACTOR.atk_ele_ev_gain(id,gain)
- # ACTOR.def_ele_ev_gain(id,gain)
- # ACTOR.atl_dfl_ev_gain(id,gain)
- # ACTOR.spds_stat_ev_gain(id,gain)
- # ACTOR.max_tp_ev_gain(gain)
- # ^- use these script calls to gain EV stats equal to gain for id.
- #
- # ACTOR.can_param_eviv_mod(stat_id)
- # ACTOR.can_xparam_eviv_mod(stat_id)
- # ACTOR.can_sparam_eviv_mod(stat_id)
- # ACTOR.can_atk_ele_eviv_mod(stat_id)
- # ACTOR.can_def_ele_eviv_mod(stat_id)
- # ACTOR.can_atl_dfl_eviv_mod(stat_id)
- # ACTOR.can_spds_stat_eviv_mod(stat_id)
- # ACTOR.can_max_tp_eviv_mod
- # ^- use these script calls to check if the actor uses ev/iv stat mods for stat_id
- #
- # ACTOR = $game_actors[ID] or $game_party.leader or whatever...
- #
- # NOW...
- # Here is a list of variables that your actors / enemies now have;
- #
- # iv_param
- # iv_xparam
- # iv_sparam
- # iv_atk_ele
- # iv_def_ele
- # iv_atl_dfl
- # iv_spds_stats
- # iv_max_tp
- # ev_param
- # ev_xparam
- # ev_sparam
- # ev_atk_ele
- # ev_def_ele
- # ev_atl_dfl
- # ev_spds_stats
- # ev_max_tp
- # ev_param_rate
- # ev_xparam_rate
- # ev_sparam_rate
- # ev_atk_ele_rate
- # ev_def_ele_rate
- # ev_atl_dfl_rate
- # ev_spds_stats_rate
- # ev_max_tp_rate
- #
- # You can use these in conditional branch checks and whatever else, you must
- # also reference the id of the stat you want to check / modify, like so...
- # $game_actors[ID].iv_param[0]
- # This would check actor Id's iv param for param id 0 - mhp.
- #
- # If you dont understand this, please disregard it. I do not have the time to
- # sit and explain how to script...
- #
- #===============================================================================
- # ☆ Notetags ( default )
- #-------------------------------------------------------------------------------
- # <par ev: ID, VALUE>
- # <xpar ev: ID, VALUE>
- # <spar ev: ID, VALUE>
- # <atkele ev: ID, VALUE>
- # <defele ev: ID, VALUE>
- # <atldfl ev: ID, VALUE>
- # <spds ev: ID, VALUE>
- # <max tp ev: VALUE>
- # <all ev: VALUE>
- # The above notetags should be given to enemies to determine how many ev pts
- # should be gained from it upon death.
- #
- # <no par eviv mod: ID>
- # <no xpar eviv mod: ID>
- # <no spar eviv mod: ID>
- # <no atk ele eviv mod: ID>
- # <no def ele eviv mod: ID>
- # <no atl dfl eviv mod: ID>
- # <no spds eviv mod: ID>
- # <no max tp eviv mod>
- # <no eviv mod>
- # These notetags should be used for actors / enemies who's stats are not modified
- # by their EV / IV values.
- #
- #===============================================================================
- # ☆ HELP
- #-------------------------------------------------------------------------------
- # N/A
- #
- #===============================================================================
- module EVIV
- #===============================================================================
- #-----------------------------------------------------------------------------
- # :stat => [id 0, id 1, id 2, id 3, id 4, id 5... ]
- #-----------------------------------------------------------------------------
- Max_Iv_Value = {
- :param => [32,32,32,32,32,32,32,32],
- :xparam => [32,32,32,32,32,32,32,32,32,32,32],
- :sparam => [32,32,32,32,32,32,32,32,32,32,32],
- :atk_ele => [32,32,32,32,32,32,32,32,32,32,32],
- :def_ele => [32,32,32,32,32,32,32,32,32,32,32],
- :atl_dfl => [32,32],
- :spds_stat => [32,32,32,32,32,32,32,32,32,32],
- :max_tp => 32,
- } # << Max_Iv_Value
- #-----------------------------------------------------------------------------
- # :stat => [id 0, id 1, id 2, id 3, id 4, id 5... ]
- #-----------------------------------------------------------------------------
- Max_Ev_Value = {
- :param => [256,256,256,256,256,256,256,256],
- :xparam => [256,256,256,256,256,256,256,256,256,256,256],
- :sparam => [256,256,256,256,256,256,256,256,256,256,256],
- :atk_ele => [256,256,256,256,256,256,256,256,256,256,256],
- :def_ele => [256,256,256,256,256,256,256,256,256,256,256],
- :atl_dfl => [256,256],
- :spds_stat => [256,256,256,256,256,256,256,256,256,256],
- :max_tp => 256,
- } # << Max_Ev_Value
- #-----------------------------------------------------------------------------
- # :stat => total max ev value for all stats of this type.
- #-----------------------------------------------------------------------------
- Total_Max_Ev_Value = {
- :param => 510,
- :xparam => 510,
- :sparam => 510,
- :atk_ele => 510,
- :def_ele => 510,
- :atl_dfl => 510,
- :spds_stat => 510,
- :max_tp => 510,
- } # << Max_Ev_Value
- #-----------------------------------------------------------------------------
- # param stat modification - this is setup to calculate the way the pokemon
- # game series calculated its Ev and Iv stats...
- #-----------------------------------------------------------------------------
- def self.param_plus(bas,battler,stat_id)
- return bas unless battler.can_param_eviv_mod(stat_id)
- ivs = battler.iv_param[stat_id]
- evs = battler.ev_param[stat_id]
- lvl = battler.level.nil? ? 1 : battler.level
- case stat_id
- when 0, 1 then return (((ivs+2*bas+(evs/4))*lvl/100)+10+lvl)
- else ; return (((ivs+2*bas+(evs/4))*lvl/100)+5)
- end
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.xparam_plus(bas,battler,stat_id)
- return bas unless battler.can_xparam_eviv_mod(stat_id)
- return bas
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.sparam_plus(bas,battler,stat_id)
- return bas unless battler.can_sparam_eviv_mod(stat_id)
- return bas
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.def_ele_plus(bas,battler,stat_id)
- return bas unless battler.can_def_ele_eviv_mod(stat_id)
- return bas
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.atk_ele_plus(bas,battler,stat_id)
- return bas unless battler.can_atk_ele_eviv_mod(stat_id)
- return bas
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.atl_dfl_plus(bas,battler,stat_id)
- return bas unless battler.can_atl_dfl_eviv_mod(stat_id)
- return bas
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.spds_plus(bas,battler,stat_id)
- return bas unless battler.can_spds_stat_eviv_mod(stat_id)
- return bas
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.max_tp_plus(bas,battler)
- return bas unless battler.can_max_tp_eviv_mod
- return bas
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- Notes={
- :param => /<par ev:(.*),(.*)>/i,
- :xparam => /<xpar ev:(.*),(.*)>/i,
- :sparam => /<spar ev:(.*),(.*)>/i,
- :atk_ele => /<atkele ev:(.*),(.*)>/i,
- :def_ele => /<defele ev:(.*),(.*)>/i,
- :atl_dfl => /<atldfl ev:(.*),(.*)>/i,
- :spds => /<spds ev:(.*),(.*)>/i,
- :max_tp => /<max tp ev:(.*)>/i,
- :all => /<all ev:(.*)>/i,
- # --
- :can_param => /<no par eviv mod:(.*)>/i,
- :can_xparam => /<no xpar eviv mod:(.*)>/i,
- :can_sparam => /<no spar eviv mod:(.*)>/i,
- :can_atk_ele => /<no atk ele eviv mod:(.*)>/i,
- :can_def_ele => /<no def ele eviv mod:(.*)>/i,
- :can_atl_dfl => /<no atl dfl eviv mod:(.*)>/i,
- :can_spds => /<no spds eviv mod:(.*)>/i,
- :can_max_tp => /<no max tp eviv mod>/i,
- :can_all => /<no eviv mod>/i,
- }
- #-----------------------------------------------------------------------------
- # :leader
- # :all_members
- # :battle_members
- # :alive_members
- #-----------------------------------------------------------------------------
- EV_Distribution_Type = :alive_members
- #-----------------------------------------------------------------------------
- # self.get_ev_dysto_membs # Do Not Remove this Method.
- #-----------------------------------------------------------------------------
- def self.get_ev_dysto_membs
- case EV_Distribution_Type
- when :leader then return [$game_party.leader]
- when :all_members then return $game_party.members
- when :battle_members then return $game_party.battle_members
- when :alive_members then return $game_party.alive_battle_members
- when :custom then return # // Your code here..
- end #####################
- end # CUSTOMISATION END #
- end #####################
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- # #
- # http://dekitarpg.wordpress.com/ #
- # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #===============================================================================#
- # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
- # YES?\.\. #
- # OMG, REALLY? \| #
- # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
- # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
- #===============================================================================#
- module EVIV
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- Max_Iv_Value[:atk_ele][-1] = 0
- Max_Iv_Value[:def_ele][-1] = 0
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- Max_Ev_Value[:atk_ele][-1] = 0
- Max_Ev_Value[:def_ele][-1] = 0
- end
- #===============================================================================
- module DataManager
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- class << self
- alias :load_database_EVIV :load_database
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.load_database
- load_database_EVIV
- load_notetags_EVIV
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.load_notetags_EVIV
- groups = [$data_enemies,$data_actors]#, $data_weapons, $data_armors, $data_states]
- for group in groups
- for obj in group
- next if obj.nil?
- obj.load_EVIV
- end
- end
- end
- end
- #===============================================================================
- module EVIV_DATA
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- attr_accessor :can_param_eviv_mod
- attr_accessor :can_xparam_eviv_mod
- attr_accessor :can_sparam_eviv_mod
- attr_accessor :can_atk_ele_eviv_mod
- attr_accessor :can_def_ele_eviv_mod
- attr_accessor :can_atl_dfl_eviv_mod
- attr_accessor :can_spds_stats_eviv_mod
- attr_accessor :can_max_tp_eviv_mod
- attr_accessor :dist_par_ev
- attr_accessor :dist_xpar_ev
- attr_accessor :dist_spar_ev
- attr_accessor :dist_atkele_ev
- attr_accessor :dist_defele_ev
- attr_accessor :dist_atldfl_ev
- attr_accessor :dist_spds_ev
- attr_accessor :dist_max_tp_ev
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def init_EVIV_variables
- init_can_stat_eviv_mod(true)
- init_dist_stat_eviv_mod( 0 )
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def init_can_stat_eviv_mod(val)
- @can_param_eviv_mod = [val] * 8
- @can_xparam_eviv_mod = [val] * 10
- @can_sparam_eviv_mod = [val] * 10
- @can_atk_ele_eviv_mod = [val] * $data_system.elements.size
- @can_def_ele_eviv_mod = [val] * $data_system.elements.size
- @can_atl_dfl_eviv_mod = [val] * 2
- @can_spds_stats_eviv_mod = [val] * 8
- @can_spds_stats_eviv_mod = [val] * SPDS::Commands.size if $D13x[:ISPDS]
- @can_max_tp_eviv_mod = val
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def init_dist_stat_eviv_mod(val)
- @dist_par_ev = [val] * 8
- @dist_xpar_ev = [val] * 10
- @dist_spar_ev = [val] * 10
- @dist_atkele_ev = [val] * $data_system.elements.size
- @dist_defele_ev = [val] * $data_system.elements.size
- @dist_atldfl_ev = [val] * 2
- @dist_spds_ev = [val] * 8
- @dist_spds_ev = [val] * SPDS::Commands.size if $D13x[:ISPDS]
- @dist_max_tp_ev = val
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def load_EVIV_notetags
- self.note.split(/[\r\n]+/).each do |line|
- case line
- when EVIV::Notes[:can_param] then @can_param_eviv_mod[$1.to_i] = false
- when EVIV::Notes[:can_xparam] then @can_xparam_eviv_mod[$1.to_i] = false
- when EVIV::Notes[:can_sparam] then @can_sparam_eviv_mod[$1.to_i] = false
- when EVIV::Notes[:can_atk_ele] then @can_atk_ele_eviv_mod[$1.to_i] = false
- when EVIV::Notes[:can_def_ele] then @can_def_ele_eviv_mod[$1.to_i] = false
- when EVIV::Notes[:can_atl_dfl] then @can_atl_dfl_eviv_mod[$1.to_i] = false
- when EVIV::Notes[:can_spds] then @can_spds_stats_eviv_mod[$1.to_i] = false
- when EVIV::Notes[:can_max_tp] then @can_max_tp_eviv_mod = false
- when EVIV::Notes[:can_all] then init_can_stat_eviv_mod(false)
- when EVIV::Notes[:param] then @dist_par_ev[$1.to_i] += $2.to_i
- when EVIV::Notes[:xparam] then @dist_xpar_ev[$1.to_i] += $2.to_i
- when EVIV::Notes[:sparam] then @dist_spar_ev[$1.to_i] += $2.to_i
- when EVIV::Notes[:atk_ele] then @dist_atkele_ev[$1.to_i] += $2.to_i
- when EVIV::Notes[:def_ele] then @dist_defele_ev[$1.to_i] += $2.to_i
- when EVIV::Notes[:atl_dfl] then @dist_atldfl_ev[$1.to_i] += $2.to_i
- when EVIV::Notes[:spds] then @dist_spds_ev[$1.to_i] += $2.to_i
- when EVIV::Notes[:max_tp] then @dist_max_tp_ev += $1.to_i
- when EVIV::Notes[:all] then init_dist_stat_eviv_mod($1.to_i)
- end
- end
- end
- end
- #===============================================================================
- class RPG::BaseItem
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- include EVIV_DATA
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def load_EVIV
- init_EVIV_variables
- load_EVIV_notetags
- end
- end
- #===============================================================================
- module BattleManager
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- class << self
- alias :bmde_EVIV :gain_exp
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.gain_exp
- gain_all_evs
- bmde_EVIV
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.gain_all_evs
- for m in EVIV.get_ev_dysto_membs
- 8.times { |i| m.param_ev_gain(i, $game_troop.par_ev_total(i)) }
- 10.times { |i| m.xparam_ev_gain(i,$game_troop.xpar_ev_total(i)) }
- 10.times { |i| m.sparam_ev_gain(i,$game_troop.spar_ev_total(i)) }
- $data_system.elements.size.times do |i|
- m.atk_ele_ev_gain(i,$game_troop.atk_ele_ev_total(i))
- m.def_ele_ev_gain(i,$game_troop.def_ele_ev_total(i))
- end
- 2.times {|i| m.atl_dfl_ev_gain(i,$game_troop.atldfl_ev_total(i)) }
- if $D13x[:ISPDS]
- SPDS::Commands.size.times do |i|
- m.spds_stat_ev_gain(i,$game_troop.spds_ev_total(i))
- end
- end
- m.max_tp_ev_gain($game_troop.max_tp_ev_total)
- end
- end
- end
- #===============================================================================
- module Game_Battler_EVIV
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- attr_accessor :iv_param
- attr_accessor :iv_xparam
- attr_accessor :iv_sparam
- attr_accessor :iv_atk_ele
- attr_accessor :iv_def_ele
- attr_accessor :iv_atl_dfl
- attr_accessor :iv_spds_stats
- attr_accessor :iv_max_tp
- attr_accessor :ev_param
- attr_accessor :ev_xparam
- attr_accessor :ev_sparam
- attr_accessor :ev_atk_ele
- attr_accessor :ev_def_ele
- attr_accessor :ev_atl_dfl
- attr_accessor :ev_spds_stats
- attr_accessor :ev_max_tp
- attr_accessor :ev_param_rate
- attr_accessor :ev_xparam_rate
- attr_accessor :ev_sparam_rate
- attr_accessor :ev_atk_ele_rate
- attr_accessor :ev_def_ele_rate
- attr_accessor :ev_atl_dfl_rate
- attr_accessor :ev_spds_stats_rate
- attr_accessor :ev_max_tp_rate
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize_EVIV
- init_ivs
- init_evs
- init_iv_rand
- init_ev_rate
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def init_ivs
- @iv_param = [0] * 8
- @iv_xparam = [0] * 10
- @iv_sparam = [0] * 10
- @iv_atk_ele = [0] * $data_system.elements.size
- @iv_def_ele = [0] * $data_system.elements.size
- @iv_atl_dfl = [0] * 2
- @iv_spds_stats = [0] * 8
- @iv_spds_stats = [0] * SPDS::Commands.size if $D13x[:ISPDS]
- @iv_max_tp = 0
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def init_evs
- @ev_param = [0] * 8
- @ev_xparam = [0] * 10
- @ev_sparam = [0] * 10
- @ev_atk_ele = [0] * $data_system.elements.size
- @ev_def_ele = [0] * $data_system.elements.size
- @ev_atl_dfl = [0] * 2
- @ev_spds_stats = [0] * 8
- @ev_spds_stats = [0] * SPDS::Commands.size if $D13x[:ISPDS]
- @ev_max_tp = 0
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def init_iv_rand
- 8.times { |i| @iv_param[i] = rand(EVIV::Max_Iv_Value[:param][i]).to_i }
- 10.times do |i|
- @iv_xparam[i] = rand(EVIV::Max_Iv_Value[:xparam][i]).to_i
- @iv_sparam[i] = rand(EVIV::Max_Iv_Value[:sparam][i]).to_i
- end
- $data_system.elements.size.times do |i|
- @iv_atk_ele[i] = rand(EVIV::Max_Iv_Value[:atk_ele][i]).to_i
- @iv_def_ele[i] = rand(EVIV::Max_Iv_Value[:def_ele][i]).to_i
- end
- 2.times { |i| @iv_atl_dfl[i] = rand(EVIV::Max_Iv_Value[:atl_dfl][i]).to_i }
- if $D13x[:ISPDS]
- SPDS::Commands.size.times do |i|
- @iv_spds_stats[i] = rand(EVIV::Max_Iv_Value[:spds_stat][i]).to_i
- end
- end
- @iv_max_tp = rand(EVIV::Max_Iv_Value[:max_tp]).to_i
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def init_ev_rand
- 8.times { |i| param_ev_gain(i,rand(EVIV::Max_Ev_Value[:param][i]).to_i )}
- 10.times do |i|
- xparam_ev_gain(i,rand(EVIV::Max_Ev_Value[:xparam][i]).to_i)
- sparam_ev_gain(i,rand(EVIV::Max_Ev_Value[:sparam][i]).to_i)
- end
- $data_system.elements.size.times do |i|
- atk_ele_ev_gain(i,rand(EVIV::Max_Ev_Value[:atk_ele][i]).to_i)
- def_ele_ev_gain(i,rand(EVIV::Max_Ev_Value[:def_ele][i]).to_i)
- end
- 2.times { |i| atl_dfl_ev_gain(i,rand(EVIV::Max_Ev_Value[:atl_dfl][i]).to_i)}
- if $D13x[:ISPDS]
- SPDS::Commands.size.times do |i|
- spds_stat_ev_gain(i,rand(EVIV::Max_Ev_Value[:spds_stat][i]).to_i)
- end
- end
- max_tp_ev_gain(rand(EVIV::Max_Ev_Value[:max_tp]).to_i)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def init_ev_rate
- @ev_param_rate = [1.0] * 8
- @ev_xparam_rate = [1.0] * 10
- @ev_sparam_rate = [1.0] * 10
- @ev_atk_ele_rate = [1.0] * $data_system.elements.size
- @ev_def_ele_rate = [1.0] * $data_system.elements.size
- @ev_atl_dfl_rate = [1.0] * 2
- @ev_spds_stats_rate = [1.0] * 8
- @ev_spds_stats_rate = [1.0] * SPDS::Commands.size if $D13x[:ISPDS]
- @ev_max_tp_rate = 1.0
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def max_total_ev(type)
- EVIV::Total_Max_Ev_Value[type]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def count_all_ev(type)
- case type
- when :param then return @ev_param.inject(0) {|r, i| r + i }
- when :xparam then return @ev_xparam.inject(0) {|r, i| r + i }
- when :sparam then return @ev_sparam.inject(0) {|r, i| r + i }
- when :atk_ele then return @ev_atk_ele.inject(0) {|r, i| r + i }
- when :def_ele then return @ev_def_ele.inject(0) {|r, i| r + i }
- when :atl_dfl then return @ev_atl_dfl.inject(0) {|r, i| r + i }
- when :spds_stat then return @ev_spds_stats.inject(0) {|r, i| r + i }
- when :max_tp then return @ev_max_tp
- end
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def count_total_ev
- total = 0
- [:param,:xparam,:sparam,:atk_ele,:def_ele,:atl_dfl,:spds,:max_tp].each do |i|
- total += count_all_ev(i)
- end
- return total
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def param_ev_gain(id,gain)
- return if count_all_ev(:param) >= max_total_ev(:param)
- value = EVIV::Max_Ev_Value[:param][id]
- @ev_param[id] += (gain*@ev_param_rate[id]).to_i
- @ev_param[id] = value-1 if @ev_param[id] >= value-1
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def xparam_ev_gain(id,gain)
- return if count_all_ev(:xparam) >= max_total_ev(:xparam)
- value = EVIV::Max_Ev_Value[:xparam][id]
- @ev_xparam[id] += (gain*@ev_xparam_rate[id]).to_i
- @ev_xparam[id] = value-1 if @ev_xparam[id] >= value-1
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def sparam_ev_gain(id,gain)
- return if count_all_ev(:sparam) >= max_total_ev(:sparam)
- value = EVIV::Max_Ev_Value[:sparam][id]
- @ev_sparam[id] += (gain*@ev_sparam_rate[id]).to_i
- @ev_sparam[id] = value-1 if @ev_sparam[id] >= value-1
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def atk_ele_ev_gain(id,gain)
- return if count_all_ev(:atk_ele) >= max_total_ev(:atk_ele)
- value = EVIV::Max_Ev_Value[:atk_ele][id]
- @ev_atk_ele[id] += (gain*@ev_atk_ele_rate[id]).to_i
- @ev_atk_ele[id] = value-1 if @ev_atk_ele[id] >= value-1
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def def_ele_ev_gain(id,gain)
- return if count_all_ev(:def_ele) >= max_total_ev(:def_ele)
- value = EVIV::Max_Ev_Value[:def_ele][id]
- @ev_def_ele[id] += (gain*@ev_def_ele_rate[id]).to_i
- @ev_def_ele[id] = value-1 if @ev_def_ele[id] >= value-1
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def atl_dfl_ev_gain(id,gain)
- return if count_all_ev(:atl_dfl) >= max_total_ev(:atl_dfl)
- value = EVIV::Max_Ev_Value[:atl_dfl][id]
- @ev_atl_dfl[id] += (gain*@ev_atl_dfl_rate[id]).to_i
- @ev_atl_dfl[id] = value-1 if @ev_atl_dfl[id] >= value-1
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def spds_stat_ev_gain(id,gain)
- return if count_all_ev(:spds_stat) >= max_total_ev(:spds_stat)
- value = EVIV::Max_Ev_Value[:spds_stat][id]
- @ev_spds_stats[id] += (gain*@ev_spds_stats_rate[id]).to_i
- @ev_spds_stats[id] = value-1 if @ev_spds_stats[id] >= value-1
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def max_tp_ev_gain(gain)
- return if count_all_ev(:max_tp) >= max_total_ev(:max_tp)
- value = EVIV::Max_Ev_Value[:max_tp]
- @ev_max_tp += (gain*@ev_max_tp_rate).to_i
- @ev_max_tp = value-1 if @ev_max_tp >= value-1
- end
- end
- #===============================================================================
- class Game_Actor < Game_Battler
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- include Game_Battler_EVIV
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- alias :setup_EVIV :setup
- alias :parp_EVIV :param_plus
- alias :xpar_EVIV :xparam_plus if $D13x[:Stats_Control]
- alias :spar_EVIV :sparam_plus if $D13x[:Stats_Control]
- alias :atke_EVIV :atk_ele_plus if $D13x[:Elems_Control]
- alias :defe_EVIV :def_ele_plus if $D13x[:Elems_Control]
- alias :atdf_EVIV :atl_dfl_plus if $D13x[:Atk_Def_Lvs]
- alias :spds_EVIV :spds_plus if $D13x[:ISPDS]
- alias :max_tp_EVIV :max_tp_plus if $D13x[:TP_Control]
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def setup(actor_id)
- initialize_EVIV
- setup_EVIV(actor_id)
- set_init_eviv
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def set_init_eviv
- return #unless actor.
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def can_param_eviv_mod(id)
- return actor.can_param_eviv_mod[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def can_xparam_eviv_mod(id)
- return actor.can_xparam_eviv_mod[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def can_sparam_eviv_mod(id)
- return actor.can_sparam_eviv_mod[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def can_atk_ele_eviv_mod(id)
- return actor.can_atk_ele_eviv_mod[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def can_def_ele_eviv_mod(id)
- return actor.can_def_ele_eviv_mod[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def can_atl_dfl_eviv_mod(id)
- return actor.can_atl_dfl_eviv_mod[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def can_spds_stat_eviv_mod(id)
- return actor.can_spds_stats_eviv_mod[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def can_max_tp_eviv_mod
- return actor.can_max_tp_eviv_mod
- end
- #-----------------------------------------------------------------------------
- # Get Added Value of Parameter
- #-----------------------------------------------------------------------------
- def param_plus(param_id)
- EVIV.param_plus(parp_EVIV(param_id),self,param_id).to_i
- end
- if $D13x[:Stats_Control]
- #---------------------------------------------------------------------------
- # Get Added Value of x-Parameter
- #---------------------------------------------------------------------------
- def xparam_plus(xparam_id)
- EVIV.xparam_plus(xpar_EVIV(xparam_id),self,xparam_id).to_f
- end
- #---------------------------------------------------------------------------
- # Get Added Value of s-Parameter
- #---------------------------------------------------------------------------
- def sparam_plus(sparam_id)
- EVIV.sparam_plus(spar_EVIV(sparam_id),self,sparam_id).to_f
- end
- end # if $D13x[:Stats_Control]
- if $D13x[:Elems_Control]
- #---------------------------------------------------------------------------
- # Get Added Value of def-Element
- #---------------------------------------------------------------------------
- def def_ele_plus(element_id)
- EVIV.def_ele_plus(defe_EVIV(element_id),self,element_id).to_f
- end
- #---------------------------------------------------------------------------
- # Get Added Value of atk-Element
- #---------------------------------------------------------------------------
- def atk_ele_plus(element_id)
- EVIV.atk_ele_plus(atke_EVIV(element_id),self,element_id).to_f
- end
- end # if $D13x[:Elems_Control]
- if $D13x[:Atk_Def_Lvs]
- #---------------------------------------------------------------------------
- # Atk Lv | Def Lv ++
- #---------------------------------------------------------------------------
- def atl_dfl_plus(id)
- EVIV.atl_dfl_plus(atdf_EVIV(id),self,id).to_i
- end
- end # if $D13x[:Atk_Def_Lvs]
- if $D13x[:ISPDS]
- #---------------------------------------------------------------------------
- # Get SPDS Stats Plus
- #---------------------------------------------------------------------------
- def spds_plus(id)
- EVIV.spds_plus(spds_EVIV(id),self,id).to_i
- end
- end # if $D13x[:ISPDS]
- if $D13x[:TP_Control]
- #---------------------------------------------------------------------------
- # Atk Lv | Def Lv ++
- #---------------------------------------------------------------------------
- def max_tp_plus
- EVIV.max_tp_plus(max_tp_EVIV,self).to_i
- end
- end # if $D13x[:TP_Control]
- end
- #===============================================================================
- class Game_Enemy < Game_Battler
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- include Game_Battler_EVIV
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- alias :setup_EVIV :initialize
- alias :parp_EVIV :param_plus
- alias :xpar_EVIV :xparam_plus if $D13x[:Stats_Control]
- alias :spar_EVIV :sparam_plus if $D13x[:Stats_Control]
- alias :atke_EVIV :atk_ele_plus if $D13x[:Elems_Control]
- alias :defe_EVIV :def_ele_plus if $D13x[:Elems_Control]
- alias :atdf_EVIV :atl_dfl_plus if $D13x[:Atk_Def_Lvs]
- alias :spds_EVIV :spds_plus if $D13x[:ISPDS]
- alias :max_tp_EVIV :max_tp_plus if $D13x[:TP_Control]
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize(index,enemy_id)
- initialize_EVIV
- init_ev_rand
- setup_EVIV(index,enemy_id)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def can_param_eviv_mod(id)
- return enemy.can_param_eviv_mod[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def can_xparam_eviv_mod(id)
- return enemy.can_xparam_eviv_mod[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def can_sparam_eviv_mod(id)
- return enemy.can_sparam_eviv_mod[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def can_atk_ele_eviv_mod(id)
- return enemy.can_atk_ele_eviv_mod[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def can_def_ele_eviv_mod(id)
- return enemy.can_def_ele_eviv_mod[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def can_atl_dfl_eviv_mod(id)
- return enemy.can_atl_dfl_eviv_mod[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def can_spds_stat_eviv_mod(id)
- return enemy.can_spds_stats_eviv_mod[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def can_max_tp_eviv_mod
- return enemy.can_max_tp_eviv_mod
- end
- #-----------------------------------------------------------------------------
- # Get Added Value of Parameter
- #-----------------------------------------------------------------------------
- def param_plus(param_id)
- EVIV.param_plus(parp_EVIV(param_id),self,param_id).to_i
- end
- if $D13x[:Stats_Control]
- #---------------------------------------------------------------------------
- # Get Added Value of x-Parameter
- #---------------------------------------------------------------------------
- def xparam_plus(xparam_id)
- EVIV.xparam_plus(xpar_EVIV(xparam_id),self,xparam_id).to_f
- end
- #---------------------------------------------------------------------------
- # Get Added Value of s-Parameter
- #---------------------------------------------------------------------------
- def sparam_plus(sparam_id)
- EVIV.sparam_plus(spar_EVIV(sparam_id),self,sparam_id).to_f
- end
- end # if $D13x[:Stats_Control]
- if $D13x[:Elems_Control]
- #---------------------------------------------------------------------------
- # Get Added Value of def-Element
- #---------------------------------------------------------------------------
- def def_ele_plus(element_id)
- EVIV.def_ele_plus(defe_EVIV(element_id),self,element_id).to_f
- end
- #---------------------------------------------------------------------------
- # Get Added Value of atk-Element
- #---------------------------------------------------------------------------
- def atk_ele_plus(element_id)
- EVIV.atk_ele_plus(atke_EVIV(element_id),self,element_id).to_f
- end
- end # if $D13x[:Elems_Control]
- if $D13x[:Atk_Def_Lvs]
- #---------------------------------------------------------------------------
- # Atk Lv | Def Lv ++
- #---------------------------------------------------------------------------
- def atl_dfl_plus(id)
- EVIV.atl_dfl_plus(atdf_EVIV(id),self,id).to_i
- end
- end # if $D13x[:Atk_Def_Lvs]
- if $D13x[:ISPDS]
- #---------------------------------------------------------------------------
- # Get SPDS Stats Plus
- #---------------------------------------------------------------------------
- def spds_plus(id)
- EVIV.spds_plus(spds_EVIV(id),self,id).to_i
- end
- end # if $D13x[:ISPDS]
- if $D13x[:TP_Control]
- #---------------------------------------------------------------------------
- # Atk Lv | Def Lv ++
- #---------------------------------------------------------------------------
- def max_tp_plus
- EVIV.max_tp_plus(max_tp_EVIV,self).to_i
- end
- end # if $D13x[:TP_Control]
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def param_ev(id)
- return enemy.dist_par_ev[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def xparam_ev(id)
- return enemy.dist_xpar_ev[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def sparam_ev(id)
- return enemy.dist_spar_ev[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def atk_ele_ev(id)
- return enemy.dist_atkele_ev[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def def_ele_ev(id)
- return enemy.dist_defele_ev[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def atldfl_ev(id)
- return enemy.dist_atldfl_ev[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def spds_ev(id)
- return enemy.dist_spds_ev[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def max_tp_ev
- return enemy.dist_max_tp_ev
- end
- end
- #===============================================================================
- class Game_Troop < Game_Unit
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def par_ev_total(id)
- dead_members.inject(0) {|r,e| r += e.param_ev(id) }
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def xpar_ev_total(id)
- dead_members.inject(0) {|r,e| r += e.xparam_ev(id) }
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def spar_ev_total(id)
- dead_members.inject(0) {|r,e| r += e.sparam_ev(id) }
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def atk_ele_ev_total(id)
- dead_members.inject(0) {|r,e| r += e.atk_ele_ev(id) }
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def def_ele_ev_total(id)
- dead_members.inject(0) {|r,e| r += e.def_ele_ev(id) }
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def atldfl_ev_total(id)
- dead_members.inject(0) {|r,e| r += e.atldfl_ev(id) }
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def spds_ev_total(id)
- dead_members.inject(0) {|r,e| r += e.spds_ev(id) }
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def max_tp_ev_total
- dead_members.inject(0) {|r,e| r += e.max_tp_ev }
- end
- end
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
- end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement