Exemplo n.º 1
0
 public override void Reset()
 {
     base.Reset();
     OngoingEffect?.Remove();
     Game.OneTurnEffects.RemoveAll(p => p.entityId == Id);
     if (ToBeDestroyed)
     {
         Game.DeadMinions.Remove(OrderOfPlay);
         ToBeDestroyed = false;
     }
 }
Exemplo n.º 2
0
        //private bool ChargeBuffed()
        //{
        //	if (NumAttacksThisTurn == 0 && HasCharge && IsExhausted)
        //	{
        //		IsExhausted = false;
        //	}
        //	return true;
        //}

        /// <summary>Disables all special effects on this minion.
        /// It's not possible to undo a silence!
        /// </summary>
        public void Silence()
        {
            HasTaunt                   = false;
            IsFrozen                   = false;
            IsEnraged                  = false;
            HasCharge                  = false;
            HasWindfury                = false;
            HasDivineShield            = false;
            HasStealth                 = false;
            HasDeathrattle             = false;
            HasBattleCry               = false;
            HasInspire                 = false;
            HasLifeSteal               = false;
            CantBeTargetedByHeroPowers = false;
            CantBeTargetedBySpells     = false;
            IsImmune                   = false;

            int sp = this[GameTag.SPELLPOWER];

            if (sp > 0)
            {
                Controller.CurrentSpellPower -= sp;
                this[GameTag.SPELLPOWER]      = 0;
            }

            OngoingEffect?.Remove();
            Game.OneTurnEffects.RemoveAll(p => p.entityId == Id);
            ActivatedTrigger?.Remove();
            //Controller.BoardZone.Auras.ForEach(aura => aura.EntityRemoved(this));

            if (AppliedEnchantments != null)
            {
                for (int i = AppliedEnchantments.Count - 1; i >= 0; i--)
                {
                    if (AppliedEnchantments[i].Creator.Power?.Aura != null)
                    {
                        continue;
                    }
                    AppliedEnchantments[i].Remove();
                }
            }

            AttackDamage = Card[GameTag.ATK];
            if (Health > Card[GameTag.HEALTH])
            {
                Health = Card[GameTag.HEALTH];
            }
            else
            {
                int cardBaseHealth = Card[GameTag.HEALTH];
                int delta          = BaseHealth - cardBaseHealth;
                if (delta > 0)
                {
                    Damage -= delta;
                }
                this[GameTag.HEALTH] = Card[GameTag.HEALTH];
            }

            if (_data.Tags.TryGetValue(GameTag.CONTROLLER_CHANGED_THIS_TURN, out int v) && v > 0)
            {
                Game.TaskQueue.Execute(new ControlTask(EntityType.SOURCE, true), Controller, this, null);
                this[GameTag.CONTROLLER_CHANGED_THIS_TURN] = 0;
            }

            if (_history && Card[GameTag.TRIGGER_VISUAL] == 1)
            {
                this[GameTag.TRIGGER_VISUAL] = 0;
            }

            IsSilenced = true;

            Game.Log(LogLevel.INFO, BlockType.PLAY, "Minion", !Game.Logging? "":$"{this} got silenced!");
        }
Exemplo n.º 3
0
 public override void Reset()
 {
     base.Reset();
     OngoingEffect?.Remove();
 }