From 79a199cbd3716c839d64ed1ad6496d230d254ec7 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 28 Sep 2019 07:56:32 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=90=EB=8F=99=20=EC=A7=84=ED=96=89=20?= =?UTF-8?q?=EB=AA=A8=EB=93=9C=EC=9D=BC=20=EB=95=8C=20=EB=AA=A8=EB=B0=98?= =?UTF-8?q?=EC=9D=B4=20=EA=B1=B0=EC=9D=98=20=ED=95=AD=EC=83=81=20=EA=B0=80?= =?UTF-8?q?=EB=8A=A5=ED=95=B4=EC=A7=80=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_process_personnel.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/hwe/func_process_personnel.php b/hwe/func_process_personnel.php index 03c965d0..0cba4b8a 100644 --- a/hwe/func_process_personnel.php +++ b/hwe/func_process_personnel.php @@ -1075,7 +1075,7 @@ function process_57(&$general) { $history = []; $date = substr($general['turntime'],11,5); - $admin = $gameStor->getValues(['year', 'month', 'killturn']); + $admin = $gameStor->getValues(['year', 'month', 'killturn', 'autorun_user', 'turn_term']); $query = "select nation,name from nation where nation='{$general['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); @@ -1089,6 +1089,19 @@ function process_57(&$general) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $ruler = MYDB_fetch_array($result); + $killTurnLimit = $admin['killturn']; + $autorunLimit = $admin['autorun_user']['limit_minutes']??0; + if($autorunLimit){ + $autorunLimit /= $admin['turn_term']; + if($autorunLimit < GameConst::$maxTurn){ + $killTurnLimit -= $autorunLimit; + } + else{ + $killTurnLimit -= Util::toInt(sqrt(GameConst::$maxTurn * $autorunLimit)); + } + } + + if($general['level'] == 0) { $log[] = "●{$admin['month']}월:재야 입니다. 모반 실패. <1>$date"; } elseif($general['level'] < 5) { @@ -1099,7 +1112,7 @@ function process_57(&$general) { $log[] = "●{$admin['month']}월:고립된 도시입니다. 모반 실패. <1>$date"; } elseif($general['level'] == 12) { $log[] = "●{$admin['month']}월:이미 군주 입니다. 모반 실패. <1>$date"; - } elseif($ruler['killturn'] >= $admin['killturn']) { + } elseif($ruler['killturn'] >= $killTurnLimit) { $log[] = "●{$admin['month']}월:군주가 활동중입니다. 모반 실패. <1>$date"; } elseif($ruler['npc'] >= 2) { $log[] = "●{$admin['month']}월:군주가 NPC입니다. 모반 실패. <1>$date";