Exemplo n.º 1
0
        private static void AddEnemyStats(List <BasicEnemyParentInfo> basicEnemyParentInfoList, StringBuilder summary, bool flag1,
                                          StatusVulnerabilityGetter statusVulnerabilityGetter)
        {
            for (var index1 = 0; index1 < basicEnemyParentInfoList.Count; ++index1)
            {
                var basicEnemyParentInfo = basicEnemyParentInfoList[index1];
                var basicEnemyInfoList   = new List <BasicEnemyInfo>();
                foreach (var phase in basicEnemyParentInfo.Phases)
                {
                    basicEnemyInfoList.Add(phase);
                }
                var flag2 = basicEnemyParentInfoList.Count > 1;
                var flag3 = basicEnemyInfoList.Count > 1;
                if (!flag2)
                {
                    summary.Append(string.Format("**{0}**\n\n", basicEnemyParentInfo.EnemyName));
                }
                else if (index1 == 0)
                {
                    summary.Append("**Stats:**\n\n");
                }
                if (index1 == 0)
                {
                    if (flag2)
                    {
                        summary.Append("Enemy | ");
                    }
                    else if (flag3)
                    {
                        summary.Append("Phase | ");
                    }
                    summary.Append("LV | HP | ATK | DEF | MAG | RES | MND | SPD |");
                    if (!flag1)
                    {
                        summary.Append(" Status Vuln. |");
                    }
                    summary.Append("\n");
                    if (flag2 | flag3)
                    {
                        summary.Append(":--|");
                    }
                    summary.Append(":--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|");
                    if (!flag1)
                    {
                        summary.Append(":--|");
                    }
                    summary.Append("\n");
                }
                else
                {
                    summary.Append("| \n");
                }

                for (var index2 = 0; index2 < basicEnemyInfoList.Count; ++index2)
                {
                    var basicEnemyInfo = basicEnemyInfoList[index2];
                    if (flag2)
                    {
                        summary.Append(basicEnemyParentInfo.EnemyName);
                        if (flag3)
                        {
                            summary.Append(" - ");
                        }
                        else
                        {
                            summary.Append(" |");
                        }
                    }

                    if (flag3)
                    {
                        if (basicEnemyInfoList.Count <= 3)
                        {
                            if (index2 == 0)
                            {
                                summary.Append("Default |");
                            }
                            if (index2 == 1)
                            {
                                summary.Append("Weak |");
                            }
                            if (index2 == 2)
                            {
                                summary.Append("Very Weak |");
                            }
                        }
                        else
                        {
                            summary.Append(string.Format("Phase {0} |", index2 + 1));
                        }
                    }

                    if (index2 == 0)
                    {
                        summary.Append(
                            string.Format(" {0} | {1} | {2} | {3} | ", basicEnemyInfo.EnemyLv,
                                          basicEnemyInfo.EnemyMaxHp.ToString("N0"), basicEnemyInfo.EnemyAtk.ToString("N0"),
                                          basicEnemyInfo.EnemyDef.ToString("N0")) + string.Format("{0} | {1} | {2} | {3} |",
                                                                                                  basicEnemyInfo.EnemyMag.ToString("N0"), basicEnemyInfo.EnemyRes.ToString("N0"),
                                                                                                  basicEnemyInfo.EnemyMnd.ToString("N0"), basicEnemyInfo.EnemySpd.ToString("N0")));
                        if (!flag1)
                        {
                            summary.Append(string.Format(" {0} |",
                                                         statusVulnerabilityGetter.GetStatusVulnerabilities(basicEnemyInfo.EnemyStatusImmunity)));
                        }
                        summary.Append("\n");
                    }
                    else
                    {
                        summary.Append(" | | ");
                        summary.Append(
                            (int)basicEnemyInfo.EnemyAtk == (int)basicEnemyInfoList[index2 - 1].EnemyAtk
                                ? string.Format("{0} | ", basicEnemyInfo.EnemyAtk.ToString("N0"))
                                : string.Format("**{0}** | ", basicEnemyInfo.EnemyAtk.ToString("N0")));
                        summary.Append(
                            (int)basicEnemyInfo.EnemyDef == (int)basicEnemyInfoList[index2 - 1].EnemyDef
                                ? string.Format("{0} | ", basicEnemyInfo.EnemyDef.ToString("N0"))
                                : string.Format("**{0}** | ", basicEnemyInfo.EnemyDef.ToString("N0")));
                        summary.Append(
                            (int)basicEnemyInfo.EnemyMag == (int)basicEnemyInfoList[index2 - 1].EnemyMag
                                ? string.Format("{0} | ", basicEnemyInfo.EnemyMag.ToString("N0"))
                                : string.Format("**{0}** | ", basicEnemyInfo.EnemyMag.ToString("N0")));
                        summary.Append(
                            (int)basicEnemyInfo.EnemyRes == (int)basicEnemyInfoList[index2 - 1].EnemyRes
                                ? string.Format("{0} | ", basicEnemyInfo.EnemyRes.ToString("N0"))
                                : string.Format("**{0}** | ", basicEnemyInfo.EnemyRes.ToString("N0")));
                        summary.Append(
                            (int)basicEnemyInfo.EnemyMnd == (int)basicEnemyInfoList[index2 - 1].EnemyMnd
                                ? string.Format("{0} | ", basicEnemyInfo.EnemyMnd.ToString("N0"))
                                : string.Format("**{0}** | ", basicEnemyInfo.EnemyMnd.ToString("N0")));
                        summary.Append(
                            (int)basicEnemyInfo.EnemySpd == (int)basicEnemyInfoList[index2 - 1].EnemySpd
                                ? string.Format("{0} |", basicEnemyInfo.EnemySpd.ToString("N0"))
                                : string.Format("**{0}** |", basicEnemyInfo.EnemySpd.ToString("N0")));
                        if (!flag1)
                        {
                            summary.Append(string.Format(" {0} |",
                                                         statusVulnerabilityGetter.GetStatusVulnerabilities(basicEnemyInfo.EnemyStatusImmunity)));
                        }
                        summary.Append("\n");
                    }
                }
            }
        }
Exemplo n.º 2
0
        public StringBuilder GetSummaryInformation(ComboBox comboBoxEnemySelection, CheckBox checkBoxCastTimes, CheckBox checkBoxEnumerate, CheckBox checkBoxRatesAsFractions, CheckBox checkBoxTranslate)
        {
            var itemNameGetter            = new ItemNameGetter();
            var statusVulnerabilityGetter = new StatusVulnerabilityGetter();
            var abilitySummaryHelper      = new AbilitySummaryHelper();

            var summary = new StringBuilder();

            if (FFRKProxy.Instance.GameState.ActiveDungeon != null)
            {
                var        activeDungeon = FFRKProxy.Instance.GameState.ActiveDungeon;
                var        battleId      = (int)FFRKProxy.Instance.GameState.ActiveBattle.Battle.BattleId;
                DataBattle dataBattle    = null;
                foreach (var battle in activeDungeon.Battles)
                {
                    if (battle.Id == battleId)
                    {
                        dataBattle = battle;
                    }
                }

                summary.Append(string.Format("*****\n\n##{0}  \n\n", dataBattle.Name));

                var medalConditions = GetMedalConditions(activeDungeon, battleId);
                if (medalConditions.Length > 0)
                {
                    summary.Append("**Medal Conditions:** " + medalConditions + "\n\n");
                }

                var prizes = activeDungeon.UserDungeon.Prizes;

                var dungeonPrizes = GetDungeonPrizes(prizes, itemNameGetter);
                if (dungeonPrizes.Length > 0)
                {
                    summary.Append(string.Format("**Clear Reward{0}:**  \n\n{1}\n", dungeonPrizes.Length != 1 ? "s" : (object)"", dungeonPrizes));
                }


                var masteryRewards = GetMasteryRewards(prizes, itemNameGetter);
                if (masteryRewards.Length > 0)
                {
                    summary.Append(string.Format("**Mastery Reward{0}:**  \n\n{1}\n", masteryRewards.Length != 1 ? "s" : (object)"", masteryRewards));
                }

                var firstClearRewards = GetFirstClearRewards(prizes, itemNameGetter);
                if (firstClearRewards.Length > 0)
                {
                    summary.Append(string.Format("**First Clear Reward{0}:**  \n\n{1}\n", firstClearRewards.Length != 1 ? "s" : (object)"", firstClearRewards));
                }
            }

            var basicEnemyParentInfoList = new List <BasicEnemyParentInfo>();

            foreach (var obj in comboBoxEnemySelection.Items)
            {
                basicEnemyParentInfoList.Add((BasicEnemyParentInfo)obj);
            }

            var hasStatusVulnerabilities = true;
            var statusVulnerabilities    = statusVulnerabilityGetter.GetStatusVulnerabilities(basicEnemyParentInfoList[0].Phases.First().EnemyStatusImmunity);

            foreach (var basicEnemyParentInfo in basicEnemyParentInfoList)
            {
                foreach (var phase in basicEnemyParentInfo.Phases)
                {
                    if (!statusVulnerabilities.Equals(statusVulnerabilityGetter.GetStatusVulnerabilities(phase.EnemyStatusImmunity)))
                    {
                        hasStatusVulnerabilities = false;
                    }
                }
            }

            AddEnemyStats(basicEnemyParentInfoList, summary, hasStatusVulnerabilities, statusVulnerabilityGetter);

            AddElementalResitances(summary, basicEnemyParentInfoList);

            AddBreakEffectiveness(summary, basicEnemyParentInfoList);

            if (hasStatusVulnerabilities)
            {
                summary.Append(string.Format("**Status Vulnerabilities{0}**: {1}  \n", basicEnemyParentInfoList.Count == 1 ? "" : (object)" (all)", statusVulnerabilities));
            }

            if (basicEnemyParentInfoList.Count == 1 && basicEnemyParentInfoList[0].Phases.Count() == 1)
            {
                summary.Append("\n##Moveset\n\n");
            }
            else
            {
                summary.Append("\n##Movesets\n\n");
            }

            var hasVariableCastTimes = true;
            var enemyCastTime        = basicEnemyParentInfoList[0].Phases.First().EnemyCastTime;

            foreach (var basicEnemyParentInfo in basicEnemyParentInfoList)
            {
                foreach (var phase in basicEnemyParentInfo.Phases)
                {
                    if (phase.EnemyCastTime.Equals("Variable") || !phase.EnemyCastTime.Equals(enemyCastTime))
                    {
                        hasVariableCastTimes = false;
                    }
                }
            }

            if (hasVariableCastTimes)
            {
                var str2 = enemyCastTime.Replace("sec", "seconds");
                if (str2.Equals("1 seconds"))
                {
                    str2 = "1 second";
                }
                summary.Append(string.Format(
                                   "All (non-interrupt) enemy abilities in this fight have a cast time of {0}.\n\n", str2));
            }

            AppendBossHealthGatesAndMoveSummary(comboBoxEnemySelection, checkBoxCastTimes, checkBoxEnumerate, checkBoxRatesAsFractions, checkBoxTranslate, basicEnemyParentInfoList, summary, hasVariableCastTimes, abilitySummaryHelper);

            AppendDataAiArgs(summary, basicEnemyParentInfoList);
            return(summary);
        }