From cfa2cff34a83a873f49945182607078812437416 Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 13 Aug 2019 00:20:07 +0900 Subject: [PATCH] =?UTF-8?q?NPC=EC=9D=98=20=EA=B8=B0=EC=88=A0=20=EC=97=B0?= =?UTF-8?q?=EA=B5=AC=20=EA=B8=B0=EC=A4=80=EC=9D=84=20'=EA=B8=B0=EC=88=A0?= =?UTF-8?q?=EC=A0=9C=ED=95=9C=EC=9D=B4=20=EC=95=84=EB=8B=88=EB=A9=B4'?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_npc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hwe/func_npc.php b/hwe/func_npc.php index fd46eec0..80be3c09 100644 --- a/hwe/func_npc.php +++ b/hwe/func_npc.php @@ -5,6 +5,9 @@ function SetDevelop($genType, $no, $city, $tech) { $db = DB::db(); $connect=$db->get(); + $gameStor = KVStorage::getStorage($db, 'game_env'); + [$startyear, $year] = $gameStor->getValuesAsArray(['startyear', 'year']); + $query = "select rate,pop/pop2*100 as po,comm/comm2*100 as co,def/def2*100 as de,wall/wall2*100 as wa,secu/secu2*100 as se,agri/agri2*100 as ag from city where city='$city'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $city = MYDB_fetch_array($result); @@ -52,11 +55,11 @@ function SetDevelop($genType, $no, $city, $tech) { elseif($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장 else { $command = EncodeCommand(0, 0, 0, 9); } //조달 } elseif($prob < 90) { - if($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술 + if(!TechLimit($startyear, $year, $tech)) { $command = EncodeCommand(0, 0, 0, 3); } //기술 elseif($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장 else { $command = EncodeCommand(0, 0, 0, 9); } //조달 } else { - if($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3 + (rand() % 2) * 6); } //기술, 조달 + if(!TechLimit($startyear, $year, $tech)) { $command = EncodeCommand(0, 0, 0, 3 + (rand() % 2) * 6); } //기술, 조달 else { $command = EncodeCommand(0, 0, 0, 29); } } break;