diff --git a/.phan/config.php b/.phan/config.php index f95c89d8..206280e8 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -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' ], diff --git a/hwe/a_history.php b/hwe/a_history.php index 701602dd..1be14045 100644 --- a/hwe/a_history.php +++ b/hwe/a_history.php @@ -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(); diff --git a/hwe/b_diplomacy.php b/hwe/b_diplomacy.php index 4753c3a3..cd719f84 100644 --- a/hwe/b_diplomacy.php +++ b/hwe/b_diplomacy.php @@ -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']; diff --git a/hwe/c_tournament.php b/hwe/c_tournament.php index e0b0df5e..e3d48954 100644 --- a/hwe/c_tournament.php +++ b/hwe/c_tournament.php @@ -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; } } diff --git a/hwe/func.php b/hwe/func.php index 7f841a0e..90dcb561 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -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; diff --git a/hwe/func_auction.php b/hwe/func_auction.php index b226c6d3..df21fd7c 100644 --- a/hwe/func_auction.php +++ b/hwe/func_auction.php @@ -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"; diff --git a/hwe/func_command.php b/hwe/func_command.php index 6469e9a1..91e929dc 100644 --- a/hwe/func_command.php +++ b/hwe/func_command.php @@ -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; } diff --git a/hwe/func_npc.php b/hwe/func_npc.php index b1c8e9bc..b82e70bc 100644 --- a/hwe/func_npc.php +++ b/hwe/func_npc.php @@ -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) { diff --git a/hwe/func_process.php b/hwe/func_process.php index 935f2462..8a89c371 100644 --- a/hwe/func_process.php +++ b/hwe/func_process.php @@ -1456,7 +1456,7 @@ function process_26(&$general) { $ded = CharDedication($ded, $general['personal']); //부대원에게 로그 전달 - $genlog[count($genlog)] = "{$troop['name']}의 부대원들은 {$city['name']}(으)로 집합되었습니다."; + $genlog[] = "{$troop['name']}의 부대원들은 {$city['name']}(으)로 집합되었습니다."; 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[] = "●{$admin['month']}월:고립된 도시입니다. 증여 실패. <1>$date"; } else { - $genlog[count($genlog)] = "●{$admin['month']}월:{$general['name']}에게서 $dtype $amount을 증여 받았습니다."; + $genlog[] = "●{$admin['month']}월:{$general['name']}에게서 $dtype $amount을 증여 받았습니다."; $log[] = "●{$admin['month']}월:{$gen['name']}에게 $dtype $amount을 증여했습니다. <1>$date"; if($what == 1) { diff --git a/hwe/func_process_chief.php b/hwe/func_process_chief.php index e33c1596..bfdb135f 100644 --- a/hwe/func_process_chief.php +++ b/hwe/func_process_chief.php @@ -64,7 +64,7 @@ function process_23(&$general) { } elseif($gen['nation'] != $general['nation']) { $log[] = "●{$admin['month']}월:아국 장수가 아닙니다. 포상 실패. <1>$date"; } else { - $genlog[count($genlog)] = "●$dtype $amount을 포상으로 받았습니다."; + $genlog[] = "●$dtype $amount을 포상으로 받았습니다."; $log[] = "●{$admin['month']}월:{$gen['name']}에게 $dtype $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)] = "●$dtype {$amount}을 몰수 당했습니다."; + $genlog[] = "●$dtype {$amount}을 몰수 당했습니다."; $log[] = "●{$admin['month']}월:{$gen['name']}에게서 $dtype $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[] = "●{$admin['month']}월:{$general['name']}(이)가 필사즉생(을)를 발동하였습니다."; // $history[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 필사즉생(을)를 발동하였습니다."; - $tricklog[count($tricklog)] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 필사즉생(을)를 발동하였습니다."; + $tricklog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 필사즉생(을)를 발동하였습니다."; pushGeneralHistory($general, "●{$admin['year']}년 {$admin['month']}월:필사즉생(을)를 발동"); pushNationHistory($nation, "●{$admin['year']}년 {$admin['month']}월:{$general['name']}(이)가 필사즉생(을)를 발동"); @@ -1426,7 +1426,7 @@ function process_72(&$general) { // $alllog[] = "●{$admin['month']}월:{$general['name']}(이)가 {$destcity['name']}백성동원(을)를 발동하였습니다."; // $history[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destcity['name']}백성동원(을)를 발동하였습니다."; - $tricklog[count($tricklog)] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destcity['name']}백성동원(을)를 발동하였습니다."; + $tricklog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destcity['name']}백성동원(을)를 발동하였습니다."; pushGeneralHistory($general, "●{$admin['year']}년 {$admin['month']}월:{$destcity['name']}백성동원(을)를 발동"); pushNationHistory($nation, "●{$admin['year']}년 {$admin['month']}월:{$general['name']}(이)가 {$destcity['name']}백성동원(을)를 발동"); @@ -1555,7 +1555,7 @@ function process_73(&$general) { // $alllog[] = "●{$admin['month']}월:{$general['name']}(이)가 {$destcity['name']}수몰(을)를 발동하였습니다."; // $history[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destcity['name']}수몰(을)를 발동하였습니다."; - $tricklog[count($tricklog)] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destcity['name']}수몰(을)를 발동하였습니다."; + $tricklog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destcity['name']}수몰(을)를 발동하였습니다."; pushGeneralHistory($general, "●{$admin['year']}년 {$admin['month']}월:{$destcity['name']}수몰(을)를 발동"); pushNationHistory($nation, "●{$admin['year']}년 {$admin['month']}월:{$general['name']}(이)가 {$destnation['name']}{$destcity['name']}수몰(을)를 발동"); pushNationHistory($destnation, "●{$admin['year']}년 {$admin['month']}월:{$nation['name']}{$general['name']}(이)가 아국의 {$destcity['name']}수몰(을)를 발동"); @@ -1676,7 +1676,7 @@ function process_74(&$general) { // $alllog[] = "●{$admin['month']}월:{$general['name']}(이)가 {$destcity['name']}허보(을)를 발동하였습니다."; // $history[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destcity['name']}허보(을)를 발동하였습니다."; - $tricklog[count($tricklog)] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destcity['name']}허보(을)를 발동하였습니다."; + $tricklog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destcity['name']}허보(을)를 발동하였습니다."; pushGeneralHistory($general, "●{$admin['year']}년 {$admin['month']}월:{$destcity['name']}허보(을)를 발동"); pushNationHistory($nation, "●{$admin['year']}년 {$admin['month']}월:{$general['name']}(이)가 {$destnation['name']}{$destcity['name']}허보(을)를 발동"); pushNationHistory($destnation, "●{$admin['year']}년 {$admin['month']}월:{$nation['name']}{$general['name']}(이)가 아국의 {$destcity['name']}허보(을)를 발동"); @@ -1821,7 +1821,7 @@ function process_75(&$general) { // $alllog[] = "●{$admin['month']}월:{$general['name']}(이)가 {$destnation['name']}피장파장(을)를 발동하였습니다."; // $history[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destnation['name']}피장파장(을)를 발동하였습니다."; - $tricklog[count($tricklog)] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destnation['name']}피장파장(을)를 발동하였습니다."; + $tricklog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destnation['name']}피장파장(을)를 발동하였습니다."; pushGeneralHistory($general, "●{$admin['year']}년 {$admin['month']}월:{$destnation['name']}피장파장(을)를 발동"); pushNationHistory($nation, "●{$admin['year']}년 {$admin['month']}월:{$general['name']}(이)가 {$destnation['name']}피장파장(을)를 발동"); pushNationHistory($destnation, "●{$admin['year']}년 {$admin['month']}월:{$nation['name']}{$general['name']}(이)가 아국에 피장파장(을)를 발동"); @@ -1924,7 +1924,7 @@ function process_76(&$general) { // $alllog[] = "●{$admin['month']}월:{$general['name']}(이)가 의병모집(을)를 발동하였습니다."; // $history[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 의병모집(을)를 발동하였습니다."; - $tricklog[count($tricklog)] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 의병모집(을)를 발동하였습니다."; + $tricklog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 의병모집(을)를 발동하였습니다."; pushGeneralHistory($general, "●{$admin['year']}년 {$admin['month']}월:의병모집(을)를 발동"); pushNationHistory($nation, "●{$admin['year']}년 {$admin['month']}월:{$general['name']}(이)가 의병모집(을)를 발동"); @@ -2162,7 +2162,7 @@ function process_77(&$general) { // $alllog[] = "●{$admin['month']}월:{$general['name']}(이)가 {$destnation['name']}이호경식(을)를 발동하였습니다."; // $history[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destnation['name']}이호경식(을)를 발동하였습니다."; - $tricklog[count($tricklog)] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destnation['name']}이호경식(을)를 발동하였습니다."; + $tricklog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destnation['name']}이호경식(을)를 발동하였습니다."; pushGeneralHistory($general, "●{$admin['year']}년 {$admin['month']}월:{$destnation['name']}이호경식(을)를 발동"); pushNationHistory($nation, "●{$admin['year']}년 {$admin['month']}월:{$general['name']}(이)가 {$destnation['name']}이호경식(을)를 발동"); pushNationHistory($destnation, "●{$admin['year']}년 {$admin['month']}월:{$nation['name']}{$general['name']}(이)가 아국에 이호경식(을)를 발동"); @@ -2291,7 +2291,7 @@ function process_78(&$general) { // $alllog[] = "●{$admin['month']}월:{$general['name']}(이)가 {$destnation['name']}급습(을)를 발동하였습니다."; // $history[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destnation['name']}급습(을)를 발동하였습니다."; - $tricklog[count($tricklog)] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destnation['name']}급습(을)를 발동하였습니다."; + $tricklog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destnation['name']}급습(을)를 발동하였습니다."; pushGeneralHistory($general, "●{$admin['year']}년 {$admin['month']}월:{$destnation['name']}급습(을)를 발동"); pushNationHistory($nation, "●{$admin['year']}년 {$admin['month']}월:{$general['name']}(이)가 {$destnation['name']}급습(을)를 발동"); pushNationHistory($destnation, "●{$admin['year']}년 {$admin['month']}월:{$nation['name']}{$general['name']}(이)가 아국에 급습(을)를 발동"); diff --git a/hwe/func_process_trick.php b/hwe/func_process_trick.php index 2e4e6e47..4b0eb8d4 100644 --- a/hwe/func_process_trick.php +++ b/hwe/func_process_trick.php @@ -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[] = "●{$admin['month']}월:없는 도시입니다. 기습 실패. <1>$date"; - } elseif($general['level'] == 0) { - $log[] = "●{$admin['month']}월:재야입니다. {$destcity['name']}에 기습 실패. <1>$date"; - } elseif($general['nation'] != $city['nation'] && $mynation['level'] != 0) { - $log[] = "●{$admin['month']}월:아국이 아닙니다. {$destcity['name']}에 기습 실패. <1>$date"; - } elseif($city['supply'] == 0 && $mynation['level'] != 0) { - $log[] = "●{$admin['month']}월:고립된 도시입니다. {$destcity['name']}에 기습 실패. <1>$date"; - } elseif($destcity['nation'] == 0) { - $log[] = "●{$admin['month']}월:공백지입니다. {$destcity['name']}에 기습 실패. <1>$date"; - } elseif($general['gold'] < $admin['develcost']*5) { - $log[] = "●{$admin['month']}월:자금이 모자랍니다. {$destcity['name']}에 기습 실패. <1>$date"; - } elseif($general['rice'] < $admin['develcost']*5) { - $log[] = "●{$admin['month']}월:군량이 모자랍니다. {$destcity['name']}에 기습 실패. <1>$date"; - } elseif($general['nation'] == $destcity['nation']) { - $log[] = "●{$admin['month']}월:아국입니다. {$destcity['name']}에 기습 실패. <1>$date"; - } elseif($dip['state'] >= 7) { - $log[] = "●{$admin['month']}월:불가침국입니다. {$destcity['name']}에 기습 실패. <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[] = "".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[] = "".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[] = "●{$admin['month']}월:{$destcity['name']}(이)가 누군가에게 공격 받았습니다."; - $log[] = "●{$admin['month']}월:{$destcity['name']}에 기습이 성공했습니다. <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[] = "●{$admin['month']}월:{$destcity['name']}에 기습이 실패했습니다. <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); -} diff --git a/hwe/func_time_event.php b/hwe/func_time_event.php index 8c0f00bb..fb457751 100644 --- a/hwe/func_time_event.php +++ b/hwe/func_time_event.php @@ -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),""); diff --git a/hwe/func_tournament.php b/hwe/func_tournament.php index f40bf7ad..6d3eb23a 100644 --- a/hwe/func_tournament.php +++ b/hwe/func_tournament.php @@ -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); diff --git a/hwe/preprocessing.php b/hwe/preprocessing.php index 20c72eec..17c44066 100644 --- a/hwe/preprocessing.php +++ b/hwe/preprocessing.php @@ -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; //견문 diff --git a/hwe/process_war.php b/hwe/process_war.php index c142ba3c..739756c8 100644 --- a/hwe/process_war.php +++ b/hwe/process_war.php @@ -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)] = "급습을 성공했다!"; + $batlog[] = "급습을 성공했다!"; $cityCrew *= 1.2; break; case 1: - $batlog[count($batlog)] = "위보를 성공했다!"; + $batlog[] = "위보를 성공했다!"; $cityCrew *= 1.4; break; case 2: - $batlog[count($batlog)] = "혼란을 성공했다!"; + $batlog[] = "혼란을 성공했다!"; $cityCrew *= 1.6; break; } @@ -232,15 +232,15 @@ function processWar($general, $city) { $type = rand() % 3; switch($type) { case 0: - $batlog[count($batlog)] = "급습을 실패했다!"; + $batlog[] = "급습을 실패했다!"; $cityCrew /= 1.2; $myCrew *= 1.2; break; case 1: - $batlog[count($batlog)] = "위보를 실패했다!"; + $batlog[] = "위보를 실패했다!"; $cityCrew /= 1.4; $myCrew *= 1.4; break; case 2: - $batlog[count($batlog)] = "혼란을 실패했다!"; + $batlog[] = "혼란을 실패했다!"; $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)] = "치료했다!"; + $batlog[] = "치료했다!"; $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)] = "필살공격!"; + $batlog[] = "필살공격!"; $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)] = "회피했다!"; + $batlog[] = "회피했다!"; $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)] = "●상대에게 위압을 줬다!"; + $batlog[] = "●상대에게 위압을 줬다!"; $myCrew = 0; } @@ -362,7 +362,7 @@ function processWar($general, $city) { $general['crew'] = round($general['crew']); $cityCrew = round($cityCrew); $myCrew = round($myCrew); - $batlog[count($batlog)] = "● $phase : 【{$general['name']}】 {$general['crew']} (-$myCrew) VS {$city['def']} (-$cityCrew) 【{$city['name']}】"; + $batlog[] = "● $phase : 【{$general['name']}】 {$general['crew']} (-$myCrew) VS {$city['def']} (-$cityCrew) 【{$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[] = "●{$game['month']}월:{$general['name']}의 ".GameUnitConst::byId($general['crewtype'])->name."(와)과 {$oppose['name']}의 ".GameUnitConst::byId($oppose['crewtype'])->name."(이)가 대결합니다."; $log[] = "●".GameUnitConst::byId($general['crewtype'])->name."(으)로 {$oppose['name']}의 ".GameUnitConst::byId($oppose['crewtype'])->name."(을)를 공격합니다."; - $opplog[count($opplog)] = "●".GameUnitConst::byId($oppose['crewtype'])->name."(으)로 {$general['name']}의 ".GameUnitConst::byId($general['crewtype'])->name."(을)를 수비합니다."; + $opplog[] = "●".GameUnitConst::byId($oppose['crewtype'])->name."(으)로 {$general['name']}의 ".GameUnitConst::byId($general['crewtype'])->name."(을)를 수비합니다."; $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)] = "".getItemName($oppose['item'])."(을)를 사용!"; + $opplog[] = "".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)] = "".getItemName($oppose['item'])."(을)를 사용!"; + $opplog[] = "".getItemName($oppose['item'])."(을)를 사용!"; $oppose['item'] = 0; } elseif($oppose['item'] >= 12 && $oppose['item'] <= 13) { //과실주, 이강주 사용 @@ -571,16 +571,16 @@ function processWar($general, $city) { // $log[] = "".getWeapName($general['weap'])."(을)를 사용!"; } $log[] = "●상대를 저격했다!"; - $batlog[count($batlog)] = "●상대를 저격했다!"; - $opplog[count($opplog)] = "●상대에게 저격당했다!"; - $oppbatlog[count($oppbatlog)] = "●상대에게 저격당했다!"; + $batlog[] = "●상대를 저격했다!"; + $opplog[] = "●상대에게 저격당했다!"; + $oppbatlog[] = "●상대에게 저격당했다!"; // 부상 $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)] = "".getItemName($general['item'])."(이)가 빗나갑니다!"; + $batlog[] = "".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)] = "".getItemName($oppose['item'])."(을)를 사용!"; + $opplog[] = "".getItemName($oppose['item'])."(을)를 사용!"; $oppose['item'] = 0; } elseif($oppose['weap'] == 10 || $oppose['weap'] == 14 || $oppose['weap'] == 18 || $oppose['weap'] == 22) { -// $opplog[count($opplog)] = "".getWeapName($oppose['weap'])."(을)를 사용!"; +// $opplog[] = "".getWeapName($oppose['weap'])."(을)를 사용!"; } - $oppbatlog[count($oppbatlog)] = "●상대를 저격했다!"; - $opplog[count($opplog)] = "●상대를 저격했다!"; - $batlog[count($batlog)] = "●상대에게 저격당했다!"; + $oppbatlog[] = "●상대를 저격했다!"; + $opplog[] = "●상대를 저격했다!"; + $batlog[] = "●상대에게 저격당했다!"; $log[] = "●상대에게 저격당했다!"; // 부상 $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)] = "".getItemName($oppose['item'])."(이)가 빗나갑니다!"; + $oppbatlog[] = "".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)] = "위보를 역으로 당했다!"; - $oppbatlog[count($oppbatlog)] = "반계로 상대의 위보를 되돌렸다!"; + $batlog[] = "위보를 역으로 당했다!"; + $oppbatlog[] = "반계로 상대의 위보를 되돌렸다!"; $myCrew *= 1.2; } else { - $batlog[count($batlog)] = "위보를 성공했다!"; - $oppbatlog[count($oppbatlog)] = "위보에 당했다!"; + $batlog[] = "위보를 성공했다!"; + $oppbatlog[] = "위보에 당했다!"; $opCrew *= 1.2; } break; @@ -708,12 +708,12 @@ function processWar($general, $city) { $ratio = rand() % 100; // 특기보정 : 반계 if($oppose['special2'] == 45 && $ratio > 70) { - $batlog[count($batlog)] = "매복을 역으로 당했다!"; - $oppbatlog[count($oppbatlog)] = "반계로 상대의 매복을 되돌렸다!"; + $batlog[] = "매복을 역으로 당했다!"; + $oppbatlog[] = "반계로 상대의 매복을 되돌렸다!"; $myCrew *= 1.4; } else { - $batlog[count($batlog)] = "매복을 성공했다!"; - $oppbatlog[count($oppbatlog)] = "매복에 당했다!"; + $batlog[] = "매복을 성공했다!"; + $oppbatlog[] = "매복에 당했다!"; $opCrew *= 1.4; } break; @@ -721,12 +721,12 @@ function processWar($general, $city) { $ratio = rand() % 100; // 특기보정 : 반계 if($oppose['special2'] == 45 && $ratio > 70) { - $batlog[count($batlog)] = "반목을 역으로 당했다!"; - $oppbatlog[count($oppbatlog)] = "반계로 상대의 반목을 되돌렸다!"; + $batlog[] = "반목을 역으로 당했다!"; + $oppbatlog[] = "반계로 상대의 반목을 되돌렸다!"; $myCrew *= 1.6; } else { - $batlog[count($batlog)] = "반목을 성공했다!"; - $oppbatlog[count($oppbatlog)] = "반목에 당했다!"; + $batlog[] = "반목을 성공했다!"; + $oppbatlog[] = "반목에 당했다!"; $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)] = "화계를 역으로 당했다!"; - $oppbatlog[count($oppbatlog)] = "반계로 상대의 화계를 되돌렸다!"; + $batlog[] = "화계를 역으로 당했다!"; + $oppbatlog[] = "반계로 상대의 화계를 되돌렸다!"; $myCrew *= 1.8; } else { - $batlog[count($batlog)] = "화계를 성공했다!"; - $oppbatlog[count($oppbatlog)] = "화계에 당했다!"; + $batlog[] = "화계를 성공했다!"; + $oppbatlog[] = "화계에 당했다!"; $opCrew *= 1.8; } break; @@ -749,12 +749,12 @@ function processWar($general, $city) { $ratio = rand() % 100; // 특기보정 : 반계 if($oppose['special2'] == 45 && $ratio > 70) { - $batlog[count($batlog)] = "혼란을 역으로 당했다!"; - $oppbatlog[count($oppbatlog)] = "반계로 상대의 혼란을 되돌렸다!"; + $batlog[] = "혼란을 역으로 당했다!"; + $oppbatlog[] = "반계로 상대의 혼란을 되돌렸다!"; $myCrew *= 2.0; } else { - $batlog[count($batlog)] = "혼란을 성공했다!"; - $oppbatlog[count($oppbatlog)] = "혼란에 당했다!"; + $batlog[] = "혼란을 성공했다!"; + $oppbatlog[] = "혼란에 당했다!"; $opCrew *= 2.0; } break; @@ -763,28 +763,28 @@ function processWar($general, $city) { $type = rand() % 5; // 0~4 switch($type) { case 0: - $batlog[count($batlog)] = "위보를 실패했다!"; - $oppbatlog[count($oppbatlog)] = "위보를 간파했다!"; + $batlog[] = "위보를 실패했다!"; + $oppbatlog[] = "위보를 간파했다!"; $opCrew /= 1.1; $myCrew *= 1.1; break; case 1: - $batlog[count($batlog)] = "매복을 실패했다!"; - $oppbatlog[count($oppbatlog)] = "매복을 간파했다!"; + $batlog[] = "매복을 실패했다!"; + $oppbatlog[] = "매복을 간파했다!"; $opCrew /= 1.2; $myCrew *= 1.2; break; case 2: - $batlog[count($batlog)] = "반목을 실패했다!"; - $oppbatlog[count($oppbatlog)] = "반목을 간파했다!"; + $batlog[] = "반목을 실패했다!"; + $oppbatlog[] = "반목을 간파했다!"; $opCrew /= 1.3; $myCrew *= 1.3; break; case 3: - $batlog[count($batlog)] = "화계를 실패했다!"; - $oppbatlog[count($oppbatlog)] = "화계를 간파했다!"; + $batlog[] = "화계를 실패했다!"; + $oppbatlog[] = "화계를 간파했다!"; $opCrew /= 1.4; $myCrew *= 1.4; break; case 4: - $batlog[count($batlog)] = "혼란을 실패했다!"; - $oppbatlog[count($oppbatlog)] = "혼란을 간파했다!"; + $batlog[] = "혼란을 실패했다!"; + $oppbatlog[] = "혼란을 간파했다!"; $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)] = "위보를 역으로 당했다!"; - $batlog[count($batlog)] = "반계로 상대의 위보를 되돌렸다!"; + $oppbatlog[] = "위보를 역으로 당했다!"; + $batlog[] = "반계로 상대의 위보를 되돌렸다!"; $opCrew *= 1.2; } else { - $oppbatlog[count($oppbatlog)] = "위보를 성공했다!"; - $batlog[count($batlog)] = "위보에 당했다!"; + $oppbatlog[] = "위보를 성공했다!"; + $batlog[] = "위보에 당했다!"; $myCrew *= 1.2; } break; @@ -849,12 +849,12 @@ function processWar($general, $city) { $ratio = rand() % 100; // 특기보정 : 반계 if($general['special2'] == 45 && $ratio > 70) { - $oppbatlog[count($oppbatlog)] = "매복을 역으로 당했다!"; - $batlog[count($batlog)] = "반계로 상대의 매복을 되돌렸다!"; + $oppbatlog[] = "매복을 역으로 당했다!"; + $batlog[] = "반계로 상대의 매복을 되돌렸다!"; $opCrew *= 1.4; } else { - $oppbatlog[count($oppbatlog)] = "매복을 성공했다!"; - $batlog[count($batlog)] = "매복에 당했다!"; + $oppbatlog[] = "매복을 성공했다!"; + $batlog[] = "매복에 당했다!"; $myCrew *= 1.4; } break; @@ -862,12 +862,12 @@ function processWar($general, $city) { $ratio = rand() % 100; // 특기보정 : 반계 if($general['special2'] == 45 && $ratio > 70) { - $oppbatlog[count($oppbatlog)] = "반목을 역으로 당했다!"; - $batlog[count($batlog)] = "반계로 상대의 반목을 되돌렸다!"; + $oppbatlog[] = "반목을 역으로 당했다!"; + $batlog[] = "반계로 상대의 반목을 되돌렸다!"; $opCrew *= 1.6; } else { - $oppbatlog[count($oppbatlog)] = "반목을 성공했다!"; - $batlog[count($batlog)] = "반목에 당했다!"; + $oppbatlog[] = "반목을 성공했다!"; + $batlog[] = "반목에 당했다!"; $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)] = "화계를 역으로 당했다!"; - $batlog[count($batlog)] = "반계로 상대의 화계을 되돌렸다!"; + $oppbatlog[] = "화계를 역으로 당했다!"; + $batlog[] = "반계로 상대의 화계을 되돌렸다!"; $opCrew *= 1.8; } else { - $oppbatlog[count($oppbatlog)] = "화계를 성공했다!"; - $batlog[count($batlog)] = "화계에 당했다!"; + $oppbatlog[] = "화계를 성공했다!"; + $batlog[] = "화계에 당했다!"; $myCrew *= 1.8; } break; @@ -890,12 +890,12 @@ function processWar($general, $city) { $ratio = rand() % 100; // 특기보정 : 반계 if($general['special2'] == 45 && $ratio > 70) { - $oppbatlog[count($oppbatlog)] = "혼란을 역으로 당했다!"; - $batlog[count($batlog)] = "반계로 상대의 혼란을 되돌렸다!"; + $oppbatlog[] = "혼란을 역으로 당했다!"; + $batlog[] = "반계로 상대의 혼란을 되돌렸다!"; $opCrew *= 2.0; } else { - $oppbatlog[count($oppbatlog)] = "혼란을 성공했다!"; - $batlog[count($batlog)] = "혼란에 당했다!"; + $oppbatlog[] = "혼란을 성공했다!"; + $batlog[] = "혼란에 당했다!"; $myCrew *= 2.0; } break; @@ -904,28 +904,28 @@ function processWar($general, $city) { $type = rand() % 5; // 0~4 switch($type) { case 0: - $oppbatlog[count($oppbatlog)] = "위보를 실패했다!"; - $batlog[count($batlog)] = "위보를 간파했다!"; + $oppbatlog[] = "위보를 실패했다!"; + $batlog[] = "위보를 간파했다!"; $myCrew /= 1.1; $opCrew *= 1.1; break; case 1: - $oppbatlog[count($oppbatlog)] = "매복을 실패했다!"; - $batlog[count($batlog)] = "매복을 간파했다!"; + $oppbatlog[] = "매복을 실패했다!"; + $batlog[] = "매복을 간파했다!"; $myCrew /= 1.2; $opCrew *= 1.2; break; case 2: - $oppbatlog[count($oppbatlog)] = "반목을 실패했다!"; - $batlog[count($batlog)] = "반목을 간파했다!"; + $oppbatlog[] = "반목을 실패했다!"; + $batlog[] = "반목을 간파했다!"; $myCrew /= 1.3; $opCrew *= 1.3; break; case 3: - $oppbatlog[count($oppbatlog)] = "화계를 실패했다!"; - $batlog[count($batlog)] = "화계를 간파했다!"; + $oppbatlog[] = "화계를 실패했다!"; + $batlog[] = "화계를 간파했다!"; $myCrew /= 1.4; $opCrew *= 1.4; break; case 4: - $oppbatlog[count($oppbatlog)] = "혼란을 실패했다!"; - $batlog[count($batlog)] = "혼란을 간파했다!"; + $oppbatlog[] = "혼란을 실패했다!"; + $batlog[] = "혼란을 간파했다!"; $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)] = "저지당했다!"; - $oppbatlog[count($oppbatlog)] = "●상대를 저지했다!"; + $batlog[] = "저지당했다!"; + $oppbatlog[] = "●상대를 저지했다!"; $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)] = "치료했다!"; + $batlog[] = "치료했다!"; $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)] = "치료했다!"; + $oppbatlog[] = "치료했다!"; $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)] = "필살공격!"; - $oppbatlog[count($oppbatlog)] = "●상대의 필살공격!"; + $batlog[] = "필살공격!"; + $oppbatlog[] = "●상대의 필살공격!"; $opCrew = CriticalScore2($opCrew); $myAvoid = 0; // 특기보정 : 격노 if($oppose['special2'] == 74) { if(rand() % 100 < 50) { - $batlog[count($batlog)] = "●필살 공격에 상대가 격노했다!"; - $oppbatlog[count($oppbatlog)] = "●상대의 필살 공격에 격노했다!"; + $batlog[] = "●필살 공격에 상대가 격노했다!"; + $oppbatlog[] = "●상대의 필살 공격에 격노했다!"; $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)] = "필살공격!"; - $batlog[count($batlog)] = "●상대의 필살공격!"; + $oppbatlog[] = "필살공격!"; + $batlog[] = "●상대의 필살공격!"; $myCrew = CriticalScore2($myCrew); $opAvoid = 0; // 특기보정 : 격노 if($general['special2'] == 74) { if(rand() % 100 < 33) { - $oppbatlog[count($oppbatlog)] = "●필살 공격에 상대가 진노했다!"; - $batlog[count($batlog)] = "●상대의 필살 공격에 진노했다!"; + $oppbatlog[] = "●필살 공격에 상대가 진노했다!"; + $batlog[] = "●상대의 필살 공격에 진노했다!"; $opCrew = CriticalScore2($opCrew); $myAvoid = 0; $warphase++; } elseif(rand() % 100 < 33) { - $oppbatlog[count($oppbatlog)] = "●필살 공격에 상대가 격노했다!"; - $batlog[count($batlog)] = "●상대의 필살 공격에 격노했다!"; + $oppbatlog[] = "●필살 공격에 상대가 격노했다!"; + $batlog[] = "●상대의 필살 공격에 격노했다!"; $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)] = "●회피 시도에 상대가 격노했다!"; - $oppbatlog[count($oppbatlog)] = "●상대의 회피 시도에 격노했다!"; + $batlog[] = "●회피 시도에 상대가 격노했다!"; + $oppbatlog[] = "●상대의 회피 시도에 격노했다!"; $myCrew = CriticalScore2($myCrew); $opAvoid = 0; } else { - $batlog[count($batlog)] = "회피했다!"; - $oppbatlog[count($oppbatlog)] = "●상대가 회피했다!"; + $batlog[] = "회피했다!"; + $oppbatlog[] = "●상대가 회피했다!"; $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)] = "●회피 시도에 상대가 진노했다!"; - $batlog[count($batlog)] = "●상대의 회피 시도에 진노했다!"; + $oppbatlog[] = "●회피 시도에 상대가 진노했다!"; + $batlog[] = "●상대의 회피 시도에 진노했다!"; $opCrew = CriticalScore2($opCrew); $myAvoid = 0; $warphase++; } elseif($general['special2'] == 74 && rand() % 100 < 33) { - $oppbatlog[count($oppbatlog)] = "●회피 시도에 상대가 격노했다!"; - $batlog[count($batlog)] = "●상대의 회피 시도에 격노했다!"; + $oppbatlog[] = "●회피 시도에 상대가 격노했다!"; + $batlog[] = "●상대의 회피 시도에 격노했다!"; $opCrew = CriticalScore2($opCrew); $myAvoid = 0; } else { - $oppbatlog[count($oppbatlog)] = "회피했다!"; - $batlog[count($batlog)] = "●상대가 회피했다!"; + $oppbatlog[] = "회피했다!"; + $batlog[] = "●상대가 회피했다!"; $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)] = "●상대에게 위압을 줬다!"; - $oppbatlog[count($oppbatlog)] = "●상대에게 위압받았다!"; + $batlog[] = "●상대에게 위압을 줬다!"; + $oppbatlog[] = "●상대에게 위압받았다!"; $myCrew = 0; } //특기보정: 위압 if($oppose['special2'] == 63 && $phase == 1 && $oppose['crew'] >= 1000 && $oppose['atmos'] >= 90 && $oppose['train'] >= 90) { - $batlog[count($batlog)] = "●상대에게 위압받았다!"; - $oppbatlog[count($oppbatlog)] = "●상대에게 위압을 줬다!"; + $batlog[] = "●상대에게 위압받았다!"; + $oppbatlog[] = "●상대에게 위압을 줬다!"; $opCrew = 0; } @@ -1227,8 +1227,8 @@ function processWar($general, $city) { $oppose['crew'] = round($oppose['crew']); $myCrew = round($myCrew); $opCrew = round($opCrew); - $batlog[count($batlog)] = "● $phase : 【{$general['name']}】 {$general['crew']} (-$myCrew) VS {$oppose['crew']} (-$opCrew) 【{$oppose['name']}】"; - $oppbatlog[count($oppbatlog)] = "● $phase : 【{$oppose['name']}】 {$oppose['crew']} (-$opCrew) VS {$general['crew']} (-$myCrew) 【{$general['name']}】"; + $batlog[] = "● $phase : 【{$general['name']}】 {$general['crew']} (-$myCrew) VS {$oppose['crew']} (-$opCrew) 【{$oppose['name']}】"; + $oppbatlog[] = "● $phase : 【{$oppose['name']}】 {$oppose['crew']} (-$opCrew) VS {$general['crew']} (-$myCrew) 【{$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)] = "●전투중 부상당했다!"; + $opplog[] = "●전투중 부상당했다!"; $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[] = "●{$game['month']}월:{$oppose['name']}의 ".GameUnitConst::byId($oppose['crewtype'])->name."(이)가 패퇴했습니다."; $log[] = "{$oppose['name']}의 ".GameUnitConst::byId($oppose['crewtype'])->name."(이)가 패퇴했습니다."; - $opplog[count($opplog)] = "●군량 부족으로 패퇴합니다."; + $opplog[] = "●군량 부족으로 패퇴합니다."; } else { $alllog[] = "●{$game['month']}월:{$oppose['name']}의 ".GameUnitConst::byId($oppose['crewtype'])->name."(이)가 전멸했습니다."; $log[] = "{$oppose['name']}의 ".GameUnitConst::byId($oppose['crewtype'])->name."(이)가 전멸했습니다."; - $opplog[count($opplog)] = "●전멸했습니다."; + $opplog[] = "●전멸했습니다."; } $opposecount--; @@ -1405,11 +1405,11 @@ function processWar($general, $city) { if($myRice <= round($general['crew']/100)) { $alllog[] = "●{$game['month']}월:{$general['name']}의 ".GameUnitConst::byId($general['crewtype'])->name."(이)가 퇴각했습니다."; $log[] = "●군량 부족으로 퇴각합니다."; - $opplog[count($opplog)] = "{$general['name']}의 ".GameUnitConst::byId($general['crewtype'])->name."(이)가 퇴각했습니다."; + $opplog[] = "{$general['name']}의 ".GameUnitConst::byId($general['crewtype'])->name."(이)가 퇴각했습니다."; } else { $alllog[] = "●{$game['month']}월:{$general['name']}의 ".GameUnitConst::byId($general['crewtype'])->name."(이)가 퇴각했습니다."; $log[] = "●퇴각했습니다."; - $opplog[count($opplog)] = "{$general['name']}의 ".GameUnitConst::byId($general['crewtype'])->name."(이)가 퇴각했습니다."; + $opplog[] = "{$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); } diff --git a/hwe/processing.php b/hwe/processing.php index 4bdecd62..c4aa93d8 100644 --- a/hwe/processing.php +++ b/hwe/processing.php @@ -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; //견문