window.onload=function(invoker) {
document.onkeydown = function(qwerDown) {
var q_a = document.getElementById('quasactiv');
var w_a = document.getElementById('wexactiv');
var e_a = document.getElementById('exortactiv');
var quas = document.getElementById('quas');
var wex = document.getElementById('wex');
var exort = document.getElementById('exort');
var invoke = document.getElementById('invoke');
var btn_quas = document.getElementById('btn-quas');
var btn_wex = document.getElementById('btn-wex');
var btn_exort = document.getElementById('btn-exort');
var btn_invoke = document.getElementById('btn-invoke');
var quasactiv = (document.querySelectorAll('[id="quasactiv"]').length);
var wexactiv = (document.querySelectorAll('[id="wexactiv"]').length);
var exortactiv = (document.querySelectorAll('[id="exortactiv"]').length);
var Alacrity = document.getElementById('Alacrity');
var Alacrity_activ = (document.querySelectorAll('[id="Alacrity"]').length);
var ChaosMeteor_activ = (document.querySelectorAll('[id="ChaosMeteor"]').length);
var ColdSnap_activ = (document.querySelectorAll('[id="ColdSnap"]').length);
var DeafeningBlast_activ = (document.querySelectorAll('[id="DeafeningBlast"]').length);
var EMP_activ = (document.querySelectorAll('[id="EMP"]').length);
var ForgeSpirit_activ = (document.querySelectorAll('[id="ForgeSpirit"]').length);
var GhostWall_activ = (document.querySelectorAll('[id="GhostWall"]').length);
var IceWall_activ = (document.querySelectorAll('[id="IceWall"]').length);
var SunStrike_activ = (document.querySelectorAll('[id="SunStrike"]').length);
var Tornado_activ = (document.querySelectorAll('[id="Tornado"]').length);
var qweadd = document.getElementById('qweactiv');
var qwediv = document.createElement('div');
var wexdiv = document.createElement('div');
var exortdiv = document.createElement('div');
var divadd = document.createElement('div');
var cont = document.getElementsByClassName("content");
var qweold = document.getElementById('qweactiv').childNodes.length;
var qwelast = qweadd.lastChild;
var qwefirst = qweadd.firstChild;
var lrcastadd = document.getElementById('lrcast');
var lrcastold = document.getElementById('lrcast').childNodes.length;
var lrcastlast = lrcastadd.lastChild;
var lrcastfirst = lrcastadd.firstChild;
var lrcastChildNodes = lrcastadd.childNodes[1];
if (81 === qwerDown.keyCode) {
quas.style.cssText = "width:125px; \
height:125px;\
border:5px solid #30A0F8";
qwediv.id = 'quasactiv';
qweadd.appendChild(qwediv);
if (qweold == 3) {
qweadd.removeChild(qwefirst);
}
else {
};
}
else if (87 === qwerDown.keyCode) {
wex.style.cssText = "width:125px; \
height:125px; \
border:5px solid #F581FC";
wexdiv.id = 'wexactiv';
qweadd.appendChild(wexdiv);
if (qweold == 3) {
qweadd.removeChild(qwefirst);
}
else {
};
}
else if (69 === qwerDown.keyCode) {
exort.style.cssText = "width:125px; \
height:125px; \
border:5px solid #F0AC38";
exortdiv.id = 'exortactiv';
qweadd.appendChild(exortdiv);
if (qweold == 3) {
qweadd.removeChild(qwefirst);
}
else {
};
}
else if(82 === qwerDown.keyCode) {
invoke.style.cssText =
"width:125px; \
height:125px; \
border-top: 5px solid #F0AC38; \
border-left: 5px solid #30A0F8; \
border-right: 5px solid #F581FC; \
border-bottom: 5px solid #fff;"
if ((wexactiv == 2) && (exortactiv == 1)) {
if(Alacrity_activ <2) {
alert("rwre");
}
else {
};
divadd.id = "Alacrity";
lrcastadd.insertBefore(divadd, lrcastadd.firstChild);
if(lrcastold == 3) {
lrcastadd.removeChild(lrcastChildNodes);
}
else {
};
}
else if((wexactiv == 1) && (exortactiv == 2)) {
divadd.id = "ChaosMeteor";
lrcastadd.insertBefore(divadd, lrcastadd.firstChild);
if(lrcastold == 3) {
lrcastadd.removeChild(lrcastChildNodes);
}
else {
};
}
else if(quasactiv == 3) {
divadd.id = "ColdSnap";
lrcastadd.insertBefore(divadd, lrcastadd.firstChild);
if(lrcastold == 3) {
lrcastadd.removeChild(lrcastChildNodes);
}
else {
};
}
else if((quasactiv == 1) && (wexactiv == 1) && (exortactiv == 1)) {
divadd.id = "DeafeningBlast";
lrcastadd.insertBefore(divadd, lrcastadd.firstChild);
if(lrcastold == 3) {
lrcastadd.removeChild(lrcastChildNodes);
}
else {
};
}
else if(wexactiv == 3) {
divadd.id = "EMP";
lrcastadd.insertBefore(divadd, lrcastadd.firstChild);
if(lrcastold == 3) {
lrcastadd.removeChild(lrcastChildNodes);
}
else {
};
}
else if((exortactiv == 2) && (quasactiv == 1)) {
divadd.id = "ForgeSpirit";
lrcastadd.insertBefore(divadd, lrcastadd.firstChild);
if(lrcastold == 3) {
lrcastadd.removeChild(lrcastChildNodes);
}
else {
};
}
else if((quasactiv == 2) && (wexactiv == 1)) {
divadd.id = "GhostWall";
lrcastadd.insertBefore(divadd, lrcastadd.firstChild);
if(lrcastold == 3) {
lrcastadd.removeChild(lrcastChildNodes);
}
else {
};
}
else if((quasactiv == 2) && (exortactiv == 1)) {
divadd.id = "IceWall";
lrcastadd.insertBefore(divadd, lrcastadd.firstChild);
if(lrcastold == 3) {
lrcastadd.removeChild(lrcastChildNodes);
}
else {
};
}
else if(exortactiv == 3) {
divadd.id = "SunStrike";
lrcastadd.insertBefore(divadd, lrcastadd.firstChild);
if(lrcastold == 3) {
lrcastadd.removeChild(lrcastChildNodes);
}
else {
};
}
else if((wexactiv == 2) && (quasactiv == 1)) {
divadd.id = "Tornado";
lrcastadd.insertBefore(divadd, lrcastadd.firstChild);
if(lrcastold == 3) {
lrcastadd.removeChild(lrcastChildNodes);
}
else {
};
}
else {
};
};
};
document.onkeyup = function(qwerUp) {
if (81 === qwerUp.keyCode) {
quas.style.cssText = "width:128px; \
height:128px;"
}
else if (87 === qwerUp.keyCode) {
wex.style.cssText = "width:128px; \
height:128px;"
}
else if (69 === qwerUp.keyCode) {
exort.style.cssText = "width:128px; \
height:128px;"
}
else if(82 === qwerUp.keyCode) {
invoke.style.cssText = "width:128px; \
height:128px;"
}
};
};
// Click