fix: AI 전쟁 상태 정의를 다시.

This commit is contained in:
2021-12-16 01:02:41 +09:00
parent 4e20bf1d1c
commit 786306e32a
+8 -9
View File
@@ -224,7 +224,7 @@ class GeneralAI
} }
} }
if (!$onWar && !$onWarReady && !$onWarYet) { if (!$onWar && !$onWarReady) {
$warTargetNation[0] = 1; $warTargetNation[0] = 1;
} }
@@ -245,18 +245,17 @@ class GeneralAI
$nationStor->last_attackable = $yearMonth; $nationStor->last_attackable = $yearMonth;
} }
if ($onWar || (!$onWarReady && !$onWarYet)) { if (key_exists(0, $warTargetNation) && $this->attackable) {
//확실한 전쟁 상태
if ($this->attackable) {
//그리고 출병 가능한 도시도 있음
$this->dipState = self::d전쟁; $this->dipState = self::d전쟁;
$nationStor->last_attackable = $yearMonth; $nationStor->last_attackable = $yearMonth;
} } else if ($onWar) {
else if($nationStor->last_attackable >= $yearMonth - 5){ if ($this->attackable) {
$this->dipState = self::d전쟁;
$nationStor->last_attackable = $yearMonth;
} else if ($nationStor->last_attackable >= $yearMonth - 5) {
//그러나 접경이 없음. 대신, 접경이 사라진지 아직 5개월 이내. //그러나 접경이 없음. 대신, 접경이 사라진지 아직 5개월 이내.
$this->dipState = self::d전쟁; $this->dipState = self::d전쟁;
} }
//5개월도 넘었다면 다른 국가를 찾아보자.
} }
} }
@@ -265,7 +264,7 @@ class GeneralAI
if ($this->warRoute !== null) { if ($this->warRoute !== null) {
return; return;
} }
$target = $this->warTargetNation; $target = array_keys($this->warTargetNation??[]);
$target[] = $this->nation['nation']; $target[] = $this->nation['nation'];
$this->warRoute = searchAllDistanceByNationList($target, false); $this->warRoute = searchAllDistanceByNationList($target, false);