Scenario 세팅 과정에 문제 해결
SetNationFront 함수도 수정
This commit is contained in:
@@ -96,7 +96,7 @@ class NPC{
|
||||
$picture = 'default.jpg';
|
||||
}
|
||||
|
||||
$city = $this->city;
|
||||
$city = $this->locatedCity;
|
||||
if($city === null){
|
||||
if($nationID == 0){
|
||||
$city = Util::choiceRandom(CityHelper::getAllCities())['id'];
|
||||
@@ -117,9 +117,10 @@ class NPC{
|
||||
$specage = $age + 1;
|
||||
$specage2 = $age + 1;
|
||||
|
||||
$npcID = $db->queryFirstField('SELECT max(npcid)+1 FROM general');
|
||||
|
||||
$db->insert('general',[
|
||||
'npcid'=>$db->sqleval('max(npcid)+1'),
|
||||
'npcid'=>$npcID,
|
||||
'npc'=>2,
|
||||
'npc_org'=>2,
|
||||
'affinity'=>$this->affinity,
|
||||
@@ -127,7 +128,7 @@ class NPC{
|
||||
'picture'=>$picture,
|
||||
'nation'=>$nationID,
|
||||
'city'=>$city,
|
||||
'leader'=>$this->leader,
|
||||
'leader'=>$this->leadership,
|
||||
'power'=>$this->power,
|
||||
'intel'=>$this->intel,
|
||||
'experience'=>$experience,
|
||||
|
||||
@@ -59,7 +59,7 @@ class Nation{
|
||||
}, $this->cities);
|
||||
$capital = \sammo\CityHelper::getCityByName($this->capital)['id'];
|
||||
|
||||
$type = \sammo\NationCharCall($this->$type);
|
||||
$type = \sammo\NationCharCall($this->type);
|
||||
|
||||
$db = DB::db();
|
||||
$otherNations = $db->queryFirstColumn('SELECT nation FROM nation');
|
||||
@@ -81,29 +81,32 @@ class Nation{
|
||||
'scoutmsg'=>$this->infoText,
|
||||
'tech'=>$this->tech,
|
||||
'totaltech'=>0,
|
||||
'level'=>$this->level,
|
||||
'level'=>$this->nationLevel,
|
||||
'type'=>$type,
|
||||
]);
|
||||
|
||||
$db->update('city', [
|
||||
'nation'=>$this->id
|
||||
], 'city IN (%li)', $cities);
|
||||
], 'city IN %li', $cities);
|
||||
|
||||
|
||||
$diplomacy = [];
|
||||
foreach($otherNations as $nation){
|
||||
$diplomacy[] = [
|
||||
'me'=>$this->$id,
|
||||
'me'=>$this->id,
|
||||
'you'=>$nation,
|
||||
'state'=>2
|
||||
];
|
||||
$diplomacy[] = [
|
||||
'me'=>$nation,
|
||||
'you'=>$this->$id,
|
||||
'you'=>$this->id,
|
||||
'state'=>2
|
||||
];
|
||||
}
|
||||
$db->insert('diplomacy', $diplomacy);
|
||||
if(count($diplomacy) > 0){
|
||||
$db->insert('diplomacy', $diplomacy);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function postBuild($env=[]){
|
||||
|
||||
Reference in New Issue
Block a user