MediaWiki:Common.js: Difference between revisions

From Wizardia Community Wiki

Content added Content deleted
No edit summary
Tag: Manual revert
mNo edit summary
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */


console.log("message55");

if (document.body.classList.contains("page-Battle_analyzer")) {
changeBAnames();
addAttributesToWizardDropdowns();
displayCalculator(1);
showTableLegend();
if (document.getElementById("wizard-1-health")) {
teamDamage();
addKillRoundCounter();
}
}
function changeBAnames() {
document.getElementById("firstHeading").innerHTML = "<span dir='autoa' class='noselect'>Battle analyzer</span>";
if (document.querySelector(".pf-runquery-formcontent > h2")) {
document.querySelector(".pf-runquery-formcontent > h2").innerHTML = "<span class='noselect'>Edit teams</span>";
}
}
function addAttributesToWizardDropdowns() {
var inputId1 = document.getElementById("input_1");
var inputId1rarity = document.getElementById("input_2");
var inputId2 = document.getElementById("input_3");
var inputId2rarity = document.getElementById("input_4");
var inputId3 = document.getElementById("input_5");
var inputId3rarity = document.getElementById("input_6");
var inputId4 = document.getElementById("input_7");
var inputId4rarity = document.getElementById("input_8");
var inputId5 = document.getElementById("input_9");
var inputId5rarity = document.getElementById("input_10");
var inputId6 = document.getElementById("input_11");
var inputId6rarity = document.getElementById("input_12");
var inputShowOppTbl = document.getElementById("input_13");

// replace underscore with empty space for Wizard names in Dropdowns
const nodeList = document.querySelectorAll("#input_1 > option, #input_3 > option, #input_5 > option, #input_7 > option, #input_9 > option, #input_11 > option");
for (var i = 0; i < nodeList.length; i++) {
nodeList[i].innerHTML = nodeList[i].innerHTML.replaceAll('_',' ');
};

inputId1.setAttribute("required","");
inputId1.classList.add(inputId1rarity.value);
inputId1rarity.setAttribute("onchange","changeRarityClassDropdowns('input_1','input_2');");
inputId1rarity.classList.add(inputId1rarity.value);
inputId2.setAttribute("required","");
inputId2.classList.add(inputId2rarity.value);
inputId2rarity.setAttribute("onchange","changeRarityClassDropdowns('input_3','input_4');");
inputId2rarity.classList.add(inputId2rarity.value);
inputId3.setAttribute("required","");
inputId3.classList.add(inputId3rarity.value);
inputId3rarity.setAttribute("onchange","changeRarityClassDropdowns('input_5','input_6');");
inputId3rarity.classList.add(inputId3rarity.value);
inputId4.setAttribute("required","");
inputId4.classList.add(inputId4rarity.value);
inputId4rarity.setAttribute("onchange","changeRarityClassDropdowns('input_7','input_8');");
inputId4rarity.classList.add(inputId4rarity.value);
inputId5.setAttribute("required","");
inputId5.classList.add(inputId5rarity.value);
inputId5rarity.setAttribute("onchange","changeRarityClassDropdowns('input_9','input_10');");
inputId5rarity.classList.add(inputId5rarity.value);
inputId6.setAttribute("required","");
inputId6.classList.add(inputId6rarity.value);
inputId6rarity.setAttribute("onchange","changeRarityClassDropdowns('input_11','input_12');");
inputId6rarity.classList.add(inputId6rarity.value);
inputShowOppTbl.classList.add("Rare");
}
function changeRarityClassDropdowns(wizardInputId,wizardRarityId) {
var wizardInput = document.getElementById(wizardInputId);
var wizardRarity = document.getElementById(wizardRarityId);

wizardInput.classList.remove("Rare");
wizardInput.classList.remove("Epic");
wizardInput.classList.remove("Legendary");
wizardRarity.classList.remove("Rare");
wizardRarity.classList.remove("Epic");
wizardRarity.classList.remove("Legendary");
wizardInput.classList.add(wizardRarity.value);
wizardRarity.classList.add(wizardRarity.value);
}
function teamDamage() {
var wizard1line1 = document.getElementById("wizard-1-line-1");
var wizard1line1spell1 = document.getElementById("wizard-1-line-1-spell-1");
var wizard1line1spell2 = document.getElementById("wizard-1-line-1-spell-2");
var wizard1line2 = document.getElementById("wizard-1-line-2");
var wizard1line2spell1 = document.getElementById("wizard-1-line-2-spell-1");
var wizard1line2spell2 = document.getElementById("wizard-1-line-2-spell-2");
var wizard1line3 = document.getElementById("wizard-1-line-3");
var wizard1line3spell1 = document.getElementById("wizard-1-line-3-spell-1");
var wizard1line3spell2 = document.getElementById("wizard-1-line-3-spell-2");
var wizard2line1 = document.getElementById("wizard-2-line-1");
var wizard2line1spell1 = document.getElementById("wizard-2-line-1-spell-1");
var wizard2line1spell2 = document.getElementById("wizard-2-line-1-spell-2");
var wizard2line2 = document.getElementById("wizard-2-line-2");
var wizard2line2spell1 = document.getElementById("wizard-2-line-2-spell-1");
var wizard2line2spell2 = document.getElementById("wizard-2-line-2-spell-2");
var wizard2line3 = document.getElementById("wizard-2-line-3");
var wizard2line3spell1 = document.getElementById("wizard-2-line-3-spell-1");
var wizard2line3spell2 = document.getElementById("wizard-2-line-3-spell-2");
var wizard3line1 = document.getElementById("wizard-3-line-1");
var wizard3line1spell1 = document.getElementById("wizard-3-line-1-spell-1");
var wizard3line1spell2 = document.getElementById("wizard-3-line-1-spell-2");
var wizard3line2 = document.getElementById("wizard-3-line-2");
var wizard3line2spell1 = document.getElementById("wizard-3-line-2-spell-1");
var wizard3line2spell2 = document.getElementById("wizard-3-line-2-spell-2");
var wizard3line3 = document.getElementById("wizard-3-line-3");
var wizard3line3spell1 = document.getElementById("wizard-3-line-3-spell-1");
var wizard3line3spell2 = document.getElementById("wizard-3-line-3-spell-2");
var wizard4line1 = document.getElementById("wizard-4-line-1");
var wizard4line1spell1 = document.getElementById("wizard-4-line-1-spell-1");
var wizard4line1spell2 = document.getElementById("wizard-4-line-1-spell-2");
var wizard4line2 = document.getElementById("wizard-4-line-2");
var wizard4line2spell1 = document.getElementById("wizard-4-line-2-spell-1");
var wizard4line2spell2 = document.getElementById("wizard-4-line-2-spell-2");
var wizard4line3 = document.getElementById("wizard-4-line-3");
var wizard4line3spell1 = document.getElementById("wizard-4-line-3-spell-1");
var wizard4line3spell2 = document.getElementById("wizard-4-line-3-spell-2");
var wizard5line1 = document.getElementById("wizard-5-line-1");
var wizard5line1spell1 = document.getElementById("wizard-5-line-1-spell-1");
var wizard5line1spell2 = document.getElementById("wizard-5-line-1-spell-2");
var wizard5line2 = document.getElementById("wizard-5-line-2");
var wizard5line2spell1 = document.getElementById("wizard-5-line-2-spell-1");
var wizard5line2spell2 = document.getElementById("wizard-5-line-2-spell-2");
var wizard5line3 = document.getElementById("wizard-5-line-3");
var wizard5line3spell1 = document.getElementById("wizard-5-line-3-spell-1");
var wizard5line3spell2 = document.getElementById("wizard-5-line-3-spell-2");
var wizard6line1 = document.getElementById("wizard-6-line-1");
var wizard6line1spell1 = document.getElementById("wizard-6-line-1-spell-1");
var wizard6line1spell2 = document.getElementById("wizard-6-line-1-spell-2");
var wizard6line2 = document.getElementById("wizard-6-line-2");
var wizard6line2spell1 = document.getElementById("wizard-6-line-2-spell-1");
var wizard6line2spell2 = document.getElementById("wizard-6-line-2-spell-2");
var wizard6line3 = document.getElementById("wizard-6-line-3");
var wizard6line3spell1 = document.getElementById("wizard-6-line-3-spell-1");
var wizard6line3spell2 = document.getElementById("wizard-6-line-3-spell-2");

var wizard1name = document.getElementById("wizard-1-name").innerHTML;
var wizard1rarity = document.getElementById("wizard-1-name").className;
var wizard1affinity = document.getElementById("wizard-1-affinity").innerHTML;
var wizard1spell1name = document.getElementById("wizard-1-spell-1-name").innerHTML.replace(/'/g, '\&apos;');
var wizard1spell1type = document.getElementById("wizard-1-spell-1-type").innerHTML;
var wizard1spell1targets = document.getElementById("wizard-1-spell-1-targets").innerHTML;
var wizard1spell1cost = document.getElementById("wizard-1-spell-1-cost").innerHTML;
var wizard1spell1value = document.getElementById("wizard-1-spell-1-value").innerHTML;
var wizard1spell2name = document.getElementById("wizard-1-spell-2-name").innerHTML.replace(/'/g, '\&apos;');
var wizard1spell2type = document.getElementById("wizard-1-spell-2-type").innerHTML;
var wizard1spell2targets = document.getElementById("wizard-1-spell-2-targets").innerHTML;
var wizard1spell2cost = document.getElementById("wizard-1-spell-2-cost").innerHTML;
var wizard1spell2value = document.getElementById("wizard-1-spell-2-value").innerHTML;

var wizard2name = document.getElementById("wizard-2-name").innerHTML;
var wizard2rarity = document.getElementById("wizard-2-name").className;
var wizard2affinity = document.getElementById("wizard-2-affinity").innerHTML;
var wizard2spell1name = document.getElementById("wizard-2-spell-1-name").innerHTML.replace(/'/g, '\&apos;');
var wizard2spell1type = document.getElementById("wizard-2-spell-1-type").innerHTML;
var wizard2spell1targets = document.getElementById("wizard-2-spell-1-targets").innerHTML;
var wizard2spell1cost = document.getElementById("wizard-2-spell-1-cost").innerHTML;
var wizard2spell1value = document.getElementById("wizard-2-spell-1-value").innerHTML;
var wizard2spell2name = document.getElementById("wizard-2-spell-2-name").innerHTML.replace(/'/g, '\&apos;');
var wizard2spell2type = document.getElementById("wizard-2-spell-2-type").innerHTML;
var wizard2spell2targets = document.getElementById("wizard-2-spell-2-targets").innerHTML;
var wizard2spell2cost = document.getElementById("wizard-2-spell-2-cost").innerHTML;
var wizard2spell2value = document.getElementById("wizard-2-spell-2-value").innerHTML;

var wizard3name = document.getElementById("wizard-3-name").innerHTML;
var wizard3rarity = document.getElementById("wizard-3-name").className;
var wizard3affinity = document.getElementById("wizard-3-affinity").innerHTML;
var wizard3spell1name = document.getElementById("wizard-3-spell-1-name").innerHTML.replace(/'/g, '\&apos;');
var wizard3spell1type = document.getElementById("wizard-3-spell-1-type").innerHTML;
var wizard3spell1targets = document.getElementById("wizard-3-spell-1-targets").innerHTML;
var wizard3spell1cost = document.getElementById("wizard-3-spell-1-cost").innerHTML;
var wizard3spell1value = document.getElementById("wizard-3-spell-1-value").innerHTML;
var wizard3spell2name = document.getElementById("wizard-3-spell-2-name").innerHTML.replace(/'/g, '\&apos;');
var wizard3spell2type = document.getElementById("wizard-3-spell-2-type").innerHTML;
var wizard3spell2targets = document.getElementById("wizard-3-spell-2-targets").innerHTML;
var wizard3spell2cost = document.getElementById("wizard-3-spell-2-cost").innerHTML;
var wizard3spell2value = document.getElementById("wizard-3-spell-2-value").innerHTML;

var wizard4name = document.getElementById("wizard-4-name").innerHTML;
var wizard4rarity = document.getElementById("wizard-4-name").className;
var wizard4affinity = document.getElementById("wizard-4-affinity").innerHTML;
var wizard4spell1name = document.getElementById("wizard-4-spell-1-name").innerHTML.replace(/'/g, '\&apos;');
var wizard4spell1type = document.getElementById("wizard-4-spell-1-type").innerHTML;
var wizard4spell1targets = document.getElementById("wizard-4-spell-1-targets").innerHTML;
var wizard4spell1cost = document.getElementById("wizard-4-spell-1-cost").innerHTML;
var wizard4spell1value = document.getElementById("wizard-4-spell-1-value").innerHTML;
var wizard4spell2name = document.getElementById("wizard-4-spell-2-name").innerHTML.replace(/'/g, '\&apos;');
var wizard4spell2type = document.getElementById("wizard-4-spell-2-type").innerHTML;
var wizard4spell2targets = document.getElementById("wizard-4-spell-2-targets").innerHTML;
var wizard4spell2cost = document.getElementById("wizard-4-spell-2-cost").innerHTML;
var wizard4spell2value = document.getElementById("wizard-4-spell-2-value").innerHTML;

var wizard5name = document.getElementById("wizard-5-name").innerHTML;
var wizard5rarity = document.getElementById("wizard-5-name").className;
var wizard5affinity = document.getElementById("wizard-5-affinity").innerHTML;
var wizard5spell1name = document.getElementById("wizard-5-spell-1-name").innerHTML.replace(/'/g, '\&apos;');
var wizard5spell1type = document.getElementById("wizard-5-spell-1-type").innerHTML;
var wizard5spell1targets = document.getElementById("wizard-5-spell-1-targets").innerHTML;
var wizard5spell1cost = document.getElementById("wizard-5-spell-1-cost").innerHTML;
var wizard5spell1value = document.getElementById("wizard-5-spell-1-value").innerHTML;
var wizard5spell2name = document.getElementById("wizard-5-spell-2-name").innerHTML.replace(/'/g, '\&apos;');
var wizard5spell2type = document.getElementById("wizard-5-spell-2-type").innerHTML;
var wizard5spell2targets = document.getElementById("wizard-5-spell-2-targets").innerHTML;
var wizard5spell2cost = document.getElementById("wizard-5-spell-2-cost").innerHTML;
var wizard5spell2value = document.getElementById("wizard-5-spell-2-value").innerHTML;

var wizard6name = document.getElementById("wizard-6-name").innerHTML;
var wizard6rarity = document.getElementById("wizard-6-name").className;
var wizard6affinity = document.getElementById("wizard-6-affinity").innerHTML;
var wizard6spell1name = document.getElementById("wizard-6-spell-1-name").innerHTML.replace(/'/g, '\&apos;');
var wizard6spell1type = document.getElementById("wizard-6-spell-1-type").innerHTML;
var wizard6spell1targets = document.getElementById("wizard-6-spell-1-targets").innerHTML;
var wizard6spell1cost = document.getElementById("wizard-6-spell-1-cost").innerHTML;
var wizard6spell1value = document.getElementById("wizard-6-spell-1-value").innerHTML;
var wizard6spell2name = document.getElementById("wizard-6-spell-2-name").innerHTML.replace(/'/g, '\&apos;');
var wizard6spell2type = document.getElementById("wizard-6-spell-2-type").innerHTML;
var wizard6spell2targets = document.getElementById("wizard-6-spell-2-targets").innerHTML;
var wizard6spell2cost = document.getElementById("wizard-6-spell-2-cost").innerHTML;
var wizard6spell2value = document.getElementById("wizard-6-spell-2-value").innerHTML;

var wizard1image = document.getElementById("wizard-1-image");
var wizard2image = document.getElementById("wizard-2-image");
var wizard3image = document.getElementById("wizard-3-image");
var wizard4image = document.getElementById("wizard-4-image");
var wizard5image = document.getElementById("wizard-5-image");
var wizard6image = document.getElementById("wizard-6-image");
wizard1image.innerHTML = wizardImage(wizard1name,wizard1rarity,'','100%','Your');
wizard2image.innerHTML = wizardImage(wizard2name,wizard2rarity,'','100%','Your');
wizard3image.innerHTML = wizardImage(wizard3name,wizard3rarity,'','100%','Your');
wizard4image.innerHTML = wizardImage(wizard4name,wizard4rarity,'','100%','Your');
wizard5image.innerHTML = wizardImage(wizard5name,wizard5rarity,'','100%','Your');
wizard6image.innerHTML = wizardImage(wizard6name,wizard6rarity,'','100%','Your');

var wizard1health = document.getElementById("wizard-1-health").innerHTML;
var wizard2health = document.getElementById("wizard-2-health").innerHTML;
var wizard3health = document.getElementById("wizard-3-health").innerHTML;
var wizard4health = document.getElementById("wizard-4-health").innerHTML;
var wizard5health = document.getElementById("wizard-5-health").innerHTML;
var wizard6health = document.getElementById("wizard-6-health").innerHTML;

var healthIconImage = "<img alt='Health' src='//static.miraheze.org/wizardiawiki/1/1f/Health.svg' decoding='async' width='16' height='16' style='vertical-align: text-top;'> ";
var wizard1healthIcon = document.getElementById("wizard-1-healthIcon");
var wizard2healthIcon = document.getElementById("wizard-2-healthIcon");
var wizard3healthIcon = document.getElementById("wizard-3-healthIcon");
var wizard4healthIcon = document.getElementById("wizard-4-healthIcon");
var wizard5healthIcon = document.getElementById("wizard-5-healthIcon");
var wizard6healthIcon = document.getElementById("wizard-6-healthIcon");
wizard1healthIcon.innerHTML = healthIconImage;
wizard2healthIcon.innerHTML = healthIconImage;
wizard3healthIcon.innerHTML = healthIconImage;
wizard4healthIcon.innerHTML = healthIconImage;
wizard5healthIcon.innerHTML = healthIconImage;
wizard6healthIcon.innerHTML = healthIconImage;

var wizard1speciality = document.getElementById("wizard-1-speciality");
var wizard2speciality = document.getElementById("wizard-2-speciality");
var wizard3speciality = document.getElementById("wizard-3-speciality");
var wizard4speciality = document.getElementById("wizard-4-speciality");
var wizard5speciality = document.getElementById("wizard-5-speciality");
var wizard6speciality = document.getElementById("wizard-6-speciality");
wizard1speciality.innerHTML = whatSpeciality(wizard1spell1type,wizard1spell1targets,wizard1spell2type,wizard1spell2targets);
wizard2speciality.innerHTML = whatSpeciality(wizard2spell1type,wizard2spell1targets,wizard2spell2type,wizard2spell2targets);
wizard3speciality.innerHTML = whatSpeciality(wizard3spell1type,wizard3spell1targets,wizard3spell2type,wizard3spell2targets);
wizard4speciality.innerHTML = whatSpeciality(wizard4spell1type,wizard4spell1targets,wizard4spell2type,wizard4spell2targets);
wizard5speciality.innerHTML = whatSpeciality(wizard5spell1type,wizard5spell1targets,wizard5spell2type,wizard5spell2targets);
wizard6speciality.innerHTML = whatSpeciality(wizard6spell1type,wizard6spell1targets,wizard6spell2type,wizard6spell2targets);

var tooltipTargetsIcon = "<img alt=&quot;Targets&quot; src=&quot;//static.miraheze.org/wizardiawiki/b/ba/Targets.svg&quot; decoding=&quot;async&quot; width=&quot;12&quot; height=&quot;13&quot; style=&quot;vertical-align: text-top&quot;>";
var tooltipManaIcon = "<img alt=&quot;Mana&quot; src=&quot;//static.miraheze.org/wizardiawiki/f/f3/Mana.svg&quot; decoding=&quot;async&quot; width=&quot;14&quot; height=&quot;13&quot; style=&quot;vertical-align: text-top&quot;>";
var tooltipDamageIcon = "<img alt=&quot;Damage&quot; src=&quot;//static.miraheze.org/wizardiawiki/f/f3/Damage.svg&quot; decoding=&quot;async&quot; width=&quot;15&quot; height=&quot;13&quot; style=&quot;vertical-align: text-top&quot;>";

wizard1line1.innerHTML = wizardImage(wizard4name,wizard4rarity,'60px','','Opponent') + wizard4name + " <span class='baOppTblHealth'>(" + wizard4health + ")</span> <div class='baOppTblSpeciality'>" + wizard4speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell1name + "<br />" + tooltipTargetsIcon + " " + wizard4spell1targets + " " + tooltipManaIcon + " " + wizard4spell1cost + " " + tooltipDamageIcon + " " + wizard4spell1value + "</p>'>" + displayDamage(wizard4affinity,wizard1affinity,wizard4spell1type,wizard4spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell2name + "<br />" + tooltipTargetsIcon + " " + wizard4spell2targets + " " + tooltipManaIcon + " " + wizard4spell2cost + " " + tooltipDamageIcon + " " + wizard4spell2value + "</p>'>" + displayDamage(wizard4affinity,wizard1affinity,wizard4spell2type,wizard4spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
wizard1line1.classList.add(wizard4rarity);
wizard1line1spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell1name + "<br />" + tooltipTargetsIcon + " " + wizard1spell1targets + " " + tooltipManaIcon + " " + wizard1spell1cost + " " + tooltipDamageIcon + " " + wizard1spell1value + "</p>'>" + displayDamage(wizard1affinity,wizard4affinity,wizard1spell1type,wizard1spell1value) + "</div>";
wizard1line1spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell2name + "<br />" + tooltipTargetsIcon + " " + wizard1spell2targets + " " + tooltipManaIcon + " " + wizard1spell2cost + " " + tooltipDamageIcon + " " + wizard1spell2value + "</p>'>" + displayDamage(wizard1affinity,wizard4affinity,wizard1spell2type,wizard1spell2value) + "</div>";

wizard1line2.innerHTML = wizardImage(wizard5name,wizard5rarity,'60px','','Opponent') + wizard5name + " <span class='baOppTblHealth'>(" + wizard5health + ")</span> <div class='baOppTblSpeciality'>" + wizard5speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell1name + "<br />" + tooltipTargetsIcon + " " + wizard5spell1targets + " " + tooltipManaIcon + " " + wizard5spell1cost + " " + tooltipDamageIcon + " " + wizard5spell1value + "</p>'>" + displayDamage(wizard5affinity,wizard1affinity,wizard5spell1type,wizard5spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell2name + "<br />" + tooltipTargetsIcon + " " + wizard5spell2targets + " " + tooltipManaIcon + " " + wizard5spell2cost + " " + tooltipDamageIcon + " " + wizard5spell2value + "</p>'>" + displayDamage(wizard5affinity,wizard1affinity,wizard5spell2type,wizard5spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
wizard1line2.classList.add(wizard5rarity);
wizard1line2spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell1name + "<br />" + tooltipTargetsIcon + " " + wizard1spell1targets + " " + tooltipManaIcon + " " + wizard1spell1cost + " " + tooltipDamageIcon + " " + wizard1spell1value + "</p>'>" + displayDamage(wizard1affinity,wizard5affinity,wizard1spell1type,wizard1spell1value) + "</div>";
wizard1line2spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell2name + "<br />" + tooltipTargetsIcon + " " + wizard1spell2targets + " " + tooltipManaIcon + " " + wizard1spell2cost + " " + tooltipDamageIcon + " " + wizard1spell2value + "</p>'>" + displayDamage(wizard1affinity,wizard5affinity,wizard1spell2type,wizard1spell2value) + "</div>";

wizard1line3.innerHTML = wizardImage(wizard6name,wizard6rarity,'60px','','Opponent') + wizard6name + " <span class='baOppTblHealth'>(" + wizard6health + ")</span> <div class='baOppTblSpeciality'>" + wizard6speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell1name + "<br />" + tooltipTargetsIcon + " " + wizard6spell1targets + " " + tooltipManaIcon + " " + wizard6spell1cost + " " + tooltipDamageIcon + " " + wizard6spell1value + "</p>'>" + displayDamage(wizard6affinity,wizard1affinity,wizard6spell1type,wizard6spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell2name + "<br />" + tooltipTargetsIcon + " " + wizard6spell2targets + " " + tooltipManaIcon + " " + wizard6spell2cost + " " + tooltipDamageIcon + " " + wizard6spell2value + "</p>'>" + displayDamage(wizard6affinity,wizard1affinity,wizard6spell2type,wizard6spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
wizard1line3.classList.add(wizard6rarity);
wizard1line3spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell1name + "<br />" + tooltipTargetsIcon + " " + wizard1spell1targets + " " + tooltipManaIcon + " " + wizard1spell1cost + " " + tooltipDamageIcon + " " + wizard1spell1value + "</p>'>" + displayDamage(wizard1affinity,wizard6affinity,wizard1spell1type,wizard1spell1value) + "</div>";
wizard1line3spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell2name + "<br />" + tooltipTargetsIcon + " " + wizard1spell2targets + " " + tooltipManaIcon + " " + wizard1spell2cost + " " + tooltipDamageIcon + " " + wizard1spell2value + "</p>'>" + displayDamage(wizard1affinity,wizard6affinity,wizard1spell2type,wizard1spell2value) + "</div>";

wizard2line1.innerHTML = wizardImage(wizard4name,wizard4rarity,'60px','','Opponent') + wizard4name + " <span class='baOppTblHealth'>(" + wizard4health + ")</span> <div class='baOppTblSpeciality'>" + wizard4speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell1name + "<br />" + tooltipTargetsIcon + " " + wizard4spell1targets + " " + tooltipManaIcon + " " + wizard4spell1cost + " " + tooltipDamageIcon + " " + wizard4spell1value + "</p>'>" + displayDamage(wizard4affinity,wizard2affinity,wizard4spell1type,wizard4spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell2name + "<br />" + tooltipTargetsIcon + " " + wizard4spell2targets + " " + tooltipManaIcon + " " + wizard4spell2cost + " " + tooltipDamageIcon + " " + wizard4spell2value + "</p>'>" + displayDamage(wizard4affinity,wizard2affinity,wizard4spell2type,wizard4spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
wizard2line1.classList.add(wizard4rarity);
wizard2line1spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell1name + "<br />" + tooltipTargetsIcon + " " + wizard2spell1targets + " " + tooltipManaIcon + " " + wizard2spell1cost + " " + tooltipDamageIcon + " " + wizard2spell1value + "</p>'>" + displayDamage(wizard2affinity,wizard4affinity,wizard2spell1type,wizard2spell1value) + "</div>";
wizard2line1spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell2name + "<br />" + tooltipTargetsIcon + " " + wizard2spell2targets + " " + tooltipManaIcon + " " + wizard2spell2cost + " " + tooltipDamageIcon + " " + wizard2spell2value + "</p>'>" + displayDamage(wizard2affinity,wizard4affinity,wizard2spell2type,wizard2spell2value) + "</div>";

wizard2line2.innerHTML = wizardImage(wizard5name,wizard5rarity,'60px','','Opponent') + wizard5name + " <span class='baOppTblHealth'>(" + wizard5health + ")</span> <div class='baOppTblSpeciality'>" + wizard5speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell1name + "<br />" + tooltipTargetsIcon + " " + wizard5spell1targets + " " + tooltipManaIcon + " " + wizard5spell1cost + " " + tooltipDamageIcon + " " + wizard5spell1value + "</p>'>" + displayDamage(wizard5affinity,wizard2affinity,wizard5spell1type,wizard5spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell2name + "<br />" + tooltipTargetsIcon + " " + wizard5spell2targets + " " + tooltipManaIcon + " " + wizard5spell2cost + " " + tooltipDamageIcon + " " + wizard5spell2value + "</p>'>" + displayDamage(wizard5affinity,wizard2affinity,wizard5spell2type,wizard5spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
wizard2line2.classList.add(wizard5rarity);
wizard2line2spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell1name + "<br />" + tooltipTargetsIcon + " " + wizard2spell1targets + " " + tooltipManaIcon + " " + wizard2spell1cost + " " + tooltipDamageIcon + " " + wizard2spell1value + "</p>'>" + displayDamage(wizard2affinity,wizard5affinity,wizard2spell1type,wizard2spell1value) + "</div>";
wizard2line2spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell2name + "<br />" + tooltipTargetsIcon + " " + wizard2spell2targets + " " + tooltipManaIcon + " " + wizard2spell2cost + " " + tooltipDamageIcon + " " + wizard2spell2value + "</p>'>" + displayDamage(wizard2affinity,wizard5affinity,wizard2spell2type,wizard2spell2value) + "</div>";

wizard2line3.innerHTML = wizardImage(wizard6name,wizard6rarity,'60px','','Opponent') + wizard6name + " <span class='baOppTblHealth'>(" + wizard6health + ")</span> <div class='baOppTblSpeciality'>" + wizard6speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell1name + "<br />" + tooltipTargetsIcon + " " + wizard6spell1targets + " " + tooltipManaIcon + " " + wizard6spell1cost + " " + tooltipDamageIcon + " " + wizard6spell1value + "</p>'>" + displayDamage(wizard6affinity,wizard2affinity,wizard6spell1type,wizard6spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell2name + "<br />" + tooltipTargetsIcon + " " + wizard6spell2targets + " " + tooltipManaIcon + " " + wizard6spell2cost + " " + tooltipDamageIcon + " " + wizard6spell2value + "</p>'>" + displayDamage(wizard6affinity,wizard2affinity,wizard6spell2type,wizard6spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
wizard2line3.classList.add(wizard6rarity);
wizard2line3spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell1name + "<br />" + tooltipTargetsIcon + " " + wizard2spell1targets + " " + tooltipManaIcon + " " + wizard2spell1cost + " " + tooltipDamageIcon + " " + wizard2spell1value + "</p>'>" + displayDamage(wizard2affinity,wizard6affinity,wizard2spell1type,wizard2spell1value) + "</div>";
wizard2line3spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell2name + "<br />" + tooltipTargetsIcon + " " + wizard2spell2targets + " " + tooltipManaIcon + " " + wizard2spell2cost + " " + tooltipDamageIcon + " " + wizard2spell2value + "</p>'>" + displayDamage(wizard2affinity,wizard6affinity,wizard2spell2type,wizard2spell2value) + "</div>";

wizard3line1.innerHTML = wizardImage(wizard4name,wizard4rarity,'60px','','Opponent') + wizard4name + " <span class='baOppTblHealth'>(" + wizard4health + ")</span> <div class='baOppTblSpeciality'>" + wizard4speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell1name + "<br />" + tooltipTargetsIcon + " " + wizard4spell1targets + " " + tooltipManaIcon + " " + wizard4spell1cost + " " + tooltipDamageIcon + " " + wizard4spell1value + "</p>'>" + displayDamage(wizard4affinity,wizard3affinity,wizard4spell1type,wizard4spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell2name + "<br />" + tooltipTargetsIcon + " " + wizard4spell2targets + " " + tooltipManaIcon + " " + wizard4spell2cost + " " + tooltipDamageIcon + " " + wizard4spell2value + "</p>'>" + displayDamage(wizard4affinity,wizard3affinity,wizard4spell2type,wizard4spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
wizard3line1.classList.add(wizard4rarity);
wizard3line1spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell1name + "<br />" + tooltipTargetsIcon + " " + wizard3spell1targets + " " + tooltipManaIcon + " " + wizard3spell1cost + " " + tooltipDamageIcon + " " + wizard3spell1value + "</p>'>" + displayDamage(wizard3affinity,wizard4affinity,wizard3spell1type,wizard3spell1value) + "</div>";
wizard3line1spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell2name + "<br />" + tooltipTargetsIcon + " " + wizard3spell2targets + " " + tooltipManaIcon + " " + wizard3spell2cost + " " + tooltipDamageIcon + " " + wizard3spell2value + "</p>'>" + displayDamage(wizard3affinity,wizard4affinity,wizard3spell2type,wizard3spell2value) + "</div>";

wizard3line2.innerHTML = wizardImage(wizard5name,wizard5rarity,'60px','','Opponent') + wizard5name + " <span class='baOppTblHealth'>(" + wizard5health + ")</span> <div class='baOppTblSpeciality'>" + wizard5speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell1name + "<br />" + tooltipTargetsIcon + " " + wizard5spell1targets + " " + tooltipManaIcon + " " + wizard5spell1cost + " " + tooltipDamageIcon + " " + wizard5spell1value + "</p>'>" + displayDamage(wizard5affinity,wizard3affinity,wizard5spell1type,wizard5spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell2name + "<br />" + tooltipTargetsIcon + " " + wizard5spell2targets + " " + tooltipManaIcon + " " + wizard5spell2cost + " " + tooltipDamageIcon + " " + wizard5spell2value + "</p>'>" + displayDamage(wizard5affinity,wizard3affinity,wizard5spell2type,wizard5spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
wizard3line2.classList.add(wizard5rarity);
wizard3line2spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell1name + "<br />" + tooltipTargetsIcon + " " + wizard3spell1targets + " " + tooltipManaIcon + " " + wizard3spell1cost + " " + tooltipDamageIcon + " " + wizard3spell1value + "</p>'>" + displayDamage(wizard3affinity,wizard5affinity,wizard3spell1type,wizard3spell1value) + "</div>";
wizard3line2spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell2name + "<br />" + tooltipTargetsIcon + " " + wizard3spell2targets + " " + tooltipManaIcon + " " + wizard3spell2cost + " " + tooltipDamageIcon + " " + wizard3spell2value + "</p>'>" + displayDamage(wizard3affinity,wizard5affinity,wizard3spell2type,wizard3spell2value) + "</div>";

wizard3line3.innerHTML = wizardImage(wizard6name,wizard6rarity,'60px','','Opponent') + wizard6name + " <span class='baOppTblHealth'>(" + wizard6health + ")</span> <div class='baOppTblSpeciality'>" + wizard6speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell1name + "<br />" + tooltipTargetsIcon + " " + wizard6spell1targets + " " + tooltipManaIcon + " " + wizard6spell1cost + " " + tooltipDamageIcon + " " + wizard6spell1value + "</p>'>" + displayDamage(wizard6affinity,wizard3affinity,wizard6spell1type,wizard6spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell2name + "<br />" + tooltipTargetsIcon + " " + wizard6spell2targets + " " + tooltipManaIcon + " " + wizard6spell2cost + " " + tooltipDamageIcon + " " + wizard6spell2value + "</p>'>" + displayDamage(wizard6affinity,wizard3affinity,wizard6spell2type,wizard6spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
wizard3line3.classList.add(wizard6rarity);
wizard3line3spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell1name + "<br />" + tooltipTargetsIcon + " " + wizard3spell1targets + " " + tooltipManaIcon + " " + wizard3spell1cost + " " + tooltipDamageIcon + " " + wizard3spell1value + "</p>'>" + displayDamage(wizard3affinity,wizard6affinity,wizard3spell1type,wizard3spell1value) + "</div>";
wizard3line3spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell2name + "<br />" + tooltipTargetsIcon + " " + wizard3spell2targets + " " + tooltipManaIcon + " " + wizard3spell2cost + " " + tooltipDamageIcon + " " + wizard3spell2value + "</p>'>" + displayDamage(wizard3affinity,wizard6affinity,wizard3spell2type,wizard3spell2value) + "</div>";

wizard4line1.innerHTML = wizardImage(wizard1name,wizard1rarity,'60px','','Opponent') + wizard1name + " <span class='baOppTblHealth'>(" + wizard1health + ")</span> <div class='baOppTblSpeciality'>" + wizard1speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell1name + "<br />" + tooltipTargetsIcon + " " + wizard1spell1targets + " " + tooltipManaIcon + " " + wizard1spell1cost + " " + tooltipDamageIcon + " " + wizard1spell1value + "</p>'>" + displayDamage(wizard1affinity,wizard4affinity,wizard1spell1type,wizard1spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell2name + "<br />" + tooltipTargetsIcon + " " + wizard1spell2targets + " " + tooltipManaIcon + " " + wizard1spell2cost + " " + tooltipDamageIcon + " " + wizard1spell2value + "</p>'>" + displayDamage(wizard1affinity,wizard4affinity,wizard1spell2type,wizard1spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
wizard4line1.classList.add(wizard1rarity);
wizard4line1spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell1name + "<br />" + tooltipTargetsIcon + " " + wizard4spell1targets + " " + tooltipManaIcon + " " + wizard4spell1cost + " " + tooltipDamageIcon + " " + wizard4spell1value + "</p>'>" + displayDamage(wizard4affinity,wizard1affinity,wizard4spell1type,wizard4spell1value) + "</div>";
wizard4line1spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell2name + "<br />" + tooltipTargetsIcon + " " + wizard4spell2targets + " " + tooltipManaIcon + " " + wizard4spell2cost + " " + tooltipDamageIcon + " " + wizard4spell2value + "</p>'>" + displayDamage(wizard4affinity,wizard1affinity,wizard4spell2type,wizard4spell2value) + "</div>";

wizard4line2.innerHTML = wizardImage(wizard2name,wizard2rarity,'60px','','Opponent') + wizard2name + " <span class='baOppTblHealth'>(" + wizard2health + ")</span> <div class='baOppTblSpeciality'>" + wizard2speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell1name + "<br />" + tooltipTargetsIcon + " " + wizard2spell1targets + " " + tooltipManaIcon + " " + wizard2spell1cost + " " + tooltipDamageIcon + " " + wizard2spell1value + "</p>'>" + displayDamage(wizard2affinity,wizard4affinity,wizard2spell1type,wizard2spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell2name + "<br />" + tooltipTargetsIcon + " " + wizard2spell2targets + " " + tooltipManaIcon + " " + wizard2spell2cost + " " + tooltipDamageIcon + " " + wizard2spell2value + "</p>'>" + displayDamage(wizard2affinity,wizard4affinity,wizard2spell2type,wizard2spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
wizard4line2.classList.add(wizard2rarity);
wizard4line2spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell1name + "<br />" + tooltipTargetsIcon + " " + wizard4spell1targets + " " + tooltipManaIcon + " " + wizard4spell1cost + " " + tooltipDamageIcon + " " + wizard4spell1value + "</p>'>" + displayDamage(wizard4affinity,wizard2affinity,wizard4spell1type,wizard4spell1value) + "</div>";
wizard4line2spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell2name + "<br />" + tooltipTargetsIcon + " " + wizard4spell2targets + " " + tooltipManaIcon + " " + wizard4spell2cost + " " + tooltipDamageIcon + " " + wizard4spell2value + "</p>'>" + displayDamage(wizard4affinity,wizard2affinity,wizard4spell2type,wizard4spell2value) + "</div>";

wizard4line3.innerHTML = wizardImage(wizard3name,wizard3rarity,'60px','','Opponent') + wizard3name + " <span class='baOppTblHealth'>(" + wizard3health + ")</span> <div class='baOppTblSpeciality'>" + wizard3speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell1name + "<br />" + tooltipTargetsIcon + " " + wizard3spell1targets + " " + tooltipManaIcon + " " + wizard3spell1cost + " " + tooltipDamageIcon + " " + wizard3spell1value + "</p>'>" + displayDamage(wizard3affinity,wizard4affinity,wizard3spell1type,wizard3spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell2name + "<br />" + tooltipTargetsIcon + " " + wizard3spell2targets + " " + tooltipManaIcon + " " + wizard3spell2cost + " " + tooltipDamageIcon + " " + wizard3spell2value + "</p>'>" + displayDamage(wizard3affinity,wizard4affinity,wizard3spell2type,wizard3spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
wizard4line3.classList.add(wizard3rarity);
wizard4line3spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell1name + "<br />" + tooltipTargetsIcon + " " + wizard4spell1targets + " " + tooltipManaIcon + " " + wizard4spell1cost + " " + tooltipDamageIcon + " " + wizard4spell1value + "</p>'>" + displayDamage(wizard4affinity,wizard3affinity,wizard4spell1type,wizard4spell1value) + "</div>";
wizard4line3spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell2name + "<br />" + tooltipTargetsIcon + " " + wizard4spell2targets + " " + tooltipManaIcon + " " + wizard4spell2cost + " " + tooltipDamageIcon + " " + wizard4spell2value + "</p>'>" + displayDamage(wizard4affinity,wizard3affinity,wizard4spell2type,wizard4spell2value) + "</div>";

wizard5line1.innerHTML = wizardImage(wizard1name,wizard1rarity,'60px','','Opponent') + wizard1name + " <span class='baOppTblHealth'>(" + wizard1health + ")</span> <div class='baOppTblSpeciality'>" + wizard1speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell1name + "<br />" + tooltipTargetsIcon + " " + wizard1spell1targets + " " + tooltipManaIcon + " " + wizard1spell1cost + " " + tooltipDamageIcon + " " + wizard1spell1value + "</p>'>" + displayDamage(wizard1affinity,wizard5affinity,wizard1spell1type,wizard1spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell2name + "<br />" + tooltipTargetsIcon + " " + wizard1spell2targets + " " + tooltipManaIcon + " " + wizard1spell2cost + " " + tooltipDamageIcon + " " + wizard1spell2value + "</p>'>" + displayDamage(wizard1affinity,wizard5affinity,wizard1spell2type,wizard1spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
wizard5line1.classList.add(wizard1rarity);
wizard5line1spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell1name + "<br />" + tooltipTargetsIcon + " " + wizard5spell1targets + " " + tooltipManaIcon + " " + wizard5spell1cost + " " + tooltipDamageIcon + " " + wizard5spell1value + "</p>'>" + displayDamage(wizard5affinity,wizard1affinity,wizard5spell1type,wizard5spell1value) + "</div>";
wizard5line1spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell2name + "<br />" + tooltipTargetsIcon + " " + wizard5spell2targets + " " + tooltipManaIcon + " " + wizard5spell2cost + " " + tooltipDamageIcon + " " + wizard5spell2value + "</p>'>" + displayDamage(wizard5affinity,wizard1affinity,wizard5spell2type,wizard5spell2value) + "</div>";

wizard5line2.innerHTML = wizardImage(wizard2name,wizard2rarity,'60px','','Opponent') + wizard2name + " <span class='baOppTblHealth'>(" + wizard2health + ")</span> <div class='baOppTblSpeciality'>" + wizard2speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell1name + "<br />" + tooltipTargetsIcon + " " + wizard2spell1targets + " " + tooltipManaIcon + " " + wizard2spell1cost + " " + tooltipDamageIcon + " " + wizard2spell1value + "</p>'>" + displayDamage(wizard2affinity,wizard5affinity,wizard2spell1type,wizard2spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell2name + "<br />" + tooltipTargetsIcon + " " + wizard2spell2targets + " " + tooltipManaIcon + " " + wizard2spell2cost + " " + tooltipDamageIcon + " " + wizard2spell2value + "</p>'>" + displayDamage(wizard2affinity,wizard5affinity,wizard2spell2type,wizard2spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
wizard5line2.classList.add(wizard2rarity);
wizard5line2spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell1name + "<br />" + tooltipTargetsIcon + " " + wizard5spell1targets + " " + tooltipManaIcon + " " + wizard5spell1cost + " " + tooltipDamageIcon + " " + wizard5spell1value + "</p>'>" + displayDamage(wizard5affinity,wizard2affinity,wizard5spell1type,wizard5spell1value) + "</div>";
wizard5line2spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell2name + "<br />" + tooltipTargetsIcon + " " + wizard5spell2targets + " " + tooltipManaIcon + " " + wizard5spell2cost + " " + tooltipDamageIcon + " " + wizard5spell2value + "</p>'>" + displayDamage(wizard5affinity,wizard2affinity,wizard5spell2type,wizard5spell2value) + "</div>";

wizard5line3.innerHTML = wizardImage(wizard3name,wizard3rarity,'60px','','Opponent') + wizard3name + " <span class='baOppTblHealth'>(" + wizard3health + ")</span> <div class='baOppTblSpeciality'>" + wizard3speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell1name + "<br />" + tooltipTargetsIcon + " " + wizard3spell1targets + " " + tooltipManaIcon + " " + wizard3spell1cost + " " + tooltipDamageIcon + " " + wizard3spell1value + "</p>'>" + displayDamage(wizard3affinity,wizard5affinity,wizard3spell1type,wizard3spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell2name + "<br />" + tooltipTargetsIcon + " " + wizard3spell2targets + " " + tooltipManaIcon + " " + wizard3spell2cost + " " + tooltipDamageIcon + " " + wizard3spell2value + "</p>'>" + displayDamage(wizard3affinity,wizard5affinity,wizard3spell2type,wizard3spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
wizard5line3.classList.add(wizard3rarity);
wizard5line3spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell1name + "<br />" + tooltipTargetsIcon + " " + wizard5spell1targets + " " + tooltipManaIcon + " " + wizard5spell1cost + " " + tooltipDamageIcon + " " + wizard5spell1value + "</p>'>" + displayDamage(wizard5affinity,wizard3affinity,wizard5spell1type,wizard5spell1value) + "</div>";
wizard5line3spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell2name + "<br />" + tooltipTargetsIcon + " " + wizard5spell2targets + " " + tooltipManaIcon + " " + wizard5spell2cost + " " + tooltipDamageIcon + " " + wizard5spell2value + "</p>'>" + displayDamage(wizard5affinity,wizard3affinity,wizard5spell2type,wizard5spell2value) + "</div>";

wizard6line1.innerHTML = wizardImage(wizard1name,wizard1rarity,'60px','','Opponent') + wizard1name + " <span class='baOppTblHealth'>(" + wizard1health + ")</span> <div class='baOppTblSpeciality'>" + wizard1speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell1name + "<br />" + tooltipTargetsIcon + " " + wizard1spell1targets + " " + tooltipManaIcon + " " + wizard1spell1cost + " " + tooltipDamageIcon + " " + wizard1spell1value + "</p>'>" + displayDamage(wizard1affinity,wizard6affinity,wizard1spell1type,wizard1spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell2name + "<br />" + tooltipTargetsIcon + " " + wizard1spell2targets + " " + tooltipManaIcon + " " + wizard1spell2cost + " " + tooltipDamageIcon + " " + wizard1spell2value + "</p>'>" + displayDamage(wizard1affinity,wizard6affinity,wizard1spell2type,wizard1spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
wizard6line1.classList.add(wizard1rarity);
wizard6line1spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell1name + "<br />" + tooltipTargetsIcon + " " + wizard6spell1targets + " " + tooltipManaIcon + " " + wizard6spell1cost + " " + tooltipDamageIcon + " " + wizard6spell1value + "</p>'>" + displayDamage(wizard6affinity,wizard1affinity,wizard6spell1type,wizard6spell1value) + "</div>";
wizard6line1spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell2name + "<br />" + tooltipTargetsIcon + " " + wizard6spell2targets + " " + tooltipManaIcon + " " + wizard6spell2cost + " " + tooltipDamageIcon + " " + wizard6spell2value + "</p>'>" + displayDamage(wizard6affinity,wizard1affinity,wizard6spell2type,wizard6spell2value) + "</div>";

wizard6line2.innerHTML = wizardImage(wizard2name,wizard2rarity,'60px','','Opponent') + wizard2name + " <span class='baOppTblHealth'>(" + wizard2health + ")</span> <div class='baOppTblSpeciality'>" + wizard2speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell1name + "<br />" + tooltipTargetsIcon + " " + wizard2spell1targets + " " + tooltipManaIcon + " " + wizard2spell1cost + " " + tooltipDamageIcon + " " + wizard2spell1value + "</p>'>" + displayDamage(wizard2affinity,wizard6affinity,wizard2spell1type,wizard2spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell2name + "<br />" + tooltipTargetsIcon + " " + wizard2spell2targets + " " + tooltipManaIcon + " " + wizard2spell2cost + " " + tooltipDamageIcon + " " + wizard2spell2value + "</p>'>" + displayDamage(wizard2affinity,wizard6affinity,wizard2spell2type,wizard2spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
wizard6line2.classList.add(wizard2rarity);
wizard6line2spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell1name + "<br />" + tooltipTargetsIcon + " " + wizard6spell1targets + " " + tooltipManaIcon + " " + wizard6spell1cost + " " + tooltipDamageIcon + " " + wizard6spell1value + "</p>'>" + displayDamage(wizard6affinity,wizard2affinity,wizard6spell1type,wizard6spell1value) + "</div>";
wizard6line2spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell2name + "<br />" + tooltipTargetsIcon + " " + wizard6spell2targets + " " + tooltipManaIcon + " " + wizard6spell2cost + " " + tooltipDamageIcon + " " + wizard6spell2value + "</p>'>" + displayDamage(wizard6affinity,wizard2affinity,wizard6spell2type,wizard6spell2value) + "</div>";

wizard6line3.innerHTML = wizardImage(wizard3name,wizard3rarity,'60px','','Opponent') + wizard3name + " <span class='baOppTblHealth'>(" + wizard3health + ")</span> <div class='baOppTblSpeciality'>" + wizard3speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell1name + "<br />" + tooltipTargetsIcon + " " + wizard3spell1targets + " " + tooltipManaIcon + " " + wizard3spell1cost + " " + tooltipDamageIcon + " " + wizard3spell1value + "</p>'>" + displayDamage(wizard3affinity,wizard6affinity,wizard3spell1type,wizard3spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell2name + "<br />" + tooltipTargetsIcon + " " + wizard3spell2targets + " " + tooltipManaIcon + " " + wizard3spell2cost + " " + tooltipDamageIcon + " " + wizard3spell2value + "</p>'>" + displayDamage(wizard3affinity,wizard6affinity,wizard3spell2type,wizard3spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
wizard6line3.classList.add(wizard3rarity);
wizard6line3spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell1name + "<br />" + tooltipTargetsIcon + " " + wizard6spell1targets + " " + tooltipManaIcon + " " + wizard6spell1cost + " " + tooltipDamageIcon + " " + wizard6spell1value + "</p>'>" + displayDamage(wizard6affinity,wizard3affinity,wizard6spell1type,wizard6spell1value) + "</div>";
wizard6line3spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell2name + "<br />" + tooltipTargetsIcon + " " + wizard6spell2targets + " " + tooltipManaIcon + " " + wizard6spell2cost + " " + tooltipDamageIcon + " " + wizard6spell2value + "</p>'>" + displayDamage(wizard6affinity,wizard3affinity,wizard6spell2type,wizard6spell2value) + "</div>";
}

function displayDamage(attAffin,defAffin,type,damage) {
if (type === "Healing") {
return "<div style='color:#fff;background-color:rgba(255, 255, 255, 0.1);border-radius:10px;padding:0.1em 0.2em;border:1px solid rgba(255, 255, 255, 0.2);font-weight:400;'><img alt='Healing' src='//static.miraheze.org/wizardiawiki/2/22/Healing.svg' decoding='async' width='13' height='13' /> <div style='display:inline;vertical-align:middle'>" + damage + "</div></div>";
} else if (type === "Armor") {
return "<div style='color:#fff;background-color:rgba(255, 255, 255, 0.1);border-radius:10px;padding:0.1em 0.2em;border:1px solid rgba(255, 255, 255, 0.2);font-weight:400;'><img alt='Armor' src='//static.miraheze.org/wizardiawiki/b/b1/Armor.svg' decoding='async' width='13' height='13' /> <div style='display:inline;vertical-align:middle'>" + damage + "</div></div>";
} else {
if (attAffin === defAffin) {
return "<div style='background-color: #e9e9e9; font-weight:500; border-radius:10px;padding:0.1em 0.2em;border:1px solid rgba(255, 255, 255, 0.2);'>" + damage + "</div>";
} else if ((attAffin === "Body" && defAffin === "Soul") || (attAffin === "Mind" && defAffin === "Body") || (attAffin === "Soul" && defAffin === "Mind")) {
return "<div style='background-color: rgb(200 245 200); font-weight:500; border-radius:10px;padding:0.1em;border:1px solid rgba(255, 255, 255, 0.2);'>" + countDamage(attAffin,defAffin,type,damage) + "</div>";
} else {
return "<div style='background-color: rgb(245 200 200); font-weight:500; border-radius:10px;padding:0.1em 0.2em;border:1px solid rgba(255, 255, 255, 0.2);'>" + countDamage(attAffin,defAffin,type,damage) + "</div>";
}
}
}

function wizardImageAffinity(affinity,team) {
var soulAffinityDisplay = " class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<div style=&quot;text-align:center&quot;><div><img alt=&quot;Soul Affinity&quot; src=&quot;//static.miraheze.org/wizardiawiki/5/5a/Soul.svg&quot; decoding=&quot;async&quot; width=&quot;40&quot; height=&quot;40&quot;></div><div><div style=&quot;color: rgb(183 245 196);display:inline;margin:0.5em;&quot;>Stronger than</div><div style=&quot;color: rgb(171 129 129);display:inline;margin:0.5em;&quot;>Weaker than</div></div><div><div style=&quot;display:inline-block;width:50%;&quot;><img alt=&quot;Mind Affinity&quot; src=&quot;//static.miraheze.org/wizardiawiki/9/96/Mind.svg&quot; decoding=&quot;async&quot; width=&quot;40&quot; height=&quot;40&quot;></div><div style=&quot;display:inline-block;width:50%;&quot;><img alt=&quot;Body Affinity&quot; src=&quot;//static.miraheze.org/wizardiawiki/0/0b/Body.svg&quot; decoding=&quot;async&quot; width=&quot;40&quot; height=&quot;40&quot;></div></div></div>'";
var bodyAffinityDisplay = " class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<div style=&quot;text-align:center&quot;><div><img alt=&quot;Body Affinity&quot; src=&quot;//static.miraheze.org/wizardiawiki/0/0b/Body.svg&quot; decoding=&quot;async&quot; width=&quot;40&quot; height=&quot;40&quot;></div><div><div style=&quot;color: rgb(183 245 196);display:inline;margin:0.5em;&quot;>Stronger than</div><div style=&quot;color: rgb(171 129 129);display:inline;margin:0.5em;&quot;>Weaker than</div></div><div><div style=&quot;display:inline-block;width:50%;&quot;><img alt=&quot;Soul Affinity&quot; src=&quot;//static.miraheze.org/wizardiawiki/5/5a/Soul.svg&quot; decoding=&quot;async&quot; width=&quot;40&quot; height=&quot;40&quot;></div><div style=&quot;display:inline-block;width:50%;&quot;><img alt=&quot;Mind Affinity&quot; src=&quot;//static.miraheze.org/wizardiawiki/9/96/Mind.svg&quot; decoding=&quot;async&quot; width=&quot;40&quot; height=&quot;40&quot;></div></div></div>'";
var mindAffinityDisplay = " class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<div style=&quot;text-align:center&quot;><div><img alt=&quot;Mind Affinity&quot; src=&quot;//static.miraheze.org/wizardiawiki/9/96/Mind.svg&quot; decoding=&quot;async&quot; width=&quot;40&quot; height=&quot;40&quot;></div><div><div style=&quot;color: rgb(183 245 196);display:inline;margin:0.5em;&quot;>Stronger than</div><div style=&quot;color: rgb(171 129 129);display:inline;margin:0.5em;&quot;>Weaker than</div></div><div><div style=&quot;display:inline-block;width:50%;&quot;><img alt=&quot;Body Affinity&quot; src=&quot;//static.miraheze.org/wizardiawiki/0/0b/Body.svg&quot; decoding=&quot;async&quot; width=&quot;40&quot; height=&quot;40&quot;></div><div style=&quot;display:inline-block;width:50%;&quot;><img alt=&quot;Soul Affinity&quot; src=&quot;//static.miraheze.org/wizardiawiki/5/5a/Soul.svg&quot; decoding=&quot;async&quot; width=&quot;40&quot; height=&quot;40&quot;></div></div></div>'";
var soulImage = "<img alt='Soul Affinity' src='//static.miraheze.org/wizardiawiki/5/5a/Soul.svg' decoding='async' width='40' height='40' style='position:absolute;left:0%;top:0%'" + soulAffinityDisplay + ">";
var bodyImage = "<img alt='Body Affinity' src='//static.miraheze.org/wizardiawiki/0/0b/Body.svg' decoding='async' width='40' height='40' style='position:absolute;left:0%;top:0%'" + bodyAffinityDisplay + ">";
var mindImage = "<img alt='Mind Affinity' src='//static.miraheze.org/wizardiawiki/9/96/Mind.svg' decoding='async' width='40' height='40' style='position:absolute;left:0%;top:0%'" + mindAffinityDisplay + ">";
if (team === "Opponent") {
return "";
}
else {
if (affinity === "Soul") {
return soulImage;
}
else if (affinity === "Body") {
return bodyImage;
}
else {
return mindImage;
}
}
}
function wizardImage(wizardName,wizardRarity,height,width,team) {
var returnHeight = height ? " height='" + height + "'" : "";
var returnWidth = width ? " width='" + width + "'" : "";

switch (wizardName) {
case 'Amin, the Deceived':
return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/0/06/Amin-epic-650.png/300px-Amin-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/0/06/Amin-epic-650.png/600px-Amin-epic-650.png 2x'>" + wizardImageAffinity("Body",team);
break;
case 'Chikara, the Tower':
return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/1/13/Chikara-epic-650.png/300px-Chikara-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/1/13/Chikara-epic-650.png/600px-Chikara-epic-650.png 2x'>" + wizardImageAffinity("Mind",team);
break;
case 'Crizal, the Alluring':
return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/c/cf/Crizal-epic-650.png/300px-Crizal-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/c/cf/Crizal-epic-650.png/600px-Crizal-epic-650.png 2x'>" + wizardImageAffinity("Mind",team);
break;
case 'Hinata, the Detached':
return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/c/c0/Hinata-epic-650.png/300px-Hinata-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/c/c0/Hinata-epic-650.png/600px-Hinata-epic-650.png 2x'>" + wizardImageAffinity("Soul",team);
break;
case 'Olek, the Reflective':
return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/f/f1/Olek-epic-650.png/300px-Olek-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/f/f1/Olek-epic-650.png/600px-Olek-epic-650.png 2x'>" + wizardImageAffinity("Soul",team);
break;
case 'Petro, the 1':
return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/f/f0/Petro-epic-650.png/300px-Petro-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/f/f0/Petro-epic-650.png/600px-Petro-epic-650.png 2x'>" + wizardImageAffinity("Mind",team);
break;
case 'S, the Unrestrained':
return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/6/65/S-epic-650.png/300px-S-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/6/65/S-epic-650.png/600px-S-epic-650.png 2x'>" + wizardImageAffinity("Soul",team);
break;
case 'Tah Mut Tah, the Indulging':
return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/e/ef/Tah-epic-650.png/300px-Tah-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/e/ef/Tah-epic-650.png/600px-Tah-epic-650.png 2x'>" + wizardImageAffinity("Body",team);
break;
case 'Tsering, the Impatient':
return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/7/79/Tsering-epic-650.png/300px-Tsering-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/7/79/Tsering-epic-650.png/600px-Tsering-epic-650.png 2x'>" + wizardImageAffinity("Body",team);
break;
case 'Elzevir, the Scribe':
return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/0/01/Elzevir-epic-650.png/300px-Elzevir-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/0/01/Elzevir-epic-650.png/600px-Elzevir-epic-650.png 2x'>" + wizardImageAffinity("Mind",team);
break;
case 'Seven, the Torn':
return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/9/97/Seven-epic-650.png/300px-Seven-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/9/97/Seven-epic-650.png/600px-Seven-epic-650.png 2x'>" + wizardImageAffinity("Body",team);
break;
case 'Rose, the Unbreakable':
return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/b/b2/Rose-epic-650.png/300px-Rose-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/b/b2/Rose-epic-650.png/600px-Rose-epic-650.png 2x'>" + wizardImageAffinity("Soul",team);
break;
case 'Einar, the Spark':
return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/9/96/Einar-epic-650.png/300px-Einar-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/9/96/Einar-epic-650.png/600px-Einar-epic-650.png 2x'>" + wizardImageAffinity("Soul",team);
break;
case 'Ergork, the Bound':
return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/7/7c/Ergork-epic-650.png/300px-Ergork-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/7/7c/Ergork-epic-650.png/600px-Ergork-epic-650.png 2x'>" + wizardImageAffinity("Body",team);
break;
case 'Wahbu, the Youthful':
return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/4/4c/Wahbu-epic-650.png/300px-Wahbu-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/4/4c/Wahbu-epic-650.png/600px-Wahbu-epic-650.png 2x'>" + wizardImageAffinity("Mind",team);
break;
default: '';
}
}

function showTableLegend() {
var tableLegend = document.getElementById("baTableLegend");
var healthIconImage = "<img alt=&quot;Healing&quot; src=&quot;//static.miraheze.org/wizardiawiki/2/22/Healing.svg&quot; decoding=&quot;async&quot; width=&quot;13&quot; height=&quot;13&quot; style=&quot;vertical-align: text-top;&quot;> ";
var armorIconImage = "<img alt=&quot;Armor&quot; src=&quot;//static.miraheze.org/wizardiawiki/b/b1/Armor.svg&quot; decoding=&quot;async&quot; width=&quot;13&quot; height=&quot;13&quot; style=&quot;vertical-align: text-top;&quot;>";
var tableLegendHtml = "<span class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<div><span style=&quot;color:black;background-color:rgb(200,245,200);font-weight: 500;border-radius: 10px;padding: 0.1em;border: 1px solid rgba(255, 255, 255, 0.2);&quot;>more damage</span> - stronger affinity</div><div><span style=&quot;color:black;background-color:rgb(245,200,200);font-weight: 500;border-radius: 10px;padding: 0.1em;border: 1px solid rgba(255, 255, 255, 0.2);&quot;>less damage</span> - weaker affinity</div><div><span style=&quot;color:black;background-color:#e9e9e9;font-weight: 500;border-radius: 10px;padding: 0.1em;border: 1px solid rgba(255, 255, 255, 0.2);&quot;>exact damage</span> - same affinity</div><div><span style=&quot;color:#fff;background-color:rgb(255,255,255,0.1);font-weight: 500;border-radius: 10px;padding: 0.05em 0.1em;border: 1px solid rgba(255, 255, 255, 0.2);&quot;>" + healthIconImage + "restores health</span> - healing</div><div><span style=&quot;color:#fff;background-color:rgb(255,255,255,0.1);font-weight: 500;border-radius: 10px;padding: 0.05em 0.1em;border: 1px solid rgba(255, 255, 255, 0.2);&quot;>" + armorIconImage + "adds armor</span> - protection</div>'>Table legend</span>";
if (tableLegend) {
tableLegend.innerHTML = tableLegendHtml;
}
}

function countDamage(attAffin,defAffin,type,damage) {
var lowMin = 0.66;
var lowMax = 0.76;
var highMin = 1.248;
var highMax = 1.30;
if (type === "Healing") {
return "0";
} else {
if (damage.includes("-")) {
var damageArray = damage.split("-");
var damageMin = damageArray[0];
var damageMax = damageArray[1];
if (attAffin === defAffin) {
return "" + damage;
} else if ((attAffin === "Body" && defAffin === "Soul") || (attAffin === "Mind" && defAffin === "Body") || (attAffin === "Soul" && defAffin === "Mind")) {
return Math.round(damageMin*highMin) + "-" + Math.round(damageMax*highMax);
} else {
return Math.round(damageMin*lowMin) + "-" + Math.round(damageMax*lowMax);
}
} else {
if (attAffin === defAffin) {
return "" + damage;
} else if ((attAffin === "Body" && defAffin === "Soul") || (attAffin === "Mind" && defAffin === "Body") || (attAffin === "Soul" && defAffin === "Mind")) {
return Math.round(damage*highMin) + "-" + Math.round(damage*highMax);
} else {
return Math.round(damage*lowMin) + "-" + Math.round(damage*lowMax);
}
}
}
}
function whatSpeciality(spell1type,spell1targets,spell2type,spell2targets) {
if (spell1type === "Healing" || spell2type === "Healing") { // if healing
if ((spell1type === "Healing" && spell1targets > 1) || (spell2type === "Healing" && spell2targets > 1)) {
return "<div style='color: #fff; background-color: rgba(255, 255, 255, 0.2); border-radius:10px;padding:0.2em; margin:0.1em;display:inline;border:1px solid rgba(255, 255, 255, 0.2);'><img alt='Healing' src='//static.miraheze.org/wizardiawiki/2/22/Healing.svg' decoding='async' width='16' height='16' style='vertical-align:text-top'> 3</div>";
} else {
return "<div style='color: #fff; background-color: rgba(255, 255, 255, 0.2); border-radius:10px;padding:0.2em; margin:0.1em;display:inline;border:1px solid rgba(255, 255, 255, 0.2);'><img alt='Healing' src='//static.miraheze.org/wizardiawiki/2/22/Healing.svg' decoding='async' width='16' height='16' style='vertical-align:text-top'> 1</div>";
}
} else if (spell1targets > 1 || spell2targets > 1) { // if AOE attack
return "<div style='color: #fff; background-color: rgba(255, 255, 255, 0.2); border-radius:10px;padding:0.2em; margin:0.1em;display:inline;border:1px solid rgba(255, 255, 255, 0.2);'><img alt='Targets' src='//static.miraheze.org/wizardiawiki/b/ba/Targets.svg' decoding='async' width='15' height='16' style='vertical-align:text-top'> 3</div>";
} else {
return "<div style='color: #fff; background-color: rgba(255, 255, 255, 0.2); border-radius:10px;padding:0.2em; margin:0.1em;display:inline;border:1px solid rgba(255, 255, 255, 0.2);'><img alt='Targets' src='//static.miraheze.org/wizardiawiki/b/ba/Targets.svg' decoding='async' width='15' height='16' style='vertical-align:text-top'> 1</div>";
}
}

function showTeam() {
var yourTeam = document.getElementById("ba-your-team");
var opponentsTeam = document.getElementById("ba-opponents-team");

if (document.getElementById("whichTeam").value === "Your"){
yourTeam.classList.remove(noDisplay);
opponentsTeam.classList.add(noDisplay);
}
else{
yourTeam.classList.add(noDisplay);
opponentsTeam.classList.remove(noDisplay);
}
}
function displayCalculator(number) {
var calculatorSection = document.getElementById("baCalculatorSection");
var calculatorWrapId = "baCalculatorWrap" + number;
var calculatorWrap = document.createElement('div');
calculatorWrap.id = calculatorWrapId;
calculatorWrap.style ="margin-bottom:0.2em;position:relative;text-align:center;border:1px solid rgba(255, 255, 255, 0.2);border-radius:10px;background-color: rgba(14, 15, 16, 1);display:inline-block;flex-direction:row;justify-content:flex-start;align-items:stretch;align-content:stretch";
calculatorWrap.innerHTML = "<div id='baCalculatorIntro" + number + "' style='color: #90accb;cursor:pointer;margin:0.2em;' onclick='damageCalculator(" + number + ")'>+ COUNT DAMAGE</div>";
if (calculatorSection) {
calculatorSection.appendChild(calculatorWrap);
}
}
function damageCalculator(number) {
var calculatorWrapId = "baCalculatorWrap" + number;
var calculatorWrap = document.getElementById(calculatorWrapId);
calculatorWrap.style.display = "flex";
var calculatorIntroId = "baCalculatorIntro" + number;
var calculatorIntro = document.getElementById(calculatorIntroId);
var totalDamage = document.createElement('div');
totalDamage.id = "baTotalDamage" + number;
totalDamage.style = "min-width:8em;flex-shrink:0;background-color:rgba(255,255,255,0.1);border-radius:10px;color:#6c757d";
var infoField = document.createElement('div');
infoField.id = "baCalculatorInfoField" + number;
infoField.style = "cursor:default;min-width:0px;flex-shrink:1;";
var stopCalculator = document.createElement('div');
stopCalculator.id = "baCalculatorManage" + number;
stopCalculator.style = "min-width:5em;flex-shrink:0;";
var wiz1line1spell1 = document.getElementById("wizard-1-line-1-spell-1");
calculatorIntro.classList.add('noDisplay');
totalDamage.innerHTML = "Total damage<div id='baCalculatorTotalDamageSum" + number + "' style='color:white;background-color:rgba(255,255,255,0.2);border:1px solid rgba(255, 255, 255, 0.2);border-radius:10px;margin:0.2em'>0</div>";
stopCalculator.innerHTML = "<div class='selectSpells' style='color:#df7f7f;cursor:pointer;border:1px solid rgba(255, 255, 255, 0.2);border-radius:10px;padding:0.1em;margin:0.1em 0.2em' onclick='stopCalculator(" + number + ")'>STOP</div>";
calculatorWrap.appendChild(totalDamage);
calculatorWrap.appendChild(infoField);
calculatorWrap.appendChild(stopCalculator);
var nodeList = document.querySelectorAll("[id*='-spell-'].baOppTblRow");
for (var i = 0; i < nodeList.length; i++) {
nodeList[i].addEventListener("click", addSpell);
nodeList[i].classList.add('selectSpells');
};
}
function addSpell() {
if(!this.innerText.includes(" ")) {
//var infoField = document.querySelector('[id ^= "baCalculatorInfoField"]');
var infoField = Array.from(
document.querySelectorAll('[id ^= "baCalculatorInfoField"]')
).pop();
var copySpell = document.createElement('div');
copySpell.classList.add("calculatedSpell");
copySpell.style.color = "#000";
copySpell.style.display = "inline-block";
copySpell.style.margin = "0.1em 0.2em";
copySpell.innerHTML = this.innerHTML;
infoField.appendChild(copySpell);
calculatorTotalDamageCount(infoField.id);
}
}
function stopCalculator(number) {
var calculatorWrapId = "baCalculatorWrap" + number;
var calculatorWrap = document.getElementById(calculatorWrapId);
var numberNew = number + 1;
var nodeList = document.querySelectorAll("[id*='-spell-'].baOppTblRow");
var manageCalculatorId = "baCalculatorManage" + number;
var manageCalculator = document.getElementById(manageCalculatorId);
manageCalculator.innerHTML = "<div style='color:#df7f7f;cursor:pointer;border:1px solid rgba(255, 255, 255, 0.2);border-radius:10px;padding:0.1em 0.3em;margin:0.1em 0.2em;' onclick='removeCalculator(" + number + ")'> [X] Remove </div>";
for (var i = 0; i < nodeList.length; i++) {
nodeList[i].removeEventListener("click", addSpell);
nodeList[i].classList.remove('selectSpells');
//document.getElementById("baCalculatorInfoField").classList.remove('selectSpells');
};
displayCalculator(numberNew);
}
function removeCalculator(number) {
var calculatorWrapId = "baCalculatorWrap" + number;
var calculatorWrap = document.getElementById(calculatorWrapId);
calculatorWrap.style.display = "none";
//calculatorWrap.innerHTML = "";
}
function calculatorTotalDamageCount(infoFieldId) {
var query = "#" + infoFieldId + " .calculatedSpell";
var damageMin = 0;
var damageMax = 0;
var nodeList = document.querySelectorAll(query);
for (var i = 0; i < nodeList.length; i++) {
if (nodeList[i].innerText.includes("-")) {
var damageArray = nodeList[i].innerText.split("-");
damageMin = damageMin + parseInt(damageArray[0]);
damageMax = damageMax + parseInt(damageArray[1]);
}
else if (nodeList[i].innerText.includes(" ")) {
}
else {
damageMin = damageMin + parseInt(nodeList[i].innerText);
damageMax = damageMax + parseInt(nodeList[i].innerText);
}
};
if (damageMin != damageMax) {
var totalSum = Array.from(
document.querySelectorAll('[id ^= "baCalculatorTotalDamageSum"]')
).pop();
totalSum.innerHTML = damageMin + "-" + damageMax;
}
else {
var totalSum = Array.from(
document.querySelectorAll('[id ^= "baCalculatorTotalDamageSum"]')
).pop();
totalSum.innerHTML = damageMin;
}
}
function canBeKilled(wizardNumber) { // returns turn number when can be killed
var wizardNumberInTeam = 0;
var start = 0;
wizardNumber = parseInt(wizardNumber);
if (wizardNumber < 4) {
start = 4;
wizardNumberInTeam = wizardNumber;
}
else if (wizardNumber > 3) {
start = 1;
wizardNumberInTeam = wizardNumber - 3;
}
else {
return;
}
var wizardHealthId = "wizard-" + wizardNumber + "-health";
var wizardHealth = document.getElementById(wizardHealthId).innerHTML;
var damageTotalMax = 0;
var damageTotalMin = 0;
var turn = 1;
var spell1damageId = "";
var spell2damageId = "";
var spell1damage = "";
var spell2damage = "";
var spell1damageMin = "";
var spell2damageMin = "";
var spell1damageMax = "";
var spell2damageMax = "";
// sum max opponent wizard damage per turn and when it exceeds wizardHealth - return turn number
for (var i = start; i < start + 3; i++) {
spell1damageId = "wizard-" + i + "-line-" + wizardNumberInTeam + "-spell-1";
spell2damageId = "wizard-" + i + "-line-" + wizardNumberInTeam + "-spell-2";
spell1damage = document.getElementById(spell1damageId).innerText;
spell2damage = document.getElementById(spell2damageId).innerText;
// check if damage is range (then split and use max damage), check if healing spell. Check both spells
if (spell1damage.includes("-")) {
var damageArray = spell1damage.split("-");
spell1damageMax = parseInt(damageArray[1]);
spell1damageMin = parseInt(damageArray[0]);
}
else if (spell1damage.includes(" ")) {
spell1damageMax = 0;
spell1damageMin = 0;
}
else {
spell1damageMax = spell1damage;
spell1damageMin = spell1damage;
}
if (spell2damage.includes("-")) {
var damageArray = spell2damage.split("-");
spell2damageMax = parseInt(damageArray[1]);
spell2damageMin = parseInt(damageArray[0]);
}
else if (spell2damage.includes(" ")) {
spell2damageMax = 0;
spell2damageMin = 0;
}
else {
spell2damageMax = spell2damage;
spell2damageMin = spell2damage;
}
// check which spell deals more damage (or equal) and add new damage to damageTotal
if (spell1damageMax >= spell2damageMax) {
damageTotalMax = damageTotalMax + parseInt(spell1damageMax);
damageTotalMin = damageTotalMin + parseInt(spell1damageMin);
}
else {
damageTotalMax = damageTotalMax + parseInt(spell2damageMax);
damageTotalMin = damageTotalMin + parseInt(spell2damageMin);
}
// check if wizard is still alive
if (wizardHealth > damageTotalMax) {
turn++;
}
else {
return "<div class='simple-tooltip simple-tooltip-inline tooltipstered turnsToKill' data-simple-tooltip='<div style=&quot;text-align:center&quot;>Can be killed in <span style=&quot;font-style:strong&quot;>" + turn + "</span> turns (" + damageTotalMin + "-" + damageTotalMax + ")</div>'>" + turn + "</div>";
}
}
return "";
}
function addKillRoundCounter() {
var wizard1image = document.getElementById("wizard-1-image");
var wizard2image = document.getElementById("wizard-2-image");
var wizard3image = document.getElementById("wizard-3-image");
var wizard4image = document.getElementById("wizard-4-image");
var wizard5image = document.getElementById("wizard-5-image");
var wizard6image = document.getElementById("wizard-6-image");
wizard1image.insertAdjacentHTML('beforeend', canBeKilled(1));
wizard2image.insertAdjacentHTML('beforeend', canBeKilled(2));
wizard3image.insertAdjacentHTML('beforeend', canBeKilled(3));
wizard4image.insertAdjacentHTML('beforeend', canBeKilled(4));
wizard5image.insertAdjacentHTML('beforeend', canBeKilled(5));
wizard6image.insertAdjacentHTML('beforeend', canBeKilled(6));

var wizard1line1 = document.querySelector("#wizard-1-line-1 .baOppTblTurnsToKill");
var wizard1line2 = document.querySelector("#wizard-1-line-2 .baOppTblTurnsToKill");
var wizard1line3 = document.querySelector("#wizard-1-line-3 .baOppTblTurnsToKill");
var wizard2line1 = document.querySelector("#wizard-2-line-1 .baOppTblTurnsToKill");
var wizard2line2 = document.querySelector("#wizard-2-line-2 .baOppTblTurnsToKill");
var wizard2line3 = document.querySelector("#wizard-2-line-3 .baOppTblTurnsToKill");
var wizard3line1 = document.querySelector("#wizard-3-line-1 .baOppTblTurnsToKill");
var wizard3line2 = document.querySelector("#wizard-3-line-2 .baOppTblTurnsToKill");
var wizard3line3 = document.querySelector("#wizard-3-line-3 .baOppTblTurnsToKill");
var wizard4line1 = document.querySelector("#wizard-4-line-1 .baOppTblTurnsToKill");
var wizard4line2 = document.querySelector("#wizard-4-line-2 .baOppTblTurnsToKill");
var wizard4line3 = document.querySelector("#wizard-4-line-3 .baOppTblTurnsToKill");
var wizard5line1 = document.querySelector("#wizard-5-line-1 .baOppTblTurnsToKill");
var wizard5line2 = document.querySelector("#wizard-5-line-2 .baOppTblTurnsToKill");
var wizard5line3 = document.querySelector("#wizard-5-line-3 .baOppTblTurnsToKill");
var wizard6line1 = document.querySelector("#wizard-6-line-1 .baOppTblTurnsToKill");
var wizard6line2 = document.querySelector("#wizard-6-line-2 .baOppTblTurnsToKill");
var wizard6line3 = document.querySelector("#wizard-6-line-3 .baOppTblTurnsToKill");
wizard1line1.insertAdjacentHTML('beforeend', canBeKilled(4));
wizard1line2.insertAdjacentHTML('beforeend', canBeKilled(5));
wizard1line3.insertAdjacentHTML('beforeend', canBeKilled(6));
wizard2line1.insertAdjacentHTML('beforeend', canBeKilled(4));
wizard2line2.insertAdjacentHTML('beforeend', canBeKilled(5));
wizard2line3.insertAdjacentHTML('beforeend', canBeKilled(6));
wizard3line1.insertAdjacentHTML('beforeend', canBeKilled(4));
wizard3line2.insertAdjacentHTML('beforeend', canBeKilled(5));
wizard3line3.insertAdjacentHTML('beforeend', canBeKilled(6));
wizard4line1.insertAdjacentHTML('beforeend', canBeKilled(1));
wizard4line2.insertAdjacentHTML('beforeend', canBeKilled(2));
wizard4line3.insertAdjacentHTML('beforeend', canBeKilled(3));
wizard5line1.insertAdjacentHTML('beforeend', canBeKilled(1));
wizard5line2.insertAdjacentHTML('beforeend', canBeKilled(2));
wizard5line3.insertAdjacentHTML('beforeend', canBeKilled(3));
wizard6line1.insertAdjacentHTML('beforeend', canBeKilled(1));
wizard6line2.insertAdjacentHTML('beforeend', canBeKilled(2));
wizard6line3.insertAdjacentHTML('beforeend', canBeKilled(3));
}

Revision as of 09:23, 15 February 2024

/* Any JavaScript here will be loaded for all users on every page load. */


console.log("message55");

if (document.body.classList.contains("page-Battle_analyzer")) {
  changeBAnames();
  addAttributesToWizardDropdowns();
  displayCalculator(1);
  showTableLegend();
  if (document.getElementById("wizard-1-health")) {
      teamDamage();
      addKillRoundCounter();
  }
}
function changeBAnames() {
  document.getElementById("firstHeading").innerHTML = "<span dir='autoa' class='noselect'>Battle analyzer</span>";
  if (document.querySelector(".pf-runquery-formcontent > h2")) {
    document.querySelector(".pf-runquery-formcontent > h2").innerHTML = "<span class='noselect'>Edit teams</span>";
  }
}
function addAttributesToWizardDropdowns() {
  var inputId1 = document.getElementById("input_1");
  var inputId1rarity = document.getElementById("input_2");
  var inputId2 = document.getElementById("input_3");
  var inputId2rarity = document.getElementById("input_4");
  var inputId3 = document.getElementById("input_5");
  var inputId3rarity = document.getElementById("input_6");
  var inputId4 = document.getElementById("input_7");
  var inputId4rarity = document.getElementById("input_8");
  var inputId5 = document.getElementById("input_9");
  var inputId5rarity = document.getElementById("input_10");
  var inputId6 = document.getElementById("input_11");
  var inputId6rarity = document.getElementById("input_12");
  var inputShowOppTbl = document.getElementById("input_13");

  // replace underscore with empty space for Wizard names in Dropdowns
  const nodeList = document.querySelectorAll("#input_1 > option, #input_3 > option, #input_5 > option, #input_7 > option, #input_9 > option, #input_11 > option");
  for (var i = 0; i < nodeList.length; i++) {
    nodeList[i].innerHTML = nodeList[i].innerHTML.replaceAll('_',' ');
  };

  inputId1.setAttribute("required","");
  inputId1.classList.add(inputId1rarity.value);
  inputId1rarity.setAttribute("onchange","changeRarityClassDropdowns('input_1','input_2');");
  inputId1rarity.classList.add(inputId1rarity.value);
  inputId2.setAttribute("required","");
  inputId2.classList.add(inputId2rarity.value);
  inputId2rarity.setAttribute("onchange","changeRarityClassDropdowns('input_3','input_4');");
  inputId2rarity.classList.add(inputId2rarity.value);
  inputId3.setAttribute("required","");
  inputId3.classList.add(inputId3rarity.value);
  inputId3rarity.setAttribute("onchange","changeRarityClassDropdowns('input_5','input_6');");
  inputId3rarity.classList.add(inputId3rarity.value);
  inputId4.setAttribute("required","");
  inputId4.classList.add(inputId4rarity.value);
  inputId4rarity.setAttribute("onchange","changeRarityClassDropdowns('input_7','input_8');");
  inputId4rarity.classList.add(inputId4rarity.value);
  inputId5.setAttribute("required","");
  inputId5.classList.add(inputId5rarity.value);
  inputId5rarity.setAttribute("onchange","changeRarityClassDropdowns('input_9','input_10');");
  inputId5rarity.classList.add(inputId5rarity.value);
  inputId6.setAttribute("required","");
  inputId6.classList.add(inputId6rarity.value);
  inputId6rarity.setAttribute("onchange","changeRarityClassDropdowns('input_11','input_12');");
  inputId6rarity.classList.add(inputId6rarity.value);
  inputShowOppTbl.classList.add("Rare");
}
function changeRarityClassDropdowns(wizardInputId,wizardRarityId) {
  var wizardInput = document.getElementById(wizardInputId);
  var wizardRarity = document.getElementById(wizardRarityId);

  wizardInput.classList.remove("Rare");
  wizardInput.classList.remove("Epic");
  wizardInput.classList.remove("Legendary");
  wizardRarity.classList.remove("Rare");
  wizardRarity.classList.remove("Epic");
  wizardRarity.classList.remove("Legendary");
  wizardInput.classList.add(wizardRarity.value);
  wizardRarity.classList.add(wizardRarity.value);
}
function teamDamage() {
  var wizard1line1 = document.getElementById("wizard-1-line-1");
  var wizard1line1spell1 = document.getElementById("wizard-1-line-1-spell-1");
  var wizard1line1spell2 = document.getElementById("wizard-1-line-1-spell-2");
  var wizard1line2 = document.getElementById("wizard-1-line-2");
  var wizard1line2spell1 = document.getElementById("wizard-1-line-2-spell-1");
  var wizard1line2spell2 = document.getElementById("wizard-1-line-2-spell-2");
  var wizard1line3 = document.getElementById("wizard-1-line-3");
  var wizard1line3spell1 = document.getElementById("wizard-1-line-3-spell-1");
  var wizard1line3spell2 = document.getElementById("wizard-1-line-3-spell-2");
  var wizard2line1 = document.getElementById("wizard-2-line-1");
  var wizard2line1spell1 = document.getElementById("wizard-2-line-1-spell-1");
  var wizard2line1spell2 = document.getElementById("wizard-2-line-1-spell-2");
  var wizard2line2 = document.getElementById("wizard-2-line-2");
  var wizard2line2spell1 = document.getElementById("wizard-2-line-2-spell-1");
  var wizard2line2spell2 = document.getElementById("wizard-2-line-2-spell-2");
  var wizard2line3 = document.getElementById("wizard-2-line-3");
  var wizard2line3spell1 = document.getElementById("wizard-2-line-3-spell-1");
  var wizard2line3spell2 = document.getElementById("wizard-2-line-3-spell-2");
  var wizard3line1 = document.getElementById("wizard-3-line-1");
  var wizard3line1spell1 = document.getElementById("wizard-3-line-1-spell-1");
  var wizard3line1spell2 = document.getElementById("wizard-3-line-1-spell-2");
  var wizard3line2 = document.getElementById("wizard-3-line-2");
  var wizard3line2spell1 = document.getElementById("wizard-3-line-2-spell-1");
  var wizard3line2spell2 = document.getElementById("wizard-3-line-2-spell-2");
  var wizard3line3 = document.getElementById("wizard-3-line-3");
  var wizard3line3spell1 = document.getElementById("wizard-3-line-3-spell-1");
  var wizard3line3spell2 = document.getElementById("wizard-3-line-3-spell-2");
  var wizard4line1 = document.getElementById("wizard-4-line-1");
  var wizard4line1spell1 = document.getElementById("wizard-4-line-1-spell-1");
  var wizard4line1spell2 = document.getElementById("wizard-4-line-1-spell-2");
  var wizard4line2 = document.getElementById("wizard-4-line-2");
  var wizard4line2spell1 = document.getElementById("wizard-4-line-2-spell-1");
  var wizard4line2spell2 = document.getElementById("wizard-4-line-2-spell-2");
  var wizard4line3 = document.getElementById("wizard-4-line-3");
  var wizard4line3spell1 = document.getElementById("wizard-4-line-3-spell-1");
  var wizard4line3spell2 = document.getElementById("wizard-4-line-3-spell-2");
  var wizard5line1 = document.getElementById("wizard-5-line-1");
  var wizard5line1spell1 = document.getElementById("wizard-5-line-1-spell-1");
  var wizard5line1spell2 = document.getElementById("wizard-5-line-1-spell-2");
  var wizard5line2 = document.getElementById("wizard-5-line-2");
  var wizard5line2spell1 = document.getElementById("wizard-5-line-2-spell-1");
  var wizard5line2spell2 = document.getElementById("wizard-5-line-2-spell-2");
  var wizard5line3 = document.getElementById("wizard-5-line-3");
  var wizard5line3spell1 = document.getElementById("wizard-5-line-3-spell-1");
  var wizard5line3spell2 = document.getElementById("wizard-5-line-3-spell-2");
  var wizard6line1 = document.getElementById("wizard-6-line-1");
  var wizard6line1spell1 = document.getElementById("wizard-6-line-1-spell-1");
  var wizard6line1spell2 = document.getElementById("wizard-6-line-1-spell-2");
  var wizard6line2 = document.getElementById("wizard-6-line-2");
  var wizard6line2spell1 = document.getElementById("wizard-6-line-2-spell-1");
  var wizard6line2spell2 = document.getElementById("wizard-6-line-2-spell-2");
  var wizard6line3 = document.getElementById("wizard-6-line-3");
  var wizard6line3spell1 = document.getElementById("wizard-6-line-3-spell-1");
  var wizard6line3spell2 = document.getElementById("wizard-6-line-3-spell-2");

  var wizard1name = document.getElementById("wizard-1-name").innerHTML;
  var wizard1rarity = document.getElementById("wizard-1-name").className;
  var wizard1affinity = document.getElementById("wizard-1-affinity").innerHTML;
  var wizard1spell1name = document.getElementById("wizard-1-spell-1-name").innerHTML.replace(/'/g, '\&apos;');
  var wizard1spell1type = document.getElementById("wizard-1-spell-1-type").innerHTML;
  var wizard1spell1targets = document.getElementById("wizard-1-spell-1-targets").innerHTML;
  var wizard1spell1cost = document.getElementById("wizard-1-spell-1-cost").innerHTML;
  var wizard1spell1value = document.getElementById("wizard-1-spell-1-value").innerHTML;
  var wizard1spell2name = document.getElementById("wizard-1-spell-2-name").innerHTML.replace(/'/g, '\&apos;');
  var wizard1spell2type = document.getElementById("wizard-1-spell-2-type").innerHTML;
  var wizard1spell2targets = document.getElementById("wizard-1-spell-2-targets").innerHTML;
  var wizard1spell2cost = document.getElementById("wizard-1-spell-2-cost").innerHTML;
  var wizard1spell2value = document.getElementById("wizard-1-spell-2-value").innerHTML;

  var wizard2name = document.getElementById("wizard-2-name").innerHTML;
  var wizard2rarity = document.getElementById("wizard-2-name").className;
  var wizard2affinity = document.getElementById("wizard-2-affinity").innerHTML;
  var wizard2spell1name = document.getElementById("wizard-2-spell-1-name").innerHTML.replace(/'/g, '\&apos;');
  var wizard2spell1type = document.getElementById("wizard-2-spell-1-type").innerHTML;
  var wizard2spell1targets = document.getElementById("wizard-2-spell-1-targets").innerHTML;
  var wizard2spell1cost = document.getElementById("wizard-2-spell-1-cost").innerHTML;
  var wizard2spell1value = document.getElementById("wizard-2-spell-1-value").innerHTML;
  var wizard2spell2name = document.getElementById("wizard-2-spell-2-name").innerHTML.replace(/'/g, '\&apos;');
  var wizard2spell2type = document.getElementById("wizard-2-spell-2-type").innerHTML;
  var wizard2spell2targets = document.getElementById("wizard-2-spell-2-targets").innerHTML;
  var wizard2spell2cost = document.getElementById("wizard-2-spell-2-cost").innerHTML;
  var wizard2spell2value = document.getElementById("wizard-2-spell-2-value").innerHTML;

  var wizard3name = document.getElementById("wizard-3-name").innerHTML;
  var wizard3rarity = document.getElementById("wizard-3-name").className;
  var wizard3affinity = document.getElementById("wizard-3-affinity").innerHTML;
  var wizard3spell1name = document.getElementById("wizard-3-spell-1-name").innerHTML.replace(/'/g, '\&apos;');
  var wizard3spell1type = document.getElementById("wizard-3-spell-1-type").innerHTML;
  var wizard3spell1targets = document.getElementById("wizard-3-spell-1-targets").innerHTML;
  var wizard3spell1cost = document.getElementById("wizard-3-spell-1-cost").innerHTML;
  var wizard3spell1value = document.getElementById("wizard-3-spell-1-value").innerHTML;
  var wizard3spell2name = document.getElementById("wizard-3-spell-2-name").innerHTML.replace(/'/g, '\&apos;');
  var wizard3spell2type = document.getElementById("wizard-3-spell-2-type").innerHTML;
  var wizard3spell2targets = document.getElementById("wizard-3-spell-2-targets").innerHTML;
  var wizard3spell2cost = document.getElementById("wizard-3-spell-2-cost").innerHTML;
  var wizard3spell2value = document.getElementById("wizard-3-spell-2-value").innerHTML;

  var wizard4name = document.getElementById("wizard-4-name").innerHTML;
  var wizard4rarity = document.getElementById("wizard-4-name").className;
  var wizard4affinity = document.getElementById("wizard-4-affinity").innerHTML;
  var wizard4spell1name = document.getElementById("wizard-4-spell-1-name").innerHTML.replace(/'/g, '\&apos;');
  var wizard4spell1type = document.getElementById("wizard-4-spell-1-type").innerHTML;
  var wizard4spell1targets = document.getElementById("wizard-4-spell-1-targets").innerHTML;
  var wizard4spell1cost = document.getElementById("wizard-4-spell-1-cost").innerHTML;
  var wizard4spell1value = document.getElementById("wizard-4-spell-1-value").innerHTML;
  var wizard4spell2name = document.getElementById("wizard-4-spell-2-name").innerHTML.replace(/'/g, '\&apos;');
  var wizard4spell2type = document.getElementById("wizard-4-spell-2-type").innerHTML;
  var wizard4spell2targets = document.getElementById("wizard-4-spell-2-targets").innerHTML;
  var wizard4spell2cost = document.getElementById("wizard-4-spell-2-cost").innerHTML;
  var wizard4spell2value = document.getElementById("wizard-4-spell-2-value").innerHTML;

  var wizard5name = document.getElementById("wizard-5-name").innerHTML;
  var wizard5rarity = document.getElementById("wizard-5-name").className;
  var wizard5affinity = document.getElementById("wizard-5-affinity").innerHTML;
  var wizard5spell1name = document.getElementById("wizard-5-spell-1-name").innerHTML.replace(/'/g, '\&apos;');
  var wizard5spell1type = document.getElementById("wizard-5-spell-1-type").innerHTML;
  var wizard5spell1targets = document.getElementById("wizard-5-spell-1-targets").innerHTML;
  var wizard5spell1cost = document.getElementById("wizard-5-spell-1-cost").innerHTML;
  var wizard5spell1value = document.getElementById("wizard-5-spell-1-value").innerHTML;
  var wizard5spell2name = document.getElementById("wizard-5-spell-2-name").innerHTML.replace(/'/g, '\&apos;');
  var wizard5spell2type = document.getElementById("wizard-5-spell-2-type").innerHTML;
  var wizard5spell2targets = document.getElementById("wizard-5-spell-2-targets").innerHTML;
  var wizard5spell2cost = document.getElementById("wizard-5-spell-2-cost").innerHTML;
  var wizard5spell2value = document.getElementById("wizard-5-spell-2-value").innerHTML;

  var wizard6name = document.getElementById("wizard-6-name").innerHTML;
  var wizard6rarity = document.getElementById("wizard-6-name").className;
  var wizard6affinity = document.getElementById("wizard-6-affinity").innerHTML;
  var wizard6spell1name = document.getElementById("wizard-6-spell-1-name").innerHTML.replace(/'/g, '\&apos;');
  var wizard6spell1type = document.getElementById("wizard-6-spell-1-type").innerHTML;
  var wizard6spell1targets = document.getElementById("wizard-6-spell-1-targets").innerHTML;
  var wizard6spell1cost = document.getElementById("wizard-6-spell-1-cost").innerHTML;
  var wizard6spell1value = document.getElementById("wizard-6-spell-1-value").innerHTML;
  var wizard6spell2name = document.getElementById("wizard-6-spell-2-name").innerHTML.replace(/'/g, '\&apos;');
  var wizard6spell2type = document.getElementById("wizard-6-spell-2-type").innerHTML;
  var wizard6spell2targets = document.getElementById("wizard-6-spell-2-targets").innerHTML;
  var wizard6spell2cost = document.getElementById("wizard-6-spell-2-cost").innerHTML;
  var wizard6spell2value = document.getElementById("wizard-6-spell-2-value").innerHTML;

  var wizard1image = document.getElementById("wizard-1-image");
  var wizard2image = document.getElementById("wizard-2-image");
  var wizard3image = document.getElementById("wizard-3-image");
  var wizard4image = document.getElementById("wizard-4-image");
  var wizard5image = document.getElementById("wizard-5-image");
  var wizard6image = document.getElementById("wizard-6-image");
  wizard1image.innerHTML = wizardImage(wizard1name,wizard1rarity,'','100%','Your');
  wizard2image.innerHTML = wizardImage(wizard2name,wizard2rarity,'','100%','Your');
  wizard3image.innerHTML = wizardImage(wizard3name,wizard3rarity,'','100%','Your');
  wizard4image.innerHTML = wizardImage(wizard4name,wizard4rarity,'','100%','Your');
  wizard5image.innerHTML = wizardImage(wizard5name,wizard5rarity,'','100%','Your');
  wizard6image.innerHTML = wizardImage(wizard6name,wizard6rarity,'','100%','Your');

  var wizard1health = document.getElementById("wizard-1-health").innerHTML;
  var wizard2health = document.getElementById("wizard-2-health").innerHTML;
  var wizard3health = document.getElementById("wizard-3-health").innerHTML;
  var wizard4health = document.getElementById("wizard-4-health").innerHTML;
  var wizard5health = document.getElementById("wizard-5-health").innerHTML;
  var wizard6health = document.getElementById("wizard-6-health").innerHTML;

  var healthIconImage = "<img alt='Health' src='//static.miraheze.org/wizardiawiki/1/1f/Health.svg' decoding='async' width='16' height='16' style='vertical-align: text-top;'> ";
  var wizard1healthIcon = document.getElementById("wizard-1-healthIcon");
  var wizard2healthIcon = document.getElementById("wizard-2-healthIcon");
  var wizard3healthIcon = document.getElementById("wizard-3-healthIcon");
  var wizard4healthIcon = document.getElementById("wizard-4-healthIcon");
  var wizard5healthIcon = document.getElementById("wizard-5-healthIcon");
  var wizard6healthIcon = document.getElementById("wizard-6-healthIcon");
  wizard1healthIcon.innerHTML = healthIconImage;
  wizard2healthIcon.innerHTML = healthIconImage;
  wizard3healthIcon.innerHTML = healthIconImage;
  wizard4healthIcon.innerHTML = healthIconImage;
  wizard5healthIcon.innerHTML = healthIconImage;
  wizard6healthIcon.innerHTML = healthIconImage;

  var wizard1speciality = document.getElementById("wizard-1-speciality");
  var wizard2speciality = document.getElementById("wizard-2-speciality");
  var wizard3speciality = document.getElementById("wizard-3-speciality");
  var wizard4speciality = document.getElementById("wizard-4-speciality");
  var wizard5speciality = document.getElementById("wizard-5-speciality");
  var wizard6speciality = document.getElementById("wizard-6-speciality");
  wizard1speciality.innerHTML = whatSpeciality(wizard1spell1type,wizard1spell1targets,wizard1spell2type,wizard1spell2targets);
  wizard2speciality.innerHTML = whatSpeciality(wizard2spell1type,wizard2spell1targets,wizard2spell2type,wizard2spell2targets);
  wizard3speciality.innerHTML = whatSpeciality(wizard3spell1type,wizard3spell1targets,wizard3spell2type,wizard3spell2targets);
  wizard4speciality.innerHTML = whatSpeciality(wizard4spell1type,wizard4spell1targets,wizard4spell2type,wizard4spell2targets);
  wizard5speciality.innerHTML = whatSpeciality(wizard5spell1type,wizard5spell1targets,wizard5spell2type,wizard5spell2targets);
  wizard6speciality.innerHTML = whatSpeciality(wizard6spell1type,wizard6spell1targets,wizard6spell2type,wizard6spell2targets);

  var tooltipTargetsIcon = "<img alt=&quot;Targets&quot; src=&quot;//static.miraheze.org/wizardiawiki/b/ba/Targets.svg&quot; decoding=&quot;async&quot; width=&quot;12&quot; height=&quot;13&quot; style=&quot;vertical-align: text-top&quot;>";
  var tooltipManaIcon = "<img alt=&quot;Mana&quot; src=&quot;//static.miraheze.org/wizardiawiki/f/f3/Mana.svg&quot; decoding=&quot;async&quot; width=&quot;14&quot; height=&quot;13&quot; style=&quot;vertical-align: text-top&quot;>";
  var tooltipDamageIcon = "<img alt=&quot;Damage&quot; src=&quot;//static.miraheze.org/wizardiawiki/f/f3/Damage.svg&quot; decoding=&quot;async&quot; width=&quot;15&quot; height=&quot;13&quot; style=&quot;vertical-align: text-top&quot;>";

  wizard1line1.innerHTML = wizardImage(wizard4name,wizard4rarity,'60px','','Opponent') + wizard4name + " <span class='baOppTblHealth'>(" + wizard4health + ")</span> <div class='baOppTblSpeciality'>" + wizard4speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell1name + "<br />" + tooltipTargetsIcon + " " + wizard4spell1targets + " " + tooltipManaIcon + " " + wizard4spell1cost + " " + tooltipDamageIcon + " " + wizard4spell1value + "</p>'>" + displayDamage(wizard4affinity,wizard1affinity,wizard4spell1type,wizard4spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell2name + "<br />" + tooltipTargetsIcon + " " + wizard4spell2targets + " " + tooltipManaIcon + " " + wizard4spell2cost + " " + tooltipDamageIcon + " " + wizard4spell2value + "</p>'>" + displayDamage(wizard4affinity,wizard1affinity,wizard4spell2type,wizard4spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
  wizard1line1.classList.add(wizard4rarity);
  wizard1line1spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell1name + "<br />" + tooltipTargetsIcon + " " + wizard1spell1targets + " " + tooltipManaIcon + " " + wizard1spell1cost + " " + tooltipDamageIcon + " " + wizard1spell1value + "</p>'>" + displayDamage(wizard1affinity,wizard4affinity,wizard1spell1type,wizard1spell1value) + "</div>";
  wizard1line1spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell2name + "<br />" + tooltipTargetsIcon + " " + wizard1spell2targets + " " + tooltipManaIcon + " " + wizard1spell2cost + " " + tooltipDamageIcon + " " + wizard1spell2value + "</p>'>" + displayDamage(wizard1affinity,wizard4affinity,wizard1spell2type,wizard1spell2value) + "</div>";

  wizard1line2.innerHTML = wizardImage(wizard5name,wizard5rarity,'60px','','Opponent') + wizard5name + " <span class='baOppTblHealth'>(" + wizard5health + ")</span> <div class='baOppTblSpeciality'>" + wizard5speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell1name + "<br />" + tooltipTargetsIcon + " " + wizard5spell1targets + " " + tooltipManaIcon + " " + wizard5spell1cost + " " + tooltipDamageIcon + " " + wizard5spell1value + "</p>'>" + displayDamage(wizard5affinity,wizard1affinity,wizard5spell1type,wizard5spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell2name + "<br />" + tooltipTargetsIcon + " " + wizard5spell2targets + " " + tooltipManaIcon + " " + wizard5spell2cost + " " + tooltipDamageIcon + " " + wizard5spell2value + "</p>'>" + displayDamage(wizard5affinity,wizard1affinity,wizard5spell2type,wizard5spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
  wizard1line2.classList.add(wizard5rarity);
  wizard1line2spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell1name + "<br />" + tooltipTargetsIcon + " " + wizard1spell1targets + " " + tooltipManaIcon + " " + wizard1spell1cost + " " + tooltipDamageIcon + " " + wizard1spell1value + "</p>'>" + displayDamage(wizard1affinity,wizard5affinity,wizard1spell1type,wizard1spell1value) + "</div>";
  wizard1line2spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell2name + "<br />" + tooltipTargetsIcon + " " + wizard1spell2targets + " " + tooltipManaIcon + " " + wizard1spell2cost + " " + tooltipDamageIcon + " " + wizard1spell2value + "</p>'>" + displayDamage(wizard1affinity,wizard5affinity,wizard1spell2type,wizard1spell2value) + "</div>";

  wizard1line3.innerHTML = wizardImage(wizard6name,wizard6rarity,'60px','','Opponent') + wizard6name + " <span class='baOppTblHealth'>(" + wizard6health + ")</span> <div class='baOppTblSpeciality'>" + wizard6speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell1name + "<br />" + tooltipTargetsIcon + " " + wizard6spell1targets + " " + tooltipManaIcon + " " + wizard6spell1cost + " " + tooltipDamageIcon + " " + wizard6spell1value + "</p>'>" + displayDamage(wizard6affinity,wizard1affinity,wizard6spell1type,wizard6spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell2name + "<br />" + tooltipTargetsIcon + " " + wizard6spell2targets + " " + tooltipManaIcon + " " + wizard6spell2cost + " " + tooltipDamageIcon + " " + wizard6spell2value + "</p>'>" + displayDamage(wizard6affinity,wizard1affinity,wizard6spell2type,wizard6spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
  wizard1line3.classList.add(wizard6rarity);
  wizard1line3spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell1name + "<br />" + tooltipTargetsIcon + " " + wizard1spell1targets + " " + tooltipManaIcon + " " + wizard1spell1cost + " " + tooltipDamageIcon + " " + wizard1spell1value + "</p>'>" + displayDamage(wizard1affinity,wizard6affinity,wizard1spell1type,wizard1spell1value) + "</div>";
  wizard1line3spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell2name + "<br />" + tooltipTargetsIcon + " " + wizard1spell2targets + " " + tooltipManaIcon + " " + wizard1spell2cost + " " + tooltipDamageIcon + " " + wizard1spell2value + "</p>'>" + displayDamage(wizard1affinity,wizard6affinity,wizard1spell2type,wizard1spell2value) + "</div>";

  wizard2line1.innerHTML = wizardImage(wizard4name,wizard4rarity,'60px','','Opponent') + wizard4name + " <span class='baOppTblHealth'>(" + wizard4health + ")</span> <div class='baOppTblSpeciality'>" + wizard4speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell1name + "<br />" + tooltipTargetsIcon + " " + wizard4spell1targets + " " + tooltipManaIcon + " " + wizard4spell1cost + " " + tooltipDamageIcon + " " + wizard4spell1value + "</p>'>" + displayDamage(wizard4affinity,wizard2affinity,wizard4spell1type,wizard4spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell2name + "<br />" + tooltipTargetsIcon + " " + wizard4spell2targets + " " + tooltipManaIcon + " " + wizard4spell2cost + " " + tooltipDamageIcon + " " + wizard4spell2value + "</p>'>" + displayDamage(wizard4affinity,wizard2affinity,wizard4spell2type,wizard4spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
  wizard2line1.classList.add(wizard4rarity);
  wizard2line1spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell1name + "<br />" + tooltipTargetsIcon + " " + wizard2spell1targets + " " + tooltipManaIcon + " " + wizard2spell1cost + " " + tooltipDamageIcon + " " + wizard2spell1value + "</p>'>" + displayDamage(wizard2affinity,wizard4affinity,wizard2spell1type,wizard2spell1value) + "</div>";
  wizard2line1spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell2name + "<br />" + tooltipTargetsIcon + " " + wizard2spell2targets + " " + tooltipManaIcon + " " + wizard2spell2cost + " " + tooltipDamageIcon + " " + wizard2spell2value + "</p>'>" + displayDamage(wizard2affinity,wizard4affinity,wizard2spell2type,wizard2spell2value) + "</div>";

  wizard2line2.innerHTML = wizardImage(wizard5name,wizard5rarity,'60px','','Opponent') + wizard5name + " <span class='baOppTblHealth'>(" + wizard5health + ")</span> <div class='baOppTblSpeciality'>" + wizard5speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell1name + "<br />" + tooltipTargetsIcon + " " + wizard5spell1targets + " " + tooltipManaIcon + " " + wizard5spell1cost + " " + tooltipDamageIcon + " " + wizard5spell1value + "</p>'>" + displayDamage(wizard5affinity,wizard2affinity,wizard5spell1type,wizard5spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell2name + "<br />" + tooltipTargetsIcon + " " + wizard5spell2targets + " " + tooltipManaIcon + " " + wizard5spell2cost + " " + tooltipDamageIcon + " " + wizard5spell2value + "</p>'>" + displayDamage(wizard5affinity,wizard2affinity,wizard5spell2type,wizard5spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
  wizard2line2.classList.add(wizard5rarity);
  wizard2line2spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell1name + "<br />" + tooltipTargetsIcon + " " + wizard2spell1targets + " " + tooltipManaIcon + " " + wizard2spell1cost + " " + tooltipDamageIcon + " " + wizard2spell1value + "</p>'>" + displayDamage(wizard2affinity,wizard5affinity,wizard2spell1type,wizard2spell1value) + "</div>";
  wizard2line2spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell2name + "<br />" + tooltipTargetsIcon + " " + wizard2spell2targets + " " + tooltipManaIcon + " " + wizard2spell2cost + " " + tooltipDamageIcon + " " + wizard2spell2value + "</p>'>" + displayDamage(wizard2affinity,wizard5affinity,wizard2spell2type,wizard2spell2value) + "</div>";

  wizard2line3.innerHTML = wizardImage(wizard6name,wizard6rarity,'60px','','Opponent') + wizard6name + " <span class='baOppTblHealth'>(" + wizard6health + ")</span> <div class='baOppTblSpeciality'>" + wizard6speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell1name + "<br />" + tooltipTargetsIcon + " " + wizard6spell1targets + " " + tooltipManaIcon + " " + wizard6spell1cost + " " + tooltipDamageIcon + " " + wizard6spell1value + "</p>'>" + displayDamage(wizard6affinity,wizard2affinity,wizard6spell1type,wizard6spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell2name + "<br />" + tooltipTargetsIcon + " " + wizard6spell2targets + " " + tooltipManaIcon + " " + wizard6spell2cost + " " + tooltipDamageIcon + " " + wizard6spell2value + "</p>'>" + displayDamage(wizard6affinity,wizard2affinity,wizard6spell2type,wizard6spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
  wizard2line3.classList.add(wizard6rarity);
  wizard2line3spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell1name + "<br />" + tooltipTargetsIcon + " " + wizard2spell1targets + " " + tooltipManaIcon + " " + wizard2spell1cost + " " + tooltipDamageIcon + " " + wizard2spell1value + "</p>'>" + displayDamage(wizard2affinity,wizard6affinity,wizard2spell1type,wizard2spell1value) + "</div>";
  wizard2line3spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell2name + "<br />" + tooltipTargetsIcon + " " + wizard2spell2targets + " " + tooltipManaIcon + " " + wizard2spell2cost + " " + tooltipDamageIcon + " " + wizard2spell2value + "</p>'>" + displayDamage(wizard2affinity,wizard6affinity,wizard2spell2type,wizard2spell2value) + "</div>";

  wizard3line1.innerHTML = wizardImage(wizard4name,wizard4rarity,'60px','','Opponent') + wizard4name + " <span class='baOppTblHealth'>(" + wizard4health + ")</span> <div class='baOppTblSpeciality'>" + wizard4speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell1name + "<br />" + tooltipTargetsIcon + " " + wizard4spell1targets + " " + tooltipManaIcon + " " + wizard4spell1cost + " " + tooltipDamageIcon + " " + wizard4spell1value + "</p>'>" + displayDamage(wizard4affinity,wizard3affinity,wizard4spell1type,wizard4spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell2name + "<br />" + tooltipTargetsIcon + " " + wizard4spell2targets + " " + tooltipManaIcon + " " + wizard4spell2cost + " " + tooltipDamageIcon + " " + wizard4spell2value + "</p>'>" + displayDamage(wizard4affinity,wizard3affinity,wizard4spell2type,wizard4spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
  wizard3line1.classList.add(wizard4rarity);
  wizard3line1spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell1name + "<br />" + tooltipTargetsIcon + " " + wizard3spell1targets + " " + tooltipManaIcon + " " + wizard3spell1cost + " " + tooltipDamageIcon + " " + wizard3spell1value + "</p>'>" + displayDamage(wizard3affinity,wizard4affinity,wizard3spell1type,wizard3spell1value) + "</div>";
  wizard3line1spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell2name + "<br />" + tooltipTargetsIcon + " " + wizard3spell2targets + " " + tooltipManaIcon + " " + wizard3spell2cost + " " + tooltipDamageIcon + " " + wizard3spell2value + "</p>'>" + displayDamage(wizard3affinity,wizard4affinity,wizard3spell2type,wizard3spell2value) + "</div>";

  wizard3line2.innerHTML = wizardImage(wizard5name,wizard5rarity,'60px','','Opponent') + wizard5name + " <span class='baOppTblHealth'>(" + wizard5health + ")</span> <div class='baOppTblSpeciality'>" + wizard5speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell1name + "<br />" + tooltipTargetsIcon + " " + wizard5spell1targets + " " + tooltipManaIcon + " " + wizard5spell1cost + " " + tooltipDamageIcon + " " + wizard5spell1value + "</p>'>" + displayDamage(wizard5affinity,wizard3affinity,wizard5spell1type,wizard5spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell2name + "<br />" + tooltipTargetsIcon + " " + wizard5spell2targets + " " + tooltipManaIcon + " " + wizard5spell2cost + " " + tooltipDamageIcon + " " + wizard5spell2value + "</p>'>" + displayDamage(wizard5affinity,wizard3affinity,wizard5spell2type,wizard5spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
  wizard3line2.classList.add(wizard5rarity);
  wizard3line2spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell1name + "<br />" + tooltipTargetsIcon + " " + wizard3spell1targets + " " + tooltipManaIcon + " " + wizard3spell1cost + " " + tooltipDamageIcon + " " + wizard3spell1value + "</p>'>" + displayDamage(wizard3affinity,wizard5affinity,wizard3spell1type,wizard3spell1value) + "</div>";
  wizard3line2spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell2name + "<br />" + tooltipTargetsIcon + " " + wizard3spell2targets + " " + tooltipManaIcon + " " + wizard3spell2cost + " " + tooltipDamageIcon + " " + wizard3spell2value + "</p>'>" + displayDamage(wizard3affinity,wizard5affinity,wizard3spell2type,wizard3spell2value) + "</div>";

  wizard3line3.innerHTML = wizardImage(wizard6name,wizard6rarity,'60px','','Opponent') + wizard6name + " <span class='baOppTblHealth'>(" + wizard6health + ")</span> <div class='baOppTblSpeciality'>" + wizard6speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell1name + "<br />" + tooltipTargetsIcon + " " + wizard6spell1targets + " " + tooltipManaIcon + " " + wizard6spell1cost + " " + tooltipDamageIcon + " " + wizard6spell1value + "</p>'>" + displayDamage(wizard6affinity,wizard3affinity,wizard6spell1type,wizard6spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell2name + "<br />" + tooltipTargetsIcon + " " + wizard6spell2targets + " " + tooltipManaIcon + " " + wizard6spell2cost + " " + tooltipDamageIcon + " " + wizard6spell2value + "</p>'>" + displayDamage(wizard6affinity,wizard3affinity,wizard6spell2type,wizard6spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
  wizard3line3.classList.add(wizard6rarity);
  wizard3line3spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell1name + "<br />" + tooltipTargetsIcon + " " + wizard3spell1targets + " " + tooltipManaIcon + " " + wizard3spell1cost + " " + tooltipDamageIcon + " " + wizard3spell1value + "</p>'>" + displayDamage(wizard3affinity,wizard6affinity,wizard3spell1type,wizard3spell1value) + "</div>";
  wizard3line3spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell2name + "<br />" + tooltipTargetsIcon + " " + wizard3spell2targets + " " + tooltipManaIcon + " " + wizard3spell2cost + " " + tooltipDamageIcon + " " + wizard3spell2value + "</p>'>" + displayDamage(wizard3affinity,wizard6affinity,wizard3spell2type,wizard3spell2value) + "</div>";

  wizard4line1.innerHTML = wizardImage(wizard1name,wizard1rarity,'60px','','Opponent') + wizard1name + " <span class='baOppTblHealth'>(" + wizard1health + ")</span> <div class='baOppTblSpeciality'>" + wizard1speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell1name + "<br />" + tooltipTargetsIcon + " " + wizard1spell1targets + " " + tooltipManaIcon + " " + wizard1spell1cost + " " + tooltipDamageIcon + " " + wizard1spell1value + "</p>'>" + displayDamage(wizard1affinity,wizard4affinity,wizard1spell1type,wizard1spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell2name + "<br />" + tooltipTargetsIcon + " " + wizard1spell2targets + " " + tooltipManaIcon + " " + wizard1spell2cost + " " + tooltipDamageIcon + " " + wizard1spell2value + "</p>'>" + displayDamage(wizard1affinity,wizard4affinity,wizard1spell2type,wizard1spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
  wizard4line1.classList.add(wizard1rarity);
  wizard4line1spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell1name + "<br />" + tooltipTargetsIcon + " " + wizard4spell1targets + " " + tooltipManaIcon + " " + wizard4spell1cost + " " + tooltipDamageIcon + " " + wizard4spell1value + "</p>'>" + displayDamage(wizard4affinity,wizard1affinity,wizard4spell1type,wizard4spell1value) + "</div>";
  wizard4line1spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell2name + "<br />" + tooltipTargetsIcon + " " + wizard4spell2targets + " " + tooltipManaIcon + " " + wizard4spell2cost + " " + tooltipDamageIcon + " " + wizard4spell2value + "</p>'>" + displayDamage(wizard4affinity,wizard1affinity,wizard4spell2type,wizard4spell2value) + "</div>";

  wizard4line2.innerHTML = wizardImage(wizard2name,wizard2rarity,'60px','','Opponent') + wizard2name + " <span class='baOppTblHealth'>(" + wizard2health + ")</span> <div class='baOppTblSpeciality'>" + wizard2speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell1name + "<br />" + tooltipTargetsIcon + " " + wizard2spell1targets + " " + tooltipManaIcon + " " + wizard2spell1cost + " " + tooltipDamageIcon + " " + wizard2spell1value + "</p>'>" + displayDamage(wizard2affinity,wizard4affinity,wizard2spell1type,wizard2spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell2name + "<br />" + tooltipTargetsIcon + " " + wizard2spell2targets + " " + tooltipManaIcon + " " + wizard2spell2cost + " " + tooltipDamageIcon + " " + wizard2spell2value + "</p>'>" + displayDamage(wizard2affinity,wizard4affinity,wizard2spell2type,wizard2spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
  wizard4line2.classList.add(wizard2rarity);
  wizard4line2spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell1name + "<br />" + tooltipTargetsIcon + " " + wizard4spell1targets + " " + tooltipManaIcon + " " + wizard4spell1cost + " " + tooltipDamageIcon + " " + wizard4spell1value + "</p>'>" + displayDamage(wizard4affinity,wizard2affinity,wizard4spell1type,wizard4spell1value) + "</div>";
  wizard4line2spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell2name + "<br />" + tooltipTargetsIcon + " " + wizard4spell2targets + " " + tooltipManaIcon + " " + wizard4spell2cost + " " + tooltipDamageIcon + " " + wizard4spell2value + "</p>'>" + displayDamage(wizard4affinity,wizard2affinity,wizard4spell2type,wizard4spell2value) + "</div>";

  wizard4line3.innerHTML = wizardImage(wizard3name,wizard3rarity,'60px','','Opponent') + wizard3name + " <span class='baOppTblHealth'>(" + wizard3health + ")</span> <div class='baOppTblSpeciality'>" + wizard3speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell1name + "<br />" + tooltipTargetsIcon + " " + wizard3spell1targets + " " + tooltipManaIcon + " " + wizard3spell1cost + " " + tooltipDamageIcon + " " + wizard3spell1value + "</p>'>" + displayDamage(wizard3affinity,wizard4affinity,wizard3spell1type,wizard3spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell2name + "<br />" + tooltipTargetsIcon + " " + wizard3spell2targets + " " + tooltipManaIcon + " " + wizard3spell2cost + " " + tooltipDamageIcon + " " + wizard3spell2value + "</p>'>" + displayDamage(wizard3affinity,wizard4affinity,wizard3spell2type,wizard3spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
  wizard4line3.classList.add(wizard3rarity);
  wizard4line3spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell1name + "<br />" + tooltipTargetsIcon + " " + wizard4spell1targets + " " + tooltipManaIcon + " " + wizard4spell1cost + " " + tooltipDamageIcon + " " + wizard4spell1value + "</p>'>" + displayDamage(wizard4affinity,wizard3affinity,wizard4spell1type,wizard4spell1value) + "</div>";
  wizard4line3spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard4spell2name + "<br />" + tooltipTargetsIcon + " " + wizard4spell2targets + " " + tooltipManaIcon + " " + wizard4spell2cost + " " + tooltipDamageIcon + " " + wizard4spell2value + "</p>'>" + displayDamage(wizard4affinity,wizard3affinity,wizard4spell2type,wizard4spell2value) + "</div>";

  wizard5line1.innerHTML = wizardImage(wizard1name,wizard1rarity,'60px','','Opponent') + wizard1name + " <span class='baOppTblHealth'>(" + wizard1health + ")</span> <div class='baOppTblSpeciality'>" + wizard1speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell1name + "<br />" + tooltipTargetsIcon + " " + wizard1spell1targets + " " + tooltipManaIcon + " " + wizard1spell1cost + " " + tooltipDamageIcon + " " + wizard1spell1value + "</p>'>" + displayDamage(wizard1affinity,wizard5affinity,wizard1spell1type,wizard1spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell2name + "<br />" + tooltipTargetsIcon + " " + wizard1spell2targets + " " + tooltipManaIcon + " " + wizard1spell2cost + " " + tooltipDamageIcon + " " + wizard1spell2value + "</p>'>" + displayDamage(wizard1affinity,wizard5affinity,wizard1spell2type,wizard1spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
  wizard5line1.classList.add(wizard1rarity);
  wizard5line1spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell1name + "<br />" + tooltipTargetsIcon + " " + wizard5spell1targets + " " + tooltipManaIcon + " " + wizard5spell1cost + " " + tooltipDamageIcon + " " + wizard5spell1value + "</p>'>" + displayDamage(wizard5affinity,wizard1affinity,wizard5spell1type,wizard5spell1value) + "</div>";
  wizard5line1spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell2name + "<br />" + tooltipTargetsIcon + " " + wizard5spell2targets + " " + tooltipManaIcon + " " + wizard5spell2cost + " " + tooltipDamageIcon + " " + wizard5spell2value + "</p>'>" + displayDamage(wizard5affinity,wizard1affinity,wizard5spell2type,wizard5spell2value) + "</div>";

  wizard5line2.innerHTML = wizardImage(wizard2name,wizard2rarity,'60px','','Opponent') + wizard2name + " <span class='baOppTblHealth'>(" + wizard2health + ")</span> <div class='baOppTblSpeciality'>" + wizard2speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell1name + "<br />" + tooltipTargetsIcon + " " + wizard2spell1targets + " " + tooltipManaIcon + " " + wizard2spell1cost + " " + tooltipDamageIcon + " " + wizard2spell1value + "</p>'>" + displayDamage(wizard2affinity,wizard5affinity,wizard2spell1type,wizard2spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell2name + "<br />" + tooltipTargetsIcon + " " + wizard2spell2targets + " " + tooltipManaIcon + " " + wizard2spell2cost + " " + tooltipDamageIcon + " " + wizard2spell2value + "</p>'>" + displayDamage(wizard2affinity,wizard5affinity,wizard2spell2type,wizard2spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
  wizard5line2.classList.add(wizard2rarity);
  wizard5line2spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell1name + "<br />" + tooltipTargetsIcon + " " + wizard5spell1targets + " " + tooltipManaIcon + " " + wizard5spell1cost + " " + tooltipDamageIcon + " " + wizard5spell1value + "</p>'>" + displayDamage(wizard5affinity,wizard2affinity,wizard5spell1type,wizard5spell1value) + "</div>";
  wizard5line2spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell2name + "<br />" + tooltipTargetsIcon + " " + wizard5spell2targets + " " + tooltipManaIcon + " " + wizard5spell2cost + " " + tooltipDamageIcon + " " + wizard5spell2value + "</p>'>" + displayDamage(wizard5affinity,wizard2affinity,wizard5spell2type,wizard5spell2value) + "</div>";

  wizard5line3.innerHTML = wizardImage(wizard3name,wizard3rarity,'60px','','Opponent') + wizard3name + " <span class='baOppTblHealth'>(" + wizard3health + ")</span> <div class='baOppTblSpeciality'>" + wizard3speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell1name + "<br />" + tooltipTargetsIcon + " " + wizard3spell1targets + " " + tooltipManaIcon + " " + wizard3spell1cost + " " + tooltipDamageIcon + " " + wizard3spell1value + "</p>'>" + displayDamage(wizard3affinity,wizard5affinity,wizard3spell1type,wizard3spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell2name + "<br />" + tooltipTargetsIcon + " " + wizard3spell2targets + " " + tooltipManaIcon + " " + wizard3spell2cost + " " + tooltipDamageIcon + " " + wizard3spell2value + "</p>'>" + displayDamage(wizard3affinity,wizard5affinity,wizard3spell2type,wizard3spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
  wizard5line3.classList.add(wizard3rarity);
  wizard5line3spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell1name + "<br />" + tooltipTargetsIcon + " " + wizard5spell1targets + " " + tooltipManaIcon + " " + wizard5spell1cost + " " + tooltipDamageIcon + " " + wizard5spell1value + "</p>'>" + displayDamage(wizard5affinity,wizard3affinity,wizard5spell1type,wizard5spell1value) + "</div>";
  wizard5line3spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard5spell2name + "<br />" + tooltipTargetsIcon + " " + wizard5spell2targets + " " + tooltipManaIcon + " " + wizard5spell2cost + " " + tooltipDamageIcon + " " + wizard5spell2value + "</p>'>" + displayDamage(wizard5affinity,wizard3affinity,wizard5spell2type,wizard5spell2value) + "</div>";

  wizard6line1.innerHTML = wizardImage(wizard1name,wizard1rarity,'60px','','Opponent') + wizard1name + " <span class='baOppTblHealth'>(" + wizard1health + ")</span> <div class='baOppTblSpeciality'>" + wizard1speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell1name + "<br />" + tooltipTargetsIcon + " " + wizard1spell1targets + " " + tooltipManaIcon + " " + wizard1spell1cost + " " + tooltipDamageIcon + " " + wizard1spell1value + "</p>'>" + displayDamage(wizard1affinity,wizard6affinity,wizard1spell1type,wizard1spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard1spell2name + "<br />" + tooltipTargetsIcon + " " + wizard1spell2targets + " " + tooltipManaIcon + " " + wizard1spell2cost + " " + tooltipDamageIcon + " " + wizard1spell2value + "</p>'>" + displayDamage(wizard1affinity,wizard6affinity,wizard1spell2type,wizard1spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
  wizard6line1.classList.add(wizard1rarity);
  wizard6line1spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell1name + "<br />" + tooltipTargetsIcon + " " + wizard6spell1targets + " " + tooltipManaIcon + " " + wizard6spell1cost + " " + tooltipDamageIcon + " " + wizard6spell1value + "</p>'>" + displayDamage(wizard6affinity,wizard1affinity,wizard6spell1type,wizard6spell1value) + "</div>";
  wizard6line1spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell2name + "<br />" + tooltipTargetsIcon + " " + wizard6spell2targets + " " + tooltipManaIcon + " " + wizard6spell2cost + " " + tooltipDamageIcon + " " + wizard6spell2value + "</p>'>" + displayDamage(wizard6affinity,wizard1affinity,wizard6spell2type,wizard6spell2value) + "</div>";

  wizard6line2.innerHTML = wizardImage(wizard2name,wizard2rarity,'60px','','Opponent') + wizard2name + " <span class='baOppTblHealth'>(" + wizard2health + ")</span> <div class='baOppTblSpeciality'>" + wizard2speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell1name + "<br />" + tooltipTargetsIcon + " " + wizard2spell1targets + " " + tooltipManaIcon + " " + wizard2spell1cost + " " + tooltipDamageIcon + " " + wizard2spell1value + "</p>'>" + displayDamage(wizard2affinity,wizard6affinity,wizard2spell1type,wizard2spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard2spell2name + "<br />" + tooltipTargetsIcon + " " + wizard2spell2targets + " " + tooltipManaIcon + " " + wizard2spell2cost + " " + tooltipDamageIcon + " " + wizard2spell2value + "</p>'>" + displayDamage(wizard2affinity,wizard6affinity,wizard2spell2type,wizard2spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
  wizard6line2.classList.add(wizard2rarity);
  wizard6line2spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell1name + "<br />" + tooltipTargetsIcon + " " + wizard6spell1targets + " " + tooltipManaIcon + " " + wizard6spell1cost + " " + tooltipDamageIcon + " " + wizard6spell1value + "</p>'>" + displayDamage(wizard6affinity,wizard2affinity,wizard6spell1type,wizard6spell1value) + "</div>";
  wizard6line2spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell2name + "<br />" + tooltipTargetsIcon + " " + wizard6spell2targets + " " + tooltipManaIcon + " " + wizard6spell2cost + " " + tooltipDamageIcon + " " + wizard6spell2value + "</p>'>" + displayDamage(wizard6affinity,wizard2affinity,wizard6spell2type,wizard6spell2value) + "</div>";

  wizard6line3.innerHTML = wizardImage(wizard3name,wizard3rarity,'60px','','Opponent') + wizard3name + " <span class='baOppTblHealth'>(" + wizard3health + ")</span> <div class='baOppTblSpeciality'>" + wizard3speciality.innerHTML + "</div> <div class='baOppTblSpellWrap'><div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell1name + "<br />" + tooltipTargetsIcon + " " + wizard3spell1targets + " " + tooltipManaIcon + " " + wizard3spell1cost + " " + tooltipDamageIcon + " " + wizard3spell1value + "</p>'>" + displayDamage(wizard3affinity,wizard6affinity,wizard3spell1type,wizard3spell1value) + "</div> <div class='baOppTblSpell simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard3spell2name + "<br />" + tooltipTargetsIcon + " " + wizard3spell2targets + " " + tooltipManaIcon + " " + wizard3spell2cost + " " + tooltipDamageIcon + " " + wizard3spell2value + "</p>'>" + displayDamage(wizard3affinity,wizard6affinity,wizard3spell2type,wizard3spell2value) + "</div></div><div class='baOppTblTurnsToKill'></div>";
  wizard6line3.classList.add(wizard3rarity);
  wizard6line3spell1.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell1name + "<br />" + tooltipTargetsIcon + " " + wizard6spell1targets + " " + tooltipManaIcon + " " + wizard6spell1cost + " " + tooltipDamageIcon + " " + wizard6spell1value + "</p>'>" + displayDamage(wizard6affinity,wizard3affinity,wizard6spell1type,wizard6spell1value) + "</div>";
  wizard6line3spell2.innerHTML = "<div class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<p>" + wizard6spell2name + "<br />" + tooltipTargetsIcon + " " + wizard6spell2targets + " " + tooltipManaIcon + " " + wizard6spell2cost + " " + tooltipDamageIcon + " " + wizard6spell2value + "</p>'>" + displayDamage(wizard6affinity,wizard3affinity,wizard6spell2type,wizard6spell2value) + "</div>";
}

function displayDamage(attAffin,defAffin,type,damage) {
  if (type === "Healing") {
    return "<div style='color:#fff;background-color:rgba(255, 255, 255, 0.1);border-radius:10px;padding:0.1em 0.2em;border:1px solid rgba(255, 255, 255, 0.2);font-weight:400;'><img alt='Healing' src='//static.miraheze.org/wizardiawiki/2/22/Healing.svg' decoding='async' width='13' height='13' /> <div style='display:inline;vertical-align:middle'>" + damage + "</div></div>";
  } else if (type === "Armor") {
    return "<div style='color:#fff;background-color:rgba(255, 255, 255, 0.1);border-radius:10px;padding:0.1em 0.2em;border:1px solid rgba(255, 255, 255, 0.2);font-weight:400;'><img alt='Armor' src='//static.miraheze.org/wizardiawiki/b/b1/Armor.svg' decoding='async' width='13' height='13' /> <div style='display:inline;vertical-align:middle'>" + damage + "</div></div>";
  } else {
    if (attAffin === defAffin) {
      return "<div style='background-color: #e9e9e9; font-weight:500; border-radius:10px;padding:0.1em 0.2em;border:1px solid rgba(255, 255, 255, 0.2);'>" + damage + "</div>";
    } else if ((attAffin === "Body" && defAffin === "Soul") || (attAffin === "Mind" && defAffin === "Body") || (attAffin === "Soul" && defAffin === "Mind")) {
      return "<div style='background-color: rgb(200 245 200); font-weight:500; border-radius:10px;padding:0.1em;border:1px solid rgba(255, 255, 255, 0.2);'>" + countDamage(attAffin,defAffin,type,damage) + "</div>";
    } else {
      return "<div style='background-color: rgb(245 200 200); font-weight:500; border-radius:10px;padding:0.1em 0.2em;border:1px solid rgba(255, 255, 255, 0.2);'>" + countDamage(attAffin,defAffin,type,damage) + "</div>";
    }
  }
}

function wizardImageAffinity(affinity,team) {
  var soulAffinityDisplay = " class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<div style=&quot;text-align:center&quot;><div><img alt=&quot;Soul Affinity&quot; src=&quot;//static.miraheze.org/wizardiawiki/5/5a/Soul.svg&quot; decoding=&quot;async&quot; width=&quot;40&quot; height=&quot;40&quot;></div><div><div style=&quot;color: rgb(183 245 196);display:inline;margin:0.5em;&quot;>Stronger than</div><div style=&quot;color: rgb(171 129 129);display:inline;margin:0.5em;&quot;>Weaker than</div></div><div><div style=&quot;display:inline-block;width:50%;&quot;><img alt=&quot;Mind Affinity&quot; src=&quot;//static.miraheze.org/wizardiawiki/9/96/Mind.svg&quot; decoding=&quot;async&quot; width=&quot;40&quot; height=&quot;40&quot;></div><div style=&quot;display:inline-block;width:50%;&quot;><img alt=&quot;Body Affinity&quot; src=&quot;//static.miraheze.org/wizardiawiki/0/0b/Body.svg&quot; decoding=&quot;async&quot; width=&quot;40&quot; height=&quot;40&quot;></div></div></div>'";
  var bodyAffinityDisplay = " class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<div style=&quot;text-align:center&quot;><div><img alt=&quot;Body Affinity&quot; src=&quot;//static.miraheze.org/wizardiawiki/0/0b/Body.svg&quot; decoding=&quot;async&quot; width=&quot;40&quot; height=&quot;40&quot;></div><div><div style=&quot;color: rgb(183 245 196);display:inline;margin:0.5em;&quot;>Stronger than</div><div style=&quot;color: rgb(171 129 129);display:inline;margin:0.5em;&quot;>Weaker than</div></div><div><div style=&quot;display:inline-block;width:50%;&quot;><img alt=&quot;Soul Affinity&quot; src=&quot;//static.miraheze.org/wizardiawiki/5/5a/Soul.svg&quot; decoding=&quot;async&quot; width=&quot;40&quot; height=&quot;40&quot;></div><div style=&quot;display:inline-block;width:50%;&quot;><img alt=&quot;Mind Affinity&quot; src=&quot;//static.miraheze.org/wizardiawiki/9/96/Mind.svg&quot; decoding=&quot;async&quot; width=&quot;40&quot; height=&quot;40&quot;></div></div></div>'";
  var mindAffinityDisplay = " class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<div style=&quot;text-align:center&quot;><div><img alt=&quot;Mind Affinity&quot; src=&quot;//static.miraheze.org/wizardiawiki/9/96/Mind.svg&quot; decoding=&quot;async&quot; width=&quot;40&quot; height=&quot;40&quot;></div><div><div style=&quot;color: rgb(183 245 196);display:inline;margin:0.5em;&quot;>Stronger than</div><div style=&quot;color: rgb(171 129 129);display:inline;margin:0.5em;&quot;>Weaker than</div></div><div><div style=&quot;display:inline-block;width:50%;&quot;><img alt=&quot;Body Affinity&quot; src=&quot;//static.miraheze.org/wizardiawiki/0/0b/Body.svg&quot; decoding=&quot;async&quot; width=&quot;40&quot; height=&quot;40&quot;></div><div style=&quot;display:inline-block;width:50%;&quot;><img alt=&quot;Soul Affinity&quot; src=&quot;//static.miraheze.org/wizardiawiki/5/5a/Soul.svg&quot; decoding=&quot;async&quot; width=&quot;40&quot; height=&quot;40&quot;></div></div></div>'";
  var soulImage = "<img alt='Soul Affinity' src='//static.miraheze.org/wizardiawiki/5/5a/Soul.svg' decoding='async' width='40' height='40' style='position:absolute;left:0%;top:0%'" + soulAffinityDisplay + ">";
  var bodyImage = "<img alt='Body Affinity' src='//static.miraheze.org/wizardiawiki/0/0b/Body.svg' decoding='async' width='40' height='40' style='position:absolute;left:0%;top:0%'" + bodyAffinityDisplay + ">";
  var mindImage = "<img alt='Mind Affinity' src='//static.miraheze.org/wizardiawiki/9/96/Mind.svg' decoding='async' width='40' height='40' style='position:absolute;left:0%;top:0%'" + mindAffinityDisplay + ">";
  if (team === "Opponent") {
    return "";
  }
  else {
    if (affinity === "Soul") {
      return soulImage;
    }
    else if (affinity === "Body") {
      return bodyImage;
    }
    else {
      return mindImage;
    }
  }
}
function wizardImage(wizardName,wizardRarity,height,width,team) {
  var returnHeight = height ? " height='" + height + "'" : "";
  var returnWidth = width ? " width='" + width + "'" : "";

  switch (wizardName) {
    case 'Amin, the Deceived':
    return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/0/06/Amin-epic-650.png/300px-Amin-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/0/06/Amin-epic-650.png/600px-Amin-epic-650.png 2x'>" + wizardImageAffinity("Body",team);
    break;
    case 'Chikara, the Tower':
    return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/1/13/Chikara-epic-650.png/300px-Chikara-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/1/13/Chikara-epic-650.png/600px-Chikara-epic-650.png 2x'>" + wizardImageAffinity("Mind",team);
    break;
    case 'Crizal, the Alluring':
    return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/c/cf/Crizal-epic-650.png/300px-Crizal-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/c/cf/Crizal-epic-650.png/600px-Crizal-epic-650.png 2x'>" + wizardImageAffinity("Mind",team);
    break;
    case 'Hinata, the Detached':
    return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/c/c0/Hinata-epic-650.png/300px-Hinata-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/c/c0/Hinata-epic-650.png/600px-Hinata-epic-650.png 2x'>" + wizardImageAffinity("Soul",team);
    break;
    case 'Olek, the Reflective':
    return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/f/f1/Olek-epic-650.png/300px-Olek-epic-650.png' decoding='async' " + returnHeight + returnWidth + "  srcset='//static.miraheze.org/wizardiawiki/thumb/f/f1/Olek-epic-650.png/600px-Olek-epic-650.png 2x'>" + wizardImageAffinity("Soul",team);
    break;
    case 'Petro, the 1':
    return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/f/f0/Petro-epic-650.png/300px-Petro-epic-650.png' decoding='async' " + returnHeight + returnWidth + "  srcset='//static.miraheze.org/wizardiawiki/thumb/f/f0/Petro-epic-650.png/600px-Petro-epic-650.png 2x'>" + wizardImageAffinity("Mind",team);
    break;
    case 'S, the Unrestrained':
    return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/6/65/S-epic-650.png/300px-S-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/6/65/S-epic-650.png/600px-S-epic-650.png 2x'>" + wizardImageAffinity("Soul",team);
    break;
    case 'Tah Mut Tah, the Indulging':
    return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/e/ef/Tah-epic-650.png/300px-Tah-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/e/ef/Tah-epic-650.png/600px-Tah-epic-650.png 2x'>" + wizardImageAffinity("Body",team);
    break;
    case 'Tsering, the Impatient':
    return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/7/79/Tsering-epic-650.png/300px-Tsering-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/7/79/Tsering-epic-650.png/600px-Tsering-epic-650.png 2x'>" + wizardImageAffinity("Body",team);
    break;
    case 'Elzevir, the Scribe':
    return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/0/01/Elzevir-epic-650.png/300px-Elzevir-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/0/01/Elzevir-epic-650.png/600px-Elzevir-epic-650.png 2x'>" + wizardImageAffinity("Mind",team);
    break;
    case 'Seven, the Torn':
    return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/9/97/Seven-epic-650.png/300px-Seven-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/9/97/Seven-epic-650.png/600px-Seven-epic-650.png 2x'>" + wizardImageAffinity("Body",team);
    break;
    case 'Rose, the Unbreakable':
    return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/b/b2/Rose-epic-650.png/300px-Rose-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/b/b2/Rose-epic-650.png/600px-Rose-epic-650.png 2x'>" + wizardImageAffinity("Soul",team);
    break;
    case 'Einar, the Spark':
    return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/9/96/Einar-epic-650.png/300px-Einar-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/9/96/Einar-epic-650.png/600px-Einar-epic-650.png 2x'>" + wizardImageAffinity("Soul",team);
    break;
    case 'Ergork, the Bound':
    return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/7/7c/Ergork-epic-650.png/300px-Ergork-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/7/7c/Ergork-epic-650.png/600px-Ergork-epic-650.png 2x'>" + wizardImageAffinity("Body",team);
    break;
    case 'Wahbu, the Youthful':
    return "<img class='wizImgBg' alt='" + wizardName + "' src='//static.miraheze.org/wizardiawiki/thumb/4/4c/Wahbu-epic-650.png/300px-Wahbu-epic-650.png' decoding='async' " + returnHeight + returnWidth + " srcset='//static.miraheze.org/wizardiawiki/thumb/4/4c/Wahbu-epic-650.png/600px-Wahbu-epic-650.png 2x'>" + wizardImageAffinity("Mind",team);
    break;
    default: '';
  }
}

function showTableLegend() {
  var tableLegend = document.getElementById("baTableLegend");
  var healthIconImage = "<img alt=&quot;Healing&quot; src=&quot;//static.miraheze.org/wizardiawiki/2/22/Healing.svg&quot; decoding=&quot;async&quot; width=&quot;13&quot; height=&quot;13&quot; style=&quot;vertical-align: text-top;&quot;> ";
  var armorIconImage = "<img alt=&quot;Armor&quot; src=&quot;//static.miraheze.org/wizardiawiki/b/b1/Armor.svg&quot; decoding=&quot;async&quot; width=&quot;13&quot; height=&quot;13&quot; style=&quot;vertical-align: text-top;&quot;>";
  var tableLegendHtml = "<span class='simple-tooltip simple-tooltip-inline tooltipstered' data-simple-tooltip='<div><span style=&quot;color:black;background-color:rgb(200,245,200);font-weight: 500;border-radius: 10px;padding: 0.1em;border: 1px solid rgba(255, 255, 255, 0.2);&quot;>more damage</span> - stronger affinity</div><div><span style=&quot;color:black;background-color:rgb(245,200,200);font-weight: 500;border-radius: 10px;padding: 0.1em;border: 1px solid rgba(255, 255, 255, 0.2);&quot;>less damage</span> - weaker affinity</div><div><span style=&quot;color:black;background-color:#e9e9e9;font-weight: 500;border-radius: 10px;padding: 0.1em;border: 1px solid rgba(255, 255, 255, 0.2);&quot;>exact damage</span> - same affinity</div><div><span style=&quot;color:#fff;background-color:rgb(255,255,255,0.1);font-weight: 500;border-radius: 10px;padding: 0.05em 0.1em;border: 1px solid rgba(255, 255, 255, 0.2);&quot;>" + healthIconImage + "restores health</span> - healing</div><div><span style=&quot;color:#fff;background-color:rgb(255,255,255,0.1);font-weight: 500;border-radius: 10px;padding: 0.05em 0.1em;border: 1px solid rgba(255, 255, 255, 0.2);&quot;>" + armorIconImage + "adds armor</span> - protection</div>'>Table legend</span>";
  if (tableLegend) {
    tableLegend.innerHTML = tableLegendHtml;
  }
}

function countDamage(attAffin,defAffin,type,damage) {
  var lowMin = 0.66;
  var lowMax = 0.76;
  var highMin = 1.248;
  var highMax = 1.30;
  if (type === "Healing") {
    return "0";
  } else {
    if (damage.includes("-")) {
      var damageArray = damage.split("-");
      var damageMin = damageArray[0];
      var damageMax = damageArray[1];
      if (attAffin === defAffin) {
        return "" + damage;
      } else if ((attAffin === "Body" && defAffin === "Soul") || (attAffin === "Mind" && defAffin === "Body") || (attAffin === "Soul" && defAffin === "Mind")) {
        return Math.round(damageMin*highMin) + "-" + Math.round(damageMax*highMax);
      } else {
        return Math.round(damageMin*lowMin) + "-" + Math.round(damageMax*lowMax);
      }
    } else {
      if (attAffin === defAffin) {
        return "" + damage;
      } else if ((attAffin === "Body" && defAffin === "Soul") || (attAffin === "Mind" && defAffin === "Body") || (attAffin === "Soul" && defAffin === "Mind")) {
        return Math.round(damage*highMin) + "-" + Math.round(damage*highMax);
      } else {
        return Math.round(damage*lowMin) + "-" + Math.round(damage*lowMax);
      }
    }
  }
}
function whatSpeciality(spell1type,spell1targets,spell2type,spell2targets) {
  if (spell1type === "Healing" || spell2type === "Healing") { // if healing
    if ((spell1type === "Healing" && spell1targets > 1) || (spell2type === "Healing" && spell2targets > 1)) {
      return "<div style='color: #fff; background-color: rgba(255, 255, 255, 0.2); border-radius:10px;padding:0.2em; margin:0.1em;display:inline;border:1px solid rgba(255, 255, 255, 0.2);'><img alt='Healing' src='//static.miraheze.org/wizardiawiki/2/22/Healing.svg' decoding='async' width='16' height='16' style='vertical-align:text-top'> 3</div>";
    } else {
      return "<div style='color: #fff; background-color: rgba(255, 255, 255, 0.2); border-radius:10px;padding:0.2em; margin:0.1em;display:inline;border:1px solid rgba(255, 255, 255, 0.2);'><img alt='Healing' src='//static.miraheze.org/wizardiawiki/2/22/Healing.svg' decoding='async' width='16' height='16' style='vertical-align:text-top'> 1</div>";
    }
  } else if (spell1targets > 1 || spell2targets > 1) { // if AOE attack
    return "<div style='color: #fff; background-color: rgba(255, 255, 255, 0.2); border-radius:10px;padding:0.2em; margin:0.1em;display:inline;border:1px solid rgba(255, 255, 255, 0.2);'><img alt='Targets' src='//static.miraheze.org/wizardiawiki/b/ba/Targets.svg' decoding='async' width='15' height='16' style='vertical-align:text-top'> 3</div>";
  } else {
    return "<div style='color: #fff; background-color: rgba(255, 255, 255, 0.2); border-radius:10px;padding:0.2em; margin:0.1em;display:inline;border:1px solid rgba(255, 255, 255, 0.2);'><img alt='Targets' src='//static.miraheze.org/wizardiawiki/b/ba/Targets.svg' decoding='async' width='15' height='16' style='vertical-align:text-top'> 1</div>";
  }
}

function showTeam() {
  var yourTeam = document.getElementById("ba-your-team");
  var opponentsTeam = document.getElementById("ba-opponents-team");

  if (document.getElementById("whichTeam").value === "Your"){
    yourTeam.classList.remove(noDisplay);
    opponentsTeam.classList.add(noDisplay);
  }     
  else{
    yourTeam.classList.add(noDisplay);
    opponentsTeam.classList.remove(noDisplay);
  }    
}
function displayCalculator(number) {
  var calculatorSection = document.getElementById("baCalculatorSection");
  var calculatorWrapId = "baCalculatorWrap" + number;
  var calculatorWrap = document.createElement('div');
  calculatorWrap.id = calculatorWrapId;
  calculatorWrap.style ="margin-bottom:0.2em;position:relative;text-align:center;border:1px solid rgba(255, 255, 255, 0.2);border-radius:10px;background-color: rgba(14, 15, 16, 1);display:inline-block;flex-direction:row;justify-content:flex-start;align-items:stretch;align-content:stretch";
  calculatorWrap.innerHTML = "<div id='baCalculatorIntro" + number + "' style='color: #90accb;cursor:pointer;margin:0.2em;' onclick='damageCalculator(" + number + ")'>+ COUNT DAMAGE</div>";
  if (calculatorSection) {
    calculatorSection.appendChild(calculatorWrap);
  }
}
function damageCalculator(number) {
  var calculatorWrapId = "baCalculatorWrap" + number;
  var calculatorWrap = document.getElementById(calculatorWrapId);
  calculatorWrap.style.display = "flex";
  var calculatorIntroId = "baCalculatorIntro" + number;
  var calculatorIntro = document.getElementById(calculatorIntroId);
  var totalDamage = document.createElement('div');
  totalDamage.id = "baTotalDamage" + number;
  totalDamage.style = "min-width:8em;flex-shrink:0;background-color:rgba(255,255,255,0.1);border-radius:10px;color:#6c757d";
  var infoField = document.createElement('div');
  infoField.id = "baCalculatorInfoField" + number;
  infoField.style = "cursor:default;min-width:0px;flex-shrink:1;";
  var stopCalculator = document.createElement('div');
  stopCalculator.id = "baCalculatorManage" + number;
  stopCalculator.style = "min-width:5em;flex-shrink:0;";
  var wiz1line1spell1 = document.getElementById("wizard-1-line-1-spell-1");
  calculatorIntro.classList.add('noDisplay');
  totalDamage.innerHTML = "Total damage<div id='baCalculatorTotalDamageSum" + number + "' style='color:white;background-color:rgba(255,255,255,0.2);border:1px solid rgba(255, 255, 255, 0.2);border-radius:10px;margin:0.2em'>0</div>";
  stopCalculator.innerHTML = "<div class='selectSpells' style='color:#df7f7f;cursor:pointer;border:1px solid rgba(255, 255, 255, 0.2);border-radius:10px;padding:0.1em;margin:0.1em 0.2em' onclick='stopCalculator(" + number + ")'>STOP</div>";
  calculatorWrap.appendChild(totalDamage);
  calculatorWrap.appendChild(infoField);
  calculatorWrap.appendChild(stopCalculator);
  var nodeList = document.querySelectorAll("[id*='-spell-'].baOppTblRow");
  for (var i = 0; i < nodeList.length; i++) {
    nodeList[i].addEventListener("click", addSpell);
    nodeList[i].classList.add('selectSpells');
  };
}
function addSpell() {
  if(!this.innerText.includes(" ")) {
    //var infoField = document.querySelector('[id ^= "baCalculatorInfoField"]');
    var infoField = Array.from(
      document.querySelectorAll('[id ^= "baCalculatorInfoField"]')
    ).pop();
    var copySpell = document.createElement('div');
    copySpell.classList.add("calculatedSpell");
    copySpell.style.color = "#000";
    copySpell.style.display = "inline-block";
    copySpell.style.margin = "0.1em 0.2em";
    copySpell.innerHTML = this.innerHTML;
    infoField.appendChild(copySpell);
    calculatorTotalDamageCount(infoField.id);
  }
}
function stopCalculator(number) {
  var calculatorWrapId = "baCalculatorWrap" + number;
  var calculatorWrap = document.getElementById(calculatorWrapId);
  var numberNew = number + 1;
  var nodeList = document.querySelectorAll("[id*='-spell-'].baOppTblRow");
  var manageCalculatorId = "baCalculatorManage" + number;
  var manageCalculator = document.getElementById(manageCalculatorId);
  manageCalculator.innerHTML = "<div style='color:#df7f7f;cursor:pointer;border:1px solid rgba(255, 255, 255, 0.2);border-radius:10px;padding:0.1em 0.3em;margin:0.1em 0.2em;' onclick='removeCalculator(" + number + ")'> [X] Remove </div>";
  for (var i = 0; i < nodeList.length; i++) {
    nodeList[i].removeEventListener("click", addSpell);
    nodeList[i].classList.remove('selectSpells');
    //document.getElementById("baCalculatorInfoField").classList.remove('selectSpells');
  };
  displayCalculator(numberNew);
}
function removeCalculator(number) {
  var calculatorWrapId = "baCalculatorWrap" + number;
  var calculatorWrap = document.getElementById(calculatorWrapId);
  calculatorWrap.style.display = "none";
  //calculatorWrap.innerHTML = "";
}
function calculatorTotalDamageCount(infoFieldId) {
  var query = "#" + infoFieldId + " .calculatedSpell";
  var damageMin = 0;
  var damageMax = 0;
  var nodeList = document.querySelectorAll(query);
  for (var i = 0; i < nodeList.length; i++) {
    if (nodeList[i].innerText.includes("-")) {
      var damageArray = nodeList[i].innerText.split("-");
      damageMin = damageMin + parseInt(damageArray[0]);
      damageMax = damageMax + parseInt(damageArray[1]);
    } 
    else if (nodeList[i].innerText.includes(" ")) {
    }
    else {
      damageMin = damageMin + parseInt(nodeList[i].innerText);
      damageMax = damageMax + parseInt(nodeList[i].innerText);
    }
  };
  if (damageMin != damageMax) {
    var totalSum = Array.from(
      document.querySelectorAll('[id ^= "baCalculatorTotalDamageSum"]')
    ).pop();
    totalSum.innerHTML = damageMin + "-" + damageMax;
  }
  else {
    var totalSum = Array.from(
      document.querySelectorAll('[id ^= "baCalculatorTotalDamageSum"]')
    ).pop();
    totalSum.innerHTML = damageMin;
  }
}
function canBeKilled(wizardNumber) { // returns turn number when can be killed
  var wizardNumberInTeam = 0;
  var start = 0;
  wizardNumber = parseInt(wizardNumber);
  if (wizardNumber < 4) {
    start = 4;
    wizardNumberInTeam = wizardNumber;
  }
  else if (wizardNumber > 3) {
    start = 1;
    wizardNumberInTeam = wizardNumber - 3;
  }
  else {
    return;
  }
  var wizardHealthId = "wizard-" + wizardNumber + "-health";
  var wizardHealth = document.getElementById(wizardHealthId).innerHTML;
  var damageTotalMax = 0;
  var damageTotalMin = 0;
  var turn = 1;
  var spell1damageId = "";
  var spell2damageId = "";
  var spell1damage = "";
  var spell2damage = "";
  var spell1damageMin = "";
  var spell2damageMin = "";
  var spell1damageMax = "";
  var spell2damageMax = "";
  // sum max opponent wizard damage per turn and when it exceeds wizardHealth - return turn number 
  for (var i = start; i < start + 3; i++) {
    spell1damageId = "wizard-" + i + "-line-" + wizardNumberInTeam + "-spell-1";
    spell2damageId = "wizard-" + i + "-line-" + wizardNumberInTeam + "-spell-2";
    spell1damage = document.getElementById(spell1damageId).innerText;
    spell2damage = document.getElementById(spell2damageId).innerText;
    // check if damage is range (then split and use max damage), check if healing spell. Check both spells
    if (spell1damage.includes("-")) {
      var damageArray = spell1damage.split("-");
      spell1damageMax = parseInt(damageArray[1]);
      spell1damageMin = parseInt(damageArray[0]);
    } 
    else if (spell1damage.includes(" ")) {
      spell1damageMax = 0;
      spell1damageMin = 0;
    }
    else {
      spell1damageMax = spell1damage;
      spell1damageMin = spell1damage;
    }
    if (spell2damage.includes("-")) {
      var damageArray = spell2damage.split("-");
      spell2damageMax = parseInt(damageArray[1]);
      spell2damageMin = parseInt(damageArray[0]);
    } 
    else if (spell2damage.includes(" ")) {
      spell2damageMax = 0;
      spell2damageMin = 0;
    }
    else {
      spell2damageMax = spell2damage;
      spell2damageMin = spell2damage;
    }
    // check which spell deals more damage (or equal) and add new damage to damageTotal
    if (spell1damageMax >= spell2damageMax) {
      damageTotalMax = damageTotalMax + parseInt(spell1damageMax);
      damageTotalMin = damageTotalMin + parseInt(spell1damageMin);
    }
    else {
      damageTotalMax = damageTotalMax + parseInt(spell2damageMax);
      damageTotalMin = damageTotalMin + parseInt(spell2damageMin);
    }
    // check if wizard is still alive
    if (wizardHealth > damageTotalMax) {
      turn++;
    }
    else {
      return "<div class='simple-tooltip simple-tooltip-inline tooltipstered turnsToKill' data-simple-tooltip='<div style=&quot;text-align:center&quot;>Can be killed in <span style=&quot;font-style:strong&quot;>" + turn + "</span> turns (" + damageTotalMin + "-" + damageTotalMax + ")</div>'>" + turn + "</div>";
    }
  }
  return "";
}
function addKillRoundCounter() {
  var wizard1image = document.getElementById("wizard-1-image");
  var wizard2image = document.getElementById("wizard-2-image");
  var wizard3image = document.getElementById("wizard-3-image");
  var wizard4image = document.getElementById("wizard-4-image");
  var wizard5image = document.getElementById("wizard-5-image");
  var wizard6image = document.getElementById("wizard-6-image");
  wizard1image.insertAdjacentHTML('beforeend', canBeKilled(1));
  wizard2image.insertAdjacentHTML('beforeend', canBeKilled(2));
  wizard3image.insertAdjacentHTML('beforeend', canBeKilled(3));
  wizard4image.insertAdjacentHTML('beforeend', canBeKilled(4));
  wizard5image.insertAdjacentHTML('beforeend', canBeKilled(5));
  wizard6image.insertAdjacentHTML('beforeend', canBeKilled(6));

  var wizard1line1 = document.querySelector("#wizard-1-line-1 .baOppTblTurnsToKill");
  var wizard1line2 = document.querySelector("#wizard-1-line-2 .baOppTblTurnsToKill");
  var wizard1line3 = document.querySelector("#wizard-1-line-3 .baOppTblTurnsToKill");
  var wizard2line1 = document.querySelector("#wizard-2-line-1 .baOppTblTurnsToKill");
  var wizard2line2 = document.querySelector("#wizard-2-line-2 .baOppTblTurnsToKill");
  var wizard2line3 = document.querySelector("#wizard-2-line-3 .baOppTblTurnsToKill");
  var wizard3line1 = document.querySelector("#wizard-3-line-1 .baOppTblTurnsToKill");
  var wizard3line2 = document.querySelector("#wizard-3-line-2 .baOppTblTurnsToKill");
  var wizard3line3 = document.querySelector("#wizard-3-line-3 .baOppTblTurnsToKill");
  var wizard4line1 = document.querySelector("#wizard-4-line-1 .baOppTblTurnsToKill");
  var wizard4line2 = document.querySelector("#wizard-4-line-2 .baOppTblTurnsToKill");
  var wizard4line3 = document.querySelector("#wizard-4-line-3 .baOppTblTurnsToKill");
  var wizard5line1 = document.querySelector("#wizard-5-line-1 .baOppTblTurnsToKill");
  var wizard5line2 = document.querySelector("#wizard-5-line-2 .baOppTblTurnsToKill");
  var wizard5line3 = document.querySelector("#wizard-5-line-3 .baOppTblTurnsToKill");
  var wizard6line1 = document.querySelector("#wizard-6-line-1 .baOppTblTurnsToKill");
  var wizard6line2 = document.querySelector("#wizard-6-line-2 .baOppTblTurnsToKill");
  var wizard6line3 = document.querySelector("#wizard-6-line-3 .baOppTblTurnsToKill");
  wizard1line1.insertAdjacentHTML('beforeend', canBeKilled(4));
  wizard1line2.insertAdjacentHTML('beforeend', canBeKilled(5));
  wizard1line3.insertAdjacentHTML('beforeend', canBeKilled(6));
  wizard2line1.insertAdjacentHTML('beforeend', canBeKilled(4));
  wizard2line2.insertAdjacentHTML('beforeend', canBeKilled(5));
  wizard2line3.insertAdjacentHTML('beforeend', canBeKilled(6));
  wizard3line1.insertAdjacentHTML('beforeend', canBeKilled(4));
  wizard3line2.insertAdjacentHTML('beforeend', canBeKilled(5));
  wizard3line3.insertAdjacentHTML('beforeend', canBeKilled(6));
  wizard4line1.insertAdjacentHTML('beforeend', canBeKilled(1));
  wizard4line2.insertAdjacentHTML('beforeend', canBeKilled(2));
  wizard4line3.insertAdjacentHTML('beforeend', canBeKilled(3));
  wizard5line1.insertAdjacentHTML('beforeend', canBeKilled(1));
  wizard5line2.insertAdjacentHTML('beforeend', canBeKilled(2));
  wizard5line3.insertAdjacentHTML('beforeend', canBeKilled(3));
  wizard6line1.insertAdjacentHTML('beforeend', canBeKilled(1));
  wizard6line2.insertAdjacentHTML('beforeend', canBeKilled(2));
  wizard6line3.insertAdjacentHTML('beforeend', canBeKilled(3));
}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.