From 929d2db5a583ebcfb8da28007b6a7e50882cf7ce Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 20 Jun 2020 21:43:28 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9C=A0=EC=A0=80=EC=9E=A5=20=EA=B5=AC?= =?UTF-8?q?=EC=B6=9C=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95=20=EC=98=88?= =?UTF-8?q?=EC=83=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/GeneralAI.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/hwe/sammo/GeneralAI.php b/hwe/sammo/GeneralAI.php index 17652a8d..9495428a 100644 --- a/hwe/sammo/GeneralAI.php +++ b/hwe/sammo/GeneralAI.php @@ -694,19 +694,13 @@ class GeneralAI if(!$this->nation['capital']){ return null; } - if (in_array($this->dipState, [self::d평화, self::d선포])) { - return null; - } //고립 도시 장수 발령 $args = []; foreach ($this->lostGenerals as $lostGeneral) { - LogText('구출준비', "{$lostGeneral->getName()}"); if ($lostGeneral->getNPCType() >= 2) { continue; } - LogText('구출준비1', "{$lostGeneral->getName()}"); - if( $lostGeneral->getVar('crew') >= $this->nationPolicy->minWarCrew && $lostGeneral->getVar('train') >= $lostGeneral->getVar('defence_train') && @@ -716,8 +710,6 @@ class GeneralAI continue; } - LogText('구출준비2', "{$lostGeneral->getName()}"); - $troopID = $lostGeneral->getVar('troop'); if($troopID && key_exists($troopID, $this->troopLeaders)){ $troopLeader = $this->troopLeaders[$troopID]; @@ -730,7 +722,6 @@ class GeneralAI continue; } } - LogText('구출준비3', "{$lostGeneral->getName()}"); if (in_array($this->dipState, [self::d직전, self::d전쟁]) && count($this->frontCities) > 2) { $selCity = Util::choiceRandom($this->frontCities); @@ -746,10 +737,12 @@ class GeneralAI if(!$args){ return null; } - LogText('구출준비5', count($args)); - $cmd = buildNationCommandClass('che_발령', $this->general, $this->env, $lastTurn, Util::choiceRandom($args)); + + $arg = Util::choiceRandom($args); + $cmd = buildNationCommandClass('che_발령', $this->general, $this->env, $lastTurn, $arg); + if(!$cmd->hasFullConditionMet()){ - LogText('구출준비5', count($args)); + LogText('구출실패', [$arg, $cmd->getFailString()]); return null; } return $cmd;