Пример #1
0
    protected virtual void ApplyContinuousEffect(PlayerAgent triggeringComponent, float timeStep)
    {
        int applicableEffect = 0;

        if (triggeringComponent != null)
        {
            switch (effectType)
            {
            case ItemData.EffectType.HP:
                accumulatedEffect += timeStep * effectSpeed;
                applicableEffect   = (int)accumulatedEffect;
                if (applicableEffect != 0)
                {
                    accumulatedEffect -= applicableEffect;
                    triggeringComponent.AddToCurrentHP(applicableEffect, false);
                }
                break;
            }
        }
    }