버그 수정
This commit is contained in:
@@ -250,7 +250,7 @@ class che_화계 extends Command\GeneralCommand{
|
||||
$destCityID,
|
||||
$destNationID
|
||||
) as $rawDestCityGeneral){
|
||||
$destCityGeneralList[] = new General($rawDestCityGeneral, $destCity, $year, $month, true);
|
||||
$destCityGeneralList[] = new General($rawDestCityGeneral, null, $destCity, $year, $month, true);
|
||||
//계략에 성공할 경우 logger를 사용해야 하므로 해야하므로, 미리 초기화한다.
|
||||
//실패하면 날리는거지 뭐~
|
||||
};
|
||||
|
||||
@@ -93,7 +93,7 @@ class General implements iAction{
|
||||
}
|
||||
$this->resultTurn = new LastTurn();
|
||||
|
||||
if($year !== null || $month !== null){
|
||||
if($year !== null && $month !== null){
|
||||
$this->initLogger($year, $month);
|
||||
}
|
||||
|
||||
|
||||
+10
-14
@@ -2849,8 +2849,8 @@ class GeneralAI
|
||||
$this->categorizeNationGeneral();
|
||||
$this->categorizeNationCities();
|
||||
|
||||
$month = $this->env['month'];
|
||||
if($general->getVar('officer_level') == 12){
|
||||
$month = $this->env['month'];
|
||||
if (in_array($month, [1, 4, 7, 10])) {
|
||||
$this->choosePromotion();
|
||||
} else if ($month == 12) {
|
||||
@@ -3252,28 +3252,24 @@ class GeneralAI
|
||||
|
||||
$nationID = $nation['nation'];
|
||||
|
||||
$rate = 15;
|
||||
//도시
|
||||
if(!$this->supplyCities){
|
||||
$db->update('nation', [
|
||||
'war' => 0,
|
||||
'rate' => 15
|
||||
], 'nation=%i', $nationID);
|
||||
} else {
|
||||
if($this->supplyCities){
|
||||
$devRate = $this->calcNationDevelopedRate();
|
||||
|
||||
$avg = ($devRate['pop'] + $devRate['all_p']) / 2;
|
||||
$avg = ($devRate['pop'] + $devRate['all']) / 2;
|
||||
|
||||
if ($avg > 0.95) $rate = 25;
|
||||
elseif ($avg > 0.70) $rate = 20;
|
||||
elseif ($avg > 0.50) $rate = 15;
|
||||
else $rate = 10;
|
||||
|
||||
$db->update('nation', [
|
||||
'war' => 0,
|
||||
'rate' => $rate
|
||||
], 'nation=%i', $nationID);
|
||||
return $rate;
|
||||
}
|
||||
|
||||
$db->update('nation', [
|
||||
'war' => 0,
|
||||
'rate' => $rate
|
||||
], 'nation=%i', $nationID);
|
||||
return $rate;
|
||||
}
|
||||
|
||||
protected function chooseGoldBillRate(): int
|
||||
|
||||
@@ -358,14 +358,16 @@ class NPC{
|
||||
}
|
||||
$db->insert('general_turn', $turnRows);
|
||||
|
||||
$rank_data = [];
|
||||
foreach(array_keys(\sammo\General::RANK_COLUMN) as $rankColumn){
|
||||
$db->insert('rank_data', [
|
||||
$rank_data[] = [
|
||||
'general_id'=>$this->generalID,
|
||||
'nation_id'=>0,
|
||||
'type'=>$rankColumn,
|
||||
'value'=>0
|
||||
]);
|
||||
];
|
||||
}
|
||||
$db->insert('rank_data', $rank_data);
|
||||
|
||||
return true; //생성되었다.
|
||||
}
|
||||
|
||||
@@ -224,6 +224,7 @@ WHERE turntime < %s ORDER BY turntime ASC, `no` ASC',
|
||||
$currentTurn = null;
|
||||
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$autorun_user = $gameStor->autorun_user;
|
||||
|
||||
foreach($generalsTodo as $rawGeneral){
|
||||
$generalCommand = $rawGeneral['action'];
|
||||
@@ -261,7 +262,7 @@ WHERE turntime < %s ORDER BY turntime ASC, `no` ASC',
|
||||
}
|
||||
|
||||
|
||||
if($general->getVar('npc') >= 2){
|
||||
if($general->getVar('npc') >= 2 || ($autorun_user['limit_minutes']??false)){
|
||||
$ai = new GeneralAI($turnObj->getGeneral());
|
||||
if($hasNationTurn){
|
||||
$nationCommandObj = $ai->chooseNationTurn($nationCommandObj);
|
||||
|
||||
Reference in New Issue
Block a user