Esempio n. 1
0
        protected void Initialize(Character character, Stats stats, CombatFactors cf, CalculationOptionsHunter co,
                                  Skills.Ability ability, bool useSpellHit, bool alwaysHit)
        {
            Char             = character;
            StatS            = stats;
            calcOpts         = co;
            combatFactors    = cf;
            Abil             = ability;
            PetAbil          = PetAttacks.None;
            isWhite          = (Abil == null);
            this.useSpellHit = useSpellHit;

            /*// Defaults
             * Miss
             * Dodge
             * Parry
             * Block
             * Glance
             * Critical
             * Hit*/
            // Start a calc
            if (alwaysHit)
            {
                CalculateAlwaysHit();
            }
            else
            {
                Calculate();
            }
        }
Esempio n. 2
0
        protected void Initialize(Character character, StatsHunter stats, CalculationOptionsHunter co,
                                  float[] avoidChances, PetAttacks ability, bool useSpellHit, bool alwaysHit)
        {
            Char             = character;
            StatS            = stats;
            calcOpts         = co;
            combatFactors    = null;
            Abil             = null;
            PetAbil          = ability;
            isWhite          = (PetAbil == PetAttacks.None);
            this.useSpellHit = useSpellHit;

            /*// Defaults
             * Miss
             * Dodge
             * Parry
             * Block
             * Glance
             * Critical
             * Hit*/
            // Start a calc
            if (alwaysHit)
            {
                CalculateAlwaysHit();
            }
            else
            {
                Calculate(avoidChances);
            }
        }
Esempio n. 3
0
        public float getSkillFrequency(PetAttacks skill)
        {
            // if we're asking for the frequency of one of the 'always on' skills,
            // and we have the talent for it, just return the cooldown.
            if (skill == PetAttacks.Rabid)
            {
                return((options.PetTalents.Rabid > 0) ? skillLibrary[PetAttacks.Rabid].cooldown : 0);
            }
            if (skill == PetAttacks.CallOfTheWild)
            {
                return((options.PetTalents.CallOfTheWild > 0) ? skillLibrary[PetAttacks.CallOfTheWild].cooldown : 0);
            }
            if (skill == PetAttacks.Bullheaded)
            {
                return((options.PetTalents.Bullheaded > 0) ? skillLibrary[PetAttacks.Bullheaded].cooldown : 0);
            }
            if (skill == PetAttacks.RoarOfRecovery)
            {
                return((options.PetTalents.RoarOfRecovery > 0) ? skillLibrary[PetAttacks.RoarOfRecovery].cooldown : 0);
            }

            foreach (PetSkillInstance S in skills)
            {
                if (S.skillType == skill)
                {
                    return(S.frequency);
                }
            }
            return(0);
        }
Esempio n. 4
0
 protected void Initialize(Character character, StatsHunter stats, CombatFactors cf, CalculationOptionsHunter co,
     Skills.Ability ability, bool useSpellHit, bool alwaysHit)
 {
     Char = character;
     StatS = stats;
     calcOpts = co;
     combatFactors = cf;
     Abil = ability;
     if (Abil == null)
     {
         isWhite = true;
     }
     else
     {
         Abil.combatFactors = combatFactors;
     }
     PetAbil = PetAttacks.None;
     this.useSpellHit = useSpellHit;
     /*// Defaults
     Miss 
     Dodge
     Parry
     Block
     Glance
     Critical
     Hit*/
     // Start a calc            
     if (alwaysHit) CalculateAlwaysHit();
     else Calculate();            
 }
Esempio n. 5
0
 public float getSkillCooldown(PetAttacks skill)
 {
     foreach (PetSkillInstance S in skills)
     {
         if (S.skillType == skill)
         {
             return(S.cooldown);
         }
     }
     return(0);
 }
Esempio n. 6
0
 public PetAttackTable(Character character, StatsHunter stats, CalculationOptionsHunter co,
                       float[] avoidChances, PetAttacks ability, bool useSpellHit, bool alwaysHit)
 {
     Initialize(character, stats, co, avoidChances, ability, useSpellHit, alwaysHit);
 }
Esempio n. 7
0
 public PetSkillInstance(PetSkillPriorityRotation priorityRotation, PetAttacks skillType, PetSkill skillData)
 {
     this.priorityRotation = priorityRotation;
     this.skillType = skillType;
     this.skillData = skillData;
 }
Esempio n. 8
0
 public float getSkillCooldown(PetAttacks skill)
 {
     foreach (PetSkillInstance S in skills)
     {
         if (S.skillType == skill) return S.cooldown;
     }
     return 0;
 }
Esempio n. 9
0
        public float getSkillFrequency(PetAttacks skill)
        {
            // if we're asking for the frequency of one of the 'always on' skills,
            // and we have the talent for it, just return the cooldown.
            if (skill == PetAttacks.Rabid) return (options.PetTalents.Rabid > 0) ? skillLibrary[PetAttacks.Rabid].cooldown : 0;
            if (skill == PetAttacks.CallOfTheWild) return (options.PetTalents.CallOfTheWild > 0) ? skillLibrary[PetAttacks.CallOfTheWild].cooldown : 0;
            if (skill == PetAttacks.Bullheaded) return (options.PetTalents.Bullheaded > 0) ? skillLibrary[PetAttacks.Bullheaded].cooldown : 0;
            if (skill == PetAttacks.RoarOfRecovery) return (options.PetTalents.RoarOfRecovery > 0) ? skillLibrary[PetAttacks.RoarOfRecovery].cooldown : 0;

            foreach (PetSkillInstance S in skills)
            {
                if (S.skillType == skill) return S.frequency;
            }
            return 0;
        }
Esempio n. 10
0
        public void AddSkill(PetAttacks skillType)
        {
            // don't add non-skills to the rotation
            if (skillType == PetAttacks.None) return;

            // check that this skill is not already in the rotation
            foreach (PetSkillInstance S in skills) {
                if (S.skillType == skillType) return;
            }

            // don't add skills that require a talent we are missing
            if (skillType == PetAttacks.Bullheaded && options.PetTalents.Bullheaded == 0) return;
            if (skillType == PetAttacks.CallOfTheWild && options.PetTalents.CallOfTheWild == 0) return;
            if (skillType == PetAttacks.Dash && options.PetTalents.DiveDash == 0) return;
            if (skillType == PetAttacks.Dive && options.PetTalents.DiveDash == 0) return;
            if (skillType == PetAttacks.LastStand && options.PetTalents.LastStand == 0) return;
            if (skillType == PetAttacks.LickYourWounds && options.PetTalents.LickYourWounds == 0) return;
            if (skillType == PetAttacks.Rabid && options.PetTalents.Rabid == 0) return;
            if (skillType == PetAttacks.RoarOfRecovery && options.PetTalents.RoarOfRecovery == 0) return;
            if (skillType == PetAttacks.RoarOfSacrifice && options.PetTalents.RoarOfSacrifice == 0) return;
            if (skillType == PetAttacks.Taunt && options.PetTalents.Taunt == 0) return;
            if (skillType == PetAttacks.WolverineBite && options.PetTalents.WolverineBite == 0) return;
            if (skillType == PetAttacks.Thunderstomp && options.PetTalents.Thunderstomp == 0) return;
            if (skillType == PetAttacks.Charge && options.PetTalents.ChargeSwoop == 0) return;
            if (skillType == PetAttacks.Swoop && options.PetTalents.ChargeSwoop == 0) return;

            // it looks good - create an instance wrapper
            skills.Add(new PetSkillInstance(this, skillType, skillLibrary[skillType]));
        }
Esempio n. 11
0
 public PetAttackTable(Character character, StatsHunter stats, CalculationOptionsHunter co,
     float[] avoidChances, PetAttacks ability, bool useSpellHit, bool alwaysHit) {
     Initialize(character, stats, co, avoidChances, ability, useSpellHit, alwaysHit);
 }
Esempio n. 12
0
 protected void Initialize(Character character, StatsHunter stats, CalculationOptionsHunter co,
     float[] avoidChances, PetAttacks ability, bool useSpellHit, bool alwaysHit)
 {
     Char = character;
     StatS = stats;
     calcOpts = co;
     combatFactors = null;
     Abil = null;
     PetAbil = ability;
     isWhite = (PetAbil == PetAttacks.None);
     this.useSpellHit = useSpellHit;
     /*// Defaults
     Miss 
     Dodge
     Parry
     Block
     Glance
     Critical
     Hit*/
     // Start a calc            
     if (alwaysHit) CalculateAlwaysHit();
     else Calculate(avoidChances);
 }
Esempio n. 13
0
 public PetSkillInstance(PetSkillPriorityRotation priorityRotation, PetAttacks skillType, PetSkill skillData)
 {
     this.priorityRotation = priorityRotation;
     this.skillType        = skillType;
     this.skillData        = skillData;
 }
Esempio n. 14
0
        public void AddSkill(PetAttacks skillType)
        {
            // don't add non-skills to the rotation
            if (skillType == PetAttacks.None)
            {
                return;
            }

            // check that this skill is not already in the rotation
            foreach (PetSkillInstance S in skills)
            {
                if (S.skillType == skillType)
                {
                    return;
                }
            }

            // don't add skills that require a talent we are missing
#if RAWR3 || SILVERLIGHT
            if (skillType == PetAttacks.Bullheaded && options.PetTalents.Bullheaded == 0)
            {
                return;
            }
            if (skillType == PetAttacks.CallOfTheWild && options.PetTalents.CallOfTheWild == 0)
            {
                return;
            }
            if (skillType == PetAttacks.Dash && options.PetTalents.DiveDash == 0)
            {
                return;
            }
            if (skillType == PetAttacks.Dive && options.PetTalents.DiveDash == 0)
            {
                return;
            }
            if (skillType == PetAttacks.LastStand && options.PetTalents.LastStand == 0)
            {
                return;
            }
            if (skillType == PetAttacks.LickYourWounds && options.PetTalents.LickYourWounds == 0)
            {
                return;
            }
            if (skillType == PetAttacks.Rabid && options.PetTalents.Rabid == 0)
            {
                return;
            }
            if (skillType == PetAttacks.RoarOfRecovery && options.PetTalents.RoarOfRecovery == 0)
            {
                return;
            }
            if (skillType == PetAttacks.RoarOfSacrifice && options.PetTalents.RoarOfSacrifice == 0)
            {
                return;
            }
            if (skillType == PetAttacks.Taunt && options.PetTalents.Taunt == 0)
            {
                return;
            }
            if (skillType == PetAttacks.WolverineBite && options.PetTalents.WolverineBite == 0)
            {
                return;
            }
            if (skillType == PetAttacks.Thunderstomp && options.PetTalents.Thunderstomp == 0)
            {
                return;
            }
            if (skillType == PetAttacks.Charge && options.PetTalents.ChargeSwoop == 0)
            {
                return;
            }
            if (skillType == PetAttacks.Swoop && options.PetTalents.ChargeSwoop == 0)
            {
                return;
            }
#else
            if (skillType == PetAttacks.Bullheaded && options.PetTalents.Bullheaded.Value == 0)
            {
                return;
            }
            if (skillType == PetAttacks.CallOfTheWild && options.PetTalents.CallOfTheWild.Value == 0)
            {
                return;
            }
            if (skillType == PetAttacks.Dash && options.PetTalents.DiveDash.Value == 0)
            {
                return;
            }
            if (skillType == PetAttacks.Dive && options.PetTalents.DiveDash.Value == 0)
            {
                return;
            }
            if (skillType == PetAttacks.LastStand && options.PetTalents.LastStand.Value == 0)
            {
                return;
            }
            if (skillType == PetAttacks.LickYourWounds && options.PetTalents.LickYourWounds.Value == 0)
            {
                return;
            }
            if (skillType == PetAttacks.Rabid && options.PetTalents.Rabid.Value == 0)
            {
                return;
            }
            if (skillType == PetAttacks.RoarOfRecovery && options.PetTalents.RoarOfRecovery.Value == 0)
            {
                return;
            }
            if (skillType == PetAttacks.RoarOfSacrifice && options.PetTalents.RoarOfSacrifice.Value == 0)
            {
                return;
            }
            if (skillType == PetAttacks.Taunt && options.PetTalents.Taunt.Value == 0)
            {
                return;
            }
            if (skillType == PetAttacks.WolverineBite && options.PetTalents.WolverineBite.Value == 0)
            {
                return;
            }
            if (skillType == PetAttacks.Thunderstomp && options.PetTalents.Thunderstomp.Value == 0)
            {
                return;
            }
            if (skillType == PetAttacks.Charge && options.PetTalents.ChargeSwoop.Value == 0)
            {
                return;
            }
            if (skillType == PetAttacks.Swoop && options.PetTalents.ChargeSwoop.Value == 0)
            {
                return;
            }
#endif

            // it looks good - create an instance wrapper
            skills.Add(new PetSkillInstance(this, skillType, skillLibrary[skillType]));
        }