jajaja el codigo son 1000 lineas, no creo que vayas a leerlo todo. pongo un pedazo de codigo.
Código PHP:
function ataque1(){ // el 1 ataca al 2
cont1 = 1
dead2 = Math.round(points2 - attack1 * reduccion2 * valor1)
document.form1.dead_2.value = dead2
document.form1.effective_1.value = Math.round(attack1 * reduccion2 * valor1)
document.form1.cont_1.value = cont1
intervalo1 = setInterval("ataque1A()",cooldown1)
if (document.form1.dead_2.value > 0){document.form1.dead_2.style.color = ''}
}
function ataque2(){ // el 2 ataca al 1
cont2 = 1
dead1 = Math.round(points1 - attack2 * reduccion1 * valor2)
document.form1.dead_1.value = dead1
document.form1.effective_2.value = Math.round(attack2 * reduccion1 * valor2)
document.form1.cont_2.value = cont2
intervalo2 = setInterval("ataque2A()",cooldown2)
if (document.form1.dead_1.value > 0){document.form1.dead_1.style.color = ''}
}
function ataque1A(){
if ( document.form1.dead_2.value > 0 ){
cont1 = cont1 + 1
dead2A = Math.round(document.form1.dead_2.value - attack1 * reduccion2 * valor1)
document.form1.dead_2.value = dead2A
if (document.form1.dead_2.value <= 0){document.form1.dead_2.style.color = 'red'}
document.form1.cont_1.value = cont1
}else{
clearInterval(intervalo2)
document.form1.winner.value = document.form1.unidades1.options[document.form1.unidades1.selectedIndex].text + ' (1)'
}
}
function ataque2A(){
cont2 = cont2 + 1
if (document.form1.dead_1.value > 0 ){
dead1A = Math.round(document.form1.dead_1.value - attack2 * reduccion1 * valor2)
document.form1.dead_1.value = dead1A
if (document.form1.dead_1.value <= 0){document.form1.dead_1.style.color = 'red'}
document.form1.cont_2.value = cont2
}else{
clearInterval(intervalo1)
document.form1.winner.value = document.form1.unidades2.options[document.form1.unidades2.selectedIndex].text + ' (2)'
}
}