From 803e18e3c34ba478b41667ab46e34f3fa96c73c4 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sun, 11 Jun 2023 21:02:57 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=9D=B4=EB=AF=BC=EC=A1=B1=20=EC=9D=B4?= =?UTF-8?q?=EB=B2=A4=ED=8A=B8=20=EC=A2=85=EB=A3=8C=EC=8B=9C=20=EB=A9=94?= =?UTF-8?q?=EC=8B=9C=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/Event/Action/InvaderEnding.php | 25 +++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/hwe/sammo/Event/Action/InvaderEnding.php b/hwe/sammo/Event/Action/InvaderEnding.php index ebe66833..d4d5888a 100644 --- a/hwe/sammo/Event/Action/InvaderEnding.php +++ b/hwe/sammo/Event/Action/InvaderEnding.php @@ -31,20 +31,35 @@ class InvaderEnding extends \sammo\Event\Action{ $logger = new ActionLogger(0, 0, $env['year'], $env['month']); + $needStop = false; + $userWin = false; $cityCnt = $db->queryFirstField('SELECT count(*) FROM city WHERE nation = 0'); if($cityCnt == 0){ + $needStop = true; + $nationName = $db->queryFirstField('SELECT name FROM nation LIMIT 1'); + if(!\str_starts_with($nationName, 'ⓞ')){ + $userWin = true; + } + } + else if($cityCnt == count(CityConst::all())){ + $needStop = true; + $userWin = false; + } + + if(!$needStop){ + return [__CLASS__, "On Event"]; + } + + if($userWin){ //천통 엔딩 $logger->pushGlobalHistoryLog("【이벤트】이민족을 모두 소탕했습니다!"); $logger->pushGlobalHistoryLog("【이벤트】중원은 당분간 태평성대를 누릴 것입니다."); } - else if($cityCnt == count(CityConst::all())){ + else { //이민족 엔딩 $logger->pushGlobalHistoryLog("【이벤트】중원은 이민족에 의해 혼란에 빠졌습니다."); $logger->pushGlobalHistoryLog("【이벤트】백성은 언젠가 영웅이 나타나길 기다립니다."); } - else{ - return [__CLASS__, "On Event"]; - } $gameStor->setValue('isunited', 3); $logger->flush(); @@ -53,7 +68,7 @@ class InvaderEnding extends \sammo\Event\Action{ $eventID = Util::array_get($env['currentEventID']); $db->delete('event', 'id = %i', $eventID); - return [__CLASS__, 'Deleted']; + return [__CLASS__, 'Deleted']; } } \ No newline at end of file