정적 분석 결과 수정. 배열 선언 문제.

This commit is contained in:
2018-04-06 20:32:57 +09:00
parent ffc0fc0c6f
commit d0e7358f68
16 changed files with 191 additions and 329 deletions
+1
View File
@@ -36,6 +36,7 @@ return [
'hwe/func_template.php',
'hwe/func_time_event.php',
'hwe/func_tournament.php',
'hwe/process_war.php',
'hwe/func.php'
],
+1
View File
@@ -3,6 +3,7 @@ namespace sammo;
include "lib.php";
include "func.php";
$btn = Util::array_get($_POST['btn']);
$yearmonth = $_POST['yearmonth'];
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
+1 -1
View File
@@ -37,7 +37,7 @@ for($i=0; $i < $nationcount; $i++) {
$citycount = MYDB_num_rows($cityresult);
$nationnum[count($nationnum)] = $nation['nation'];
$nationnum[] = $nation['nation'];
$nationname[$nation['nation']] = $nation['name'];
$nationcolor[$nation['nation']] = $nation['color'];
+1 -1
View File
@@ -111,7 +111,7 @@ if($btn == "자동개최설정" && $session->userGrade >= 5) {
}
for($i=0; $i < 8; $i++) {
if($occupied[$i] == 0) {
$map[count($map)] = $i;
$map[] = $i;
}
}
+4 -5
View File
@@ -564,13 +564,11 @@ function commandTable() {
addCommand("탈취(무력경험, 자금$develcost5, 군량$develcost5)", 33);
addCommand("파괴(무력경험, 자금$develcost5, 군량$develcost5)", 34);
addCommand("선동(통솔경험, 자금$develcost5, 군량$develcost5)", 35);
// addCommand("기습(통, 무, 지, 자금$develcost10, 군량$develcost10)", 36);
} else {
addCommand("화계(지력경험, 자금$develcost5, 군량$develcost5)", 32, 0);
addCommand("탈취(무력경험, 자금$develcost5, 군량$develcost5)", 33, 0);
addCommand("파괴(무력경험, 자금$develcost5, 군량$develcost5)", 34, 0);
addCommand("선동(통솔경험, 자금$develcost5, 군량$develcost5)", 35, 0);
// addCommand("기습(통, 무, 지, 자금500, 군량500)", 36, 0);
}
commandGroup("", 1);
commandGroup("========= 개 인 ==========");
@@ -1904,6 +1902,7 @@ function updateTurntime($no) {
$db = DB::db();
$connect=$db->get();
$alllog = [];
$log = [];
$query = "select year,month,isUnited,turnterm from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -2195,7 +2194,7 @@ function uniqueItem($general, $log, $vote=0) {
}
for($i=7; $i <= 26; $i++) {
if($occupied[$i] == 0) {
$item[count($item)] = $i;
$item[] = $i;
}
}
$it = $item[rand() % count($item)];
@@ -2267,8 +2266,8 @@ function uniqueItem($general, $log, $vote=0) {
}
break;
}
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushWorldHistory($history, $admin['year'], $admin['month']);
pushGeneralPublicRecord($alllog, $game['year'], $game['month']);
pushWorldHistory($history, $game['year'], $game['month']);
}
}
return $log;
+8 -1
View File
@@ -62,7 +62,7 @@ function registerAuction() {
}
for($i=7; $i <= 26; $i++) {
if($occupied[$i] == 0) {
$item[count($item)] = $i;
$item[] = $i;
}
}
$it = $item[rand() % count($item)];
@@ -144,6 +144,13 @@ function processAuction() {
$db = DB::db();
$connect=$db->get();
$trader = [];
$traderLog = [];
$auctionLog = [];
$bidderLog = [];
$alllog = [];
$history = [];
$date = date("Y-m-d H:i:s");
$query = "select year,month from game limit 1";
+13 -17
View File
@@ -6,6 +6,7 @@ function getTurn($general, $type, $font=1) {
$db = DB::db();
$connect=$db->get();
$turn = [];
$turn[0] = $general["turn0"];
if($type >= 1) {
@@ -146,11 +147,6 @@ function getTurn($general, $type, $font=1) {
$city= getCity($double, "name");
$str[$i] = "{$city['name']}】에 선동 실행";
break;
case 36: //기습
$double = $command[1];
$city= getCity($double, "name");
$str[$i] = "{$city['name']}】에 기습 실행";
break;
case 41: //단련
$str[$i] = "숙련도를 단련";
@@ -283,7 +279,7 @@ function getCoreTurn($nation, $level) {
case 23: //포상
$fourth = $command[3];
$third = $command[2];
$double = $command[1];
$double = (int)$command[1];
$query = "select name from general where no='$third'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -316,7 +312,7 @@ function getCoreTurn($nation, $level) {
$str[$i] = "{$general['name']}】【{$city['name']}】(으)로 발령";
break;
case 51: //항복권고
$double = $command[1];
$double = (int)$command[1];
$nation = getNationStaticInfo($double);
@@ -325,7 +321,7 @@ function getCoreTurn($nation, $level) {
case 52: //원조
$fourth = $command[3];
$third = $command[2];
$double = $command[1];
$double = (int)$command[1];
$nation = getNationStaticInfo($double);
@@ -338,7 +334,7 @@ function getCoreTurn($nation, $level) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
$double = $command[1];
$double = (int)$command[1];
$nation = getNationStaticInfo($double);
@@ -346,7 +342,7 @@ function getCoreTurn($nation, $level) {
break;
case 61: //불가침제의
$third = $command[2];
$double = $command[1];
$double = (int)$command[1];
$nation = getNationStaticInfo($double);
@@ -422,14 +418,14 @@ function getCoreTurn($nation, $level) {
$str[$i] = "의병모집";
break;
case 77: //이호경식
$double = $command[1];
$double = (int)$command[1];
$nation = getNationStaticInfo($double);
$str[$i] = "{$nation['name']}】에 이호경식";
break;
case 78: //급습
$double = $command[1];
$double = (int)$command[1];
$nation = getNationStaticInfo($double);
@@ -585,7 +581,6 @@ function processCommand($no) {
case 33: process_33($general); break; //탈취
case 34: process_34($general); break; //파괴
case 35: process_35($general); break; //선동
case 36: process_36($general); break; //기습
case 41: process_41($general); break; //단련
case 42: process_42($general); break; //견문
@@ -752,10 +747,11 @@ function EncodeCommand($fourth, $third, $double, $command) {
}
function DecodeCommand($str) {
$command[3] = floor(substr($str, 0, 4));
$command[2] = floor(substr($str, 4, 4));
$command[1] = floor(substr($str, 8, 4));
$command[0] = floor(substr($str, 12, 2));
$command = [];
$command[3] = (int)(substr($str, 0, 4));
$command[2] = (int)(substr($str, 4, 4));
$command[1] = (int)(substr($str, 8, 4));
$command[0] = (int)(substr($str, 12, 2));
return $command;
}
+2 -2
View File
@@ -679,7 +679,7 @@ function processAI($no) {
$result = MYDB_query($query, $connect) or Error("processAI20 ".MYDB_error($connect),"");
$targetCity = MYDB_fetch_array($result);
//공백지이면 타겟에 포함
if($targetCity['nation'] == 0) { $target[count($target)] = $targetCity['city']; }
if($targetCity['nation'] == 0) { $target[] = $targetCity['city']; }
}
if(count($target) == 0 || $isStart == 1 || $nation['war'] == 1) { $command = EncodeCommand(0, 0, 0, 1); } //공격 가능도시가 없으면 내정
else { $command = EncodeCommand(0, 0, $target[rand()%count($target)], 16); } //있으면 공격
@@ -850,7 +850,7 @@ function processAI($no) {
$dipResult = MYDB_query($query, $connect) or Error("processAI22 ".MYDB_error($connect),"");
$dip = MYDB_fetch_array($dipResult);
//전쟁중인 국가이면 타겟에 포함
if($dip['state'] == 0) $target[count($target)] = $targetCity['city'];
if($dip['state'] == 0) $target[] = $targetCity['city'];
}
}
if(count($target) == 0) {
+3 -3
View File
@@ -1456,7 +1456,7 @@ function process_26(&$general) {
$ded = CharDedication($ded, $general['personal']);
//부대원에게 로그 전달
$genlog[count($genlog)] = "<C>●</><S>{$troop['name']}</>의 부대원들은 <G><b>{$city['name']}</b></>(으)로 집합되었습니다.";
$genlog[] = "<C>●</><S>{$troop['name']}</>의 부대원들은 <G><b>{$city['name']}</b></>(으)로 집합되었습니다.";
for($i=0; $i < $gencount; $i++) {
$troopgen = MYDB_fetch_array($result);
@@ -1729,7 +1729,7 @@ function process_31(&$general) {
}
// 기존 첩보 목록에 없으면 새로 등록, 있으면 갱신
if($exist == 0) {
$citys[count($citys)] = $destination * 10 + 3;
$citys[] = $destination * 10 + 3;
} else {
$citys[$i] = $destination * 10 + 3;
}
@@ -2084,7 +2084,7 @@ function process_43(&$general) {
} elseif($city['supply'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 증여 실패. <1>$date</>";
} else {
$genlog[count($genlog)] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>에게서 $dtype <C>$amount</>을 증여 받았습니다.";
$genlog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>에게서 $dtype <C>$amount</>을 증여 받았습니다.";
$log[] = "<C>●</>{$admin['month']}월:<Y>{$gen['name']}</>에게 $dtype <C>$amount</>을 증여했습니다. <1>$date</>";
if($what == 1) {
+14 -14
View File
@@ -64,7 +64,7 @@ function process_23(&$general) {
} elseif($gen['nation'] != $general['nation']) {
$log[] = "<C>●</>{$admin['month']}월:아국 장수가 아닙니다. 포상 실패. <1>$date</>";
} else {
$genlog[count($genlog)] = "<C>●</>$dtype <C>$amount</>을 포상으로 받았습니다.";
$genlog[] = "<C>●</>$dtype <C>$amount</>을 포상으로 받았습니다.";
$log[] = "<C>●</>{$admin['month']}월:<Y>{$gen['name']}</>에게 $dtype <C>$amount</>을 수여했습니다. <1>$date</>";
$exp = 1;
$ded = 1;
@@ -174,7 +174,7 @@ function process_24(&$general) {
PushMsg(1, 0, $gen['picture'], $gen['imgsvr'], "{$gen['name']}:", $nation['color'], $nation['name'], $nation['color'], $str);
}
$genlog[count($genlog)] = "<C>●</>$dtype {$amount}을 몰수 당했습니다.";
$genlog[] = "<C>●</>$dtype {$amount}을 몰수 당했습니다.";
$log[] = "<C>●</>{$admin['month']}월:<Y>{$gen['name']}</>에게서 $dtype <C>$amount</>을 몰수했습니다. <1>$date</>";
$exp = 1;
$ded = 1;
@@ -522,7 +522,7 @@ function process_53(&$general) {
}
//기존 메세지 한칸씩 뒤로 미룸
for($i=$deleted-1; $i >=0; $i--) {
moveMsg("nation", "dip", $i+1, $younatin["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
moveMsg("nation", "dip", $i+1, $younation["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
}
//권고 서신시 장수번호/상대국 번호
$me = $general['no'] * 10000 + $younation['nation'];
@@ -595,7 +595,7 @@ function process_61(&$general) {
}
//기존 메세지 한칸씩 뒤로 미룸
for($i=$deleted-1; $i >=0; $i--) {
moveMsg("nation", "dip", $i+1, $younatin["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
moveMsg("nation", "dip", $i+1, $younation["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
}
//권고 서신시 장수번호/상대국 번호
$me = $general['no'] * 10000 + $younation['nation'];
@@ -773,7 +773,7 @@ function process_63(&$general) {
}
//기존 메세지 한칸씩 뒤로 미룸
for($i=$deleted-1; $i >=0; $i--) {
moveMsg("nation", "dip", $i+1, $younatin["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
moveMsg("nation", "dip", $i+1, $younation["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
}
//권고 서신시 장수번호/상대국 번호
$me = $general['no'] * 10000 + $younation['nation'];
@@ -841,7 +841,7 @@ function process_64(&$general) {
}
//기존 메세지 한칸씩 뒤로 미룸
for($i=$deleted-1; $i >=0; $i--) {
moveMsg("nation", "dip", $i+1, $younatin["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
moveMsg("nation", "dip", $i+1, $younation["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
}
//권고 서신시 장수번호/상대국 번호
$me = $general['no'] * 10000 + $younation['nation'];
@@ -1312,7 +1312,7 @@ function process_71(&$general) {
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <M>필사즉생</>(을)를 발동하였습니다.";
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <M>필사즉생</>(을)를 발동하였습니다.";
$tricklog[count($tricklog)] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <M>필사즉생</>(을)를 발동하였습니다.";
$tricklog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <M>필사즉생</>(을)를 발동하였습니다.";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<M>필사즉생</>(을)를 발동");
pushNationHistory($nation, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>{$general['name']}</>(이)가 <M>필사즉생</>(을)를 발동");
@@ -1426,7 +1426,7 @@ function process_72(&$general) {
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>에 <M>백성동원</>(을)를 발동하였습니다.";
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>백성동원</>(을)를 발동하였습니다.";
$tricklog[count($tricklog)] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>백성동원</>(을)를 발동하였습니다.";
$tricklog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>백성동원</>(을)를 발동하였습니다.";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 <M>백성동원</>(을)를 발동");
pushNationHistory($nation, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>에 <M>백성동원</>(을)를 발동");
@@ -1555,7 +1555,7 @@ function process_73(&$general) {
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동하였습니다.";
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동하였습니다.";
$tricklog[count($tricklog)] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동하였습니다.";
$tricklog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동하였습니다.";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동");
pushNationHistory($nation, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>의 <G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동");
pushNationHistory($destnation, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 아국의 <G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동");
@@ -1676,7 +1676,7 @@ function process_74(&$general) {
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동하였습니다.";
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동하였습니다.";
$tricklog[count($tricklog)] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동하였습니다.";
$tricklog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동하였습니다.";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동");
pushNationHistory($nation, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>의 <G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동");
pushNationHistory($destnation, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 아국의 <G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동");
@@ -1821,7 +1821,7 @@ function process_75(&$general) {
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>피장파장</>(을)를 발동하였습니다.";
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>피장파장</>(을)를 발동하였습니다.";
$tricklog[count($tricklog)] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>피장파장</>(을)를 발동하였습니다.";
$tricklog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>피장파장</>(을)를 발동하였습니다.";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$destnation['name']}</b></>에 <M>피장파장</>(을)를 발동");
pushNationHistory($nation, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>피장파장</>(을)를 발동");
pushNationHistory($destnation, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 아국에 <M>피장파장</>(을)를 발동");
@@ -1924,7 +1924,7 @@ function process_76(&$general) {
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <M>의병모집</>(을)를 발동하였습니다.";
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <M>의병모집</>(을)를 발동하였습니다.";
$tricklog[count($tricklog)] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <M>의병모집</>(을)를 발동하였습니다.";
$tricklog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <M>의병모집</>(을)를 발동하였습니다.";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<M>의병모집</>(을)를 발동");
pushNationHistory($nation, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>{$general['name']}</>(이)가 <M>의병모집</>(을)를 발동");
@@ -2162,7 +2162,7 @@ function process_77(&$general) {
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>이호경식</>(을)를 발동하였습니다.";
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>이호경식</>(을)를 발동하였습니다.";
$tricklog[count($tricklog)] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>이호경식</>(을)를 발동하였습니다.";
$tricklog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>이호경식</>(을)를 발동하였습니다.";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$destnation['name']}</b></>에 <M>이호경식</>(을)를 발동");
pushNationHistory($nation, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>이호경식</>(을)를 발동");
pushNationHistory($destnation, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 아국에 <M>이호경식</>(을)를 발동");
@@ -2291,7 +2291,7 @@ function process_78(&$general) {
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>급습</>(을)를 발동하였습니다.";
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>급습</>(을)를 발동하였습니다.";
$tricklog[count($tricklog)] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>급습</>(을)를 발동하였습니다.";
$tricklog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>급습</>(을)를 발동하였습니다.";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$destnation['name']}</b></>에 <M>급습</>(을)를 발동");
pushNationHistory($nation, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>급습</>(을)를 발동");
pushNationHistory($destnation, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 아국에 <M>급습</>(을)를 발동");
+4 -147
View File
@@ -9,7 +9,7 @@ function process_32(&$general) {
$log = [];
$alllog = [];
$history = [];
global $_firing, $_basefiring, $_firingpower;
global $_firing, $_basefiring, $_firingbase, $_firingpower;
$date = substr($general['turntime'],11,5);
$query = "select year,month,develcost from game limit 1";
@@ -134,7 +134,7 @@ function process_33(&$general) {
$log = [];
$alllog = [];
$history = [];
global $_firing, $_basefiring, $_firingpower;
global $_firing, $_basefiring, $_firingbase, $_firingpower;
//탈취는 0까지 무제한
$date = substr($general['turntime'],11,5);
@@ -286,7 +286,7 @@ function process_34(&$general) {
$log = [];
$alllog = [];
$history = [];
global $_firing, $_basefiring, $_firingpower;
global $_firing, $_basefiring, $_firingbase, $_firingpower;
$date = substr($general['turntime'],11,5);
$query = "select year,month,develcost from game limit 1";
@@ -412,7 +412,7 @@ function process_35(&$general) {
$log = [];
$alllog = [];
$history = [];
global $_firing, $_basefiring, $_firingpower;
global $_firing, $_basefiring, $_firingbase, $_firingpower;
$date = substr($general['turntime'],11,5);
$query = "select year,month,develcost from game limit 1";
@@ -532,146 +532,3 @@ function process_35(&$general) {
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushGenLog($general, $log);
}
function process_36(&$general) {
return process_99($general);
$db = DB::db();
$connect=$db->get();
$log = [];
$alllog = [];
$history = [];
global $_firing, $_basefiring, $_firingpower;
$date = substr($general['turntime'],11,5);
$query = "select year,month,develcost from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$dist = searchDistance($general['city'], 5, false);
$command = DecodeCommand($general['turn0']);
$destination = $command[1];
$query = "select * from city where city='$destination'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$destcity = MYDB_fetch_array($result);
$mynation = getNationStaticInfo($general['nation']);
$lbonus = setLeadershipBonus($general, $mynation['level']);
$query = "select nation,supply from city where city='{$general['city']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
$query = "select state from diplomacy where me='{$general['nation']}' and you='{$destcity['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result);
if(!$destcity) {
$log[] = "<C>●</>{$admin['month']}월:없는 도시입니다. 기습 실패. <1>$date</>";
} elseif($general['level'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:재야입니다. <G><b>{$destcity['name']}</b></>에 기습 실패. <1>$date</>";
} elseif($general['nation'] != $city['nation'] && $mynation['level'] != 0) {
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. <G><b>{$destcity['name']}</b></>에 기습 실패. <1>$date</>";
} elseif($city['supply'] == 0 && $mynation['level'] != 0) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. <G><b>{$destcity['name']}</b></>에 기습 실패. <1>$date</>";
} elseif($destcity['nation'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:공백지입니다. <G><b>{$destcity['name']}</b></>에 기습 실패. <1>$date</>";
} elseif($general['gold'] < $admin['develcost']*5) {
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. <G><b>{$destcity['name']}</b></>에 기습 실패. <1>$date</>";
} elseif($general['rice'] < $admin['develcost']*5) {
$log[] = "<C>●</>{$admin['month']}월:군량이 모자랍니다. <G><b>{$destcity['name']}</b></>에 기습 실패. <1>$date</>";
} elseif($general['nation'] == $destcity['nation']) {
$log[] = "<C>●</>{$admin['month']}월:아국입니다. <G><b>{$destcity['name']}</b></>에 기습 실패. <1>$date</>";
} elseif($dip['state'] >= 7) {
$log[] = "<C>●</>{$admin['month']}월:불가침국입니다. <G><b>{$destcity['name']}</b></>에 기습 실패. <1>$date</>";
} else {
$query = "select ROUND((leader+intel+power)*(100-injury)/100)+weap+horse+book as sum,weap,horse,book from general where city='$destination' and nation='{$destcity['nation']}' order by sum desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result);
$generalStatAll = getGeneralLeadership($general, true, true, true)
+ getGeneralPower($general, true, true, true)
+ getGeneralIntel($general, true, true, true);
$ratio = round((($generalStatAll - ($gen['sum']+getWeapEff($gen['weap'])+getHorseEff($gen['horse'])+getBookEff($gen['book']))) / $_firing - ($destcity['secu']/$destcity['secu2'])/5 + $_basefiring)*100);
$ratio2 = rand() % 100;
if($general['item'] == 5) {
// 이추 사용
$ratio += 10;
$query = "update general set item=0 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$log[] = "<C>●</><C>".getItemName($general['item'])."</>(을)를 사용!";
$general['item'] = 0;
} elseif($general['item'] == 6) {
// 향낭 사용
$ratio += 20;
$query = "update general set item=0 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$log[] = "<C>●</><C>".getItemName($general['item'])."</>(을)를 사용!";
$general['item'] = 0;
} elseif($general['item'] >= 21 && $general['item'] <= 22) {
// 육도, 삼략 사용
$ratio += 20;
}
// 특기보정 : 신산, 귀모
if($general['special2'] == 41) { $ratio += 10; }
if($general['special'] == 31) { $ratio += 20; }
// 국가보정
if($mynation['type'] == 9) { $ratio += 10; }
// 거리보정
$ratio /= Util::array_get($dist[$destination], 99);
if($ratio > $ratio2) {
$alllog[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>(이)가 누군가에게 공격 받았습니다.";
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 기습이 성공했습니다. <1>$date</>";
// 기습
$destcity['agri'] -= rand() % round($_firingpower/2) + $_firingbase;
$destcity['comm'] -= rand() % round($_firingpower/2) + $_firingbase;
$destcity['secu'] -= rand() % round($_firingpower/4) + $_firingbase;
$destcity['def'] -= rand() % round($_firingpower/2) + $_firingbase;
$destcity['wall'] -= rand() % round($_firingpower/2) + $_firingbase;
$destcity['rate'] -= rand() % round($_firingpower/50) + $_firingbase/50;
if($destcity['agri'] < 0) { $destcity['agri'] = 0; }
if($destcity['comm'] < 0) { $destcity['comm'] = 0; }
if($destcity['secu'] < 0) { $destcity['secu'] = 0; }
if($destcity['def'] < 0) { $destcity['def'] = 0; }
if($destcity['wall'] < 0) { $destcity['wall'] = 0; }
if($destcity['rate'] < 0) { $destcity['rate'] = 0; }
$query = "update city set state=32,agri='{$destcity['agri']}',comm='{$destcity['comm']}',secu='{$destcity['secu']}',def='{$destcity['def']}',wall='{$destcity['wall']}',rate='{$destcity['rate']}' where city='$destination'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set firenum=firenum+1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
TrickInjury($destination);
$exp = rand() % 100 + 201;
$ded = rand() % 70 + 141;
} else {
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 기습이 실패했습니다. <1>$date</>";
$exp = rand() % 100 + 1;
$ded = rand() % 70 + 1;
}
// 성격 보정
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
$general['leader2']++;
$general['intel2']++;
$general['power2']++;
$general['gold'] -= $admin['develcost']*5;
$general['rice'] -= $admin['develcost']*5;
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',rice='{$general['rice']}',leader2='{$general['leader2']}',intel2='{$general['intel2']}',power2='{$general['power2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$log = checkAbility($general, $log);
}
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushGenLog($general, $log);
}
+1 -1
View File
@@ -83,7 +83,7 @@ function processGoldIncome() {
// 실지급율
$ratio = $realoutcome / $originoutcome;
}
$adminLog[count($adminLog)] = StringUtil::Fill2($nation['name'],12," ")." // 세금 : ".StringUtil::Fill2($income,6," ")." // 세출 : ".StringUtil::Fill2($originoutcome,6," ")." // 실제 : ".tab2($realoutcome,6," ")." // 지급율 : ".tab2(round($ratio*100,2),5," ")." % // 결과금 : ".tab2($nation['gold'],6," ");
$adminLog[] = StringUtil::Fill2($nation['name'],12," ")." // 세금 : ".StringUtil::Fill2($income,6," ")." // 세출 : ".StringUtil::Fill2($originoutcome,6," ")." // 실제 : ".tab2($realoutcome,6," ")." // 지급율 : ".tab2(round($ratio*100,2),5," ")." % // 결과금 : ".tab2($nation['gold'],6," ");
$query = "select no,name,nation from general where nation='{$nation['nation']}' and level>='9'";
$coreresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
+3
View File
@@ -275,6 +275,9 @@ function fillLowGenAll() {
$db = DB::db();
$connect=$db->get();
$general = [];
$grpCount = [];
$query = "select develcost from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
-1
View File
@@ -86,7 +86,6 @@ switch($commandtype) {
// case 33: command_33($turn, 33); break; //탈취
// case 34: command_34($turn, 34); break; //파괴
// case 35: command_35($turn, 35); break; //선동
// case 36: command_36($turn, 36); break; //기습
case 41: command_Single($turn, 41); break; //단련
case 42: command_Single($turn, 42); break; //견문
+135 -135
View File
@@ -18,7 +18,7 @@ function processWar($general, $city) {
$deadAmount['att'] = 0;
$deadAmount['def'] = 0;
$warphase = GameConst::byID($general['crewtype'])->speed; //병종간 페이즈 수 얻기
$warphase = GameUnitConst::byID($general['crewtype'])->speed; //병종간 페이즈 수 얻기
// 특기보정 : 돌격
if($general['special2'] == 60) { $warphase += 1; }
@@ -216,15 +216,15 @@ function processWar($general, $city) {
$type = rand() % 3;
switch($type) {
case 0:
$batlog[count($batlog)] = "<C>●</><D>급습</>을 <C>성공</>했다!";
$batlog[] = "<C>●</><D>급습</>을 <C>성공</>했다!";
$cityCrew *= 1.2;
break;
case 1:
$batlog[count($batlog)] = "<C>●</><D>위보</>를 <C>성공</>했다!";
$batlog[] = "<C>●</><D>위보</>를 <C>성공</>했다!";
$cityCrew *= 1.4;
break;
case 2:
$batlog[count($batlog)] = "<C>●</><D>혼란</>을 <C>성공</>했다!";
$batlog[] = "<C>●</><D>혼란</>을 <C>성공</>했다!";
$cityCrew *= 1.6;
break;
}
@@ -232,15 +232,15 @@ function processWar($general, $city) {
$type = rand() % 3;
switch($type) {
case 0:
$batlog[count($batlog)] = "<C>●</><D>급습</>을 <R>실패</>했다!";
$batlog[] = "<C>●</><D>급습</>을 <R>실패</>했다!";
$cityCrew /= 1.2; $myCrew *= 1.2;
break;
case 1:
$batlog[count($batlog)] = "<C>●</><D>위보</>를 <R>실패</>했다!";
$batlog[] = "<C>●</><D>위보</>를 <R>실패</>했다!";
$cityCrew /= 1.4; $myCrew *= 1.4;
break;
case 2:
$batlog[count($batlog)] = "<C>●</><D>혼란</>을 <R>실패</>했다!";
$batlog[] = "<C>●</><D>혼란</>을 <R>실패</>했다!";
$cityCrew /= 1.6; $myCrew *= 1.6;
break;
}
@@ -272,7 +272,7 @@ function processWar($general, $city) {
if($general['special2'] == 62) { $myCrew *= 0.90; }
$ratio = rand() % 100; // 0 ~ 99
if(($general['special2'] == 73 || $general['item'] == 23 || $general['item'] == 24) && $ratio > 80 && $avoid == 1) {
$batlog[count($batlog)] = "<C>●</><C>치료</>했다!</>";
$batlog[] = "<C>●</><C>치료</>했다!</>";
$myCrew /= 1.5; // 66%만 소모
$avoid = 0;
}
@@ -287,19 +287,19 @@ function processWar($general, $city) {
if($general['special2'] == 61) { $ratio += 10; }
if($general['special2'] == 71) { $ratio += 20; }
if($ratio >= $rd && $avoid == 1) {
$batlog[count($batlog)] = "<C>●</><C>필살</>공격!</>";
$batlog[] = "<C>●</><C>필살</>공격!</>";
$cityCrew = CriticalScore2($cityCrew);
$avoid = 0;
}
//회피
$ratio = rand() % 100; // 0 ~ 99
$ratio2 = GameConst::byID($general['crewtype'])->avoid; //회피율
$ratio2 = GameUnitConst::byID($general['crewtype'])->avoid; //회피율
//특기보정 : 궁병
if($general['special2'] == 51) { $ratio2 += 20; }
//도구 보정 : 둔갑천서, 태평요술
if($general['item'] == 26 || $general['item'] == 25) { $ratio2 += 20; }
if($ratio < $ratio2 && $avoid == 1) {
$batlog[count($batlog)] = "<C>●</><C>회피</>했다!</>";
$batlog[] = "<C>●</><C>회피</>했다!</>";
$myCrew /= 10; // 10%만 소모
$avoid = 0;
}
@@ -310,7 +310,7 @@ function processWar($general, $city) {
//특기보정 : 위압
if($general['special2'] == 63 && $phase == 1 && $general['crew'] >= 1000 && $general['atmos'] >= 90 && $general['train'] >= 90) {
$batlog[count($batlog)] = "<C>●</>상대에게 <C>위압</>을 줬다!</>";
$batlog[] = "<C>●</>상대에게 <C>위압</>을 줬다!</>";
$myCrew = 0;
}
@@ -362,7 +362,7 @@ function processWar($general, $city) {
$general['crew'] = round($general['crew']);
$cityCrew = round($cityCrew);
$myCrew = round($myCrew);
$batlog[count($batlog)] = "<C>●</> $phase : <Y1>【{$general['name']}】</> <C>{$general['crew']} (-$myCrew)</> VS <C>{$city['def']} (-$cityCrew)</> <Y1>【{$city['name']}】</>";
$batlog[] = "<C>●</> $phase : <Y1>【{$general['name']}】</> <C>{$general['crew']} (-$myCrew)</> VS <C>{$city['def']} (-$cityCrew)</> <Y1>【{$city['name']}】</>";
$mykillnum += $cityCrew; $mydeathnum += $myCrew;
@@ -404,8 +404,8 @@ function processWar($general, $city) {
]);
$log[] = $res;//TODO: $log를 출력할 때 date에 대해선 숨겨야 함.
$batlog[count($batlog)] = $res;
$batres[count($batres)] = $res;
$batlog[] = $res;
$batres[] = $res;
$deadAmount['att'] = $deadAmount['att'] + $mydeathnum;
$deadAmount['def'] = $deadAmount['def'] + $mykillnum;
@@ -515,7 +515,7 @@ function processWar($general, $city) {
$oppose = MYDB_fetch_array($result);
$alllog[] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."(와)과 <Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."(이)가 대결합니다.";
$log[] = "<C>●</>".GameUnitConst::byId($general['crewtype'])->name."(으)로 <Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."(을)를 <M>공격</>합니다.";
$opplog[count($opplog)] = "<C>●</>".GameUnitConst::byId($oppose['crewtype'])->name."(으)로 <Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."(을)를 <M>수비</>합니다.";
$opplog[] = "<C>●</>".GameUnitConst::byId($oppose['crewtype'])->name."(으)로 <Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."(을)를 <M>수비</>합니다.";
$oppAtmos = 0;
if($oppose['item'] == 3) {
@@ -523,7 +523,7 @@ function processWar($general, $city) {
$oppAtmos += 3;
$query = "update general set item=0 where no='{$oppose['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$opplog[count($opplog)] = "<C>●</><C>".getItemName($oppose['item'])."</>(을)를 사용!";
$opplog[] = "<C>●</><C>".getItemName($oppose['item'])."</>(을)를 사용!";
$oppose['item'] = 0;
} elseif($oppose['item'] >= 14 && $oppose['item'] <= 16) {
//의적주, 두강주, 보령압주 사용
@@ -538,7 +538,7 @@ function processWar($general, $city) {
$oppTrain += 3;
$query = "update general set item=0 where no='{$oppose['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$opplog[count($opplog)] = "<C>●</><C>".getItemName($oppose['item'])."</>(을)를 사용!";
$opplog[] = "<C>●</><C>".getItemName($oppose['item'])."</>(을)를 사용!";
$oppose['item'] = 0;
} elseif($oppose['item'] >= 12 && $oppose['item'] <= 13) {
//과실주, 이강주 사용
@@ -571,16 +571,16 @@ function processWar($general, $city) {
// $log[] = "<C>●</><C>".getWeapName($general['weap'])."</>(을)를 사용!";
}
$log[] = "<C>●</>상대를 <C>저격</>했다!";
$batlog[count($batlog)] = "<C>●</>상대를 <C>저격</>했다!";
$opplog[count($opplog)] = "<C>●</>상대에게 <R>저격</>당했다!";
$oppbatlog[count($oppbatlog)] = "<C>●</>상대에게 <R>저격</>당했다!";
$batlog[] = "<C>●</>상대를 <C>저격</>했다!";
$opplog[] = "<C>●</>상대에게 <R>저격</>당했다!";
$oppbatlog[] = "<C>●</>상대에게 <R>저격</>당했다!";
// 부상
$oppose['injury'] += rand() % 41 + 20; // 20 ~ 60
if($oppose['injury'] > 80) { $oppose['injury'] = 80; }
} else if($general['item'] == 2 && $ratio <= 40) {
$query = "update general set item=0 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$batlog[count($batlog)] = "<C>●</><C>".getItemName($general['item'])."</>(이)가 빗나갑니다!";
$batlog[] = "<C>●</><C>".getItemName($general['item'])."</>(이)가 빗나갑니다!";
$general['item'] = 0;
}
$ratio = rand() % 100;
@@ -590,14 +590,14 @@ function processWar($general, $city) {
if($oppose['item'] == 2) {
$query = "update general set item=0 where no='{$oppose['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$opplog[count($opplog)] = "<C>●</><C>".getItemName($oppose['item'])."</>(을)를 사용!";
$opplog[] = "<C>●</><C>".getItemName($oppose['item'])."</>(을)를 사용!";
$oppose['item'] = 0;
} elseif($oppose['weap'] == 10 || $oppose['weap'] == 14 || $oppose['weap'] == 18 || $oppose['weap'] == 22) {
// $opplog[count($opplog)] = "<C>●</><C>".getWeapName($oppose['weap'])."</>(을)를 사용!";
// $opplog[] = "<C>●</><C>".getWeapName($oppose['weap'])."</>(을)를 사용!";
}
$oppbatlog[count($oppbatlog)] = "<C>●</>상대를 <C>저격</>했다!";
$opplog[count($opplog)] = "<C>●</>상대를 <C>저격</>했다!";
$batlog[count($batlog)] = "<C>●</>상대에게 <R>저격</>당했다!";
$oppbatlog[] = "<C>●</>상대를 <C>저격</>했다!";
$opplog[] = "<C>●</>상대를 <C>저격</>했다!";
$batlog[] = "<C>●</>상대에게 <R>저격</>당했다!";
$log[] = "<C>●</>상대에게 <R>저격</>당했다!";
// 부상
$general['injury'] += rand() % 41 + 20; // 20 ~ 60
@@ -605,7 +605,7 @@ function processWar($general, $city) {
} else if($oppose['item'] == 2 && $ratio <= 40) {
$query = "update general set item=0 where no='{$oppose['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$oppbatlog[count($oppbatlog)] = "<C>●</><C>".getItemName($oppose['item'])."</>(이)가 빗나갑니다!";
$oppbatlog[] = "<C>●</><C>".getItemName($oppose['item'])."</>(이)가 빗나갑니다!";
$oppose['item'] = 0;
}
@@ -695,12 +695,12 @@ function processWar($general, $city) {
$ratio = rand() % 100;
// 특기보정 : 반계
if($oppose['special2'] == 45 && $ratio > 70) {
$batlog[count($batlog)] = "<C>●</><D>위보</>를 <R>역으로</> 당했다!";
$oppbatlog[count($oppbatlog)] = "<C>●</><C>반계</>로 상대의 <D>위보</>를 되돌렸다!";
$batlog[] = "<C>●</><D>위보</>를 <R>역으로</> 당했다!";
$oppbatlog[] = "<C>●</><C>반계</>로 상대의 <D>위보</>를 되돌렸다!";
$myCrew *= 1.2;
} else {
$batlog[count($batlog)] = "<C>●</><D>위보</>를 <C>성공</>했다!";
$oppbatlog[count($oppbatlog)] = "<C>●</><D>위보</>에 당했다!";
$batlog[] = "<C>●</><D>위보</>를 <C>성공</>했다!";
$oppbatlog[] = "<C>●</><D>위보</>에 당했다!";
$opCrew *= 1.2;
}
break;
@@ -708,12 +708,12 @@ function processWar($general, $city) {
$ratio = rand() % 100;
// 특기보정 : 반계
if($oppose['special2'] == 45 && $ratio > 70) {
$batlog[count($batlog)] = "<C>●</><D>매복</>을 <R>역으로</> 당했다!";
$oppbatlog[count($oppbatlog)] = "<C>●</><C>반계</>로 상대의 <D>매복</>을 되돌렸다!";
$batlog[] = "<C>●</><D>매복</>을 <R>역으로</> 당했다!";
$oppbatlog[] = "<C>●</><C>반계</>로 상대의 <D>매복</>을 되돌렸다!";
$myCrew *= 1.4;
} else {
$batlog[count($batlog)] = "<C>●</><D>매복</>을 <C>성공</>했다!";
$oppbatlog[count($oppbatlog)] = "<C>●</><D>매복</>에 당했다!";
$batlog[] = "<C>●</><D>매복</>을 <C>성공</>했다!";
$oppbatlog[] = "<C>●</><D>매복</>에 당했다!";
$opCrew *= 1.4;
}
break;
@@ -721,12 +721,12 @@ function processWar($general, $city) {
$ratio = rand() % 100;
// 특기보정 : 반계
if($oppose['special2'] == 45 && $ratio > 70) {
$batlog[count($batlog)] = "<C>●</><D>반목</>을 <R>역으로</> 당했다!";
$oppbatlog[count($oppbatlog)] = "<C>●</><C>반계</>로 상대의 <D>반목</>을 되돌렸다!";
$batlog[] = "<C>●</><D>반목</>을 <R>역으로</> 당했다!";
$oppbatlog[] = "<C>●</><C>반계</>로 상대의 <D>반목</>을 되돌렸다!";
$myCrew *= 1.6;
} else {
$batlog[count($batlog)] = "<C>●</><D>반목</>을 <C>성공</>했다!";
$oppbatlog[count($oppbatlog)] = "<C>●</><D>반목</>에 당했다!";
$batlog[] = "<C>●</><D>반목</>을 <C>성공</>했다!";
$oppbatlog[] = "<C>●</><D>반목</>에 당했다!";
$opCrew *= 1.6;
// 특기보정 : 반계
if($general['special2'] == 45) { $opCrew *= 2; }
@@ -736,12 +736,12 @@ function processWar($general, $city) {
$ratio = rand() % 100;
// 특기보정 : 반계
if($oppose['special2'] == 45 && $ratio > 70) {
$batlog[count($batlog)] = "<C>●</><D>화계</>를 <R>역으로</> 당했다!";
$oppbatlog[count($oppbatlog)] = "<C>●</><C>반계</>로 상대의 <D>화계</>를 되돌렸다!";
$batlog[] = "<C>●</><D>화계</>를 <R>역으로</> 당했다!";
$oppbatlog[] = "<C>●</><C>반계</>로 상대의 <D>화계</>를 되돌렸다!";
$myCrew *= 1.8;
} else {
$batlog[count($batlog)] = "<C>●</><D>화계</>를 <C>성공</>했다!";
$oppbatlog[count($oppbatlog)] = "<C>●</><D>화계</>에 당했다!";
$batlog[] = "<C>●</><D>화계</>를 <C>성공</>했다!";
$oppbatlog[] = "<C>●</><D>화계</>에 당했다!";
$opCrew *= 1.8;
}
break;
@@ -749,12 +749,12 @@ function processWar($general, $city) {
$ratio = rand() % 100;
// 특기보정 : 반계
if($oppose['special2'] == 45 && $ratio > 70) {
$batlog[count($batlog)] = "<C>●</><D>혼란</>을 <R>역으로</> 당했다!";
$oppbatlog[count($oppbatlog)] = "<C>●</><C>반계</>로 상대의 <D>혼란</>을 되돌렸다!";
$batlog[] = "<C>●</><D>혼란</>을 <R>역으로</> 당했다!";
$oppbatlog[] = "<C>●</><C>반계</>로 상대의 <D>혼란</>을 되돌렸다!";
$myCrew *= 2.0;
} else {
$batlog[count($batlog)] = "<C>●</><D>혼란</>을 <C>성공</>했다!";
$oppbatlog[count($oppbatlog)] = "<C>●</><D>혼란</>에 당했다!";
$batlog[] = "<C>●</><D>혼란</>을 <C>성공</>했다!";
$oppbatlog[] = "<C>●</><D>혼란</>에 당했다!";
$opCrew *= 2.0;
}
break;
@@ -763,28 +763,28 @@ function processWar($general, $city) {
$type = rand() % 5; // 0~4
switch($type) {
case 0:
$batlog[count($batlog)] = "<C>●</><D>위보</>를 <R>실패</>했다!";
$oppbatlog[count($oppbatlog)] = "<C>●</><D>위보</>를 간파했다!";
$batlog[] = "<C>●</><D>위보</>를 <R>실패</>했다!";
$oppbatlog[] = "<C>●</><D>위보</>를 간파했다!";
$opCrew /= 1.1; $myCrew *= 1.1;
break;
case 1:
$batlog[count($batlog)] = "<C>●</><D>매복</>을 <R>실패</>했다!";
$oppbatlog[count($oppbatlog)] = "<C>●</><D>매복</>을 간파했다!";
$batlog[] = "<C>●</><D>매복</>을 <R>실패</>했다!";
$oppbatlog[] = "<C>●</><D>매복</>을 간파했다!";
$opCrew /= 1.2; $myCrew *= 1.2;
break;
case 2:
$batlog[count($batlog)] = "<C>●</><D>반목</>을 <R>실패</>했다!";
$oppbatlog[count($oppbatlog)] = "<C>●</><D>반목</>을 간파했다!";
$batlog[] = "<C>●</><D>반목</>을 <R>실패</>했다!";
$oppbatlog[] = "<C>●</><D>반목</>을 간파했다!";
$opCrew /= 1.3; $myCrew *= 1.3;
break;
case 3:
$batlog[count($batlog)] = "<C>●</><D>화계</>를 <R>실패</>했다!";
$oppbatlog[count($oppbatlog)] = "<C>●</><D>화계</>를 간파했다!";
$batlog[] = "<C>●</><D>화계</>를 <R>실패</>했다!";
$oppbatlog[] = "<C>●</><D>화계</>를 간파했다!";
$opCrew /= 1.4; $myCrew *= 1.4;
break;
case 4:
$batlog[count($batlog)] = "<C>●</><D>혼란</>을 <R>실패</>했다!";
$oppbatlog[count($oppbatlog)] = "<C>●</><D>혼란</>을 간파했다!";
$batlog[] = "<C>●</><D>혼란</>을 <R>실패</>했다!";
$oppbatlog[] = "<C>●</><D>혼란</>을 간파했다!";
$opCrew /= 1.5; $myCrew *= 1.5;
break;
}
@@ -836,12 +836,12 @@ function processWar($general, $city) {
$ratio = rand() % 100;
// 특기보정 : 반계
if($general['special2'] == 45 && $ratio > 70) {
$oppbatlog[count($oppbatlog)] = "<C>●</><D>위보</>를 <R>역으로</> 당했다!";
$batlog[count($batlog)] = "<C>●</><C>반계</>로 상대의 <D>위보</>를 되돌렸다!";
$oppbatlog[] = "<C>●</><D>위보</>를 <R>역으로</> 당했다!";
$batlog[] = "<C>●</><C>반계</>로 상대의 <D>위보</>를 되돌렸다!";
$opCrew *= 1.2;
} else {
$oppbatlog[count($oppbatlog)] = "<C>●</><D>위보</>를 <C>성공</>했다!";
$batlog[count($batlog)] = "<C>●</><D>위보</>에 당했다!";
$oppbatlog[] = "<C>●</><D>위보</>를 <C>성공</>했다!";
$batlog[] = "<C>●</><D>위보</>에 당했다!";
$myCrew *= 1.2;
}
break;
@@ -849,12 +849,12 @@ function processWar($general, $city) {
$ratio = rand() % 100;
// 특기보정 : 반계
if($general['special2'] == 45 && $ratio > 70) {
$oppbatlog[count($oppbatlog)] = "<C>●</><D>매복</>을 <R>역으로</> 당했다!";
$batlog[count($batlog)] = "<C>●</><C>반계</>로 상대의 <D>매복</>을 되돌렸다!";
$oppbatlog[] = "<C>●</><D>매복</>을 <R>역으로</> 당했다!";
$batlog[] = "<C>●</><C>반계</>로 상대의 <D>매복</>을 되돌렸다!";
$opCrew *= 1.4;
} else {
$oppbatlog[count($oppbatlog)] = "<C>●</><D>매복</>을 <C>성공</>했다!";
$batlog[count($batlog)] = "<C>●</><D>매복</>에 당했다!";
$oppbatlog[] = "<C>●</><D>매복</>을 <C>성공</>했다!";
$batlog[] = "<C>●</><D>매복</>에 당했다!";
$myCrew *= 1.4;
}
break;
@@ -862,12 +862,12 @@ function processWar($general, $city) {
$ratio = rand() % 100;
// 특기보정 : 반계
if($general['special2'] == 45 && $ratio > 70) {
$oppbatlog[count($oppbatlog)] = "<C>●</><D>반목</>을 <R>역으로</> 당했다!";
$batlog[count($batlog)] = "<C>●</><C>반계</>로 상대의 <D>반목</>을 되돌렸다!";
$oppbatlog[] = "<C>●</><D>반목</>을 <R>역으로</> 당했다!";
$batlog[] = "<C>●</><C>반계</>로 상대의 <D>반목</>을 되돌렸다!";
$opCrew *= 1.6;
} else {
$oppbatlog[count($oppbatlog)] = "<C>●</><D>반목</>을 <C>성공</>했다!";
$batlog[count($batlog)] = "<C>●</><D>반목</>에 당했다!";
$oppbatlog[] = "<C>●</><D>반목</>을 <C>성공</>했다!";
$batlog[] = "<C>●</><D>반목</>에 당했다!";
$myCrew *= 1.6;
// 특기보정 : 반계
if($oppose['special2'] == 45) { $myCrew *= 2; }
@@ -877,12 +877,12 @@ function processWar($general, $city) {
$ratio = rand() % 100;
// 특기보정 : 반계
if($general['special2'] == 45 && $ratio > 70) {
$oppbatlog[count($oppbatlog)] = "<C>●</><D>화계</>를 <R>역으로</> 당했다!";
$batlog[count($batlog)] = "<C>●</><C>반계</>로 상대의 <D>화계</>을 되돌렸다!";
$oppbatlog[] = "<C>●</><D>화계</>를 <R>역으로</> 당했다!";
$batlog[] = "<C>●</><C>반계</>로 상대의 <D>화계</>을 되돌렸다!";
$opCrew *= 1.8;
} else {
$oppbatlog[count($oppbatlog)] = "<C>●</><D>화계</>를 <C>성공</>했다!";
$batlog[count($batlog)] = "<C>●</><D>화계</>에 당했다!";
$oppbatlog[] = "<C>●</><D>화계</>를 <C>성공</>했다!";
$batlog[] = "<C>●</><D>화계</>에 당했다!";
$myCrew *= 1.8;
}
break;
@@ -890,12 +890,12 @@ function processWar($general, $city) {
$ratio = rand() % 100;
// 특기보정 : 반계
if($general['special2'] == 45 && $ratio > 70) {
$oppbatlog[count($oppbatlog)] = "<C>●</><D>혼란</>을 <R>역으로</> 당했다!";
$batlog[count($batlog)] = "<C>●</><C>반계</>로 상대의 <D>혼란</>을 되돌렸다!";
$oppbatlog[] = "<C>●</><D>혼란</>을 <R>역으로</> 당했다!";
$batlog[] = "<C>●</><C>반계</>로 상대의 <D>혼란</>을 되돌렸다!";
$opCrew *= 2.0;
} else {
$oppbatlog[count($oppbatlog)] = "<C>●</><D>혼란</>을 <C>성공</>했다!";
$batlog[count($batlog)] = "<C>●</><D>혼란</>에 당했다!";
$oppbatlog[] = "<C>●</><D>혼란</>을 <C>성공</>했다!";
$batlog[] = "<C>●</><D>혼란</>에 당했다!";
$myCrew *= 2.0;
}
break;
@@ -904,28 +904,28 @@ function processWar($general, $city) {
$type = rand() % 5; // 0~4
switch($type) {
case 0:
$oppbatlog[count($oppbatlog)] = "<C>●</><D>위보</>를 <R>실패</>했다!";
$batlog[count($batlog)] = "<C>●</><D>위보</>를 간파했다!";
$oppbatlog[] = "<C>●</><D>위보</>를 <R>실패</>했다!";
$batlog[] = "<C>●</><D>위보</>를 간파했다!";
$myCrew /= 1.1; $opCrew *= 1.1;
break;
case 1:
$oppbatlog[count($oppbatlog)] = "<C>●</><D>매복</>을 <R>실패</>했다!";
$batlog[count($batlog)] = "<C>●</><D>매복</>을 간파했다!";
$oppbatlog[] = "<C>●</><D>매복</>을 <R>실패</>했다!";
$batlog[] = "<C>●</><D>매복</>을 간파했다!";
$myCrew /= 1.2; $opCrew *= 1.2;
break;
case 2:
$oppbatlog[count($oppbatlog)] = "<C>●</><D>반목</>을 <R>실패</>했다!";
$batlog[count($batlog)] = "<C>●</><D>반목</>을 간파했다!";
$oppbatlog[] = "<C>●</><D>반목</>을 <R>실패</>했다!";
$batlog[] = "<C>●</><D>반목</>을 간파했다!";
$myCrew /= 1.3; $opCrew *= 1.3;
break;
case 3:
$oppbatlog[count($oppbatlog)] = "<C>●</><D>화계</>를 <R>실패</>했다!";
$batlog[count($batlog)] = "<C>●</><D>화계</>를 간파했다!";
$oppbatlog[] = "<C>●</><D>화계</>를 <R>실패</>했다!";
$batlog[] = "<C>●</><D>화계</>를 간파했다!";
$myCrew /= 1.4; $opCrew *= 1.4;
break;
case 4:
$oppbatlog[count($oppbatlog)] = "<C>●</><D>혼란</>을 <R>실패</>했다!";
$batlog[count($batlog)] = "<C>●</><D>혼란</>을 간파했다!";
$oppbatlog[] = "<C>●</><D>혼란</>을 <R>실패</>했다!";
$batlog[] = "<C>●</><D>혼란</>을 간파했다!";
$myCrew /= 1.5; $opCrew *= 1.5;
break;
}
@@ -940,8 +940,8 @@ function processWar($general, $city) {
$r += $oppose['train'] + $oppTrain + $oppTrainBonus;
$ratio = rand() % 400; // 최대 50% 저지
if($ratio < $r && $opAvoid == 1) {
$batlog[count($batlog)] = "<C>●</><R>저지</>당했다!</>";
$oppbatlog[count($oppbatlog)] = "<C>●</>상대를 <C>저지</>했다!</>";
$batlog[] = "<C>●</><R>저지</>당했다!</>";
$oppbatlog[] = "<C>●</>상대를 <C>저지</>했다!</>";
$opAvoid = 0;
continue;
}
@@ -1035,7 +1035,7 @@ function processWar($general, $city) {
}
$ratio = rand() % 100; // 0 ~ 99
if(($general['special2'] == 73 || $general['item'] == 23 || $general['item'] == 24) && $ratio > 80 && $myAvoid == 1) {
$batlog[count($batlog)] = "<C>●</><C>치료</>했다!</>";
$batlog[] = "<C>●</><C>치료</>했다!</>";
$myCrew /= 1.5; // 66%만 소모
$myAvoid = 0;
}
@@ -1054,7 +1054,7 @@ function processWar($general, $city) {
}
$ratio = rand() % 100; // 0 ~ 99
if(($oppose['special2'] == 73 || $oppose['item'] == 23 || $oppose['item'] == 24) && $ratio > 80 && $opAvoid == 1) {
$oppbatlog[count($oppbatlog)] = "<C>●</><C>치료</>했다!</>";
$oppbatlog[] = "<C>●</><C>치료</>했다!</>";
$opCrew /= 1.5; // 66%만 소모
$opAvoid = 0;
}
@@ -1069,16 +1069,16 @@ function processWar($general, $city) {
if($general['special2'] == 61) { $ratio += 10; }
if($general['special2'] == 71) { $ratio += 20; }
if($ratio >= $rd && $myAvoid == 1) {
$batlog[count($batlog)] = "<C>●</><C>필살</>공격!</>";
$oppbatlog[count($oppbatlog)] = "<C>●</>상대의 <R>필살</>공격!</>";
$batlog[] = "<C>●</><C>필살</>공격!</>";
$oppbatlog[] = "<C>●</>상대의 <R>필살</>공격!</>";
$opCrew = CriticalScore2($opCrew);
$myAvoid = 0;
// 특기보정 : 격노
if($oppose['special2'] == 74) {
if(rand() % 100 < 50) {
$batlog[count($batlog)] = "<C>●</>필살 공격에 상대가 <R>격노</>했다!</>";
$oppbatlog[count($oppbatlog)] = "<C>●</>상대의 필살 공격에 <C>격노</>했다!</>";
$batlog[] = "<C>●</>필살 공격에 상대가 <R>격노</>했다!</>";
$oppbatlog[] = "<C>●</>상대의 필살 공격에 <C>격노</>했다!</>";
$myCrew = CriticalScore2($myCrew);
$opAvoid = 0;
}
@@ -1093,22 +1093,22 @@ function processWar($general, $city) {
// 특기보정 : 필살
if($oppose['special2'] == 71) { $ratio += 20; }
if($ratio >= $rd && $opAvoid == 1) {
$oppbatlog[count($oppbatlog)] = "<C>●</><C>필살</>공격!</>";
$batlog[count($batlog)] = "<C>●</>상대의 <R>필살</>공격!</>";
$oppbatlog[] = "<C>●</><C>필살</>공격!</>";
$batlog[] = "<C>●</>상대의 <R>필살</>공격!</>";
$myCrew = CriticalScore2($myCrew);
$opAvoid = 0;
// 특기보정 : 격노
if($general['special2'] == 74) {
if(rand() % 100 < 33) {
$oppbatlog[count($oppbatlog)] = "<C>●</>필살 공격에 상대가 <R>진노</>했다!</>";
$batlog[count($batlog)] = "<C>●</>상대의 필살 공격에 <C>진노</>했다!</>";
$oppbatlog[] = "<C>●</>필살 공격에 상대가 <R>진노</>했다!</>";
$batlog[] = "<C>●</>상대의 필살 공격에 <C>진노</>했다!</>";
$opCrew = CriticalScore2($opCrew);
$myAvoid = 0;
$warphase++;
} elseif(rand() % 100 < 33) {
$oppbatlog[count($oppbatlog)] = "<C>●</>필살 공격에 상대가 <R>격노</>했다!</>";
$batlog[count($batlog)] = "<C>●</>상대의 필살 공격에 <C>격노</>했다!</>";
$oppbatlog[] = "<C>●</>필살 공격에 상대가 <R>격노</>했다!</>";
$batlog[] = "<C>●</>상대의 필살 공격에 <C>격노</>했다!</>";
$opCrew = CriticalScore2($opCrew);
$myAvoid = 0;
}
@@ -1117,7 +1117,7 @@ function processWar($general, $city) {
//회피
$ratio = rand() % 100; // 0 ~ 99
$ratio2 = GameConst::byID($general['crewtype'])->avoid; //회피율
$ratio2 = GameUnitConst::byID($general['crewtype'])->avoid; //회피율
//특기보정 : 돌격, 궁병
if($oppose['special2'] == 60) { $ratio2 -= 100; }
if($general['special2'] == 51) { $ratio2 += 20; }
@@ -1126,20 +1126,20 @@ function processWar($general, $city) {
if($ratio < $ratio2 && $myAvoid == 1) {
// 특기보정 : 격노
if($oppose['special2'] == 74 && rand() % 100 < 50) {
$batlog[count($batlog)] = "<C>●</>회피 시도에 상대가 <R>격노</>했다!</>";
$oppbatlog[count($oppbatlog)] = "<C>●</>상대의 회피 시도에 <C>격노</>했다!</>";
$batlog[] = "<C>●</>회피 시도에 상대가 <R>격노</>했다!</>";
$oppbatlog[] = "<C>●</>상대의 회피 시도에 <C>격노</>했다!</>";
$myCrew = CriticalScore2($myCrew);
$opAvoid = 0;
} else {
$batlog[count($batlog)] = "<C>●</><C>회피</>했다!</>";
$oppbatlog[count($oppbatlog)] = "<C>●</>상대가 <R>회피</>했다!</>";
$batlog[] = "<C>●</><C>회피</>했다!</>";
$oppbatlog[] = "<C>●</>상대가 <R>회피</>했다!</>";
$myCrew /= 10; // 10%만 소모
$myAvoid = 0;
}
}
//회피
$ratio = rand() % 100; // 0 ~ 99
$ratio2 = GameConst::byID($oppose['crewtype'])->defence; //회피율
$ratio2 = GameUnitConst::byID($oppose['crewtype'])->defence; //회피율
// 특기보정 : 돌격, 궁병
if($general['special2'] == 60) { $ratio2 -= 100; }
if($oppose['special2'] == 51) { $ratio2 += 20; }
@@ -1148,19 +1148,19 @@ function processWar($general, $city) {
if($ratio < $ratio2 && $opAvoid == 1) {
// 특기보정 : 격노
if($general['special2'] == 74 && rand() % 100 < 33) {
$oppbatlog[count($oppbatlog)] = "<C>●</>회피 시도에 상대가 <R>진노</>했다!</>";
$batlog[count($batlog)] = "<C>●</>상대의 회피 시도에 <C>진노</>했다!</>";
$oppbatlog[] = "<C>●</>회피 시도에 상대가 <R>진노</>했다!</>";
$batlog[] = "<C>●</>상대의 회피 시도에 <C>진노</>했다!</>";
$opCrew = CriticalScore2($opCrew);
$myAvoid = 0;
$warphase++;
} elseif($general['special2'] == 74 && rand() % 100 < 33) {
$oppbatlog[count($oppbatlog)] = "<C>●</>회피 시도에 상대가 <R>격노</>했다!</>";
$batlog[count($batlog)] = "<C>●</>상대의 회피 시도에 <C>격노</>했다!</>";
$oppbatlog[] = "<C>●</>회피 시도에 상대가 <R>격노</>했다!</>";
$batlog[] = "<C>●</>상대의 회피 시도에 <C>격노</>했다!</>";
$opCrew = CriticalScore2($opCrew);
$myAvoid = 0;
} else {
$oppbatlog[count($oppbatlog)] = "<C>●</><C>회피</>했다!</>";
$batlog[count($batlog)] = "<C>●</>상대가 <R>회피</>했다!</>";
$oppbatlog[] = "<C>●</><C>회피</>했다!</>";
$batlog[] = "<C>●</>상대가 <R>회피</>했다!</>";
$opCrew /= 10; // 10%만 소모
$opAvoid = 0;
}
@@ -1172,14 +1172,14 @@ function processWar($general, $city) {
//특기보정 : 위압
if($general['special2'] == 63 && $phase == 1 && $general['crew'] >= 1000 && $general['atmos'] >= 90 && $general['train'] >= 90) {
$batlog[count($batlog)] = "<C>●</>상대에게 <C>위압</>을 줬다!</>";
$oppbatlog[count($oppbatlog)] = "<C>●</>상대에게 <R>위압</>받았다!</>";
$batlog[] = "<C>●</>상대에게 <C>위압</>을 줬다!</>";
$oppbatlog[] = "<C>●</>상대에게 <R>위압</>받았다!</>";
$myCrew = 0;
}
//특기보정: 위압
if($oppose['special2'] == 63 && $phase == 1 && $oppose['crew'] >= 1000 && $oppose['atmos'] >= 90 && $oppose['train'] >= 90) {
$batlog[count($batlog)] = "<C>●</>상대에게 <R>위압</>받았다!</>";
$oppbatlog[count($oppbatlog)] = "<C>●</>상대에게 <C>위압</>을 줬다!</>";
$batlog[] = "<C>●</>상대에게 <R>위압</>받았다!</>";
$oppbatlog[] = "<C>●</>상대에게 <C>위압</>을 줬다!</>";
$opCrew = 0;
}
@@ -1227,8 +1227,8 @@ function processWar($general, $city) {
$oppose['crew'] = round($oppose['crew']);
$myCrew = round($myCrew);
$opCrew = round($opCrew);
$batlog[count($batlog)] = "<C>●</> $phase : <Y1>【{$general['name']}】</> <C>{$general['crew']} (-$myCrew)</> VS <C>{$oppose['crew']} (-$opCrew)</> <Y1>【{$oppose['name']}】</>";
$oppbatlog[count($oppbatlog)] = "<C>●</> $phase : <Y1>【{$oppose['name']}】</> <C>{$oppose['crew']} (-$opCrew)</> VS <C>{$general['crew']} (-$myCrew)</> <Y1>【{$general['name']}】</>";
$batlog[] = "<C>●</> $phase : <Y1>【{$general['name']}】</> <C>{$general['crew']} (-$myCrew)</> VS <C>{$oppose['crew']} (-$opCrew)</> <Y1>【{$oppose['name']}】</>";
$oppbatlog[] = "<C>●</> $phase : <Y1>【{$oppose['name']}】</> <C>{$oppose['crew']} (-$opCrew)</> VS <C>{$general['crew']} (-$myCrew)</> <Y1>【{$general['name']}】</>";
$mykillnum += $opCrew; $mydeathnum += $myCrew;
$opkillnum += $myCrew; $opdeathnum += $opCrew;
@@ -1290,11 +1290,11 @@ function processWar($general, $city) {
]);
$log[] = $res;
$batlog[count($batlog)] = $res;
$batres[count($batres)] = $res;
$opplog[count($opplog)] = $oppres;
$oppbatlog[count($oppbatlog)] = $oppres;
$oppbatres[count($oppbatres)] = $oppres;
$batlog[] = $res;
$batres[] = $res;
$opplog[] = $oppres;
$oppbatlog[] = $oppres;
$oppbatres[] = $oppres;
$deadAmount['att'] = $deadAmount['att'] + $mydeathnum;
$deadAmount['def'] = $deadAmount['def'] + $opdeathnum;
@@ -1302,7 +1302,7 @@ function processWar($general, $city) {
// 상대장수 부상
$ratio = rand() % 100;
if($ratio >= 95) {
$opplog[count($opplog)] = "<C>●</>전투중 <R>부상</>당했다!";
$opplog[] = "<C>●</>전투중 <R>부상</>당했다!";
$oppose['injury'] += rand() % 71 + 10; // 10 ~ 80
if($oppose['injury'] > 80) { $oppose['injury'] = 80; }
}
@@ -1367,11 +1367,11 @@ function processWar($general, $city) {
if($opRice <= round($oppose['crew']/100)) {
$alllog[] = "<C>●</>{$game['month']}월:<Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."(이)가 패퇴했습니다.";
$log[] = "<C>●</><Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."(이)가 패퇴했습니다.";
$opplog[count($opplog)] = "<C>●</>군량 부족으로 패퇴합니다.";
$opplog[] = "<C>●</>군량 부족으로 패퇴합니다.";
} else {
$alllog[] = "<C>●</>{$game['month']}월:<Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."(이)가 전멸했습니다.";
$log[] = "<C>●</><Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."(이)가 전멸했습니다.";
$opplog[count($opplog)] = "<C>●</>전멸했습니다.";
$opplog[] = "<C>●</>전멸했습니다.";
}
$opposecount--;
@@ -1405,11 +1405,11 @@ function processWar($general, $city) {
if($myRice <= round($general['crew']/100)) {
$alllog[] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."(이)가 퇴각했습니다.";
$log[] = "<C>●</>군량 부족으로 퇴각합니다.";
$opplog[count($opplog)] = "<C>●</><Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."(이)가 퇴각했습니다.";
$opplog[] = "<C>●</><Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."(이)가 퇴각했습니다.";
} else {
$alllog[] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."(이)가 퇴각했습니다.";
$log[] = "<C>●</>퇴각했습니다.";
$opplog[count($opplog)] = "<C>●</><Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."(이)가 퇴각했습니다.";
$opplog[] = "<C>●</><Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."(이)가 퇴각했습니다.";
}
// 경험치 상승
@@ -1547,7 +1547,7 @@ function getCrewtypeRice($game, $crewtype, $tech) {
//////////////////////////////////////////////////////////////
function getAtt($game, $general, $tech, $lbonus) {
$att = GameConst::byID($general['crewtype'])->attack + getTechAbil($tech);
$att = GameUnitConst::byID($general['crewtype'])->attack + getTechAbil($tech);
$general['lbonus'] = $lbonus;
@@ -1566,7 +1566,7 @@ function getAtt($game, $general, $tech, $lbonus) {
}
function getDef($game, $general, $tech) {
$def = GameConst::byID($general['crewtype'])->defence + getTechAbil($tech);
$def = GameUnitConst::byID($general['crewtype'])->defence + getTechAbil($tech);
$crew = ($general['crew'] / (7000 / 30)) + 70; // 5000명일때 91점 7000명일때 100점 10000명일때 113점
$def = $def * $crew / 100;
@@ -1667,8 +1667,8 @@ function getConquerNation($city) {
$db = DB::db();
$connect=$db->get();
$nationlist = explode("|", $city['conflict']);
$killnum = explode("|", $city['conflict2']);
$nationlist = explode("|", (string)$city['conflict']);
$killnum = explode("|", (string)$city['conflict2']);
$max = 0;
for($i=0; $i < count($nationlist); $i++) {
@@ -1952,7 +1952,7 @@ function ConquerCity($game, $general, $city, $nation, $destnation) {
}
pushGenLog($general, $log);
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushGeneralPublicRecord($alllog, $game['year'], $game['month']);
pushWorldHistory($history);
}
-1
View File
@@ -67,7 +67,6 @@ switch($commandtype) {
case 33: command_33($turn, 33); break; //탈취
case 34: command_34($turn, 34); break; //파괴
case 35: command_35($turn, 35); break; //선동
case 36: command_36($turn, 36); break; //기습
case 41: command_Single($turn, 41); break; //단련
case 42: command_Single($turn, 42); break; //견문