Beispiel #1
0
    public void AddToStack(StackableEffect stackEffect)
    {
        var modifer    = stackEffect.modifer;
        var newModifer = new StatModifer(modifer.Value, modifer.Type, modifer.Order, modifer.Source);

        var stacks = stackableEffects[stackEffect];

        if (stacks != null)
        {
            entity.AddStatModifer(newModifer, stackEffect.attriEnum);
            stacks.Push(newModifer);
        }
    }
        public override IEnumerator DoEffect(LivingEntity entity)
        {
            var modifer = new StatModifer(Amount, type, this);

            entity.AddStatModifer(modifer, attributeEnum);
            if (!isPersistent)
            {
                yield return(new WaitForSeconds(effectLifeTime));

                entity.RemoveStatModifer(modifer, attributeEnum);
                entity.GetComponent <StatusEffectSystem>().RegisterDebuffCooldown(new Cooldown(reapplyCooldown, name));
                EndEffect(entity);
                yield return(null);
            }
        }