fix: 이민족
This commit is contained in:
@@ -11,6 +11,9 @@ use sammo\Scenario\Nation;
|
|||||||
use sammo\UniqueConst;
|
use sammo\UniqueConst;
|
||||||
use sammo\Util;
|
use sammo\Util;
|
||||||
|
|
||||||
|
use function sammo\getNationStaticInfo;
|
||||||
|
use function sammo\refreshNationStaticInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 이민족 침입을 모사
|
* 이민족 침입을 모사
|
||||||
*
|
*
|
||||||
@@ -137,7 +140,7 @@ class RaiseInvader extends \sammo\Event\Action
|
|||||||
$year = $env['year'];
|
$year = $env['year'];
|
||||||
|
|
||||||
$invaderNationIDList = [];
|
$invaderNationIDList = [];
|
||||||
|
refreshNationStaticInfo();
|
||||||
foreach ($cities as $cityObj) {
|
foreach ($cities as $cityObj) {
|
||||||
if ($cityObj->level != 4) {
|
if ($cityObj->level != 4) {
|
||||||
continue;
|
continue;
|
||||||
@@ -149,17 +152,20 @@ class RaiseInvader extends \sammo\Event\Action
|
|||||||
|
|
||||||
$invaderName = $cityObj->name;
|
$invaderName = $cityObj->name;
|
||||||
$nationName = "ⓞ{$invaderName}족";
|
$nationName = "ⓞ{$invaderName}족";
|
||||||
$cityID = $cityObj->id;
|
$nationObj = new Nation($invaderNationID, $nationName, '#800080', 9999999, 9999999, "중원의 부패를 물리쳐라! 이민족 침범!", $tech, "che_병가", 2, [$cityObj->name]);
|
||||||
$nationObj = new Nation($invaderNationID, $nationName, '#800080', 9999999, 9999999, "중원의 부패를 물리쳐라! 이민족 침범!", $tech, "che_병가", 2, [$cityID]);
|
$nationObj->build($env);
|
||||||
$nationObj->addGeneral((new GeneralBuilder("{$invaderName}대왕", false, null, $lastNationID))
|
|
||||||
|
$ruler = (new GeneralBuilder("{$invaderName}대왕", false, null, $lastNationID))
|
||||||
->setEgo('che_패권')
|
->setEgo('che_패권')
|
||||||
->setSpecial('che_인덕', 'che_척사')
|
->setSpecial('che_인덕', 'che_척사')
|
||||||
->setLifeSpan($year - 20, $year + 20)
|
->setLifeSpan($year - 20, $year + 20)
|
||||||
->setNPCType(9)
|
->setNPCType(9)
|
||||||
->setStat(Util::toInt($specAvg * 1.8), Util::toInt($specAvg * 1.8), Util::toInt($specAvg * 1.2))
|
->setStat(Util::toInt($specAvg * 1.8), Util::toInt($specAvg * 1.8), Util::toInt($specAvg * 1.2))
|
||||||
->setAffinity(999)
|
->setAffinity(999)
|
||||||
->setGoldRice(99999, 99999)
|
->setGoldRice(99999, 99999);
|
||||||
);
|
$ruler->build($env);
|
||||||
|
|
||||||
|
$nationObj->addGeneral($ruler);
|
||||||
|
|
||||||
foreach (Util::range(1, $npcEachCount) as $invaderGenIdx) {
|
foreach (Util::range(1, $npcEachCount) as $invaderGenIdx) {
|
||||||
$gen = (new GeneralBuilder("{$invaderName}장수{$invaderGenIdx}", false, null, $invaderNationID))
|
$gen = (new GeneralBuilder("{$invaderName}장수{$invaderGenIdx}", false, null, $invaderNationID))
|
||||||
@@ -185,11 +191,12 @@ class RaiseInvader extends \sammo\Event\Action
|
|||||||
$gen->setStat($leadership, $subStat, $mainStat)
|
$gen->setStat($leadership, $subStat, $mainStat)
|
||||||
->setDex($dex, $dex, $dex, $dex * 2, 0);
|
->setDex($dex, $dex, $dex, $dex * 2, 0);
|
||||||
}
|
}
|
||||||
|
$gen->build($env);
|
||||||
$nationObj->addGeneral($gen);
|
$nationObj->addGeneral($gen);
|
||||||
}
|
}
|
||||||
|
|
||||||
$nationObj->build($env);
|
|
||||||
$nationObj->postBuild($env);
|
$nationObj->postBuild($env);
|
||||||
|
refreshNationStaticInfo();
|
||||||
$db->insert('event', [
|
$db->insert('event', [
|
||||||
'condition' => Json::encode(true),
|
'condition' => Json::encode(true),
|
||||||
'action' => Json::encode(["AutoDeleteInvader", $invaderNationID]),
|
'action' => Json::encode(["AutoDeleteInvader", $invaderNationID]),
|
||||||
@@ -220,6 +227,10 @@ class RaiseInvader extends \sammo\Event\Action
|
|||||||
|
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$gameStor->isunited = 1;
|
$gameStor->isunited = 1;
|
||||||
|
refreshNationStaticInfo();
|
||||||
|
|
||||||
|
//TODO: 락풀기
|
||||||
|
//TODO: 공지 띄우기
|
||||||
|
|
||||||
return [__CLASS__, count($invaderNationIDList)];
|
return [__CLASS__, count($invaderNationIDList)];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user