diff --git a/.phan/config.php b/.phan/config.php index 649b51d7..80b5229a 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -32,7 +32,7 @@ return [ 'hwe/func_npc.php', 'hwe/func_process_chief.php', 'hwe/func_process_personnel.php', - 'hwe/func_process_trick.php', + 'hwe/func_process_sabotage.php', 'hwe/func_process.php', 'hwe/func_string.php', 'hwe/func_template.php', diff --git a/hwe/_admin5.php b/hwe/_admin5.php index af822bf4..e460fbc4 100644 --- a/hwe/_admin5.php +++ b/hwe/_admin5.php @@ -158,7 +158,7 @@ SELECT A.chemi, A.color, A.tech, - A.tricklimit, + A.sabotagelimit, A.gold, A.rice, COUNT(B.nation) AS gennum, @@ -233,7 +233,7 @@ for($i=0; $i < $nationCount; $i++) {  {$gen['cnt']}   {$city['cnt']}   {$nation['tech']}  -  {$nation['tricklimit']}  +  {$nation['sabotagelimit']}   {$nation['gold']}   {$nation['rice']}   {$gen['avgg']}  @@ -263,7 +263,7 @@ for($i=0; $i < $nationCount; $i++) { ?> - +
diff --git a/hwe/func.php b/hwe/func.php index 6e2d7c97..e4190542 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -4,7 +4,7 @@ namespace sammo; require_once 'process_war.php'; require_once 'func_gamerule.php'; require_once 'func_process.php'; -require_once 'func_process_trick.php'; +require_once 'func_process_sabotage.php'; require_once 'func_process_chief.php'; require_once 'func_process_personnel.php'; require_once 'func_npc.php'; @@ -270,7 +270,7 @@ function myNationInfo() { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $me = MYDB_fetch_array($result); - $query = "select nation,name,color,power,msg,gold,rice,bill,rate,scout,war,tricklimit,surlimit,tech,totaltech,level,type from nation where nation='{$me['nation']}'"; + $query = "select nation,name,color,power,msg,gold,rice,bill,rate,scout,war,sabotagelimit,surlimit,tech,totaltech,level,type from nation where nation='{$me['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $nation = MYDB_fetch_array($result); @@ -350,14 +350,14 @@ function myNationInfo() { $nation['tech'] = "$techCall / {$nation['tech']}"; if($me['nation']==0){ - $nation['tricklimit'] = "해당 없음"; + $nation['sabotagelimit'] = "해당 없음"; $nation['surlimit'] = "해당 없음"; $nation['scout'] = "해당 없음"; $nation['war'] = "해당 없음"; $nation['power'] = "해당 없음"; } else { - if($nation['tricklimit'] != 0) { $nation['tricklimit'] = "{$nation['tricklimit']}턴"; } - else { $nation['tricklimit'] = "가 능"; } + if($nation['sabotagelimit'] != 0) { $nation['sabotagelimit'] = "{$nation['sabotagelimit']}턴"; } + else { $nation['sabotagelimit'] = "가 능"; } if($nation['surlimit'] != 0) { $nation['surlimit'] = "{$nation['surlimit']}턴"; } else { $nation['surlimit'] = "가 능"; } @@ -388,7 +388,7 @@ function myNationInfo() { - + @@ -962,8 +962,6 @@ function myInfo2() { } function generalInfo2($no) { - global $_dexLimit; - $db = DB::db(); $connect=$db->get(); @@ -989,11 +987,11 @@ function generalInfo2($no) { $dedication = getDed($general['dedication'])." ({$general['dedication']})"; break; } - $dex0 = $general['dex0'] / $_dexLimit * 100; - $dex10 = $general['dex10'] / $_dexLimit * 100; - $dex20 = $general['dex20'] / $_dexLimit * 100; - $dex30 = $general['dex30'] / $_dexLimit * 100; - $dex40 = $general['dex40'] / $_dexLimit * 100; + $dex0 = $general['dex0'] / GameConst::$dexLimit * 100; + $dex10 = $general['dex10'] / GameConst::$dexLimit * 100; + $dex20 = $general['dex20'] / GameConst::$dexLimit * 100; + $dex30 = $general['dex30'] / GameConst::$dexLimit * 100; + $dex40 = $general['dex40'] / GameConst::$dexLimit * 100; if($dex0 > 100) { $dex0 = 100; } if($dex10 > 100) { $dex10 = 100; } @@ -2678,7 +2676,7 @@ function CharCritical($rate, $personal) { return $rate; } -function TrickInjury($city, $type=0) { +function SabotageInjury($city, $type=0) { $db = DB::db(); $connect=$db->get(); $log = []; diff --git a/hwe/func_gamerule.php b/hwe/func_gamerule.php index 869aa466..e3006343 100644 --- a/hwe/func_gamerule.php +++ b/hwe/func_gamerule.php @@ -413,7 +413,7 @@ function preUpdateMonthly() { //건국제한, 전략제한, 외교제한-1 $query = "update general set makelimit=makelimit-1 where makelimit>'0'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $query = "update nation set tricklimit=tricklimit-1 where tricklimit>'0'"; + $query = "update nation set sabotagelimit=sabotagelimit-1 where sabotagelimit>'0'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $query = "update nation set surlimit=surlimit-1 where surlimit>'0'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); diff --git a/hwe/func_history.php b/hwe/func_history.php index cffd6b6a..ea38d3f4 100644 --- a/hwe/func_history.php +++ b/hwe/func_history.php @@ -64,12 +64,12 @@ function getTnmtFightLogAll(int $group) { return join('
',getFormattedFileLogAll("logs/fight{$group}.txt")); } -function pushTrickLog($log) { - pushRawFileLog("logs/_tricklog.txt", $log); +function pushSabotageLog($log) { + pushRawFileLog("logs/_sabotagelog.txt", $log); } -function getTrickLogRecent($count) { - return join('
', getFormattedFileLogRecent("logs/_tricklog.txt", $count, 150)); +function getSabotageLogRecent($count) { + return join('
', getFormattedFileLogRecent("logs/_sabotagelog.txt", $count, 150)); } function pushProcessLog($log) { diff --git a/hwe/func_process.php b/hwe/func_process.php index dd9a8709..354e3e7d 100644 --- a/hwe/func_process.php +++ b/hwe/func_process.php @@ -855,11 +855,10 @@ function process_11(&$general, $type) { $log = []; $alllog = []; $history = []; - global $_defaultatmos, $_defaulttrain, $_defaultatmos2, $_defaulttrain2; $date = substr($general['turntime'],11,5); - if($type == 1) { $defaultatmos = $_defaultatmos; $defaulttrain = $_defaulttrain; } - else { $defaultatmos = $_defaultatmos2; $defaulttrain = $_defaulttrain2; } + if($type == 1) { $defaultatmos = GameConst::$defaultAtmosLow; $defaulttrain = GameConst::$defaultTrainLow; } + else { $defaultatmos = GameConst::$defaultAtmosHigh; $defaulttrain = GameConst::$defaultTrainHigh; } $query = "select year,month,startyear from game limit 1"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); @@ -1042,7 +1041,6 @@ function process_13(&$general) { $log = []; $alllog = []; $history = []; - global $_maxtrain, $_training, $_atmosing; $date = substr($general['turntime'],11,5); $query = "select year,month from game limit 1"; @@ -1065,13 +1063,13 @@ function process_13(&$general) { // $log[] = "●{$admin['month']}월:고립된 도시입니다. 훈련 실패. <1>$date"; } elseif($general['crew'] == 0) { $log[] = "●{$admin['month']}월:병사가 없습니다. 훈련 실패. <1>$date"; - } elseif($general['train'] >= $_maxtrain) { + } elseif($general['train'] >= GameConst::$maxTrainByCommand) { $log[] = "●{$admin['month']}월:병사들은 이미 정예병사들입니다. <1>$date"; // } elseif(intdiv($general['crewtype'], 10) == 4) { // $log[] = "●{$admin['month']}월:병기는 훈련이 불가능합니다. <1>$date"; } else { // 훈련시 - $score = Util::round(getGeneralLeadership($general, true, true, true) * 100 / $general['crew'] * $_training); + $score = Util::round(getGeneralLeadership($general, true, true, true) * 100 / $general['crew'] * GameConst::$trainDelta); $log[] = "●{$admin['month']}월:훈련치가 $score 상승했습니다. <1>$date"; $exp = 100; @@ -1084,11 +1082,11 @@ function process_13(&$general) { // 훈련치 변경 $score += $general['train']; - if($score > $_maxtrain) { $score = $_maxtrain; } + if($score > GameConst::$maxTrainByCommand) { $score = GameConst::$maxTrainByCommand; } $query = "update general set train='$score' where no='{$general['no']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); // 사기 약간 감소 - $score = intval($general['atmos'] * $_atmosing); + $score = intval($general['atmos'] * GameConst::$atmosSideEffectByTraining); if($score < 0 ) { $score = 0; } $query = "update general set atmos='$score' where no='{$general['no']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); @@ -1109,7 +1107,6 @@ function process_14(&$general) { $db = DB::db(); $connect=$db->get(); - global $_maxatmos, $_training; $log = []; $alllog = []; $history = []; @@ -1137,12 +1134,12 @@ function process_14(&$general) { $log[] = "●{$admin['month']}월:병사가 없습니다. 사기진작 실패. <1>$date"; } elseif($general['gold'] < $general['crew']/100) { $log[] = "●{$admin['month']}월:자금이 모자랍니다. 사기진작 실패. <1>$date"; - } elseif($general['atmos'] >= $_maxatmos) { + } elseif($general['atmos'] >= GameConst::$maxAtmosByCommand) { $log[] = "●{$admin['month']}월:이미 사기는 하늘을 찌를듯 합니다. <1>$date"; // } elseif(intdiv($general['crewtype'], 10) == 4) { // $log[] = "●{$admin['month']}월:병기는 사기 진작이 불가능합니다. <1>$date"; } else { - $score = Util::round(getGeneralLeadership($general, true, true, true)*100 / $general['crew'] * $_training); + $score = Util::round(getGeneralLeadership($general, true, true, true)*100 / $general['crew'] * GameConst::$trainAtmos); $gold = $general['gold'] - Util::round($general['crew']/100); $log[] = "●{$admin['month']}월:사기치가 $score 상승했습니다. <1>$date"; @@ -1156,7 +1153,7 @@ function process_14(&$general) { // 사기치 변경 // 자금 감소 // 경험치 상승 // 공헌도, 명성 상승 $score += $general['atmos']; - if($score > $_maxatmos) { $score = $_maxatmos; } + if($score > GameConst::$maxAtmosByCommand) { $score = GameConst::$maxAtmosByCommand; } $general['leader2']++; $query = "update general set resturn='SUCCESS',atmos='$score',gold='$gold',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); @@ -1172,7 +1169,6 @@ function process_15(&$general) { $db = DB::db(); $connect=$db->get(); - global $_maxatmos, $_maxtrain; $log = []; $alllog = []; $history = []; @@ -1255,7 +1251,7 @@ function process_16(&$general) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $admin = MYDB_fetch_array($result); - $query = "select nation,war,tricklimit,tech from nation where nation='{$general['nation']}'"; + $query = "select nation,war,sabotagelimit,tech from nation where nation='{$general['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $nation = MYDB_fetch_array($result); @@ -1270,7 +1266,7 @@ function process_16(&$general) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $destcity = MYDB_fetch_array($result); - $query = "select nation,tricklimit,tech from nation where nation='{$destcity['nation']}'"; + $query = "select nation,sabotagelimit,tech from nation where nation='{$destcity['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $dnation = MYDB_fetch_array($result); @@ -2357,7 +2353,6 @@ function process_49(&$general) { $log = []; $alllog = []; $history = []; - global $_taxrate; $date = substr($general['turntime'],11,5); @@ -2393,7 +2388,7 @@ function process_49(&$general) { //특기 보정 : 거상 if($general['special'] == 30 && $city['trade'] > 100) { $cost = $amount * (6 * $city['trade']/100 - 5); } // 이익인 경우 5배 이득 if($general['special'] == 30 && $city['trade'] < 100) { $cost = $amount * (0.2 * $city['trade']/100 + 0.8); } // 손해인 경우 1/5배 손해 - $tax = $cost * $_taxrate; + $tax = $cost * GameConst::$exchangeFee; $cost = $cost - $tax; } elseif($type == 2) { $dtype = "군량 구입"; @@ -2401,11 +2396,11 @@ function process_49(&$general) { //특기 보정 : 거상 if($general['special'] == 30 && $city['trade'] < 100) { $cost = $amount * (6 * $city['trade']/100 - 5); } // 이익인 경우 5배 이득 if($general['special'] == 30 && $city['trade'] > 100) { $cost = $amount * (0.2 * $city['trade']/100 + 0.8); } // 손해인 경우 1/5배 손해 - $tax = $cost * $_taxrate; + $tax = $cost * GameConst::$exchangeFee; $cost = $cost + $tax; if($general['gold'] < $cost) { $cost = $general['gold']; - $tax = $cost * $_taxrate; + $tax = $cost * GameConst::$exchangeFee; $amount = ($cost-$tax) * 100 / $city['trade']; //특기 보정 : 거상 if($general['special'] == 30 && $city['trade'] < 100) { $amount = ($cost-$tax) / (6 * $city['trade']/100 - 5); } // 이익인 경우 5배 이득 diff --git a/hwe/func_process_chief.php b/hwe/func_process_chief.php index 028fd6c6..1b56fc6c 100644 --- a/hwe/func_process_chief.php +++ b/hwe/func_process_chief.php @@ -1243,7 +1243,7 @@ function process_71(&$general) { $log = []; $alllog = []; $history = []; - $tricklog = []; + $sabotagelog = []; $date = substr($general['turntime'],11,5); @@ -1255,7 +1255,7 @@ function process_71(&$general) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $city = MYDB_fetch_array($result); - $query = "select nation,name,type,tricklimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; + $query = "select nation,name,type,sabotagelimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $nation = MYDB_fetch_array($result); @@ -1288,7 +1288,7 @@ function process_71(&$general) { $log[] = "●{$admin['month']}월:수뇌부가 아닙니다. 필사즉생 실패. <1>$date"; } elseif($dipCount == 0) { $log[] = "●{$admin['month']}월:전쟁중이 아닙니다. 필사즉생 실패. <1>$date"; - } elseif($nation['tricklimit'] > 0) { + } elseif($nation['sabotagelimit'] > 0) { $log[] = "●{$admin['month']}월:전략기한이 남았습니다. 필사즉생 실패. <1>$date"; } elseif($term < $term2) { $log[] = "●{$admin['month']}월:필사즉생 수행중... ({$term}/{$term2}) <1>$date"; @@ -1315,7 +1315,7 @@ function process_71(&$general) { // $alllog[] = "●{$admin['month']}월:{$general['name']}(이)가 필사즉생(을)를 발동하였습니다."; // $history[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 필사즉생(을)를 발동하였습니다."; - $tricklog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 필사즉생(을)를 발동하였습니다."; + $sabotagelog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 필사즉생(을)를 발동하였습니다."; pushGeneralHistory($general, "●{$admin['year']}년 {$admin['month']}월:필사즉생(을)를 발동"); pushNationHistory($nation, "●{$admin['year']}년 {$admin['month']}월:{$general['name']}(이)가 필사즉생(을)를 발동"); @@ -1328,7 +1328,7 @@ function process_71(&$general) { if($nation['type'] == 12) { $term3 = $term3 * 2; } //전략기한 - $query = "update nation set tricklimit={$term3} where nation='{$general['nation']}'"; + $query = "update nation set sabotagelimit={$term3} where nation='{$general['nation']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); //경험치, 공헌치 @@ -1338,7 +1338,7 @@ function process_71(&$general) { // pushWorldHistory($history, $admin['year'], $admin['month']); // pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']); - pushTrickLog($tricklog); + pushSabotageLog($sabotagelog); pushGenLog($general, $log); } @@ -1349,7 +1349,7 @@ function process_72(&$general) { $log = []; $alllog = []; $history = []; - $tricklog = []; + $sabotagelog = []; $date = substr($general['turntime'],11,5); @@ -1361,7 +1361,7 @@ function process_72(&$general) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $city = MYDB_fetch_array($result); - $query = "select nation,name,type,tricklimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; + $query = "select nation,name,type,sabotagelimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $nation = MYDB_fetch_array($result); @@ -1401,7 +1401,7 @@ function process_72(&$general) { $log[] = "●{$admin['month']}월:수뇌부가 아닙니다. 백성동원 실패. <1>$date"; } elseif($dipCount == 0) { $log[] = "●{$admin['month']}월:전쟁중이 아닙니다. 백성동원 실패. <1>$date"; - } elseif($nation['tricklimit'] > 0) { + } elseif($nation['sabotagelimit'] > 0) { $log[] = "●{$admin['month']}월:전략기한이 남았습니다. 백성동원 실패. <1>$date"; } elseif($destcity['nation'] != $general['nation']) { $log[] = "●{$admin['month']}월:아국 도시만 가능합니다. 백성동원 실패. <1>$date"; @@ -1430,7 +1430,7 @@ function process_72(&$general) { // $alllog[] = "●{$admin['month']}월:{$general['name']}(이)가 {$destcity['name']}백성동원(을)를 발동하였습니다."; // $history[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destcity['name']}백성동원(을)를 발동하였습니다."; - $tricklog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destcity['name']}백성동원(을)를 발동하였습니다."; + $sabotagelog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destcity['name']}백성동원(을)를 발동하였습니다."; pushGeneralHistory($general, "●{$admin['year']}년 {$admin['month']}월:{$destcity['name']}백성동원(을)를 발동"); pushNationHistory($nation, "●{$admin['year']}년 {$admin['month']}월:{$general['name']}(이)가 {$destcity['name']}백성동원(을)를 발동"); @@ -1443,7 +1443,7 @@ function process_72(&$general) { if($nation['type'] == 12) { $term3 = $term3 * 2; } //전략기한 - $query = "update nation set tricklimit={$term3} where nation='{$general['nation']}'"; + $query = "update nation set sabotagelimit={$term3} where nation='{$general['nation']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); //경험치, 공헌치 @@ -1453,7 +1453,7 @@ function process_72(&$general) { // pushWorldHistory($history, $admin['year'], $admin['month']); // pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']); - pushTrickLog($tricklog); + pushSabotageLog($sabotagelog); pushGenLog($general, $log); } @@ -1464,7 +1464,7 @@ function process_73(&$general) { $log = []; $alllog = []; $history = []; - $tricklog = []; + $sabotagelog = []; $date = substr($general['turntime'],11,5); @@ -1476,7 +1476,7 @@ function process_73(&$general) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $city = MYDB_fetch_array($result); - $query = "select nation,name,type,tricklimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; + $query = "select nation,name,type,sabotagelimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $nation = MYDB_fetch_array($result); @@ -1524,7 +1524,7 @@ function process_73(&$general) { $log[] = "●{$admin['month']}월:대상도시가 아국입니다. 수몰 실패. <1>$date"; } elseif($dip['state'] > 0) { $log[] = "●{$admin['month']}월:전쟁중인 상대국에만 가능합니다. 수몰 실패. <1>$date"; - } elseif($nation['tricklimit'] > 0) { + } elseif($nation['sabotagelimit'] > 0) { $log[] = "●{$admin['month']}월:전략기한이 남았습니다. 수몰 실패. <1>$date"; } elseif($term < $term2) { $log[] = "●{$admin['month']}월:수몰 수행중... ({$term}/{$term2}) <1>$date"; @@ -1560,7 +1560,7 @@ function process_73(&$general) { // $alllog[] = "●{$admin['month']}월:{$general['name']}(이)가 {$destcity['name']}수몰(을)를 발동하였습니다."; // $history[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destcity['name']}수몰(을)를 발동하였습니다."; - $tricklog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destcity['name']}수몰(을)를 발동하였습니다."; + $sabotagelog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destcity['name']}수몰(을)를 발동하였습니다."; pushGeneralHistory($general, "●{$admin['year']}년 {$admin['month']}월:{$destcity['name']}수몰(을)를 발동"); pushNationHistory($nation, "●{$admin['year']}년 {$admin['month']}월:{$general['name']}(이)가 {$destnation['name']}{$destcity['name']}수몰(을)를 발동"); pushNationHistory($destnation, "●{$admin['year']}년 {$admin['month']}월:{$nation['name']}{$general['name']}(이)가 아국의 {$destcity['name']}수몰(을)를 발동"); @@ -1574,7 +1574,7 @@ function process_73(&$general) { if($nation['type'] == 12) { $term3 = $term3 * 2; } //전략기한 - $query = "update nation set tricklimit={$term3} where nation='{$general['nation']}'"; + $query = "update nation set sabotagelimit={$term3} where nation='{$general['nation']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); //경험치, 공헌치 @@ -1584,7 +1584,7 @@ function process_73(&$general) { // pushWorldHistory($history, $admin['year'], $admin['month']); // pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']); - pushTrickLog($tricklog); + pushSabotageLog($sabotagelog); pushGenLog($general, $log); } @@ -1595,7 +1595,7 @@ function process_74(&$general) { $log = []; $alllog = []; $history = []; - $tricklog = []; + $sabotagelog = []; $date = substr($general['turntime'],11,5); @@ -1607,7 +1607,7 @@ function process_74(&$general) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $city = MYDB_fetch_array($result); - $query = "select nation,name,type,tricklimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; + $query = "select nation,name,type,sabotagelimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $nation = MYDB_fetch_array($result); @@ -1655,7 +1655,7 @@ function process_74(&$general) { $log[] = "●{$admin['month']}월:대상도시가 아국입니다. 허보 실패. <1>$date"; } elseif($dip['state'] > 1) { $log[] = "●{$admin['month']}월:선포,전쟁중인 상대국에만 가능합니다. 허보 실패. <1>$date"; - } elseif($nation['tricklimit'] > 0) { + } elseif($nation['sabotagelimit'] > 0) { $log[] = "●{$admin['month']}월:전략기한이 남았습니다. 허보 실패. <1>$date"; } elseif($term < $term2) { $log[] = "●{$admin['month']}월:허보 수행중... ({$term}/{$term2}) <1>$date"; @@ -1682,7 +1682,7 @@ function process_74(&$general) { // $alllog[] = "●{$admin['month']}월:{$general['name']}(이)가 {$destcity['name']}허보(을)를 발동하였습니다."; // $history[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destcity['name']}허보(을)를 발동하였습니다."; - $tricklog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destcity['name']}허보(을)를 발동하였습니다."; + $sabotagelog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destcity['name']}허보(을)를 발동하였습니다."; pushGeneralHistory($general, "●{$admin['year']}년 {$admin['month']}월:{$destcity['name']}허보(을)를 발동"); pushNationHistory($nation, "●{$admin['year']}년 {$admin['month']}월:{$general['name']}(이)가 {$destnation['name']}{$destcity['name']}허보(을)를 발동"); pushNationHistory($destnation, "●{$admin['year']}년 {$admin['month']}월:{$nation['name']}{$general['name']}(이)가 아국의 {$destcity['name']}허보(을)를 발동"); @@ -1718,7 +1718,7 @@ function process_74(&$general) { if($nation['type'] == 12) { $term3 = $term3 * 2; } //전략기한 - $query = "update nation set tricklimit={$term3} where nation='{$general['nation']}'"; + $query = "update nation set sabotagelimit={$term3} where nation='{$general['nation']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); //경험치, 공헌치 @@ -1728,7 +1728,7 @@ function process_74(&$general) { // pushWorldHistory($history, $admin['year'], $admin['month']); // pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']); - pushTrickLog($tricklog); + pushSabotageLog($sabotagelog); pushGenLog($general, $log); } @@ -1739,7 +1739,7 @@ function process_75(&$general) { $log = []; $alllog = []; $history = []; - $tricklog = []; + $sabotagelog = []; $date = substr($general['turntime'],11,5); @@ -1751,7 +1751,7 @@ function process_75(&$general) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $city = MYDB_fetch_array($result); - $query = "select nation,name,type,tricklimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; + $query = "select nation,name,type,sabotagelimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $nation = MYDB_fetch_array($result); @@ -1793,7 +1793,7 @@ function process_75(&$general) { $log[] = "●{$admin['month']}월:수뇌부가 아닙니다. 피장파장 실패. <1>$date"; } elseif($dip['state'] > 1) { $log[] = "●{$admin['month']}월:선포,전쟁중인 상대국에만 가능합니다. 피장파장 실패. <1>$date"; - } elseif($nation['tricklimit'] > 0) { + } elseif($nation['sabotagelimit'] > 0) { $log[] = "●{$admin['month']}월:전략기한이 남았습니다. 피장파장 실패. <1>$date"; } elseif($term < $term2) { $log[] = "●{$admin['month']}월:피장파장 수행중... ({$term}/{$term2}) <1>$date"; @@ -1829,13 +1829,13 @@ function process_75(&$general) { // $alllog[] = "●{$admin['month']}월:{$general['name']}(이)가 {$destnation['name']}피장파장(을)를 발동하였습니다."; // $history[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destnation['name']}피장파장(을)를 발동하였습니다."; - $tricklog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destnation['name']}피장파장(을)를 발동하였습니다."; + $sabotagelog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destnation['name']}피장파장(을)를 발동하였습니다."; pushGeneralHistory($general, "●{$admin['year']}년 {$admin['month']}월:{$destnation['name']}피장파장(을)를 발동"); pushNationHistory($nation, "●{$admin['year']}년 {$admin['month']}월:{$general['name']}(이)가 {$destnation['name']}피장파장(을)를 발동"); pushNationHistory($destnation, "●{$admin['year']}년 {$admin['month']}월:{$nation['name']}{$general['name']}(이)가 아국에 피장파장(을)를 발동"); //전략기한+60 - $query = "update nation set tricklimit=tricklimit+60 where nation='{$destnation['nation']}'"; + $query = "update nation set sabotagelimit=sabotagelimit+60 where nation='{$destnation['nation']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); // 국가보정 @@ -1844,7 +1844,7 @@ function process_75(&$general) { //전략기한, 최소72 if($term3 < 72) { $term3 = 72; } - $query = "update nation set tricklimit={$term3} where nation='{$general['nation']}'"; + $query = "update nation set sabotagelimit={$term3} where nation='{$general['nation']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); //경험치, 공헌치 @@ -1854,7 +1854,7 @@ function process_75(&$general) { // pushWorldHistory($history, $admin['year'], $admin['month']); // pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']); - pushTrickLog($tricklog); + pushSabotageLog($sabotagelog); pushGenLog($general, $log); } @@ -1865,7 +1865,7 @@ function process_76(&$general) { $log = []; $alllog = []; $history = []; - $tricklog = []; + $sabotagelog = []; $date = substr($general['turntime'],11,5); @@ -1877,7 +1877,7 @@ function process_76(&$general) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $city = MYDB_fetch_array($result); - $query = "select nation,name,type,tricklimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; + $query = "select nation,name,type,sabotagelimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $nation = MYDB_fetch_array($result); @@ -1906,7 +1906,7 @@ function process_76(&$general) { $log[] = "●{$admin['month']}월:아국이 아닙니다. 의병모집 실패. <1>$date"; } elseif($general['level'] < 5) { $log[] = "●{$admin['month']}월:수뇌부가 아닙니다. 의병모집 실패. <1>$date"; - } elseif($nation['tricklimit'] > 0) { + } elseif($nation['sabotagelimit'] > 0) { $log[] = "●{$admin['month']}월:전략기한이 남았습니다. 의병모집 실패. <1>$date"; } elseif($term < $term2) { $log[] = "●{$admin['month']}월:의병모집 수행중... ({$term}/{$term2}) <1>$date"; @@ -1933,7 +1933,7 @@ function process_76(&$general) { // $alllog[] = "●{$admin['month']}월:{$general['name']}(이)가 의병모집(을)를 발동하였습니다."; // $history[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 의병모집(을)를 발동하였습니다."; - $tricklog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 의병모집(을)를 발동하였습니다."; + $sabotagelog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 의병모집(을)를 발동하였습니다."; pushGeneralHistory($general, "●{$admin['year']}년 {$admin['month']}월:의병모집(을)를 발동"); pushNationHistory($nation, "●{$admin['year']}년 {$admin['month']}월:{$general['name']}(이)가 의병모집(을)를 발동"); @@ -2063,7 +2063,7 @@ function process_76(&$general) { if($nation['type'] == 12) { $term3 = $term3 * 2; } //전략기한, 국가 기술력 그대로 - $query = "update nation set tricklimit={$term3},totaltech=tech*'$gencount',gennum='$gennum' where nation='{$general['nation']}'"; + $query = "update nation set sabotagelimit={$term3},totaltech=tech*'$gencount',gennum='$gennum' where nation='{$general['nation']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); //경험치, 공헌치 @@ -2073,7 +2073,7 @@ function process_76(&$general) { // pushWorldHistory($history, $admin['year'], $admin['month']); // pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']); - pushTrickLog($tricklog); + pushSabotageLog($sabotagelog); pushGenLog($general, $log); } @@ -2084,7 +2084,7 @@ function process_77(&$general) { $log = []; $alllog = []; $history = []; - $tricklog = []; + $sabotagelog = []; $date = substr($general['turntime'],11,5); @@ -2096,7 +2096,7 @@ function process_77(&$general) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $city = MYDB_fetch_array($result); - $query = "select nation,name,type,tricklimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; + $query = "select nation,name,type,sabotagelimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $nation = MYDB_fetch_array($result); @@ -2136,7 +2136,7 @@ function process_77(&$general) { $log[] = "●{$admin['month']}월:수뇌부가 아닙니다. 이호경식 실패. <1>$date"; } elseif($dip['state'] > 1) { $log[] = "●{$admin['month']}월:선포,전쟁중인 상대국에만 가능합니다. 이호경식 실패. <1>$date"; - } elseif($nation['tricklimit'] > 0) { + } elseif($nation['sabotagelimit'] > 0) { $log[] = "●{$admin['month']}월:전략기한이 남았습니다. 이호경식 실패. <1>$date"; } elseif($term < $term2) { $log[] = "●{$admin['month']}월:이호경식 수행중... ({$term}/{$term2}) <1>$date"; @@ -2172,7 +2172,7 @@ function process_77(&$general) { // $alllog[] = "●{$admin['month']}월:{$general['name']}(이)가 {$destnation['name']}이호경식(을)를 발동하였습니다."; // $history[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destnation['name']}이호경식(을)를 발동하였습니다."; - $tricklog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destnation['name']}이호경식(을)를 발동하였습니다."; + $sabotagelog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destnation['name']}이호경식(을)를 발동하였습니다."; pushGeneralHistory($general, "●{$admin['year']}년 {$admin['month']}월:{$destnation['name']}이호경식(을)를 발동"); pushNationHistory($nation, "●{$admin['year']}년 {$admin['month']}월:{$general['name']}(이)가 {$destnation['name']}이호경식(을)를 발동"); pushNationHistory($destnation, "●{$admin['year']}년 {$admin['month']}월:{$nation['name']}{$general['name']}(이)가 아국에 이호경식(을)를 발동"); @@ -2191,7 +2191,7 @@ function process_77(&$general) { if($nation['type'] == 12) { $term3 = $term3 * 2; } //전략기한 - $query = "update nation set tricklimit={$term3} where nation='{$general['nation']}'"; + $query = "update nation set sabotagelimit={$term3} where nation='{$general['nation']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); //경험치, 공헌치 @@ -2201,7 +2201,7 @@ function process_77(&$general) { // pushWorldHistory($history, $admin['year'], $admin['month']); // pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']); - pushTrickLog($tricklog); + pushSabotageLog($sabotagelog); pushGenLog($general, $log); } @@ -2212,7 +2212,7 @@ function process_78(&$general) { $log = []; $alllog = []; $history = []; - $tricklog = []; + $sabotagelog = []; $date = substr($general['turntime'],11,5); @@ -2224,7 +2224,7 @@ function process_78(&$general) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $city = MYDB_fetch_array($result); - $query = "select nation,name,type,tricklimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; + $query = "select nation,name,type,sabotagelimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $nation = MYDB_fetch_array($result); @@ -2266,7 +2266,7 @@ function process_78(&$general) { $log[] = "●{$admin['month']}월:선포중인 상대국에만 가능합니다. 급습 실패. <1>$date"; } elseif($dip['term'] < 12) { $log[] = "●{$admin['month']}월:선포 12개월 이상인 상대국에만 가능합니다. 급습 실패. <1>$date"; - } elseif($nation['tricklimit'] > 0) { + } elseif($nation['sabotagelimit'] > 0) { $log[] = "●{$admin['month']}월:전략기한이 남았습니다. 급습 실패. <1>$date"; } elseif($term < $term2) { $log[] = "●{$admin['month']}월:급습 수행중... ({$term}/{$term2}) <1>$date"; @@ -2302,7 +2302,7 @@ function process_78(&$general) { // $alllog[] = "●{$admin['month']}월:{$general['name']}(이)가 {$destnation['name']}급습(을)를 발동하였습니다."; // $history[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destnation['name']}급습(을)를 발동하였습니다."; - $tricklog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destnation['name']}급습(을)를 발동하였습니다."; + $sabotagelog[] = "●{$admin['year']}년 {$admin['month']}월:【전략】{$nation['name']}(이)가 {$destnation['name']}급습(을)를 발동하였습니다."; pushGeneralHistory($general, "●{$admin['year']}년 {$admin['month']}월:{$destnation['name']}급습(을)를 발동"); pushNationHistory($nation, "●{$admin['year']}년 {$admin['month']}월:{$general['name']}(이)가 {$destnation['name']}급습(을)를 발동"); pushNationHistory($destnation, "●{$admin['year']}년 {$admin['month']}월:{$nation['name']}{$general['name']}(이)가 아국에 급습(을)를 발동"); @@ -2316,7 +2316,7 @@ function process_78(&$general) { if($nation['type'] == 12) { $term3 = $term3 * 2; } //전략기한 - $query = "update nation set tricklimit={$term3} where nation='{$general['nation']}'"; + $query = "update nation set sabotagelimit={$term3} where nation='{$general['nation']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); //경험치, 공헌치 @@ -2326,7 +2326,7 @@ function process_78(&$general) { // pushWorldHistory($history, $admin['year'], $admin['month']); // pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']); - pushTrickLog($tricklog); + pushSabotageLog($sabotagelog); pushGenLog($general, $log); } @@ -2348,7 +2348,7 @@ function process_81(&$general) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $city = MYDB_fetch_array($result); - $query = "select nation,can_change_flag,name,type,tricklimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; + $query = "select nation,can_change_flag,name,type,sabotagelimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $nation = MYDB_fetch_array($result); diff --git a/hwe/func_process_personnel.php b/hwe/func_process_personnel.php index fcd60126..0c80c62c 100644 --- a/hwe/func_process_personnel.php +++ b/hwe/func_process_personnel.php @@ -811,7 +811,7 @@ function process_55(&$general) { 'rice'=>GameConst::$baserice, 'rate'=>20, 'bill'=>100, - 'tricklimit'=>36, + 'sabotagelimit'=>36, 'surlimit'=>72, 'type'=>0, 'gennum'=>1 diff --git a/hwe/func_process_trick.php b/hwe/func_process_sabotage.php similarity index 94% rename from hwe/func_process_trick.php rename to hwe/func_process_sabotage.php index a7a22c35..d57b5f55 100644 --- a/hwe/func_process_trick.php +++ b/hwe/func_process_sabotage.php @@ -9,7 +9,7 @@ function process_32(&$general) { $log = []; $alllog = []; $history = []; - global $_firing, $_basefiring, $_firingbase, $_firingpower; + $date = substr($general['turntime'],11,5); $query = "select year,month,develcost from game limit 1"; @@ -57,7 +57,7 @@ function process_32(&$general) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $intelgen = MYDB_fetch_array($result); - $ratio = Util::round(((getGeneralIntel($general, true, true, true, false) - getGeneralIntel($intelgen, true, true, true, false)) / $_firing - ($destcity['secu']/$destcity['secu2'])/5 + $_basefiring)*100); + $ratio = Util::round(((getGeneralIntel($general, true, true, true, false) - getGeneralIntel($intelgen, true, true, true, false)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$defaultSabotageProb)*100); $ratio2 = rand() % 100; if($general['item'] == 5) { @@ -93,8 +93,8 @@ function process_32(&$general) { $alllog[] = "●{$admin['month']}월:{$destcity['name']}(이)가 불타고 있습니다."; $log[] = "●{$admin['month']}월:{$destcity['name']}에 화계가 성공했습니다. <1>$date"; - $destcity['agri'] -= rand() % $_firingpower + $_firingbase; - $destcity['comm'] -= rand() % $_firingpower + $_firingbase; + $destcity['agri'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$defaultSabotageAmount; + $destcity['comm'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$defaultSabotageAmount; if($destcity['agri'] < 0) { $destcity['agri'] = 0; } if($destcity['comm'] < 0) { $destcity['comm'] = 0; } $query = "update city set state=32,agri='{$destcity['agri']}',comm='{$destcity['comm']}' where city='$destination'"; @@ -102,7 +102,7 @@ function process_32(&$general) { $query = "update general set firenum=firenum+1 where no='{$general['no']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - TrickInjury($destination); + SabotageInjury($destination); $exp = rand() % 100 + 201; $ded = rand() % 70 + 141; } else { @@ -134,7 +134,7 @@ function process_33(&$general) { $log = []; $alllog = []; $history = []; - global $_firing, $_basefiring, $_firingbase, $_firingpower; + //탈취는 0까지 무제한 $date = substr($general['turntime'],11,5); @@ -187,7 +187,7 @@ function process_33(&$general) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $powergen = MYDB_fetch_array($result); - $ratio = Util::round(((getGeneralPower($general, true, true, true, false) - getGeneralPower($powergen, true, true, true, false)) / $_firing - ($destcity['secu']/$destcity['secu2'])/5 + $_basefiring)*100); + $ratio = Util::round(((getGeneralPower($general, true, true, true, false) - getGeneralPower($powergen, true, true, true, false)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$defaultSabotageProb)*100); $ratio2 = rand() % 100; if($general['item'] == 5) { @@ -224,8 +224,8 @@ function process_33(&$general) { $log[] = "●{$admin['month']}월:{$destcity['name']}에 탈취가 성공했습니다. <1>$date"; // 탈취 최대 400 * 8 - $gold = (rand() % $_firingpower + $_firingbase) * $destcity['level']; - $rice = (rand() % $_firingpower + $_firingbase) * $destcity['level']; + $gold = (rand() % GameConst::$sabotageAmountCoef + GameConst::$defaultSabotageAmount) * $destcity['level']; + $rice = (rand() % GameConst::$sabotageAmountCoef + GameConst::$defaultSabotageAmount) * $destcity['level']; $nation['gold'] -= $gold; $nation['rice'] -= $rice; @@ -254,7 +254,7 @@ function process_33(&$general) { } $log[] = "●금$gold 쌀$rice을 획득했습니다."; -// TrickInjury($destination); +// SabotageInjury($destination); $exp = rand() % 100 + 201; $ded = rand() % 70 + 141; } else { @@ -286,7 +286,7 @@ function process_34(&$general) { $log = []; $alllog = []; $history = []; - global $_firing, $_basefiring, $_firingbase, $_firingpower; + $date = substr($general['turntime'],11,5); $query = "select year,month,develcost from game limit 1"; @@ -334,7 +334,7 @@ function process_34(&$general) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $powergen = MYDB_fetch_array($result); - $ratio = Util::round(((getGeneralPower($general, true, true, true, false) - getGeneralPower($powergen, true, true, true, false)) / $_firing - ($destcity['secu']/$destcity['secu2'])/5 + $_basefiring)*100); + $ratio = Util::round(((getGeneralPower($general, true, true, true, false) - getGeneralPower($powergen, true, true, true, false)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$defaultSabotageProb)*100); $ratio2 = rand() % 100; if($general['item'] == 5) { @@ -371,8 +371,8 @@ function process_34(&$general) { $log[] = "●{$admin['month']}월:{$destcity['name']}에 파괴가 성공했습니다. <1>$date"; // 파괴 - $destcity['def'] -= rand() % $_firingpower + $_firingbase; - $destcity['wall'] -= rand() % $_firingpower + $_firingbase; + $destcity['def'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$defaultSabotageAmount; + $destcity['wall'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$defaultSabotageAmount; if($destcity['def'] < 100) { $destcity['def'] = 100; } if($destcity['wall'] < 100) { $destcity['wall'] = 100; } $query = "update city set state=34,def='{$destcity['def']}',wall='{$destcity['wall']}' where city='$destination'"; @@ -380,7 +380,7 @@ function process_34(&$general) { $query = "update general set firenum=firenum+1 where no='{$general['no']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - TrickInjury($destination); + SabotageInjury($destination); $exp = rand() % 100 + 201; $ded = rand() % 70 + 141; } else { @@ -412,7 +412,7 @@ function process_35(&$general) { $log = []; $alllog = []; $history = []; - global $_firing, $_basefiring, $_firingbase, $_firingpower; + $date = substr($general['turntime'],11,5); $query = "select year,month,develcost from game limit 1"; @@ -462,7 +462,7 @@ function process_35(&$general) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $gen = MYDB_fetch_array($result); - $ratio = Util::round(((getGeneralLeadership($general, true, true, true) - getGeneralLeadership($gen, true, true, true)) / $_firing - ($destcity['secu']/$destcity['secu2'])/5 + $_basefiring)*100); + $ratio = Util::round(((getGeneralLeadership($general, true, true, true) - getGeneralLeadership($gen, true, true, true)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$defaultSabotageProb)*100); $ratio2 = rand() % 100; if($general['item'] == 5) { @@ -499,8 +499,8 @@ function process_35(&$general) { $log[] = "●{$admin['month']}월:{$destcity['name']}에 선동이 성공했습니다. <1>$date"; // 선동 최대 10 - $destcity['secu'] -= rand() % Util::round($_firingpower/2) + $_firingbase; - $destcity['rate'] -= rand() % Util::round($_firingpower/50) + $_firingbase/50; + $destcity['secu'] -= rand() % Util::round(GameConst::$sabotageAmountCoef/2) + GameConst::$defaultSabotageAmount; + $destcity['rate'] -= rand() % Util::round(GameConst::$sabotageAmountCoef/50) + GameConst::$defaultSabotageAmount/50; if($destcity['secu'] < 0) { $destcity['secu'] = 0; } if($destcity['rate'] < 0) { $destcity['rate'] = 0; } $query = "update city set state=32,rate='{$destcity['rate']}',secu='{$destcity['secu']}' where city='$destination'"; @@ -508,7 +508,7 @@ function process_35(&$general) { $query = "update general set firenum=firenum+1 where no='{$general['no']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - TrickInjury($destination); + SabotageInjury($destination); $exp = rand() % 100 + 201; $ded = rand() % 70 + 141; } else { diff --git a/hwe/func_time_event.php b/hwe/func_time_event.php index 166d4da8..8a0cf97b 100644 --- a/hwe/func_time_event.php +++ b/hwe/func_time_event.php @@ -713,7 +713,7 @@ function disaster() { $query = "update city set state='$state',pop=pop*{$ratio},rate=rate*{$ratio},agri=agri*{$ratio},comm=comm*{$ratio},secu=secu*{$ratio},def=def*{$ratio},wall=wall*{$ratio} where city='$disastercity[$i]'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - TrickInjury($disastercity[$i], 1); + SabotageInjury($disastercity[$i], 1); } } else { for($i=0; $i < count($disastercity); $i++) { diff --git a/hwe/j_msg_submit.php b/hwe/j_msg_submit.php index d5085e6b..97aa32ff 100644 --- a/hwe/j_msg_submit.php +++ b/hwe/j_msg_submit.php @@ -7,10 +7,10 @@ include 'func.php'; $post = WebUtil::parseJsonPost(); '@phan-var mixed[] $post'; -$v = new Validator(); -$v->rule('required', ['mailbox','msg']); +$v = new Validator($post); +$v->rule('required', ['mailbox','text']); $v->rule('integer', 'mailbox'); -$v->rule('lengthMin', 'msg', 1); +$v->rule('lengthMin', 'text', 1); if(!$v->validate()){ Json::die([ @@ -21,7 +21,7 @@ if(!$v->validate()){ } $mailbox = (int)$post['mailbox']; -$text = StringUtil::cutStringForWidth($post['msg'], 100, ''); +$text = StringUtil::cutStringForWidth($post['text'], 100, ''); $session = Session::requireGameLogin([ 'msgID'=>null diff --git a/hwe/lib.php b/hwe/lib.php index 4fe54c6b..06047ae1 100644 --- a/hwe/lib.php +++ b/hwe/lib.php @@ -21,34 +21,12 @@ $loader->addClassMap((function () { //디버그용 매크로 ini_set("session.cache_expire", 10080); // minutes - - include "MYDB.php"; // 각종 변수 define('STEP_LOG', true); define('PROCESS_LOG', true); $_startTime = microtime(true); -$_upgradeLimit = 30; // 능력치 상승 경험치 -$_dexLimit = 1000000; // 숙련도 제한치 -$_defaultatmos = 40; // 초기 사기치 -$_defaulttrain = 40; // 초기 훈련치 -$_defaultatmos2 = 70; // 초기 사기치 -$_defaulttrain2 = 70; // 초기 훈련치 -$_maxtrain = 100; // 최대 훈련치 -$_maxatmos = 100; // 인위적으로 올릴 수 있는 최대 사기치 -$_maximumatmos = 150; // 최대 사기치 -$_maximumtrain = 110; // 최대 훈련치 -$_training = 30; // 풀징병시 훈련 1회 상승량 -$_atmosing = 0.98; // 훈련시 사기 감소율 -$_basefiring = 0.25; // 계략 기본 성공률 -$_firing = 300; // 계략시 확률 가중치(수치가 클수록 변화가 적음 : (지력차/$_firing + $_basefiring) -$_firingbase = 100; // 계략시 기본 수치 감소량 -$_firingpower = 400; // 계략시 수치 감소량($_firingbase ~ $_firingpower) -$x_goodgenleader = 65; // 명장,지장에 사용될 통솔 제한 -$x_goodgenpower = 65; // 명장에 사용될 무력 제한 -$x_goodgenintel = 65; // 지장에 사용될 지력 제한 -$_taxrate = 0.01; // 군량 매매시 세율 ob_start(); session_cache_limiter('nocache');//NOTE: 캐시가 가능하도록 설정해야 할 수도 있음. 주의! diff --git a/hwe/process_war.php b/hwe/process_war.php index 0d17ed57..761315a2 100644 --- a/hwe/process_war.php +++ b/hwe/process_war.php @@ -10,7 +10,6 @@ function processWar($general, $city) { $templates = new \League\Plates\Engine('templates'); - global $_maximumatmos, $_maximumtrain, $_dexLimit; $date = substr($general['turntime'],11,5); $query = "select * from game limit 1"; @@ -133,7 +132,7 @@ function processWar($general, $city) { // 장수가 없어서 도시 공격하려했으나 병량없을시 if($opposecount == 0 && $destnation['nation'] > 0 && $destnation['rice'] <= 0 && $city['supply'] == 1) { $general['train'] += 1; //훈련 상승 - if($general['train'] > $_maximumtrain) { $general['train'] = $_maximumtrain; } + if($general['train'] > GameConst::$maxTrainByWar) { $general['train'] = GameConst::$maxTrainByWar; } $query = "update general set recwar='{$general['turntime']}',train='{$general['train']}',warnum=warnum+1 where no='{$general['no']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); @@ -164,7 +163,7 @@ function processWar($general, $city) { $log[] = "●".GameUnitConst::byId($general['crewtype'])->name."(으)로 성벽을 공격합니다."; $general['train'] += 1; //훈련 상승 - if($general['train'] > $_maximumtrain) { $general['train'] = $_maximumtrain; } + if($general['train'] > GameConst::$maxTrainByWar) { $general['train'] = GameConst::$maxTrainByWar; } $query = "update general set recwar='{$general['turntime']}',train='{$general['train']}',warnum=warnum+1 where no='{$general['no']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); @@ -575,9 +574,9 @@ function processWar($general, $city) { } $general['train'] += 1; //훈련 상승 - if($general['train'] > $_maximumtrain) { $general['train'] = $_maximumtrain; } + if($general['train'] > GameConst::$maxTrainByWar) { $general['train'] = GameConst::$maxTrainByWar; } $oppose['train'] += 1; //훈련 상승 - if($oppose['train'] > $_maximumtrain) { $oppose['train'] = $_maximumtrain; } + if($oppose['train'] > GameConst::$maxTrainByWar) { $oppose['train'] = GameConst::$maxTrainByWar; } $query = "update general set recwar='{$general['turntime']}',train='{$general['train']}',warnum=warnum+1 where no='{$general['no']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); @@ -1398,7 +1397,7 @@ function processWar($general, $city) { $opposecount--; $general['atmos'] *= 1.1; //사기 증가 - if($general['atmos'] > $_maximumatmos) { $general['atmos'] = $_maximumatmos; } + if($general['atmos'] > GameConst::$maxAtmosByWar) { $general['atmos'] = GameConst::$maxAtmosByWar; } $query = "update general set atmos='{$general['atmos']}',killnum=killnum+1 where no='{$general['no']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); @@ -1445,7 +1444,7 @@ function processWar($general, $city) { } $oppose['atmos'] *= 1.1; //사기 증가 - if($oppose['atmos'] > $_maximumatmos) { $oppose['atmos'] = $_maximumatmos; } + if($oppose['atmos'] > GameConst::$maxAtmosByWar) { $oppose['atmos'] = GameConst::$maxAtmosByWar; } // 상대장수 경험 등등 증가 $opexp = Util::round($opexp / 50 * 0.8); @@ -1703,8 +1702,6 @@ function ConquerCity($game, $general, $city, $nation, $destnation) { $db = DB::db(); $connect=$db->get(); - global $_maximumatmos; - $alllog = []; $log = []; $history = []; @@ -1890,7 +1887,7 @@ function ConquerCity($game, $general, $city, $nation, $destnation) { } $general['atmos'] *= 1.1; //사기 증가 - if($general['atmos'] > $_maximumatmos) { $general['atmos'] = $_maximumatmos; } + if($general['atmos'] > GameConst::$maxAtmosByWar) { $general['atmos'] = GameConst::$maxAtmosByWar; } $conquerNation = getConquerNation($city); diff --git a/hwe/processing.php b/hwe/processing.php index f09cd1cf..844a4f39 100644 --- a/hwe/processing.php +++ b/hwe/processing.php @@ -974,7 +974,7 @@ function command_25($turn, $command) { $result = MYDB_query($query, $connect) or Error("command_27 ".MYDB_error($connect),""); $me = MYDB_fetch_array($result); - $query = "select nation,name,color,scout,scoutmsg,tricklimit,gennum from nation order by gennum"; + $query = "select nation,name,color,scout,scoutmsg,sabotagelimit,gennum from nation order by gennum"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $count = MYDB_num_rows($result); diff --git a/hwe/sammo/GameConst.php b/hwe/sammo/GameConst.php index a893603a..43d1615d 100644 --- a/hwe/sammo/GameConst.php +++ b/hwe/sammo/GameConst.php @@ -15,34 +15,36 @@ class GameConst public static $upgradeLimit = 30; /** @var int 숙련도 제한치*/ public static $dexLimit = 1000000; - /** @var int 초기 사기치*/ - public static $defaultatmos = 40; - /** @var int 초기 훈련치*/ - public static $defaulttrain = 40; - /** @var int 초기 사기치*/ - public static $defaultatmos2 = 70; - /** @var int 초기 훈련치*/ - public static $defaulttrain2 = 70; - /** @var int 최대 훈련치*/ - public static $maxtrain = 100; - /** @var int 인위적으로 올릴 수 있는 최대 사기치*/ - public static $maxatmos = 100; - /** @var int 최대 사기치*/ - public static $maximumatmos = 150; - /** @var int 최대 훈련치*/ - public static $maximumtrain = 110; + /** @var int 초기 징병 사기치*/ + public static $defaultAtmosLow = 40; + /** @var int 초기 징병 훈련치*/ + public static $defaultTrainLow = 40; + /** @var int 초기 모병 사기치*/ + public static $defaultAtmosHigh = 70; + /** @var int 초기 모병 훈련치*/ + public static $defaultTrainHigh = 70; + /** @var int 사기진작으로 올릴 수 있는 최대 사기치*/ + public static $maxAtmosByCommand = 100; + /** @var int 훈련으로 올릴 수 있는 최대 사기치*/ + public static $maxTrainByCommand = 100; + /** @var int 전투로 올릴 수 있는 최대 사기치*/ + public static $maxAtmosByWar = 150; + /** @var int 전투로 올릴 수 훈련치*/ + public static $maxTrainByWar = 110; /** @var int 풀징병시 훈련 1회 상승량*/ - public static $training = 30; + public static $trainDelta = 30; + /** @var int 풀징병시 훈련 1회 상승량*/ + public static $atmosDelta = 30; /** @var float 훈련시 사기 감소율*/ - public static $atmosing = 0.98; + public static $atmosSideEffectByTraining = 0.98; /** @var float 계략 기본 성공률*/ - public static $basefiring = 0.25; - /** @var int 계략시 확률 가중치(수치가 클수록 변화가 적음 : (지력차/public static $firing + public static $basefiring)*/ - public static $firing = 300; + public static $sabotageDefaultProb = 0.25; + /** @var int 계략시 확률 가중치(수치가 클수록 변화가 적음 : (지력차/$firing + $basefiring)*/ + public static $sabotageProbCoefByStat = 300; /** @var int 계략시 기본 수치 감소량*/ - public static $firingbase = 100; - /** @var int 계략시 수치 감소량(public static $firingbase ~ public static $firingpower)*/ - public static $firingpower = 400; + public static $sabotageDefaultAmount = 100; + /** @var int 계략시 수치 감소량($firingbase ~ $firingpower)*/ + public static $sabotageAmountCoef = 400; /** @var int 명장,지장에 사용될 통솔 제한*/ public static $goodgenleader = 65; /** @var int 명장에 사용될 무력 제한*/ @@ -68,7 +70,7 @@ class GameConst /** @var int 최저 병량(긴급시) */ public static $minNationalRice = 0; /** @var float 군량 매매시 세율*/ - public static $taxrate = 0.01; + public static $exchangeFee = 0.01; /** @var float 성인 연령 */ public static $adultAge = 14; diff --git a/hwe/sammo/Scenario/Nation.php b/hwe/sammo/Scenario/Nation.php index e6d4eff2..9cf9b793 100644 --- a/hwe/sammo/Scenario/Nation.php +++ b/hwe/sammo/Scenario/Nation.php @@ -85,7 +85,7 @@ class Nation{ 'rate'=>15, 'scout'=>0, 'war'=>0, - 'tricklimit'=>24, + 'sabotagelimit'=>24, 'surlimit'=>72, 'scoutmsg'=>$this->infoText, 'tech'=>$this->tech, diff --git a/hwe/sql/schema.sql b/hwe/sql/schema.sql index a1dfd6fb..7d42ce52 100644 --- a/hwe/sql/schema.sql +++ b/hwe/sql/schema.sql @@ -192,7 +192,7 @@ create table nation ( l5set int(1) default 0, scout int(1) default 0, war int(1) default 0, - tricklimit int(4) default 36, + sabotagelimit int(4) default 36, surlimit int(4) default 72, scoutmsg text default '', tech int(8) default 0, totaltech int(8) default 0,
전 략{$nation['tricklimit']}{$nation['sabotagelimit']} 외 교 {$nation['surlimit']}