Example #1
0
        public Ability(string name, Character character, S stats, AbilityType abilityType, DamageType damageType, PLAYER_ROLES role, bool hasGCD = true, bool noMultiplier = false)
        {
            Meteor       = false;
            _name        = name;
            _character   = character;
            _stats       = stats;
            _talents     = (T)character.CurrentTalents;
            AbilityType  = abilityType;
            DamageType   = damageType;
            NoMultiplier = noMultiplier;
            Role         = role;

            HasGCD   = hasGCD;
            _normGCD = 1.5f + Latency;
            if (hasGCD)
            {
                GCD = (AbilityType == AbilityType.Spell ? 1.5f / (1 + Stats.SpellHaste) : 1.5f) + Latency;
            }
            else
            {
                GCD = 0f;
            }

            _triggers = new List <Ability <T, S, C> >();
        }
Example #2
0
 /// <summary>
 /// Generates the time lost to all Impedance types.
 /// </summary>
 /// <param name="bossOpts">Pass character.BossOptions</param>
 /// <param name="role">The role of the character</param>
 /// <param name="moveBreakingMOD">The modifier for this type, eg- Type is Moves, pass stats.MovementSpeed</param>
 /// <param name="fearBreakingMOD">The modifier for this type, eg- Type is Fears, pass stats.FearDurReduc</param>
 /// <param name="stunBreakingMOD">The modifier for this type, eg- Type is Stuns, pass stats.StunDurReduc</param>
 /// <param name="rootBreakingMOD">The modifier for this type, eg- Type is Roots, pass stats.SnareRootDurReduc</param>
 /// <param name="silenceBreakingMOD">The modifier for this type, eg- Type is Silences, pass stats.SilenceDurReduc</param>
 /// <param name="moveBreakingCD">CD of the move breaking ability in seconds</param>
 /// <param name="fearBreakingCD">CD of the fear breaking ability in seconds</param>
 /// <param name="stunBreakingCD">CD of the stun breaking ability in seconds</param>
 /// <param name="rootBreakingCD">CD of the root breaking ability in seconds</param>
 /// <param name="silenceBreakingCD">CD of the silence breaking ability in seconds</param>
 /// <returns>Returns the Percentage of time lost to all Impedance types.
 /// <para>This is limited to 0%-100% to prevent wierd calc issues</para></returns>
 public static float GetTotalImpedancePercs(BossOptions bossOpts, PLAYER_ROLES role, float moveBreakingMOD, float fearBreakingMOD, float stunBreakingMOD, float rootBreakingMOD, float silenceBreakingMOD,
     float moveBreakingCD = 0, float fearBreakingCD = 0, float stunBreakingCD = 0, float rootBreakingCD = 0, float silenceBreakingCD = 0)
 {
     return GetImpedancePerc(bossOpts, role, 0, moveBreakingMOD, moveBreakingCD) +
            GetImpedancePerc(bossOpts, role, 1, fearBreakingMOD, fearBreakingCD) +
            GetImpedancePerc(bossOpts, role, 2, stunBreakingMOD, stunBreakingCD) +
            GetImpedancePerc(bossOpts, role, 3, rootBreakingMOD, rootBreakingCD) +
            GetImpedancePerc(bossOpts, role, 4, silenceBreakingMOD, silenceBreakingCD);
 }
Example #3
0
 /// <summary>
 /// Generates the time lost to this Impedance type.
 /// </summary>
 /// <param name="bossOpts">Pass character.BossOptions</param>
 /// <param name="role">The role of the character</param>
 /// <param name="type">The Type to check:<para>0: Moves</para><para>1: Fears</para><para>2: Stuns</para><para>3: Roots</para><para>4: Silence</para></param>
 /// <param name="breakingMOD">% reduction of duration</param>
 /// <param name="breakingCD">CD of the breaking ability</param>
 /// <returns>Returns the Percentage of time lost to this Impedance type.
 /// <para>This is limited to 0%-100% to prevent wierd calc issues</para></returns>
 public static float GetImpedancePerc(BossOptions bossOpts, PLAYER_ROLES role, int type, float breakingMOD, float breakingCD=0)
 {
     List<Impedance> imps;
     // Which Imps are we looking for?
     if      (type == 0 && bossOpts.MovingTargs  ) { imps = bossOpts.Moves; }
     else if (type == 1 && bossOpts.FearingTargs ) { imps = bossOpts.Fears; }
     else if (type == 2 && bossOpts.StunningTargs) { imps = bossOpts.Stuns; }
     else if (type == 3 && bossOpts.RootingTargs ) { imps = bossOpts.Roots; }
     else if (type == 4 && bossOpts.SilencingTargs) { imps = bossOpts.Silences; }
     else return 0f;
     // Are there any of this type?
     if (imps.Count <= 0) return 0f;
     // Process them individually and add to the total time lost
     float timeIn = 0;
     foreach (Impedance i in imps) {
         if (i.AffectsRole[role])
         {
             float acts = i.Chance * i.FightUptimePercent * bossOpts.BerserkTimer / i.Frequency;
             float breakedActs = acts * (i.Breakable && breakingCD > 0 ? Math.Min(i.Frequency / breakingCD, 1f) : 0f);
             acts -= breakedActs;
             timeIn += acts * i.Duration / 1000f * (i.Breakable ? (1f - breakingMOD) : 1f); // full duration
             timeIn += breakedActs * 3f; // breaked ones: 1.5 to react, 1.5 GCD 
         }
     }
     // Convert this to a Percentage
     return Math.Max(0f, Math.Min(1f, timeIn / bossOpts.BerserkTimer));
 }