Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # N.A.S.T.Y. EZ Crit/Hit/Evasion Plus
- # Nelderson's Awesome Scripts To You
- #
- # By: Nelderson
- # Last Updated: 2/16/2012
- # Version 1.0 - 2/16/2012
- #===============================================================================
- # Update History:
- # - Version 1.0 - Initial release, made for EZaxess (The Ultimate in BITCH!)
- #===============================================================================
- # *Notes:
- # - There is one section to fill out at the top for your
- # actor's base stats.
- #
- # - For weapons and armor a new notetag is used for extra stats.
- # <nel_stat STAT x>
- # Where STAT can be: (cri, hit, eva)
- # Where x is the variable increase(Can also be a negative number)
- #
- # Example:
- # <nel_stat cri+ 14>
- #
- # - Added compatibility with the Passive Skills Script.
- #
- # New Parameters for Skill Notetags: (hit+, cri+, eva+, hit-, cri-, eva-)
- #
- # Example:
- # <passive_skill cri+ 14>
- #
- # This would put the passive skill's owner critical rate up 14
- #===============================================================================
- # Credits:
- # -Nelderson
- #===============================================================================
- module NEL
- #Starting Base Rates for Actors
- #Actor ID => [Hit, Evasion, Critical]
- def self.base_hitevacrit_rate(actor_id)
- case actor_id
- when 1; return [70, 2, 3]
- else; return [75, 4, 4]
- end
- end
- end
- class Game_Actor < Game_Battler
- include NOTEREADER
- include Passive_Configs
- alias nel_crihiteva_stats_setup setup
- def setup(*args)
- @nel_eva = 0 #Evasion Bonus from Passive Skills
- @nel_hit = 0 #Hit Bonus from Passive Skills
- @nel_cri = 0 #Critical Bonus from Passive Skills
- nel_crihiteva_stats_setup(*args)
- end
- #--------------------------------------------------------------------------
- # * Get Evasion Rate - Overwriten
- #--------------------------------------------------------------------------
- def eva
- n = NEL.base_hitevacrit_rate(self.id)[1] + @nel_eva
- for item in armors.compact do n += item.eva end
- for wep in weapons.compact do n += wep.eva end
- n = [[Integer(n), 0].max, 100].min
- return n
- end
- #--------------------------------------------------------------------------
- # * Get Critical Ratio - Overwriten
- #--------------------------------------------------------------------------
- def cri
- n = NEL.base_hitevacrit_rate(self.id)[2]+ @nel_cri
- for weapon in weapons.compact do n += weapon.cri end
- for item in armors.compact do n += item.cri end
- n = [[Integer(n), 0].max, 100].min
- return n
- end
- #--------------------------------------------------------------------------
- # * Get Hit Ratio - Overwriten
- #--------------------------------------------------------------------------
- def hit
- n = NEL.base_hitevacrit_rate(self.id)[0] + @nel_hit
- if two_swords_style
- n1 = weapons[0] == nil ? 0 : weapons[0].hit
- n2 = weapons[1] == nil ? 0 : weapons[1].hit
- n += [n1, n2].min
- else
- n += weapons[0] == nil ? 0 : weapons[0].hit
- end
- n = [[Integer(n), 0].max, 100].min
- return n
- end
- #----------------------------------------------------------------------------#
- # * Passive Refresh - Compatibility for PassiveSkills 3.0 By: Rockleedude
- # skill_id : skill ID #####START#####
- #----------------------------------------------------------------------------#
- #Adding Passive Skills
- alias nel_crithiteva_passvi_skils_learn passive_learn
- def passive_learn(skill_id)
- hastag = get_tag_array_for($data_skills[skill_id].note,"passive_skill","nil")
- if skill_learn?($data_skills[skill_id]) and hastag = true
- #--------------------# Add passive property #----------------------#
- # Critical Rate - cri+
- get_tag_array_for($data_skills[skill_id].note,"passive_skill","cri+")
- if $tag_array[1].eql?("cri+") and $tag_array[2] != nil
- if $tag_array[2].eql?("var") and $tag_array[3] != nil
- ammount = $game_variables[$tag_array[3].to_i]
- else
- ammount = $tag_array[2].to_i
- end
- @nel_cri += ammount
- end
- #--------------------# Add passive property #----------------------#
- # Evasion Rate - eva+
- get_tag_array_for($data_skills[skill_id].note,"passive_skill","eva+")
- if $tag_array[1].eql?("eva+") and $tag_array[2] != nil
- if $tag_array[2].eql?("var") and $tag_array[3] != nil
- ammount = $game_variables[$tag_array[3].to_i]
- else
- ammount = $tag_array[2].to_i
- end
- @nel_eva += ammount
- end
- #--------------------# Add passive property #----------------------#
- # Hit Rate - hit+
- get_tag_array_for($data_skills[skill_id].note,"passive_skill","hit+")
- if $tag_array[1].eql?("hit+") and $tag_array[2] != nil
- if $tag_array[2].eql?("var") and $tag_array[3] != nil
- ammount = $game_variables[$tag_array[3].to_i]
- else
- ammount = $tag_array[2].to_i
- end
- @nel_hit += ammount
- end
- #--------------------# Add passive property #----------------------#
- # Critical Rate - cri-
- get_tag_array_for($data_skills[skill_id].note,"passive_skill","cri-")
- if $tag_array[1].eql?("cri-") and $tag_array[2] != nil
- if $tag_array[2].eql?("var") and $tag_array[3] != nil
- ammount = $game_variables[$tag_array[3].to_i]
- else
- ammount = $tag_array[2].to_i
- end
- @nel_cri -= ammount
- end
- #--------------------# Add passive property #----------------------#
- # Evasion Rate - eva-
- get_tag_array_for($data_skills[skill_id].note,"passive_skill","eva-")
- if $tag_array[1].eql?("eva-") and $tag_array[2] != nil
- if $tag_array[2].eql?("var") and $tag_array[3] != nil
- ammount = $game_variables[$tag_array[3].to_i]
- else
- ammount = $tag_array[2].to_i
- end
- @nel_eva -= ammount
- end
- #--------------------# Add passive property #----------------------#
- # Hit Rate - hit-
- get_tag_array_for($data_skills[skill_id].note,"passive_skill","hit-")
- if $tag_array[1].eql?("hit-") and $tag_array[2] != nil
- if $tag_array[2].eql?("var") and $tag_array[3] != nil
- ammount = $game_variables[$tag_array[3].to_i]
- else
- ammount = $tag_array[2].to_i
- end
- @nel_hit -= ammount
- end
- end
- nel_crithiteva_passvi_skils_learn(skill_id)
- end
- #Removing Passive Skills
- alias nel_crithiteva_passvi_skils_unlearn passive_unlearn
- def passive_unlearn(skill_id)
- hastag = get_tag_array_for($data_skills[skill_id].note,"passive_skill","nil")
- if skill_learn?($data_skills[skill_id]) and hastag = true
- #--------------------# Remove passive property #----------------------#
- # Critical Rate - cri+
- get_tag_array_for($data_skills[skill_id].note,"passive_skill","cri+")
- if $tag_array[1].eql?("cri+") and $tag_array[2] != nil
- if $tag_array[2].eql?("var") and $tag_array[3] != nil
- ammount = $game_variables[$tag_array[3].to_i]
- else
- ammount = $tag_array[2].to_i
- end
- @nel_cri -= ammount
- end
- #--------------------# Remove passive property #----------------------#
- # Evasiom Rate - eva+
- get_tag_array_for($data_skills[skill_id].note,"passive_skill","eva+")
- if $tag_array[1].eql?("eva+") and $tag_array[2] != nil
- if $tag_array[2].eql?("var") and $tag_array[3] != nil
- ammount = $game_variables[$tag_array[3].to_i]
- else
- ammount = $tag_array[2].to_i
- end
- @nel_eva -= ammount
- end
- #--------------------# Remove passive property #----------------------#
- # Hit Rate - hit+
- get_tag_array_for($data_skills[skill_id].note,"passive_skill","hit+")
- if $tag_array[1].eql?("hit+") and $tag_array[2] != nil
- if $tag_array[2].eql?("var") and $tag_array[3] != nil
- ammount = $game_variables[$tag_array[3].to_i]
- else
- ammount = $tag_array[2].to_i
- end
- @nel_hit -= ammount
- end
- #--------------------# Remove passive property #----------------------#
- # Critical Rate - cri-
- get_tag_array_for($data_skills[skill_id].note,"passive_skill","cri-")
- if $tag_array[1].eql?("cri-") and $tag_array[2] != nil
- if $tag_array[2].eql?("var") and $tag_array[3] != nil
- ammount = $game_variables[$tag_array[3].to_i]
- else
- ammount = $tag_array[2].to_i
- end
- @nel_cri += ammount
- end
- #--------------------# Remove passive property #----------------------#
- # Evasiom Rate - eva-
- get_tag_array_for($data_skills[skill_id].note,"passive_skill","eva-")
- if $tag_array[1].eql?("eva-") and $tag_array[2] != nil
- if $tag_array[2].eql?("var") and $tag_array[3] != nil
- ammount = $game_variables[$tag_array[3].to_i]
- else
- ammount = $tag_array[2].to_i
- end
- @nel_eva += ammount
- end
- #--------------------# Remove passive property #----------------------#
- # Hit Rate - hit_
- get_tag_array_for($data_skills[skill_id].note,"passive_skill","hit-")
- if $tag_array[1].eql?("hit-") and $tag_array[2] != nil
- if $tag_array[2].eql?("var") and $tag_array[3] != nil
- ammount = $game_variables[$tag_array[3].to_i]
- else
- ammount = $tag_array[2].to_i
- end
- @nel_hit += ammount
- end
- end
- nel_crithiteva_passvi_skils_unlearn(skill_id)
- end
- end
- #----------------------------------------------------------------------------#
- # * Passive Refresh - Compatibility for PassiveSkills 3.0 By: Rockleedude
- # skill_id : skill ID #####END#####
- #----------------------------------------------------------------------------#
- class RPG::Weapon
- attr_accessor :cri
- attr_accessor :eva
- def load_cr_eva_cahce
- @cri = 0
- @eva = 0
- end
- def weapon_hcr_neld_stat_info #Checks the atribute and how much it goes up in notetag
- self.note.split(/[\r\n]+/).each{ |a|
- case a
- when /<nel_stat[ ](.*)[ ](\-?\d+)>/i
- eval("self.#{$1.downcase} += #{$2}")
- end}
- end
- end
- class RPG::Armor
- attr_accessor :cri
- attr_accessor :hit
- def load_cr_hit_cahce
- @hit = 0
- @cri = 0
- end
- def armor_hcr_neld_stat_info #Checks the atribute and how much it goes up in notetag
- self.note.split(/[\r\n]+/).each{ |a|
- case a
- when /<nel_stat[ ](.*)[ ](\-?\d+)>/i
- eval("self.#{$1.downcase} += #{$2}")
- end}
- end
- end
- class Scene_Title < Scene_Base
- #--------------------------------------------------------------------------#
- # * Aliased method load_database
- #--------------------------------------------------------------------------#
- alias nel_load_datbas_critevahit_loda_d load_database unless $@
- def load_database
- nel_load_datbas_critevahit_loda_d
- nel_load_wep_armor_item_stuuff
- end
- def nel_load_wep_armor_item_stuuff
- for a in $data_weapons #Weapon cri/eva initialization
- next if a == nil
- a.load_cr_eva_cahce
- a.weapon_hcr_neld_stat_info
- end
- for b in $data_armors #Armor cri/hit initialization
- next if b == nil
- b.load_cr_hit_cahce
- b.armor_hcr_neld_stat_info
- end
- end
- end
Add Comment
Please, Sign In to add comment