버그 수정

This commit is contained in:
2019-04-21 15:41:02 +09:00
parent 2765e1c923
commit 9ad8d70cf7
9 changed files with 32 additions and 14 deletions
+16
View File
@@ -1,6 +1,8 @@
<?php
namespace sammo\Scenario;
use \sammo\DB;
use \sammo\GameConst;
use function \sammo\getNationChiefLevel;
class Nation{
private $id;
@@ -146,6 +148,20 @@ class Nation{
$newRuler = $db->queryFirstField('SELECT `no` FROM general WHERE nation=%i ORDER BY leader+power+intel DESC LIMIT 1', $this->id);
$db->update('general',['level'=>12], 'no=%i', $newRuler);
}
$turnRows = [];
foreach(range(getNationChiefLevel(0) - 1, getNationChiefLevel($this->nationLevel), -1) as $chiefLevel){
foreach(range(0, GameConst::$maxChiefTurn - 1) as $turnIdx){
$turnRows[] = [
'nation_id'=>$nation['nation'],
'level'=>$chiefLevel,
'turn_idx'=>$turnIdx,
'action'=>'휴식',
'arg'=>null,
];
}
}
$db->insertIgnore('nation_turn', $turnRows);
}
public function getBrief(){