diff --git a/hwe/b_myPage.php b/hwe/b_myPage.php
index d2cbf0b4..0372f5d9 100644
--- a/hwe/b_myPage.php
+++ b/hwe/b_myPage.php
@@ -93,11 +93,10 @@ var availableDieImmediately = =$availableDieImmediately?'true':'false'?>;
∞수뇌가 되었을 때 휴식 턴이어도 적당한 턴을 알아서 넣는 것을 허용합니다.
수비 【
- getVar('defence_train')==90?"selected":""; ?>>☆(훈사90)
- getVar('defence_train')==80?"selected":""; ?>>◎(훈사80)
- getVar('defence_train')==60?"selected":""; ?>>○(훈사60)
- getVar('defence_train')==40?"selected":""; ?>>△(훈사40)
- getVar('defence_train')==999?"selected":""; ?>>×[훈련, 사기 -3]
+
+ getVar('defence_train')==$targetDefenceTrain?"selected":""; ?>>=formatDefenceTrain($targetDefenceTrain)?>(훈사=$targetDefenceTrain?>)
+
+ getVar('defence_train')==999?"selected":""; ?>>=formatDefenceTrain(999)?>[훈련, 사기 -3]
】
id='set_my_setting' name=btn style=background-color:=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=설정저장>
diff --git a/hwe/func_template.php b/hwe/func_template.php
index f6bab7d9..61fe96d2 100644
--- a/hwe/func_template.php
+++ b/hwe/func_template.php
@@ -1,270 +1,274 @@
-
-
-
-
-
- 관리메뉴
-
-
-
- = WebUtil::printCSS('../d_shared/common.css') ?>
- = WebUtil::printCSS('css/common.css') ?>
-
-
-
- 관리자가 아닙니다.
- = banner() ?>
-
-
-
-1턴";
- foreach (Util::range(1, GameConst::$maxTurn) as $turnIdx) {
- $turnText = $turnIdx + 1;
- $turnList[] = "{$turnText}턴 ";
- }
-
- $turnText = join("\n", $turnList);
-
- return "
-
- 전체
- 홀턴
- 짝턴
- {$turnText}
-
-";
-}
-
-function chiefTurnTable()
-{
- $turnList = [];
- $turnList[] = "1턴 ";
- foreach (Util::range(1, GameConst::$maxChiefTurn) as $turnIdx) {
- $turnText = $turnIdx + 1;
- $turnList[] = "{$turnText}턴 ";
- }
-
- $turnText = join("\n", $turnList);
-
- return "
-
-{$turnText}
-
-";
-}
-
-function displayiActionObjInfo(?iAction $action)
-{
- if ($action === null) {
- $info = '';
- $text = '-';
- } else {
- $info = $action->getInfo();
- $text = $action->getName();
- }
-
- $templates = new \League\Plates\Engine(__DIR__ . '/templates');
-
- return $templates->render('tooltip', [
- 'text' => $text,
- 'info' => $info,
- ]);
-}
-function displayCharInfo(string $type): string
-{
- $class = buildPersonalityClass($type);
- $info = $class->getInfo();
- $text = $class->getName();
-
- $templates = new \League\Plates\Engine(__DIR__ . '/templates');
-
- return $templates->render('tooltip', [
- 'text' => $text,
- 'info' => $info,
- ]);
-}
-
-function displaySpecialWarInfo(?string $type): string
-{
- $class = buildGeneralSpecialWarClass($type);
- $info = $class->getInfo();
- $name = $class->getName();
-
- $templates = new \League\Plates\Engine(__DIR__ . '/templates');
-
- return $templates->render('tooltip', [
- 'text' => $name,
- 'info' => $info,
- ]);
-}
-
-function displaySpecialDomesticInfo(?string $type): string
-{
- $class = buildGeneralSpecialDomesticClass($type);
- $info = $class->getInfo();
- $name = $class->getName();
-
- $templates = new \League\Plates\Engine(__DIR__ . '/templates');
-
- return $templates->render('tooltip', [
- 'text' => $name,
- 'info' => $info,
- ]);
-}
-
-function allButton(bool $seizeNPCMode)
-{
- if ($seizeNPCMode) {
- $site = "a_npcList.php";
- $call = "빙의일람";
- } else {
- $site = "a_vote.php";
- $call = "설문조사";
- }
-
- if (\file_exists(__DIR__ . "/d_setting/templates/allButton.php")) {
- $templates = new \League\Plates\Engine(__DIR__ . '/d_setting/templates');
- } else {
- $templates = new \League\Plates\Engine(__DIR__ . '/templates');
- }
-
-
- return $templates->render('allButton', [
- 'call' => $call,
- 'site' => $site
- ]);
-}
-
-
-function commandButton()
-{
- $session = Session::getInstance();
- $userID = Session::getUserID();
- if (!$session->isGameLoggedIn()) {
- return '';
- }
-
- $db = DB::db();
- $me = $db->queryFirstRow("select no,nation,officer_level,belong,permission,penalty from general where owner=%i", $userID);
-
- $nation = $db->queryFirstRow("select nation,level,color,secretlimit from nation where nation=%i", $me['nation']) ?? [
- 'nation' => 0,
- 'level' => 0,
- 'secretlimit' => 99,
- 'color' => '#000000'
- ];
-
- $bgColor = Util::array_get($nation['color']) ?: '#000000';
- $fgColor = newColor($bgColor);
-
- $templates = new \League\Plates\Engine(__DIR__ . '/templates');
- $showSecret = false;
- $permission = checkSecretPermission($me);
- if ($permission >= 1) {
- $showSecret = true;
- } else if ($me['officer_level'] == 0) {
- $showSecret = false;
- }
-
- return $templates->render('commandButton', [
- 'bgColor' => $bgColor,
- 'fgColor' => $fgColor,
- 'meLevel' => $me['officer_level'],
- 'nationLevel' => $nation['level'],
- 'showSecret' => $showSecret,
- 'permission' => $permission,
- ]);
-}
-
-function formatWounded(int $value, int $wound): string
-{
- if ($wound == 0) {
- return "$value";
- }
- $woundedValue = intdiv($value * (100 - $wound), 100);
- return "$woundedValue ";
-}
-
-function formatDefenceTrain(int $value): string
-{
- if ($value === 999) {
- return "×";
- } else if ($value >= 80) {
- return "◎";
- } else {
- return "○";
- }
-}
-
-function formatLeadershipBonus(int $value): string
-{
- if ($value == 0) {
- return '';
- }
- return "+{$value} ";
-}
-
-function formatName(string $name, int $npc): string
-{
- if ($npc == 1) {
- $name = "$name ";
- } else if ($npc > 1) {
- $name = "$name ";
- }
- return $name;
-}
-
-function getMapHtml(?string $mapTheme = null)
-{
- $templates = new \League\Plates\Engine(__DIR__ . '/templates');
-
- if ($mapTheme === null) {
- $db = DB::db();
- $gameStor = KVStorage::getStorage($db, 'game_env');
- $mapTheme = $gameStor->map_theme ?? 'che';
- }
-
- return $templates->render('map', [
- 'mapTheme' => $mapTheme
- ]);
-}
-
-function getInvitationList(array $nationList)
-{
- $templates = new \League\Plates\Engine(__DIR__ . '/templates');
-
- foreach ($nationList as &$nation) {
- $nation['textColor'] = newColor($nation['color']);
- }
- return $templates->render('invitationList', [
- 'nationList' => $nationList
- ]);
-}
+
+
+
+
+
+ 관리메뉴
+
+
+
+ = WebUtil::printCSS('../d_shared/common.css') ?>
+ = WebUtil::printCSS('css/common.css') ?>
+
+
+
+ 관리자가 아닙니다.
+ = banner() ?>
+
+
+
+1턴";
+ foreach (Util::range(1, GameConst::$maxTurn) as $turnIdx) {
+ $turnText = $turnIdx + 1;
+ $turnList[] = "{$turnText}턴 ";
+ }
+
+ $turnText = join("\n", $turnList);
+
+ return "
+
+ 전체
+ 홀턴
+ 짝턴
+ {$turnText}
+
+";
+}
+
+function chiefTurnTable()
+{
+ $turnList = [];
+ $turnList[] = "1턴 ";
+ foreach (Util::range(1, GameConst::$maxChiefTurn) as $turnIdx) {
+ $turnText = $turnIdx + 1;
+ $turnList[] = "{$turnText}턴 ";
+ }
+
+ $turnText = join("\n", $turnList);
+
+ return "
+
+{$turnText}
+
+";
+}
+
+function displayiActionObjInfo(?iAction $action)
+{
+ if ($action === null) {
+ $info = '';
+ $text = '-';
+ } else {
+ $info = $action->getInfo();
+ $text = $action->getName();
+ }
+
+ $templates = new \League\Plates\Engine(__DIR__ . '/templates');
+
+ return $templates->render('tooltip', [
+ 'text' => $text,
+ 'info' => $info,
+ ]);
+}
+function displayCharInfo(string $type): string
+{
+ $class = buildPersonalityClass($type);
+ $info = $class->getInfo();
+ $text = $class->getName();
+
+ $templates = new \League\Plates\Engine(__DIR__ . '/templates');
+
+ return $templates->render('tooltip', [
+ 'text' => $text,
+ 'info' => $info,
+ ]);
+}
+
+function displaySpecialWarInfo(?string $type): string
+{
+ $class = buildGeneralSpecialWarClass($type);
+ $info = $class->getInfo();
+ $name = $class->getName();
+
+ $templates = new \League\Plates\Engine(__DIR__ . '/templates');
+
+ return $templates->render('tooltip', [
+ 'text' => $name,
+ 'info' => $info,
+ ]);
+}
+
+function displaySpecialDomesticInfo(?string $type): string
+{
+ $class = buildGeneralSpecialDomesticClass($type);
+ $info = $class->getInfo();
+ $name = $class->getName();
+
+ $templates = new \League\Plates\Engine(__DIR__ . '/templates');
+
+ return $templates->render('tooltip', [
+ 'text' => $name,
+ 'info' => $info,
+ ]);
+}
+
+function allButton(bool $seizeNPCMode)
+{
+ if ($seizeNPCMode) {
+ $site = "a_npcList.php";
+ $call = "빙의일람";
+ } else {
+ $site = "a_vote.php";
+ $call = "설문조사";
+ }
+
+ if (\file_exists(__DIR__ . "/d_setting/templates/allButton.php")) {
+ $templates = new \League\Plates\Engine(__DIR__ . '/d_setting/templates');
+ } else {
+ $templates = new \League\Plates\Engine(__DIR__ . '/templates');
+ }
+
+
+ return $templates->render('allButton', [
+ 'call' => $call,
+ 'site' => $site
+ ]);
+}
+
+
+function commandButton()
+{
+ $session = Session::getInstance();
+ $userID = Session::getUserID();
+ if (!$session->isGameLoggedIn()) {
+ return '';
+ }
+
+ $db = DB::db();
+ $me = $db->queryFirstRow("select no,nation,officer_level,belong,permission,penalty from general where owner=%i", $userID);
+
+ $nation = $db->queryFirstRow("select nation,level,color,secretlimit from nation where nation=%i", $me['nation']) ?? [
+ 'nation' => 0,
+ 'level' => 0,
+ 'secretlimit' => 99,
+ 'color' => '#000000'
+ ];
+
+ $bgColor = Util::array_get($nation['color']) ?: '#000000';
+ $fgColor = newColor($bgColor);
+
+ $templates = new \League\Plates\Engine(__DIR__ . '/templates');
+ $showSecret = false;
+ $permission = checkSecretPermission($me);
+ if ($permission >= 1) {
+ $showSecret = true;
+ } else if ($me['officer_level'] == 0) {
+ $showSecret = false;
+ }
+
+ return $templates->render('commandButton', [
+ 'bgColor' => $bgColor,
+ 'fgColor' => $fgColor,
+ 'meLevel' => $me['officer_level'],
+ 'nationLevel' => $nation['level'],
+ 'showSecret' => $showSecret,
+ 'permission' => $permission,
+ ]);
+}
+
+function formatWounded(int $value, int $wound): string
+{
+ if ($wound == 0) {
+ return "$value";
+ }
+ $woundedValue = intdiv($value * (100 - $wound), 100);
+ return "$woundedValue ";
+}
+
+function formatDefenceTrain(int $value): string
+{
+ if ($value === 999) {
+ return "×";
+ } else if ($value >= 90){
+ return "☆";
+ } else if ($value >= 80) {
+ return "◎";
+ } else if ($value >= 60) {
+ return "○";
+ } else{
+ return "△";
+ }
+}
+
+function formatLeadershipBonus(int $value): string
+{
+ if ($value == 0) {
+ return '';
+ }
+ return "+{$value} ";
+}
+
+function formatName(string $name, int $npc): string
+{
+ if ($npc == 1) {
+ $name = "$name ";
+ } else if ($npc > 1) {
+ $name = "$name ";
+ }
+ return $name;
+}
+
+function getMapHtml(?string $mapTheme = null)
+{
+ $templates = new \League\Plates\Engine(__DIR__ . '/templates');
+
+ if ($mapTheme === null) {
+ $db = DB::db();
+ $gameStor = KVStorage::getStorage($db, 'game_env');
+ $mapTheme = $gameStor->map_theme ?? 'che';
+ }
+
+ return $templates->render('map', [
+ 'mapTheme' => $mapTheme
+ ]);
+}
+
+function getInvitationList(array $nationList)
+{
+ $templates = new \League\Plates\Engine(__DIR__ . '/templates');
+
+ foreach ($nationList as &$nation) {
+ $nation['textColor'] = newColor($nation['color']);
+ }
+ return $templates->render('invitationList', [
+ 'nationList' => $nationList
+ ]);
+}