diff --git a/hwe/sammo/Event/Action/CreateManyNPC.php b/hwe/sammo/Event/Action/CreateManyNPC.php index 9a686ac1..87ec077c 100644 --- a/hwe/sammo/Event/Action/CreateManyNPC.php +++ b/hwe/sammo/Event/Action/CreateManyNPC.php @@ -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("장수 {$genCnt}명이 등장했습니다.", \sammo\ActionLogger::NOTICE_YEAR_MONTH); $logger->flush(); - return [__CLASS__, $result]; + return [__CLASS__, $result]; } } \ No newline at end of file diff --git a/hwe/scenario/scenario_0.json b/hwe/scenario/scenario_0.json index d44a61f1..b47e808a 100644 --- a/hwe/scenario/scenario_0.json +++ b/hwe/scenario/scenario_0.json @@ -9,7 +9,7 @@ "events":[ [ ["or", ["Date", "==", null, 12], ["Date", "==", null, 6]], - ["CreateManyNPC", 30], + ["CreateManyNPC", 10, 10], ["DeleteEvent"] ], [ diff --git a/hwe/scenario/scenario_1.json b/hwe/scenario/scenario_1.json index 31f45dd6..b609f4c6 100644 --- a/hwe/scenario/scenario_1.json +++ b/hwe/scenario/scenario_1.json @@ -12,7 +12,7 @@ "events":[ [ ["or", ["Date", "==", null, 12], ["Date", "==", null, 6]], - ["CreateManyNPC", 30], + ["CreateManyNPC", 10, 10], ["DeleteEvent"] ], [ diff --git a/hwe/scenario/scenario_2.json b/hwe/scenario/scenario_2.json index e6f8f410..12f63c82 100644 --- a/hwe/scenario/scenario_2.json +++ b/hwe/scenario/scenario_2.json @@ -16,7 +16,7 @@ "events":[ [ ["or", ["Date", "==", null, 12], ["Date", "==", null, 6]], - ["CreateManyNPC", 30], + ["CreateManyNPC", 10, 10], ["DeleteEvent"] ], [ diff --git a/hwe/scenario/scenario_2300.json b/hwe/scenario/scenario_2300.json index 7b5de8ee..0aac9133 100644 --- a/hwe/scenario/scenario_2300.json +++ b/hwe/scenario/scenario_2300.json @@ -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"] ] ] - + } \ No newline at end of file diff --git a/hwe/scenario/scenario_902.json b/hwe/scenario/scenario_902.json index 78835148..556b37b0 100644 --- a/hwe/scenario/scenario_902.json +++ b/hwe/scenario/scenario_902.json @@ -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"] ], [ diff --git a/hwe/scenario/scenario_903.json b/hwe/scenario/scenario_903.json index 98b6cc1c..f99a15af 100644 --- a/hwe/scenario/scenario_903.json +++ b/hwe/scenario/scenario_903.json @@ -12,7 +12,7 @@ "events": [ [ ["Date", "==", null, 12], - ["CreateManyNPC", 100], + ["CreateManyNPC", 100, 0], ["DeleteEvent"] ], [