Exemplo n.º 1
0
 protected void Initialize(Character character, Base.StatsWarrior stats, CombatFactors cf, BossOptions bo,
     Skills.Ability ability, bool ismh, bool usespellhit, bool userangedhit, bool alwaysHit)
 {
     Char = character;
     StatS = stats;
     bossOpts = bo;
     combatFactors = cf;
     Abil = ability;
     isWhite = (Abil == null);
     isMH = ismh;
     useSpellHit = usespellhit;
     useRangedHit = userangedhit;
     // Start a calc
     Reset(alwaysHit);
 }
Exemplo n.º 2
0
 protected void Initialize(Character character, Base.StatsWarrior stats, CombatFactors cf, BossOptions bo,
                           Skills.Ability ability, bool ismh, bool usespellhit, bool userangedhit, bool alwaysHit)
 {
     Char          = character;
     StatS         = stats;
     bossOpts      = bo;
     combatFactors = cf;
     Abil          = ability;
     isWhite       = (Abil == null);
     isMH          = ismh;
     useSpellHit   = usespellhit;
     useRangedHit  = userangedhit;
     // Start a calc
     Reset(alwaysHit);
 }
Exemplo n.º 3
0
        public FuryRotation(Character character, Stats stats, CombatFactors cf, Skills.WhiteAttacks wa, CalculationOptionsDPSWarr co, BossOptions bo)
        {
            Char    = character;
            StatS   = stats;
            Talents = Char == null || Char.WarriorTalents == null ? new WarriorTalents() : Char.WarriorTalents;
            //TalentsCata = Char == null || Char.WarriorTalentsCata == null ? new WarriorTalentsCata() : Char.WarriorTalentsCata;
            CombatFactors = cf;
            CalcOpts      = (co == null ? new CalculationOptionsDPSWarr() : co);
            BossOpts      = (bo == null ? new BossOptions() : bo);
            WhiteAtks     = wa;

            _cachedLatentGCD = 1.5f + CalcOpts.Latency + CalcOpts.AllowedReact;
            _cachedNumGCDs   = CalcOpts.AllowFlooring ? (float)Math.Floor(FightDuration / LatentGCD) : FightDuration / LatentGCD;
            // Initialize();
        }
Exemplo n.º 4
0
        protected void Initialize(Character character, Stats stats, CombatFactors cf, CalculationOptionsDPSWarr co, BossOptions bo,
                                  Skills.Ability ability, bool ismh, bool useSpellHit, bool alwaysHit)
        {
            Char             = character;
            StatS            = stats;
            calcOpts         = co;
            bossOpts         = bo;
            combatFactors    = cf;
            Abil             = ability;
            isWhite          = (Abil == null);
            isMH             = ismh;
            this.useSpellHit = useSpellHit;

            /*// Defaults
             * Miss
             * Dodge
             * Parry
             * Block
             * Glance
             * Critical
             * Hit*/
            // Start a calc
            Reset(alwaysHit);
        }
Exemplo n.º 5
0
 public AttackTable(Character character, Base.StatsWarrior stats, CombatFactors cf, BossOptions bo, Skills.Ability ability, bool ismh, bool useSpellHit, bool useRangedHit, bool alwaysHit)
 {
     Initialize(character, stats, cf, bo, ability, ismh, useSpellHit, useRangedHit, alwaysHit);
 }
Exemplo n.º 6
0
 public AttackTable(Character character, Stats stats, CombatFactors cf, CalculationOptionsDPSWarr co, BossOptions bo, Skills.Ability ability, bool ismh, bool useSpellHit, bool alwaysHit)
 {
     Initialize(character, stats, cf, co, bo, ability, ismh, useSpellHit, alwaysHit);
 }
Exemplo n.º 7
0
 public AttackTable(Character character, Base.StatsWarrior stats, CombatFactors cf, BossOptions bo, Skills.Ability ability, bool ismh, bool useSpellHit, bool useRangedHit, bool alwaysHit)
 {
     Initialize(character, stats, cf, bo, ability, ismh, useSpellHit, useRangedHit, alwaysHit);
 }
Exemplo n.º 8
0
        private Base.StatsWarrior GetCharacterStats(Character character, Item additionalItem, StatType statType, CalculationOptionsDPSWarr calcOpts, BossOptions bossOpts,
            out Base.StatsWarrior statsRace, out CombatFactors combatFactors, out Skills.WhiteAttacks whiteAttacks, out Rotation Rot)
        {
#if DEBUG
            //ConstructionCounts["GetCharacterStats_Inner"]++;
#endif
            DPSWarrCharacter dpswarchar = new DPSWarrCharacter { Char = character, CalcOpts = calcOpts, BossOpts = bossOpts, Talents = character.WarriorTalents, CombatFactors = null, Rot = null };
            Base.StatsWarrior statsTotal = GetCharacterStats_Buffed(dpswarchar, additionalItem, statType != StatType.Unbuffed, out statsRace);
            dpswarchar.StatS = statsTotal;
            combatFactors = new CombatFactors(character, statsTotal, calcOpts, bossOpts); // we have to regenerate it here
            dpswarchar.CombatFactors = combatFactors;
            whiteAttacks = new Skills.WhiteAttacks(dpswarchar);
            dpswarchar.Whiteattacks = whiteAttacks;
            if (combatFactors.FuryStance) Rot = new FuryRotation(dpswarchar);
            else Rot = new ArmsRotation(dpswarchar);
            dpswarchar.Rot = Rot;
            
            if (statType == (StatType.Buffed | StatType.Unbuffed))
            {
                return statsTotal;
            }
            // SpecialEffects: Supposed to handle all procs such as Berserking, Mirror of Truth, Grim Toll, etc.
            Rot.Initialize();
            Rot.MakeRotationandDoDPS(false, false);
            Rot.AddValidatedSpecialEffects(statsTotal, character.WarriorTalents);

            DPSWarrCharacter charStruct = new DPSWarrCharacter(){
                CalcOpts = calcOpts,
                BossOpts = bossOpts,
                Char = character,
                CombatFactors = combatFactors,
                Rot = Rot,
                Talents = character.WarriorTalents,
                StatS = statsTotal,
                Whiteattacks = whiteAttacks,
            };

            float fightDuration = bossOpts.BerserkTimer;

            List<SpecialEffect> bersMainHand = new List<SpecialEffect>();
            List<SpecialEffect> bersOffHand = new List<SpecialEffect>();

            if (character.MainHandEnchant != null/* && character.MainHandEnchant.Id == 3789*/) { // 3789 = Berserker Enchant ID, but now supporting other proc effects as well
                Stats.SpecialEffectEnumerator mhEffects = character.MainHandEnchant.Stats.SpecialEffects();
                if (mhEffects.MoveNext()) {
                    bersMainHand.Add(mhEffects.Current); 
                }
            }
            if (character.MainHand != null && character.MainHand.Item.Stats._rawSpecialEffectData != null) {
                Stats.SpecialEffectEnumerator mhEffects = character.MainHand.Item.Stats.SpecialEffects();
                if (mhEffects.MoveNext()) { bersMainHand.Add(mhEffects.Current); }
            }
            if (combatFactors.useOH && character.OffHandEnchant != null /*&& character.OffHandEnchant.Id == 3789*/) {
                Stats.SpecialEffectEnumerator ohEffects = character.OffHandEnchant.Stats.SpecialEffects();
                if (ohEffects.MoveNext()) { bersOffHand.Add(ohEffects.Current); }
            }
            if (character.OffHand != null && character.OffHand.Item.Stats._rawSpecialEffectData != null) {
                Stats.SpecialEffectEnumerator ohEffects = character.OffHand.Item.Stats.SpecialEffects();
                if (ohEffects.MoveNext()) { bersOffHand.Add(ohEffects.Current); }
            }
            if (statType == StatType.Average) {
                DoSpecialEffects(charStruct, bersMainHand, bersOffHand, statsTotal);
            }
            else // if (statType == StatType.Maximum)
            {
                Base.StatsWarrior maxSpecEffects = new Base.StatsWarrior();
                foreach (SpecialEffect effect in statsTotal.SpecialEffects()) maxSpecEffects.Accumulate(effect.Stats);
                return UpdateStatsAndAdd(maxSpecEffects as Base.StatsWarrior, combatFactors.StatS, character);
            }
            //UpdateStatsAndAdd(statsProcs, statsTotal, character); // Already done in GetSpecialEffectStats

            // special case for dual wielding w/ berserker enchant on one/both weapons, as they act independently
            //combatFactors.StatS = statsTotal;
            Base.StatsWarrior bersStats = new Base.StatsWarrior();
            foreach (SpecialEffect e in bersMainHand) {
                if (e.Duration == 0) {
                    bersStats.ShadowDamage = e.GetAverageProcsPerSecond(fightDuration / Rot.AttemptedAtksOverDurMH, Rot.LandedAtksOverDurMH / Rot.AttemptedAtksOverDurMH, combatFactors.CMHItemSpeed, calcOpts.SE_UseDur ? fightDuration : 0);
                } else {
                    // berserker enchant id
                    float f = e.GetAverageUptime(fightDuration / Rot.AttemptedAtksOverDurMH, Rot.LandedAtksOverDurMH / Rot.AttemptedAtksOverDurMH, combatFactors.CMHItemSpeed, calcOpts.SE_UseDur ? fightDuration : 0);
                    bersStats.Accumulate(e.Stats, f);
                }
            }
            foreach (SpecialEffect e in bersOffHand) {
                if (e.Duration == 0) {
                    bersStats.ShadowDamage += e.GetAverageProcsPerSecond(fightDuration / Rot.AttemptedAtksOverDurOH, Rot.LandedAtksOverDurOH / Rot.AttemptedAtksOverDurOH, combatFactors.COHItemSpeed, calcOpts.SE_UseDur ? fightDuration : 0);
                } else {
                    float f = e.GetAverageUptime(fightDuration / Rot.AttemptedAtksOverDurOH, Rot.LandedAtksOverDurOH / Rot.AttemptedAtksOverDurOH, combatFactors.COHItemSpeed, calcOpts.SE_UseDur ? fightDuration : 0);
                    bersStats.Accumulate(e.Stats, f);
                }
            }
            combatFactors.StatS = UpdateStatsAndAdd(bersStats, combatFactors.StatS, character);
            combatFactors.InvalidateCache();
            return combatFactors.StatS;
        }