Пример #1
0
        public void ApplyAssignEffect()
        {
            PreProcess();
            if (Effect is DamageEffect damageEffect)
            {
            }
            if (Effect is AddStatusEffect addStatusEffect)
            {
                var statusConfig = addStatusEffect.AddStatus;
                if (statusConfig.CanStack == false)
                {
                    if (Target.HasStatus(statusConfig.ID))
                    {
                        var status          = Target.GetStatus(statusConfig.ID);
                        var statusLifeTimer = status.GetComponent <StatusLifeTimeComponent>().LifeTimer;
                        statusLifeTimer.MaxTime = addStatusEffect.Duration / 1000f;
                        statusLifeTimer.Reset();
                        return;
                    }
                }
                Status        = Target.AttachStatus <StatusAbility>(statusConfig);
                Status.Caster = Creator;
                Status.Level  = SourceAbility.Level;
                Status.AddComponent <StatusLifeTimeComponent>();
                Status.TryActivateAbility();
            }
            PostProcess();

            ApplyAction();
        }
Пример #2
0
 public void ApplyAssignEffect()
 {
     PreProcess();
     if (Effect is DamageEffect damageEffect)
     {
     }
     if (Effect is AddStatusEffect addStatusEffect)
     {
         Status        = Target.ReceiveStatus <StatusAbility>(addStatusEffect.AddStatus);
         Status.Caster = Creator;
         Status.AddComponent <StatusLifeTimeComponent>();
         Status.TryActivateAbility();
     }
     PostProcess();
 }