From 5b0a3b064d7498a8268c3a14c467d820b6f07c41 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Mon, 3 Oct 2022 23:37:07 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20AI=20=ED=9B=84=EB=B0=A9=20=EB=B0=9C?= =?UTF-8?q?=EB=A0=B9=20=EB=A1=9C=EC=A7=81=20=EB=B2=84=EA=B7=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20-=20=EC=A7=95=EB=B3=91=EC=8B=9C=20=EC=9D=B8?= =?UTF-8?q?=EA=B5=AC=20=EC=86=8C=EB=AA=A8=EA=B0=80=20=EC=97=86=EB=8A=94=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0=20=ED=9B=84=EB=B0=A9=20=EB=B0=9C=EB=A0=B9=20?= =?UTF-8?q?=EC=A0=9C=EC=99=B8=20-=20NPC=20=EC=88=98=EB=87=8C=EC=9D=BC?= =?UTF-8?q?=EB=95=8C=EC=99=80=20=EC=9C=A0=EC=A0=80=20=EC=88=98=EB=87=8C?= =?UTF-8?q?=EC=9D=BC=20=EB=95=8C=20=EB=8F=84=EC=8B=9C=20=EC=9D=B8=EA=B5=AC?= =?UTF-8?q?=20=EA=B3=84=EC=82=B0=EC=8B=9D=20=EB=8B=A4=EB=A5=B8=20=EB=B2=84?= =?UTF-8?q?=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/GeneralAI.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/hwe/sammo/GeneralAI.php b/hwe/sammo/GeneralAI.php index 9c95fc08..5e45fd4f 100644 --- a/hwe/sammo/GeneralAI.php +++ b/hwe/sammo/GeneralAI.php @@ -673,6 +673,9 @@ class GeneralAI if ($userGeneral->getVar('crew') >= $this->nationPolicy->minWarCrew) { continue; } + if ($userGeneral->onCalcDomestic('징집인구', 'score', 100) <= 1) { + continue; + } $generalCadidates[$generalID] = $userGeneral; } @@ -686,9 +689,10 @@ class GeneralAI /** @var General */ $pickedGeneral = $this->rng->choice($generalCadidates); - $minRecruitPop = $this->fullLeadership * 100 + GameConst::$minAvailableRecruitPop; - if (!$this->generalPolicy->can한계징병) { - $minRecruitPop = max($minRecruitPop, $this->fullLeadership * 100 + $this->nationPolicy->minNPCRecruitCityPopulation); + $pickedGeneralLeadership = $pickedGeneral->getLeadership(false, true, true, true); + $minRecruitPop = $pickedGeneralLeadership * 100 + GameConst::$minAvailableRecruitPop; + if($pickedGeneral->getNPCType() >= 2) { + $minRecruitPop = max($minRecruitPop, $pickedGeneralLeadership * 100 + $this->nationPolicy->minNPCRecruitCityPopulation); } $recruitableCityList = []; @@ -972,6 +976,9 @@ class GeneralAI if ($npcGeneral->getVar('crew') >= $this->nationPolicy->minWarCrew) { continue; } + if ($npcGeneral->onCalcDomestic('징집인구', 'score', 100) <= 1) { + continue; + } $generalCadidates[$generalID] = $npcGeneral; } @@ -985,9 +992,10 @@ class GeneralAI /** @var General */ $pickedGeneral = $this->rng->choice($generalCadidates); - $minRecruitPop = $this->fullLeadership * 100 + GameConst::$minAvailableRecruitPop; - if (!$this->generalPolicy->can한계징병) { - $minRecruitPop = max($minRecruitPop, $this->fullLeadership * 100 + $this->nationPolicy->minNPCRecruitCityPopulation); + $pickedGeneralLeadership = $pickedGeneral->getLeadership(false, true, true, true); + $minRecruitPop = $pickedGeneralLeadership * 100 + GameConst::$minAvailableRecruitPop; + if($pickedGeneral->getNPCType() >= 2) { + $minRecruitPop = max($minRecruitPop, $pickedGeneralLeadership * 100 + $this->nationPolicy->minNPCRecruitCityPopulation); } $recruitableCityList = [];