From 13fccb998efcef3a1e95f8c5b995615299dbc142 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 29 Apr 2018 01:47:48 +0900 Subject: [PATCH] =?UTF-8?q?=EB=85=84=EB=8F=84=20=EA=B3=84=EC=82=B0=20?= =?UTF-8?q?=EA=B3=B5=EC=8B=9D=20=EC=9E=AC=20=EC=88=98=EC=A0=95.=20?= =?UTF-8?q?=EC=8B=9C=EB=82=98=EB=A6=AC=EC=98=A4=20=EC=8B=9C=EC=9E=91?= =?UTF-8?q?=EC=8B=9C=20=EB=82=A8=EC=9D=80=20=EA=B0=9C=EC=9B=94=20=EC=88=98?= =?UTF-8?q?=EB=A5=BC=20=EA=B3=84=EC=82=B0.=20=EB=B0=98=EB=8F=99=ED=83=81?= =?UTF-8?q?=EC=97=B0=ED=95=A9=20=EC=8B=9C=EB=82=98=EB=A6=AC=EC=98=A4=20?= =?UTF-8?q?=EC=99=B8=EA=B5=90=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func.php | 2 +- hwe/sammo/Scenario.php | 4 +- hwe/scenario/scenario_2.json | 78 ++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 2 deletions(-) diff --git a/hwe/func.php b/hwe/func.php index 5b8f7d4d..06192ea1 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -1787,7 +1787,7 @@ function turnDate($curtime) { $date += $num; $year = intdiv($date, 12); - $month = 1 + $year % 12; + $month = 1 + $date % 12; // 바뀐 경우만 업데이트 if($admin['month'] != $month || $admin['year'] != $year) { diff --git a/hwe/sammo/Scenario.php b/hwe/sammo/Scenario.php index 983090e5..2e552dd0 100644 --- a/hwe/sammo/Scenario.php +++ b/hwe/sammo/Scenario.php @@ -280,12 +280,14 @@ class Scenario{ private function buildDiplomacy($env){ $this->initFull(); + $monthDiff = ($env['year'] * 12) + ($env['month'] - 1) - ($env['startyear'] * 12); + $db = DB::db(); foreach($this->diplomacy as $diplomacy){ list($me, $you, $state, $remain) = $diplomacy; $db->update('diplomacy', [ 'state'=>$state, - 'term'=>$remain + 'term'=>$remain - $monthDiff ], '(me = %i AND you = %i) OR (me = %i AND you = %i)', $me, $you, $you, $me); } } diff --git a/hwe/scenario/scenario_2.json b/hwe/scenario/scenario_2.json index 8e810e0b..16b3738a 100644 --- a/hwe/scenario/scenario_2.json +++ b/hwe/scenario/scenario_2.json @@ -67,6 +67,84 @@ ], "diplomacy":[ + [1, 2, 1, 36], + [1, 4, 1, 36], + [1, 6, 1, 36], + [1, 7, 1, 36], + [1, 8, 1, 36], + [1, 9, 1, 36], + [1, 10, 1, 36], + [1, 11, 1, 36], + [1, 13, 1, 36], + [1, 14, 1, 36], + [1, 16, 1, 36], + [1, 17, 1, 36], + [1, 20, 1, 36], + + [2, 4, 7, 48], + [2, 6, 7, 48], + [2, 8, 7, 48], + [2, 9, 7, 48], + [2, 11, 7, 48], + [2, 13, 7, 48], + [2, 14, 7, 48], + [2, 16, 7, 48], + [2, 17, 7, 48], + [2, 20, 7, 48], + + [4, 6, 7, 48], + [4, 8, 7, 48], + [4, 9, 7, 48], + [4, 11, 7, 48], + [4, 13, 7, 48], + [4, 14, 7, 48], + [4, 16, 7, 48], + [4, 17, 7, 48], + [4, 20, 7, 48], + + [6, 8, 7, 48], + [6, 9, 7, 48], + [6, 11, 7, 48], + [6, 13, 7, 48], + [6, 14, 7, 48], + [6, 16, 7, 48], + [6, 17, 7, 48], + [6, 20, 7, 48], + + [8, 9, 7, 48], + [8, 11, 7, 48], + [8, 13, 7, 48], + [8, 14, 7, 48], + [8, 16, 7, 48], + [8, 17, 7, 48], + [8, 20, 7, 48], + + [9, 11, 7, 48], + [9, 13, 7, 48], + [9, 14, 7, 48], + [9, 16, 7, 48], + [9, 17, 7, 48], + [9, 20, 7, 48], + + [11, 13, 7, 48], + [11, 14, 7, 48], + [11, 16, 7, 48], + [11, 17, 7, 48], + [11, 20, 7, 48], + + [13, 14, 7, 48], + [13, 16, 7, 48], + [13, 17, 7, 48], + [13, 20, 7, 48], + + [14, 16, 7, 48], + [14, 17, 7, 48], + [14, 20, 7, 48], + + [16, 17, 7, 48], + [16, 20, 7, 48], + + [17, 20, 7, 48] ], "general":[ [ 1, "소제1",1001, 0, null, 20, 11, 48, 0, 168, 190, "유지", null],