From ba6370d206dc2b885f47ea5f225b6a0891a74dd8 Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 16 Dec 2021 01:02:41 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20AI=20=EC=A0=84=EC=9F=81=20=EC=83=81?= =?UTF-8?q?=ED=83=9C=20=EC=A0=95=EC=9D=98=EB=A5=BC=20=EB=8B=A4=EC=8B=9C.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/GeneralAI.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hwe/sammo/GeneralAI.php b/hwe/sammo/GeneralAI.php index 3c8a6e75..fd14f1b7 100644 --- a/hwe/sammo/GeneralAI.php +++ b/hwe/sammo/GeneralAI.php @@ -224,7 +224,7 @@ class GeneralAI } } - if (!$onWar && !$onWarReady && !$onWarYet) { + if (!$onWar && !$onWarReady) { $warTargetNation[0] = 1; } @@ -245,18 +245,17 @@ class GeneralAI $nationStor->last_attackable = $yearMonth; } - if ($onWar || (!$onWarReady && !$onWarYet)) { - //확실한 전쟁 상태 + if (key_exists(0, $warTargetNation) && $this->attackable) { + $this->dipState = self::d전쟁; + $nationStor->last_attackable = $yearMonth; + } else if ($onWar) { if ($this->attackable) { - //그리고 출병 가능한 도시도 있음 $this->dipState = self::d전쟁; $nationStor->last_attackable = $yearMonth; - } - else if($nationStor->last_attackable >= $yearMonth - 5){ + } else if ($nationStor->last_attackable >= $yearMonth - 5) { //그러나 접경이 없음. 대신, 접경이 사라진지 아직 5개월 이내. $this->dipState = self::d전쟁; } - //5개월도 넘었다면 다른 국가를 찾아보자. } } @@ -265,7 +264,7 @@ class GeneralAI if ($this->warRoute !== null) { return; } - $target = $this->warTargetNation; + $target = array_keys($this->warTargetNation??[]); $target[] = $this->nation['nation']; $this->warRoute = searchAllDistanceByNationList($target, false);