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 - Damage Tracker
- # -- Author : Dekita
- # -- Version : 1.1
- # -- Level : Easy
- # -- Requires : N/A
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:DMG_Tracker]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # o1/o4/2o13 - Bugfix,(extra damage)
- # 22/o3/2o13 - Started, Finished,
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # This Script allows variables to track the overall damage actors have taken
- # and the overall damage actors have dealt to enemies.
- # Each point of damage an actor takes/deals will be added onto a set variable.
- #
- # Does not account for heals of any kind !!
- #
- # Why you may want to use this :
- # Maybe a healing skill that heals based on the damage you take during gameplay.
- # Maybe a clan that only allows warriors who have been through harsh battles ?
- # Maybe you want to combine this script with my $D13x - Learn Skill Requirements
- # To make certain skills only available after taking/dealing x amount of damage...
- # The list goes on :p
- #
- # The default settings will only track variables for actor 1, you must customize
- # the settings to suit your needs for other actors.
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ 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.
- #
- #===============================================================================
- # ☆ Additional Credit
- #-------------------------------------------------------------------------------
- # ' SimplestChaos ' - For giving me the inspiration to write this :)
- #
- #===============================================================================
- module DMG_Tracker
- #===============================================================================
- Actor={}# << Keep
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # ☆ General Settings
- #--------------------------------------------------------------------------
- # If this option is true, the damage taken from negative HRG / MRG states
- # will also be added to the variable (if use? is set to true)
- # This would also include floor damage.
- # NOTE: Only affects damage taken, not damage dealt !
- All_Damage_Counts = true
- # If this is false, whenever you deal damage that is more than the targets
- # current hp, ALL extra damage will also be added to the variable.
- Ignore_Xtra_Dam = true
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # ☆ Tracking Settings
- #--------------------------------------------------------------------------
- # This is where you define which actors control which variables
- # Actor[ id ] = { << begins hash, must be kept.
- # :hp_dmg_took => [ use? , vari id ] , :mp_dmg_took => [ use? , vari id ] ,
- # :hp_dmg_deal => [ use? , vari id ] , :mp_dmg_deal => [ use? , vari id ] ,
- # } << ends hash, must be kept.
- Actor[1]={
- :hp_dmg_took => [ true , 100 ] , :mp_dmg_took => [ false , 101 ] ,
- :hp_dmg_deal => [ true , 102 ] , :mp_dmg_deal => [ false , 103 ] ,
- } # << End actor id 1
- Actor[2]={
- :hp_dmg_took => [ false , 104 ] , :mp_dmg_took => [ false , 105 ] ,
- :hp_dmg_deal => [ false , 106 ] , :mp_dmg_deal => [ false , 107 ] ,
- } # << End actor id 2
- Actor[3]={
- :hp_dmg_took => [ false , 108 ] , :mp_dmg_took => [ false , 109 ] ,
- :hp_dmg_deal => [ false , 110 ] , :mp_dmg_deal => [ false , 111 ] ,
- } # << End actor id 3
- Actor[4]={
- :hp_dmg_took => [ false , 112 ] , :mp_dmg_took => [ false , 113 ] ,
- :hp_dmg_deal => [ false , 114 ] , :mp_dmg_deal => [ false , 115 ] ,
- } # << End actor id 4
- Actor[5]={
- :hp_dmg_took => [ false , 116 ] , :mp_dmg_took => [ false , 117 ] ,
- :hp_dmg_deal => [ false , 118 ] , :mp_dmg_deal => [ false , 119 ] ,
- } # << End actor id 5
- Actor[6]={
- :hp_dmg_took => [ false , 120 ] , :mp_dmg_took => [ false , 121 ] ,
- :hp_dmg_deal => [ false , 122 ] , :mp_dmg_deal => [ false , 123 ] ,
- } # << End actor id 6
- Actor[7]={
- :hp_dmg_took => [ false , 124 ] , :mp_dmg_took => [ false , 125 ] ,
- :hp_dmg_deal => [ false , 126 ] , :mp_dmg_deal => [ false , 127 ] ,
- } # << End actor id 7
- Actor[8]={
- :hp_dmg_took => [ false , 128 ] , :mp_dmg_took => [ false , 129 ] ,
- :hp_dmg_deal => [ false , 130 ] , :mp_dmg_deal => [ false , 131 ] ,
- } # << End actor id 8
- Actor[9]={
- :hp_dmg_took => [ false , 132 ] , :mp_dmg_took => [ false , 133 ] ,
- :hp_dmg_deal => [ false , 134 ] , :mp_dmg_deal => [ false , 135 ] ,
- } # << End actor id 9
- Actor[10]={
- :hp_dmg_took => [ false , 136 ] , :mp_dmg_took => [ false , 137 ] ,
- :hp_dmg_deal => [ false , 138 ] , :mp_dmg_deal => [ false , 139 ] ,
- } # << End actor id 10
- # << Add more lines here if you have more than 10 actors :)
- end #####################
- # CUSTOMISATION 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.\..\.. #
- #===============================================================================#
- class Game_Battler < Game_BattlerBase
- #===============================================================================
- #--------------------------------------------------------------------------
- # Alias List
- #--------------------------------------------------------------------------
- alias :exe_dmg_tracker :execute_damage
- alias :regen_hp_vtrack :regenerate_hp
- alias :regen_mp_vtrack :regenerate_mp
- #--------------------------------------------------------------------------
- # Damage Processing
- #--------------------------------------------------------------------------
- def execute_damage(user)
- hpd = @result.hp_damage.to_i
- mpd = @result.mp_damage.to_i
- ohp = self.hp
- omp = self.mp
- exe_dmg_tracker(user)
- execute_var_mod(hpd,mpd,ohp,omp)
- exec_var_mod_II(user,hpd,mpd,ohp,omp)
- end
- #--------------------------------------------------------------------------
- # Modify Variables From Damage Taken
- #--------------------------------------------------------------------------
- def execute_var_mod(hp_dam,mp_dam,ohp,omp)
- return unless self.is_a?(Game_Actor)
- return unless DMG_Tracker::Actor[self.id] != nil
- info = DMG_Tracker::Actor[self.id]
- if ohp - hp_dam < 0
- $game_variables[info[:hp_dmg_took][1]] += ohp if info[:hp_dmg_took][0]
- else
- $game_variables[info[:hp_dmg_took][1]] += hp_dam if info[:hp_dmg_took][0]
- end
- if omp - mp_dam < 0
- $game_variables[info[:mp_dmg_took][1]] += omp if info[:mp_dmg_took][0]
- else
- $game_variables[info[:mp_dmg_took][1]] += mp_dam if info[:mp_dmg_took][0]
- end
- end
- #--------------------------------------------------------------------------
- # Modify Variables From Damage Dealt
- #--------------------------------------------------------------------------
- def exec_var_mod_II(user,hp_dam,mp_dam,ohp,omp)
- return unless user.is_a?(Game_Actor)
- return unless DMG_Tracker::Actor[user.id] != nil
- i = DMG_Tracker::Actor[user.id]
- if DMG_Tracker::Ignore_Xtra_Dam
- if ohp - hp_dam < 0
- $game_variables[i[:hp_dmg_deal][1]] += ohp if i[:hp_dmg_deal][0]
- else
- $game_variables[i[:hp_dmg_deal][1]] += hp_dam if i[:hp_dmg_deal][0]
- end
- if omp - mp_dam < 0
- $game_variables[i[:hp_dmg_deal][1]] += omp if i[:hp_dmg_deal][0]
- else
- $game_variables[i[:hp_dmg_deal][1]] += hp_dam if i[:hp_dmg_deal][0]
- end
- else
- $game_variables[i[:hp_dmg_deal][1]] += hp_dam if i[:hp_dmg_deal][0]
- $game_variables[i[:mp_dmg_deal][1]] += mp_dam if i[:mp_dmg_deal][0]
- end
- end
- #--------------------------------------------------------------------------
- # Regenerate HP
- #--------------------------------------------------------------------------
- def regenerate_hp
- regen_hp_vtrack
- execure_regen(:hp, @result.hp_damage)
- end
- #--------------------------------------------------------------------------
- # Regenerate MP
- #--------------------------------------------------------------------------
- def regenerate_mp
- regen_mp_vtrack
- execure_regen(:mp, @result.mp_damage)
- end
- #--------------------------------------------------------------------------
- # Execute Regen ( kept the typo ;p )
- #--------------------------------------------------------------------------
- def execure_regen(type = nil, damage = 0)
- return unless self.is_a?(Game_Actor)
- return unless DMG_Tracker::All_Damage_Counts
- return unless type != nil
- return unless damage > 0
- return unless DMG_Tracker::Actor[self.id] != nil
- info = DMG_Tracker::Actor[self.id]
- vee = $game_variables
- case type
- when :hp then vee[info[:hp_dmg_took][1]] += damage if info[:hp_dmg_took][0]
- when :mp then vee[info[:mp_dmg_took][1]] += damage if info[:mp_dmg_took][0]
- end
- 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