- Joined
- Jan 12, 2014
- Messages
- 112
- Reaction score
- 24
- Primarily Uses
The enemies HP are drastically lower than they should be in battle. This only happens with this script, but I still want to keep the script. How should I edit it so that this glitch doesn't occur?
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# This class deals with battlers. It's used as a superclass for the Game_Actor
# and Game_Enemy classes.
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias timed_hit_attack_effect attack_effect
alias timed_hit_skill_effect skill_effect
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :timed_hit_hit_percent
attr_accessor :timed_hit_use_percent
attr_accessor :timed_hit_state_to_add
#--------------------------------------------------------------------------
# * Applying Normal Attack Effects
# attacker : battler
#--------------------------------------------------------------------------
def attack_effect(attacker)
effective = false
# If part of Timed Hits
if @timed_hit_use_percent
hp = self.hp
# Perform the original call and get effective
effective = timed_hit_attack_effect(attacker)
if self.damage != "Miss"
self.hp = hp
self.damage = Integer((@timed_hit_hit_percent * self.damage) / 100.0)
self.hp -= Integer(self.damage)
if @timed_hit_state_to_add != nil
self.add_state(@timed_hit_state_to_add)
end
end
# If not part of Timed Hits
else
# Perform the original call and get effective
effective = timed_hit_attack_effect(attacker)
end
@timed_hit_use_percent = false
@timed_hit_state_to_add = nil
return effective
end
#--------------------------------------------------------------------------
# * Apply Skill Effects
# user : the one using skills (battler)
# skill : skill
#--------------------------------------------------------------------------
def skill_effect(user, skill)
effective = false
# If part of Timed Hits
if @timed_hit_use_percent
hp = self.hp
# Perform the original call and get effective
effective = timed_hit_skill_effect(user, skill)
if self.damage != "Miss"
self.hp = hp
self.damage = Integer((@timed_hit_hit_percent * self.damage) / 100.0)
self.hp -= Integer(self.damage)
end
# If not part of Timed Hits
else
# Perform the original call and get effective
effective = timed_hit_skill_effect(user, skill)
end
@timed_hit_use_percent = false
return effective
end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles the actor. It's used within the Game_Actors class
# ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :actor_id
end
# ** Game_Battler
#------------------------------------------------------------------------------
# This class deals with battlers. It's used as a superclass for the Game_Actor
# and Game_Enemy classes.
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias timed_hit_attack_effect attack_effect
alias timed_hit_skill_effect skill_effect
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :timed_hit_hit_percent
attr_accessor :timed_hit_use_percent
attr_accessor :timed_hit_state_to_add
#--------------------------------------------------------------------------
# * Applying Normal Attack Effects
# attacker : battler
#--------------------------------------------------------------------------
def attack_effect(attacker)
effective = false
# If part of Timed Hits
if @timed_hit_use_percent
hp = self.hp
# Perform the original call and get effective
effective = timed_hit_attack_effect(attacker)
if self.damage != "Miss"
self.hp = hp
self.damage = Integer((@timed_hit_hit_percent * self.damage) / 100.0)
self.hp -= Integer(self.damage)
if @timed_hit_state_to_add != nil
self.add_state(@timed_hit_state_to_add)
end
end
# If not part of Timed Hits
else
# Perform the original call and get effective
effective = timed_hit_attack_effect(attacker)
end
@timed_hit_use_percent = false
@timed_hit_state_to_add = nil
return effective
end
#--------------------------------------------------------------------------
# * Apply Skill Effects
# user : the one using skills (battler)
# skill : skill
#--------------------------------------------------------------------------
def skill_effect(user, skill)
effective = false
# If part of Timed Hits
if @timed_hit_use_percent
hp = self.hp
# Perform the original call and get effective
effective = timed_hit_skill_effect(user, skill)
if self.damage != "Miss"
self.hp = hp
self.damage = Integer((@timed_hit_hit_percent * self.damage) / 100.0)
self.hp -= Integer(self.damage)
end
# If not part of Timed Hits
else
# Perform the original call and get effective
effective = timed_hit_skill_effect(user, skill)
end
@timed_hit_use_percent = false
return effective
end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles the actor. It's used within the Game_Actors class
# ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :actor_id
end
