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