From c4aa6b4ffce0541afc543dd4bc46a416fa92d43a Mon Sep 17 00:00:00 2001 From: Hide_D Date: Wed, 16 Mar 2022 01:30:47 +0900 Subject: [PATCH] =?UTF-8?q?game:=20=EC=A1=B0=EA=B8=B0=20=EC=9D=80=ED=87=B4?= =?UTF-8?q?=20=EC=BB=A4=EB=A7=A8=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/Command/General/che_은퇴.php | 84 ++++++++++++++++++++++++++ hwe/sammo/GameConstBase.php | 1 + 2 files changed, 85 insertions(+) create mode 100644 hwe/sammo/Command/General/che_은퇴.php diff --git a/hwe/sammo/Command/General/che_은퇴.php b/hwe/sammo/Command/General/che_은퇴.php new file mode 100644 index 00000000..47e815a6 --- /dev/null +++ b/hwe/sammo/Command/General/che_은퇴.php @@ -0,0 +1,84 @@ +arg = null; + return true; + } + + protected function init(){ + + $general = $this->generalObj; + + $this->setNation(); + $reqAge = static::$reqAge; + + $this->fullConditionConstraints=[ + ConstraintHelper::ReqGeneralValue('age', '나이', '>=', $reqAge, "나이가 {$reqAge}세 이상이어야 합니다.") + ]; + + } + + public function getCommandDetailTitle(): string + { + $name = $this->getName(); + $reqAge = static::$reqAge; + return "{$name}({$reqAge}세 이상, 2턴)"; + } + + public function getCost():array{ + return [0, 0]; + } + + public function getPreReqTurn():int{ + return 1; + } + + public function getPostReqTurn():int{ + return 0; + } + + public function run():bool{ + if(!$this->hasFullConditionMet()){ + throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도'); + } + + $db = DB::db(); + + $general = $this->generalObj; + $date = $general->getTurnTime($general::TURNTIME_HM); + + $logger = $general->getLogger(); + + $general->rebirth(); + $logger->pushGeneralActionLog("은퇴하였습니다. <1>$date"); + + $this->setResultTurn(new LastTurn(static::getName(), $this->arg)); + tryUniqueItemLottery($general); + $general->applyDB($db); + + return true; + } + + +} \ No newline at end of file diff --git a/hwe/sammo/GameConstBase.php b/hwe/sammo/GameConstBase.php index d9daf957..7d825c32 100644 --- a/hwe/sammo/GameConstBase.php +++ b/hwe/sammo/GameConstBase.php @@ -327,6 +327,7 @@ class GameConstBase 'che_증여', 'che_헌납', 'che_하야', + 'che_은퇴', 'che_거병', 'che_건국', 'che_선양',