Exemple #1
0
    public override void Activate(int atk, Team targets, Hero self)
    {
        Hero target     = targets.GetRandomHero();
        int  damage     = atk * power / 100;
        int  healDamage = damage * healPower / 100;

        // Hitcheck based on accuracy
        if (HitCheck(accuracy))
        {
            // Apply damage to the enemy
            target.applyDamage(damage, this);

            // Show floating damage number
            DamagePopup.CreateDamage(target.transform.position, damage);

            // Apply the heal to self
            self.applyDamage(-healDamage, this);

            DamagePopup.CreateHeal(self.transform.position, healDamage);
        }
        else // Miss
        {
            // Show miss text
            DamagePopup.CreateText(target.transform.position, "Miss");
        }
    }
Exemple #2
0
    public override void Activate(int atk, Team targets, Hero self)
    {
        int damage = atk * power / 100;

        foreach (Hero target in targets.heroes)
        {
            // Skip if dead
            if (target.isDead)
            {
                continue;
            }

            // Hitcheck based on accuracy
            if (HitCheck(accuracy))
            {
                // Apply damage to the enemy
                target.applyDamage(damage, this);

                // Show floating damage number
                DamagePopup.CreateDamage(target.transform.position, damage);
            }
            else // Miss
            {
                // Show miss text
                DamagePopup.CreateText(target.transform.position, "Miss");
            }
        }
    }