=begin Extra Stats version: 1.1 Created by: Casper Gaming Compatibility: May not be compatible with scripts that use the defs below: Aliases: process_victory in Scene_Battle, increase_steps in Game_Party Overwrites: decide_number_input in Scene_Shop, gold_total in Game_Troop, display_critical, display_evasion, display_miss, display_hp_damage in Scene_Battle. FFEATURES: This script will keep track of some extra stats and store them in variables! So far, these stats are tracked: Amount of Battles(random and evented) won. Steps Taken in an area. Amount of stuff(items, armor, wep, etc.) bought. Amount of stuff(items, armor, wep, etc.) sold. Amount of profit made from selling to shops. Amount of gold spent buying from shops. Amount of enemies defeated. Amount of damage taken in battle. Amount of damage dealt in battle. Amount of misses in battle. Amount of evades in battle. Amount of criticals in battle. How to use these features is explained below in the setup section. SETUP BELOW IS REQUIRED! CREDIT and TERMS: Please visit https://www.caspergaming.com/terms-of-use/ for terms of use and credit guidelines =end module CASPER_STATS # Don't touch this. ############# #SETUP START# ############# WINSWITCH = 1 # Switch ID that, when ON, will keep track of amt of battles # (random or evented) the actor has won and store the amt in # WINVAR. When OFF it will not keep track of battles won. WINVAR = 1 # Variable ID that stores the amount of battles(random or evented) # the actor has won. STEPSWITCH = 2# Switch ID that, when ON, will keep track of steps taken. When # OFF, it will not. This does not affect the built in feature # that keeps track of steps taken throughout the whole game. STEPVAR = 2 # Variable ID that stores the steps taken inside an area. SELLSWITCH = 4# Switch ID that, when ON, will keep track of the amount of # items sold to a shop and store this value in SELLVAR. SELLVAR = 4 # Variable ID that stores the amount of items the actor has # sold to a shop. BUYSWITCH = 5 # Switch ID that, when ON, will keep track of the amount of # items bought from a shop and store this value in BUYVAR. BUYVAR = 5 # Variable ID that stores the amount of items the actor has # bought from a shop. SOLDPROFIT = 100 # Variable ID that stores the total gold gained from selling # items to a shop. BOUGHTLOSS = 101 # Variable ID that stores the total amount of gold lost from # buying items from a shop. ENEMIESDEFEATED = 102 # Variable that stores the amount of enemies defeated. DAMAGETAKEN = 103 # Variable that stores amount of damage taken. DAMAGEDEALT = 104 # Variable that stores amount of damage dealt. MISSCOUNT = 105 # Amount of actor misses. EVADECOUNT = 106 # Amount of actor evades. CRITICALCOUNT = 107 # Amount of actor critical hits. ########### #SETUP END# ########### end # Don't touch this or anything below. class Scene_Battle < Scene_Base include CASPER_STATS alias casper_victory process_victory unless $@ def process_victory casper_victory if $game_switches[WINSWITCH] $game_variables[WINVAR] += 1 end end def display_critical(target, obj = nil) if target.critical if target.actor? text = Vocab::CriticalToActor else text = Vocab::CriticalToEnemy $game_variables[CRITICALCOUNT] += 1 end @message_window.add_instant_text(text) wait(20) end end def display_evasion(target, obj = nil) if target.actor? text = sprintf(Vocab::ActorEvasion, target.name) $game_variables[EVADECOUNT] += 1 else text = sprintf(Vocab::EnemyEvasion, target.name) end Sound.play_evasion @message_window.add_instant_text(text) wait(30) end def display_miss(target, obj = nil) if obj == nil or obj.physical_attack if target.actor? text = sprintf(Vocab::ActorNoHit, target.name) else text = sprintf(Vocab::EnemyNoHit, target.name) $game_variables[MISSCOUNT] += 1 end Sound.play_miss else text = sprintf(Vocab::ActionFailure, target.name) end @message_window.add_instant_text(text) wait(30) end def display_hp_damage(target, obj = nil) if target.hp_damage == 0 # No damage return if obj != nil and obj.damage_to_mp return if obj != nil and obj.base_damage == 0 fmt = target.actor? ? Vocab::ActorNoDamage : Vocab::EnemyNoDamage text = sprintf(fmt, target.name) elsif target.absorbed # Absorb fmt = target.actor? ? Vocab::ActorDrain : Vocab::EnemyDrain text = sprintf(fmt, target.name, Vocab::hp, target.hp_damage) elsif target.hp_damage > 0 # Damage if target.actor? $game_variables[DAMAGETAKEN] += target.hp_damage else $game_variables[DAMAGEDEALT] += target.hp_damage end if target.actor? text = sprintf(Vocab::ActorDamage, target.name, target.hp_damage) Sound.play_actor_damage $game_troop.screen.start_shake(5, 5, 10) else text = sprintf(Vocab::EnemyDamage, target.name, target.hp_damage) Sound.play_enemy_damage target.blink = true end else # Recovery fmt = target.actor? ? Vocab::ActorRecovery : Vocab::EnemyRecovery text = sprintf(fmt, target.name, Vocab::hp, -target.hp_damage) Sound.play_recovery end @message_window.add_instant_text(text) wait(30) end end class Game_Party < Game_Unit include CASPER_STATS alias casper_steps increase_steps unless $@ def increase_steps casper_steps if $game_switches[STEPSWITCH] $game_variables[STEPVAR] += 1 end end end class Scene_Shop < Scene_Base include CASPER_STATS def decide_number_input Sound.play_shop @number_window.active = false @number_window.visible = false case @command_window.index when 0 $game_party.lose_gold(@number_window.number * @item.price) $game_variables[BOUGHTLOSS.to_i] = $game_variables[BOUGHTLOSS.to_i] + (@number_window.number * @item.price) $game_party.gain_item(@item, @number_window.number) if $game_switches[BUYSWITCH] $game_variables[BUYVAR] += @number_window.number end @gold_window.refresh @buy_window.refresh @status_window.refresh @buy_window.active = true @buy_window.visible = true when 1 $game_party.gain_gold(@number_window.number * (@item.price / 2)) $game_variables[SOLDPROFIT.to_i] = $game_variables[SOLDPROFIT.to_i] + (@number_window.number * (@item.price / 2)) $game_party.lose_item(@item, @number_window.number) if $game_switches[SELLSWITCH] $game_variables[SELLVAR] += @number_window.number end @gold_window.refresh @sell_window.refresh @status_window.refresh @sell_window.active = true @sell_window.visible = true @status_window.visible = false end end end class Game_Troop < Game_Unit include CASPER_STATS def gold_total gold = 0 for enemy in dead_members $game_variables[ENEMIESDEFEATED] += 1 gold += enemy.gold unless enemy.hidden end return gold end end