버그 수정

This commit is contained in:
2020-04-22 02:31:53 +09:00
parent cf7a4a82f3
commit 5893d853aa
+10 -8
View File
@@ -775,7 +775,7 @@ class GeneralAI
/** @var General */ /** @var General */
$destGeneral = Util::choiceRandom($generalCandidates); $destGeneral = Util::choiceRandom($generalCandidates);
$srcCity = $this->supplyCities[$destGeneral->getCityID]; $srcCity = $this->supplyCities[$destGeneral->getCityID()];
$destCity = $this->supplyCities[Util::choiceRandomUsingWeight($cityCandidiates)]; $destCity = $this->supplyCities[Util::choiceRandomUsingWeight($cityCandidiates)];
if($srcCity['dev'] <= $destCity['dev']){ if($srcCity['dev'] <= $destCity['dev']){
@@ -1004,7 +1004,7 @@ class GeneralAI
/** @var General */ /** @var General */
$destGeneral = Util::choiceRandom($generalCandidates); $destGeneral = Util::choiceRandom($generalCandidates);
$srcCity = $this->supplyCities[$destGeneral->getCityID]; $srcCity = $this->supplyCities[$destGeneral->getCityID()];
$destCity = $this->supplyCities[Util::choiceRandomUsingWeight($cityCandidiates)]; $destCity = $this->supplyCities[Util::choiceRandomUsingWeight($cityCandidiates)];
if($srcCity['dev'] <= $destCity['dev']){ if($srcCity['dev'] <= $destCity['dev']){
@@ -1068,6 +1068,9 @@ class GeneralAI
} }
//국고와 '충분한 금액'의 기하평균 //국고와 '충분한 금액'의 기하평균
$payAmount = sqrt(($enoughMoney - $targetUserGeneral->getVar($resName)) * $resVal); $payAmount = sqrt(($enoughMoney - $targetUserGeneral->getVar($resName)) * $resVal);
if($payAmount < $this->nationPolicy->minimumResourceActionAmount){
continue;
}
if ($resVal < $payAmount / 2) { if ($resVal < $payAmount / 2) {
continue; continue;
@@ -1526,6 +1529,8 @@ class GeneralAI
return null; return null;
} }
$targetNationID = $this->findWarTarget(); $targetNationID = $this->findWarTarget();
if($targetNationID === null){ if($targetNationID === null){
return null; return null;
@@ -1697,6 +1702,7 @@ class GeneralAI
$cmdList = []; $cmdList = [];
LogText('내정', [$general->getName(), $this->city['name'], $develRate]);
if ($genType & self::t통솔장) { if ($genType & self::t통솔장) {
if ($develRate['trust'] < 0.95) { if ($develRate['trust'] < 0.95) {
$cmd = buildGeneralCommandClass('che_주민선정', $general, $env); $cmd = buildGeneralCommandClass('che_주민선정', $general, $env);
@@ -2458,7 +2464,7 @@ class GeneralAI
{ {
$city = $this->city; $city = $this->city;
if(Util::randBool(0.8)){ if(Util::randBool(0.6)){
return null; return null;
} }
@@ -2483,10 +2489,6 @@ class GeneralAI
return null; return null;
} }
if (!Util::randBool(0.4)) {
return null;
}
$this->categorizeNationCities(); $this->categorizeNationCities();
$candidateCities = []; $candidateCities = [];
foreach($this->supplyCities as $candidate){ foreach($this->supplyCities as $candidate){
@@ -3174,7 +3176,7 @@ class GeneralAI
$nation = $this->nation; $nation = $this->nation;
$nationID = $nation['nation']; $nationID = $nation['nation'];
if(!$this->frontCities){ if($this->frontCities){
return null; return null;
} }