history 타입들을 text에서 mediumtext로 변경

시나리오 생성 시 장수수 처리 수정
This commit is contained in:
2018-04-01 23:31:37 +09:00
parent e1f646daa5
commit a70bf667a4
6 changed files with 32 additions and 9 deletions
+14
View File
@@ -242,6 +242,9 @@ class Scenario{
$remainGenerals = [];
foreach($this->generals as $general){
if($general->build($env)){
if($general->nationID){
$this->nations[$general->nationID]->addGeneral($general);
}
continue;
}
@@ -256,6 +259,9 @@ class Scenario{
if($env['extended_general']){
foreach($this->generalsEx as $general){
if($general->build($env)){
if($general->nationID){
$this->nations[$general->nationID]->addGeneral($general);
}
continue;
}
@@ -320,6 +326,14 @@ class Scenario{
];
}
foreach($this->nations as $id=>$nation){
if($id == 0){
continue;
}
$nation->postBuild($env);
}
$this->buildDiplomacy($env);
foreach($this->initialEvents as $event){
+4 -1
View File
@@ -116,7 +116,10 @@ class NPC{
$experience = $age * 100;
$dedication = $age * 100;
$level = $nationID?1:$this->level;
$level = $this->level;
if(!$level){
$level = $nationID?1:0;
}
$turntime = \sammo\getRandTurn($env['turnterm']);
+7 -3
View File
@@ -18,6 +18,8 @@ class Nation{
private $cities = [];
private $generals = [];
public function __construct(
int $id = null,
string $name = '국가',
@@ -118,12 +120,14 @@ class Nation{
}
public function addGeneral(NPC $general){
$this->generals[] = $general;
}
public function postBuild($env=[]){
$npc_cnt = count($this->generals);
if($env['extended_general']){
$npc_cnt += count($this->generalsEx);
}
$db = DB::db();
$db->update('nation', [
'gennum'=>$npc_cnt,
'totaltech'=>$this->tech*$npc_cnt