버그 수정
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user