Exemplo n.º 1
0
        /// <summary>
        /// Contextually calculate the damage of an aura before critical or direct hit
        /// calculations and before 5% variance. Requires initialized and active source
        /// actor and target, as well as the aura information.  This should be calculated
        /// on application of the aura, and attached to the active aura, as aura effects
        /// snapshot temporary effects (e.g. Trick Attack).
        /// </summary>
        /// <param name="source">The source actor using the action.</param>
        /// <param name="target">The target being affected by the action.</param>
        /// <param name="aura">The aura being applied.</param>
        /// <returns>Damage before RNG effects.</returns>
        public static int _calculateAuraBaseDamage(IActor source, ITarget target, BaseAura aura)
        {
            var potency = aura.DamageOverTimePotency;

            if (potency == 0)
            {
                return(0);
            }

            double damage      = 0;
            var    primaryStat = Constants.getDefaultPrimaryStat(source.JobID);

            // Collect relevant stats and multipliers.
            var weaponDamage            = source.getStat(CharacterStat.WEAPONDAMAGE);
            var attackPower             = source.getStat(CharacterStat.ATTACKPOWER);
            var determinationMultiplier = Formulas.calculateDeterminationMultiplier(source.getStat(CharacterStat.DETERMINATION));
            var tenacityMultiplier      = Formulas.calculateTenacityMultiplier(source.getStat(CharacterStat.TENACITY));
            var speedMultiplier         = Formulas.calculateSpeedMultiplier(source.getStat(CharacterStat.SPEED));

            // Base damage, innate actor multipliers (determination, tenacity, speed, traits)
            damage = Formulas.calculateActionDamage(potency, weaponDamage, attackPower, source.JobID, primaryStat);
            damage = damage * determinationMultiplier;
            damage = damage * tenacityMultiplier;
            damage = Math.Floor(damage * Constants.getTraitDamageModifier(source.JobID));
            damage = Math.Floor(damage * speedMultiplier);

            return((int)damage);
        }
Exemplo n.º 2
0
        public AuraEvent(long time, IActor source, ITarget target, BaseAura aura) : base(time, source)
        {
            this.Target = target;
            this.Aura   = aura;

            this.AuraStack = 1;
        }
Exemplo n.º 3
0
        public BattleEvent(BattleEventType type, long time)
        {
            Type = type;
            Time = time;

            Source   = null;
            Target   = null;
            Aura     = null;
            Action   = null;
            BaseAura = null;
        }
Exemplo n.º 4
0
        public BattleEvent(BattleEventType type,
                           long time,
                           IActor source,
                           ITarget target    = null,
                           Action action     = null,
                           Aura aura         = null,
                           BaseAura baseAura = null)
        {
            Type   = type;
            Source = source;
            Target = target;
            Time   = time;

            Action   = action;
            Aura     = aura;
            BaseAura = baseAura;
        }
Exemplo n.º 5
0
        private void _handleApplyAuraEvent(IActor source, ITarget target, BaseAura aura)
        {
            // Apply the aura.
            var appliedAura = _applyAura(aura, source, target);

            // Log event.
            CombatLogEventType type;

            if (appliedAura.isBuff)
            {
                type = CombatLogEventType.APPLYBUFF;
            }
            else
            {
                type = CombatLogEventType.APPLYDEBUFF;
            }
            //EventLog.Add(new CombatLogEvent(type, appliedAura.Expires, appliedAura.Source, target, appliedAura.BaseAura));

            // Add aura expiration event in the future.
            EventQueue.Add(new BattleEvent(BattleEventType.EXPIRE_AURA,
                                           appliedAura.Expires, appliedAura.Source,
                                           target, aura: appliedAura));
        }
Exemplo n.º 6
0
 private Aura _applyAura(BaseAura aura, IActor source, ITarget target)
 {
     throw new NotImplementedException();
 }