diff --git a/hwe/a_kingdomList.php b/hwe/a_kingdomList.php
index 3c3f2e43..0f2c6a25 100644
--- a/hwe/a_kingdomList.php
+++ b/hwe/a_kingdomList.php
@@ -111,7 +111,7 @@ if ($con >= 2) {
}
$chief = $chiefs[$chiefLevel] ?? ['name' => '-', 'npc' => 0];
$officerLevelText = getOfficerLevelText($chiefLevel, $nation['level']);
- $chiefText = getColoredName($chief['name'], $chief['npc']);
+ $chiefText = formatName($chief['name'], $chief['npc']);
echo "
{$officerLevelText} |
{$chiefText} | ";
}
@@ -178,7 +178,7 @@ if ($con >= 2) {
| 장수 일람 : ";
foreach ($nations[0]['generals'] as $general) {
- $generalText = getColoredName($general['name'], $general['npc']);
+ $generalText = formatName($general['name'], $general['npc']);
echo "{$generalText}, ";
}
echo "
diff --git a/hwe/a_npcList.php b/hwe/a_npcList.php
index 533e46f8..e226c29c 100644
--- a/hwe/a_npcList.php
+++ b/hwe/a_npcList.php
@@ -111,7 +111,7 @@ $sel[$type] = "selected";
|
- | = getColoredName($general['name'], $general['npc']) ?> |
+ = formatName($general['name'], $general['npc']) ?> |
= $general['owner_name'] ?> |
Lv = $general['explevel'] ?> |
= $nationName[$general['nation']] ?> |
diff --git a/hwe/b_currentCity.php b/hwe/b_currentCity.php
index 38d63e50..49458ef1 100644
--- a/hwe/b_currentCity.php
+++ b/hwe/b_currentCity.php
@@ -364,7 +364,7 @@ $templates = new \League\Plates\Engine('templates');
}
$generalsName = array_map(function ($gen) {
- return getColoredName($gen['name'], $gen['npc']);
+ return formatName($gen['name'], $gen['npc']);
}, $generals);
$enemyCrew = 0;
diff --git a/hwe/b_genList.php b/hwe/b_genList.php
index 5d8dd06f..1a591fa9 100644
--- a/hwe/b_genList.php
+++ b/hwe/b_genList.php
@@ -172,7 +172,7 @@ $templates = new \League\Plates\Engine('templates');
$general['expLevelText'] = getExpLevel($general['experience']);
- $general['nameText'] = getColoredName($general['name'], $general['npc']);
+ $general['nameText'] = formatName($general['name'], $general['npc']);
$general['modeText'] = formatDefenceTrain($general['defence_train']);
$general['crewtypeText'] = GameUnitConst::byId($general['crewtype'])->name ?? '-';
diff --git a/hwe/b_myCityInfo.php b/hwe/b_myCityInfo.php
index 864c3173..9022b364 100644
--- a/hwe/b_myCityInfo.php
+++ b/hwe/b_myCityInfo.php
@@ -71,7 +71,8 @@ $sel = [$type => "selected"];
queryFirstRow('SELECT nation, name, color, type, level, capital, gennum, `power`, `rate` from nation WHERE nation = %i', $nationID); //국가정보
+ $nationTypeObj = buildNationTypeClass($nation['type']);
$officerList = [];
foreach ($db->query('SELECT no,name,npc,city,officer_level,officer_city,belong FROM general WHERE nation = %i AND 2 <= officer_level AND officer_level <= 4', $nationID) as $officer) {
@@ -82,6 +83,17 @@ $sel = [$type => "selected"];
$officerList[$officerCityID][$officer['officer_level']] = $officer;
}
+ $generalList = $db->query('SELECT npc, name, city FROM general WHERE nation = %i', $me['nation']);
+ $cityGeneralList = [];
+ foreach ($generalList as $general) {
+ $cityID = $general['city'];
+ if (!key_exists($cityID, $cityGeneralList)) {
+ $cityGeneralList[$cityID] = [];
+ }
+
+ $cityGeneralList[$cityID][] = formatName($general['name'], $general['npc']);
+ }
+
$cityList = $db->query('SELECT *,pop/pop_max as poprate from city where nation=%i', $nationID);
@@ -171,8 +183,12 @@ $sel = [$type => "selected"];
];
$cityOfficerList = $officerList[$cityID] ?? [];
+ $effectiveOfficerCnt = 0;
foreach ($cityOfficerList as $cityOfficer) {
- $officerName[$cityOfficer['officer_level']] = getColoredName($cityOfficer['name'], $cityOfficer['npc']);
+ if ($cityOfficer['city'] == $cityID) {
+ $effectiveOfficerCnt += 1;
+ }
+ $officerName[$cityOfficer['officer_level']] = formatName($cityOfficer['name'], $cityOfficer['npc']);
}
if ($type == 10 && $city['region'] != $region) {
@@ -187,62 +203,60 @@ $sel = [$type => "selected"];
$city['trade'] = "- ";
}
- echo "
-
-
- | 【 " . CityConst::$regionMap[$city['region']] . " | " . CityConst::$levelMap[$city['level']] . " 】 {$city['name']} |
-
-
- | 주민 |
- {$city['pop']}/{$city['pop_max']} |
- 농업 |
- {$city['agri']}/{$city['agri_max']} |
- 상업 |
- {$city['comm']}/{$city['comm_max']} |
- 치안 |
- {$city['secu']}/{$city['secu_max']} |
- 수비 |
- {$city['def']}/{$city['def_max']} |
- 성벽 |
- {$city['wall']}/{$city['wall_max']} |
-
-
- | 민심 |
- " . round($city['trust'], 1) . " |
- 시세 |
- {$city['trade']}% |
- 인구 |
- " . round($city['pop'] / $city['pop_max'] * 100, 2) . " % |
- 태수 |
- ";
- echo $officerName[4];
- echo " |
- 군사 |
- ";
- echo $officerName[3];
- echo " |
- 종사 |
- ";
- echo $officerName[2];
- echo " |
-
-
- | 장수 |
- ";
- $generalList = $db->query('SELECT npc, name FROM general WHERE city = %i AND nation = %i', $city['city'], $me['nation']);
- if (!$generalList) {
- echo "-";
- }
- foreach ($generalList as $general) {
- echo getColoredName($general['name'], $general['npc']) . ', ';
- }
- echo "
- |
-
-
-";
- }
+
+ $cityGoldIncome = $nation['rate'] / 20 * calcCityGoldIncome($city, $effectiveOfficerCnt, $nation['capital'] == $cityID, $nation['level'], $nationTypeObj);
+ $cityRiceIncome = $nation['rate'] / 20 * calcCityRiceIncome($city, $effectiveOfficerCnt, $nation['capital'] == $cityID, $nation['level'], $nationTypeObj);
+ $cityWallIncome = $nation['rate'] / 20 * calcCityWallRiceIncome($city, $effectiveOfficerCnt, $nation['capital'] == $cityID, $nation['level'], $nationTypeObj);
+
?>
+
+
+ |
+ 【 = CityConst::$regionMap[$city['region']] ?> | = CityConst::$levelMap[$city['level']] ?> 】 = $city['name'] ?>
+ |
+
+
+ | 주민 |
+ = $city['pop'] ?>/= $city['pop_max'] ?> |
+ 인구율 |
+ = round($city['pop'] / $city['pop_max'] * 100, 2) ?>% |
+ 자금 수입 |
+ = number_format($cityGoldIncome) ?> |
+ 군량 수입 |
+ = number_format($cityRiceIncome) ?> |
+ 둔전 수입 |
+ = number_format($cityWallIncome) ?> |
+
+
+ | 농업 |
+ = $city['agri'] ?>/= $city['agri_max'] ?> |
+ 상업 |
+ = $city['comm'] ?>/= $city['comm_max'] ?> |
+ 치안 |
+ = $city['secu'] ?>/= $city['secu_max'] ?> |
+ 수비 |
+ = $city['def'] ?>/= $city['def_max'] ?> |
+ 성벽 |
+ = $city['wall'] ?>/= $city['wall_max'] ?> |
+
+
+ | 민심 |
+ = round($city['trust'], 1) ?> |
+ 시세 |
+ = $city['trade'] ?>% |
+ 태수 |
+ = $officerName[4] ?> |
+ 군사 |
+ = $officerName[3] ?> |
+ 종사 |
+ = $officerName[2] ?> |
+
+
+ | 장수 |
+ = key_exists($cityID, $cityGeneralList) ? join(', ', $cityGeneralList[$cityID]) : '-' ?> |
+
+
+
@@ -252,7 +266,7 @@ $sel = [$type => "selected"];
| = banner() ?> |
+