From baba2d34dda5393acb13fd89c239332aa9e54de4 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 28 Mar 2020 19:43:40 +0900 Subject: [PATCH] =?UTF-8?q?VAL2=EB=A5=BC=20VAL=5Fmax=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/_admin5.php | 18 +++++----- hwe/b_currentCity.php | 14 ++++---- hwe/b_myCityInfo.php | 16 ++++----- hwe/b_myKingdomInfo.php | 2 +- hwe/func.php | 8 ++--- hwe/func_gamerule.php | 8 ++--- hwe/func_process_chief.php | 30 ++++++++-------- hwe/func_time_event.php | 40 ++++++++++----------- hwe/j_simulate_battle.php | 8 ++--- hwe/js/battle_simulator.js | 22 ++++++------ hwe/process_war.php | 6 ++-- hwe/sammo/CityConstBase.php | 12 +++---- hwe/sammo/Command/General/che_강행.php | 2 +- hwe/sammo/Command/General/che_견문.php | 6 ++-- hwe/sammo/Command/General/che_군량매매.php | 6 ++-- hwe/sammo/Command/General/che_귀환.php | 2 +- hwe/sammo/Command/General/che_기술연구.php | 2 +- hwe/sammo/Command/General/che_단련.php | 6 ++-- hwe/sammo/Command/General/che_등용.php | 2 +- hwe/sammo/Command/General/che_물자조달.php | 6 ++-- hwe/sammo/Command/General/che_사기진작.php | 2 +- hwe/sammo/Command/General/che_상업투자.php | 4 +-- hwe/sammo/Command/General/che_이동.php | 2 +- hwe/sammo/Command/General/che_인재탐색.php | 12 +++---- hwe/sammo/Command/General/che_전투태세.php | 2 +- hwe/sammo/Command/General/che_정착장려.php | 4 +-- hwe/sammo/Command/General/che_주민선정.php | 2 +- hwe/sammo/Command/General/che_증여.php | 2 +- hwe/sammo/Command/General/che_집합.php | 2 +- hwe/sammo/Command/General/che_징병.php | 2 +- hwe/sammo/Command/General/che_첩보.php | 2 +- hwe/sammo/Command/General/che_헌납.php | 2 +- hwe/sammo/Command/General/che_화계.php | 6 ++-- hwe/sammo/Command/General/che_훈련.php | 2 +- hwe/sammo/Command/Nation/che_백성동원.php | 4 +-- hwe/sammo/Constraint/RemainCityCapacity.php | 2 +- hwe/sammo/Constraint/ReqCityCapacity.php | 2 +- hwe/sammo/Constraint/ReqDestNationValue.php | 2 +- hwe/sammo/Constraint/ReqGeneralValue.php | 2 +- hwe/sammo/Constraint/ReqNationValue.php | 2 +- hwe/sammo/Event/Action/ChangeCity.php | 2 +- hwe/sammo/General.php | 4 +-- hwe/sammo/GeneralAI.php | 20 +++++------ hwe/sammo/WarUnitGeneral.php | 6 ++-- hwe/sql/schema.sql | 18 +++++----- hwe/templates/mainCityInfo.php | 24 ++++++------- 46 files changed, 175 insertions(+), 175 deletions(-) diff --git a/hwe/_admin5.php b/hwe/_admin5.php index 6bf358fe..7156e04d 100644 --- a/hwe/_admin5.php +++ b/hwe/_admin5.php @@ -210,14 +210,14 @@ for($i=0; $i < $nationCount; $i++) { $gen = MYDB_fetch_array($genResult); $query = "select COUNT(*) as cnt, - SUM(pop) as pop, SUM(pop2) as pop2, - ROUND(SUM(pop)/SUM(pop2)*100, 2) as rate, + SUM(pop) as pop, SUM(pop_max) as pop_max, + ROUND(SUM(pop)/SUM(pop_max)*100, 2) as rate, trust, - ROUND(SUM(agri)/SUM(agri2)*100, 2) as agri, - ROUND(SUM(comm)/SUM(comm2)*100, 2) as comm, - ROUND(SUM(secu)/SUM(secu2)*100, 2) as secu, - ROUND(SUM(wall)/SUM(wall2)*100, 2) as wall, - ROUND(SUM(def)/SUM(def2)*100, 2) as def + ROUND(SUM(agri)/SUM(agri_max)*100, 2) as agri, + ROUND(SUM(comm)/SUM(comm_max)*100, 2) as comm, + ROUND(SUM(secu)/SUM(secu_max)*100, 2) as secu, + ROUND(SUM(wall)/SUM(wall_max)*100, 2) as wall, + ROUND(SUM(def)/SUM(def_max)*100, 2) as def from city where nation='{$nation['nation']}'"; $cityResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $city = MYDB_fetch_array($cityResult); @@ -246,8 +246,8 @@ for($i=0; $i < $nationCount; $i++) {  {$nation['dex30']}   {$nation['dex40']}   {$gen['crew']}/{$gen['leadership']}00  -  {$city['pop']}/{$city['pop2']}  -  ".sprintf('%.1f',$city['pop']/$city['pop2']*100)."%  +  {$city['pop']}/{$city['pop_max']}  +  ".sprintf('%.1f',$city['pop']/$city['pop_max']*100)."%   {$city['agri']}%   {$city['comm']}%   {$city['secu']}%  diff --git a/hwe/b_currentCity.php b/hwe/b_currentCity.php index f8f21e9a..54414bf0 100644 --- a/hwe/b_currentCity.php +++ b/hwe/b_currentCity.php @@ -416,17 +416,17 @@ foreach($generalsFormat as $general){ 주민 - / + / 농업 - / + / 상업 - / + / 치안 - / + / 수비 - / + / 성벽 - / + / 민심 @@ -434,7 +434,7 @@ foreach($generalsFormat as $general){ 시세 % 인구 - % + % 태수 군사 diff --git a/hwe/b_myCityInfo.php b/hwe/b_myCityInfo.php index 024a709c..41bbbd3f 100644 --- a/hwe/b_myCityInfo.php +++ b/hwe/b_myCityInfo.php @@ -75,7 +75,7 @@ $sel = [$type => "selected"]; $nation = getNationStaticInfo($me['nation']); //국가정보 -$query = "select *,pop/pop2 as poprate from city where nation='{$me['nation']}'"; +$query = "select *,pop/pop_max as poprate from city where nation='{$me['nation']}'"; switch ($type) { case 1: break; @@ -144,17 +144,17 @@ for ($j=0; $j < $citycount; $j++) { 주민 - {$city['pop']}/{$city['pop2']} + {$city['pop']}/{$city['pop_max']} 농업 - {$city['agri']}/{$city['agri2']} + {$city['agri']}/{$city['agri_max']} 상업 - {$city['comm']}/{$city['comm2']} + {$city['comm']}/{$city['comm_max']} 치안 - {$city['secu']}/{$city['secu2']} + {$city['secu']}/{$city['secu_max']} 수비 - {$city['def']}/{$city['def2']} + {$city['def']}/{$city['def_max']} 성벽 - {$city['wall']}/{$city['wall2']} + {$city['wall']}/{$city['wall_max']} 민심 @@ -162,7 +162,7 @@ for ($j=0; $j < $citycount; $j++) { 시세 {$city['trade']}% 인구 - ".round($city['pop']/$city['pop2']*100, 2)." % + ".round($city['pop']/$city['pop_max']*100, 2)." % 태수 "; echo $officerName[4]; diff --git a/hwe/b_myKingdomInfo.php b/hwe/b_myKingdomInfo.php index 536dc0c5..a0787052 100644 --- a/hwe/b_myKingdomInfo.php +++ b/hwe/b_myKingdomInfo.php @@ -52,7 +52,7 @@ $cityNames = []; foreach($cityList as $city){ $currPop += $city['pop']; - $maxPop += $city['pop2']; + $maxPop += $city['pop_max']; if($city['city'] == $nation['capital']){ $cityNames[] = "{$city['name']}"; } diff --git a/hwe/func.php b/hwe/func.php index ef9fd43f..54e41007 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -196,7 +196,7 @@ function myNationInfo() { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $nation = MYDB_fetch_array($result); - $query = "select COUNT(*) as cnt, SUM(pop) as totpop, SUM(pop2) as maxpop from city where nation='{$nation['nation']}'"; // 도시 이름 목록 + $query = "select COUNT(*) as cnt, SUM(pop) as totpop, SUM(pop_max) as maxpop from city where nation='{$nation['nation']}'"; // 도시 이름 목록 $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $city = MYDB_fetch_array($result); @@ -726,13 +726,13 @@ function generalInfo(General $generalObj) { 통솔  {$color}{$leadership}{$lbonus}  - ".bar(expStatus($generalObj->getVar('leadership2')), 20)." + ".bar(expStatus($generalObj->getVar('leadership_max')), 20)." 무력  {$color}{$strength}  - ".bar(expStatus($generalObj->getVar('strength2')), 20)." + ".bar(expStatus($generalObj->getVar('strength_max')), 20)." 지력  {$color}{$intel}  - ".bar(expStatus($generalObj->getVar('intel2')), 20)." + ".bar(expStatus($generalObj->getVar('intel_max')), 20)." 명마 diff --git a/hwe/func_gamerule.php b/hwe/func_gamerule.php index 46a936da..f1bfe2ca 100644 --- a/hwe/func_gamerule.php +++ b/hwe/func_gamerule.php @@ -405,7 +405,7 @@ function postUpdateMonthly() { +A.tech +if(A.level=0,0,( select round( - sum(pop)*sum(pop+agri+comm+secu+wall+def)/sum(pop2+agri2+comm2+secu2+wall2+def2)/100 + sum(pop)*sum(pop+agri+comm+secu+wall+def)/sum(pop_max+agri_max+comm_max+secu_max+wall_max+def_max)/100 ) from city where nation=A.nation and supply=1 )) +(select sum(leadership+strength+intel) from general where nation=A.nation) @@ -1054,7 +1054,7 @@ function checkStatistic() { ); $nationCityInfos = Util::convertArrayToDict( - $db->query('SELECT nation, count(*) as cnt, sum(pop) as pop,sum(pop2) as pop2 from city GROUP BY nation'), + $db->query('SELECT nation, count(*) as cnt, sum(pop) as pop,sum(pop_max) as pop_max from city GROUP BY nation'), 'nation' ); @@ -1066,7 +1066,7 @@ function checkStatistic() { $nation['cityInfo'] = $city; $nationName .= $nation['name'].'('.getNationType($nation['type']).'), '; - $powerHist .= "{$nation['name']}({$nation['power']}/{$nation['gennum']}/{$city['cnt']}/{$city['pop']}/{$city['pop2']}/{$nation['goldrice']}/{$general['goldrice']}/{$general['abil']}/{$general['dex']}/{$general['expded']}), "; + $powerHist .= "{$nation['name']}({$nation['power']}/{$nation['gennum']}/{$city['cnt']}/{$city['pop']}/{$city['pop_max']}/{$nation['goldrice']}/{$general['goldrice']}/{$general['abil']}/{$general['dex']}/{$general['expded']}), "; if(!isset($nationHists[$nation['type']])){ $nationHists[$nation['type']] = 0; @@ -1253,7 +1253,7 @@ function checkEmperior() { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $nation = MYDB_fetch_array($result); - $query = "select SUM(pop) as totalpop,SUM(pop2) as maxpop from city where nation='{$nation['nation']}'"; // 도시 이름 목록 + $query = "select SUM(pop) as totalpop,SUM(pop_max) as maxpop from city where nation='{$nation['nation']}'"; // 도시 이름 목록 $cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $city = MYDB_fetch_array($cityresult); $pop = "{$city['totalpop']} / {$city['maxpop']}"; diff --git a/hwe/func_process_chief.php b/hwe/func_process_chief.php index fd6dcdc8..1d3847e3 100644 --- a/hwe/func_process_chief.php +++ b/hwe/func_process_chief.php @@ -658,12 +658,12 @@ function process_67(&$general) { $db->update('city', [ 'upgrading'=>$db->sqleval('upgrading+1'), 'level'=>$db->sqleval('level+1'), - 'pop2'=>$db->sqleval('pop2 + %i', GameConst::$expandCityPopIncreaseAmount), - 'agri2'=>$db->sqleval('agri2 + %i', GameConst::$expandCityDevelIncreaseAmount), - 'comm2'=>$db->sqleval('comm2 + %i', GameConst::$expandCityDevelIncreaseAmount), - 'secu2'=>$db->sqleval('secu2 + %i', GameConst::$expandCityDevelIncreaseAmount), - 'def2'=>$db->sqleval('def2 + %i', GameConst::$expandCityWallIncreaseAmount), - 'wall2'=>$db->sqleval('wall2 + %i', GameConst::$expandCityWallIncreaseAmount), + 'pop_max'=>$db->sqleval('pop_max + %i', GameConst::$expandCityPopIncreaseAmount), + 'agri_max'=>$db->sqleval('agri_max + %i', GameConst::$expandCityDevelIncreaseAmount), + 'comm_max'=>$db->sqleval('comm_max + %i', GameConst::$expandCityDevelIncreaseAmount), + 'secu_max'=>$db->sqleval('secu_max + %i', GameConst::$expandCityDevelIncreaseAmount), + 'def_max'=>$db->sqleval('def_max + %i', GameConst::$expandCityWallIncreaseAmount), + 'wall_max'=>$db->sqleval('wall_max + %i', GameConst::$expandCityWallIncreaseAmount), ], 'city=%i', $destcity['city']); //경험치, 공헌치 @@ -772,12 +772,12 @@ function process_68(&$general) { $db->update('city', [ 'upgrading'=>$db->sqleval('upgrading-1'), 'level'=>$db->sqleval('level-1'), - 'pop2'=>$db->sqleval('pop2 - %i', GameConst::$expandCityPopIncreaseAmount), - 'agri2'=>$db->sqleval('agri2 - %i', GameConst::$expandCityDevelIncreaseAmount), - 'comm2'=>$db->sqleval('comm2 - %i', GameConst::$expandCityDevelIncreaseAmount), - 'secu2'=>$db->sqleval('secu2 - %i', GameConst::$expandCityDevelIncreaseAmount), - 'def2'=>$db->sqleval('def2 - %i', GameConst::$expandCityWallIncreaseAmount), - 'wall2'=>$db->sqleval('wall2 - %i', GameConst::$expandCityWallIncreaseAmount), + 'pop_max'=>$db->sqleval('pop_max - %i', GameConst::$expandCityPopIncreaseAmount), + 'agri_max'=>$db->sqleval('agri_max - %i', GameConst::$expandCityDevelIncreaseAmount), + 'comm_max'=>$db->sqleval('comm_max - %i', GameConst::$expandCityDevelIncreaseAmount), + 'secu_max'=>$db->sqleval('secu_max - %i', GameConst::$expandCityDevelIncreaseAmount), + 'def_max'=>$db->sqleval('def_max - %i', GameConst::$expandCityWallIncreaseAmount), + 'wall_max'=>$db->sqleval('wall_max - %i', GameConst::$expandCityWallIncreaseAmount), 'pop'=>$pop, 'agri'=>$agri, 'comm'=>$comm, @@ -993,7 +993,7 @@ function process_72(&$general) { pushNationHistory($nation, "●{$admin['year']}년 {$admin['month']}월:{$general['name']}{$josaYi} {$destcity['name']}백성동원을 발동"); //도시 성수 80% - $query = "update city set def=def2*0.8,wall=wall2*0.8 where city='{$destcity['city']}'"; + $query = "update city set def=def_max*0.8,wall=wall_max*0.8 where city='{$destcity['city']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); // 국가보정 @@ -1509,7 +1509,7 @@ function process_76(&$general) { $type = Util::choiceRandomUsingWeight([ 'strength0'=>1, 'strength1'=>1, - 'strength2'=>1, + 'strength_max'=>1, 'intel'=>3, 'neutral'=>0 ]); @@ -1526,7 +1526,7 @@ function process_76(&$general) { $intel = $stat_tier3; $dexVal = [$dexTotal/8, $dexTotal*5/8, $dexTotal/8, $dexTotal/8]; break; - case 'strength2': + case 'strength_max': $leadership = $stat_tier1; $strength = $stat_tier2; $intel = $stat_tier3; diff --git a/hwe/func_time_event.php b/hwe/func_time_event.php index cc006094..64fa03c8 100644 --- a/hwe/func_time_event.php +++ b/hwe/func_time_event.php @@ -138,15 +138,15 @@ function popIncrease() { $updateVar = []; if($popRatio >= 0){ - $updateVar['pop'] = $db->sqleval('least(pop2, %i + pop * (1 + %d * (1 + secu / secu2 / 10)))', GameConst::$basePopIncreaseAmount, $popRatio); + $updateVar['pop'] = $db->sqleval('least(pop_max, %i + pop * (1 + %d * (1 + secu / secu_max / 10)))', GameConst::$basePopIncreaseAmount, $popRatio); } else{ - $updateVar['pop'] = $db->sqleval('least(pop2, %i + pop * (1 + %d * (1 - secu / secu2 / 10)))', GameConst::$basePopIncreaseAmount, $popRatio); + $updateVar['pop'] = $db->sqleval('least(pop_max, %i + pop * (1 + %d * (1 - secu / secu_max / 10)))', GameConst::$basePopIncreaseAmount, $popRatio); } $genericRatio = (20 - $taxRate) / 200; // 20일때 0% 0일때 10% 100일때 -40% foreach(['agri', 'comm', 'secu', 'def', 'wall'] as $key){ - $updateVar[$key] = $db->sqleval('least(%b, %b * (1 + %d))', $key.'2', $key, $genericRatio); + $updateVar[$key] = $db->sqleval('least(%b, %b * (1 + %d))', $key.'_max', $key, $genericRatio); } $trustDiff = 20 - $taxRate; @@ -173,8 +173,8 @@ function calcCityGoldIncome(array $rawCity, int $officerCnt, bool $isCapital, in $trustRatio = $rawCity['trust'] / 200 + 0.5;//0.5 ~ 1 - $cityIncome = $rawCity['pop'] * $rawCity['comm'] / $rawCity['comm2'] * $trustRatio / 30; - $cityIncome *= 1 + $rawCity['secu']/$rawCity['secu2']/10; + $cityIncome = $rawCity['pop'] * $rawCity['comm'] / $rawCity['comm_max'] * $trustRatio / 30; + $cityIncome *= 1 + $rawCity['secu']/$rawCity['secu_max']/10; $cityIncome *= pow(1.05, $officerCnt); if($isCapital){ $cityIncome *= 1 + 1/(3*$nationLevel); @@ -191,8 +191,8 @@ function calcCityRiceIncome(array $rawCity, int $officerCnt, bool $isCapital, in $trustRatio = $rawCity['trust'] / 200 + 0.5;//0.5 ~ 1 - $cityIncome = $rawCity['pop'] * $rawCity['agri'] / $rawCity['agri2'] * $trustRatio / 30; - $cityIncome *= 1 + $rawCity['secu']/$rawCity['secu2']/10; + $cityIncome = $rawCity['pop'] * $rawCity['agri'] / $rawCity['agri_max'] * $trustRatio / 30; + $cityIncome *= 1 + $rawCity['secu']/$rawCity['secu_max']/10; $cityIncome *= pow(1.05, $officerCnt); if($isCapital){ $cityIncome *= 1 + 1/(3*$nationLevel); @@ -207,8 +207,8 @@ function calcCityWallRiceIncome(array $rawCity, int $officerCnt, bool $isCapital return 0; } - $wallIncome = $rawCity['def'] * $rawCity['wall'] / $rawCity['wall2'] / 3; - $wallIncome *= 1 + $rawCity['secu']/$rawCity['secu2']/10; + $wallIncome = $rawCity['def'] * $rawCity['wall'] / $rawCity['wall_max'] / 3; + $wallIncome *= 1 + $rawCity['secu']/$rawCity['secu_max']/10; $wallIncome *= pow(1.05, $officerCnt); if($isCapital){ $wallIncome *= 1 + 1/(3*$nationLevel); @@ -520,14 +520,14 @@ function disaster() { $targetCityList = []; - foreach($db->query('SELECT city,name,secu,secu2 FROM city') as $city){ + foreach($db->query('SELECT city,name,secu,secu_max FROM city') as $city){ //호황 발생 도시 선택 ( 기본 2% ) //재해 발생 도시 선택 ( 기본 6% ) if($isGood){ - $raiseProp = 0.02 + ($city['secu'] / $city['secu2']) * 0.05; // 2 ~ 7% + $raiseProp = 0.02 + ($city['secu'] / $city['secu_max']) * 0.05; // 2 ~ 7% } else { - $raiseProp = 0.06 - ($city['secu'] / $city['secu2']) * 0.05; // 1 ~ 6% + $raiseProp = 0.06 - ($city['secu'] / $city['secu_max']) * 0.05; // 1 ~ 6% } if(Util::randBool($raiseProp)) { @@ -587,7 +587,7 @@ function disaster() { $generalListByCity = Util::arrayGroupBy($db->query('SELECT no, nation, city, injury, crew, atmos, train FROM general WHERE city IN %li', Util::squeezeFromArray($targetCityList, 'city')), 'city'); //NOTE: 쿼리 1번이지만 복잡하기 vs 쿼리 여러번이지만 조금 더 깔끔하기 foreach ($targetCityList as $city) { - $affectRatio = Util::valueFit($city['secu'] / $city['secu2'] / 0.8, 0, 1); + $affectRatio = Util::valueFit($city['secu'] / $city['secu_max'] / 0.8, 0, 1); $affectRatio = 0.8 + $affectRatio * 0.15; $db->update('city', [ @@ -613,18 +613,18 @@ function disaster() { } else{ foreach ($targetCityList as $city) { - $affectRatio = Util::valueFit($city['secu'] / $city['secu2'] / 0.8, 0, 1); + $affectRatio = Util::valueFit($city['secu'] / $city['secu_max'] / 0.8, 0, 1); $affectRatio = 1.01 + $affectRatio * 0.04; $db->update('city', [ 'state'=>$stateCode, - 'pop'=>$db->sqleval('greatest(pop * %d, pop2)', $affectRatio), + 'pop'=>$db->sqleval('greatest(pop * %d, pop_max)', $affectRatio), 'trust'=>$db->sqleval('greatest(trust * %d, 100)', $affectRatio), - 'agri'=>$db->sqleval('greatest(agri * %d, agri2)', $affectRatio), - 'comm'=>$db->sqleval('greatest(comm * %d, comm2)', $affectRatio), - 'secu'=>$db->sqleval('greatest(secu * %d, secu2)', $affectRatio), - 'def'=>$db->sqleval('greatest(def * %d, def2)', $affectRatio), - 'wall'=>$db->sqleval('greatest(wall * %d, wall2)', $affectRatio), + 'agri'=>$db->sqleval('greatest(agri * %d, agri_max)', $affectRatio), + 'comm'=>$db->sqleval('greatest(comm * %d, comm_max)', $affectRatio), + 'secu'=>$db->sqleval('greatest(secu * %d, secu_max)', $affectRatio), + 'def'=>$db->sqleval('greatest(def * %d, def_max)', $affectRatio), + 'wall'=>$db->sqleval('greatest(wall * %d, wall_max)', $affectRatio), ], 'city = %i', $city['city']); diff --git a/hwe/j_simulate_battle.php b/hwe/j_simulate_battle.php index 6d7697f5..216201fd 100644 --- a/hwe/j_simulate_battle.php +++ b/hwe/j_simulate_battle.php @@ -82,13 +82,13 @@ $rawDefenderNation = $query['defenderNation']; $generalCheck = [ 'required'=>[ 'no', 'name', 'nation', 'turntime', 'personal', 'special2', 'crew', 'crewtype', 'atmos', 'train', - 'intel', 'intel2', 'book', 'strength', 'strength2', 'weapon', 'injury', 'leadership', 'leadership2', 'horse', 'item', + 'intel', 'intel_max', 'book', 'strength', 'strength_max', 'weapon', 'injury', 'leadership', 'leadership_max', 'horse', 'item', 'explevel', 'experience', 'dedication', 'level', 'gold', 'rice', 'dex0', 'dex10', 'dex20', 'dex30', 'dex40', 'warnum', 'killnum', 'deathnum', 'killcrew', 'deathcrew', 'recwar' ], 'integer'=>[ 'no', 'nation', 'personal', 'special2', 'crew', 'crewtype', 'atmos', 'train', - 'intel', 'intel2', 'book', 'strength', 'strength2', 'weapon', 'injury', 'leadership', 'leadership2', 'horse', 'item', + 'intel', 'intel_max', 'book', 'strength', 'strength_max', 'weapon', 'injury', 'leadership', 'leadership_max', 'horse', 'item', 'explevel', 'experience', 'dedication', 'level', 'gold', 'rice', 'dex0', 'dex10', 'dex20', 'dex30', 'dex40', 'warnum', 'killnum', 'deathnum', 'killcrew', 'deathcrew' ], @@ -156,7 +156,7 @@ $cityCheck = [ 'city', 'nation', 'supply', 'name', 'pop', 'agri', 'comm', 'secu', 'def', 'wall', 'trust', 'level', - 'pop2', 'agri2', 'comm2', 'secu2', 'def2', 'wall2', + 'pop_max', 'agri_max', 'comm_max', 'secu_max', 'def_max', 'wall_max', 'dead', 'state', 'officer4', 'officer3', 'officer2', 'conflict', ], 'numeric'=>[ @@ -164,7 +164,7 @@ $cityCheck = [ ], 'integer'=>[ 'city', 'nation', 'supply', - 'pop2', 'agri2', 'comm2', 'secu2', 'def2', 'wall2', + 'pop_max', 'agri_max', 'comm_max', 'secu_max', 'def_max', 'wall_max', 'state', 'officer4', 'officer3', 'officer2' ], 'min'=>[ diff --git a/hwe/js/battle_simulator.js b/hwe/js/battle_simulator.js index 68f24919..2d844646 100644 --- a/hwe/js/battle_simulator.js +++ b/hwe/js/battle_simulator.js @@ -365,9 +365,9 @@ jQuery(function($){ city: (generalData.no)<=1 ? 1 : 3, turntime:'2018-08-26 12:00', special:defaultSpecialDomestic, - leadership2:0, - strength2:0, - intel2:0, + leadership_max:0, + strength_max:0, + intel_max:0, gold:10000, @@ -597,12 +597,12 @@ jQuery(function($){ trust:100, - pop2:600000, - agri2:12000, - comm2:12000, - secu2:10000, - def2:12000, - wall2:12000, + pop_max:600000, + agri_max:12000, + comm_max:12000, + secu_max:10000, + def_max:12000, + wall_max:12000, dead:0, @@ -640,8 +640,8 @@ jQuery(function($){ var defenderCity = $.extend({}, defaultCity, allData.defenderCity); defenderCity.nation = 2; defenderCity.city = 3; - defenderCity.wall2 = defenderCity.wall/5*6; - defenderCity.def2 = defenderCity.def/5*6; + defenderCity.wall_max = defenderCity.wall/5*6; + defenderCity.def_max = defenderCity.def/5*6; var defenderGenerals = []; $.each(allData.defenderGenerals, function(){ diff --git a/hwe/process_war.php b/hwe/process_war.php index b62f417b..15fee786 100644 --- a/hwe/process_war.php +++ b/hwe/process_war.php @@ -34,7 +34,7 @@ function processWar(General $attackerGeneral, array $rawAttackerNation, array $r $city = new WarUnitCity($rawDefenderCity, $rawDefenderNation, $year, $month, $cityRate); $defenderList = []; - foreach ($db->query('SELECT no,name,nation,turntime,personal,special,special2,crew,crewtype,atmos,train,intel,intel2,book,strength,strength2,weapon,injury,leadership,leadership2,horse,item,explevel,experience,dedication,level,gold,rice,dex0,dex10,dex20,dex30,dex40,warnum,killnum,deathnum,killcrew,deathcrew,recwar,defence_train FROM general WHERE nation=%i AND city=%i AND nation!=0 and crew > 0 and rice>(crew/100) and train>=defence_train and atmos>=defence_train', $city->getVar('nation'), $city->getVar('city')) as $rawGeneral){ + foreach ($db->query('SELECT no,name,nation,turntime,personal,special,special2,crew,crewtype,atmos,train,intel,intel_max,book,strength,strength_max,weapon,injury,leadership,leadership_max,horse,item,explevel,experience,dedication,level,gold,rice,dex0,dex10,dex20,dex30,dex40,warnum,killnum,deathnum,killcrew,deathcrew,recwar,defence_train FROM general WHERE nation=%i AND city=%i AND nation!=0 and crew > 0 and rice>(crew/100) and train>=defence_train and atmos>=defence_train', $city->getVar('nation'), $city->getVar('city')) as $rawGeneral){ $defenderList[] = new General($rawGeneral, $rawDefenderCity, $year, $month); } @@ -702,8 +702,8 @@ function ConquerCity($admin, $general, $city, $nation, $destnation) { $query['def'] = 1000; $query['wall'] = 1000; } else { - $query['def'] = $db->sqleval('def2/2'); - $query['wall'] = $db->sqleval('wall2/2'); + $query['def'] = $db->sqleval('def_max/2'); + $query['wall'] = $db->sqleval('wall_max/2'); } $db->update('city', $query, 'city=%i', (int)$city['city']); diff --git a/hwe/sammo/CityConstBase.php b/hwe/sammo/CityConstBase.php index 3f412347..192cd17e 100644 --- a/hwe/sammo/CityConstBase.php +++ b/hwe/sammo/CityConstBase.php @@ -337,12 +337,12 @@ class CityConstBase{ 'city'=>$city->id, 'name'=>$city->name, 'level'=>$city->level, - 'pop2'=>$city->population, - 'agri2'=>$city->agriculture, - 'comm2'=>$city->commerce, - 'secu2'=>$city->security, - 'def2'=>$city->defence, - 'wall2'=>$city->wall, + 'pop_max'=>$city->population, + 'agri_max'=>$city->agriculture, + 'comm_max'=>$city->commerce, + 'secu_max'=>$city->security, + 'def_max'=>$city->defence, + 'wall_max'=>$city->wall, 'region'=>$city->region ] + $initValue + static::$buildInitCommon; }, array_values(static::$constID)); diff --git a/hwe/sammo/Command/General/che_강행.php b/hwe/sammo/Command/General/che_강행.php index a85717da..300f15c7 100644 --- a/hwe/sammo/Command/General/che_강행.php +++ b/hwe/sammo/Command/General/che_강행.php @@ -149,7 +149,7 @@ class che_강행 extends Command\GeneralCommand{ [$reqGold, $reqRice] = $this->getCost(); $general->increaseVarWithLimit('gold', -$reqGold, 0); $general->increaseVar('experience', $exp); - $general->increaseVar('leadership2', 1); + $general->increaseVar('leadership_max', 1); $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); $general->checkStatChange(); $general->applyDB($db); diff --git a/hwe/sammo/Command/General/che_견문.php b/hwe/sammo/Command/General/che_견문.php index 22208bd2..16160142 100644 --- a/hwe/sammo/Command/General/che_견문.php +++ b/hwe/sammo/Command/General/che_견문.php @@ -77,13 +77,13 @@ class che_견문 extends Command\GeneralCommand{ $exp += 60; } if($type & SightseeingMessage::IncLeadership){ - $general->increaseVar('leadership2', 2); + $general->increaseVar('leadership_max', 2); } if($type & SightseeingMessage::IncStrength){ - $general->increaseVar('strength2', 2); + $general->increaseVar('strength_max', 2); } if($type & SightseeingMessage::IncIntel){ - $general->increaseVar('intel2', 2); + $general->increaseVar('intel_max', 2); } if($type & SightseeingMessage::IncGold){ $general->increaseVar('gold', 300); diff --git a/hwe/sammo/Command/General/che_군량매매.php b/hwe/sammo/Command/General/che_군량매매.php index 8c9cb4db..40f278a9 100644 --- a/hwe/sammo/Command/General/che_군량매매.php +++ b/hwe/sammo/Command/General/che_군량매매.php @@ -158,9 +158,9 @@ class che_군량매매 extends Command\GeneralCommand{ $ded = $general->onCalcStat($general, 'dedication', $ded); $incStat = Util::choiceRandomUsingWeight([ - 'leadership2'=>$general->getLeadership(false, false, false, false), - 'strength2'=>$general->getStrength(false, false, false, false), - 'intel2'=>$general->getIntel(false, false, false, false) + 'leadership_max'=>$general->getLeadership(false, false, false, false), + 'strength_max'=>$general->getStrength(false, false, false, false), + 'intel_max'=>$general->getIntel(false, false, false, false) ]); $general->increaseVar('experience', $exp); diff --git a/hwe/sammo/Command/General/che_귀환.php b/hwe/sammo/Command/General/che_귀환.php index 68b892f7..e230b5ff 100644 --- a/hwe/sammo/Command/General/che_귀환.php +++ b/hwe/sammo/Command/General/che_귀환.php @@ -102,7 +102,7 @@ class che_귀환 extends Command\GeneralCommand{ $general->increaseVar('experience', $exp); $general->increaseVar('dedication', $ded); - $general->increaseVar('leadership2', 1); + $general->increaseVar('leadership_max', 1); $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); $general->checkStatChange(); $general->applyDB($db); diff --git a/hwe/sammo/Command/General/che_기술연구.php b/hwe/sammo/Command/General/che_기술연구.php index af8c5403..005c5b34 100644 --- a/hwe/sammo/Command/General/che_기술연구.php +++ b/hwe/sammo/Command/General/che_기술연구.php @@ -126,7 +126,7 @@ class che_기술연구 extends che_상업투자{ $general->increaseVarWithLimit('gold', -$this->reqGold, 0); $general->increaseVar('experience', $exp); $general->increaseVar('dedication', $ded); - $general->increaseVar(static::$statKey.'2', 1); + $general->increaseVar(static::$statKey.'_max', 1); $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); $general->checkStatChange(); diff --git a/hwe/sammo/Command/General/che_단련.php b/hwe/sammo/Command/General/che_단련.php index 825e6bea..8bb0c2f4 100644 --- a/hwe/sammo/Command/General/che_단련.php +++ b/hwe/sammo/Command/General/che_단련.php @@ -116,9 +116,9 @@ class che_단련 extends Command\GeneralCommand{ $general->addDex($general->getCrewTypeObj(), $score, false); $incStat = Util::choiceRandomUsingWeight([ - 'leadership2'=>$general->getLeadership(false, false, false, false), - 'strength2'=>$general->getStrength(false, false, false, false), - 'intel2'=>$general->getIntel(false, false, false, false) + 'leadership_max'=>$general->getLeadership(false, false, false, false), + 'strength_max'=>$general->getStrength(false, false, false, false), + 'intel_max'=>$general->getIntel(false, false, false, false) ]); [$reqGold, $reqRice] = $this->getCost(); diff --git a/hwe/sammo/Command/General/che_등용.php b/hwe/sammo/Command/General/che_등용.php index 50d01b26..8e45e509 100644 --- a/hwe/sammo/Command/General/che_등용.php +++ b/hwe/sammo/Command/General/che_등용.php @@ -147,7 +147,7 @@ class che_등용 extends Command\GeneralCommand{ $general->increaseVar('experience', $exp); $general->increaseVar('dedication', $ded); - $general->increaseVar('leadership2', 1); + $general->increaseVar('leadership_max', 1); $general->increaseVarWithLimit('gold', -$reqGold, 0); $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); diff --git a/hwe/sammo/Command/General/che_물자조달.php b/hwe/sammo/Command/General/che_물자조달.php index f0123a65..4341213e 100644 --- a/hwe/sammo/Command/General/che_물자조달.php +++ b/hwe/sammo/Command/General/che_물자조달.php @@ -111,9 +111,9 @@ class che_물자조달 extends Command\GeneralCommand{ $ded = $general->onCalcStat($general, 'dedication', $ded); $incStat = Util::choiceRandomUsingWeight([ - 'leadership2'=>$general->getLeadership(false, false, false, false), - 'strength2'=>$general->getStrength(false, false, false, false), - 'intel2'=>$general->getIntel(false, false, false, false) + 'leadership_max'=>$general->getLeadership(false, false, false, false), + 'strength_max'=>$general->getStrength(false, false, false, false), + 'intel_max'=>$general->getIntel(false, false, false, false) ]); $general->increaseVar('experience', $exp); diff --git a/hwe/sammo/Command/General/che_사기진작.php b/hwe/sammo/Command/General/che_사기진작.php index 319e9c66..e105214b 100644 --- a/hwe/sammo/Command/General/che_사기진작.php +++ b/hwe/sammo/Command/General/che_사기진작.php @@ -100,7 +100,7 @@ class che_사기진작 extends Command\GeneralCommand{ $general->increaseVar('experience', $exp); $general->increaseVar('dedication', $ded); - $general->increaseVar('leadership2', 1); + $general->increaseVar('leadership_max', 1); $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); $general->checkStatChange(); tryUniqueItemLottery($general); diff --git a/hwe/sammo/Command/General/che_상업투자.php b/hwe/sammo/Command/General/che_상업투자.php index d233afbd..7a16eae1 100644 --- a/hwe/sammo/Command/General/che_상업투자.php +++ b/hwe/sammo/Command/General/che_상업투자.php @@ -190,7 +190,7 @@ class che_상업투자 extends Command\GeneralCommand{ static::$cityKey => Util::valueFit( $this->city[static::$cityKey] + $score, 0, - $this->city[static::$cityKey.'2'] + $this->city[static::$cityKey.'_max'] ) ]; $db->update('city', $cityUpdated, 'city=%i', $general->getVar('city')); @@ -198,7 +198,7 @@ class che_상업투자 extends Command\GeneralCommand{ $general->increaseVarWithLimit('gold', -$this->reqGold, 0); $general->increaseVar('experience', $exp); $general->increaseVar('dedication', $ded); - $general->increaseVar(static::$statKey.'2', 1); + $general->increaseVar(static::$statKey.'_max', 1); $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); $general->checkStatChange(); tryUniqueItemLottery($general); diff --git a/hwe/sammo/Command/General/che_이동.php b/hwe/sammo/Command/General/che_이동.php index 6e344d3f..5fd59376 100644 --- a/hwe/sammo/Command/General/che_이동.php +++ b/hwe/sammo/Command/General/che_이동.php @@ -147,7 +147,7 @@ class che_이동 extends Command\GeneralCommand{ [$reqGold, $reqRice] = $this->getCost(); $general->increaseVarWithLimit('gold', -$reqGold, 0); $general->increaseVar('experience', $exp); - $general->increaseVar('leadership2', 1); + $general->increaseVar('leadership_max', 1); $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); $general->checkStatChange(); $general->applyDB($db); diff --git a/hwe/sammo/Command/General/che_인재탐색.php b/hwe/sammo/Command/General/che_인재탐색.php index 6c2e3c58..a36c8153 100644 --- a/hwe/sammo/Command/General/che_인재탐색.php +++ b/hwe/sammo/Command/General/che_인재탐색.php @@ -129,9 +129,9 @@ class che_인재탐색 extends Command\GeneralCommand{ $logger->pushGeneralActionLog("인재를 찾을 수 없었습니다. <1>$date"); $incStat = Util::choiceRandomUsingWeight([ - 'leadership2'=>$general->getLeadership(false, false, false, false), - 'strength2'=>$general->getStrength(false, false, false, false), - 'intel2'=>$general->getIntel(false, false, false, false) + 'leadership_max'=>$general->getLeadership(false, false, false, false), + 'strength_max'=>$general->getStrength(false, false, false, false), + 'intel_max'=>$general->getIntel(false, false, false, false) ]); [$reqGold, $reqRice] = $this->getCost(); @@ -290,9 +290,9 @@ class che_인재탐색 extends Command\GeneralCommand{ $logger->pushGeneralHistoryLog("$npcName{$josaRa}는 인재를 {$scoutType}"); $incStat = Util::choiceRandomUsingWeight([ - 'leadership2'=>$general->getLeadership(false, false, false, false), - 'strength2'=>$general->getStrength(false, false, false, false), - 'intel2'=>$general->getIntel(false, false, false, false) + 'leadership_max'=>$general->getLeadership(false, false, false, false), + 'strength_max'=>$general->getStrength(false, false, false, false), + 'intel_max'=>$general->getIntel(false, false, false, false) ]); [$reqGold, $reqRice] = $this->getCost(); diff --git a/hwe/sammo/Command/General/che_전투태세.php b/hwe/sammo/Command/General/che_전투태세.php index 3075d50b..4874b58a 100644 --- a/hwe/sammo/Command/General/che_전투태세.php +++ b/hwe/sammo/Command/General/che_전투태세.php @@ -123,7 +123,7 @@ class che_전투태세 extends Command\GeneralCommand{ $general->addDex($general->getCrewTypeObj(), $crew / 100 * 3, false); - $general->increaseVar('leadership2', 3); + $general->increaseVar('leadership_max', 3); $general->setResultTurn($turnResult); $general->checkStatChange(); tryUniqueItemLottery($general); diff --git a/hwe/sammo/Command/General/che_정착장려.php b/hwe/sammo/Command/General/che_정착장려.php index 6d0238a0..aa968801 100644 --- a/hwe/sammo/Command/General/che_정착장려.php +++ b/hwe/sammo/Command/General/che_정착장려.php @@ -175,7 +175,7 @@ class che_정착장려 extends Command\GeneralCommand{ static::$cityKey => Util::valueFit( $this->city[static::$cityKey] + $score, 0, - $this->city[static::$cityKey.'2'] + $this->city[static::$cityKey.'_max'] ) ]; $db->update('city', $cityUpdated, 'city=%i', $general->getVar('city')); @@ -183,7 +183,7 @@ class che_정착장려 extends Command\GeneralCommand{ $general->increaseVarWithLimit('rice', -$this->reqRice, 0); $general->increaseVar('experience', $exp); $general->increaseVar('dedication', $ded); - $general->increaseVar(static::$statKey.'2', 1); + $general->increaseVar(static::$statKey.'_max', 1); $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); $general->checkStatChange(); tryUniqueItemLottery($general); diff --git a/hwe/sammo/Command/General/che_주민선정.php b/hwe/sammo/Command/General/che_주민선정.php index 6f4bb7a2..ca39508b 100644 --- a/hwe/sammo/Command/General/che_주민선정.php +++ b/hwe/sammo/Command/General/che_주민선정.php @@ -181,7 +181,7 @@ class che_주민선정 extends Command\GeneralCommand{ $general->increaseVarWithLimit('rice', -$this->reqRice, 0); $general->increaseVar('experience', $exp); $general->increaseVar('dedication', $ded); - $general->increaseVar(static::$statKey.'2', 1); + $general->increaseVar(static::$statKey.'_max', 1); $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); $general->checkStatChange(); tryUniqueItemLottery($general); diff --git a/hwe/sammo/Command/General/che_증여.php b/hwe/sammo/Command/General/che_증여.php index 585828c7..4dd8105e 100644 --- a/hwe/sammo/Command/General/che_증여.php +++ b/hwe/sammo/Command/General/che_증여.php @@ -153,7 +153,7 @@ class che_증여 extends Command\GeneralCommand{ $general->increaseVar('experience', $exp); $general->increaseVar('dedication', $ded); - $general->increaseVar('leadership2', 1); + $general->increaseVar('leadership_max', 1); $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); $general->checkStatChange(); diff --git a/hwe/sammo/Command/General/che_집합.php b/hwe/sammo/Command/General/che_집합.php index 8bbea466..12f1e7ff 100644 --- a/hwe/sammo/Command/General/che_집합.php +++ b/hwe/sammo/Command/General/che_집합.php @@ -106,7 +106,7 @@ class che_집합 extends Command\GeneralCommand{ $general->increaseVar('experience', $exp); $general->increaseVar('dedication', $ded); - $general->increaseVar('leadership2', 1); + $general->increaseVar('leadership_max', 1); $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); $general->checkStatChange(); tryUniqueItemLottery($general); diff --git a/hwe/sammo/Command/General/che_징병.php b/hwe/sammo/Command/General/che_징병.php index 9d50d924..7c82c3c2 100644 --- a/hwe/sammo/Command/General/che_징병.php +++ b/hwe/sammo/Command/General/che_징병.php @@ -207,7 +207,7 @@ class che_징병 extends Command\GeneralCommand{ $general->increaseVar('dedication', $ded); $general->increaseVarWithLimit('gold', -$reqGold, 0); $general->increaseVarWithLimit('rice', -$reqRice, 0); - $general->increaseVar('leadership2', 1); + $general->increaseVar('leadership_max', 1); $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); $general->checkStatChange(); tryUniqueItemLottery($general); diff --git a/hwe/sammo/Command/General/che_첩보.php b/hwe/sammo/Command/General/che_첩보.php index e3283e9b..4b65d500 100644 --- a/hwe/sammo/Command/General/che_첩보.php +++ b/hwe/sammo/Command/General/che_첩보.php @@ -195,7 +195,7 @@ class che_첩보 extends Command\GeneralCommand{ $general->increaseVarWithLimit('rice', -$reqRice, 0); $general->increaseVar('experience', $exp); $general->increaseVar('dedication', $ded); - $general->increaseVar('leadership2', 1); + $general->increaseVar('leadership_max', 1); $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); $general->checkStatChange(); $general->applyDB($db); diff --git a/hwe/sammo/Command/General/che_헌납.php b/hwe/sammo/Command/General/che_헌납.php index edffed26..95f712ae 100644 --- a/hwe/sammo/Command/General/che_헌납.php +++ b/hwe/sammo/Command/General/che_헌납.php @@ -133,7 +133,7 @@ class che_헌납 extends Command\GeneralCommand{ $general->increaseVar('experience', $exp); $general->increaseVar('dedication', $ded); - $general->increaseVar('leadership2', 1); + $general->increaseVar('leadership_max', 1); $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); $general->checkStatChange(); diff --git a/hwe/sammo/Command/General/che_화계.php b/hwe/sammo/Command/General/che_화계.php index beaa3af7..8e924ee3 100644 --- a/hwe/sammo/Command/General/che_화계.php +++ b/hwe/sammo/Command/General/che_화계.php @@ -98,7 +98,7 @@ class che_화계 extends Command\GeneralCommand{ $prob = $maxGenScore / GameConst::$sabotageProbCoefByStat; - $prob += $destCity['secu'] / $destCity['secu2'] / 5; //최대 20%p + $prob += $destCity['secu'] / $destCity['secu_max'] / 5; //최대 20%p $prob += $destCity['supply'] ? 0.1 : 0; return $prob; } @@ -273,7 +273,7 @@ class che_화계 extends Command\GeneralCommand{ $general->increaseVarWithLimit('rice', -$reqRice, 0); $general->increaseVar('experience', $exp); $general->increaseVar('dedication', $ded); - $general->increaseVar($statType.'2', 1); + $general->increaseVar($statType.'_max', 1); $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); $general->checkStatChange(); @@ -310,7 +310,7 @@ class che_화계 extends Command\GeneralCommand{ $general->increaseVarWithLimit('rice', -$reqRice, 0); $general->increaseVar('experience', $exp); $general->increaseVar('dedication', $ded); - $general->increaseVar($statType.'2', 1); + $general->increaseVar($statType.'_max', 1); $general->increaseVar('firenum', 1); $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); $general->checkStatChange(); diff --git a/hwe/sammo/Command/General/che_훈련.php b/hwe/sammo/Command/General/che_훈련.php index 65e7a5a4..7995817e 100644 --- a/hwe/sammo/Command/General/che_훈련.php +++ b/hwe/sammo/Command/General/che_훈련.php @@ -104,7 +104,7 @@ class che_훈련 extends Command\GeneralCommand{ $general->increaseVar('experience', $exp); $general->increaseVar('dedication', $ded); - $general->increaseVar('leadership2', 1); + $general->increaseVar('leadership_max', 1); $general->setResultTurn(new LastTurn(static::getName(), $this->arg)); $general->checkStatChange(); tryUniqueItemLottery($general); diff --git a/hwe/sammo/Command/Nation/che_백성동원.php b/hwe/sammo/Command/Nation/che_백성동원.php index 94a5d26d..cf5762f9 100644 --- a/hwe/sammo/Command/Nation/che_백성동원.php +++ b/hwe/sammo/Command/Nation/che_백성동원.php @@ -148,8 +148,8 @@ class che_백성동원 extends Command\NationCommand{ } $db->update('city', [ - 'def' => $db->sqleval('GREATEST(def2 * 0.8, def)'), - 'wall' => $db->sqleval('GREATEST(wall2 * 0.8, wall)'), + 'def' => $db->sqleval('GREATEST(def_max * 0.8, def)'), + 'wall' => $db->sqleval('GREATEST(wall_max * 0.8, wall)'), ], 'city=%i', $destCityID); $josaYiNation = JosaUtil::pick($nationName, '이'); diff --git a/hwe/sammo/Constraint/RemainCityCapacity.php b/hwe/sammo/Constraint/RemainCityCapacity.php index 0908ed69..18da2418 100644 --- a/hwe/sammo/Constraint/RemainCityCapacity.php +++ b/hwe/sammo/Constraint/RemainCityCapacity.php @@ -17,7 +17,7 @@ class RemainCityCapacity extends Constraint{ } [$this->key, $this->keyNick] = $this->arg; - $this->maxKey = $this->key.'2'; + $this->maxKey = $this->key.'_max'; if(!key_exists($this->key, $this->city)){ if(!$throwExeception){return false; } diff --git a/hwe/sammo/Constraint/ReqCityCapacity.php b/hwe/sammo/Constraint/ReqCityCapacity.php index b3281173..768ea26b 100644 --- a/hwe/sammo/Constraint/ReqCityCapacity.php +++ b/hwe/sammo/Constraint/ReqCityCapacity.php @@ -20,7 +20,7 @@ class ReqCityCapacity extends Constraint{ [$this->key, $this->keyNick, $this->reqVal] = $this->arg; - $this->maxKey = $this->key.'2'; + $this->maxKey = $this->key.'_max'; if(!key_exists($this->key, $this->city)){ if(!$throwExeception){return false; } diff --git a/hwe/sammo/Constraint/ReqDestNationValue.php b/hwe/sammo/Constraint/ReqDestNationValue.php index ff3d2e19..5de227d8 100644 --- a/hwe/sammo/Constraint/ReqDestNationValue.php +++ b/hwe/sammo/Constraint/ReqDestNationValue.php @@ -38,7 +38,7 @@ class ReqDestNationValue extends Constraint{ $this->comp = $comp; - $this->maxKey = $this->key.'2'; + $this->maxKey = $this->key.'_max'; if(!key_exists($this->key, $this->destNation)){ if(!$throwExeception){return false; } diff --git a/hwe/sammo/Constraint/ReqGeneralValue.php b/hwe/sammo/Constraint/ReqGeneralValue.php index 4a0d3857..c74119eb 100644 --- a/hwe/sammo/Constraint/ReqGeneralValue.php +++ b/hwe/sammo/Constraint/ReqGeneralValue.php @@ -38,7 +38,7 @@ class ReqGeneralValue extends Constraint{ $this->comp = $comp; - $this->maxKey = $this->key.'2'; + $this->maxKey = $this->key.'_max'; if(!key_exists($this->key, $this->general)){ if(!$throwExeception){return false; } diff --git a/hwe/sammo/Constraint/ReqNationValue.php b/hwe/sammo/Constraint/ReqNationValue.php index e7dd84ee..5d701f81 100644 --- a/hwe/sammo/Constraint/ReqNationValue.php +++ b/hwe/sammo/Constraint/ReqNationValue.php @@ -38,7 +38,7 @@ class ReqNationValue extends Constraint{ $this->comp = $comp; - $this->maxKey = $this->key.'2'; + $this->maxKey = $this->key.'_max'; if(!key_exists($this->key, $this->nation)){ if(!$throwExeception){return false; } diff --git a/hwe/sammo/Event/Action/ChangeCity.php b/hwe/sammo/Event/Action/ChangeCity.php index b69275a3..97cb627e 100644 --- a/hwe/sammo/Event/Action/ChangeCity.php +++ b/hwe/sammo/Event/Action/ChangeCity.php @@ -92,7 +92,7 @@ class ChangeCity extends \sammo\Event\Action{ } private function genSQLGeneric($key, $value){ - $keyMax = $key.'2'; //comm, comm2 + $keyMax = $key.'_max'; //comm, comm_max if(is_float($value)){ if($value < 0){ diff --git a/hwe/sammo/General.php b/hwe/sammo/General.php index 44d6255c..cb472e53 100644 --- a/hwe/sammo/General.php +++ b/hwe/sammo/General.php @@ -478,7 +478,7 @@ class General implements iAction{ $result = false; foreach($table as [$statNickName, $statName]){ - $statExpName = $statName.'2'; + $statExpName = $statName.'_max'; if($this->getVar($statExpName) < 0){ $logger->pushGeneralActionLog("{$statNickName}이 1 떨어졌습니다!", ActionLogger::PLAIN); @@ -673,7 +673,7 @@ class General implements iAction{ ]; $fullColumn = [ 'no', 'name', 'name2', 'picture', 'imgsvr', 'nation', 'city', 'troop', 'injury', 'affinity', - 'leadership', 'leadership2', 'strength', 'strength2', 'intel', 'intel2', 'weapon', 'book', 'horse', 'item', + 'leadership', 'leadership_max', 'strength', 'strength_max', 'intel', 'intel_max', 'weapon', 'book', 'horse', 'item', 'experience', 'dedication', 'level', 'gold', 'rice', 'crew', 'crewtype', 'train', 'atmos', 'turntime', 'makelimit', 'killturn', 'block', 'dedlevel', 'explevel', 'age', 'startage', 'belong', 'personal', 'special', 'special2', 'defence_train', 'tnmt', 'npc', 'npc_org', 'deadyear', 'npcmsg', diff --git a/hwe/sammo/GeneralAI.php b/hwe/sammo/GeneralAI.php index 65e73ada..674ca166 100644 --- a/hwe/sammo/GeneralAI.php +++ b/hwe/sammo/GeneralAI.php @@ -186,12 +186,12 @@ class GeneralAI{ $develRate = [ 'trust'=>$city['trust'], - 'pop'=>$city['pop']/$city['pop2'], - 'agri'=>$city['agri']/$city['agri2'], - 'comm'=>$city['comm']/$city['comm2'], - 'secu'=>$city['secu']/$city['secu2'], - 'def'=>$city['def']/$city['def2'], - 'wall'=>$city['wall']/$city['wall2'], + 'pop'=>$city['pop']/$city['pop_max'], + 'agri'=>$city['agri']/$city['agri_max'], + 'comm'=>$city['comm']/$city['comm_max'], + 'secu'=>$city['secu']/$city['secu_max'], + 'def'=>$city['def']/$city['def_max'], + 'wall'=>$city['wall']/$city['wall_max'], ]; // 우선 선정 @@ -535,7 +535,7 @@ class GeneralAI{ $dev = ($nationCity['agri'] + $nationCity['comm'] + $nationCity['secu'] + $nationCity['def'] + $nationCity['wall'])/ ($nationCity['agri'] + $nationCity['comm'] + $nationCity['secu'] + $nationCity['def'] + $nationCity['wall']); - $dev += $nationCity['pop'] / $nationCity['pop2']; + $dev += $nationCity['pop'] / $nationCity['pop_max']; $dev /= 50; $nationCity['dev'] = $dev; @@ -978,7 +978,7 @@ class GeneralAI{ if($targetCity['pop'] < 33000 + $nationGeneral->leadership){ continue; } - if (Util::randBool($targetCity['pop'] / $targetCity['pop2'])) { + if (Util::randBool($targetCity['pop'] / $targetCity['pop_max'])) { break; } } @@ -1316,7 +1316,7 @@ class GeneralAI{ $developTurn = $this->chooseDevelopTurn($cityFull); if($cityFull && Util::randBool(0.2)){ - $moveRawCities = $db->query('SELECT city,front,(pop/10+agri+comm+secu+def+wall)/(pop2/10+agri2+comm2+secu2+def2+wall2)*100 as dev, officer3 FROM city WHERE nation=%i', $nationID); + $moveRawCities = $db->query('SELECT city,front,(pop/10+agri+comm+secu+def+wall)/(pop_max/10+agri_max+comm_max+secu_max+def_max+wall_max)*100 as dev, officer3 FROM city WHERE nation=%i', $nationID); $moveCities = []; foreach($moveRawCities as $moveCity){ @@ -1671,7 +1671,7 @@ class GeneralAI{ $nationID = $this->nation['nation']; $this->devRate = $db->queryFirstRow( - 'SELECT sum(pop)/sum(pop2) as pop_p,(sum(agri)+sum(comm)+sum(secu)+sum(def)+sum(wall))/(sum(agri2)+sum(comm2)+sum(secu2)+sum(def2)+sum(wall2)) as all_p from city where nation=%i', + 'SELECT sum(pop)/sum(pop_max) as pop_p,(sum(agri)+sum(comm)+sum(secu)+sum(def)+sum(wall))/(sum(agri_max)+sum(comm_max)+sum(secu_max)+sum(def_max)+sum(wall_max)) as all_p from city where nation=%i', $nationID ); return $this->devRate; diff --git a/hwe/sammo/WarUnitGeneral.php b/hwe/sammo/WarUnitGeneral.php index ce51ed70..547450db 100644 --- a/hwe/sammo/WarUnitGeneral.php +++ b/hwe/sammo/WarUnitGeneral.php @@ -122,11 +122,11 @@ class WarUnitGeneral extends WarUnit{ function addStatExp(int $value = 1){ $general = $this->general; if($this->crewType->armType == GameUnitConst::T_WIZARD) { // 귀병 - $general->increaseVar('intel2', $value); + $general->increaseVar('intel_max', $value); } elseif($this->crewType->armType == GameUnitConst::T_SIEGE) { // 차병 - $general->increaseVar('leadership2', $value); + $general->increaseVar('leadership_max', $value); } else { - $general->increaseVar('strength2', $value); + $general->increaseVar('strength_max', $value); } } diff --git a/hwe/sql/schema.sql b/hwe/sql/schema.sql index 25c65144..a92844f5 100644 --- a/hwe/sql/schema.sql +++ b/hwe/sql/schema.sql @@ -25,11 +25,11 @@ CREATE TABLE `general` ( `city` INT(6) NOT NULL DEFAULT '3', `troop` INT(6) NOT NULL DEFAULT '0', `leadership` INT(3) NOT NULL DEFAULT '50', - `leadership2` INT(3) NOT NULL DEFAULT '0', + `leadership_max` INT(3) NOT NULL DEFAULT '0', `strength` INT(3) NOT NULL DEFAULT '50', - `strength2` INT(3) NOT NULL DEFAULT '0', + `strength_max` INT(3) NOT NULL DEFAULT '0', `intel` INT(3) NOT NULL DEFAULT '50', - `intel2` INT(3) NOT NULL DEFAULT '0', + `intel_max` INT(3) NOT NULL DEFAULT '0', `injury` INT(2) NOT NULL DEFAULT '0', `experience` INT(6) NOT NULL DEFAULT '0', `dedication` INT(6) NOT NULL DEFAULT '0', @@ -255,20 +255,20 @@ CREATE TABLE `city` ( `supply` INT(1) NOT NULL DEFAULT '1', `front` INT(1) NOT NULL DEFAULT '0', `pop` INT(7) NOT NULL, - `pop2` INT(7) NOT NULL, + `pop_max` INT(7) NOT NULL, `agri` INT(5) NOT NULL, - `agri2` INT(5) NOT NULL, + `agri_max` INT(5) NOT NULL, `comm` INT(5) NOT NULL, - `comm2` INT(5) NOT NULL, + `comm_max` INT(5) NOT NULL, `secu` INT(5) NOT NULL, - `secu2` INT(5) NOT NULL, + `secu_max` INT(5) NOT NULL, `trust` FLOAT NOT NULL, `trade` INT(3) NULL DEFAULT NULL, `dead` INT(7) NOT NULL DEFAULT '0', `def` INT(5) NOT NULL, - `def2` INT(5) NOT NULL, + `def_max` INT(5) NOT NULL, `wall` INT(5) NOT NULL, - `wall2` INT(5) NOT NULL, + `wall_max` INT(5) NOT NULL, `officer4` INT(4) NOT NULL DEFAULT '0', `officer3` INT(4) NOT NULL DEFAULT '0', `officer2` INT(4) NOT NULL DEFAULT '0', diff --git a/hwe/templates/mainCityInfo.php b/hwe/templates/mainCityInfo.php index 13ddb0f8..6a21122b 100644 --- a/hwe/templates/mainCityInfo.php +++ b/hwe/templates/mainCityInfo.php @@ -4,44 +4,44 @@ 주민 - bar($pop/$pop2*100)?> + bar($pop/$pop_max*100)?> 민심 bar($trust)?> 태수 - / + / 농업 - bar($agri/$agri2*100)?> + bar($agri/$agri_max*100)?> 상업 - bar($comm/$comm2*100)?> + bar($comm/$comm_max*100)?> 치안 - bar($secu/$secu2*100)?> + bar($secu/$secu_max*100)?> 군사 - / - / - / + / + / + / 수비 - bar($def/$def2*100)?> + bar($def/$def_max*100)?> 성벽 - bar($wall/$wall2*100)?> + bar($wall/$wall_max*100)?> 시세 bar(($trade-95)*10)?> 종사 - / - / + / + / \ No newline at end of file