From 78ff016defaa949c55af74847e64360c2bd806bb Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 3 Oct 2019 15:12:25 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B0=90=EC=B6=95=20=EC=A1=B0=EA=B1=B4=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD,=20=EC=A6=9D/=EA=B0=90=EC=B6=95=EC=8B=9C=20?= =?UTF-8?q?=EB=B3=80=ED=99=94=EB=9F=89=EC=9D=84=20=EC=A7=80=EC=A0=95?= =?UTF-8?q?=EA=B0=80=EB=8A=A5=ED=95=98=EB=8F=84=EB=A1=9D=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/func_process_chief.php | 48 ++++++++++++++++++++++++++----------- hwe/func_time_event.php | 2 +- hwe/sammo/GameConstBase.php | 9 +++++++ 3 files changed, 44 insertions(+), 15 deletions(-) diff --git a/hwe/func_process_chief.php b/hwe/func_process_chief.php index 04125696..95e52b79 100644 --- a/hwe/func_process_chief.php +++ b/hwe/func_process_chief.php @@ -1131,8 +1131,16 @@ function process_67(&$general) { MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); //수도 증축 - $query = "update city set upgrading=upgrading+1,level=level+1,pop2=pop2+100000,agri2=agri2+2000,comm2=comm2+2000,def2=def2+2000,wall2=wall2+2000,secu2=secu2+2000 where city='{$destcity['city']}'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + $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), + ], 'city=%i', $destcity['city']); //경험치, 공헌치 $query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'"; @@ -1187,12 +1195,10 @@ function process_68(&$general) { $log[] = "●{$admin['month']}월:수도에서 실행해야 합니다. 감축 실패. <1>$date"; } elseif($nation['capital'] != $destcity['city']) { $log[] = "●{$admin['month']}월:수도만 가능합니다. 감축 실패. <1>$date"; - } elseif($destcity['level'] <= 3) { - $log[] = "●{$admin['month']}월:수진, 진, 관문은 불가능합니다. 감축 실패. <1>$date"; - } elseif($destcity['level'] <= 6) { - $log[] = "●{$admin['month']}월:더이상 감축할 수 없습니다. 감축 실패. <1>$date"; } elseif($destcity['upgrading'] <= 0) { $log[] = "●{$admin['month']}월:증축된 도시가 아닙니다. 감축 실패. <1>$date"; + } elseif($destcity['level'] <= 4) { + $log[] = "●{$admin['month']}월:수, 진, 관문, 이성은 불가능합니다. 감축 실패. <1>$date"; } elseif($general['level'] < 5) { $log[] = "●{$admin['month']}월:수뇌부가 아닙니다. 감축 실패. <1>$date"; } elseif($nation['capset'] == 1) { @@ -1224,12 +1230,12 @@ function process_68(&$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),""); - $pop = $destcity['pop'] - 100000; - $agri = $destcity['agri'] - 2000; - $comm = $destcity['comm'] - 2000; - $def = $destcity['def'] - 2000; - $wall = $destcity['wall'] - 2000; - $secu = $destcity['secu'] - 2000; + $pop = $destcity['pop'] - GameConst::$expandCityPopIncreaseAmount; + $agri = $destcity['agri'] - GameConst::$expandCityDevelIncreaseAmount; + $comm = $destcity['comm'] - GameConst::$expandCityDevelIncreaseAmount; + $def = $destcity['def'] - GameConst::$expandCityWallIncreaseAmount; + $wall = $destcity['wall'] - GameConst::$expandCityWallIncreaseAmount; + $secu = $destcity['secu'] - GameConst::$expandCityDevelIncreaseAmount; if($pop < 30000) { $pop = 30000; } if($agri < 0) { $agri = 0; } if($comm < 0) { $comm = 0; } @@ -1237,8 +1243,22 @@ function process_68(&$general) { if($wall < 0) { $wall = 0; } if($secu < 0) { $secu = 0; } //수도 감축 - $query = "update city set upgrading=upgrading-1,level=level-1,pop2=pop2-100000,agri2=agri2-2000,comm2=comm2-2000,def2=def2-2000,wall2=wall2-2000,secu2=secu2-2000,pop='$pop',agri='$agri',comm='$comm',def='$def',wall='$wall',secu='$secu' where city='{$destcity['city']}'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + $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'=>$pop, + 'agri'=>$agri, + 'comm'=>$comm, + 'secu'=>$secu, + 'def'=>$def, + 'wall'=>$wall + ], 'city=%i', $destcity['city']); //경험치, 공헌치 $query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'"; diff --git a/hwe/func_time_event.php b/hwe/func_time_event.php index 49da5719..da617ff6 100644 --- a/hwe/func_time_event.php +++ b/hwe/func_time_event.php @@ -178,7 +178,7 @@ function popIncrease() { $ratio *= (1 - $city['secu']/$city['secu2']/10); //치안에 따라 최대 10% 경감 } - $pop = $city['pop'] + (int)($city['pop'] * $ratio) + 5000; // 기본 5000명은 증가 + $pop = $city['pop'] + (int)($city['pop'] * $ratio) + GameConst::$basePopIncreaseAmount; // 기본인구는 증가 $ratio = round($ratio*100, 2); $cityrate = $city['rate']; diff --git a/hwe/sammo/GameConstBase.php b/hwe/sammo/GameConstBase.php index 33e6fab2..9a04f049 100644 --- a/hwe/sammo/GameConstBase.php +++ b/hwe/sammo/GameConstBase.php @@ -74,6 +74,15 @@ class GameConstBase /** @var int 최대 기술 레벨 */ public static $maxTechLevel = 12; + /** @var int 최소 인구 증가량 */ + public static $basePopIncreaseAmount = 5000; + /** @var int 증축시 인구 증가량 */ + public static $expandCityPopIncreaseAmount = 10000; + /** @var int 증축시 내정 증가량 */ + public static $expandCityDevelIncreaseAmount = 2000; + /** @var int 증축시 성벽 증가량 */ + public static $expandCityWallIncreaseAmount = 2000; + /** @var int 초기 제한시 장수 제한 */ public static $initialNationGenLimitForRandInit = 3;