From 928e8a200ba29f074d14da82f07366e339a79c6c Mon Sep 17 00:00:00 2001 From: hide_d Date: Mon, 15 Oct 2018 02:09:19 +0900 Subject: [PATCH] =?UTF-8?q?=EC=82=AC=EA=B8=B0=EC=A7=84=EC=9E=91=20?= =?UTF-8?q?=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 | 106 ++++++++++++++++++ .../Constraint/ReqGeneralAtmosMargin.php | 2 +- 2 files changed, 107 insertions(+), 1 deletion(-) 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..05af08b7 --- /dev/null +++ b/hwe/sammo/Command/General/che_사기진작.php @@ -0,0 +1,106 @@ +generalObj; + + $this->setCity(); + $this->setNation(); + + [$reqGold, $reqRice] = $this->getCost(); + + $this->runnableConstraints=[ + ['NoNeutral'], + ['NoWanderingNation'], + ['OccupiedCity'], + ['ReqGeneralCrew'], + ['ReqGeneralGold', $reqGold], + ['ReqGeneralRice', $reqRice], + ['ReqGeneralAtmosMargin'], + ]; + + } + + protected function argTest():bool{ + $this->arg = null; + return true; + } + + public function getCost():array{ + return [Util::round($this->getVar('crew')/100), 0]; + } + + public function getPreReqTurn():int{ + return 0; + } + + public function getPostReqTurn():int{ + return 0; + } + + public function run():bool{ + if(!$this->isRunnable()){ + throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도'); + } + + $db = DB::db(); + + $general = $this->generalObj; + $date = substr($general->getVar('turntime'),11,5); + + $score = Util::round($general->getLeadership() * 100 / $general->getVar('crew') * GameConst::$atmosDelta); + $scoreText = number_format($score, 0); + + $sideEffect = Util::valueFit(intval($general->getVar('train') * GameConst::$trainSideEffectByAtmosTurn), 0); + + $logger = $general->getLogger(); + + $logger->pushGeneralActionLog("사기치가 $scoreText 상승했습니다. <1>$date"); + + $exp = 100; + $ded = 70; + + $exp = $general->onPreGeneralStatUpdate($general, 'experience', $exp); + $ded = $general->onPreGeneralStatUpdate($general, 'dedication', $ded); + + $general->increaseVarWithLimit('atmos', $score, 0, GameConst::$maAtmosByCommand); + $general->setVar('train', $sideEffect); + + $general->addDex($general->getVar('crew')/100, $score, false); + + $general->increaseVar('experience', $exp); + $general->increaseVar('dedication', $ded); + $general->increaseVar('leader2', 1); + $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); + $general->applyDB($db); + + $this->checkStatChange(); + uniqueItemEx($general->getVar('no'), $logger); + } + + +} \ No newline at end of file diff --git a/hwe/sammo/Constraint/ReqGeneralAtmosMargin.php b/hwe/sammo/Constraint/ReqGeneralAtmosMargin.php index e0bec533..23dee07f 100644 --- a/hwe/sammo/Constraint/ReqGeneralAtmosMargin.php +++ b/hwe/sammo/Constraint/ReqGeneralAtmosMargin.php @@ -27,7 +27,7 @@ class ReqGeneralAtmosMargin extends Constraint{ return true; } - $this->reason = "병사들은 이미 정예병사들입니다."; + $this->reason = "이미 사기는 하늘을 찌를듯 합니다."; return false; } } \ No newline at end of file