diff --git a/hwe/sammo/Command/Nation/che_급습.php b/hwe/sammo/Command/Nation/che_급습.php index 92534432..f7daf847 100644 --- a/hwe/sammo/Command/Nation/che_급습.php +++ b/hwe/sammo/Command/Nation/che_급습.php @@ -228,7 +228,8 @@ class che_급습 extends Command\NationCommand return [ 'mapTheme' => \sammo\getMapTheme(), 'procRes' => [ - 'nations' => $nationList + 'nations' => $nationList, + 'startYear' => $this->env['startyear'], ], ]; } diff --git a/hwe/sammo/Command/Nation/che_선전포고.php b/hwe/sammo/Command/Nation/che_선전포고.php index 38a55d1f..2c127767 100644 --- a/hwe/sammo/Command/Nation/che_선전포고.php +++ b/hwe/sammo/Command/Nation/che_선전포고.php @@ -192,6 +192,45 @@ class che_선전포고 extends Command\NationCommand return true; } + + public function exportJSVars(): array + { + $generalObj = $this->generalObj; + $nationID = $generalObj->getNationID(); + $nationList = []; + $testTurn = new LastTurn($this->getName(), null, $this->getPreReqTurn()); + foreach (getAllNationStaticInfo() as $destNation) { + /*if ($destNation['nation'] == $nationID) { + continue; + }*/ + + $testTurn->setArg(['destNationID' => $destNation['nation']]); + $testCommand = new static($generalObj, $this->env, $testTurn, ['destNationID' => $destNation['nation']]); + + $nationTarget = [ + 'id' => $destNation['nation'], + 'name' => $destNation['name'], + 'color' => $destNation['color'], + 'power' => $destNation['power'], + ]; + if (!$testCommand->hasFullConditionMet()) { + $nationTarget['notAvailable'] = true; + } + if ($destNation['nation'] == $nationID) { + $nationTarget['notAvailable'] = true; + } + + $nationList[] = $nationTarget; + } + return [ + 'mapTheme' => \sammo\getMapTheme(), + 'procRes' => [ + 'nations' => $nationList, + 'startYear' => $this->env['startyear'], + ], + ]; + } + public function getJSPlugins(): array { return [ diff --git a/hwe/ts/processing/Nation/che_급습.vue b/hwe/ts/processing/Nation/che_선전포고.vue similarity index 72% rename from hwe/ts/processing/Nation/che_급습.vue rename to hwe/ts/processing/Nation/che_선전포고.vue index dea8f58c..794075e4 100644 --- a/hwe/ts/processing/Nation/che_급습.vue +++ b/hwe/ts/processing/Nation/che_선전포고.vue @@ -10,12 +10,21 @@ v-model="selectedCityObj" /> -