Exemplo n.º 1
0
        /// <summary>
        /// For applying a fixed amoount of damage
        /// </summary>
        /// <param name="damage">the precalculated damage to be dealt</param>
        /// <returns>The actaul damage dealt</returns>
        public virtual int applyDamage(int damage)
        {
            updateHealth(-damage);
            FloatingPopup.create(combatSprite.transform.position, damage.ToString(), Color.red);

            return((int)damage);
        }
Exemplo n.º 2
0
        /// <summary>
        /// <para>
        /// Applies the status effect to this combatant.
        /// </para>
        /// See the <see cref="Assets.Scripts.Entities.Combat.EffectProcessor"/> class for effect processing logic.
        /// </summary>
        /// <param name="statusEffect">ID for an ability status effect. see EffectProcess.cs.</param>
        /// <param name="potency">The strength or duration if applicable of the status effect</param>
        /// <param name="turnsApplied">The amount of combat turns the affect will be applied for.</param>
        public virtual void applyEffect(int statusEffect, int potency, int turnsApplied)
        {
            EffectProcessor.getInstance().applyEffect(this, statusEffect, potency, turnsApplied);
            string conditionLabel = EffectProcessor.getEffectLabel(statusEffect, potency);

            FloatingPopup.create(combatSprite.transform.position, conditionLabel, Color.blue);

            log.Debug($"<b><color=#87CEEB>[CONDITION]</color></b> -{id}:\"{name}\" has been affected with <color=#87CEEB><b>{conditionLabel}</b></color>");
        }
Exemplo n.º 3
0
        /// <summary>
        /// Provides the base logic for applying a hp recovery/healing effect to a combatant.
        /// </summary>
        /// <remarks>
        /// This provides a flat healing value to the target
        /// </remarks>
        /// <param name="minValue">The lower bound of the healing being applied that is used to calculate the actual amount healed. </param>
        /// <param name="maxValue">The upper bound of the healing being applied that is used to calculate the actual amount healed.</param>
        /// <returns>The amount healed</returns>
        public virtual int applyHealing(int value)
        {
            updateHealth(value);

            FloatingPopup.create(combatSprite.transform.position, value.ToString(), new Color(0, 100, 0));
            log.Debug($"<b><color=green>[HEAL]</color></b> -{id}:\"{name}\" is healed for <color=green><b>{value}</b></color>");

            return((int)value);
        }