From ab3dcff023802883c49c45bd116a4eb0ea8fc7fc Mon Sep 17 00:00:00 2001 From: hide_d Date: Wed, 19 Sep 2018 01:49:46 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A0=91=EA=B2=BD=EC=A7=80=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=EC=8B=9C,=20=EA=B3=B5=EB=B0=B1=EC=A7=80=20=EC=A0=91?= =?UTF-8?q?=EA=B2=BD=EC=9D=B8=EC=A7=80=20=EC=A0=81=EA=B5=B0=20=EC=A0=91?= =?UTF-8?q?=EA=B2=BD=EC=9D=B8=EC=A7=80=20=EA=B5=AC=EB=B6=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_gamerule.php | 2 +- hwe/func_npc.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hwe/func_gamerule.php b/hwe/func_gamerule.php index d1108d00..1a703038 100644 --- a/hwe/func_gamerule.php +++ b/hwe/func_gamerule.php @@ -229,7 +229,7 @@ function SetNationFront($nationNo) { if($adj){ $db->update('city', [ - 'front'=>1 + 'front'=>($enemyCities?1:2), ], 'nation=%i and city in %li', $nationNo, array_keys($adj)); } } diff --git a/hwe/func_npc.php b/hwe/func_npc.php index fcd92fc3..188254cb 100644 --- a/hwe/func_npc.php +++ b/hwe/func_npc.php @@ -248,7 +248,7 @@ function processAI($no) { $coreCommand = MYDB_fetch_array($result); } - $cityCount = $db->queryFirstField('SELECT count(city) FROM city WHERE nation=%i AND supply=1 AND front=1', $general['nation']); + $cityCount = $db->queryFirstField('SELECT count(city) FROM city WHERE nation=%i AND supply=1 AND front>0', $general['nation']); // 공격가능도시 있으면 1 $attackable = $cityCount > 0; @@ -491,7 +491,7 @@ function processAI($no) { SetNationFront($nation['nation']); - $frontCount = $db->queryFirstField('SELECT count(city) FROM city WHERE nation=%i AND front=1', $general['nation']); + $frontCount = $db->queryFirstField('SELECT count(city) FROM city WHERE nation=%i AND front>0', $general['nation']); if($frontCount > 0){ break; } @@ -745,7 +745,7 @@ function processAI($no) { //전시일때 if($general['gold'] + $general['rice'] < $resrc*2) { $command = EncodeCommand(0, 0, 0, 9); } //금쌀없으면 조달 elseif($general['rice'] > $resrc && $city['rate'] < 95 && $city['front'] == 0) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정 - elseif($general['rice'] > $resrc && $city['rate'] < 50 && $city['front'] == 1) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정 + elseif($general['rice'] > $resrc && $city['rate'] < 50 && $city['front'] > 0) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정 elseif($general['gold'] < $resrc || ($general['gold'] < $resrc *2 && $general['rice'] > $resrc * 6)) { // 금없으면 쌀팜 $amount = intdiv(($general['rice'] - $general['gold'])/2, 100); // 100단위 if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }// 팜 @@ -827,9 +827,9 @@ function processAI($no) { if(count($target) == 0) { //전방 도시 선택, 30% 확률로 태수 있는 전방으로 워프 if(rand()%100 < 30) { - $query = "select city from city where nation='{$general['nation']}' and supply='1' and front=1 order by gen1 desc,rand() limit 0,1"; + $query = "select city from city where nation='{$general['nation']}' and supply='1' and front>0 order by gen1 desc,rand() limit 0,1"; } else { - $query = "select city from city where nation='{$general['nation']}' and supply='1' and front=1 order by rand() limit 0,1"; + $query = "select city from city where nation='{$general['nation']}' and supply='1' and front>0 order by rand() limit 0,1"; } $result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),""); $cityCount = MYDB_num_rows($result);