From 5d15141ae9f9e98cf80e9437fd23bebf3db4e9b7 Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 30 Apr 2020 19:56:38 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A7=95=EB=B3=91=20=EC=9E=85=EB=A0=A5=20?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/Command/General/che_징병.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hwe/sammo/Command/General/che_징병.php b/hwe/sammo/Command/General/che_징병.php index 3df7b067..560964a6 100644 --- a/hwe/sammo/Command/General/che_징병.php +++ b/hwe/sammo/Command/General/che_징병.php @@ -34,6 +34,7 @@ class che_징병 extends Command\GeneralCommand{ static protected $defaultTrain; static protected $defaultAtmos; + protected $maxCrew = 0; protected $reqCrew = 0; /** @var \sammo\GameUnitDetail */ protected $reqCrewType; @@ -82,13 +83,12 @@ class che_징병 extends Command\GeneralCommand{ } protected function init(){ - $general = $this->generalObj; $this->setCity(); $this->setNation(['tech']); - $leadership = $general->getLeadership(); + $leadership = $general->getLeadership(false); $currCrewType = $general->getCrewTypeObj(); $maxCrew = $leadership * 100; @@ -96,7 +96,8 @@ class che_징병 extends Command\GeneralCommand{ if($reqCrewType->id == $currCrewType->id){ $maxCrew -= $general->getVar('crew'); } - $reqCrew = Util::valueFit($this->arg['amount'], 100, $maxCrew); + $this->maxCrew = Util::valueFit($this->arg['amount'], 100, $maxCrew); + $reqCrew = Util::valueFit($this->arg['amount'], 100); $this->reqCrew = $reqCrew; $this->reqCrewType = $reqCrewType; $this->currCrewType = $currCrewType; @@ -131,10 +132,10 @@ class che_징병 extends Command\GeneralCommand{ if(!$this->isArgValid){ return [0, 0]; } - $reqGold = $this->reqCrewType->costWithTech($this->nation['tech'], $this->reqCrew); + $reqGold = $this->reqCrewType->costWithTech($this->nation['tech'], $this->maxCrew); $reqGold = $this->generalObj->onCalcDomestic('징병', 'cost', $reqGold, ['armType'=>$this->reqCrewType->armType]); $reqGold *= static::$costOffset; - $reqRice = $this->reqCrew / 100; + $reqRice = $this->maxCrew / 100; $reqGold = Util::round($reqGold); $reqRice = Util::round($reqRice);