Пример #1
0
            public DataPrecisionDetails(Old_RaidBossFight _BossFight, RealmDB _RealmDB)
            {
                m_FightPrecision       = (float)_BossFight.CalculatePrecision(_RealmDB.RD_IsPlayerFunc(_BossFight));
                m_HasResetsMidFight    = _BossFight.GetFightData().HasResetsMidFight();
                m_ContainCorruptSWSync = _BossFight.GetUnrealisticPlayerSpikes(_RealmDB.RD_GetPlayerIdentifierFunc(_BossFight)).Count != 0;
                m_AddonVersion         = _BossFight.GetFightData().AddonVersion;
                m_RecordedBy           = _BossFight.GetFightData().RecordedByPlayer;

                var timeSlices = _BossFight.GetFightData().TimeSlices;

                float bossPart1Percentage = 0.0f;
                float bossPart2Percentage = 0.0f;

                string startY = "Start_Y";

                if (_BossFight.GetBossName() == "Razorgore the Untamed" && (_BossFight.GetStartDateTime() < new DateTime(2014, 3, 12) || m_AddonVersion == "1.8.2" || m_AddonVersion == "1.8.1" || m_AddonVersion == "1.7"))
                {
                    startY = "Start_Y=Grethok the Controller";
                }
                for (int i = 0; i < timeSlices.Count; ++i)
                {
                    if (m_StartSpecifier != SpecifierType.YellSpecifier && timeSlices[i].IsStartEvent())
                    {
                        if (timeSlices[i].IsEvent(startY) == true)
                        {
                            m_StartSpecifier = SpecifierType.YellSpecifier;
                        }
                        else
                        {
                            m_StartSpecifier = SpecifierType.HealthSpecifier;
                        }
                    }
                    if (m_HealthPercentageFirstSeen < 0.99f && timeSlices[i].IsBossHealthEvent())
                    {
                        if (_BossFight.GetBossName() == "C'Thun")
                        {
                            float eyeofcthunMax = timeSlices[i].GetTotalBossPercentage("Eye of C'Thun", true) * 0.5f;
                            if (eyeofcthunMax > bossPart1Percentage)
                            {
                                bossPart1Percentage = eyeofcthunMax;
                            }
                            float cthunMax = timeSlices[i].GetTotalBossPercentage("C'Thun", true) * 0.5f;
                            if (cthunMax > bossPart2Percentage)
                            {
                                bossPart2Percentage = cthunMax;
                            }
                            if (bossPart1Percentage + bossPart2Percentage > m_HealthPercentageFirstSeen)
                            {
                                m_HealthPercentageFirstSeen = bossPart1Percentage + bossPart2Percentage;
                            }
                        }
                        else
                        {
                            var healthPercentage = timeSlices[i].GetTotalBossPercentage(_BossFight.GetBossName());
                            if (healthPercentage > m_HealthPercentageFirstSeen)
                            {
                                m_HealthPercentageFirstSeen = healthPercentage;
                            }
                        }
                    }
                    if (m_EndSpecifier != SpecifierType.YellSpecifier && timeSlices[i].IsDeadEvent())
                    {
                        if (timeSlices[i].IsEvent("Dead_Y") == true)
                        {
                            m_EndSpecifier = SpecifierType.YellSpecifier;
                            break;
                        }
                        else
                        {
                            m_EndSpecifier = SpecifierType.HealthSpecifier;
                        }
                    }
                }
            }