コード例 #1
0
        /// <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;
        }
コード例 #2
0
        /// <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;
        }
コード例 #3
0
ファイル: BaseMinion.cs プロジェクト: kwluo90/HearthAnalyzer
        /// <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;
        }
コード例 #4
0
ファイル: BaseMinion.cs プロジェクト: kwluo90/HearthAnalyzer
 /// <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;
 }
コード例 #5
0
ファイル: BaseMinion.cs プロジェクト: kwluo90/HearthAnalyzer
        /// <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;
        }
コード例 #6
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;
 }