Ejemplo n.º 1
0
    //=============================== Buffs & Debuffs ============================================

    /// <summary>
    /// Añade un buffo a este jugador. Si el bufo es Inmediato, activa el buffo. Si el buffo es limitado o permanente se encola y se ejecuta por primera vez.
    /// </summary>
    /// <param name="buff">El buffo a añadir.</param>
    public void AddBuff(Buff buff)
    {
        EffectDurationType duration = buff.durationType;

        //Activo la función inmediatamente.
        if (buff.durationType == EffectDurationType.Inmediate)
        {
            ActivateBuff(buff);
        }
        else
        {
            ActiveBuffs[duration].Add(buff);
            ActivateBuff(buff);
        }
        OnBuffAdded();
    }
Ejemplo n.º 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();
    }
Ejemplo n.º 3
0
            private static int OnEffectRemoved(void *pEffectListHandler, void *pObject, void *pEffect)
            {
                CNWSObject  gameObject = CNWSObject.FromPointer(pObject);
                CGameEffect gameEffect = CGameEffect.FromPointer(pEffect);

                if (gameObject == null || gameEffect == null)
                {
                    return(Hook.CallOriginal(pEffectListHandler, pObject, pEffect));
                }

                EffectDurationType durationType = (EffectDurationType)gameEffect.GetDurationType();

                if (durationType != EffectDurationType.Temporary && durationType != EffectDurationType.Permanent)
                {
                    return(Hook.CallOriginal(pEffectListHandler, pObject, pEffect));
                }

                OnEffectRemove eventData = ProcessEvent(new OnEffectRemove
                {
                    Object = gameObject.ToNwObject() !,
                    Effect = gameEffect.ToEffect(false) !,
                });