コード例 #1
0
        /// <summary>
        /// Applies any status effects that are part of this action.
        /// </summary>
        /// <param name="actor">The character applying the status effects.</param>
        /// <param name="action">The action being performed.</param>
        /// <param name="targets">A list of characters to apply status effects to.</param>
        private void ApplyStatusEffects(Character actor, ActionBase action, IReadOnlyList <Character> targets)
        {
            var livingTargets = new List <Character>(targets);

            livingTargets.RemoveAll(character => character.CurrentHealth <= 0);

            if (livingTargets.Count() > 0)
            {
                foreach (var status in action.BuffsToApply)
                {
                    _statusEffectController.ApplyStatus(actor, status, livingTargets);
                }
            }
        }