/// <summary> /// Applies the provided effects to the minion /// </summary> /// <param name="effects">The effects to apply</param> public void ApplyStatusEffects(MinionStatusEffects effects) { if (effects.HasFlag(MinionStatusEffects.WINDFURY)) { // If we're applying windfury, we need to unexhaust the minion if it has // only attacked once so far this turn if (this.attacksThisTurn < 2) { this.RemoveStatusEffects(MinionStatusEffects.EXHAUSTED); } } this.StatusEffects |= effects; }
/// <summary> /// Called when a minion is silenced /// </summary> public void Silence() { Logger.Instance.Debug(string.Format("Minion {0}[{1}] has been silenced!", this.Name, this.Id)); // Unregister all event listeners, including death rattles GameEventManager.UnregisterForEvents(this); GameEngine.UnregisterDeathrattle(this); // Remove any effects but keep it exhausted if it was already bool wasExhausted = this.StatusEffects.HasFlag(MinionStatusEffects.EXHAUSTED); this.StatusEffects = MinionStatusEffects.SILENCED | (wasExhausted ? MinionStatusEffects.EXHAUSTED : 0); // Remove any bonus health this.CurrentHealth = Math.Min(this.MaxHealth - this.BonusHealth, this.CurrentHealth); // Reset the attack power to its original value this.PermanentAttackBuff = 0; this.TemporaryAttackBuff = 0; }
/// <summary> /// Removes the specified effects from the minion /// </summary> /// <param name="effects">The effects to remove</param> public void RemoveStatusEffects(MinionStatusEffects effects) { this.StatusEffects = this.StatusEffects & ~effects; }