10-14-2009, 10:09 PM
dam.. doesn t work this time :(
could it be because of this code just above in the same BS ? :
could it be because of this code just above in the same BS ? :
Code:
#--------------------------------------------------------------------------
def attack_effect(attacker)
self.critical = @evaded = @missed = false
hit_result = (rand(100) < attacker.hit)
set_attack_result(attacker) if hit_result
weapon = attacker.actor? ? $data_weapons[attacker.weapon_id] : nil
if hit_result
set_attack_state_change(attacker)
else
self.critical = false
@missed = true
end
self.damage = POP_EVA if @evaded
self.damage = POP_MISS if @missed
return true
end
#--------------------------------------------------------------------------
def perfect_attack_effect(attacker)
self.critical = @evaded = @missed = false
set_attack_result(attacker)
weapon = attacker.actor? ? $data_weapons[attacker.weapon_id] : nil
set_attack_state_change(attacker)
return true
end
def set_attack_result(attacker)
set_attack_damage_value(attacker)
if self.damage > 0
self.damage /= 2 if self.guarding?
set_attack_critical(attacker)
set_critical_damage(attacker) if self.critical
end
apply_variance(5) if self.damage.abs > 0
set_attack_hit_value(attacker)
end