From 34bdcc1456de2e4c7accf3ff9cf6e8b88d0e2f9d Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 4 May 2019 00:09:50 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=B8=EC=9C=A8=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=9D=BC=20=EB=82=B4=EC=A0=95=EC=9D=B4=20=EB=81=9D=EC=97=86?= =?UTF-8?q?=EC=9D=B4=20=EC=98=A4=EB=A5=B4=EB=8A=94=20=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_time_event.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/hwe/func_time_event.php b/hwe/func_time_event.php index 47fa3deb..1d22c49b 100644 --- a/hwe/func_time_event.php +++ b/hwe/func_time_event.php @@ -160,11 +160,16 @@ function popIncrease() { $wall = $city['wall']; } else { $ratio = (20 - $rate[$city['nation']])/200; // 20일때 0% 0일때 10% 100일때 -40% - $agri = $city['agri'] + intval($city['agri'] * $ratio); //내정도 증감 - $comm = $city['comm'] + intval($city['comm'] * $ratio); - $secu = $city['secu'] + intval($city['secu'] * $ratio); - $def = $city['def'] + intval($city['def'] * $ratio); - $wall = $city['wall'] + intval($city['wall'] * $ratio); + $agri = $city['agri']; //내정도 증감 + $comm = $city['comm']; + $secu = $city['secu']; + $def = $city['def'] ; + $wall = $city['wall']; + if($ratio < 0 || $city['agri'] < $city['agri2']) $agri += intval($city['agri'] * $ratio); //내정도 증감 + if($ratio < 0 || $city['comm'] < $city['comm2']) $comm += intval($city['comm'] * $ratio); + if($ratio < 0 || $city['secu'] < $city['secu2']) $secu += intval($city['secu'] * $ratio); + if($ratio < 0 || $city['def'] < $city['def2'] ) $def += intval($city['def'] * $ratio); + if($ratio < 0 || $city['wall'] < $city['wall2']) $wall += intval($city['wall'] * $ratio); $ratio = (30 - $rate[$city['nation']])/200; // 20일때 5% 5일때 12.5% 50일때 -10% if($ratio >= 0) { // 국가보정 @@ -178,7 +183,10 @@ function popIncrease() { $ratio *= (1 - $city['secu']/$city['secu2']/10); //치안에 따라 최대 10% 경감 } - $pop = $city['pop'] + (int)($city['pop'] * $ratio) + 5000; // 기본 5000명은 증가 + if($ratio < 0 || $city['pop'] < $city['pop2']){ + $pop = $city['pop'] + (int)($city['pop'] * $ratio) + 5000; // 기본 5000명은 증가 + } + $ratio = round($ratio*100, 2); $cityrate = $city['rate'];