function genEnemy(a) {
//javascript:alert(en[0]+'\n'+genEnemy(en[0])+'\n'+en[0])
with (Math) {
a[1]=round(a[1]*(.5+random()))
a[2]=round(a[2]*(1+random()))
for (var b=0;b<5;b++) a[3][b]=round(a[3][b]*(a[3][b]/2+random()*a[3][b]/10))
for (var b=0;b<a[4].length;b++) random()<it[a[4][b]][3]/10?a[4][b]=0:0
}
return a
}
Script to generate an enemy's stats given the bases each enemy array. (RPG game) The problem is, when I am expecting it to return an array containing the new stats, it also sets the enemy array to the new one. Why is this? Obviously you can see how problems are caused by this (the bases being changed so a weak enemy can become uber powerful). How would I stop it from setting the array in en (array of enemy values)?