From a9f3b839ec4ae69cf5f003268ce10e45cd3957fb Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 5 Mar 2019 02:11:52 +0900 Subject: [PATCH 01/34] =?UTF-8?q?=EB=AA=85=EC=A0=84=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=9E=A5=EC=88=98=EC=9D=98=20=EB=B3=B8=EB=8B=89=EC=9D=B4=20?= =?UTF-8?q?=EB=9C=A8=EB=8F=84=EB=A1=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/a_hallOfFame.php | 12 +++++++++++- hwe/func.php | 7 ++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/hwe/a_hallOfFame.php b/hwe/a_hallOfFame.php index 3a94afd0..b0f8cb23 100644 --- a/hwe/a_hallOfFame.php +++ b/hwe/a_hallOfFame.php @@ -92,12 +92,22 @@ $types = [ $templates = new \League\Plates\Engine('templates'); +$ownerNameList = []; +foreach(RootDB::db()->queryAllLists('SELECT no, name FROM member') as [$ownerID, $ownerName]){ + $ownerNameList[$ownerID] = $ownerName; +} + foreach($types as $idx=>[$typeName, $typeValue]) { $hallResult = $db->query('SELECT * FROM ng_hall WHERE `type`=%i AND %? ORDER BY `value` DESC LIMIT 10', $idx, $searchFilter); - $hallResult = array_map(function($general)use($typeValue){ + $hallResult = array_map(function($general)use($typeValue, $ownerNameList){ $aux = Json::decode($general['aux']); $general += $aux; + + if(key_exists($general['owner'], $ownerNameList)){ + $general['owner_name'] = $ownerNameList[$general['owner']]; + } + if(!key_exists('bgColor', $general)){ if(!key_exists('color', $general)){ $general['bgColor'] = GameConst::$basecolor4; diff --git a/hwe/func.php b/hwe/func.php index 90c6230a..4a2a613f 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -2151,6 +2151,11 @@ function CheckHall($no) { [$scenarioIdx, $scenarioName, $startTime] = $gameStor->getValuesAsArray(['scenario', 'scenario_text', 'starttime']); + $ownerName = $general['name2']; + if($general['owner']){ + $ownerName = RootDB::db()->queryFirstField('SELECT name FROM member WHERE no = %i', $general['owner']); + } + foreach($types as $idx=>$typeName) { @@ -2180,7 +2185,7 @@ function CheckHall($no) { 'imgsvr'=>$general['imgsvr'], 'startTime'=>$startTime, 'unitedTime'=>$unitedDate, - 'owner_name'=>$general['name2'], + 'owner_name'=>$ownerName, 'serverID'=>UniqueConst::$serverID, 'serverIdx'=>$serverCnt, 'serverName'=>UniqueConst::$serverName, From 110294103f4ddf9f348200192df72a687a141ac8 Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 5 Mar 2019 02:23:28 +0900 Subject: [PATCH 02/34] =?UTF-8?q?=EC=B2=9C=ED=86=B5=20=ED=9B=84=EC=97=90?= =?UTF-8?q?=EB=8A=94=20=EB=AA=85=EC=9E=A5=20=EC=9D=BC=EB=9E=8C=EC=97=90=20?= =?UTF-8?q?=EC=9E=A5=EC=88=98=20=EB=B3=B8=EB=8B=89=EC=9D=B4=20=EB=9C=A8?= =?UTF-8?q?=EB=8F=84=EB=A1=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/a_bestGeneral.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hwe/a_bestGeneral.php b/hwe/a_bestGeneral.php index cb0073d5..0339ac27 100644 --- a/hwe/a_bestGeneral.php +++ b/hwe/a_bestGeneral.php @@ -49,6 +49,12 @@ increaseRefresh("명장일람", 1);
isunited){ + foreach(RootDB::db()->queryAllLists('SELECT no, name FROM member') as [$ownerID, $ownerName]){ + $ownerNameList[$ownerID] = $ownerName; + } +} $nationName = [0=>'재야']; $nationColor = [0=>'#000000']; @@ -166,7 +172,7 @@ $generals = array_map(function($general) use($nationColor, $nationName) { return $general; }, $db->query( - "SELECT nation,no,name,name2 as owner_name, picture, imgsvr, + "SELECT nation,no,name,name2 as owner_name, owner, picture, imgsvr, experience, dedication, firenum, warnum, killnum, killcrew, deathcrew, dex0, dex10, dex20, dex30, dex40, ttw, ttd, ttl, tlw, tld, tll, tpw, tpd, tpl, tiw, tid, til, @@ -179,7 +185,7 @@ $templates = new \League\Plates\Engine('templates'); foreach($types as $idx=>[$typeName, $typeValue, $typeFunc]){ $validCnt = 0; - $typeGenerals = array_map(function($general) use($typeValue, $typeFunc, &$validCnt){ + $typeGenerals = array_map(function($general) use($typeValue, $typeFunc, &$validCnt, $ownerNameList){ $general = ($typeFunc)($general); $value = $general['value']; @@ -193,6 +199,7 @@ foreach($types as $idx=>[$typeName, $typeValue, $typeFunc]){ else { $general['printValue'] = number_format($value); } + $general['owner_name'] = $ownerNameList[$general['owner']]??null; return $general; }, $generals); @@ -231,6 +238,7 @@ foreach($generals as $general){ $itemName = ($itemFunc)($itemCode); $general['rankName'] = $itemName; $general['value'] = $itemCode; + $general['owner_name'] = $ownerNameList[$general['owner']]??null; $itemTypes[$itemIdx][5][$itemCode] = $general; } } @@ -252,6 +260,7 @@ foreach($itemTypes as [$itemNameType, $itemType, $itemFunc, $itemMinCode, $itemM } $general = $itemOwners[$itemCode]; + $general['owner_name'] = $ownerNameList[$general['owner']]??null; $itemRanker[$itemCode] = $general; } From 2c2b0785145e4960bd32540bd2c6e06fe5d229ad Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 5 Mar 2019 02:27:22 +0900 Subject: [PATCH 03/34] =?UTF-8?q?=EB=AA=85=EC=9E=A5=EC=9D=BC=EB=9E=8C?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EA=B3=84=EB=9E=B5=20=EC=8B=9C=EB=8F=84=20?= =?UTF-8?q?=EC=9E=A5=EC=88=98=20=EB=B3=B8=EB=8B=89=EC=9D=B4=20=EB=9C=A8?= =?UTF-8?q?=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/a_bestGeneral.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hwe/a_bestGeneral.php b/hwe/a_bestGeneral.php index 0339ac27..eb789a52 100644 --- a/hwe/a_bestGeneral.php +++ b/hwe/a_bestGeneral.php @@ -186,6 +186,7 @@ $templates = new \League\Plates\Engine('templates'); foreach($types as $idx=>[$typeName, $typeValue, $typeFunc]){ $validCnt = 0; $typeGenerals = array_map(function($general) use($typeValue, $typeFunc, &$validCnt, $ownerNameList){ + $general['owner_name'] = $ownerNameList[$general['owner']]??null; $general = ($typeFunc)($general); $value = $general['value']; @@ -199,7 +200,6 @@ foreach($types as $idx=>[$typeName, $typeValue, $typeFunc]){ else { $general['printValue'] = number_format($value); } - $general['owner_name'] = $ownerNameList[$general['owner']]??null; return $general; }, $generals); From 12912a62aa4767b9ee5ebe19cc10ee6ecf90825a Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 5 Mar 2019 02:29:10 +0900 Subject: [PATCH 04/34] =?UTF-8?q?=EC=95=84=EC=9D=B4=ED=85=9C=EC=97=90=20?= =?UTF-8?q?=EC=9E=A5=EC=88=98=EB=AA=85=EC=9D=84=20=EB=9D=84=EC=9A=B0?= =?UTF-8?q?=EB=8A=94=EA=B2=83=EC=9D=80=20=EB=B9=84=ED=95=A9=EB=A6=AC?= =?UTF-8?q?=EC=A0=81=EC=9C=BC=EB=A1=9C=20=EB=B3=B4=EC=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/a_bestGeneral.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/hwe/a_bestGeneral.php b/hwe/a_bestGeneral.php index eb789a52..6211d11b 100644 --- a/hwe/a_bestGeneral.php +++ b/hwe/a_bestGeneral.php @@ -238,7 +238,6 @@ foreach($generals as $general){ $itemName = ($itemFunc)($itemCode); $general['rankName'] = $itemName; $general['value'] = $itemCode; - $general['owner_name'] = $ownerNameList[$general['owner']]??null; $itemTypes[$itemIdx][5][$itemCode] = $general; } } @@ -260,7 +259,6 @@ foreach($itemTypes as [$itemNameType, $itemType, $itemFunc, $itemMinCode, $itemM } $general = $itemOwners[$itemCode]; - $general['owner_name'] = $ownerNameList[$general['owner']]??null; $itemRanker[$itemCode] = $general; } From 2785ca9f312dfae5db10c490154d2382a5d327da Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 5 Mar 2019 02:32:42 +0900 Subject: [PATCH 05/34] =?UTF-8?q?=EC=B2=9C=ED=86=B5=20=EC=8B=9C=EC=97=90?= =?UTF-8?q?=EB=8A=94=20=EA=B3=84=EB=9E=B5=20=EB=AA=85=EC=9E=A5=EC=9D=B4=20?= =?UTF-8?q?=EB=B3=B4=EC=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/a_bestGeneral.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hwe/a_bestGeneral.php b/hwe/a_bestGeneral.php index 6211d11b..095bcd0f 100644 --- a/hwe/a_bestGeneral.php +++ b/hwe/a_bestGeneral.php @@ -66,8 +66,11 @@ foreach (getAllNationStaticInfo() as $nation) { $types = [ ["명 성", "int", function($v){$v['value'] = $v['experience']; return $v; }], ["계 급", "int", function($v){$v['value'] = $v['dedication']; return $v; }], - ["계 략 성 공", "int", function($v){ + ["계 략 성 공", "int", function($v) use ($gameStor){ $v['value'] = $v['firenum']; + if($gameStor->isunited){ + return $v; + } $v['nationName'] = '???'; $v['pictureFullPath'] = GetImageURL(0)."/default.jpg"; $v['name'] = '???'; From e9d1fdb4ee7005fa1e025d4758f55bd2c147a608 Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 5 Mar 2019 23:06:34 +0900 Subject: [PATCH 06/34] =?UTF-8?q?=EB=91=90=EB=B2=88=20=ED=83=AD=20?= =?UTF-8?q?=ED=95=B4=20=EB=8F=84=EC=8B=9C=20=EC=9D=B4=EB=8F=99=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=9E=AC=20=EB=B6=80=ED=99=9C,=20=EC=98=B5?= =?UTF-8?q?=EC=85=98=20=EC=84=A4=EC=A0=95=20=EA=B0=80=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/css/map.css | 13 +++++ hwe/js/map.js | 128 +++++++++++++++++++++++++++++++++++++++++- hwe/templates/map.php | 3 + 3 files changed, 142 insertions(+), 2 deletions(-) diff --git a/hwe/css/map.css b/hwe/css/map.css index 935458c6..e89b79aa 100644 --- a/hwe/css/map.css +++ b/hwe/css/map.css @@ -61,6 +61,7 @@ position:absolute; right:0; bottom:0; + text-align:right; } .map_body .map_toggle_cityname::after{ @@ -71,6 +72,18 @@ content: "켜기" } +.map_body .map_toggle_single_tap{ + display:none; +} + +.map_body .map_toggle_single_tap::after{ + content: "끄기" +} + +.map_body .map_toggle_single_tap.active::after{ + content: "켜기" +} + .world_map .city_tooltip{ position: absolute; z-index:6; diff --git a/hwe/js/map.js b/hwe/js/map.js index 09686e8d..b1c49e67 100644 --- a/hwe/js/map.js +++ b/hwe/js/map.js @@ -1,5 +1,20 @@ +function is_touch_device() { + var prefixes = ' -webkit- -moz- -o- -ms- '.split(' '); + var mq = function(query) { + return window.matchMedia(query).matches; + } + if (('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch) { + return true; + } + + + // include the 'heartz' as a way to have a non matching MQ to help terminate the join + // https://git.io/vznFH + var query = ['(', prefixes.join('touch-enabled),('), 'heartz', ')'].join(''); + return mq(query); + } function reloadWorldMap(option){ var $world_map = $('.world_map'); @@ -368,8 +383,76 @@ function reloadWorldMap(option){ var $map_body = $('.world_map .map_body'); + //터치스크린 탭 + + if(is_touch_device()){ + $objs.on('touchstart', function(e){ + if(window.sam_toggleSingleTap){ + return true; + } + var $this = $(this); + + var touchMode = $this.data('touchMode'); + if($tooltip_city.data('target') != $this.data('id')){ + $this.data('touchMode', 1); + } + else if(touchMode === undefined){ + $this.data('touchMode', 1); + } + else{ + $this.data('touchMode', touchMode + 1); + } + $map_body.data('touchMode', 1); + + $tooltip_city.data('target', $this.data('id')); + + + }); + + $objs.on('touchend', function(e){ + if(window.sam_toggleSingleTap){ + return true; + } + var $this = $(this); + var position = $this.parent().position(); + $tooltip_city.html($this.data('text')); + + var nation_text = $this.data('nation'); + if(nation_text){ + $tooltip_nation.html(nation_text).show(); + } + else{ + $tooltip_nation.html('').hide(); + } + + $tooltip.css({'top': position.top + 25, 'left': position.left + 35}).show(); + + var touchMode = $this.data('touchMode'); + if(touchMode <= 1){ + return false; + } + + //xxx: touchend 다음 click 이벤트가 갈 수도 있고, 안 갈 수도 있다. + $this.data('touchMode', 0); + }); + + $map_body.on('touchend',function(e){ + if(window.sam_toggleSingleTap){ + return true; + } + //위의 touchend bind에 해당하지 않는 경우 -> 빈 지도 터치 + $tooltip.hide(); + }); + + } + //Mouse over 모드 작동 + $map_body.on('mousemove', function(e){ + if($(this).data('touchMode')){ + return true; + } + var parentOffset = $map_body.offset(); var relX = e.pageX - parentOffset.left; var relY = e.pageY - parentOffset.top; @@ -378,6 +461,10 @@ function reloadWorldMap(option){ }); $objs.on('mouseenter', function(e){ + if($map_body.data('touchMode')){ + return true; + } + var $this = $(this); $tooltip_city.data('target', $this.data('id')); @@ -398,7 +485,15 @@ function reloadWorldMap(option){ }); $objs.on('click', function(e){ - return; + //xxx: touchend 다음 click 이벤트가 갈 수도 있고, 안 갈 수도 있다. + var touchMode = $(this).data('touchMode'); + if(touchMode === undefined){ + return; + } + + if(touchMode === 1){ + return false; + } }); @@ -448,6 +543,31 @@ function reloadWorldMap(option){ } }); + var $toggleSingleTapBtn = $world_map.find('.map_toggle_single_tap'); + if(localStorage.getItem('sam.toggleSingleTap') == 'yes'){ + window.sam_toggleSingleTap = true; + $toggleSingleTapBtn.addClass('active').attr('aria-pressed', 'true'); + } + else{ + window.sam_toggleSingleTap = false; + } + + var $map_body = $('.world_map .map_body'); + + $toggleSingleTapBtn.click(function(){ + //이전 상태 확인 + var state = !$toggleSingleTapBtn.hasClass('active'); + if(state){ + $map_body.removeData('touchMode'); + localStorage.setItem('sam.toggleSingleTap', 'yes'); + window.sam_toggleSingleTap = true; + } + else{ + localStorage.setItem('sam.toggleSingleTap', 'no'); + window.sam_toggleSingleTap = false; + } + }); + if(isDetailMap){ $world_map.addClass('map_detail'); } @@ -527,4 +647,8 @@ function reloadWorldMap(option){ } } - +$(function(){ + if(is_touch_device()){ + $('.map_body .map_toggle_single_tap').show(); + } +}) \ No newline at end of file diff --git a/hwe/templates/map.php b/hwe/templates/map.php index 72b97147..bc50e3b0 100644 --- a/hwe/templates/map.php +++ b/hwe/templates/map.php @@ -11,6 +11,9 @@

+
From 45d7a29a95042e7a58697052a3c4149f1fd37f87 Mon Sep 17 00:00:00 2001 From: hide_d Date: Wed, 6 Mar 2019 00:38:35 +0900 Subject: [PATCH 07/34] =?UTF-8?q?=EC=88=98=EB=B9=84=20=EC=88=9C=EC=84=9C?= =?UTF-8?q?=EC=97=90=20=ED=9B=88=EC=82=AC=20=EC=98=81=ED=96=A5=EC=9D=84=20?= =?UTF-8?q?=EB=8D=94=20=EA=B0=95=ED=95=98=EA=B2=8C=20=EC=A3=BC=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/process_war.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hwe/process_war.php b/hwe/process_war.php index e1b1f890..4c7c7626 100644 --- a/hwe/process_war.php +++ b/hwe/process_war.php @@ -217,7 +217,7 @@ function extractBattleOrder($general){ getGeneralIntel($general, false, true, true, true); $totalStat = ($realStat + $fullStat) / 2; - $totalCrew = $general['crew'] / 10000 * $general['train'] * $general['atmos']; + $totalCrew = $general['crew'] / 1000000 * (($general['train'] * $general['atmos']) ** 1.5); return $totalStat + $totalCrew / 100; } From 58933a6bcdb385c9c0aa1e4f376a6f78e3d2b10d Mon Sep 17 00:00:00 2001 From: hide_d Date: Wed, 6 Mar 2019 00:40:56 +0900 Subject: [PATCH 08/34] =?UTF-8?q?=EC=9D=B8=EC=9E=90=20=EB=B2=84=EA=B7=B8?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/j_general_set_permission.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hwe/j_general_set_permission.php b/hwe/j_general_set_permission.php index 988ac22e..76744f36 100644 --- a/hwe/j_general_set_permission.php +++ b/hwe/j_general_set_permission.php @@ -7,7 +7,7 @@ include "func.php"; //TODO: 변경이 완료되면 항상 공지되어야함 -$isAmbassador = Util::getReq('isAmbassador', bool); +$isAmbassador = Util::getReq('isAmbassador', 'bool'); $genlist = Util::getReq('genlist', 'array_int'); //로그인 검사 From f9f59bd7c269b1a113f1521c62764db571cc6e15 Mon Sep 17 00:00:00 2001 From: hide_d Date: Wed, 6 Mar 2019 01:09:34 +0900 Subject: [PATCH 09/34] =?UTF-8?q?=ED=86=A0=EB=84=88=EB=A8=BC=ED=8A=B8=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=EC=9D=B4=20=EB=B3=80=EA=B2=BD=20=ED=9A=9F?= =?UTF-8?q?=EC=88=98=EB=A5=BC=20=EA=B9=8E=EC=A7=80=20=EC=95=8A=EC=9D=8C.?= =?UTF-8?q?=20=EC=88=98=EB=B9=84=20=EB=81=94=20=EC=8B=9C=20=ED=9B=88?= =?UTF-8?q?=EC=82=AC=203=20=EA=B0=90=EC=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/b_myPage.php | 31 ++++++++++++++++++++++++------- hwe/func_command.php | 23 ++++++++++++++--------- 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/hwe/b_myPage.php b/hwe/b_myPage.php index b5170e04..e72171e4 100644 --- a/hwe/b_myPage.php +++ b/hwe/b_myPage.php @@ -28,7 +28,7 @@ $connect=$db->get(); increaseRefresh("내정보", 1); -$query = "select no,npc,mode,tnmt,myset from general where owner='{$userID}'"; +$query = "select no,npc,mode,tnmt,myset,train,atmos from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), ""); $me = MYDB_fetch_array($result); @@ -46,13 +46,30 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) { $submit = 'hidden'; } - $me['myset'] -= 1; + if($mode == 0){ + $db->update('general', [ + 'myset'=>$db->sqleval('myset-1'), + 'mode'=>$mode, + 'train'=>max(0, $me['train'] - 3), + 'atmos'=>max(0, $me['atmos'] - 3), + ], 'owner=%i AND mode!=%i', $userID, $mode); + } + else{ + $db->update('general', [ + 'myset'=>$db->sqleval('myset-1'), + 'mode'=>$mode + ], 'owner=%i AND mode!=%i', $userID, $mode); + } - $db->update('general', [ - 'myset'=>$db->sqleval('myset-1'), - 'mode'=>$mode, - 'tnmt'=>$tnmt - ], 'owner=%i', $userID); + if($db->affectedRows()){ + $me['myset'] -= 1; + } + + if($me['tnmt'] != $tnmt){ + $db->update('general', [ + 'tnmt'=>$tnmt + ], 'owner=%i', $userID); + } $me['mode'] = $mode; $me['tnmt'] = $tnmt; diff --git a/hwe/func_command.php b/hwe/func_command.php index 0064cf43..7c7d3a16 100644 --- a/hwe/func_command.php +++ b/hwe/func_command.php @@ -478,9 +478,7 @@ function processCommand($no) { $gameStor = KVStorage::getStorage($db, 'game_env'); $connect=$db->get(); - $query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,affinity,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40,warnum,killnum,deathnum,killcrew,deathcrew,recwar from general where no='$no'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $general = MYDB_fetch_array($result); + $general = $db->queryFirstRow('SELECT npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,affinity,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40,warnum,killnum,deathnum,killcrew,deathcrew,recwar,myset from general where no = %i', $no); list($month, $killturn) = $gameStor->getValuesAsArray(['month', 'killturn']); $log = []; @@ -546,17 +544,24 @@ function processCommand($no) { } $command = DecodeCommand($general['turn0']); + $newKillturn = $killturn; //삭턴 처리 if($general['npc'] >= 2 || $general['killturn'] > $killturn) { - $query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn=killturn-1 where no='{$general['no']}'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + $newKillturn = $general['killturn'] - 1; } elseif($command[0] == 0) { - $query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn=killturn-1 where no='{$general['no']}'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + $newKillturn = $general['killturn'] - 1; } else { - $query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn='{$killturn}' where no='{$general['no']}'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + $newKillturn = $killturn; } + + $newMySet = min($general['myset'] + 1, 3); + $db->update('general', [ + 'recturn'=>$db->sqleval('turn0'), + 'resturn'=>'FAIL', + 'con'=>0, + 'killturn'=>$newKillturn, + 'myset'=>$newMySet + ], 'no = %i', $general['no']); //FIXME: 운영자 같이 사망하면 안되는 인물에 대한 처리가 필요 //연속턴 아닌경우 텀 리셋 From b733b70ad84de144aeec0345b583acce87189105 Mon Sep 17 00:00:00 2001 From: hide_d Date: Wed, 6 Mar 2019 01:44:24 +0900 Subject: [PATCH 10/34] =?UTF-8?q?=ED=99=A9=EC=A0=9C=EA=B0=80=20=EC=9E=88?= =?UTF-8?q?=EC=9D=84=20=EA=B2=BD=EC=9A=B0=20=ED=99=A9=EC=A0=9C.=20?= =?UTF-8?q?=EC=97=86=EC=9C=BC=EB=A9=B4=20=EC=9D=B4=EC=A0=84=20=EC=B2=9C?= =?UTF-8?q?=ED=86=B5=20=EA=B5=B0=EC=A3=BC=EC=9D=98=20=EB=AA=85=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=ED=86=A0=EB=84=88=EB=A8=BC=ED=8A=B8=20=EA=B0=9C?= =?UTF-8?q?=EC=B5=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_tournament.php | 22 ++++++++++++++++++---- hwe/sammo/ResetHelper.php | 5 ++++- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/hwe/func_tournament.php b/hwe/func_tournament.php index 206117e1..9be9527f 100644 --- a/hwe/func_tournament.php +++ b/hwe/func_tournament.php @@ -235,6 +235,8 @@ function startTournament($auto, $type) { $gameStor = KVStorage::getStorage($db, 'game_env'); $connect=$db->get(); + $prevWinner = $gameStor->prev_winner; + eraseTnmtFightLogAll(); switch($auto) { @@ -263,12 +265,24 @@ function startTournament($auto, $type) { $query = "truncate tournament"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + $opener = $db->queryFirstField('SELECT `general`.`name` FROM `general` JOIN `nation` ON `general`.`nation` = `nation`.`nation` WHERE `general`.`level` = 12 AND `nation`.`level` = 7 ORDER BY rand() LIMIT 1'); + if(!$opener){ + $opener = $gameStor->prev_winner; + } + + if($opener){ + $openerText = "황제 {$opener}의 명으로 "; + } + else{ + $openerText = ''; + } + $history = []; switch($type) { - case 0: $history[] = "◆{$admin['year']}년 {$admin['month']}월: 전력전 대회가 개최됩니다! 천하의 영웅들을 모집하고 있습니다!"; break; - case 1: $history[] = "◆{$admin['year']}년 {$admin['month']}월: 통솔전 대회가 개최됩니다! 천하의 명사들을 모집하고 있습니다!"; break; - case 2: $history[] = "◆{$admin['year']}년 {$admin['month']}월: 일기토 대회가 개최됩니다! 천하의 용사들을 모집하고 있습니다!"; break; - case 3: $history[] = "◆{$admin['year']}년 {$admin['month']}월: 설전 대회가 개최됩니다! 천하의 책사들을 모집하고 있습니다!"; break; + case 0: $history[] = "◆{$admin['year']}년 {$admin['month']}월: $openerText전력전 대회가 개최됩니다! 천하의 영웅들을 모집하고 있습니다!"; break; + case 1: $history[] = "◆{$admin['year']}년 {$admin['month']}월: $openerText통솔전 대회가 개최됩니다! 천하의 명사들을 모집하고 있습니다!"; break; + case 2: $history[] = "◆{$admin['year']}년 {$admin['month']}월: $openerText일기토 대회가 개최됩니다! 천하의 용사들을 모집하고 있습니다!"; break; + case 3: $history[] = "◆{$admin['year']}년 {$admin['month']}월: $openerText설전 대회가 개최됩니다! 천하의 책사들을 모집하고 있습니다!"; break; } pushWorldHistory($history, $admin['year'], $admin['month']); } diff --git a/hwe/sammo/ResetHelper.php b/hwe/sammo/ResetHelper.php index bc398df4..fd1582bc 100644 --- a/hwe/sammo/ResetHelper.php +++ b/hwe/sammo/ResetHelper.php @@ -164,6 +164,8 @@ class ResetHelper{ 'plock'=>1 ]); + $prevWinner = $db->queryFirstField('SELECT l12name FROM emperior ORDER BY `no` DESC LIMIT 1'); + CityConst::build(); $cityPositions = []; foreach(CityConst::all() as $city){ @@ -235,7 +237,8 @@ class ResetHelper{ 'npcmode'=>$npcmode, 'extended_general'=>$extend, 'fiction'=>$fiction, - 'tnmt_trig'=>$tournament_trig + 'tnmt_trig'=>$tournament_trig, + 'prev_winner'=>$prevWinner ]; foreach(RootDB::db()->query('SELECT `no`, `name`, `picture`, `imgsvr` FROM member WHERE grade >= 5') as $admin){ From 2549aa58098f19d8c5c180fe9e58a57aedea8b4a Mon Sep 17 00:00:00 2001 From: hide_d Date: Fri, 8 Mar 2019 22:20:45 +0900 Subject: [PATCH 11/34] =?UTF-8?q?=EC=9D=98=EB=B3=91,=20=EC=9D=B8=ED=83=90?= =?UTF-8?q?=EC=9E=A5=EB=8F=84=20=EC=A0=81=EC=9D=80=20=EB=B9=84=EC=A4=91?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=9E=A5=EC=88=98=20=EC=B9=B4=EC=9A=B4?= =?UTF-8?q?=ED=8A=B8=EC=97=90=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_process_personnel.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hwe/func_process_personnel.php b/hwe/func_process_personnel.php index a7f21420..0c380582 100644 --- a/hwe/func_process_personnel.php +++ b/hwe/func_process_personnel.php @@ -131,6 +131,16 @@ function process_25(&$general) { $generals[$nation] = $cnt; } + foreach($db->queryAllLists('SELECT count(no), nation FROM general WHERE 3 <= npc and npc <= 4 AND nation > 0 GROUP BY nation') as list($cnt, $nation)){ + //의병, 인탐장은 1/3로 카운트 + if(key_exists($nation, $generals)){ + $generals[$nation] += $cnt / 3; + } + else{ + $generals[$nation] = $cnt / 3; + } + } + $allGen = array_sum($generals); $genLimit = GameConst::$defaultMaxGeneral; From f21ebfc366f252e2eb4025998288f272e11fe6a3 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 00:00:00 +0900 Subject: [PATCH 12/34] =?UTF-8?q?=EA=B4=80=EB=A6=AC=EC=9E=90=20=ED=84=B4?= =?UTF-8?q?=20=EB=8B=B9=EA=B9=80=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/_119_b.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hwe/_119_b.php b/hwe/_119_b.php index cf83c7ba..1e66a2e5 100644 --- a/hwe/_119_b.php +++ b/hwe/_119_b.php @@ -40,10 +40,10 @@ case "분당김": $gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s'); $db->update('general', [ - 'turntime'=>$db->sqleval('DATE_ADD(turntime, INTERVAL %i MINUTE)', $minute) + 'turntime'=>$db->sqleval('DATE_SUB(turntime, INTERVAL %i MINUTE)', $minute) ], true); $db->update('auction', [ - 'expire'=>$db->sqleval('DATE_ADD(expire, INTERVAL %i MINUTE)', $minute) + 'expire'=>$db->sqleval('DATE_SUB(expire, INTERVAL %i MINUTE)', $minute) ], true); break; case "분지연": From aeea53017fee5904f4649839eaa9fbaea9294011 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 00:15:51 +0900 Subject: [PATCH 13/34] =?UTF-8?q?=EC=9D=B8=ED=83=90=20=EC=9E=A5=EC=88=98?= =?UTF-8?q?=20=EB=B9=84=EC=9C=A8=204:4:2=EB=A1=9C=20=EB=B3=80=EA=B2=BD.=20?= =?UTF-8?q?=EC=9D=B8=ED=83=90=EC=9E=A5=20=EC=88=99=EB=A0=A8=EB=8F=84=20?= =?UTF-8?q?=ED=8F=89=EC=A4=80=ED=99=94.=20=EC=9D=B8=ED=83=90=20=ED=99=95?= =?UTF-8?q?=EB=A5=A0=20=EC=83=81=EC=8A=B9.=20=20=EB=B0=9C=EA=B2=AC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_process_chief.php | 42 +++++++------ hwe/func_process_personnel.php | 108 ++++++++++++++------------------- 2 files changed, 69 insertions(+), 81 deletions(-) diff --git a/hwe/func_process_chief.php b/hwe/func_process_chief.php index 33248ccc..81637e6b 100644 --- a/hwe/func_process_chief.php +++ b/hwe/func_process_chief.php @@ -1968,31 +1968,35 @@ function process_76(&$general) { $avgNation = MYDB_fetch_array($result); $gencount = 5 + Util::round($avgNation['gennum'] / 10); - $query = "select avg(age) as age, max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0) as dex0, avg(dex10) as dex10, avg(dex20) as dex20, avg(dex30) as dex30, avg(dex40) as dex40 from general where nation='{$general['nation']}'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $avgGen = MYDB_fetch_array($result); + $avgGen = $db->queryFirstRow('SELECT max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0+dex10+dex20+dex30) * 1.5 / 4 as dex_t, avg(dex40) as dex40 from general where npc < 5 and nation = %i', $general['nation']); //의병추가 $npc = 4; $npcid = $admin['npccount']; for($i=0; $i < $gencount; $i++) { - // 무장 40%, 지장 40%, 무지장 20% - $type = rand() % 10; - switch($type) { - case 0: case 1: case 2: case 3: - $leader = GameConst::$defaultStatMax - 10 + rand()%11; - $intel = GameConst::$defaultStatMin + rand()%6; - $power = GameConst::$defaultStatTotal - $leader - $intel; + //무장 40%, 지장 40%, 무지장 20% + $stat_tier1 = GameConst::$defaultStatMax - 10 + rand()%11; + $stat_tier3 = GameConst::$defaultStatMin + rand()%6; + $stat_tier2 = GameConst::$defaultStatTotal - $stat_tier1 - $stat_tier3; + switch(Util::choiceRandomUsingWeight([ + 'power'=>4, + 'intel'=>4, + 'neutral'=>2 + ])){ + case 'power': + $leader = $stat_tier1; + $power = $stat_tier2; + $intel = $stat_tier3; break; - case 4: case 5: case 6: case 7: - $leader = GameConst::$defaultStatMax - 10 + rand()%11; - $power = GameConst::$defaultStatMin + rand()%6; - $intel = GameConst::$defaultStatTotal - $leader - $power; + case 'intel': + $leader = $stat_tier1; + $power = $stat_tier3; + $intel = $stat_tier2; break; - case 8: case 9: - $leader = GameConst::$defaultStatMin + rand()%6; - $power = GameConst::$defaultStatMax - 10 + rand()%11; - $intel = GameConst::$defaultStatTotal - $leader - $power; + case 'neutral': + $leader = $stat_tier3; + $power = $stat_tier1; + $intel = $stat_tier2; break; } // 국내 최고능치 기준으로 랜덤성 스케일링 @@ -2066,7 +2070,7 @@ function process_76(&$general) { '1','100','100','0','".GameUnitConst::DEFAULT_CREWTYPE."','0','0','0', '0','0','0','$turntime','$killturn','{$avgGen['age']}','1','$personal','0','0','0','0','', '0','$bornyear','$deadyear', - '{$avgGen['dex0']}','{$avgGen['dex10']}','{$avgGen['dex20']}','{$avgGen['dex30']}','{$avgGen['dex40']}' + '{$avgGen['dex_t']}','{$avgGen['dex_t']}','{$avgGen['dex_t']}','{$avgGen['dex_t']}','{$avgGen['dex40']}' )", $connect ) or Error(__LINE__.MYDB_error($connect),""); diff --git a/hwe/func_process_personnel.php b/hwe/func_process_personnel.php index 0c380582..e445c7f1 100644 --- a/hwe/func_process_personnel.php +++ b/hwe/func_process_personnel.php @@ -290,7 +290,7 @@ function process_29(&$general) { $history = []; $date = substr($general['turntime'],11,5); - $admin = $gameStor->getValues(['startyear','year','month','develcost','npccount','turnterm','scenario']); + $admin = $gameStor->getValues(['startyear','year','month','develcost','npccount','turnterm','scenario','maxgeneral']); $query = "select nation,name,level,gennum,scout from nation where nation='{$general['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); @@ -306,25 +306,20 @@ function process_29(&$general) { } elseif($general['gold'] < $admin['develcost']) { $log[] = "●{$admin['month']}월:자금이 모자랍니다. 인재탐색 실패. <1>$date"; } else { - $query = "select no from general where nation='{$general['nation']}' and npc<2"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $gencount = MYDB_num_rows($result); - $query = "select no from general where nation='{$general['nation']}' and npc=3"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $npccount = MYDB_num_rows($result); + $max_gen_cnt = $admin['maxgeneral']; - $query = "select no from general where nation!='{$general['nation']}' and npc=3"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $otherNpccount = MYDB_num_rows($result); - $otherNpccount = Util::round(sqrt($otherNpccount + 1)) - 1; - - if($gencount <= 0) { $gencount = 1; } - if($npccount <= 0) { $npccount = 1; } - $criteria = $gencount * $npccount + $otherNpccount; + $total_gen_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc <= 2'); + $total_npc_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE 3 <= npc AND npc <= 4'); + + $curr_cnt = Util::toInt($total_gen_cnt + $total_npc_cnt / 2); + $remain_slot = $max_gen_cnt - $curr_cnt; + + $found_prop = max(pow($remain_slot / $max_gen_cnt, 5), 1 / $max_gen_cnt); + $found_npc = Util::randBool($found_prop); // 탐색 실패 - if(rand() % $criteria > 0) { + if(!$found_npc) { $exp = 100; $ded = 70; switch(Util::choiceRandomUsingWeight([$general['leader'], $general['power'], $general['intel']])) { @@ -354,7 +349,12 @@ function process_29(&$general) { $name = "{$name}{$count}"; } - if($nation['scout'] != 0) { + $gen_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc <= 2 AND nation = %i', $general['nation']); + $npc_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE 3 <= npc AND npc <= 4 AND nation = %i', $general['nation']); + + $join_prop = 0.3 + 0.7 * (($gen_cnt + $npc_cnt / 2) / $curr_cnt); + + if($nation['scout'] != 0 || !Util::randBool($join_prop)) { $scoutType = "발견"; $scoutLevel = 0; $scoutNation = 0; @@ -370,50 +370,34 @@ function process_29(&$general) { $alllog[] = "●{$admin['month']}월:{$general['name']}{$josaYi} $name{$josaRa}는 인재를 {$scoutType}하였습니다!"; pushGeneralHistory($general, "●{$admin['year']}년 {$admin['month']}월:$name{$josaRa}는 인재를 {$scoutType}"); - $query = "select max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0) as dex0, avg(dex10) as dex10, avg(dex20) as dex20, avg(dex30) as dex30, avg(dex40) as dex40 from general where nation='{$general['nation']}'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $avgGen = MYDB_fetch_array($result); + $avgGen = $db->queryFirstRow('SELECT max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0+dex10+dex20+dex30) * 1.5 / 4 as dex_t, avg(dex40) as dex40 from general where npc < 5 and nation = %i', $general['nation']); - // 체섭시 무장 20%, 지장 20%, 무지장 60% - // 마이너 무장 40%, 지장 40%, 무지장 20% - $type = rand() % 10; - if($admin['scenario'] < 100) { - switch($type) { - case 0: case 1: - $leader = GameConst::$defaultStatMax - 10 + rand()%11; - $intel = GameConst::$defaultStatMin + rand()%6; - $power = GameConst::$defaultStatTotal - $leader - $intel; - break; - case 2: case 3: - $leader = GameConst::$defaultStatMax - 10 + rand()%11; - $power = GameConst::$defaultStatMin + rand()%6; - $intel = GameConst::$defaultStatTotal - $leader - $power; - break; - case 4: case 5: case 6: case 7: case 8: case 9: - $leader = GameConst::$defaultStatMin + rand()%6; - $power = GameConst::$defaultStatMax - 10 + rand()%11; - $intel = GameConst::$defaultStatTotal - $leader - $power; - break; - } - } else { - switch($type) { - case 0: case 1: case 2: case 3: - $leader = GameConst::$defaultStatMax - 10 + rand()%11; - $intel = GameConst::$defaultStatMin + rand()%6; - $power = GameConst::$defaultStatTotal - $leader - $intel; - break; - case 4: case 5: case 6: case 7: - $leader = GameConst::$defaultStatMax - 10 + rand()%11; - $power = GameConst::$defaultStatMin + rand()%6; - $intel = GameConst::$defaultStatTotal - $leader - $power; - break; - case 8: case 9: - $leader = GameConst::$defaultStatMin + rand()%6; - $power = GameConst::$defaultStatMax - 10 + rand()%11; - $intel = GameConst::$defaultStatTotal - $leader - $power; - break; - } + //무장 40%, 지장 40%, 무지장 20% + $stat_tier1 = GameConst::$defaultStatMax - 10 + rand()%11; + $stat_tier3 = GameConst::$defaultStatMin + rand()%6; + $stat_tier2 = GameConst::$defaultStatTotal - $stat_tier1 - $stat_tier3; + switch(Util::choiceRandomUsingWeight([ + 'power'=>4, + 'intel'=>4, + 'neutral'=>2 + ])){ + case 'power': + $leader = $stat_tier1; + $power = $stat_tier2; + $intel = $stat_tier3; + break; + case 'intel': + $leader = $stat_tier1; + $power = $stat_tier3; + $intel = $stat_tier2; + break; + case 'neutral': + $leader = $stat_tier3; + $power = $stat_tier1; + $intel = $stat_tier2; + break; } + // 국내 최고능치 기준으로 랜덤성 스케일링 if($avgGen['lpi'] > 210) { $leader = Util::round($leader * $avgGen['lpi'] / GameConst::$defaultStatTotal * (60+rand()%31)/100); @@ -476,8 +460,8 @@ function process_29(&$general) { $specage2 = Util::round((80 - $age)/3) + $age; //$specage = $age + 1 + rand() % 3; //$specage2 = $age + 5 + rand() % 5; - // 10년 ~ 50년 - $killturn = rand()%480 + 120; + // 20년 ~ 50년 + $killturn = Util::randRangeInt(20, 50) * 12; @MYDB_query(" insert into general ( @@ -493,7 +477,7 @@ function process_29(&$general) { '$scoutLevel','100','100','0','".GameUnitConst::DEFAULT_CREWTYPE."','0','0','0', '0','0','0','$turntime','$killturn','$age','1','$personal','0','$specage','0','$specage2','', '0','$bornyear','$deadyear', - '{$avgGen['dex0']}','{$avgGen['dex10']}','{$avgGen['dex20']}','{$avgGen['dex30']}','{$avgGen['dex40']}' + '{$avgGen['dex_t']}','{$avgGen['dex_t']}','{$avgGen['dex_t']}','{$avgGen['dex_t']}','{$avgGen['dex40']}' )", $connect ) or Error(__LINE__.MYDB_error($connect),""); From 78da30f2ad33abecd916845f85c183bdff239e7e Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 00:33:14 +0900 Subject: [PATCH 14/34] =?UTF-8?q?m=EC=9E=A5=EC=9D=B4=20=EC=95=84=EC=A3=BC?= =?UTF-8?q?=20=EC=A0=81=EC=9D=84=EB=95=90=20=EC=9E=98=20=EB=BD=91=ED=9E=88?= =?UTF-8?q?=EB=8F=84=EB=A1=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_process_personnel.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hwe/func_process_personnel.php b/hwe/func_process_personnel.php index e445c7f1..eec0ddaf 100644 --- a/hwe/func_process_personnel.php +++ b/hwe/func_process_personnel.php @@ -312,9 +312,18 @@ function process_29(&$general) { $total_gen_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc <= 2'); $total_npc_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE 3 <= npc AND npc <= 4'); + $gen_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc <= 2 AND nation = %i', $general['nation']); + $npc_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE 3 <= npc AND npc <= 4 AND nation = %i', $general['nation']); + $curr_cnt = Util::toInt($total_gen_cnt + $total_npc_cnt / 2); $remain_slot = $max_gen_cnt - $curr_cnt; + if($npc_cnt < 2){ + $found_prop = 1 / ($npc_cnt + 1); + } + else{ + $found_prop = max(pow($remain_slot / $max_gen_cnt, 5), 1 / $max_gen_cnt); + } $found_prop = max(pow($remain_slot / $max_gen_cnt, 5), 1 / $max_gen_cnt); $found_npc = Util::randBool($found_prop); @@ -349,9 +358,6 @@ function process_29(&$general) { $name = "{$name}{$count}"; } - $gen_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc <= 2 AND nation = %i', $general['nation']); - $npc_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE 3 <= npc AND npc <= 4 AND nation = %i', $general['nation']); - $join_prop = 0.3 + 0.7 * (($gen_cnt + $npc_cnt / 2) / $curr_cnt); if($nation['scout'] != 0 || !Util::randBool($join_prop)) { From b7e432228b1e3f174fc86bb6159e1125c2c963b3 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 00:39:13 +0900 Subject: [PATCH 15/34] =?UTF-8?q?=EC=BB=A4=EB=B0=8B=20=EC=B7=A8=EC=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_process_personnel.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/hwe/func_process_personnel.php b/hwe/func_process_personnel.php index eec0ddaf..e445c7f1 100644 --- a/hwe/func_process_personnel.php +++ b/hwe/func_process_personnel.php @@ -312,18 +312,9 @@ function process_29(&$general) { $total_gen_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc <= 2'); $total_npc_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE 3 <= npc AND npc <= 4'); - $gen_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc <= 2 AND nation = %i', $general['nation']); - $npc_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE 3 <= npc AND npc <= 4 AND nation = %i', $general['nation']); - $curr_cnt = Util::toInt($total_gen_cnt + $total_npc_cnt / 2); $remain_slot = $max_gen_cnt - $curr_cnt; - if($npc_cnt < 2){ - $found_prop = 1 / ($npc_cnt + 1); - } - else{ - $found_prop = max(pow($remain_slot / $max_gen_cnt, 5), 1 / $max_gen_cnt); - } $found_prop = max(pow($remain_slot / $max_gen_cnt, 5), 1 / $max_gen_cnt); $found_npc = Util::randBool($found_prop); @@ -358,6 +349,9 @@ function process_29(&$general) { $name = "{$name}{$count}"; } + $gen_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc <= 2 AND nation = %i', $general['nation']); + $npc_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE 3 <= npc AND npc <= 4 AND nation = %i', $general['nation']); + $join_prop = 0.3 + 0.7 * (($gen_cnt + $npc_cnt / 2) / $curr_cnt); if($nation['scout'] != 0 || !Util::randBool($join_prop)) { From 9ad815a44ae14c7ab0da88898e972b2b449f7537 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 00:40:16 +0900 Subject: [PATCH 16/34] =?UTF-8?q?Revert=20"=EC=BB=A4=EB=B0=8B=20=EC=B7=A8?= =?UTF-8?q?=EC=86=8C"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0843da7a7c36f9cd3e1b0e24231fdd53d65afa4e. --- hwe/func_process_personnel.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hwe/func_process_personnel.php b/hwe/func_process_personnel.php index e445c7f1..eec0ddaf 100644 --- a/hwe/func_process_personnel.php +++ b/hwe/func_process_personnel.php @@ -312,9 +312,18 @@ function process_29(&$general) { $total_gen_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc <= 2'); $total_npc_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE 3 <= npc AND npc <= 4'); + $gen_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc <= 2 AND nation = %i', $general['nation']); + $npc_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE 3 <= npc AND npc <= 4 AND nation = %i', $general['nation']); + $curr_cnt = Util::toInt($total_gen_cnt + $total_npc_cnt / 2); $remain_slot = $max_gen_cnt - $curr_cnt; + if($npc_cnt < 2){ + $found_prop = 1 / ($npc_cnt + 1); + } + else{ + $found_prop = max(pow($remain_slot / $max_gen_cnt, 5), 1 / $max_gen_cnt); + } $found_prop = max(pow($remain_slot / $max_gen_cnt, 5), 1 / $max_gen_cnt); $found_npc = Util::randBool($found_prop); @@ -349,9 +358,6 @@ function process_29(&$general) { $name = "{$name}{$count}"; } - $gen_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc <= 2 AND nation = %i', $general['nation']); - $npc_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE 3 <= npc AND npc <= 4 AND nation = %i', $general['nation']); - $join_prop = 0.3 + 0.7 * (($gen_cnt + $npc_cnt / 2) / $curr_cnt); if($nation['scout'] != 0 || !Util::randBool($join_prop)) { From 9044b573066e0eaa298b7714dd3233d04cc76a13 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 00:41:38 +0900 Subject: [PATCH 17/34] =?UTF-8?q?=EC=98=81=EC=9E=85=20=EA=B8=88=EC=A7=80?= =?UTF-8?q?=EC=8B=9C=EC=97=90=EB=8A=94=20=EC=9D=B8=ED=83=90=20=ED=99=95?= =?UTF-8?q?=EB=A5=A0=20=EB=B3=B4=EC=A0=95=20=EC=97=86=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_process_personnel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hwe/func_process_personnel.php b/hwe/func_process_personnel.php index eec0ddaf..f714c506 100644 --- a/hwe/func_process_personnel.php +++ b/hwe/func_process_personnel.php @@ -318,7 +318,7 @@ function process_29(&$general) { $curr_cnt = Util::toInt($total_gen_cnt + $total_npc_cnt / 2); $remain_slot = $max_gen_cnt - $curr_cnt; - if($npc_cnt < 2){ + if($nation['scout'] == 0 && $npc_cnt < 2){ $found_prop = 1 / ($npc_cnt + 1); } else{ From 270c7377dee9147b244c411fceceec405aa5c5e0 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 00:59:16 +0900 Subject: [PATCH 18/34] =?UTF-8?q?=EC=82=AC=EB=A0=B9=ED=84=B4=20=EC=8B=A4?= =?UTF-8?q?=ED=96=89=ED=9B=84=20=EC=9E=AC=20=EB=A1=9C=EB=93=9C=EC=8B=9C=20?= =?UTF-8?q?=EC=88=98=EB=B9=84=20=EC=BC=AC=EB=81=94=20=EB=A6=AC=EC=85=8B=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hwe/func_command.php b/hwe/func_command.php index 7c7d3a16..82e5b968 100644 --- a/hwe/func_command.php +++ b/hwe/func_command.php @@ -538,7 +538,7 @@ function processCommand($no) { } //장수정보 재로드 - $query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,affinity,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40,warnum,killnum,deathnum,killcrew,deathcrew,recwar from general where no='$no'"; + $query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,affinity,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40,warnum,killnum,deathnum,killcrew,deathcrew,recwar,myset from general where no='$no'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $general = MYDB_fetch_array($result); } From ee9f97f9178b9567f17e68337adb57988fe29a48 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 01:05:47 +0900 Subject: [PATCH 19/34] =?UTF-8?q?m=EC=9E=A5=20=ED=95=A9=EC=82=B0=20?= =?UTF-8?q?=EB=8A=A5=EB=A0=A5=EC=B9=98=20=EB=B2=84=EA=B7=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_process_chief.php | 7 ++++--- hwe/func_process_personnel.php | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hwe/func_process_chief.php b/hwe/func_process_chief.php index 81637e6b..75571d92 100644 --- a/hwe/func_process_chief.php +++ b/hwe/func_process_chief.php @@ -1978,11 +1978,12 @@ function process_76(&$general) { $stat_tier1 = GameConst::$defaultStatMax - 10 + rand()%11; $stat_tier3 = GameConst::$defaultStatMin + rand()%6; $stat_tier2 = GameConst::$defaultStatTotal - $stat_tier1 - $stat_tier3; - switch(Util::choiceRandomUsingWeight([ + $type = Util::choiceRandomUsingWeight([ 'power'=>4, 'intel'=>4, 'neutral'=>2 - ])){ + ]); + switch($type){ case 'power': $leader = $stat_tier1; $power = $stat_tier2; @@ -2030,7 +2031,7 @@ function process_76(&$general) { $intel -= $over3; } // 낮은 능치쪽으로 합산 - if($type == 0) { + if($type == 'power') { $intel = $intel + $over1 + $over2 + $over3; } else { $power = $power + $over1 + $over2 + $over3; diff --git a/hwe/func_process_personnel.php b/hwe/func_process_personnel.php index f714c506..22e579d8 100644 --- a/hwe/func_process_personnel.php +++ b/hwe/func_process_personnel.php @@ -382,11 +382,12 @@ function process_29(&$general) { $stat_tier1 = GameConst::$defaultStatMax - 10 + rand()%11; $stat_tier3 = GameConst::$defaultStatMin + rand()%6; $stat_tier2 = GameConst::$defaultStatTotal - $stat_tier1 - $stat_tier3; - switch(Util::choiceRandomUsingWeight([ + $type = Util::choiceRandomUsingWeight([ 'power'=>4, 'intel'=>4, 'neutral'=>2 - ])){ + ]); + switch($type){ case 'power': $leader = $stat_tier1; $power = $stat_tier2; @@ -435,7 +436,7 @@ function process_29(&$general) { $intel -= $over3; } // 낮은 능치쪽으로 합산 - if($type == 0) { + if($type == 'power') { $intel = $intel + $over1 + $over2 + $over3; } else { $power = $power + $over1 + $over2 + $over3; From a3c4da4455e0a26c3f2dd2db43d947498374f036 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 01:57:51 +0900 Subject: [PATCH 20/34] =?UTF-8?q?=EC=9D=98=EB=B3=91=EA=B3=A0=EC=9A=A9=20?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_process_chief.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hwe/func_process_chief.php b/hwe/func_process_chief.php index 75571d92..7c318e4e 100644 --- a/hwe/func_process_chief.php +++ b/hwe/func_process_chief.php @@ -1968,7 +1968,7 @@ function process_76(&$general) { $avgNation = MYDB_fetch_array($result); $gencount = 5 + Util::round($avgNation['gennum'] / 10); - $avgGen = $db->queryFirstRow('SELECT max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0+dex10+dex20+dex30) * 1.5 / 4 as dex_t, avg(dex40) as dex40 from general where npc < 5 and nation = %i', $general['nation']); + $avgGen = $db->queryFirstRow('SELECT max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0+dex10+dex20+dex30) * 1.5 / 4 as dex_t, avg(age) as age, avg(dex40) as dex40 from general where npc < 5 and nation = %i', $general['nation']); //의병추가 $npc = 4; From d5689b061f8a8be0ed524f5f57a2e47f60a3b05f Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 01:59:41 +0900 Subject: [PATCH 21/34] =?UTF-8?q?=EC=9D=98=EB=B3=91=20=EA=B3=A0=EC=9A=A9?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=EB=8A=94=20=EB=AC=B4=EC=A7=80=EC=9E=A5?= =?UTF-8?q?=EC=9D=B4=20=EC=95=88=EB=82=98=EC=98=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_process_chief.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hwe/func_process_chief.php b/hwe/func_process_chief.php index 7c318e4e..f090ad06 100644 --- a/hwe/func_process_chief.php +++ b/hwe/func_process_chief.php @@ -1974,14 +1974,14 @@ function process_76(&$general) { $npc = 4; $npcid = $admin['npccount']; for($i=0; $i < $gencount; $i++) { - //무장 40%, 지장 40%, 무지장 20% + //무장 50%, 지장 50%, 무지장 0% $stat_tier1 = GameConst::$defaultStatMax - 10 + rand()%11; $stat_tier3 = GameConst::$defaultStatMin + rand()%6; $stat_tier2 = GameConst::$defaultStatTotal - $stat_tier1 - $stat_tier3; $type = Util::choiceRandomUsingWeight([ - 'power'=>4, - 'intel'=>4, - 'neutral'=>2 + 'power'=>5, + 'intel'=>5, + 'neutral'=>0 ]); switch($type){ case 'power': From 86ee9befc13a8c6d1232489e77060e3772cbb292 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 02:26:50 +0900 Subject: [PATCH 22/34] =?UTF-8?q?=EC=BB=A4=EB=A7=A8=EB=93=9C=20=EB=B2=84?= =?UTF-8?q?=EA=B7=B8=20=EC=88=98=EC=A0=95=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hwe/func.php b/hwe/func.php index 4a2a613f..822b13d6 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -468,20 +468,20 @@ function addCommand($typename, $value, $valid = 1, $color=0) { switch($color) { case 0: echo " - "; + "; break; case 1: echo " - "; + "; break; case 2: echo " - "; + "; break; } } else { echo " - "; + "; } } From d31223fa0c9557599e5fe06fbf6957ecac5553ee Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 02:30:12 +0900 Subject: [PATCH 23/34] =?UTF-8?q?=EC=BB=A4=EB=A7=A8=EB=93=9C=20attr=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/processing.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/hwe/processing.php b/hwe/processing.php index 169d1d84..40260b15 100644 --- a/hwe/processing.php +++ b/hwe/processing.php @@ -495,7 +495,7 @@ function command_22($turn, $command) { } foreach(getAllNationStaticInfo() as $nation){ - echo ""; + echo ""; $query = "select no,name,npc from general where nation='{$nation['nation']}' and level!='12' and npc<2 order by npc,binary(name)"; $genresult = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); @@ -1506,9 +1506,9 @@ function command_51($turn, $command) { $nation = MYDB_fetch_array($result); if($myNation['power'] <= $nation['power'] * 3 || !isNeighbor($me['nation'], $nation['nation'])) { - echo ""; + echo ""; } else { - echo ""; + echo ""; } } echo " @@ -1559,7 +1559,7 @@ function command_52($turn, $command) { foreach(getAllNationStaticInfo() as $nation) { - echo ""; + echo ""; } echo " @@ -1650,9 +1650,9 @@ function command_53($turn, $command) { $nation = MYDB_fetch_array($result); if(($myNation['power']+$nation['power'])/2 > $cond1 || ($myNation['gennum']+$nation['gennum'])/2 > $cond2 || !isNeighbor($me['nation'], $nation['nation'])) { - echo ""; + echo ""; } else { - echo ""; + echo ""; } } @@ -1768,7 +1768,7 @@ function command_61($turn, $command) { case 6: $color = "red"; break; case 7: $color = "blue"; break; } - echo ""; + echo ""; } echo " @@ -1860,7 +1860,7 @@ function command_62($turn, $command) { case 6: $color = "black"; break; case 7: $color = "blue"; break; } - echo ""; + echo ""; } echo " @@ -1921,7 +1921,7 @@ function command_63($turn, $command) { case 6: $color = "red"; break; case 7: $color = "red"; break; } - echo ""; + echo ""; } echo " @@ -1982,7 +1982,7 @@ function command_64($turn, $command) { case 6: $color = "red"; break; case 7: $color = "blue"; break; } - echo ""; + echo ""; } echo " @@ -2330,7 +2330,7 @@ function command_75($turn, $command) { case 6: $color = "red"; break; case 7: $color = "blue"; break; } - echo ""; + echo ""; } echo " @@ -2392,7 +2392,7 @@ function command_77($turn, $command) { case 6: $color = "red"; break; case 7: $color = "blue"; break; } - echo ""; + echo ""; } echo " @@ -2454,7 +2454,7 @@ function command_78($turn, $command) { case 6: $color = "red"; break; case 7: $color = "blue"; break; } - echo ""; + echo ""; } echo " From 0be6f7f57e5ed3391c96a9e2104a7f343b2af6d6 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 03:43:15 +0900 Subject: [PATCH 24/34] =?UTF-8?q?=EC=98=A4=ED=83=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_process_personnel.php | 1 - 1 file changed, 1 deletion(-) diff --git a/hwe/func_process_personnel.php b/hwe/func_process_personnel.php index 22e579d8..14eb6954 100644 --- a/hwe/func_process_personnel.php +++ b/hwe/func_process_personnel.php @@ -324,7 +324,6 @@ function process_29(&$general) { else{ $found_prop = max(pow($remain_slot / $max_gen_cnt, 5), 1 / $max_gen_cnt); } - $found_prop = max(pow($remain_slot / $max_gen_cnt, 5), 1 / $max_gen_cnt); $found_npc = Util::randBool($found_prop); // 탐색 실패 From 760cb97db4f4e791e2d08a4cf6b27ab32019d910 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 06:12:26 +0900 Subject: [PATCH 25/34] =?UTF-8?q?=EC=9D=B8=ED=83=90=20=EA=B0=80=EC=86=8D?= =?UTF-8?q?=20=EC=A1=B0=EA=B1=B4=20=EA=B0=95=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_process_personnel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hwe/func_process_personnel.php b/hwe/func_process_personnel.php index 14eb6954..17a39c80 100644 --- a/hwe/func_process_personnel.php +++ b/hwe/func_process_personnel.php @@ -318,7 +318,7 @@ function process_29(&$general) { $curr_cnt = Util::toInt($total_gen_cnt + $total_npc_cnt / 2); $remain_slot = $max_gen_cnt - $curr_cnt; - if($nation['scout'] == 0 && $npc_cnt < 2){ + if($total_npc_cnt < 20 && $nation['scout'] == 0 && $npc_cnt < 2){ $found_prop = 1 / ($npc_cnt + 1); } else{ From 4e3c643e4347d042ec7d71740fe2e1e3d781d013 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 13:45:29 +0900 Subject: [PATCH 26/34] =?UTF-8?q?=EC=8B=9C=EB=82=98=EB=A6=AC=EC=98=A4=20?= =?UTF-8?q?=EC=B5=9C=EB=8C=80=20=EC=9E=A5=EC=88=98=EA=B0=92=20=EC=A1=B0?= =?UTF-8?q?=EC=A0=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/scenario/scenario_1010.json | 3 +++ hwe/scenario/scenario_1020.json | 3 +++ hwe/scenario/scenario_1030.json | 3 +++ hwe/scenario/scenario_1040.json | 3 +++ hwe/scenario/scenario_1050.json | 3 +++ hwe/scenario/scenario_1060.json | 3 +++ hwe/scenario/scenario_1070.json | 3 +++ hwe/scenario/scenario_1080.json | 3 +++ hwe/scenario/scenario_1090.json | 3 +++ hwe/scenario/scenario_1100.json | 3 +++ hwe/scenario/scenario_1110.json | 3 +++ hwe/scenario/scenario_1120.json | 3 +++ hwe/scenario/scenario_2010.json | 3 +++ hwe/scenario/scenario_2011.json | 3 +++ hwe/scenario/scenario_2012.json | 3 +++ hwe/scenario/scenario_2020.json | 3 +++ hwe/scenario/scenario_2040.json | 3 +++ hwe/scenario/scenario_2080.json | 3 +++ hwe/scenario/scenario_2100.json | 3 +++ hwe/scenario/scenario_2101.json | 3 +++ hwe/scenario/scenario_2102.json | 3 +++ hwe/scenario/scenario_2110.json | 3 +++ hwe/scenario/scenario_2120.json | 3 +++ hwe/scenario/scenario_2160.json | 3 +++ hwe/scenario/scenario_2171.json | 3 +++ hwe/scenario/scenario_2180.json | 3 +++ 26 files changed, 78 insertions(+) diff --git a/hwe/scenario/scenario_1010.json b/hwe/scenario/scenario_1010.json index 833e6379..ccab99e7 100644 --- a/hwe/scenario/scenario_1010.json +++ b/hwe/scenario/scenario_1010.json @@ -3,6 +3,9 @@ "startYear":181, "life":1, "fiction":0, + "const":{ + "defaultMaxGeneral":600 + }, "nation":[ ["후한", "#800000", 10000, 10000, "후한왕조", 1500, "유가", 7,[ "낙양","계","역경","진양","남피","호관","호로","사곡","함곡","사수","하내","장안","홍농","완" diff --git a/hwe/scenario/scenario_1020.json b/hwe/scenario/scenario_1020.json index 16b3738a..4400f021 100644 --- a/hwe/scenario/scenario_1020.json +++ b/hwe/scenario/scenario_1020.json @@ -3,6 +3,9 @@ "startYear":187, "life":1, "fiction":0, + "const":{ + "defaultMaxGeneral":600 + }, "nation":[ ["동탁", "#A9A9A9", 10000, 10000, "천하 권력을 노리는 동탁", 1500, "법가", 5, [ "낙양", "사곡", "함곡", "호로", "호관", "사수", "안정", "장안", "홍농" diff --git a/hwe/scenario/scenario_1030.json b/hwe/scenario/scenario_1030.json index 31beb5f2..41f27c2c 100644 --- a/hwe/scenario/scenario_1030.json +++ b/hwe/scenario/scenario_1030.json @@ -3,6 +3,9 @@ "startYear":191, "life":1, "fiction":0, + "const":{ + "defaultMaxGeneral":600 + }, "nation":[ ["조조", "#000080", 100000, 100000, "여포에게 본거지를 빼앗긴 위기의 조조", 1000, "병가", 2, [ "진류", "정도" diff --git a/hwe/scenario/scenario_1040.json b/hwe/scenario/scenario_1040.json index 8408fc18..6c0c7442 100644 --- a/hwe/scenario/scenario_1040.json +++ b/hwe/scenario/scenario_1040.json @@ -3,6 +3,9 @@ "startYear":193, "life":1, "fiction":0, + "const":{ + "defaultMaxGeneral":600 + }, "nation":[ ["조조", "#000080", 10000, 10000, "황제를 등에 업고 본격적으로 성장하는 조조", 1000, "병가", 4, [ "허창", "호로", "낙양", "진류", "복양" diff --git a/hwe/scenario/scenario_1050.json b/hwe/scenario/scenario_1050.json index 184d7670..1192ccd1 100644 --- a/hwe/scenario/scenario_1050.json +++ b/hwe/scenario/scenario_1050.json @@ -3,6 +3,9 @@ "startYear":197, "life":1, "fiction":0, + "const":{ + "defaultMaxGeneral":600 + }, "nation":[ ["조조", "#000080", 10000, 10000, "원소와의 운명의 한판을 준비하는 조조", 1000, "병가", 5, [ "허창", "호로", "사곡", "함곡", "사수", "정도", "서주", "장안", "홍농", "낙양", "진류", "패", "완" diff --git a/hwe/scenario/scenario_1060.json b/hwe/scenario/scenario_1060.json index b65c9645..e083b0b3 100644 --- a/hwe/scenario/scenario_1060.json +++ b/hwe/scenario/scenario_1060.json @@ -3,6 +3,9 @@ "startYear":199, "life":1, "fiction":0, + "const":{ + "defaultMaxGeneral":600 + }, "nation":[ ["조조", "#000080", 10000, 10000, "관도대전에 승리하고 승리를 굳히려는 조조", 1000, "병가", 5, [ "허창", "호로", "사곡", "함곡", "사수", "관도", "정도", "복양", "장안", "홍농", "낙양", "진류", "패", "초", "완", "여남" diff --git a/hwe/scenario/scenario_1070.json b/hwe/scenario/scenario_1070.json index 4d074e28..dab03dd0 100644 --- a/hwe/scenario/scenario_1070.json +++ b/hwe/scenario/scenario_1070.json @@ -3,6 +3,9 @@ "startYear":204, "life":1, "fiction":0, + "const":{ + "defaultMaxGeneral":600 + }, "nation":[ ["조조", "#000080", 10000, 10000, "하북을 제패하고 대군을 이끌고 남하하는 조조", 1000, "병가", 6, [ "허창", "역경", "계교", "관도", "호관", "정도", "호로", "사곡", "함곡", "사수", "서주", "계", diff --git a/hwe/scenario/scenario_1080.json b/hwe/scenario/scenario_1080.json index 3d5ce369..283e15f4 100644 --- a/hwe/scenario/scenario_1080.json +++ b/hwe/scenario/scenario_1080.json @@ -3,6 +3,9 @@ "startYear":210, "life":1, "fiction":0, + "const":{ + "defaultMaxGeneral":600 + }, "nation":[ ["조조", "#000080", 10000, 10000, "강남 정벌에 실패한 뒤 한중을 노리는 조조", 1000, "병가", 6, [ "허창", "역경", "계교", "관도", "정도", "서주", "호관", "호로", "사곡", "함곡", "사수", "계", diff --git a/hwe/scenario/scenario_1090.json b/hwe/scenario/scenario_1090.json index 8bee3452..27a4f6b1 100644 --- a/hwe/scenario/scenario_1090.json +++ b/hwe/scenario/scenario_1090.json @@ -3,6 +3,9 @@ "startYear":216, "life":1, "fiction":0, + "const":{ + "defaultMaxGeneral":600 + }, "nation":[ ["조조", "#000080", 10000, 10000, "한중을 잃고 퇴각한 조조", 1000, "병가", 6, [ "허창", "합비", "광릉", "역경", "계교", "관도", "정도", "서주", "호관", "호로", "사곡", diff --git a/hwe/scenario/scenario_1100.json b/hwe/scenario/scenario_1100.json index beac190b..4e070efc 100644 --- a/hwe/scenario/scenario_1100.json +++ b/hwe/scenario/scenario_1100.json @@ -3,6 +3,9 @@ "startYear":222, "life":1, "fiction":0, + "const":{ + "defaultMaxGeneral":600 + }, "nation":[ ["조비", "#000080", 10000, 10000, "정권을 안정시킨 조비", 1000, "병가", 6, [ "허창", "합비", "광릉", "역경", "계교", "관도", "정도", "서주", "호관", "호로", "사곡", diff --git a/hwe/scenario/scenario_1110.json b/hwe/scenario/scenario_1110.json index 46b5072b..c6438dd0 100644 --- a/hwe/scenario/scenario_1110.json +++ b/hwe/scenario/scenario_1110.json @@ -3,6 +3,9 @@ "startYear":225, "life":1, "fiction":0, + "const":{ + "defaultMaxGeneral":600 + }, "nation":[ ["조예", "#000080", 10000, 10000, "제갈량의 북벌에 맞서 사마의를 내세운 조예", 1000, "병가", 6, [ "허창", "기산", "합비", "광릉", "역경", "계교", "관도", "정도", "서주", "호관", "호로", "사곡", diff --git a/hwe/scenario/scenario_1120.json b/hwe/scenario/scenario_1120.json index e5d99440..0af49db7 100644 --- a/hwe/scenario/scenario_1120.json +++ b/hwe/scenario/scenario_1120.json @@ -3,6 +3,9 @@ "startYear":188, "life":1, "fiction":0, + "const":{ + "defaultMaxGeneral":600 + }, "nation":[ ["원소", "#FFFF00", 10000, 10000, "4세 5공 명문 혈통 기주 패자 원소", 1000, "법가", 2, [ "업", "복양", "진류", "관도", "정도" diff --git a/hwe/scenario/scenario_2010.json b/hwe/scenario/scenario_2010.json index 74e1addf..bac73f8d 100644 --- a/hwe/scenario/scenario_2010.json +++ b/hwe/scenario/scenario_2010.json @@ -6,6 +6,9 @@ ], "diplomacy":[ ], + "const":{ + "defaultMaxGeneral":800 + }, "general":[ [ 1, "소제1",1001, 0, null, 20, 11, 48, 0, 160, 300, "유지", null], [ 1, "헌제",1002, 0, null, 17, 13, 61, 0, 160, 300, "안전", null], diff --git a/hwe/scenario/scenario_2011.json b/hwe/scenario/scenario_2011.json index c4a07db5..a2a109a6 100644 --- a/hwe/scenario/scenario_2011.json +++ b/hwe/scenario/scenario_2011.json @@ -12,6 +12,9 @@ "max":95, "npcMax":95 }, + "const":{ + "defaultMaxGeneral":800 + }, "general":[ [ 1, "소제1",1001, 0, null, 20, 11, 48, 0, 160, 300, "유지", null], [ 1, "헌제",1002, 0, null, 17, 13, 61, 0, 160, 300, "안전", null], diff --git a/hwe/scenario/scenario_2012.json b/hwe/scenario/scenario_2012.json index c0504f9f..2ab93028 100644 --- a/hwe/scenario/scenario_2012.json +++ b/hwe/scenario/scenario_2012.json @@ -15,6 +15,9 @@ "map":{ "mapName":"miniche" }, + "const":{ + "defaultMaxGeneral":800 + }, "general":[ [ 1, "소제1",1001, 0, null, 20, 11, 48, 0, 160, 300, "유지", null], [ 1, "헌제",1002, 0, null, 17, 13, 61, 0, 160, 300, "안전", null], diff --git a/hwe/scenario/scenario_2020.json b/hwe/scenario/scenario_2020.json index 83bfe607..8280816e 100644 --- a/hwe/scenario/scenario_2020.json +++ b/hwe/scenario/scenario_2020.json @@ -15,6 +15,9 @@ ], "diplomacy":[ ], + "const":{ + "defaultMaxGeneral":800 + }, "general":[ [ 1, "소제1",1001, 0, null, 20, 11, 48, 0, 160, 300, "유지", null], [ 1, "헌제",1002, 0, null, 17, 13, 61, 0, 160, 300, "안전", null], diff --git a/hwe/scenario/scenario_2040.json b/hwe/scenario/scenario_2040.json index 9980a030..6a298f87 100644 --- a/hwe/scenario/scenario_2040.json +++ b/hwe/scenario/scenario_2040.json @@ -6,6 +6,9 @@ ], "diplomacy":[ ], + "const":{ + "defaultMaxGeneral":600 + }, "general":[ [ 1, "소제1",1001, 0, null, 20, 11, 48, 0, 168, 190, "유지",null], [ 1, "헌제",1002, 0, null, 17, 13, 61, 0, 170, 250, "안전",null], diff --git a/hwe/scenario/scenario_2080.json b/hwe/scenario/scenario_2080.json index e890f5a9..e8f61cc2 100644 --- a/hwe/scenario/scenario_2080.json +++ b/hwe/scenario/scenario_2080.json @@ -6,6 +6,9 @@ ], "diplomacy":[ ], + "const":{ + "defaultMaxGeneral":600 + }, "general":[ [ 25, "이수만",9009, 0, null, 81, 20, 74, 0, 160, 300, null, null, "SM이 갑이제"], [ 25, "강타", -1, 0, null, 83, 61, 66, 0, 160, 300, null, null], diff --git a/hwe/scenario/scenario_2100.json b/hwe/scenario/scenario_2100.json index cdba9b91..5b135bfb 100644 --- a/hwe/scenario/scenario_2100.json +++ b/hwe/scenario/scenario_2100.json @@ -10,6 +10,9 @@ "npcMax":65, "chiefMin":55 }, + "const":{ + "defaultMaxGeneral":700 + }, "general":[ [ 1, "소제1", 1001, 0, null, 18, 7, 48, 0, 160, 300, "유지", null], [ 1, "헌제", 1002, 0, null, 15, 7, 61, 0, 160, 300, "안전", null], diff --git a/hwe/scenario/scenario_2101.json b/hwe/scenario/scenario_2101.json index 419ca6e8..f2bfdc9e 100644 --- a/hwe/scenario/scenario_2101.json +++ b/hwe/scenario/scenario_2101.json @@ -13,6 +13,9 @@ "npcMax":65, "chiefMin":55 }, + "const":{ + "defaultMaxGeneral":700 + }, "general":[ [ 1, "소제1", 1001, 0, null, 18, 7, 48, 0, 160, 300, "유지", null], [ 1, "헌제", 1002, 0, null, 15, 7, 61, 0, 160, 300, "안전", null], diff --git a/hwe/scenario/scenario_2102.json b/hwe/scenario/scenario_2102.json index d7a9ce2a..8257dbe7 100644 --- a/hwe/scenario/scenario_2102.json +++ b/hwe/scenario/scenario_2102.json @@ -16,6 +16,9 @@ "map":{ "mapName":"miniche" }, + "const":{ + "defaultMaxGeneral":700 + }, "general":[ [ 1, "소제1", 1001, 0, null, 18, 7, 48, 0, 160, 300, "유지", null], [ 1, "헌제", 1002, 0, null, 15, 7, 61, 0, 160, 300, "안전", null], diff --git a/hwe/scenario/scenario_2110.json b/hwe/scenario/scenario_2110.json index 88479ff7..e67a1692 100644 --- a/hwe/scenario/scenario_2110.json +++ b/hwe/scenario/scenario_2110.json @@ -12,6 +12,9 @@ "max":95, "npcMax":95 }, + "const":{ + "defaultMaxGeneral":600 + }, "general":[ [0, "김일융", null, 0, null, 88, 83, 79, 0, 160, 300, null, null], [0, "이승엽", null, 0, null, 90, 108, 37, 0, 160, 300, null, "위압", "안녕하세요 국민타자 이승엽입니다."], diff --git a/hwe/scenario/scenario_2120.json b/hwe/scenario/scenario_2120.json index 5b391259..f3b6b602 100644 --- a/hwe/scenario/scenario_2120.json +++ b/hwe/scenario/scenario_2120.json @@ -12,6 +12,9 @@ "max":95, "npcMax":95 }, + "const":{ + "defaultMaxGeneral":800 + }, "general":[ [0, "가규", -1, 0, null, 78, 61, 84, 0, 160, 250, null, null], [0, "가범", -1, 0, null, 60, 62, 73, 0, 160, 250, null, null], diff --git a/hwe/scenario/scenario_2160.json b/hwe/scenario/scenario_2160.json index 4b201a13..4e99c9b6 100644 --- a/hwe/scenario/scenario_2160.json +++ b/hwe/scenario/scenario_2160.json @@ -11,6 +11,9 @@ "min": 40, "max": 90 }, + "const":{ + "defaultMaxGeneral":1000 + }, "iconPath": ".", "fiction": 1, "nation":[ diff --git a/hwe/scenario/scenario_2171.json b/hwe/scenario/scenario_2171.json index 37547ed8..19f143b0 100644 --- a/hwe/scenario/scenario_2171.json +++ b/hwe/scenario/scenario_2171.json @@ -11,6 +11,9 @@ "min": 50, "max": 105 }, + "const":{ + "defaultMaxGeneral":700 + }, "iconPath": "루드라사움", "fiction": 0, "nation":[ diff --git a/hwe/scenario/scenario_2180.json b/hwe/scenario/scenario_2180.json index dfd4e183..c1d8c0a8 100644 --- a/hwe/scenario/scenario_2180.json +++ b/hwe/scenario/scenario_2180.json @@ -19,6 +19,9 @@ "mapName":"ludo_rathowm", "unitSet":"ludo_rathowm" }, + "const":{ + "defaultMaxGeneral":900 + }, "diplomacy":[], "general":[ [0, "아회남", null, 0, null, 65, 74, 26, 0, 160, 300, null, null], From 355b6c2e7d186c674ffa18ff6f7bbab680135486 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 16:23:47 +0900 Subject: [PATCH 27/34] =?UTF-8?q?=EC=9D=B8=ED=83=90=20=ED=99=95=EB=A5=A0?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_process_personnel.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hwe/func_process_personnel.php b/hwe/func_process_personnel.php index 17a39c80..e8eb7b28 100644 --- a/hwe/func_process_personnel.php +++ b/hwe/func_process_personnel.php @@ -318,11 +318,15 @@ function process_29(&$general) { $curr_cnt = Util::toInt($total_gen_cnt + $total_npc_cnt / 2); $remain_slot = $max_gen_cnt - $curr_cnt; - if($total_npc_cnt < 20 && $nation['scout'] == 0 && $npc_cnt < 2){ - $found_prop = 1 / ($npc_cnt + 1); + $found_prop_main = pow($remain_slot / $max_gen_cnt, 6); + $found_prop_small = 1 / ($total_npc_cnt / 3 + 1); + $found_prop_big = 1 / $max_gen_cnt; + + if($total_npc_cnt < 30){ + $found_prop = max($found_prop_main, $found_prop_small); } else{ - $found_prop = max(pow($remain_slot / $max_gen_cnt, 5), 1 / $max_gen_cnt); + $found_prop = max($found_prop_main, $found_prop_big); } $found_npc = Util::randBool($found_prop); From 3362a76de7bcb4a3200f798a9aae101b9093fa45 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 16:41:41 +0900 Subject: [PATCH 28/34] =?UTF-8?q?=EA=B0=92=20=EC=8B=A4=EC=88=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_process_personnel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hwe/func_process_personnel.php b/hwe/func_process_personnel.php index e8eb7b28..ac427339 100644 --- a/hwe/func_process_personnel.php +++ b/hwe/func_process_personnel.php @@ -322,7 +322,7 @@ function process_29(&$general) { $found_prop_small = 1 / ($total_npc_cnt / 3 + 1); $found_prop_big = 1 / $max_gen_cnt; - if($total_npc_cnt < 30){ + if($total_npc_cnt < 50){ $found_prop = max($found_prop_main, $found_prop_small); } else{ From 0abd026f78e6da4e2cd8577f270e64dbdb11beb0 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 16:50:31 +0900 Subject: [PATCH 29/34] =?UTF-8?q?=EC=9D=B8=ED=83=90,=20=EC=9D=98=EB=B3=91?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EB=B0=9C=EC=83=9D=ED=95=A0=20=EC=88=98=20?= =?UTF-8?q?=EC=9E=88=EB=8A=94=20=EC=88=99=EB=A0=A8=20=EC=98=88=EC=99=B8=20?= =?UTF-8?q?=EC=BC=80=EC=9D=B4=EC=8A=A4=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_process_chief.php | 2 +- hwe/func_process_personnel.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hwe/func_process_chief.php b/hwe/func_process_chief.php index f090ad06..bbac1110 100644 --- a/hwe/func_process_chief.php +++ b/hwe/func_process_chief.php @@ -1968,7 +1968,7 @@ function process_76(&$general) { $avgNation = MYDB_fetch_array($result); $gencount = 5 + Util::round($avgNation['gennum'] / 10); - $avgGen = $db->queryFirstRow('SELECT max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0+dex10+dex20+dex30) * 1.5 / 4 as dex_t, avg(age) as age, avg(dex40) as dex40 from general where npc < 5 and nation = %i', $general['nation']); + $avgGen = $db->queryFirstRow('SELECT max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0+dex10+dex20+dex30) / 4 as dex_t, avg(age) as age, avg(dex40) as dex40 from general where npc < 5 and nation = %i', $general['nation']); //의병추가 $npc = 4; diff --git a/hwe/func_process_personnel.php b/hwe/func_process_personnel.php index ac427339..de6769ac 100644 --- a/hwe/func_process_personnel.php +++ b/hwe/func_process_personnel.php @@ -379,7 +379,7 @@ function process_29(&$general) { $alllog[] = "●{$admin['month']}월:{$general['name']}{$josaYi} $name{$josaRa}는 인재를 {$scoutType}하였습니다!"; pushGeneralHistory($general, "●{$admin['year']}년 {$admin['month']}월:$name{$josaRa}는 인재를 {$scoutType}"); - $avgGen = $db->queryFirstRow('SELECT max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0+dex10+dex20+dex30) * 1.5 / 4 as dex_t, avg(dex40) as dex40 from general where npc < 5 and nation = %i', $general['nation']); + $avgGen = $db->queryFirstRow('SELECT max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0+dex10+dex20+dex30) / 4 as dex_t, avg(dex40) as dex40 from general where npc < 5 and nation = %i', $general['nation']); //무장 40%, 지장 40%, 무지장 20% $stat_tier1 = GameConst::$defaultStatMax - 10 + rand()%11; From bfae547240968201e836f62975c243e20e65ef43 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 9 Mar 2019 17:08:11 +0900 Subject: [PATCH 30/34] =?UTF-8?q?=EC=9D=80=ED=87=B4=20=EC=97=B0=EB=A0=B9?= =?UTF-8?q?=20=EA=B0=92=EC=9D=84=20GameConst=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func.php | 6 +++--- hwe/func_process_personnel.php | 4 ++-- hwe/join_post.php | 4 ++-- hwe/sammo/GameConstBase.php | 1 + 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hwe/func.php b/hwe/func.php index 822b13d6..c1042744 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -910,8 +910,8 @@ function generalInfo($no) { if($nation['color'] == "") { $nation['color'] = "#000000"; } - if($general['age'] < 60) { $general['age'] = "{$general['age']} 세"; } - elseif($general['age'] < 80) { $general['age'] = "{$general['age']} 세"; } + if($general['age'] < GameConst::$retirementYear*0.75) { $general['age'] = "{$general['age']} 세"; } + elseif($general['age'] < GameConst::$retirementYear) { $general['age'] = "{$general['age']} 세"; } else { $general['age'] = "{$general['age']} 세"; } $general['connect'] = Util::round($general['connect'] / 10) * 10; @@ -2078,7 +2078,7 @@ function updateTurntime($no) { } } - if($general['age'] >= 80 && $general['npc'] == 0) { + if($general['age'] >= GameConst::$retirementYear && $general['npc'] == 0) { if($admin['isunited'] == 0) { CheckHall($no); } diff --git a/hwe/func_process_personnel.php b/hwe/func_process_personnel.php index de6769ac..cc8fcead 100644 --- a/hwe/func_process_personnel.php +++ b/hwe/func_process_personnel.php @@ -466,8 +466,8 @@ function process_29(&$general) { $bornyear = $admin['year']; $deadyear = $admin['year'] + 3; $age = 20; - $specage = Util::round((80 - $age)/12) + $age; - $specage2 = Util::round((80 - $age)/3) + $age; + $specage = Util::round((GameConst::$retirementYear - $age)/12) + $age; + $specage2 = Util::round((GameConst::$retirementYear - $age)/3) + $age; //$specage = $age + 1 + rand() % 3; //$specage2 = $age + 5 + rand() % 5; // 20년 ~ 50년 diff --git a/hwe/join_post.php b/hwe/join_post.php index c02132d9..2452534c 100644 --- a/hwe/join_post.php +++ b/hwe/join_post.php @@ -162,11 +162,11 @@ if ($genius) { $specage2 = $age; $special2 = getSpecial2($leader, $power, $intel); } else { - $specage2 = Util::valueFit(Util::round((80 - $age)/4 - $relYear / 2), 3) + $age; + $specage2 = Util::valueFit(Util::round((GameConst::$retirementYear - $age)/4 - $relYear / 2), 3) + $age; $special2 = 0; } //내특 -$specage = Util::valueFit(Util::round((80 - $age)/12 - $relYear / 2), 3) + $age; +$specage = Util::valueFit(Util::round((GameConst::$retirementYear - $age)/12 - $relYear / 2), 3) + $age; $special = 0; if ($admin['scenario'] >= 1000) { diff --git a/hwe/sammo/GameConstBase.php b/hwe/sammo/GameConstBase.php index 3a8dc3ce..33e6fab2 100644 --- a/hwe/sammo/GameConstBase.php +++ b/hwe/sammo/GameConstBase.php @@ -93,4 +93,5 @@ class GameConstBase public static $maxTurn = 24; public static $statGradeLevel = 5; + public static $retirementYear = 80; } From 8b27d0e249db69f9643b0bbe8170988a967d5d7a Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 10 Mar 2019 00:47:13 +0900 Subject: [PATCH 31/34] =?UTF-8?q?=EB=B6=88=EA=B0=80=EC=B9=A8=20=EC=84=9C?= =?UTF-8?q?=EC=8B=A0=20=EA=B1=B0=EB=B6=80=20=EB=B6=88=EA=B0=80=EB=8A=A5?= =?UTF-8?q?=ED=95=9C=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/DiplomaticMessage.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hwe/sammo/DiplomaticMessage.php b/hwe/sammo/DiplomaticMessage.php index 2bb69009..5bae6d63 100644 --- a/hwe/sammo/DiplomaticMessage.php +++ b/hwe/sammo/DiplomaticMessage.php @@ -67,7 +67,7 @@ class DiplomaticMessage extends Message{ $permission = checkSecretPermission($general, false); if(!$general || $permission < 4){ - return [self::INVALID, '해당 국가의 외교권자 아닙니다.']; + return [self::INVALID, '해당 국가의 외교권자가 아닙니다.']; } return [self::ACCEPTED, '']; @@ -273,7 +273,7 @@ class DiplomaticMessage extends Message{ $gameStor = KVStorage::getStorage($db, 'game_env'); $general = $db->queryFirstRow( - 'SELECT `name`, nation, `level`, `permission`, `penalty` FROM general WHERE `no`=%i AND nation=%i', + 'SELECT `name`, nation, `level`, `permission`, `penalty`,belong FROM general WHERE `no`=%i AND nation=%i', $receiverID, $this->dest->nationID ); @@ -378,7 +378,7 @@ class DiplomaticMessage extends Message{ $db = DB::db(); $general = $db->queryFirstRow( - 'SELECT `name`, `level` FROM general WHERE `no`=%i AND nation=%i', + 'SELECT `name`, nation, `level`, `permission`, `penalty`,belong FROM general WHERE `no`=%i AND nation=%i', $receiverID, $this->dest->nationID ); From 82988b0e086bfd0c336ce249ecc448e94d0fa9a7 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 10 Mar 2019 14:19:29 +0900 Subject: [PATCH 32/34] =?UTF-8?q?=EC=9E=A5=EC=82=AC-=EC=98=81=EB=A6=89?= =?UTF-8?q?=EC=9D=B4=20=EC=9D=B4=EC=96=B4=EC=A7=84=EA=B1=B8=EB=A1=9C=20?= =?UTF-8?q?=EB=82=98=EC=98=A4=EB=8A=94=20=EC=9D=BC=EB=B0=98=EC=A7=80?= =?UTF-8?q?=EB=8F=84=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/CityConstBase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hwe/sammo/CityConstBase.php b/hwe/sammo/CityConstBase.php index 742f5a19..c7673351 100644 --- a/hwe/sammo/CityConstBase.php +++ b/hwe/sammo/CityConstBase.php @@ -70,7 +70,7 @@ class CityConstBase{ [11, '수춘', '대', 5143, 99, 96, 80, 99, 95, '중원', 395, 270, ['서주', '여남', '초', '합비']], [12, '서주', '대', 4853,101, 98, 80,102, 97, '중원', 440, 250, ['수춘', '하비', '초', '패']], [13, '강릉', '대', 4850,105, 96, 80, 95, 96, '초', 245, 335, ['장사', '무릉', '이릉', '장판']], - [14, '장사', '대', 4710, 97, 99, 80,100,105, '초', 255, 375, ['강릉', '시상', '계양', '무릉', '영릉']], + [14, '장사', '대', 4710, 97, 99, 80,100,105, '초', 255, 375, ['강릉', '시상', '계양', '무릉']], [15, '시상', '대', 5252, 98,100,100, 99, 96, '오월', 360, 360, ['장사', '여강', '고창', '적벽', '파양']], [16, '위례', '대', 4926,100, 93, 80, 98,103, '동이', 620, 145, ['평양', '사비', '계림', '안평', '동황']], [17, '계', '중', 3885, 75, 80, 60, 78, 81, '하북', 365, 35, ['진양', '역경']], @@ -110,7 +110,7 @@ class CityConstBase{ [51, '신야', '소', 2786, 60, 62, 40, 58, 55, '초', 250, 260, ['양양', '완', '상용']], [52, '강하', '소', 3074, 55, 56, 40, 57, 60, '초', 315, 295, ['장판', '적벽']], [53, '무릉', '소', 3196, 58, 63, 40, 63, 58, '초', 195, 355, ['강릉', '장사', '영릉']], - [54, '영릉', '소', 2849, 62, 58, 40, 62, 62, '초', 190, 395, ['장사', '계양', '남영', '무릉']], + [54, '영릉', '소', 2849, 62, 58, 40, 62, 62, '초', 190, 395, ['계양', '남영', '무릉']], [55, '상동', '소', 2767, 58, 59, 40, 62, 58, '초', 210, 435, ['남해', '계양', '고창']], [56, '여강', '소', 2905, 56, 58, 40, 60, 55, '오월', 380, 315, ['시상', '합비', '적벽', '파양']], [57, '회계', '소', 3005, 64, 59, 40, 62, 64, '오월', 480, 395, ['오', '산월']], From 306ca3e04f55eff4b87973fdfcb14fdd13001ba4 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 10 Mar 2019 17:19:35 +0900 Subject: [PATCH 33/34] =?UTF-8?q?=EC=A0=90=EB=A0=B9=20=EC=8B=9C=20?= =?UTF-8?q?=EB=8F=84=EC=8B=9C=20=EA=B4=80=EC=A7=81=20=EC=B4=88=EA=B8=B0?= =?UTF-8?q?=ED=99=94.=20=EC=BD=94=EB=93=9C=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/process_war.php | 90 +++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 49 deletions(-) diff --git a/hwe/process_war.php b/hwe/process_war.php index 4c7c7626..92cff6e4 100644 --- a/hwe/process_war.php +++ b/hwe/process_war.php @@ -705,59 +705,47 @@ function ConquerCity($admin, $general, $city, $nation, $destnation) { $conquerNation = getConquerNation($city); - if($conquerNation == $general['nation']) { + if ($conquerNation == $general['nation']) { // 이동 - $query = "update general set city='{$city['city']}' where no='{$general['no']}'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - if($city['level'] > 3) { - // 도시 소속 변경, 태수,군사,종사 초기화 - $query = "update city set supply=1,conflict='{}',term=0,agri=agri*0.7,comm=comm*0.7,secu=secu*0.7,def=1000,wall=1000,nation='{$general['nation']}',gen1=0,gen2=0,gen3=0 where city='{$city['city']}'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - } else { - // 도시 소속 변경, 태수,군사,종사 초기화 - $query = "update city set supply=1,conflict='{}',term=0,agri=agri*0.7,comm=comm*0.7,secu=secu*0.7,def=def2/2,wall=wall2/2,nation='{$general['nation']}',gen1=0,gen2=0,gen3=0 where city='{$city['city']}'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - } - //전방설정 - SetNationFront($nation['nation']); - SetNationFront($destnation['nation']); - } else { - $query = "select name,nation from nation where nation='$conquerNation'"; - $conquerResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $conquerNationArray = MYDB_fetch_array($conquerResult); + $db->update('general', [ + 'city'=>$city['city'] + ], 'no=%i', $general['no']); + } + else{ + $conquerNationName = $db->queryFirstField('SELECT `name` FROM nation WHERE nation=%i', $conquerNation); $josaUl = JosaUtil::pick($city['name'], '을'); - $josaYi = JosaUtil::pick($conquerNationArray['name'], '이'); - $history[] = "●{$year}년 {$month}월:【분쟁협상】{$conquerNationArray['name']}{$josaYi} 영토분쟁에서 우위를 점하여 {$city['name']}{$josaUl} 양도받았습니다."; - pushNationHistory($nation, "●{$year}년 {$month}월:{$city['name']}{$josaUl} {$conquerNationArray['name']}양도"); - pushNationHistory($conquerNationArray, "●{$year}년 {$month}월:{$nation['name']}에서 {$city['name']}{$josaUl} 양도 받음"); - - $query = [ - 'supply'=>1, - 'term'=>0, - 'conflict'=>'{}', - 'agri'=>$db->sqleval('agri*0.7'), - 'comm'=>$db->sqleval('comm*0.7'), - 'secu'=>$db->sqleval('secu*0.7'), - 'nation'=>$conquerNation, - 'gen1'=>0, - 'gen2'=>0, - 'gen3'=>0 - ]; - if($city['level'] > 3) { - $query['def'] = 1000; - $query['wall'] = 1000; - } else { - // 도시 소속 변경, 태수,군사,종사 초기화 - $query['def'] = $db->sqleval('def2/2'); - $query['wall'] = $db->sqleval('wall2/2'); - } - $db->update('city', $query, 'city=%i', (int)$city['city']); - //전방설정 - SetNationFront($destnation['nation']); - SetNationFront($conquerNation); + $josaYi = JosaUtil::pick($conquerNationName, '이'); + $history[] = "●{$year}년 {$month}월:【분쟁협상】{$conquerNationName}{$josaYi} 영토분쟁에서 우위를 점하여 {$city['name']}{$josaUl} 양도받았습니다."; + pushNationHistory($nation, "●{$year}년 {$month}월:{$city['name']}{$josaUl} {$conquerNationName}양도"); + pushNationHistory(['nation'=>$conquerNation], "●{$year}년 {$month}월:{$nation['name']}에서 {$city['name']}{$josaUl} 양도 받음"); } - + + $query = [ + 'supply'=>1, + 'term'=>0, + 'conflict'=>'{}', + 'agri'=>$db->sqleval('agri*0.7'), + 'comm'=>$db->sqleval('comm*0.7'), + 'secu'=>$db->sqleval('secu*0.7'), + 'nation'=>$conquerNation, + 'gen1'=>0, + 'gen2'=>0, + 'gen3'=>0, + 'gen1set'=>0, + 'gen2set'=>0, + 'gen3set'=>0 + ]; + if($city['level'] > 3) { + $query['def'] = 1000; + $query['wall'] = 1000; + } else { + $query['def'] = $db->sqleval('def2/2'); + $query['wall'] = $db->sqleval('wall2/2'); + } + + $db->update('city', $query, 'city=%i', (int)$city['city']); + //전방설정 if($renewFront){ foreach(getAllNationStaticInfo() as $nation){ if($nation['level'] <= 0){ @@ -766,6 +754,10 @@ function ConquerCity($admin, $general, $city, $nation, $destnation) { SetNationFront($nation['nation']); } } + else{ + SetNationFront($destnation['nation']); + SetNationFront($conquerNation); + } pushGenLog($general, $log); pushGeneralPublicRecord($alllog, $year, $month); From a7784d7870875ecf902b6cc28f8f7220bf1f0dd5 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 10 Mar 2019 17:20:44 +0900 Subject: [PATCH 34/34] =?UTF-8?q?=EC=A7=80=EC=97=B0=20threshold=20?= =?UTF-8?q?=EC=A6=9D=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hwe/func.php b/hwe/func.php index c1042744..6d8aad66 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -1442,10 +1442,10 @@ function checkDelay() { $threshold = 1; } else if($term >= 10){ - $threshold = 2; + $threshold = 3; } else{ - $threshold = 3; + $threshold = 6; } //지연 해야할 밀린 턴 횟수 $iter = intdiv($timeMinDiff, $term);