From 08891b36aad48ada5cae49ef8e3ed51475ce3f93 Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 30 Jan 2020 02:17:59 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A6=9D=EC=B6=95,=20=EA=B0=90=EC=B6=95=20?= =?UTF-8?q?=EC=BB=A4=EB=A7=A8=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func.php | 4 ++-- hwe/func_process_chief.php | 35 ++++++++++++++++++----------------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/hwe/func.php b/hwe/func.php index 2e06b94c..d291cf67 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -807,8 +807,8 @@ function CoreCommandTable() { addCommand("초토화", 65, $valid); addCommand("천도/3턴(금쌀{$develcost}0)", 66, $valid); $cost = $develcost * GameConst::$expandCityCostCoef + GameConst::$expandCityDefaultCost; // 7만~13만 - addCommand("증축/6턴(금쌀{$cost})", 67, $valid); - addCommand("감축/6턴", 68, $valid); + addCommand("증축/3턴(금쌀{$cost})", 67, $valid); + addCommand("감축/3턴", 68, $valid); commandGroup("", 1); commandGroup("====== 전 략 ======"); $term = Util::round(sqrt($genCount*8)*10); diff --git a/hwe/func_process_chief.php b/hwe/func_process_chief.php index 599cb7c0..332e9a09 100644 --- a/hwe/func_process_chief.php +++ b/hwe/func_process_chief.php @@ -1074,7 +1074,7 @@ function process_67(&$general) { $command = DecodeCommand($nation["l{$general['level']}turn0"]); $which = $command[1]; - $query = "select city,name,nation,level from city where city='$which'"; + $query = "select city,name,nation,level,front from city where city='$which'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $destcity = MYDB_fetch_array($result); @@ -1089,10 +1089,11 @@ function process_67(&$general) { $code = 100 + 67; } - if($nation['capital'] != $general['city']) { - $log[] = "●{$admin['month']}월:수도에서 실행해야 합니다. 증축 실패. <1>$date"; - } elseif($nation['capital'] != $destcity['city']) { - $log[] = "●{$admin['month']}월:수도만 가능합니다. 증축 실패. <1>$date"; + if($destcity['nation'] != $general['nation']){ + $log[] = "●{$admin['month']}월:아군 도시가 아닙니다. 증축 실패. <1>$date"; + } + else if($nation['capital'] != $destcity['city'] && $destcity['front'] == 1) { + $log[] = "●{$admin['month']}월:접경 도시 증축은 수도만 가능합니다. 증축 실패. <1>$date"; } elseif($destcity['level'] <= 3) { $log[] = "●{$admin['month']}월:수진, 진, 관문은 불가능합니다. 증축 실패. <1>$date"; } elseif($destcity['level'] >= 8) { @@ -1103,8 +1104,8 @@ function process_67(&$general) { $log[] = "●{$admin['month']}월:다음 분기에 가능합니다. 증축 실패. <1>$date"; } elseif($nation['gold']-GameConst::$basegold < $amount || $nation['rice']-GameConst::$baserice < $amount) { $log[] = "●{$admin['month']}월:물자가 부족합니다. 증축 실패. <1>$date"; - } elseif($term < 6) { - $log[] = "●{$admin['month']}월:증축중... ({$term}/6) <1>$date"; + } elseif($term < 3) { + $log[] = "●{$admin['month']}월:증축중... ({$term}/3) <1>$date"; $query = "update nation set l{$general['level']}term={$code} where nation='{$general['nation']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); @@ -1130,7 +1131,7 @@ function process_67(&$general) { $query = "update nation set l{$general['level']}term='0',capset='1',gold=gold-'$amount',rice=rice-'$amount' where nation='{$general['nation']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - //수도 증축 + //증축 $db->update('city', [ 'upgrading'=>$db->sqleval('upgrading+1'), 'level'=>$db->sqleval('level+1'), @@ -1165,7 +1166,7 @@ function process_68(&$general) { $admin = $gameStor->getValues(['year','month','develcost']); - $query = "select nation,supply from city where city='{$general['city']}'"; + $query = "select nation,supply,front from city where city='{$general['city']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $city = MYDB_fetch_array($result); @@ -1190,12 +1191,12 @@ function process_68(&$general) { $term = 1; $code = 100 + 68; } - - if($nation['capital'] != $general['city']) { - $log[] = "●{$admin['month']}월:수도에서 실행해야 합니다. 감축 실패. <1>$date"; - } elseif($nation['capital'] != $destcity['city']) { - $log[] = "●{$admin['month']}월:수도만 가능합니다. 감축 실패. <1>$date"; - } elseif($destcity['upgrading'] <= 0) { + if($destcity['nation'] != $general['nation']){ + $log[] = "●{$admin['month']}월:아군 도시가 아닙니다. 감축 실패. <1>$date"; + } + else if($nation['capital'] != $destcity['city'] && $destcity['front'] == 1) { + $log[] = "●{$admin['month']}월:접경 도시 감축은 수도만 가능합니다. 감축 실패. <1>$date"; + } elseif($destcity['level'] == 5) { $log[] = "●{$admin['month']}월:증축된 도시가 아닙니다. 감축 실패. <1>$date"; } elseif($destcity['level'] <= 4) { $log[] = "●{$admin['month']}월:수, 진, 관문, 이성은 불가능합니다. 감축 실패. <1>$date"; @@ -1203,8 +1204,8 @@ function process_68(&$general) { $log[] = "●{$admin['month']}월:수뇌부가 아닙니다. 감축 실패. <1>$date"; } elseif($nation['capset'] == 1) { $log[] = "●{$admin['month']}월:다음 분기에 가능합니다. 감축 실패. <1>$date"; - } elseif($term < 6) { - $log[] = "●{$admin['month']}월:감축중... ({$term}/6) <1>$date"; + } elseif($term < 3) { + $log[] = "●{$admin['month']}월:감축중... ({$term}/3) <1>$date"; $query = "update nation set l{$general['level']}term={$code} where nation='{$general['nation']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");