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();