Esempio n. 1
0
    protected void ActivateEffect(Targetable target)
    {
        foreach (ActiveEffect activeEffect in effects)
        {
            if (!CheckConditions())
            {
                continue;
            }

            List <Targetable> targets;
            if (activeEffect.targetType == TargetType.SingleTarget)
            {
                targets = new List <Targetable> {
                    target
                };
            }
            else
            {
                targets = GetTargets(activeEffect, activeEffect.targetType);
            }

            if (activatedEffects.ContainsKey(activeEffect))
            {
                activatedEffects[activeEffect].Initialize(targets);
            }
            else
            {
                EffectActivator effectActivator = Instantiate(activeEffect.effectActivator, transform);
                effectActivator.Initialize(targets);

                activatedEffects.Add(activeEffect, effectActivator);
            }
        }
    }
Esempio n. 2
0
 public override void ActivateEffect()
 {
     foreach (var target in newTargets)
     {
         ApplyVisualization(target.Key);
         effectActivator.Initialize(target.Value);
     }
 }
Esempio n. 3
0
    public override void ActivateEffect()
    {
        currentStacks++;

        if (currentStacks == maxStacks)
        {
            if (OnMaxStacksEffect != null)
            {
                OnMaxStacksEffect.Initialize(targets);

                maxStacksReached?.Invoke();
            }
            currentStacks = 0;
        }
        else
        {
            OnEveryStackEffect.Initialize(targets);
        }
    }
Esempio n. 4
0
 private void OnEffectEnds()
 {
     OnEndEffect.Initialize(targets);        
     visualizer.StopVisualizer();
     timer = null;
 }
Esempio n. 5
0
 private void OnEverySecond()
 {
     OnEverySecondEffect.Initialize(targets);
 }
Esempio n. 6
0
 private void OnEffectStarts()
 {
     OnStartEffect.Initialize(targets);
 }