fix: 이민족 발동 시, 초기 이성이 없으면 동작하지 않도록
This commit is contained in:
+24
-15
@@ -909,24 +909,33 @@ function checkEmperior()
|
||||
//연감 월결산
|
||||
LogHistory();
|
||||
|
||||
$invaderMsgCnt = 2;
|
||||
foreach(range(12, 5, -1) as $chiefLevel){
|
||||
if(!key_exists($chiefLevel, $chiefs)){
|
||||
continue;
|
||||
}
|
||||
$targetChief = $chiefs[$chiefLevel];
|
||||
if($targetChief['npc'] >= 2){
|
||||
continue;
|
||||
}
|
||||
$invaderMsgs = RaiseInvaderMessage::buildRaiseInvaderMessage($targetChief['no']);
|
||||
foreach($invaderMsgs as $invaderMsg){
|
||||
$invaderMsg->send();
|
||||
}
|
||||
$invaderMsgCnt--;
|
||||
if($invaderMsgCnt <= 0){
|
||||
$availableInvaderGame = false;
|
||||
foreach(CityConst::all() as $city){
|
||||
if($city->level == 4){
|
||||
$availableInvaderGame = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if($availableInvaderGame){
|
||||
$invaderMsgCnt = 2;
|
||||
foreach(range(12, 5, -1) as $chiefLevel){
|
||||
if(!key_exists($chiefLevel, $chiefs)){
|
||||
continue;
|
||||
}
|
||||
$targetChief = $chiefs[$chiefLevel];
|
||||
if($targetChief['npc'] >= 2){
|
||||
continue;
|
||||
}
|
||||
$invaderMsgs = RaiseInvaderMessage::buildRaiseInvaderMessage($targetChief['no']);
|
||||
foreach($invaderMsgs as $invaderMsg){
|
||||
$invaderMsg->send();
|
||||
}
|
||||
$invaderMsgCnt--;
|
||||
if($invaderMsgCnt <= 0){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateMaxDomesticCritical(General $general, $score)
|
||||
|
||||
@@ -93,8 +93,6 @@ class RaiseInvader extends \sammo\Event\Action
|
||||
public function run(array $env)
|
||||
{
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$gameStor->setValue('isunited', 1);
|
||||
|
||||
$npcEachCount = $this->npcEachCount;
|
||||
|
||||
@@ -107,6 +105,13 @@ class RaiseInvader extends \sammo\Event\Action
|
||||
$cities[] = $cityObj;
|
||||
}
|
||||
|
||||
if(!$cities){
|
||||
return [__CLASS__, 0];
|
||||
}
|
||||
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$gameStor->setValue('isunited', 1);
|
||||
|
||||
if ($npcEachCount < 0) {
|
||||
$npcEachCount =
|
||||
$db->queryFirstField('SELECT count(no) from general where npc < 4') / count($cities);
|
||||
|
||||
Reference in New Issue
Block a user