태수국 추가 설정
- 태수국 장수의 수명(10년 후 6년마다 절반 정도) - 유저장은 태수국 임관 불가 - 공백지 시나리오에 기본 세팅
This commit is contained in:
@@ -138,7 +138,7 @@ class RaiseNPCNation extends \sammo\Event\Action
|
||||
$techSum += $nation['tech'];
|
||||
$nationCnt += 1;
|
||||
}
|
||||
if($nationCnt == 0){
|
||||
if ($nationCnt == 0) {
|
||||
return 0;
|
||||
}
|
||||
return Util::toInt($techSum / $nationCnt);
|
||||
@@ -165,26 +165,29 @@ class RaiseNPCNation extends \sammo\Event\Action
|
||||
$nationObj = new Nation($nationID, $nationName, $color, 0, 2000, "우리도 할 수 있다! {$cityName}군", $tech, null, 2, [$cityName]);
|
||||
$nationObj->build($env);
|
||||
|
||||
$affinity = Util::randRangeInt(1, 150);
|
||||
$ruler = (new GeneralBuilder("{$cityName}태수", false, null, $nationID))
|
||||
->setOfficerLevel(12)
|
||||
->setCityID($cityID)
|
||||
->setNPCType(6)
|
||||
->setGoldRice(1000, 1000)
|
||||
->setAffinity($affinity)
|
||||
->fillRandomStat($pickTypeList)
|
||||
->fillRemainSpecAsZero($env);
|
||||
$ruler->build($env);
|
||||
|
||||
$nationObj->addGeneral($ruler);
|
||||
|
||||
$birthYear = $env['year'] - 20;
|
||||
$deadYearMin = $env['year'] + 10;
|
||||
|
||||
foreach (pickGeneralFromPool(DB::db(), 0, $genCnt - 1) as $pickedNPC) {
|
||||
//대충 10년후부터 6년마다 절반?
|
||||
$deadYear = $deadYearMin + Util::toInt(60 * (1 - log(Util::randRange(1, 1024), 2)/10));
|
||||
$newNPC = $pickedNPC->getGeneralBuilder();
|
||||
$newNPC->setNationID($nationID)
|
||||
->setCityID($cityID)
|
||||
->setNPCType(6)
|
||||
->setGoldRice(1000, 1000)
|
||||
->setAffinity($affinity)
|
||||
->setLifeSpan($birthYear, $deadYear)
|
||||
->fillRandomStat($pickTypeList)
|
||||
->fillRemainSpecAsZero($env);
|
||||
$newNPC->build($env);
|
||||
@@ -237,24 +240,24 @@ class RaiseNPCNation extends \sammo\Event\Action
|
||||
$cityID = $emptyCity['city'];
|
||||
|
||||
$minDistance = 999;
|
||||
foreach($occupiedCitiesID as $targetCityID){
|
||||
foreach ($occupiedCitiesID as $targetCityID) {
|
||||
$minDistance = min(\sammo\calcCityDistance($cityID, $targetCityID, null), $minDistance);
|
||||
if($minDistance < static::MIN_DIST_USERNATION){
|
||||
if ($minDistance < static::MIN_DIST_USERNATION) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if($minDistance < static::MIN_DIST_USERNATION){
|
||||
if ($minDistance < static::MIN_DIST_USERNATION) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$minDistance = 999;
|
||||
foreach($npcCitiesID as $targetCityID){
|
||||
foreach ($npcCitiesID as $targetCityID) {
|
||||
$minDistance = min(\sammo\calcCityDistance($cityID, $targetCityID, null), $minDistance);
|
||||
if($minDistance < static::MIN_DIST_NPCNATION){
|
||||
if ($minDistance < static::MIN_DIST_NPCNATION) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if($minDistance < static::MIN_DIST_NPCNATION){
|
||||
if ($minDistance < static::MIN_DIST_NPCNATION) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -265,7 +268,7 @@ class RaiseNPCNation extends \sammo\Event\Action
|
||||
$npcCitiesID[] = $cityID;
|
||||
}
|
||||
|
||||
if(count($npcCities) > 0){
|
||||
if (count($npcCities) > 0) {
|
||||
$logger = new ActionLogger(0, 0, $env['year'], $env['month']);
|
||||
$logger->pushGlobalHistoryLog("<L><b>【공지】</b></>공백지에 임의의 국가가 생성되었습니다.");
|
||||
$logger->flush();
|
||||
|
||||
Reference in New Issue
Block a user