From 5c9b79729fc1d1cbef5ee8590a43dadd696e0174 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 6 Oct 2018 04:18:08 +0900 Subject: [PATCH] =?UTF-8?q?AI=EC=97=90=EC=84=9C=20'=EB=82=B4=EC=A0=95?= =?UTF-8?q?=ED=92=80'=20=EC=9D=B8=EC=8B=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/GeneralAI.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hwe/sammo/GeneralAI.php b/hwe/sammo/GeneralAI.php index 4ae9fc02..bbbd1f65 100644 --- a/hwe/sammo/GeneralAI.php +++ b/hwe/sammo/GeneralAI.php @@ -129,7 +129,7 @@ class GeneralAI{ } } - protected function chooseDevelopTurn():?array{ + protected function chooseDevelopTurn(bool &$cityFull):?array{ $general = $this->general; $city = $this->city; $nation = $this->nation; @@ -140,6 +140,8 @@ class GeneralAI{ $power = $this->power; $intel = $this->intel; + $cityFull = false; + $develRate = [ 'trust'=>$city['trust'], 'pop'=>$city['pop']/$city['pop2'], @@ -151,7 +153,7 @@ class GeneralAI{ ]; // 우선 선정 - if($develRate['trust'] < 95 && Util::randBool($leadership / 40)){ + if($develRate['trust'] < 0.95 && Util::randBool($leadership / 40)){ return ['che_선정', null]; } @@ -212,6 +214,10 @@ class GeneralAI{ } } + if(!$commandList){ + $cityFull = true; + } + $genCount = $db->queryFirstField('SELECT count(no) FROM general'); $commandList['che_인재탐색'] = 500 / $genCount * 10; @@ -219,8 +225,6 @@ class GeneralAI{ (GameConst::$minNationalGold + GameConst::$minNationalRice + 10000) / Util::valueFit($nation['gold'] + $nation['rice'], 1000) ) * 10; - - //NOTE:내정 풀을 인식하는게 더 좋지 않을까? return [Util::choiceRandomUsingWeight($commandList), null]; }