Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin =========================================================================
- Dekita's v1.1
- ★ Pokémon Natures™ ★
- ================================================================================
- Script Information:
- ====================
- This script replicates the natures / iv / ev feature from pokemon,
- e.g each pokemon, (in this case actor) is given a random nature and iv value
- upon entering the party.
- That actors growth rates are then determined by its nature and its iv, ev also
- has a role in how characters grow, you can gain ev from killing enemies
- and script calls.
- NOTE: This works 100% like pokemon. unsure which generation, but its pokemon :p
- ================================================================================
- ★☆★☆★☆★☆★☆★☆★☆★ 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.(into other game engines e.g RGSS2)
- 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/ or DekitaRPG@gmail.com
- ================================================================================
- History:
- =========
- D /M /Y
- 13/11/2o12 - added ev gain rate,
- 08/11/2o12 - added max iv cust,
- 07/11/2o12 - updated - v1.1
- 30/10/2o12 - finished,
- 29/10/2o12 - started,
- ================================================================================
- Credit and Thanks to :
- =======================
- http://www.serebii.net/games/stats.shtml for stat calculations.
- ================================================================================
- Known Bugs:
- ============
- N/A
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- If a new bug is found please contact me at
- http://dekitarpg.wordpress.com/
- ================================================================================
- INSTRUCTIONS:
- ==============
- Place this script UNDER "▼ Materials" and ABOVE "▼ Main" in your script editor.
- ================================================================================
- Script Calls:
- ==============
- $game_actors[ACTOR_ID].gain_evs(PARAM_ID, VALUE)
- ACTOR_ID = the database number of the actor
- PARAM_ID = the param id
- (0 = mhp, 1 = mmp, 2 = atk, 3 = def, 4 = mat, 5 = mdf, 6 = agi, 7 = luk)
- VALUE = the amount of ev you wish to gain.
- you could also do...
- $game_party.members[PARTY_MEMBER_ID].gain_evs(PARAM_ID, VALUE)
- ================================================================================
- Notetags: (default)
- ==========
- <ev: mhp, mmp, atk, def, mat, mdf, agi, luk>
- give this to an enemy if you want them to give you ev when they are killed
- replace mhp, mmp, atk, def, mat, mdf, agi, luk with numbers.
- <STAT ev rate: X>
- give this to equipment or states to change the ev gain rate
- replace STAT with either mhp, mmp, atk, def, mat, mdf, agi or luk
- replace X with a float value (e.g 1.5)
- =end #==========================================================================#
- module Dekita__Pokémon_Nature
- #==============================================================================
- Nature = []# <- DO NOT DELETE.
- Nature_Vocab = "Nature :"
- # NOTE: nature multipliers are percentage values, this means that
- # 1.1 = 110% 0.9 = 90% 0.01 = 1%
- # 1 is the default, any stats you do not want modified make sure they are 1.
- # Traditional Pokemon Natures
- #Nature id =[ Name, mhp, mmp, atk, def, mat, mdf, agi, luk]
- Nature[0] = ["Adamant", 1, 1, 1.1, 1, 0.9, 1, 1, 1]
- Nature[1] = ["Bashfull", 1, 1, 1, 1, 1, 1, 1, 1]
- Nature[2] = ["Bold", 1, 1, 0.9, 1.1, 1, 1, 1, 1]
- Nature[3] = ["Brave", 1, 1, 1.1, 1, 1, 1, 0.9, 1]
- Nature[4] = ["Calm", 1, 1, 0.9, 1, 1, 1.1, 1, 1]
- Nature[5] = ["Careful", 1, 1, 1, 1, 0.9, 1.1, 1, 1]
- Nature[6] = ["Docile", 1, 1, 1, 1, 1, 1, 1, 1]
- Nature[7] = ["Gentle", 1, 1, 0.9, 1, 1, 1.1, 1, 1]
- Nature[8] = ["Hardy", 1, 1, 1, 1, 1, 1, 1, 1]
- Nature[9] = ["Hasty", 1, 1, 1, 0.9, 1, 1, 1.1, 1]
- Nature[10]= ["Impish", 1, 1, 1, 1.1, 0.9, 1, 1, 1]
- Nature[11]= ["Jolly", 1, 1, 1, 1, 0.9, 1, 1.1, 1]
- Nature[12]= ["Lax", 1, 1, 1, 1.1, 1, 0.9, 1, 1]
- Nature[13]= ["Lonely", 1, 1, 1.1, 0.9, 1, 1, 1, 1]
- Nature[14]= ["Mild", 1, 1, 1, 0.9, 1.1, 1, 1, 1]
- Nature[15]= ["Modest", 1, 1, 0.9, 1, 1.1, 1, 1, 1]
- Nature[16]= ["Naive", 1, 1, 1, 1, 1, 0.9, 1.1, 1]
- Nature[17]= ["Naughty", 1, 1, 1.1, 1, 1, 0.9, 1, 1]
- Nature[18]= ["Quiet", 1, 1, 1, 1, 1.1, 1, 0.9, 1]
- Nature[19]= ["Quirky", 1, 1, 1, 1, 1, 1, 1, 1]
- Nature[20]= ["Rash", 1, 1, 1, 1, 1.1, 0.9, 1, 1]
- Nature[21]= ["Relaxed", 1, 1, 1, 1.1, 1, 1, 0.9, 1]
- Nature[22]= ["Sassy", 1, 1, 1, 1, 1, 1.1, 0.9, 1]
- Nature[23]= ["Serious", 1, 1, 1, 1, 1, 1, 1, 1]
- Nature[24]= ["Timid", 1, 1, 0.9, 1, 1, 1, 1.1, 1]
- # Dekita EPIC Natures
- Nature[25]= ["A Dick", 0.9, 0.9, 1.3, 0.9, 1.3, 0.9, 0.9, 0.9]
- Nature[26]= ["Like a G6",1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1]
- # You can continue to add to this array at will like so...
- # Nature[NUMBER] = ["NAME", 1, 1, 1, 1, 1, 1, 1, 1]
- # Make sure NUMBER is the next number in the list to avoid crashes.
- Max_IV_Amount = 31
- #############################
- # CUSTOMISATION OPTIONS END #
- #############################
- # For MHP and MMP
- # (((IVs + 2 * BASE + (EVs / 4) ) * level / 100) + 10 + level ) * NATURE
- # For ATK, DEF, MAT, MDF, AGI, LUK
- # (((IVs + 2 * BASE + (EVs / 4) ) * level / 100) + 5) * NATURE
- # BASE = Base is determined by each stats level 1 parameter in the database,
- # higher = more end game stats, lower = less end game stats
- # NATURE = the nature modifier (settings above) if the actors nature modifies
- # these stats
- # NOTE : pokemon natures do not modify hp and mp, but i have included the option
- # for " THE FUCKING LOLz™ "
- end ## Dekita__Pokémon_Nature
- $imported = {} if $imported.nil?
- $imported[:Dekita_Pokémon_Natures] = true
- #################################################################################
- #################################################################################
- # As team rocket where once again "blasting off" Ash, Brock and Misty slowly #
- # lifted their bodies from the ground, turning, gasping at the horror they could#
- # see before them... #
- #################################################################################
- #################### !! DONT MODIFY SHIT AFTER HERE !! ##########################
- #################################################################################
- module DataManager
- #==============================================================================
- class <<self; alias load_database_Natures load_database; end
- def self.load_database
- load_database_Natures
- load_notetags_Natures
- end
- def self.load_notetags_Natures
- groups = [$data_enemies, $data_weapons, $data_armors, $data_states]
- for group in groups
- for obj in group
- next if obj.nil?
- obj.load_notetags_Natures
- end
- end
- end
- end # DataManager
- #==============================================================================
- module BattleManager
- #==============================================================================
- class <<self; alias battlemanager_display_exp__Natures display_exp; end
- def self.display_exp
- battlemanager_display_exp__Natures
- gain_evs
- end
- def self.gain_evs
- mhp_ev_val = ($game_troop.mhp_evs_total).to_i
- mmp_ev_val = ($game_troop.mmp_evs_total).to_i
- atk_ev_val = ($game_troop.atk_evs_total).to_i
- def_ev_val = ($game_troop.def_evs_total).to_i
- mat_ev_val = ($game_troop.mat_evs_total).to_i
- mdf_ev_val = ($game_troop.mdf_evs_total).to_i
- agi_ev_val = ($game_troop.agi_evs_total).to_i
- luk_ev_val = ($game_troop.luk_evs_total).to_i
- for member in $game_party.members
- member.gain_evs(0, mhp_ev_val)
- member.gain_evs(1, mmp_ev_val)
- member.gain_evs(2, atk_ev_val)
- member.gain_evs(3, def_ev_val)
- member.gain_evs(4, mat_ev_val)
- member.gain_evs(5, mdf_ev_val)
- member.gain_evs(6, agi_ev_val)
- member.gain_evs(7, luk_ev_val)
- end
- end
- end # BattleManager
- #==============================================================================
- class RPG::EquipItem < RPG::BaseItem
- #==============================================================================
- attr_accessor :ev_gain_rate
- def load_notetags_Natures
- @ev_gain_rate = [0] * 8
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<mhp ev rate: (.*)>/i
- @ev_gain_rate[0] += $1.to_f
- #---
- when /<mmp ev rate: (.*)>/i
- @ev_gain_rate[1] += $1.to_f
- #---
- when /<atk ev rate: (.*)>/i
- @ev_gain_rate[2] += $1.to_f
- #---
- when /<def ev rate: (.*)>/i
- @ev_gain_rate[3] += $1.to_f
- #---
- when /<mat ev rate: (.*)>/i
- @ev_gain_rate[4] += $1.to_f
- #---
- when /<mdf ev rate: (.*)>/i
- @ev_gain_rate[5] += $1.to_f
- #---
- when /<agi ev rate: (.*)>/i
- @ev_gain_rate[6] += $1.to_f
- #---
- when /<luk ev rate: (.*)>/i
- @ev_gain_rate[7] += $1.to_f
- #---
- end
- } # self.note.split
- #---
- end
- end
- #==============================================================================
- class RPG::State < RPG::BaseItem
- #==============================================================================
- attr_accessor :ev_gain_rate
- def load_notetags_Natures
- @ev_gain_rate = [0] * 8
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<mhp ev rate: (.*)>/i
- @ev_gain_rate[0] += $1.to_f
- #---
- when /<mmp ev rate: (.*)>/i
- @ev_gain_rate[1] += $1.to_f
- #---
- when /<atk ev rate: (.*)>/i
- @ev_gain_rate[2] += $1.to_f
- #---
- when /<def ev rate: (.*)>/i
- @ev_gain_rate[3] += $1.to_f
- #---
- when /<mat ev rate: (.*)>/i
- @ev_gain_rate[4] += $1.to_f
- #---
- when /<mdf ev rate: (.*)>/i
- @ev_gain_rate[5] += $1.to_f
- #---
- when /<agi ev rate: (.*)>/i
- @ev_gain_rate[6] += $1.to_f
- #---
- when /<luk ev rate: (.*)>/i
- @ev_gain_rate[7] += $1.to_f
- #---
- end
- } # self.note.split
- #---
- end
- end
- #==============================================================================
- class RPG::Enemy < RPG::BaseItem
- #==============================================================================
- attr_accessor :dist_evs
- def load_notetags_Natures
- @dist_evs = [0] * 8
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<mhp ev: (.*)>/i
- @dist_evs[0] += $1.to_i
- #---
- when /<mmp ev: (.*)>/i
- @dist_evs[1] += $1.to_i
- #---
- when /<atk ev: (.*)>/i
- @dist_evs[2] += $1.to_i
- #---
- when /<def ev: (.*)>/i
- @dist_evs[3] += $1.to_i
- #---
- when /<mat ev: (.*)>/i
- @dist_evs[4] += $1.to_i
- #---
- when /<mdf ev: (.*)>/i
- @dist_evs[5] += $1.to_i
- #---
- when /<agi ev: (.*)>/i
- @dist_evs[6] += $1.to_i
- #---
- when /<luk ev: (.*)>/i
- @dist_evs[7] += $1.to_i
- #---
- end
- } # self.note.split
- #---
- end
- end # RPG::Enemy
- #==============================================================================
- class Game_Actor < Game_Battler
- #==============================================================================
- attr_accessor :nature
- attr_accessor :init_ivs
- attr_accessor :curr_evs
- alias pokemon_nature_A_GO_GO setup
- def setup(actor_id)
- @init_ivs = [0] * 8
- @curr_evs = [0] * 8
- @nature = get_rand_nature
- get_init_ivs
- get_init_evs
- pokemon_nature_A_GO_GO(actor_id)
- end
- def get_init_ivs
- 8.times {|i| @init_ivs[i] = (rand(Dekita__Pokémon_Nature::Max_IV_Amount+1))}
- end
- def get_init_evs
- 8.times {|i| @curr_evs[i] = 0}
- end
- def param_base(param_id)
- par_id = param_id
- case par_id
- when 0, 1 # NOTE : if you change these calculations your a fucking moron ! ijs...
- return (((@init_ivs[par_id]+2*self.class.params[par_id, 1]+(@curr_evs[par_id]/4))*@level/100)+10+@level)*@nature[par_id+1]
- when 2, 3, 4, 5, 6, 7
- return (((@init_ivs[par_id]+2*self.class.params[par_id, 1]+(@curr_evs[par_id]/4))*@level/100)+5)*@nature[par_id+1]
- end
- end
- def gain_evs(ev_id, value)
- value *= ev_gain_rate(ev_id)
- tote_ev_val = get_total_ev_count
- return if tote_ev_val == max_ev_all_val
- if @curr_evs[ev_id] <= max_ev_each_val && value + @curr_evs[ev_id] <= max_ev_each_val
- @curr_evs[ev_id] += value.to_i if value + tote_ev_val <= max_ev_all_val
- else
- @curr_evs[ev_id] = max_ev_each_val if value + tote_ev_val <= max_ev_all_val
- end
- end
- def ev_gain_rate(ev_id)
- rate = 1.0
- rate += ev_weapon_rate(ev_id)
- rate += ev_status_rate(ev_id)
- return rate
- end
- def ev_weapon_rate(ev_id)
- rate = 0.0
- rate += equips.compact.inject(0) {|r, i| r += i.ev_gain_rate[ev_id] rescue 0 }
- return rate
- end
- def ev_status_rate(ev_id)
- rate = 0.0
- rate += states.compact.inject(0) {|r, i| r += i.ev_gain_rate[ev_id] rescue 0 }
- return rate
- end
- def max_ev_each_val
- return 255
- end
- def max_ev_all_val
- return 510
- end
- def get_total_ev_count
- val = @curr_evs[0]
- val += @curr_evs[1]
- val += @curr_evs[2]
- val += @curr_evs[3]
- val += @curr_evs[4]
- val += @curr_evs[5]
- val += @curr_evs[6]
- val += @curr_evs[7]
- return val
- end
- def get_rand_nature
- dnar = (Dekita__Pokémon_Nature::Nature.size)
- val = rand(dnar)
- p "Got nature #{Dekita__Pokémon_Nature::Nature[val][0]}"
- return Dekita__Pokémon_Nature::Nature[val]
- end
- end # Game_Actor < Game_Battler
- #==============================================================================
- class Game_Enemy < Game_Battler
- #==============================================================================
- def mhp_evs_from_death
- return enemy.dist_evs[0]
- end
- def mmp_evs_from_death
- return enemy.dist_evs[1]
- end
- def atk_evs_from_death
- return enemy.dist_evs[2]
- end
- def def_evs_from_death
- return enemy.dist_evs[3]
- end
- def mat_evs_from_death
- return enemy.dist_evs[4]
- end
- def mdf_evs_from_death
- return enemy.dist_evs[5]
- end
- def agi_evs_from_death
- return enemy.dist_evs[6]
- end
- def luk_evs_from_death
- return enemy.dist_evs[7]
- end
- end # Game_Enemy
- #==============================================================================
- class Game_Troop < Game_Unit
- #==============================================================================
- def mhp_evs_total
- dead_members.inject(0) {|r, enemy| r += enemy.mhp_evs_from_death }
- end
- def mmp_evs_total
- dead_members.inject(0) {|r, enemy| r += enemy.mmp_evs_from_death }
- end
- def atk_evs_total
- dead_members.inject(0) {|r, enemy| r += enemy.atk_evs_from_death }
- end
- def def_evs_total
- dead_members.inject(0) {|r, enemy| r += enemy.def_evs_from_death }
- end
- def mat_evs_total
- dead_members.inject(0) {|r, enemy| r += enemy.mat_evs_from_death }
- end
- def mdf_evs_total
- dead_members.inject(0) {|r, enemy| r += enemy.mdf_evs_from_death }
- end
- def agi_evs_total
- dead_members.inject(0) {|r, enemy| r += enemy.agi_evs_from_death }
- end
- def luk_evs_total
- dead_members.inject(0) {|r, enemy| r += enemy.luk_evs_from_death }
- end
- end # Game_Troop
- #===============================================================================#
- # - SCRIPT END - #
- #===============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #===============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement