balance: 초반 NPC 생성 시 모든 국가를 채울 수 있을 정도로는 제공

This commit is contained in:
2021-10-14 00:36:06 +09:00
parent 4a1bccdf75
commit 418007e572
7 changed files with 37 additions and 25 deletions
+17 -5
View File
@@ -9,9 +9,11 @@ use function sammo\pickGeneralFromPool;
//기존 event_3.php
class CreateManyNPC extends \sammo\Event\Action{
protected $npcCount;
protected $fillCnt;
protected $avgGen;
public function __construct($npcCount = 10){
public function __construct($npcCount = 10, $fillCnt = 0){
$this->npcCount = $npcCount;
$this->fillCnt = $fillCnt;
}
protected function generateNPC($env, int $cnt){
@@ -41,13 +43,23 @@ class CreateManyNPC extends \sammo\Event\Action{
}
return $result;
}
public function run(array $env){
if($this->npcCount <= 0){
return [__CLASS__, []];
return [__CLASS__, []];
}
$result = $this->generateNPC($env, $this->npcCount);
$moreGenCnt = 0;
if($this->fillCnt){
$db = DB::db();
$nations = $db->queryFirstColumn('SELECT nation FROM general WHERE npc < 2 AND officer_level = 12');
$regGens = $db->queryFirstField('SELECT count(*) FROM general WHERE nation IN %li AND npc < 4', $nations);
$moreGenCnt = count($nations) * $this->fillCnt - $regGens;
}
$result = $this->generateNPC($env, $this->npcCount + $moreGenCnt);
$logger = new \sammo\ActionLogger(0, 0, $env['year'], $env['month']);
$genCnt = count($result);
@@ -62,6 +74,6 @@ class CreateManyNPC extends \sammo\Event\Action{
$logger->pushGlobalHistoryLog("장수 <C>{$genCnt}</>명이 <S>등장</>했습니다.", \sammo\ActionLogger::NOTICE_YEAR_MONTH);
$logger->flush();
return [__CLASS__, $result];
return [__CLASS__, $result];
}
}
+1 -1
View File
@@ -9,7 +9,7 @@
"events":[
[
["or", ["Date", "==", null, 12], ["Date", "==", null, 6]],
["CreateManyNPC", 30],
["CreateManyNPC", 10, 10],
["DeleteEvent"]
],
[
+1 -1
View File
@@ -12,7 +12,7 @@
"events":[
[
["or", ["Date", "==", null, 12], ["Date", "==", null, 6]],
["CreateManyNPC", 30],
["CreateManyNPC", 10, 10],
["DeleteEvent"]
],
[
+1 -1
View File
@@ -16,7 +16,7 @@
"events":[
[
["or", ["Date", "==", null, 12], ["Date", "==", null, 6]],
["CreateManyNPC", 30],
["CreateManyNPC", 10, 10],
["DeleteEvent"]
],
[
+3 -3
View File
@@ -17,7 +17,7 @@
"iconPath": "쿠키런킹덤",
"fiction": 1,
"nation":[
],
"map":{
"mapName":"miniche",
@@ -100,7 +100,7 @@
"events":[
[
["or", ["Date", "==", null, 12], ["Date", "==", null, 6]],
["CreateManyNPC", 30],
["CreateManyNPC", 10, 10],
["DeleteEvent"]
],
[
@@ -109,5 +109,5 @@
["DeleteEvent"]
]
]
}
+13 -13
View File
@@ -9,26 +9,26 @@
"const": {
"joinRuinedNPCProp":0,
"availableSpecialWar":[
"che_귀병", "che_신산", "che_환술", "che_집중", "che_신중", "che_반계",
"che_귀병", "che_신산", "che_환술", "che_집중", "che_신중", "che_반계",
"che_보병", "che_궁병", "che_기병", "che_공성",
"che_돌격", "che_무쌍", "che_위압",
"che_돌격", "che_무쌍", "che_위압",
"che_저격", "che_필살", "che_징병", "che_의술", "che_격노", "che_척사"
],
"allItems":{
"horse":{
"che_명마_01_노기":0, "che_명마_02_조랑":0, "che_명마_03_노새":0,
"che_명마_04_나귀":0, "che_명마_05_갈색마":0, "che_명마_06_흑색마":0,
"che_명마_07_백마":2, "che_명마_07_기주마":2,
"che_명마_04_나귀":0, "che_명마_05_갈색마":0, "che_명마_06_흑색마":0,
"che_명마_07_백마":2, "che_명마_07_기주마":2,
"che_명마_08_양주마":2, "che_명마_09_과하마":2,
"che_명마_10_대완마":2, "che_명마_11_서량마":2,
"che_명마_10_대완마":2, "che_명마_11_서량마":2,
"che_명마_12_사륜거":2, "che_명마_13_절영":1, "che_명마_13_적로":1,
"che_명마_14_적란마":1, "che_명마_14_조황비전":1, "che_명마_15_한혈마":1, "che_명마_15_적토마":1
},
"weapon":{
"che_무기_01_단도":0, "che_무기_02_단궁":0, "che_무기_03_단극":0,
"che_무기_04_목검":0, "che_무기_05_죽창":0, "che_무기_06_소부":0,
"che_무기_07_동추":1, "che_무기_07_철편":1, "che_무기_07_철쇄":1, "che_무기_07_맥궁":1,
"che_무기_08_유성추":1, "che_무기_08_철질여골":1, "che_무기_09_쌍철극":1, "che_무기_09_동호비궁":1,
"che_무기_10_삼첨도":1, "che_무기_10_대부":1, "che_무기_11_고정도":1, "che_무기_11_이광궁":1,
@@ -37,18 +37,18 @@
},
"book":{
"che_서적_01_효경전":0, "che_서적_02_회남자":0, "che_서적_03_변도론":0,
"che_서적_04_건상역주":0, "che_서적_05_여씨춘추":0, "che_서적_06_사민월령":0,
"che_서적_04_건상역주":0, "che_서적_05_여씨춘추":0, "che_서적_06_사민월령":0,
"che_서적_07_위료자":1, "che_서적_07_사마법":1, "che_서적_07_한서":1, "che_서적_07_논어":1,
"che_서적_08_전론":1, "che_서적_08_사기":1, "che_서적_09_장자":1, "che_서적_09_역경":1,
"che_서적_10_시경":1, "che_서적_10_구국론":1, "che_서적_11_상군서":1, "che_서적_11_춘추전":1,
"che_서적_12_산해경":1, "che_서적_12_맹덕신서":1, "che_서적_13_관자":1, "che_서적_13_병법24편":1,
"che_서적_10_시경":1, "che_서적_10_구국론":1, "che_서적_11_상군서":1, "che_서적_11_춘추전":1,
"che_서적_12_산해경":1, "che_서적_12_맹덕신서":1, "che_서적_13_관자":1, "che_서적_13_병법24편":1,
"che_서적_14_한비자":1, "che_서적_14_오자병법":1, "che_서적_15_노자":1, "che_서적_15_손자병법":1
},
"item":{
"che_치료_환약":0, "che_저격_수극":0, "che_사기_탁주":0,
"che_훈련_청주":0, "che_계략_이추":0, "che_계략_향낭":0,
"event_전투특기_격노":0, "event_전투특기_공성":0, "event_전투특기_궁병":0,
"event_전투특기_귀병":0, "event_전투특기_기병":0, "event_전투특기_돌격":0, "event_전투특기_무쌍":0,
"event_전투특기_반계":0, "event_전투특기_보병":0, "event_전투특기_신산":0, "event_전투특기_신중":0,
@@ -60,7 +60,7 @@
"events":[
[
["Date", "==", null, 12],
["CreateManyNPC", 30],
["CreateManyNPC", 10, 10],
["DeleteEvent"]
],
[
+1 -1
View File
@@ -12,7 +12,7 @@
"events": [
[
["Date", "==", null, 12],
["CreateManyNPC", 100],
["CreateManyNPC", 100, 0],
["DeleteEvent"]
],
[