// TODO: Find a better way to implement the descriptions public string FixedDescription(ChampionStatic champion, int intSpell) { string sourceString = champion.Spells[intSpell].Tooltip.Replace("</span>", "").Replace("<br>", Environment.NewLine); sourceString = Regex.Replace(sourceString, "<span class.*?>", ""); if (champion.Spells[intSpell].Vars != null) { foreach (SpellVarsStatic value in champion.Spells[intSpell].Vars) { string key = value.Key; string matchpattern = "{{ " + key + " }}"; string replacementpattern = value.GetCoeffString(); if (value.Link == "attackdamage" || value.Link == "bonusattackdamage") { replacementpattern += " AD"; } else if (value.Link == "spelldamage") { replacementpattern += " AP"; } sourceString = Regex.Replace(sourceString, matchpattern, replacementpattern); } } int count = champion.Spells[intSpell].EffectBurns == null ? 0 : champion.Spells[intSpell].EffectBurns.Count; for (int i = 1; i < count; i++) { string matchpatten = "{{ e" + i + " }}"; sourceString = Regex.Replace(sourceString, matchpatten, champion.Spells[intSpell].EffectBurns[i]); } // Special Cases for Jayce and Elise if (champion.Spells.Count > 4 && (intSpell + 4) < champion.Spells.Count) { sourceString += Environment.NewLine + Environment.NewLine + champion.Spells[intSpell + 4].Tooltip.Replace("</span>", "").Replace("<br>", Environment.NewLine); sourceString = Regex.Replace(sourceString, "<span class.*?>", ""); if (champion.Spells[intSpell + 4].Vars != null) { foreach (SpellVarsStatic value in champion.Spells[intSpell + 4].Vars) { string key = value.Key; string matchpattern = "{{ " + key + " }}"; string replacementpattern = value.GetCoeffString(); if (value.Link == "attackdamage" || value.Link == "bonusattackdamage") { replacementpattern += " AD"; } else if (value.Link == "spelldamage") { replacementpattern += " AP"; } sourceString = Regex.Replace(sourceString, matchpattern, replacementpattern); } } for (int i = 1; i < champion.Spells[intSpell + 4].EffectBurns.Count; i++) { string matchpatten = "{{ e" + i + " }}"; sourceString = Regex.Replace(sourceString, matchpatten, champion.Spells[intSpell + 4].EffectBurns[i]); } } sourceString = Regex.Replace(sourceString, "{{.*?}}", ""); // removes any crap left behind return sourceString; }
public ChampionStaticWrapper(ChampionStatic champion, Language language, ChampionData championData) { ChampionStatic = champion; Language = language; ChampionData = championData; }