\n" if($mv_mode eq 'pc');
$log2 .="\n";
$log2 .="\n";
$log .=" \n";
$ck=1;
}elsif($ck==1){
# 戦闘処理読み込み
require './inc/ore_sub-battle.cgi';
$j=int($b_n-$b_v);
$j=0 if($j<1);
$log .="$cmp[$camp]軍 $nm $cl[$rank] 指揮($lr) 部隊数($sol) VS $cmp[$nation]軍 $tnm 指揮($tlr) 部隊数($tsol) \n";
$log .="- 戦闘限界まであと $j ターン - \n";
$log .=" \n";
$qz = int($lv-20);
if($b_n eq'' && $tlr eq''){
$tm = $ck = $cmd = 0;
$nation = 0;
$type='';
$log .="戦闘中にバグが発生しました!強制的にメイン画面に戻ります \n";
&call_main_st;
}
if($j>2 && $tm<10 && $cmd !=-1){
my $l=int(rand(5));
if($l==0 && $qz<$tlv){
$tm=50;
$log .="なんと敵軍を指揮する $tnm から一騎討ちの申\し込みが! どうしますか? \n";
$log .="敵将ステータス - $tnm ( HP $thp MP $tmp UA $tua UD $tud LV $tlv ) \n";
}
}
if($tm==50){
if($cmd==10){
$log .="一騎討ちの申\し込みを断った 評価がほんの少し下がった \n";
$tm=0;
$rank_exe-=1;
}elsif($cmd==20){
$log .="$tnm の挑戦を受けてこの戦いの勝敗を架けた一騎討ちを行なう事に! \n";
$tm=60;
$rank_exe+=1;
}
}elsif($tm==60){
$log .="真剣勝負開始! \n";
$tm=70;
}elsif($tm==70){
# 戦闘処理呼び出し
&bt_cm;
if($thp<1){
$G =int(rand(200))+((500*$tlv)-($lv*50));
$G =1 if($G<1);
$G =int(rand(500))+1500 if($G>2000);
$gold +=$G;
$E =int((((((rand(5))+5)+$tlv)*2)*0.8)-$lv);
$E =1 if($E<1);
$E =int(rand(50))+250 if($E>300);
$exe+=$E;
$thp=0;
$bst ='';
$bt =0;
$log .="$nm は $tnm を倒した! \n";
$log .="$G の金 と $E の経験値を得た! \n";
$log .="\n";
$H =int(rand(51)); $E = int((100+$H)*$lv);
$E = int((rand(500))+1800) if($E>2000);
$G = 20000;
#改造前は50+$H
$N = $H+150;
#ここまで
$exe+=$E;
$gold+=$G;
if($camp==1){
$cs1+=int($sol);
$cn1+=$N;
}elsif($camp==2){
$cs2+=int($sol);
$cn2+=$N;
}elsif($camp==3){
$cs3+=int($sol);
$cn3+=$N;
}elsif($camp==4){
$cs4+=int($sol);
$cn4+=$N;
}elsif($camp==5){
$cs5+=int($sol);
$cn5+=$N;
}
$tsol=int($tsol/2);
if($nation==1){
$cs1+=$tsol;
}elsif($nation==2){
$cs2+=$tsol;
}elsif($nation==3){
$cs3+=$tsol;
}elsif($nation==4){
$cs4+=$tsol;
}elsif($nation==5){
$cs5+=$tsol;
}
if($nation==1){
$cn1-=$N;
$cn1=0 if($cn1<1);
}elsif($nation==2){
$cn2-=$N;
$cn2=0 if($cn2<1);
}elsif($nation==3){
$cn3-=$N;
$cn3=0 if($cn3<1);
}elsif($nation==4){
$cn4-=$N;
$cn4=0 if($cn4<1);
}elsif($nation==5){
$cn5-=$N;
$cn5=0 if($cn5<1);
}
$log .="敵軍は $tnm の敗北に戦意を喪失しました!将を欠いた部隊など敵ではありません 敵軍を追撃し、かなりの被害を与えました! \n";
$log .="$cmp[$nation]から $N の国力を奪いました 更に$E の経験値と $G の報酬を得た! \n";
$wr_mes ="$date $cmp[$camp] の $syogo が $cmp[$nation] に侵攻、$tnm と一騎討ちの末これを下し $N の国力を奪う事に成功したようです";
&touitu;
$V =int(rand(6))+5;
$sol_lv-=$V;
$rank_exe+=int($V*2)+5;
$sol=0;
$tnm='';
$ck = $tm = $cmd = 0;
$nation=0;
$type='';
&hist_write;#国ログ
}elsif($hp<1){
$bst ='';
$bt =0;
$ck =0;
$hp =0;
$G=int(rand(10))+1;
$E=int(rand(5))+1;
$gold+=$G;
$exe+=$E;
$log .="あなたは $tnm に敗れ去った… \n";
$log .="$G の金 と $E の経験値を得た \n";
$log .="\n";
$sol=int($sol/2);
if($camp==1){
$cs1+=int($sol);
$cn1+=$N;
}elsif($camp==2){
$cs2+=int($sol);
$cn2+=$N;
}elsif($camp==3){
$cs3+=int($sol);
$cn3+=$N;
}elsif($camp==4){
$cs4+=int($sol);
$cn4+=$N;
}elsif($camp==5){
$cs5+=int($sol);
$cn5+=$N;
}
if($nation==1){
$cs1+=$tsol;
}elsif($nation==2){
$cs2+=$tsol;
}elsif($nation==3){
$cs3+=$tsol;
}elsif($nation==4){
$cs4+=$tsol;
}elsif($nation==5){
$cs5+=$tsol;
}
$log .="一騎討ちに敗れ指揮官を失ったあなたの部隊は敵にかなりの損害を与えられた… \n";
$rank_exe-=15;
$log .="部隊全滅という不名誉な敗北に、貴方に対する評価が著しく低下した \n";
if($rank_exe<1){
$rank--;
$rank=1 if($rank<1);
$next_rank=int(($rank*$rank)*3);
$v=$next_rank-10;
$rank_exe=$v;
$log .="一階級降格されてしまった… \n";
}
$wr_mes ="$date $cmp[$camp] の $syogo が $cmp[$nation] に侵攻、$tnm と一騎討ちを演じるが敗北し部隊は敗走したようです";
$sol=0;
$tnm='';
$ck = $tm = $cmd = 0;
$nation=0;
$type='';
&hist_write;#国ログ
}
}elsif($tm<1){
if($cmd==10){
my $btp = $ag + int(rand($lv/2) +1);
my $bte = $tag+ int(rand($tlv/2)+1);
if($j<3){
$log .="ここまで戦闘が進行した状態での退却は不\可\能\です \n";
$b_n+=1;
}elsif($btp<$bte){
$log .="敵軍に逃走経路を塞がれ、もはや撤退は不可能です。 \n";
$b_n+=1;
}else{
$log .="残念ですが作戦を中止し退却します \n";
if($camp==1){
$cs1+=int($sol);
}elsif($camp==2){
$cs2+=int($sol);
}elsif($camp==3){
$cs3+=int($sol);
}elsif($camp==4){
$cs4+=int($sol);
}elsif($camp==5){
$cs5+=int($sol);
}
if($nation==1){
$cs1+=$tsol;
}elsif($nation==2){
$cs2+=$tsol;
}elsif($nation==3){
$cs3+=$tsol;
}elsif($nation==4){
$cs4+=$tsol;
}elsif($nation==5){
$cs5+=$tsol;
}
$wr_mes ="$date $cmp[$camp] の $syogo が $cmp[$nation] に侵攻、 $tnm 防衛部隊と交戦。余儀なく撤退した模様";
$sol_lv-=int(rand(40));
$rank_exe-=1;
$rank_exe = 0 if($rank_exe<1);
$tnm='';
$ck = $tm = $cmd = 0;
$nation=0;
$type='';
&hist_write;#国ログ
}
}elsif($cmd==1){
$l=int(rand(3));
if($l==0){
$x=int(($sol/100)+($lr*10))+$sol_lv;
$y=int(($tsol/100)+($tlr*10))+$tsol_lv;
$x=1 if($x<1);
$y=1 if($y<1);
$log .="$nm (攻撃陣形) VS $tnm (攻撃陣形) \n";
$log .="○自軍被害 $y ●敵軍被害 $x \n";
$sol-=$y;
$tsol-=$x;
}elsif($l==1){
$x=int((($sol/100)+($lr*10))*2)+$sol_lv;
$y=int((($tsol/100)+($tlr*10))*0.5)+$tsol_lv;
$x=1 if($x<1);
$y=1 if($y<1);
$log .="$nm (攻撃陣形) VS $tnm (防御陣形) \n";
$log .="○自軍被害 $y ●敵軍被害 $x \n";
$sol-=$y;
$tsol-=$x;
}elsif($l==2){
$x=int((($sol/100)+($lr*10))*0.5)+$sol_lv;
$y=int((($tsol/100)+($tlr*10))*2)+$tsol_lv;
$x=1 if($x<1);
$y=1 if($y<1);
$log .="$nm (攻撃陣形) VS $tnm (突撃陣形) \n";
$log .="○自軍被害 $y ●敵軍被害 $x \n";
$sol-=$y;
$tsol-=$x;
}
}elsif($cmd==2){
$l=int(rand(3));
if($l==0){
$x=int((($sol/100)+($lr*10))*0.5)+$sol_lv;
$y=int((($tsol/100)+($tlr*10))*2)+$tsol_lv;
$x=1 if($x<1);
$y=1 if($y<1);
$log .="$nm (防御陣形) VS $tnm (攻撃陣形) \n";
$log .="○自軍被害 $y ●敵軍被害 $x \n";
$sol-=$y;
$tsol-=$x;
}elsif($l==1){
$x=int(($sol/100)+($lr*10))+$sol_lv;
$y=int(($tsol/100)+($tlr*10))+$tsol_lv;
$x=1 if($x<1);
$y=1 if($y<1);
$log .="$nm (防御陣形) VS $tnm (防御陣形) \n";
$log .="○自軍被害 $y ●敵軍被害 $x \n";
$sol-=$y;
$tsol-=$x;
}elsif($l==2){
$x=int((($sol/100)+($lr*10))*2)+$sol_lv;
$y=int((($tsol/100)+($tlr*10))*0.5)+$tsol_lv;
$x=1 if($x<1);
$y=1 if($y<1);
$log .="$nm (防御陣形) VS $tnm (突撃陣形) \n";
$log .="○自軍被害 $y ●敵軍被害 $x \n";
$sol-=$y;
$tsol-=$x;
}
}elsif($cmd==3){
$l=int(rand(3));
if($l==0){
$x=int((($sol/100)+($lr*10))*2)+$sol_lv;
$y=int((($tsol/100)+($tlr*10))*0.5)+$tsol_lv;
$x=1 if($x<1);
$y=1 if($y<1);
$log .="$nm (突撃陣形) VS $tnm (攻撃陣形) \n";
$log .="○自軍被害 $y ●敵軍被害 $x \n";
$sol-=$y;
$tsol-=$x;
}elsif($l==1){
$x=int((($sol/100)+($lr*10))*0.5)+$sol_lv;
$y=int((($tsol/100)+($tlr*10))*2)+$tsol_lv;
$x=1 if($x<1);
$y=1 if($y<1);
$log .="$nm (突撃陣形) VS $tnm (防御陣形) \n";
$log .="○自軍被害 $y ●敵軍被害 $x \n";
$sol-=$y;
$tsol-=$x;
}elsif($l==2){
$x=int(($sol/100)+($lr*10))+$sol_lv;
$y=int(($tsol/100)+($tlr*10))+$tsol_lv;
$x=1 if($x<1);
$y=1 if($y<1);
$log .="$nm (突撃陣形) VS $tnm (突撃陣形) \n";
$log .="○自軍被害 $y ●敵軍被害 $x \n";
$sol-=$y;
$tsol-=$x;
}
}
$log .=" \n";
if($sol<1&&$tsol<1){
$log .="両軍ともに壊滅的損害を受け戦闘継続が不可能となりました 今回の作戦は引き分けです\n";
$log .="国力は両陣営とも変化なし \n";
$H =int(rand(21));
$E = int((20+$H)*$lv);
$E = int(rand(50))+170 if($E>200);
$G = 5000;
$exe+=$E;
$gold+=$G;
$rank_exe-=10;
$log .="部隊全滅という不名誉な敗北の為、貴方に対する評価が著しく低下した \n";
if($rank_exe<1){
$rank--;
$rank=1 if($rank<1);
$next_rank=int(($rank*$rank)*3);
$v=$next_rank-10;
$rank_exe=$v;
$log .="一階級降格されてしまった… \n";
}
$log .="$E の経験値と $G の報酬を得た \n";
$wr_mes ="$date $cmp[$camp] の $syogo が $cmp[$nation] に侵攻、$tnm 防衛部隊に阻まれ激戦の末、両軍壊滅したようです";
$sol=0;
$sol_lv=0;
$tnm='';
$ck = $tm = $cmd = 0;
$nation=0;
$type='';
&hist_write;#国ログ
}elsif($tsol<1){
$log .="敵部隊を撃破しました! 我が軍の勝利です! \n";
$H =int(rand(51));
$E = int((100+$H)*$lv);
$E = int((rand(500))+1800) if($E>2000);
$G = 20000;
#改造前は50+$H
$N = $H+150;
#ここまで
$exe+=$E;
$gold+=$G;
if($camp==1){
$cs1+=int($sol);
$cn1+=$N;
}elsif($camp==2){
$cs2+=int($sol);
$cn2+=$N;
}elsif($camp==3){
$cs3+=int($sol);
$cn3+=$N;
}elsif($camp==4){
$cs4+=int($sol);
$cn4+=$N;
}elsif($camp==5){
$cs5+=int($sol);
$cn5+=$N;
}
if($nation==1){
$cn1-=$N;
$cn1=0 if($cn1<1);
}elsif($nation==2){
$cn2-=$N;
$cn2=0 if($cn2<1);
}elsif($nation==3){
$cn3-=$N;
$cn3=0 if($cn3<1);
}elsif($nation==4){
$cn4-=$N;
$cn4=0 if($cn4<1);
}elsif($nation==5){
$cn5-=$N;
$cn5=0 if($cn5<1);
}
$log .="$cmp[$nation]から $N の国力を奪いました $E の経験値と $G の報酬を得た! \n";
$wr_mes ="$date $cmp[$camp] の $syogo が $cmp[$nation] に侵攻、$tnm 防衛部隊を撃破。 $N の国力を奪う事に成功したようです";
&touitu;
$V =int(rand(6))+10;
$sol_lv-=$V;
$rank_exe+=$V;
$sol=0;
$tnm='';
$ck = $tm = $cmd = 0;
$nation=0;
$type='';
&hist_write;#国ログ
}elsif($sol<1){
$log .="我が軍は敗北しました…。残念ですが撤退します。 \n";
$log .="国力は両陣営とも変化なし \n";
$H =int(rand(21));
$E = int((20+$H)*$lv);
$E = int(rand(50))+170 if($E>200);
$G = 5000;
$exe+=$E;
$gold+=$G;
$log .="$E の経験値と $G の報酬を得た \n";
$wr_mes ="$date $cmp[$camp] の $syogo が $cmp[$nation] に侵攻、$tnm 防衛部隊の前に敗退したようです";
if($nation==1){
$cs1+=$tsol;
}elsif($nation==2){
$cs2+=$tsol;
}elsif($nation==3){
$cs3+=$tsol;
}elsif($nation==4){
$cs4+=$tsol;
}elsif($nation==5){
$cs5+=$tsol;
}
$rank_exe-=10;
$log .="部隊全滅という不名誉な敗北に、貴方に対する評価が著しく低下した \n";
if($rank_exe<1){
$rank--;
$rank=1 if($rank<1);
$next_rank=int(($rank*$rank)*3);
$v=$next_rank-10;
$rank_exe=$v;
$log .="一階級降格されてしまった… \n";
}
$sol=0;
$tnm='';
$ck = $tm = $cmd = 0;
$nation=0;
$type='';
&hist_write;#国ログ
}elsif($b_n<$b_v){
$log .="戦闘限界ターンを超えてしまった…これ以上は戦えません \n";
$log .="国力は両陣営とも変化なし \n";
$H =int(rand(21));
$E = int((20+$H)*$lv);
$E = int(rand(50))+170 if($E>200);
$G = 5000;
$exe+=$E;
$gold+=$G;
$log .="$E の経験値と $G の報酬を得た \n";
$wr_mes ="$date $cmp[$camp] の $syogo が $cmp[$nation] に侵攻、$tnm 防衛部隊に阻まれ戦闘限界をオーバーしたようです";
$rank_exe-=5;
$log .="作戦に失敗した為、貴方に対する評価が低下した \n";
if($rank_exe<1){
$rank--;
$rank=1 if($rank<1);
$next_rank=int(($rank*$rank)*3);
$v=$next_rank-10;
$rank_exe=$v;
$log .="一階級降格されてしまった… \n";
}
$sol_lv-=int(rand(40));
$sol=0;
$tnm='';
$ck = $tm = $cmd = 0;
$nation=0;
$type='';
&hist_write;#国ログ
}
$b_v+=1 if($cmd>0);
}
$log2 .=" |