diff --git a/hwe/_119_b.php b/hwe/_119_b.php index c3297b61..841b0409 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 "분지연": diff --git a/hwe/a_bestGeneral.php b/hwe/a_bestGeneral.php index b2ec9438..9e598898 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']; @@ -60,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'] = '???'; @@ -166,7 +175,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 +188,8 @@ $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['owner_name'] = $ownerNameList[$general['owner']]??null; $general = ($typeFunc)($general); $value = $general['value']; 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/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/css/map.css b/hwe/css/map.css index bb82e79a..44ff4fb9 100644 --- a/hwe/css/map.css +++ b/hwe/css/map.css @@ -63,6 +63,7 @@ position:absolute; right:0; bottom:0; + text-align:right; } .map_body .map_toggle_cityname::after{ @@ -73,6 +74,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/func.php b/hwe/func.php index 802fd745..da1abffb 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -464,20 +464,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 " - "; + "; } } @@ -707,8 +707,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; @@ -1232,10 +1232,10 @@ function checkDelay() { $threshold = 1; } else if($term >= 10){ - $threshold = 2; + $threshold = 3; } else{ - $threshold = 3; + $threshold = 6; } //지연 해야할 밀린 턴 횟수 $iter = intdiv($timeMinDiff, $term); @@ -1438,6 +1438,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) { @@ -1467,7 +1472,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, diff --git a/hwe/func_process_chief.php b/hwe/func_process_chief.php index 580b36ed..1a55e87f 100644 --- a/hwe/func_process_chief.php +++ b/hwe/func_process_chief.php @@ -1472,31 +1472,36 @@ function process_76(&$general) { $avgGenNum = $db->queryFirstField('SELECT avg(gennum) FROM nation'); $addGenCount = 5 + Util::round($avgGenNum / 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) / 4 as dex_t, avg(age) as age, avg(dex40) as dex40 from general where npc < 5 and nation = %i', $general['nation']); //의병추가 $npc = 4; $npcid = Util::randRangeInt(0, 9999999); for($i=0; $i < $addGenCount; $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; + //무장 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'=>5, + 'intel'=>5, + 'neutral'=>0 + ]); + switch($type){ + 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; } // 국내 최고능치 기준으로 랜덤성 스케일링 @@ -1530,7 +1535,7 @@ function process_76(&$general) { $intel -= $over3; } // 낮은 능치쪽으로 합산 - if($type == 0) { + if($type == 'power') { $intel = $intel + $over1 + $over2 + $over3; } else { $power = $power + $over1 + $over2 + $over3; @@ -1569,7 +1574,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.old.php b/hwe/func_process_personnel.old.php index b3335805..29bbf2ce 100644 --- a/hwe/func_process_personnel.old.php +++ b/hwe/func_process_personnel.old.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; @@ -274,7 +284,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),""); @@ -290,25 +300,32 @@ 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'); + + $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; + + $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 < 50){ + $found_prop = max($found_prop_main, $found_prop_small); + } + else{ + $found_prop = max($found_prop_main, $found_prop_big); + } + $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']])) { @@ -338,7 +355,9 @@ function process_29(&$general) { $name = "{$name}{$count}"; } - if($nation['scout'] != 0) { + $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; @@ -354,50 +373,35 @@ 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) / 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; + $type = Util::choiceRandomUsingWeight([ + 'power'=>4, + 'intel'=>4, + 'neutral'=>2 + ]); + switch($type){ + 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); @@ -429,7 +433,7 @@ function process_29(&$general) { $intel -= $over3; } // 낮은 능치쪽으로 합산 - if($type == 0) { + if($type == 'power') { $intel = $intel + $over1 + $over2 + $over3; } else { $power = $power + $over1 + $over2 + $over3; @@ -456,57 +460,31 @@ 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; - // 10년 ~ 50년 - $killturn = rand()%480 + 120; + // 20년 ~ 50년 + $killturn = Util::randRangeInt(20, 50) * 12; - $db->insert('general', [ - 'npcid'=>$npccount, - 'npc'=>$npc, - 'npc_org'=>$npc, - 'affinity'=>$affinity, - 'name'=>$name, - 'picture'=>$picture, - 'nation'=>$scoutNation, - 'city'=>$general['city'], - 'leader'=>$leader, - 'power'=>$power, - 'intel'=>$intel, - 'experience'=>$experience, - 'dedication'=>$dedication, - 'level'=>$scoutLevel, - 'gold'=>100, - 'rice'=>100, - 'crew'=>0, - 'crewtype'=>GameUnitConst::DEFAULT_CREWTYPE, - 'train'=>0, - 'atmos'=>0, - 'tnmt'=>0, - 'weap'=>0, - 'book'=>0, - 'horse'=>0, - 'turntime'=>$turntime, - 'killturn'=>$killturn, - 'age'=>$age, - 'belong'=>1, - 'personal'=>$personal, - 'special'=>0, - 'specage'=>$specage, - 'special2'=>0, - 'specage2'=>$specage2, - 'npcmsg'=>'', - 'makelimit'=>0, - 'bornyear'=>$bornyear, - 'deadyear'=>$deadyear, - 'dex0'=>$avgGen['dex0'], - 'dex10'=>$avgGen['dex10'], - 'dex20'=>$avgGen['dex20'], - 'dex30'=>$avgGen['dex30'], - 'dex40'=>$avgGen['dex40'], - ]); + @MYDB_query(" + insert into general ( + npcid,npc,npc_org,affinity,name,picture,nation, + city,leader,power,intel,experience,dedication, + level,gold,rice,crew,crewtype,train,atmos,tnmt, + weap,book,horse,turntime,killturn,age,belong,personal,special,specage,special2,specage2,npcmsg, + makelimit,bornyear,deadyear, + dex0, dex10, dex20, dex30, dex40 + ) values ( + '$npccount','$npc','$npc','$affinity','$name','$picture','$scoutNation', + '{$general['city']}','$leader','$power','$intel','{$avgGen['exp']}','{$avgGen['ded']}', + '$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['dex_t']}','{$avgGen['dex_t']}','{$avgGen['dex_t']}','{$avgGen['dex_t']}','{$avgGen['dex40']}' + )", + $connect + ) or Error(__LINE__.MYDB_error($connect),""); $npcid++; diff --git a/hwe/func_tournament.php b/hwe/func_tournament.php index 2cae8179..911a1b0f 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) { @@ -279,12 +281,24 @@ function startTournament($auto, $type) { ], true); $db->query('TRUNCATE TABLE tournament'); + $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/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'); //로그인 검사 diff --git a/hwe/join_post.php b/hwe/join_post.php index 4287ff0a..2256baf9 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 = GameConst::$defaultSpecialDomestic; if ($admin['scenario'] >= 1000) { 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/process_war.php b/hwe/process_war.php index cc4c347f..62b57584 100644 --- a/hwe/process_war.php +++ b/hwe/process_war.php @@ -210,7 +210,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; } @@ -697,59 +697,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){ @@ -758,6 +746,10 @@ function ConquerCity($admin, $general, $city, $nation, $destnation) { SetNationFront($nation['nation']); } } + else{ + SetNationFront($destnation['nation']); + SetNationFront($conquerNation); + } pushGenLog($general, $log); pushGeneralPublicRecord($alllog, $year, $month); diff --git a/hwe/processing.php b/hwe/processing.php index 7073dbc5..e8c88ee2 100644 --- a/hwe/processing.php +++ b/hwe/processing.php @@ -490,7 +490,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),""); @@ -1492,9 +1492,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 " @@ -1545,7 +1545,7 @@ function command_52($turn, $command) { foreach(getAllNationStaticInfo() as $nation) { - echo ""; + echo ""; } echo " @@ -1636,9 +1636,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 ""; } } @@ -1754,7 +1754,7 @@ function command_61($turn, $command) { case 6: $color = "red"; break; case 7: $color = "blue"; break; } - echo ""; + echo ""; } echo " @@ -1846,7 +1846,7 @@ function command_62($turn, $command) { case 6: $color = "black"; break; case 7: $color = "blue"; break; } - echo ""; + echo ""; } echo " @@ -1907,7 +1907,7 @@ function command_63($turn, $command) { case 6: $color = "red"; break; case 7: $color = "red"; break; } - echo ""; + echo ""; } echo " @@ -1968,7 +1968,7 @@ function command_64($turn, $command) { case 6: $color = "red"; break; case 7: $color = "blue"; break; } - echo ""; + echo ""; } echo " @@ -2316,7 +2316,7 @@ function command_75($turn, $command) { case 6: $color = "red"; break; case 7: $color = "blue"; break; } - echo ""; + echo ""; } echo " @@ -2378,7 +2378,7 @@ function command_77($turn, $command) { case 6: $color = "red"; break; case 7: $color = "blue"; break; } - echo ""; + echo ""; } echo " @@ -2440,7 +2440,7 @@ function command_78($turn, $command) { case 6: $color = "red"; break; case 7: $color = "blue"; break; } - echo ""; + echo ""; } echo " diff --git a/hwe/sammo/CityConstBase.php b/hwe/sammo/CityConstBase.php index 38ab1ebe..4b99bdf1 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, ['오', '산월']], 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 ); diff --git a/hwe/sammo/GameConstBase.php b/hwe/sammo/GameConstBase.php index 0ee1f7ce..d0766d65 100644 --- a/hwe/sammo/GameConstBase.php +++ b/hwe/sammo/GameConstBase.php @@ -242,4 +242,5 @@ class GameConstBase //'che_국기변경' ] ]; + public static $retirementYear = 80; } diff --git a/hwe/sammo/ResetHelper.php b/hwe/sammo/ResetHelper.php index 9ee7beb4..4f91139b 100644 --- a/hwe/sammo/ResetHelper.php +++ b/hwe/sammo/ResetHelper.php @@ -165,6 +165,8 @@ class ResetHelper{ 'locktime'=>TimeUtil::now(true) ]); + $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){ diff --git a/hwe/sammo/TurnExecutionHelper.php b/hwe/sammo/TurnExecutionHelper.php index 4403e1ac..9ac20787 100644 --- a/hwe/sammo/TurnExecutionHelper.php +++ b/hwe/sammo/TurnExecutionHelper.php @@ -271,6 +271,7 @@ WHERE turntime < %s ORDER BY turntime ASC, `no` ASC', pullGeneralCommand($general->getID()); $currentTurn = $general->getVar('turntime'); + $general->increaseVarWithLimit('myset', 1, null, 3); $turnObj->updateTurnTime(); $turnObj->applyDB(); diff --git a/hwe/scenario/scenario_1010.json b/hwe/scenario/scenario_1010.json index c1e1e220..6f59e4be 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 8a163f97..4cc5d17c 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 09dde46d..10b6ee0f 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 ae8de94f..19007acf 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 57648539..0be720fd 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 a622cda2..21105369 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 599e0f33..bf7b8f08 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 697d5697..68648e9b 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 65e9d5b1..a4df9928 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 9f171f70..45a157af 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 f2dd1ad0..01fedf0c 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 b7752870..908d8d91 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], 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 @@

+