From 127cbf1509263402e8629fa9d3befe023326f427 Mon Sep 17 00:00:00 2001 From: hide_d Date: Wed, 22 Apr 2020 23:55:13 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/Command/General/che_인재탐색.php | 2 +- hwe/sammo/GeneralAI.php | 34 ++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/hwe/sammo/Command/General/che_인재탐색.php b/hwe/sammo/Command/General/che_인재탐색.php index 56eda7fb..e656a7a6 100644 --- a/hwe/sammo/Command/General/che_인재탐색.php +++ b/hwe/sammo/Command/General/che_인재탐색.php @@ -221,7 +221,7 @@ class che_인재탐색 extends Command\GeneralCommand{ $intel = Util::round($intel); - $joinProp = 0.55 * $avgCnt / ($genCnt + $npcCnt / 2); + $joinProp = 0.55 * $avgCnt / (Util::valueFit($genCnt + $npcCnt, 1) / 2); $noScout = false; if($this->nation['scout'] != 0){ $noScout = true; diff --git a/hwe/sammo/GeneralAI.php b/hwe/sammo/GeneralAI.php index 139aef37..80ba4d89 100644 --- a/hwe/sammo/GeneralAI.php +++ b/hwe/sammo/GeneralAI.php @@ -1547,6 +1547,40 @@ class GeneralAI return null; } + $currentTech = $this->nation['tech']; + if(!TechLimit($this->env['startyear'], $this->env['year'], $currentTech + 1000)){ + return null; + } + + $avgGold = 0; + $avgRice = 0; + $genCnt = 0; + foreach($this->npcWarGenerals as $general){ + $avgGold += $general->getVar('gold'); + $avgRice += $general->getVar('rice'); + $genCnt += 1; + } + foreach($this->userWarGenerals as $general){ + $avgGold += $general->getVar('gold'); + $avgRice += $general->getVar('rice'); + $genCnt += 1; + } + + if($genCnt == 0){ + //장수가 없는데 무슨 선포야. + return null; + } + $avgGold /= $genCnt; + $avgRice /= $genCnt; + + $trialProp = $avgGold / max($this->nationPolicy->reqNPCWarGold, 1000); + $trialProp += $avgRice / max($this->nationPolicy->reqNPCWarRice, 1000); + $trialProp /= 2; + + if(!Util::randBool($trialProp)){ + return null; + } + $targetNationID = $this->findWarTarget();