I'm using Zephren's Timed Hit script [which can be found here http://houseslashers.b1.jcink.com/index.php?showtopic=116 ] and have been running into a strange problem.
Problem is, when I use a skill like remedy [anything that removes status effects] or I use a skill that would cause a status effect, it says "Script 'Timed Hit 1' line 38: TypeError occurred. String can't be coerced into fixnum" then closes.
Line 38 is this part: "Integer((@timed_hit_hit_percent * self.damage) / 100.0)"
Strangely when I add power to the skills that give or cure status effects and make it cause damage it works fine without the error.
Though obviously I don't want to get hurt every time I use a remedy skill.
Here is the whole script in case anyone can see why this is happening:
class Game_Battler
attr_accessor :timed_hit_hit_percent
attr_accessor :timed_hit_use_percent
attr_accessor :timed_hit_state_to_add
alias timed_hit_attack_effect attack_effect
def attack_effect(attacker)
if @timed_hit_use_percent
hp = self.hp
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
elsif attacker.is_a?(Game_Enemy)
timed_hit_attack_effect(attacker)
end
@timed_hit_use_percent = false
@timed_hit_state_to_add = nil
end
alias timed_hit_skill_effect skill_effect
def skill_effect(user, skill)
if @timed_hit_use_percent
hp = self.hp
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
elsif user.is_a?(Game_Enemy)
timed_hit_skill_effect(user, skill)
end
@timed_hit_use_percent = false
end
end
