private GameplayEffectSpec(GameplayEffectScriptableObject GameplayEffect, AbilitySystemCharacter Source, float Level = 1)
        {
            this.GameplayEffect = GameplayEffect;
            this.Source         = Source;
            for (var i = 0; i < this.GameplayEffect.gameplayEffect.Modifiers.Length; i++)
            {
                this.GameplayEffect.gameplayEffect.Modifiers[i].ModifierMagnitude.Initialise(this);
            }
            this.Level = Level;
            if (this.GameplayEffect.gameplayEffect.DurationModifier)
            {
                this.DurationRemaining = this.GameplayEffect.gameplayEffect.DurationModifier.CalculateMagnitude(this).GetValueOrDefault() * this.GameplayEffect.gameplayEffect.DurationMultiplier;
                this.TotalDuration     = this.DurationRemaining;
            }

            this.TimeUntilPeriodTick = this.GameplayEffect.Period.Period;
            // By setting the time to 0, we make sure it gets executed at first opportunity
            if (this.GameplayEffect.Period.ExecuteOnApplication)
            {
                this.TimeUntilPeriodTick = 0;
            }
        }
 public GameplayEffectSpec SetTarget(AbilitySystemCharacter target)
 {
     this.Target = target;
     return(this);
 }
 public static GameplayEffectSpec CreateNew(GameplayEffectScriptableObject GameplayEffect, AbilitySystemCharacter Source, float Level = 1)
 {
     return(new GameplayEffectSpec(GameplayEffect, Source, Level));
 }