부대장 수를 많이 늘림

This commit is contained in:
2019-05-04 00:17:25 +09:00
parent 34bdcc1456
commit ab7a1b1cc2
+37 -36
View File
@@ -1100,45 +1100,46 @@ function updateNationState() {
} }
$maxTroopLeader = [
1=>0,
2=>2,
3=>4,
4=>6,
5=>8,
6=>10,
7=>12,
][$nationlevel]??0;
$lastAssemblerID = $gameStor->assembler_id??0; $lastAssemblerID = $gameStor->assembler_id??0;
for($levelGen = max(1, $oldLevel) + 1; $levelGen <= $nationlevel; $levelGen+=1){ $currentTroopLeaderCnt = $db->queryFirstField('SELECT count(no) FROM general WHERE nation = %i AND npc = 5', $nation['nation']);
if(in_array($levelGen, [3, 5, 7])){ while($currentTroopLeaderCnt < $maxTroopLeader){
$genStep = 2; $currentTroopLeaderCnt++;
} $lastAssemblerID += 1;
else{ $npcObj = new Scenario\NPC(
$genStep = 1; 999, sprintf('부대장%3d',$lastAssemblerID), null, $nation['nation'], null,
} 10, 10, 10, 1, $admin['year'] - 15, $admin['year'] + 15, '은둔', '의술'
);
while($genStep > 0){ $npcObj->npc = 5;
$lastAssemblerID += 1; $npcObj->build($admin);
$npcObj = new Scenario\NPC( $npcID = $npcObj->generalID;
999, sprintf('부대장%3d',$lastAssemblerID), null, $nation['nation'], null,
10, 10, 10, 1, $admin['year'] - 15, $admin['year'] + 15, '은둔', '의술'
);
$npcObj->npc = 5;
$npcObj->build($admin);
$npcID = $npcObj->generalID;
$db->insert('troop', [ $db->insert('troop', [
'name'=>$npcObj->realName, 'name'=>$npcObj->realName,
'nation'=>$nation['nation'], 'nation'=>$nation['nation'],
'no'=>$npcID 'no'=>$npcID
]); ]);
$troopID = $db->insertId(); $troopID = $db->insertId();
$command = EncodeCommand(0, 0, 0, 26); //집합 $command = EncodeCommand(0, 0, 0, 26); //집합
$db->update('general', [ $db->update('general', [
'troop'=>$troopID, 'troop'=>$troopID,
'turn0'=>$command, 'turn0'=>$command,
'turn1'=>$command, 'turn1'=>$command,
'turn2'=>$command, 'turn2'=>$command,
'turn3'=>$command, 'turn3'=>$command,
'turn4'=>$command, 'turn4'=>$command,
'turn5'=>$command, 'turn5'=>$command,
'killturn'=>80 'killturn'=>80
], 'no=%i', $npcID); ], 'no=%i', $npcID);
$genStep -= 1;
}
} }
$gameStor->assembler_id = $lastAssemblerID; $gameStor->assembler_id = $lastAssemblerID;