From 04a7a34fccc707b089526c8eceb8fbeb07400254 Mon Sep 17 00:00:00 2001 From: hided62 Date: Tue, 17 Sep 2024 00:48:54 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B6=80=EB=8C=80=20=EC=9D=B4=EB=8F=99=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=EC=B4=88=EA=B8=B0=20=EC=BD=94=EB=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../event_UnlimitedDefenceThresholdChange.php | 18 +++++ hwe/sammo/BaseStaticEvent.php | 11 +++ hwe/sammo/GameConstBase.php | 4 + .../StaticEvent/event_부대발령즉시집합.php | 77 +++++++++++++++++++ .../StaticEvent/event_부대탑승즉시이동.php | 45 +++++++++++ hwe/sammo/StaticEventHandler.php | 18 +++++ hwe/scenario/scenario_911.json | 62 +++++++++++++++ 7 files changed, 235 insertions(+) create mode 100644 hwe/sammo/ActionScenarioEffect/event_UnlimitedDefenceThresholdChange.php create mode 100644 hwe/sammo/BaseStaticEvent.php create mode 100644 hwe/sammo/StaticEvent/event_부대발령즉시집합.php create mode 100644 hwe/sammo/StaticEvent/event_부대탑승즉시이동.php create mode 100644 hwe/sammo/StaticEventHandler.php create mode 100644 hwe/scenario/scenario_911.json diff --git a/hwe/sammo/ActionScenarioEffect/event_UnlimitedDefenceThresholdChange.php b/hwe/sammo/ActionScenarioEffect/event_UnlimitedDefenceThresholdChange.php new file mode 100644 index 00000000..30f2e28e --- /dev/null +++ b/hwe/sammo/ActionScenarioEffect/event_UnlimitedDefenceThresholdChange.php @@ -0,0 +1,18 @@ +getID() !== $destGeneral->getVar('troop')){ + //부대장 발령이 아니므로 무시 + return true; + } + + if($destGeneral->getCityID() === $destCityID){ + //이미 제자리이므로 무시 + return true; + } + + if($destGeneral->getNationID() !== $general->getNationID()){ + return "destGeneral is not same nation"; + } + + $db = DB::db(); + $cityName = CityConst::byID($destCityID)->name; + $josaRo = JosaUtil::pick($cityName, '로'); + + $troopID = $destGeneral->getID(); + $troopName = $db->queryFirstField('SELECT name FROM troop WHERE troop_leader = %i', $troopID); + + + $generalList = $db->queryFirstColumn('SELECT no FROM general WHERE nation=%i AND city!=%i AND troop=%i AND no!=%i', $general->getNationID(), $destCityID, $troopID, $general->getID()); + if($generalList){ + $db->update('general', [ + 'city'=>$destCityID + ], 'no IN %li', $generalList); + } + foreach($generalList as $targetGeneralID){ + $targetLogger = new ActionLogger($targetGeneralID, $general->getNationID(), $env['year'], $env['month']); + $targetLogger->pushGeneralActionLog("{$troopName} 부대원들은 {$cityName}{$josaRo} 즉시 집합되었습니다.", ActionLogger::PLAIN); + $targetLogger->flush(); + } + + $general->setVar('city', $destGeneral->getCityID()); + $general->applyDB(DB::db()); + + return true; + } +} diff --git a/hwe/sammo/StaticEvent/event_부대탑승즉시이동.php b/hwe/sammo/StaticEvent/event_부대탑승즉시이동.php new file mode 100644 index 00000000..34472362 --- /dev/null +++ b/hwe/sammo/StaticEvent/event_부대탑승즉시이동.php @@ -0,0 +1,45 @@ +getID() !== $destGeneral->getVar('troop')){ + return "destGeneral is not troop"; + } + + if($destGeneral->getNationID() !== $general->getNationID()){ + return "destGeneral is not same nation"; + } + + if($destGeneral->getCityID() === $general->getCityID()){ + return true; + } + + $general->setVar('city', $destGeneral->getCityID()); + $general->applyDB(DB::db()); + + return true; + } +} diff --git a/hwe/sammo/StaticEventHandler.php b/hwe/sammo/StaticEventHandler.php new file mode 100644 index 00000000..d0db0970 --- /dev/null +++ b/hwe/sammo/StaticEventHandler.php @@ -0,0 +1,18 @@ +●180년 1월:【이벤트】부대를 통해 빠르게 이동할 수 있습니다." + ], + "const": { + "joinRuinedNPCProp":0, + "npcBanMessageProb":1, + "scenarioEffect": "event_UnlimitedDefenceThresholdChange", + "staticEventHandlers": { + "Command/General/che_부대탑승": [ + "event_부대탑승즉시이동" + ], + "Command/Nation/che_발령": [ + "event_부대발령즉시집합" + ] + } + }, + "events":[ + [ + "month", 1000, + ["or", ["Date", "==", null, 12], ["Date", "==", null, 6]], + ["CreateManyNPC", 10, 10], + ["DeleteEvent"] + ], + [ + "month", 1000, + ["Date", "==", 181, 1], + ["RaiseNPCNation"], + ["DeleteEvent"] + ], + [ + "month", 999, + ["Date", "==", 181, 1], + ["OpenNationBetting", 4, 5000], + ["OpenNationBetting", 1, 2000], + ["DeleteEvent"] + ], + [ + "month", 999, + ["and", + ["Date", ">=", 183, 1], + ["RemainNation", "<=", 8] + ], + ["OpenNationBetting", 1, 1000], + ["DeleteEvent"] + ], + [ + "destroy_nation", 1000, + ["and", + ["Date", ">=", 183, 1], + ["RemainNation", "==", 1] + ], + ["BlockScoutAction"], + ["DeleteEvent"] + ] + ] +} \ No newline at end of file