private static void AppendMoveSummary(ComboBox comboBoxEnemySelection, CheckBox checkBoxCastTimes, CheckBox checkBoxEnumerate, CheckBox checkBoxRatesAsFractions, CheckBox checkBoxTranslate, AbilitySummaryHelper abilitySummaryHelper, BasicEnemyInfo enemy, BasicEnemyParentInfo myEnemyParent, StringBuilder summary) { var str6 = abilitySummaryHelper.GetAbilitySummary(enemy, myEnemyParent, FFRKProxy.Instance.GameState.ActiveBattle, comboBoxEnemySelection, checkBoxCastTimes, checkBoxEnumerate, checkBoxRatesAsFractions, checkBoxTranslate) .Replace("\n", "\n* ").Replace("not yet implemented", "**not yet implemented**") .Replace("not parsed", "**not parsed**").Replace(" 【", "【"); if (!str6.Equals("")) { summary.Append(string.Format("* {0}\n\n", str6)); } }
private static void AppendBossHealthGatesAndMoveSummary(ComboBox comboBoxEnemySelection, CheckBox checkBoxCastTimes, CheckBox checkBoxEnumerate, CheckBox checkBoxRatesAsFractions, CheckBox checkBoxTranslate, List <BasicEnemyParentInfo> basicEnemyParentInfoList, StringBuilder summary, bool hasVariableCastTimes, AbilitySummaryHelper abilitySummaryHelper) { for (var index1 = 0; index1 < basicEnemyParentInfoList.Count; ++index1) { var myEnemyParent = basicEnemyParentInfoList[index1]; var basicEnemyInfoList = new List <BasicEnemyInfo>(); foreach (var phase in myEnemyParent.Phases) { basicEnemyInfoList.Add(phase); } for (var index2 = 0; index2 < basicEnemyInfoList.Count; ++index2) { var enemy = basicEnemyInfoList[index2]; var enemyName = myEnemyParent.EnemyName; if (basicEnemyInfoList.Count == 2 || basicEnemyInfoList.Count == 3) { if (index2 == 0) { enemyName += " - Default"; } if (index2 == 1) { enemyName += " - Weak"; } if (index2 == 2) { enemyName += " - Very Weak"; } } else if (basicEnemyInfoList.Count >= 4) { enemyName += string.Format(" - Phase {0}", index2 + 1); } if (basicEnemyInfoList.Count >= 2) { var flag2 = false; var flag3 = false; var str2 = "hp_rate_to_phase_" + basicEnemyInfoList.Count; var str3 = "hp_rate_to_phase_" + (basicEnemyInfoList.Count + 1); if (basicEnemyInfoList.Count == 6) { str2 = "hp_rate_to_phase_5"; } foreach (var aiArg in myEnemyParent.AiArgs) { if (aiArg.Tag.Equals(str2) || basicEnemyInfoList.Count == 2 && aiArg.Tag.Equals("hp_rate_to_weak") || basicEnemyInfoList.Count == 3 && aiArg.Tag.Equals("hp_rate_to_very_weak")) { flag2 = true; } else if (aiArg.Tag.Equals(str3) || basicEnemyInfoList.Count == 1 && aiArg.Tag.Equals("hp_rate_to_weak") || basicEnemyInfoList.Count == 2 && aiArg.Tag.Equals("hp_rate_to_very_weak")) { flag3 = true; } } if (flag2 && !flag3) { DataAIArgs dataAiArgs1 = null; DataAIArgs dataAiArgs2 = null; var str4 = "hp_rate_to_phase_" + (index2 + 1); var str5 = "hp_rate_to_phase_" + (index2 + 2); var result1 = -1; var result2 = -1; foreach (var aiArg in myEnemyParent.AiArgs) { if (aiArg.Tag.Equals(str4) || index2 == 1 && aiArg.Tag.Equals("hp_rate_to_weak") || index2 == 2 && aiArg.Tag.Equals("hp_rate_to_very_weak")) { dataAiArgs1 = aiArg; } else if (aiArg.Tag.Equals(str5) || index2 == 0 && aiArg.Tag.Equals("hp_rate_to_weak") || index2 == 1 && aiArg.Tag.Equals("hp_rate_to_very_weak")) { dataAiArgs2 = aiArg; } } if (dataAiArgs1 != null && int.TryParse(dataAiArgs1.ArgValue, out result1)) { if (index2 == basicEnemyInfoList.Count - 1) { enemyName += string.Format(" ({0}% - 0% HP)", result1); } else if (index2 < basicEnemyInfoList.Count - 1 && dataAiArgs2 != null && int.TryParse(dataAiArgs2.ArgValue, out result2)) { enemyName += string.Format(" ({0}% - {1}% HP)", result1, result2 + 1); } else if (index2 < basicEnemyInfoList.Count - 1 && dataAiArgs2 == null) { enemyName += string.Format(" ({0}% - 0% HP)", dataAiArgs1.ArgValue); } } else if (index2 == 0 && dataAiArgs2 != null && int.TryParse(dataAiArgs2.ArgValue, out result2)) { enemyName += string.Format(" (100% - {0}% HP)", result2 + 1); } } } summary.Append(string.Format("**{0}:** \n\n", enemyName)); if (!hasVariableCastTimes && !enemy.EnemyCastTime.Equals("Variable")) { summary.Append(string.Format("(These abilities have a cast time of {0})\n\n", enemy.EnemyCastTime)); } AppendMoveSummary(comboBoxEnemySelection, checkBoxCastTimes, checkBoxEnumerate, checkBoxRatesAsFractions, checkBoxTranslate, abilitySummaryHelper, enemy, myEnemyParent, summary); } } }
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); }