징병 입력 버그 수정
This commit is contained in:
@@ -34,6 +34,7 @@ class che_징병 extends Command\GeneralCommand{
|
|||||||
static protected $defaultTrain;
|
static protected $defaultTrain;
|
||||||
static protected $defaultAtmos;
|
static protected $defaultAtmos;
|
||||||
|
|
||||||
|
protected $maxCrew = 0;
|
||||||
protected $reqCrew = 0;
|
protected $reqCrew = 0;
|
||||||
/** @var \sammo\GameUnitDetail */
|
/** @var \sammo\GameUnitDetail */
|
||||||
protected $reqCrewType;
|
protected $reqCrewType;
|
||||||
@@ -82,13 +83,12 @@ class che_징병 extends Command\GeneralCommand{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function init(){
|
protected function init(){
|
||||||
|
|
||||||
$general = $this->generalObj;
|
$general = $this->generalObj;
|
||||||
|
|
||||||
$this->setCity();
|
$this->setCity();
|
||||||
$this->setNation(['tech']);
|
$this->setNation(['tech']);
|
||||||
|
|
||||||
$leadership = $general->getLeadership();
|
$leadership = $general->getLeadership(false);
|
||||||
$currCrewType = $general->getCrewTypeObj();
|
$currCrewType = $general->getCrewTypeObj();
|
||||||
$maxCrew = $leadership * 100;
|
$maxCrew = $leadership * 100;
|
||||||
|
|
||||||
@@ -96,7 +96,8 @@ class che_징병 extends Command\GeneralCommand{
|
|||||||
if($reqCrewType->id == $currCrewType->id){
|
if($reqCrewType->id == $currCrewType->id){
|
||||||
$maxCrew -= $general->getVar('crew');
|
$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->reqCrew = $reqCrew;
|
||||||
$this->reqCrewType = $reqCrewType;
|
$this->reqCrewType = $reqCrewType;
|
||||||
$this->currCrewType = $currCrewType;
|
$this->currCrewType = $currCrewType;
|
||||||
@@ -131,10 +132,10 @@ class che_징병 extends Command\GeneralCommand{
|
|||||||
if(!$this->isArgValid){
|
if(!$this->isArgValid){
|
||||||
return [0, 0];
|
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 = $this->generalObj->onCalcDomestic('징병', 'cost', $reqGold, ['armType'=>$this->reqCrewType->armType]);
|
||||||
$reqGold *= static::$costOffset;
|
$reqGold *= static::$costOffset;
|
||||||
$reqRice = $this->reqCrew / 100;
|
$reqRice = $this->maxCrew / 100;
|
||||||
|
|
||||||
$reqGold = Util::round($reqGold);
|
$reqGold = Util::round($reqGold);
|
||||||
$reqRice = Util::round($reqRice);
|
$reqRice = Util::round($reqRice);
|
||||||
|
|||||||
Reference in New Issue
Block a user