From 48207b93002d9ac2e29f80bd1abece15b0f7ebd2 Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 24 Apr 2018 01:58:07 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8F=AC=EC=83=81=20=EC=A1=B0=EA=B1=B4=20?= =?UTF-8?q?=EC=9E=AC=20=EC=88=98=EC=A0=95.=20=EB=AC=B4=EC=A7=80=EC=9E=A5?= =?UTF-8?q?=EC=9D=B4=EB=9D=BC=EB=8F=84=20=EA=B8=88=EC=8C=80=EC=9D=B4=20?= =?UTF-8?q?=EB=84=88=EB=AC=B4=20=EC=A0=81=EC=9C=BC=EB=A9=B4=20=EC=A3=BC?= =?UTF-8?q?=EA=B8=B4=20=ED=95=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_npc.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hwe/func_npc.php b/hwe/func_npc.php index 7c7ce4c0..69d93ab1 100644 --- a/hwe/func_npc.php +++ b/hwe/func_npc.php @@ -261,6 +261,7 @@ function processAI($no) { } $tech = getTechCost($nation['tech']); + $resrc = $tech * 700;//XXX: 왜 700이지? if($general['atmos'] >= 90 && $general['train'] >= 90) { if($general['mode'] == 0) { @@ -626,12 +627,13 @@ function processAI($no) { } } else { // 포상 // 포상 대상 - list($npcGenID, $npcGenValue) = $db->queryFirstList( - 'SELECT `no`, %b FROM general WHERE nation=%i AND `no`!=%i AND npc >= 2 AND killturn > 5 AND leader >= 40 ORDER BY %b ASC LIMIT 1', + list($npcGenID, $npcGenValue, $npcLeadership) = $db->queryFirstList( + 'SELECT `no`, %b, leader FROM general WHERE nation=%i AND `no`!=%i AND npc >= 2 AND killturn > 5 AND (leader >= 40 OR %b < %i) ORDER BY %b ASC LIMIT 1', $type, $general['nation'], $general['no'], $type, + $resrc, $type ); @@ -640,7 +642,6 @@ function processAI($no) { $type, $general['nation'], $general['no'], - $type, $type ); @@ -657,6 +658,10 @@ function processAI($no) { if ($genID) { if($genID === $npcGenID){ $amount = min(100, intdiv(($nation[$type]-GameConst::$baserice), 5000)*10 + 10); + if($npcLeadership < 40){ + $amount = min($amount, intdiv($resrc, 1000)*10 + 10); + } + } else{ $amount = min(100, intdiv(($nation[$type]-GameConst::$baserice), 2000)*10 + 10); @@ -710,8 +715,6 @@ function processAI($no) { return; } - $resrc = $tech * 700;//XXX: 왜 700이지? - if($general['leader'] < 40){ //무지장인데