Beispiel #1
0
    /// <summary>
    /// Reduce en 1 la duración de todos los buffos y debuffos x cada turno que termina.
    /// </summary>
    protected void ReduxActiveEffectsDuration()
    {
        //Necesito todos los buffos que sean de tipo limitado.
        var limitedBuffs   = ActiveBuffs[EffectDurationType.Limited];
        var limitedDebuffs = ActiveDebuffs[EffectDurationType.Limited];

        //Le resto 1 a la duración.
        List <Buff> remainingBuffs = new List <Buff>();

        foreach (var buff in limitedBuffs)
        {
            Buff Current = buff;
            Current.Duration--;
            if (Current.Duration > 0)
            {
                remainingBuffs.Add(Current);
            }
        }
        ActiveBuffs[EffectDurationType.Limited] = remainingBuffs;

        List <DeBuff> remainigDebuffs = new List <DeBuff>();

        foreach (var debuff in limitedDebuffs)
        {
            DeBuff current = debuff;
            current.Duration--;
            if (current.Duration > 0)
            {
                remainigDebuffs.Add(current);
            }
        }
        ActiveDebuffs[EffectDurationType.Limited] = remainigDebuffs;
    }
Beispiel #2
0
    public void AddDebuff(DeBuff deBuff)
    {
        EffectDurationType duration = deBuff.durationType;

        //Activo inmediatamente la función;
        if (duration == EffectDurationType.Inmediate)
        {
            ActivateDebuff(deBuff);
        }
        else
        {
            ActiveDebuffs[duration].Add(deBuff);
            ActivateDebuff(deBuff);
        }
        OnDebuffAdded();
    }
Beispiel #3
0
    public int FindSetBuff(DeBuff _debuff, int _set = -1)
    {
        int cnt = 0;

        foreach (var i in m_Debuff)
        {
            if (i.Type == _debuff && i.Time > 0)
            {
                cnt++;
                if (_set >= 0)
                {
                    i.Time = _set;
                }
            }
        }
        return(cnt);
    }
Beispiel #4
0
    /// <summary>
    /// Permite activar el efecto de un Debuff.
    /// </summary>
    /// <param name="deBuff"></param>
    protected void ActivateDebuff(DeBuff deBuff)
    {
        switch (deBuff.DebuffType)
        {
        case DeBuffType.healthReduction:
            Health -= deBuff.Ammount;
            break;

        case DeBuffType.ArmourDestruction:
            DestroyArmour();
            break;

        case DeBuffType.nullify:
            break;

        default:
            break;
        }
    }
 public void Apply(DeBuff DB)
 {
     //not to this.gameObject but
     DB.Apply(gameObject);
 }