예제 #1
0
 /// <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;
 }
예제 #2
0
 public Enchant(GameTag tag, EffectOperator @operator, int value)
 {
     Effects = new IEffect[] { new Effect(tag, @operator, value) };
 }
예제 #3
0
파일: Aura.cs 프로젝트: leod/SabberStone
 /// <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;
 }
예제 #4
0
파일: Aura.cs 프로젝트: leod/SabberStone
        //public (TriggerType Type, TriggerSource Source, SelfCondition Condition) UpdateTrigger;

        public AdaptiveCostEffect(EffectOperator @operator, Func <IPlayable, int> costFunc) : base(AuraType.ADAPTIVE)
        {
            ValueFunc = costFunc;
            _operator = @operator;
        }
예제 #5
0
 /// <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;
 }
예제 #7
0
 public abstract void ApplyAura(T entity, EffectOperator @operator, int value);
예제 #8
0
 public abstract void RemoveAura(T entity, EffectOperator @operator, int value);
예제 #9
0
 internal GenericEffect(TAttr attr, EffectOperator @operator, int value)
 {
     _attr     = attr;
     _operator = @operator;
     _value    = value;
 }
예제 #10
0
 public override void Apply(T entity, EffectOperator @operator, int value)
 {
     ref int?target = ref GetRef(entity);
예제 #11
0
 private AdaptiveEffect(AdaptiveEffect prototype, IPlayable owner) : base(prototype, owner)
 {
     _tag       = prototype._tag;
     _operator  = prototype._operator;
     _lastValue = prototype._lastValue;
 }
예제 #12
0
        //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;
        }
예제 #13
0
 private AdaptiveCostEffect(AdaptiveCostEffect prototype, IPlayable owner) : base(prototype, owner)
 {
     _operator = prototype._operator;
 }
예제 #14
0
 public AdaptiveCostEffect(EffectOperator @operator, Func <IPlayable, int> predicate) : base(AuraType.ADAPTIVE)
 {
     Predicate = predicate;
     _operator = @operator;
 }
예제 #15
0
 public AdaptiveEffect(GameTag tag, EffectOperator @operator, Func <IPlayable, int> predicate) : base(AuraType.ADAPTIVE)
 {
     Predicate = predicate;
     _tag      = tag;
     _operator = @operator;
 }