
#==============================================================================
# ** Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :kill_count
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_killcount_gmbtlr_init initialize
alias seph_killcount_gmbtlr_ae attack_effect
alias seph_killcount_gmbtlr_se skill_effect
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Original Initialization
seph_killcount_gmbtlr_init
# Starts Kill Count
@kill_count = 0
end
#--------------------------------------------------------------------------
# * Applying Normal Attack Effects
#--------------------------------------------------------------------------
def attack_effect(attacker)
# Original Attack Effect
seph_killcount_gmbtlr_ae(attacker)
# If Self is Dead
if dead?
# Adds to Kill Count
attacker.kill_count += 1
end
end
#--------------------------------------------------------------------------
# * Apply Skill Effects
#--------------------------------------------------------------------------
def skill_effect(user, skill)
# Original Attack Effect
seph_killcount_gmbtlr_se(user, skill)
# If Self is Dead
if dead?
# Adds to Kill Count
user.kill_count += 1
end
end
end
$game_party.actors[index].kill_count
or
$game_actors[id].kill_count
OK, I added it just below Game_Battler3, as a new script.
When I call this script:
$game_actors[id].kill_count
It gives an error message.
So I tried to replace id by a number, like 001 for the 1st character.
But this time, nothing happens. Is this normal?
Error message is:
NoMethodError
Undefined methpd 'kill count'for nil:NilClass