/// <summary> /// Create an Enchant that uses the Number value in the stack. /// </summary> public Enchant(GameTag tag, EffectOperator @operator) { Effects = new IEffect[] { new Effect(tag, @operator, 0) }; UseScriptTag = true; }
public Enchant(GameTag tag, EffectOperator @operator, int value) { Effects = new IEffect[] { new Effect(tag, @operator, value) }; }
/// <summary> /// Defines a kind of effects in which the given tag varies with the value from the given function. (e.g. giants) /// </summary> public AdaptiveEffect(GameTag tag, EffectOperator @operator, Func <IPlayable, int> valueFunc) : base(AuraType.ADAPTIVE) { ValueFunc = valueFunc; _tag = tag; _operator = @operator; }
//public (TriggerType Type, TriggerSource Source, SelfCondition Condition) UpdateTrigger; public AdaptiveCostEffect(EffectOperator @operator, Func <IPlayable, int> costFunc) : base(AuraType.ADAPTIVE) { ValueFunc = costFunc; _operator = @operator; }
/// <summary> /// Create a new Effect. An Effect consists of <see cref="GameTag"/>, <see cref="EffectOperator"/>, and <see cref="int"/> value. /// </summary> /// <param name="tag">The <see cref="GameTag"/> to be affected.</param> /// <param name="operator">The operation this effect performs.</param> /// <param name="value">The right operand of the operator.</param> public Effect(GameTag tag, EffectOperator @operator, int value) { Tag = tag; Operator = @operator; Value = value; }
/// <summary> /// Defines a kind of effects in which the given tag varies with the value from the given function. (e.g. giants) /// </summary> public AdaptiveEffect(GameTag tag, EffectOperator @operator, Func <Playable, int> valueFunc) { _tag = tag; _operator = @operator; _valueFunction = valueFunc; }
public abstract void ApplyAura(T entity, EffectOperator @operator, int value);
public abstract void RemoveAura(T entity, EffectOperator @operator, int value);
internal GenericEffect(TAttr attr, EffectOperator @operator, int value) { _attr = attr; _operator = @operator; _value = value; }
public override void Apply(T entity, EffectOperator @operator, int value) { ref int?target = ref GetRef(entity);
private AdaptiveEffect(AdaptiveEffect prototype, IPlayable owner) : base(prototype, owner) { _tag = prototype._tag; _operator = prototype._operator; _lastValue = prototype._lastValue; }
//public (TriggerType Type, TriggerSource Source, SelfCondition Condition) UpdateTrigger; /// <summary> /// Creates an Adaptive Cost Effect that varies the owner's cost. /// (e.g. Giants needs subtraction. They costs less for the calculated value from the given cost function.) /// The argument of the cost function is the owner entity. /// </summary> /// <param name="costFunc">The cost function to calculate the amount the owner costs varies.</param> /// <param name="operator">This determines how cost varies.</param> public AdaptiveCostEffect(Func <IPlayable, int> costFunc, EffectOperator @operator = EffectOperator.SUB) { _costFunction = costFunc; _operator = @operator; }
private AdaptiveCostEffect(AdaptiveCostEffect prototype, IPlayable owner) : base(prototype, owner) { _operator = prototype._operator; }
public AdaptiveCostEffect(EffectOperator @operator, Func <IPlayable, int> predicate) : base(AuraType.ADAPTIVE) { Predicate = predicate; _operator = @operator; }
public AdaptiveEffect(GameTag tag, EffectOperator @operator, Func <IPlayable, int> predicate) : base(AuraType.ADAPTIVE) { Predicate = predicate; _tag = tag; _operator = @operator; }