Esempio n. 1
0
    public override IEnumerator PerformTurn(List <AbstractCreature> targets)
    {
        if (!data.Stunned)
        {
            int attackDamage        = data.AttackPower;
            AbstractCreature target = targets[UnityEngine.Random.Range(0, targets.Count)];
            target.UnderAttack(attackDamage);
            endTurn();
        }

        statusController.reduceStatusDuration(this);
        yield return(null);
    }
    public void reduceStatusDuration(AbstractCreature c)
    {
        foreach (AbstractStatus s in statuses)
        {
            Debug.Log(s.StatusName + " " + s.TurnsUntilRemoved);
            if (s.TurnsUntilRemoved >= 0)
            {
                //Can be abstracted to DoT effects later
                if (s is Ignited)
                {
                    Ignited i = (Ignited)s;
                    c.UnderAttack(i.FireDamage);
                }
                s.TurnsUntilRemoved -= 1;
            }

            if (s.TurnsUntilRemoved == 0)
            {
                s.removeStatus(c);
            }
        }

        statuses.RemoveAll(s => s.TurnsUntilRemoved < 0 - 1);
    }
Esempio n. 3
0
 public override IEnumerator DoAction(Dictionary <Condition, object> npcState)
 {
     base.DoAction(npcState);
     target.UnderAttack(damage);
     yield return(null);
 }