년도 계산 공식 재 수정. 시나리오 시작시 남은 개월 수를 계산. 반동탁연합 시나리오 외교 추가

This commit is contained in:
2018-04-29 01:47:48 +09:00
parent 1e54220230
commit 13fccb998e
3 changed files with 82 additions and 2 deletions
+3 -1
View File
@@ -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);
}
}