From 85cb91071e9d578a7774dffd8033783670c1167c Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 15 Aug 2020 03:46:43 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B8=B0=EB=B3=B8=20=EB=8F=84=EC=8B=9C=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EB=8C=80?= =?UTF-8?q?=ED=8F=AD=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/b_currentCity.php | 75 ++++++++++++++++++++---- hwe/js/map.js | 4 +- hwe/templates/cityGeneral.php | 104 +++++++++++++++++----------------- 3 files changed, 118 insertions(+), 65 deletions(-) diff --git a/hwe/b_currentCity.php b/hwe/b_currentCity.php index 770aad53..46228962 100644 --- a/hwe/b_currentCity.php +++ b/hwe/b_currentCity.php @@ -148,8 +148,30 @@ echo " unset($city); // 첩보된 도시까지만 허용 -if($valid == 0 && $userGrade < 5) { + +$showDetailedInfo = false; +if($valid){ + $showDetailedInfo = true; +} + +if(!key_exists($citylist, CityConst::all())){ $citylist = $me['city']; + $showDetailedInfo = true; + $valid = 1; +} + +if($userGrade >= 5){ + $valid = true; +} + +if(!$valid) { + $ownCities = Util::convertArrayToSetLike($db->queryFirstColumn('SELECT city FROM city WHERE nation = %i AND nation != 0', $me['nation'])); + foreach(array_keys(CityConst::byID($citylist)->path) as $pathID){ + if(key_exists($pathID, $ownCities)){ + $showDetailedInfo = true; + break; + } + } } @@ -172,11 +194,35 @@ if($city['trade'] === null) { } $dbColumns = General::mergeQueryColumn(['npc', 'defence_train', 'no', 'picture', 'imgsvr', 'name', 'injury', 'leadership', 'strength', 'intel', 'officer_level', 'nation', 'crewtype', 'crew', 'train', 'atmos'], 2)[0]; -$generals = $db->query( - 'SELECT %l from general where city=%i order by name', - Util::formatListOfBackticks($dbColumns), - $city['city'] -); +if($showDetailedInfo){ + $generals = $db->query( + 'SELECT %l from general where city=%i order by name', + Util::formatListOfBackticks($dbColumns), + $city['city'] + ); +} +else{ + $generals = []; +} + +if($valid){ + $city['trustText'] = round($city['trust'], 1); + $city['popRateText'] = round($city['pop']/$city['pop_max']*100, 2); +} +else{ + $city['agri'] = '?'; + $city['comm'] = '?'; + $city['pop'] = '?'; + $city['secu'] = '?'; + $city['trustText'] = '?'; + $city['popRateText'] = '?'; + + if($city['nation'] != 0){ + $city['def'] = '?'; + $city['wall'] = '?'; + } +} + $generalTurnList = []; @@ -257,6 +303,10 @@ foreach($generals as $general){ $crew = $general['crew']; $train = -1; $atmos = -1; + + if(!$valid){ + $crew = -1; + } } $nation = $general['nation']; @@ -331,7 +381,9 @@ foreach($generalsFormat as $general){ } if($general['nation'] != $myNation['nation']){ $enemyCnt += 1; - $enemyCrew += $general['crew']; + if($general['crew'] >= 0){ + $enemyCrew += $general['crew']; + } if($general['crew'] > 0){ $enemyArmedCnt += 1; } @@ -402,11 +454,11 @@ foreach($generalsFormat as $general){ 민심 - + 시세 % 인구 - % + % 태수 군사 @@ -430,11 +482,12 @@ foreach($generalsFormat as $general){ 장수 - + 알 수 없음'?>
+ @@ -459,7 +512,7 @@ foreach($generalsFormat as $general){ ?>
- + diff --git a/hwe/js/map.js b/hwe/js/map.js index 871ad48f..f2bcd3e7 100644 --- a/hwe/js/map.js +++ b/hwe/js/map.js @@ -235,10 +235,10 @@ function reloadWorldMap(option, drawTarget) { } function mergeClickable(city) { - //clickable = (remainSpy << 3) | (ourCity << 2) | (shownByGeneral << 1) | clickableAll + //clickable = (defaultCity << 4 ) | (remainSpy << 3) | (ourCity << 2) | (shownByGeneral << 1) | clickableAll var id = city.id; var nationId = city.nationId; - var clickable = 0; + var clickable = 16; if (id in spyList) { clickable |= spyList[id] << 3; } diff --git a/hwe/templates/cityGeneral.php b/hwe/templates/cityGeneral.php index 2c04feb2..f342eae8 100644 --- a/hwe/templates/cityGeneral.php +++ b/hwe/templates/cityGeneral.php @@ -1,53 +1,53 @@ - - data-general-defence-train="" - data-general-crew-type="" - data-general-crew="" - data-general-train="" - data-general-atmos="" - - data-general-crew="" - - data-general-nation="" - data-general-nation-name="" -> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + data-general-defence-train="" + data-general-crew-type="" + data-general-crew="" + data-general-train="" + data-general-atmos="" + + data-general-crew="" + + data-general-nation="" + data-general-nation-name="" +> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file
NPC 장수????】 장수재 야
NPC 장수??=0?$crew:'?'?>??】 장수재 야