diff --git a/hwe/sammo/API/General/GetUserActionCommandTable.php b/hwe/sammo/API/General/GetUserActionCommandTable.php index fbf46f8a..53b18542 100644 --- a/hwe/sammo/API/General/GetUserActionCommandTable.php +++ b/hwe/sammo/API/General/GetUserActionCommandTable.php @@ -27,13 +27,15 @@ class GetUserActionCommandTable extends \sammo\BaseAPI public function launch(Session $session, ?\DateTimeInterface $modifiedSince, ?string $reqEtag): null | string | array | APIRecoveryType { $generalID = $session->generalID; - $general = General::createObjFromDB($generalID); $db = DB::db(); $gameStor = KVStorage::getStorage($db, 'game_env'); $gameStor->turnOnCache(); $env = $gameStor->getAll(); + + $general = General::createObjFromDB($generalID); + $commandTable = []; foreach (GameConst::$availableUserActionCommand as $commandCategory => $commandList) { $subList = []; diff --git a/hwe/sammo/ActionBuff/g65_계략성공.php b/hwe/sammo/ActionBuff/g65_계략성공.php new file mode 100644 index 00000000..2218cc12 --- /dev/null +++ b/hwe/sammo/ActionBuff/g65_계략성공.php @@ -0,0 +1,19 @@ +getPostReqTurn(); + return "금/쌀 동등화(재사용 대기 {$postReqTurn})"; + } + + protected function init(){ + //아무것도 하지 않음 + $this->fullConditionConstraints=[]; + + } + + public function getPreReqTurn():int{ + return 0; + } + + public function getPostReqTurn():int{ + return 60; + } + + public function getCost():array{ + return [0, 0]; + } + + public function run(\Sammo\RandUtil $rng):bool{ + $general = $this->generalObj; + + $date = $general->getTurnTime($general::TURNTIME_HM); + + $gold = $general->getVar('gold'); + $rice = $general->getVar('rice'); + + $avg = Util::toInt(($gold + $rice + 1) / 2); + $general->setVar('gold', $avg); + $general->setVar('rice', $avg); + + $logger = $this->generalObj->getLogger(); + $logger->pushGeneralActionLog("지나가는 상인과 금과 쌀을 거래합니다. <1>$date"); + $general->applyDB(DB::db()); + return true; + } +} \ No newline at end of file diff --git a/hwe/sammo/Command/UserAction/g65_병장기지원.php b/hwe/sammo/Command/UserAction/g65_병장기지원.php index ad2c9562..88ead17b 100644 --- a/hwe/sammo/Command/UserAction/g65_병장기지원.php +++ b/hwe/sammo/Command/UserAction/g65_병장기지원.php @@ -24,6 +24,9 @@ class g65_병장기지원 extends Command\UserActionCommand{ } protected function init(){ + $this->setCity(); + $this->setNation(); + $this->fullConditionConstraints = [ ConstraintHelper::NotBeNeutral(), ConstraintHelper::OccupiedCity() diff --git a/hwe/sammo/Command/UserAction/g65_요술.php b/hwe/sammo/Command/UserAction/g65_요술.php new file mode 100644 index 00000000..7ba6bdb1 --- /dev/null +++ b/hwe/sammo/Command/UserAction/g65_요술.php @@ -0,0 +1,62 @@ +getPostReqTurn(); + return "이번 턴의 계략 항상 성공(재사용 대기 {$postReqTurn})"; + } + + protected function init(){ + $this->setCity(); + $this->setNation(); + + $this->fullConditionConstraints = [ + ConstraintHelper::NotBeNeutral(), + ConstraintHelper::OccupiedCity() + ]; + } + + public function getPreReqTurn():int{ + return 0; + } + + public function getPostReqTurn():int{ + return 60; + } + + public function getCost():array{ + return [0, 0]; + } + + public function run(\Sammo\RandUtil $rng):bool{ + if (!$this->hasFullConditionMet()) { + throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도'); + } + + $general = $this->generalObj; + $general->addInstantBuff(new g65_내정성공(), 2); + + $date = $general->getTurnTime($general::TURNTIME_HM); + + $logger = $general->getLogger(); + $logger->pushGeneralActionLog("이번 턴의 계략을 집중합니다. <1>$date"); + return true; + } +} \ No newline at end of file diff --git a/hwe/sammo/Command/UserAction/g65_입대독려.php b/hwe/sammo/Command/UserAction/g65_입대독려.php index 5895c8c0..eb8181e4 100644 --- a/hwe/sammo/Command/UserAction/g65_입대독려.php +++ b/hwe/sammo/Command/UserAction/g65_입대독려.php @@ -24,6 +24,9 @@ class g65_입대독려 extends Command\UserActionCommand{ } protected function init(){ + $this->setCity(); + $this->setNation(); + $this->fullConditionConstraints = [ ConstraintHelper::NotBeNeutral(), ConstraintHelper::OccupiedCity() diff --git a/hwe/sammo/Command/UserAction/g65_접경귀환.php b/hwe/sammo/Command/UserAction/g65_접경귀환.php index 290a06be..91f23edf 100644 --- a/hwe/sammo/Command/UserAction/g65_접경귀환.php +++ b/hwe/sammo/Command/UserAction/g65_접경귀환.php @@ -32,6 +32,9 @@ class g65_접경귀환 extends Command\UserActionCommand protected function init() { + $this->setCity(); + $this->setNation(); + $this->fullConditionConstraints = [ ConstraintHelper::NotBeNeutral(), ConstraintHelper::NotWanderingNation(), @@ -94,8 +97,10 @@ class g65_접경귀환 extends Command\UserActionCommand $destCityID = $rng->choice($nearestCityList); $destCityName = CityConst::byID($destCityID)->name; + $date = $general->getTurnTime($general::TURNTIME_HM); + $josaRo = JosaUtil::pick($destCityName, '로'); - $logger->pushGeneralActionLog("{$destCityName}{$josaRo} 접경귀환했습니다."); + $logger->pushGeneralActionLog("{$destCityName}{$josaRo} 접경귀환했습니다. <1>$date"); $general->setVar('city', $destCityID); $general->applyDB($db); diff --git a/hwe/sammo/Command/UserAction/g65_철야내정.php b/hwe/sammo/Command/UserAction/g65_철야내정.php index 734e3adc..c6fb2cb8 100644 --- a/hwe/sammo/Command/UserAction/g65_철야내정.php +++ b/hwe/sammo/Command/UserAction/g65_철야내정.php @@ -24,6 +24,9 @@ class g65_철야내정 extends Command\UserActionCommand{ } protected function init(){ + $this->setCity(); + $this->setNation(); + $this->fullConditionConstraints = [ ConstraintHelper::NotBeNeutral(), ConstraintHelper::OccupiedCity() @@ -50,8 +53,10 @@ class g65_철야내정 extends Command\UserActionCommand{ $general = $this->generalObj; $general->addInstantBuff(new g65_내정성공(), 2); + $date = $general->getTurnTime($general::TURNTIME_HM); + $logger = $general->getLogger(); - $logger->pushGeneralActionLog("2턴 간 내정을 철저히 지휘합니다."); + $logger->pushGeneralActionLog("2턴 간 내정을 철저히 지휘합니다. <1>$date"); return true; } } \ No newline at end of file diff --git a/hwe/sammo/GameConstBase.php b/hwe/sammo/GameConstBase.php index d498c474..b23cb9b4 100644 --- a/hwe/sammo/GameConstBase.php +++ b/hwe/sammo/GameConstBase.php @@ -402,6 +402,7 @@ class GameConstBase '휴식', 'g65_의원소환', 'g65_철야내정', + 'g65_군량급매', 'g65_접경귀환', 'g65_병장기지원', 'g65_입대독려',