태수국 추가 설정
- 태수국 장수의 수명(10년 후 6년마다 절반 정도) - 유저장은 태수국 임관 불가 - 공백지 시나리오에 기본 세팅
This commit is contained in:
@@ -202,6 +202,8 @@ class che_임관 extends Command\GeneralCommand{
|
||||
$nationList[$nationID]['scoutmsg'] = $scoutMsg;
|
||||
}
|
||||
|
||||
$hiddenItems = [];
|
||||
|
||||
foreach($nationList as &$nation){
|
||||
if($env['year'] < $env['startyear']+3 && $nation['gennum'] >= GameConst::$initialNationGenLimit){
|
||||
$nation['availableJoin'] = false;
|
||||
@@ -217,7 +219,9 @@ class che_임관 extends Command\GeneralCommand{
|
||||
$nation['availableJoin'] = false;
|
||||
}
|
||||
|
||||
|
||||
if(Util::starts_with($nation['name'], 'ⓤ')){
|
||||
$hiddenItems[$nation['nation']] = $nation['nation'];
|
||||
}
|
||||
}
|
||||
unset($nation);
|
||||
ob_start();
|
||||
@@ -228,6 +232,7 @@ class che_임관 extends Command\GeneralCommand{
|
||||
임관할 국가를 목록에서 선택하세요.<br>
|
||||
<select class='formInput' name="destNationID" id="destNationID" size='1' style='color:white;background-color:black;'>
|
||||
<?php foreach($nationList as $nation): ?>
|
||||
<?php if(key_exists($nation['nation'], $hiddenItems)){ continue; } ?>
|
||||
<option
|
||||
value='<?=$nation['nation']?>'
|
||||
style='<?=$nation['availableJoin']?'':'background-color:red;'?>'
|
||||
|
||||
@@ -209,7 +209,10 @@ class che_장수대상임관 extends Command\GeneralCommand{
|
||||
$nationList[$nationID]['scoutmsg'] = $scoutMsg;
|
||||
}
|
||||
|
||||
$hiddenItems = [];
|
||||
|
||||
foreach($nationList as &$nation){
|
||||
$nation['hideen'] = false;
|
||||
if($env['year'] < $env['startyear']+3 && $nation['gennum'] >= GameConst::$initialNationGenLimit){
|
||||
$nation['availableJoin'] = false;
|
||||
}
|
||||
@@ -224,7 +227,9 @@ class che_장수대상임관 extends Command\GeneralCommand{
|
||||
$nation['availableJoin'] = false;
|
||||
}
|
||||
|
||||
|
||||
if(Util::starts_with($nation['name'], 'ⓤ')){
|
||||
$hiddenItems[$nation['nation']] = $nation['nation'];
|
||||
}
|
||||
}
|
||||
unset($nation);
|
||||
ob_start();
|
||||
@@ -235,6 +240,7 @@ class che_장수대상임관 extends Command\GeneralCommand{
|
||||
임관할 국가를 목록에서 선택하세요.<br>
|
||||
<select class='formInput' name="destGeneralID" id="destGeneralID" size='1' style='color:white;background-color:black;'>
|
||||
<?php foreach($generalList as $targetGeneral): ?>
|
||||
<?php if(key_exists($targetGeneral['nation'], $hiddenItems)){ continue; } ?>
|
||||
<option value='<?=$targetGeneral['no']?>'><?=getColoredName($targetGeneral['name'],$targetGeneral['npc'])?>【<?=getNationStaticInfo($targetGeneral['nation'])['name']??'재야'?>】</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
|
||||
@@ -50,6 +50,11 @@ class AllowJoinDestNation extends Constraint{
|
||||
return false;
|
||||
}
|
||||
|
||||
if($this->general['npc']??2 < 2 && \sammo\Util::starts_with($this->destNation['name'], 'ⓤ')){
|
||||
$this->reason = "유저장은 태수국에 임관할 수 없습니다.";
|
||||
return false;
|
||||
}
|
||||
|
||||
$joinedNations = $this->general['auxVar']['joinedNations']??[];
|
||||
if(in_array($this->destNation['nation'], $joinedNations)){
|
||||
$this->reason = "이미 임관했었던 국가입니다.";
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -5,5 +5,17 @@
|
||||
],
|
||||
"const": {
|
||||
"joinRuinedNPCProp":0
|
||||
}
|
||||
},
|
||||
"events":[
|
||||
[
|
||||
["Date", "==", null, 12],
|
||||
["CreateManyNPC", 30],
|
||||
["DeleteEvent"]
|
||||
],
|
||||
[
|
||||
["Date", "==", 181, 1],
|
||||
["RaiseNPCNation"],
|
||||
["DeleteEvent"]
|
||||
]
|
||||
]
|
||||
}
|
||||
@@ -8,5 +8,17 @@
|
||||
],
|
||||
"const": {
|
||||
"joinRuinedNPCProp":0
|
||||
}
|
||||
},
|
||||
"events":[
|
||||
[
|
||||
["Date", "==", null, 12],
|
||||
["CreateManyNPC", 30],
|
||||
["DeleteEvent"]
|
||||
],
|
||||
[
|
||||
["Date", "==", 181, 1],
|
||||
["RaiseNPCNation"],
|
||||
["DeleteEvent"]
|
||||
]
|
||||
]
|
||||
}
|
||||
@@ -18,6 +18,11 @@
|
||||
["Date", "==", null, 12],
|
||||
["CreateManyNPC", 30],
|
||||
["DeleteEvent"]
|
||||
],
|
||||
[
|
||||
["Date", "==", 181, 1],
|
||||
["RaiseNPCNation"],
|
||||
["DeleteEvent"]
|
||||
]
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user