string PHPSAsIntExportDataCallback(CombatantData data, string extraFormat)
 {
     if (double.TryParse(data.GetColumnByName("pHPS"), out double value) == false)
     {
         return("-");
     }
     return(value.ToString("#0"));
 }
Exemplo n.º 2
0
        private static String GetCustomColumnData(CombatantData combatant, String column)
        {
            String data = combatant.GetColumnByName(column);

            if (data != null)
            {
                return(data);
            }

            return("");
        }
Exemplo n.º 3
0
        private string GetPerf(EncType enc, CombatantData combatant, double encdpshps)
        {
            string job = combatant.GetColumnByName("Job");

            if (job == string.Empty)
            {
                return(string.Empty);
            }

            string perfdpshps = enc == EncType.DPS ? "dps" : "hps";

            EncounterData encounter = combatant.Parent;
            string        zonename  = encounter.ZoneName;
            string        bossname  = encounter.GetStrongestEnemy("YOU");

            PerfKey key  = CreateKey(zonename, bossname);
            dynamic perf = null;

            if (cache.TryGetValue(key, out perf))
            {
                double[] perfarry = (double[])perf[perfdpshps][job];

                if (encdpshps < perfarry[6])
                {
                    return("10-");
                }
                if (encdpshps < perfarry[5])
                {
                    return("10+");
                }
                if (encdpshps < perfarry[4])
                {
                    return("25+");
                }
                if (encdpshps < perfarry[3])
                {
                    return("50+");
                }
                if (encdpshps < perfarry[2])
                {
                    return("75+");
                }
                if (encdpshps < perfarry[1])
                {
                    return("95+");
                }
                if (encdpshps < perfarry[0])
                {
                    return("99+");
                }
                return("100");
            }
            return(string.Empty);
        }
Exemplo n.º 4
0
        private string GetHpsPerf(CombatantData combatant)
        {
            double absorbHPS = combatant.EncHPS;

            if (absorbHPS > 0)
            {
                int overhealpct = Int32.Parse(combatant.GetColumnByName("OverHealPct").Replace("%", string.Empty));

                double absorbHeald = combatant.Healed - Math.Round(Decimal.ToDouble(combatant.Healed * (overhealpct / 100)));
                absorbHPS = Math.Round(absorbHeald / combatant.Parent.Duration.TotalSeconds);
            }

            return(GetPerf(EncType.HPS, combatant, absorbHPS));
        }
Exemplo n.º 5
0
        void sendEncounterCombatantData(CombatantData cd, Int32 actorId)
        {
            // build send data
            List <Byte> sendData = new List <Byte>();

            sendData.Add(DATA_TYPE_COMBATANT);                             // declare data type
            prepareInt32(ref sendData, cd.EncStartTime.GetHashCode());     // encounter id
            prepareInt32(ref sendData, actorId);                           // actor id (ffxiv)
            prepareString(ref sendData, cd.Name);                          // combatant name
            prepareString(ref sendData, cd.GetColumnByName("Job"));        // combatant job (ffxiv)
            prepareInt32(ref sendData, (Int32)cd.Damage);                  // damage done
            prepareInt32(ref sendData, (Int32)cd.DamageTaken);             // damage taken
            prepareInt32(ref sendData, (Int32)cd.Healed);                  // damage healed
            prepareInt32(ref sendData, cd.Deaths);                         // number of deaths
            prepareInt32(ref sendData, cd.Hits);                           // number of attacks
            prepareInt32(ref sendData, cd.Heals);                          // number of heals performed
            prepareInt32(ref sendData, cd.Kills);                          // number of kills
            // send
            sendUdp(ref sendData);
        }
        public double GetPercentile(CombatantData combatant)
        {
            var job = combatant.GetColumnByName("Job").ToUpper();

            if (combatant.Parent == null)
            {
                return(-1);
            }
            if (string.IsNullOrEmpty(job))
            {
                return(-1);
            }

            var boss = GetBoss(combatant.Parent).ToLower();

            if (!string.IsNullOrEmpty(boss))
            {
                return(GetRealPercentile(job, boss, combatant.EncDPS));
            }

            return(-1);
        }
 int PHPSSortComparer(CombatantData left, CombatantData right)
 {
     return(left.GetColumnByName("pHPS").CompareAsDoubleTo(right.GetColumnByName("pHPS")));
 }
 string HPerfExportDataCallback(CombatantData data, string extraFormat)
 {
     return(data.GetColumnByName("hPerf"));
 }
 int HPerfSortComparer(CombatantData left, CombatantData right)
 {
     return(left.GetColumnByName("hPerf").CompareAsIntTo(right.GetColumnByName("hPerf")));
 }
 string ADPSPortionsExportDataCallback(CombatantData data, string extraFormat)
 {
     return(data.GetColumnByName("aDPSPortions"));
 }
 int ADPSPortionsSortComparer(CombatantData left, CombatantData right)
 {
     return(left.GetColumnByName("aDPSPortions").CompareAsDoubleTo(right.GetColumnByName("aDPSPortions")));
 }
 string MedicatedCountExportDataCallback(CombatantData data, string extraFormat)
 {
     return(data.GetColumnByName("MedicatedCount"));
 }
 int MedicatedCountSortComparer(CombatantData left, CombatantData right)
 {
     return(left.GetColumnByName("MedicatedCount").CompareAsIntTo(right.GetColumnByName("MedicatedCount")));
 }
 public static Job GetJob(this CombatantData data)
 {
     return(new Job(data.GetColumnByName("Job")));
 }
 public static bool IsAlly(this CombatantData data)
 {
     return(bool.Parse(data.GetColumnByName("Ally")));
 }