Ejemplo n.º 1
0
        /// <summary>
        /// Remove ths aura effect from the target entity.
        /// </summary>
        public void Remove(AuraEffects auraEffects)
        {
            if (Tag == GameTag.COST)
            {
                auraEffects.RemoveCostAura(this);
                return;
            }

            if (Tag == GameTag.HEALTH && Operator == EffectOperator.ADD)
            {
                //((ICharacter)auraEffects.Owner).Damage -= Value;
                auraEffects.Owner[GameTag.DAMAGE] -= Value;
            }

            switch (Operator)
            {
            case EffectOperator.ADD:
                auraEffects[Tag] -= Value;
                return;

            case EffectOperator.SUB:
                auraEffects[Tag] += Value;
                return;

            case EffectOperator.SET:
                auraEffects[Tag] -= Value;
                return;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Apply this effect to the target as an aura effect.
        /// </summary>
        public void Apply(AuraEffects auraEffects)
        {
            if (Tag == GameTag.COST)
            {
                auraEffects.AddCostAura(this);
                return;
            }

            switch (Operator)
            {
            case EffectOperator.ADD:
                auraEffects[Tag] += Value;
                return;

            case EffectOperator.SUB:
                auraEffects[Tag] += Value;
                return;

            // TODO: SET Aura
            case EffectOperator.SET:
                auraEffects.Owner[Tag] = 0;
                auraEffects[Tag]       = Value;
                return;

            default:
                throw new NotImplementedException();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Apply this effect to the target as an aura effect.
        /// </summary>
        public void ApplyAuraTo(IPlayable playable)
        {
            AuraEffects auraEffects = playable.AuraEffects;

            if (auraEffects == null)
            {
                auraEffects          = new AuraEffects(playable.Card.Type);
                playable.AuraEffects = auraEffects;
            }

            switch (Operator)
            {
            case EffectOperator.ADD:
                auraEffects[Tag] += Value;
                return;

            case EffectOperator.SUB:
                auraEffects[Tag] -= Value;
                return;

            // TODO: SET Aura
            case EffectOperator.SET:
                //playable[Tag] = 0;
                auraEffects[Tag] = Value;

                if (playable is Minion m)
                {
                    switch (Tag)
                    {
                    case GameTag.CHARGE:
                        if (m.IsExhausted && m._numAttackThisTurn < 1)
                        {
                            m.IsExhausted = false;
                        }
                        if (m.AttackableByRush)
                        {
                            m.AttackableByRush = false;
                        }
                        break;

                    case GameTag.RUSH:
                        if (m.IsExhausted && m._numAttackThisTurn == 0)
                        {
                            m.IsExhausted      = false;
                            m.AttackableByRush = true;
                            playable.Game.RushMinions.Add(playable.Id);
                        }
                        break;

                    case GameTag.HEALTH_MINIMUM:
                        m[GameTag.HEALTH_MINIMUM] = Value;
                        break;
                    }
                }
                return;

            default:
                throw new NotImplementedException();
            }
        }
Ejemplo n.º 4
0
		private AuraEffects(IEntity owner, AuraEffects other)
		{
			Owner = owner;
			Checker = Checker;
			_costEffects = other._costEffects?.Count > 0 ? new List<CostEffect>(other._costEffects) : null;
			COST = other.COST;
			CANT_BE_TARGETED_BY_SPELLS = other.CANT_BE_TARGETED_BY_SPELLS;
			IMMUNE = other.IMMUNE;
			ATK = other.ATK;
			CANTATTACKHEROES = other.CANTATTACKHEROES;
			if (!(owner is Minion)) return;
			HEALTH = other.HEALTH;
			CHARGE = other.CHARGE;
			WINDFURY = other.WINDFURY;
			LIFESTEAL = other.LIFESTEAL;
			CANT_ATTACK = other.CANT_ATTACK;
			CARD_COST_HEALTH = other.CARD_COST_HEALTH;
			RUSH = other.RUSH;
			ECHO = other.ECHO;
		}
Ejemplo n.º 5
0
 private AuraEffects(AuraEffects original) : this(original.Type)
 {
     Buffer.BlockCopy(original._data, 0, _data, 0, _data.Length * _int32Size);
 }
Ejemplo n.º 6
0
 protected abstract ref int GetAuraRef(AuraEffects auraEffects);