さぁ、合計",live,"チームのバトルロイヤル!!
生き残るのは果たして誰か!?
いよいよ、戦闘開始!!
");
while(live>=2){ /*while文の戦闘開始*/
document.write("");
for(i=1;i<=8;i++){if(hp[i]>0){if(i==d){document.write("");};document.write(robo[i],"残りHP",hp[i],"
");if(i==d){document.write("");}}}
document.write("
");
a=d=0;
for(i=1;i<=8;i++){spe2[i]=spe[i]*(Math.random()+0.5);} /*スピードのランダム化*/
for(i=1;i<=8;i++){luck2[i]=luck[i]*(Math.random()+0.5);}/*うんのよさのランダム化*/
for(i=1;i<=8;i++){if(sanka[i]==0){kougeki[i]=2;syubi[i]=2;}}
damage=Math.min( Math.min(Math.min(kougeki[1],kougeki[2]),Math.min(kougeki[3],kougeki[4]) ) , Math.min(Math.min(kougeki[5],kougeki[6]) , Math.min(kougeki[7],kougeki[8]) ) );
if(damage>=2){for(i=1;i<=8;i++){kougeki[i]=0;}} /*限定解除damage変数を別目的で使ってる*/
damage=Math.min( Math.min(Math.min(syubi[1],syubi[2]),Math.min(syubi[3],syubi[4]) ) , Math.min(Math.min(syubi[5],syubi[6]) , Math.min(syubi[7],syubi[8]) ) );
if(damage>=2){for(i=1;i<=8;i++){syubi[i]=0;}} /*限定解除*/
for(i=1;i<=8;i++){if(kougeki[i]>=2){spe2[i]=0;}}/*攻撃側の回数限界*/
for(i=1;i<=8;i++){if(syubi[i]>=2){luck2[i]=99999;}} /*被攻撃側の回数限界*/
spemax=Math.max( Math.max(Math.max(spe2[1],spe2[2]),Math.max(spe2[3],spe2[4]) ) , Math.max(Math.max(spe2[5],spe2[6]) , Math.max(spe2[7],spe2[8]) ) );
luckmin=Math.min( Math.min(Math.min(luck2[1],luck2[2]),Math.min(luck2[3],luck2[4]) ) , Math.min(Math.min(luck2[5],luck2[6]) , Math.min(luck2[7],luck2[8]) ) );
for(i=1;i<=8;i++){if(spe2[i]==spemax){a=i;}} /*攻撃側決定*/
for(i=1;i<=8;i++){if(luck2[i]==luckmin){d=i;}} /*防御側決定*/
if(d==a || sanka[a]==sanka[d] || spe[d]==-1){while(a==d || sanka[a]==sanka[d] || spe[d]==-1){i=Math.ceil(Math.random()*8);{if(spe[i]!=-1 && i!=a){d=i}}}} /*防御側最終決定*/
syubi[d]=syubi[d]+1;
kougeki[a]=kougeki[a]+1;
if(Math.random()*100150){wtype[a]=Math.ceil(Math.random()*19);}
document.write(robo[a],"は",waza[a],"の呪文を唱えた!!!
");
if(wkaisu[a]>=1){
/*ooooooooooooooooooooooダメージ技oooooooooooooooooooooooooooooo*/
if(wtype[a]<=10){
damage=1.3;
if(wtype[a]==2){damage=0.7;}
if(wtype[a]==4){damage=0.7;}
if(wtype[a]==5){damage=2*luck[a]/(luck[a]+luck[d]);}
if(wtype[a]==6){damage=2*spe[a]/(spe[a]+spe[d]);}
if(wtype[a]==7){damage=1.0;}
if(wtype[a]==9){damage=1.0;}
if(wtype[a]==10){damage=0.4;}
if(Math.random()*100");}
if(wtype[a]==2){damage=Math.round(damage*1.2);document.write("激しい衝撃波が",robo[d],"を襲う!!
");}
if(wtype[a]==3 || wtype[a]==4){
damage=Math.round(att[d]*(Math.random()/4+0.9)+(Math.random()/4+0.9)*spe[d]/4-(Math.random()/4+0.9)*def[a]/4-(Math.random()/4+0.9)*luck[a]/4);if(damage<=0){damage=1;}
if(wtype[a]==3){damage=Math.round(damage*0.8);}
if(wtype[a]==4){damage=Math.round(damage*1.2);}
document.write(robo[a],"の感覚が研ぎ澄まされた!!
",robo[d],"の攻撃!
しかし、",robo[a],"は見切っていた!
",robo[a],"の反撃!!
");}
if(wtype[a]==5){damage=Math.round(Math.random()*2*luck[a]);document.write("光の玉がふわふわと",robo[d],"に向かって飛んでいった!
ラッキー!!命中!!!
");}
if(wtype[a]==6){document.write("トランス状態となった",robo[a],"が、",robo[d],"に襲いかかった!!
",robo[a],"の連続攻撃!!
");damage=Math.round(damage/5);j=Math.round(5*spe[a]/spe[d]);if(j<=0){j=0;}if(j>=7){j=7;};for(i=1;i<=j;i++){document.write(robo[d],"に",damage,"のダメージを与えた!!!
");hp[d]-=damage;damage=Math.round((Math.random()+0.5)*damage)+1;}}
if(wtype[a]==7){damage=maxhp[a]-hp[a];document.write(robo[a],"の怨念が衝撃波となって、",robo[d],"を襲う!
")}
if(wtype[a]==8){damage=Math.round(hp[d]/2);}
if(wtype[a]==9){damage=Math.round(maxhp[d]/4);}
if(wtype[a]==10){damage=Math.round(maxhp[d]/2);}
if(wtype[a]==8 || wtype[a]==9 || wtype[a]==10){document.write("一筋の光が、",robo[d],"の心臓を貫いた!!
");}
if(damage<=0){damage=1;}
document.write(robo[d],"に",damage,"のダメージを与えた!!!
");
hp[d]-=damage;
if(hp[d]<=0 && wtype[d]==13 && wkaisu[d]>=1){hp[d]=maxhp[d];wkaisu[d]-=1;document.write("
",robo[d],"は倒された!!
しかし、",robo[d],"は死ぬ間際、",waza[d],"を唱えた!
復活!!",robo[d],"のHPが全回復した。
");}
if(hp[d]<=0){spe[d]=-1;luck[d]=99999999999999;document.write("",robo[d],"は倒された!!
");
if(hp[d]>=-20){document.write("しかし、",robo[d],"奇跡的に一命を取り留めた!
");}
if(hp[d]<-20 && hp[d]>=-50){document.write(robo[d],"は悶死した!
");}
if(hp[d]<-50){document.write(robo[d],"は即死した!!
");}
j=sanka[d];team[j]-=1;if(team[j]==0){live-=1;team[j]=-1;}sanka[d]=0;
}
}else{document.write("しかし、呪文は失敗してしまった!!!
");}/*必殺外す*/}
/*ooooooooooooooooooooooダメージ技oooooooooooooooooooooooooooooo*/
if(wtype[a]==11 || wtype[a]==12){
if(wtype[a]==11){damage=Math.round(maxhp[a]/4);}
if(wtype[a]==12){damage=Math.round(maxhp[a]/2);}
document.write(robo[a],"のHPが",damage,"回復した!
");
wkaisu[a]-=1;hp[a]+=damage;if(hp[a]>maxhp[a]){hp[a]=maxhp[a];}}
if(wtype[a]==13){document.write("しかし、何もおこらなかった!
");}
if(wtype[a]==14){att[a]*=2;wkaisu[a]-=1;document.write(robo[a],"の攻撃力が上がった!!
");}
if(wtype[a]==15){def[a]*=2;wkaisu[a]-=1;document.write(robo[a],"の守備力が上がった!!
");}
if(wtype[a]==16){spe[a]*=2;luck[a]*=2;wkaisu[a]-=1;document.write(robo[a],"のすばやさと運のよさが上がった!!
");}
if(wtype[a]==17){att[d]/=2;document.write(robo[d],"の攻撃力を半減させた!!
");}
if(wtype[a]==18){def[d]/=2;document.write(robo[d],"の守備力を半減させた!!
");}
if(wtype[a]==19){spe[d]/=2;luck[d]/=2;document.write(robo[d],"のすばやさと運のよさを半減させた!!
");}
}else{document.write("しかし、MPが足りない!
");}
}else{ /*通常攻撃*/
document.write(robo[a],"の攻撃!
");
if(Math.random()*100<100*luck[a]/(luck[a]+luck[d]) || Math.round(Math.random()*100)<40){
damage=Math.round(att[a]*(Math.random()/3+1)+(Math.random()/3+0.9)*spe[a]/4-(Math.random()/3+0.9)*def[d]-(Math.random()/3+0.9)*luck[d]/4);
if(damage<=0){damage=1;}
document.write(robo[d],"に",damage,"のダメージを与えた!!!
");
hp[d]-=damage;
if(hp[d]<=0 && wtype[d]==13 && wkaisu[d]>=1){hp[d]=maxhp[d];wkaisu[d]-=1;document.write("
",robo[d],"は倒された!!
しかし、",robo[d],"は死ぬ間際、",waza[d],"を唱えた!
復活!!",robo[d],"のHPが全回復した。
");}
if(hp[d]<=0){spe[d]=-1;luck[d]=99999999999999;document.write("",robo[d],"は倒された!!
");
if(hp[d]>=-20){document.write("しかし、",robo[d],"は奇跡的に一命を取り留めた!
");}
if(hp[d]<-20 && hp[d]>=-50){document.write(robo[d],"は悶死した!
");}
if(hp[d]<-50){document.write(robo[d],"は即死した!!
");}
j=sanka[d];team[j]-=1;if(team[j]==0){live-=1;team[j]=-1;}sanka[d]=0;
}
}else{document.write("しかし、",robo[d],"はうまくかわした!!
");}
}
} /*while文の戦闘ここまで*/
if(live<=1){for(i=1;i<=8;i++){if(hp[i]>0){document.write("",robo[i],"残りHP",hp[i],"
",robo[i],"の勝利!!
優勝、おめでとう!!
",robo[i],"こそ、世界最強の勇者だ!!