/// <summary>
        /// Static utility function that returns the default ("un-buffed") value for a BuffableValue.
        /// (This just ensures that there's one place for all these constants.)
        /// </summary>
        public static float GetUnbuffedValue(Action.BuffableValue buffType)
        {
            switch (buffType)
            {
            case BuffableValue.PercentDamageReceived: return(1);

            case BuffableValue.PercentHealingReceived: return(1);

            case BuffableValue.ChanceToStunTramplers: return(0);

            default: throw new System.Exception($"Unknown buff type {buffType}");
            }
        }
Example #2
0
        /// <summary>
        /// Gives all active Actions a chance to alter a gameplay variable.
        /// </summary>
        /// <remarks>
        /// Note that this handles both positive alterations (commonly called "buffs")
        /// AND negative ones ("debuffs").
        /// </remarks>
        /// <param name="buffType">Which gameplay variable is being calculated</param>
        /// <returns>The final ("buffed") value of the variable</returns>
        public float GetBuffedValue(Action.BuffableValue buffType)
        {
            float buffedValue = Action.GetUnbuffedValue(buffType);

            if (m_Queue.Count > 0)
            {
                m_Queue[0].BuffValue(buffType, ref buffedValue);
            }
            foreach (var action in m_NonBlockingActions)
            {
                action.BuffValue(buffType, ref buffedValue);
            }
            return(buffedValue);
        }
Example #3
0
 /// <summary>
 /// Determines a gameplay variable for this character. The value is determined
 /// by the character's active Actions.
 /// </summary>
 /// <param name="buffType"></param>
 /// <returns></returns>
 public float GetBuffedValue(Action.BuffableValue buffType)
 {
     return(m_ActionPlayer.GetBuffedValue(buffType));
 }