From 0867a234c2efd7168c2d79390e7ad34eb6241fab Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 30 May 2020 03:18:23 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A9=B8=EB=A7=9D=EC=8B=9C=20=EC=9E=84?= =?UTF-8?q?=EA=B4=80=20=ED=99=95=EB=A5=A0=EC=9D=84=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?=EA=B0=80=EB=8A=A5=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/process_war.php | 10 +++++++--- hwe/sammo/GameConstBase.php | 3 +++ hwe/scenario/scenario_0.json | 5 ++++- hwe/scenario/scenario_1.json | 5 ++++- hwe/scenario/scenario_2.json | 3 ++- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/hwe/process_war.php b/hwe/process_war.php index 40e1fc38..6301f521 100644 --- a/hwe/process_war.php +++ b/hwe/process_war.php @@ -558,13 +558,17 @@ function ConquerCity(array $admin, General $general, array $city) { } } - //NPC인 경우 10% 확률로 임관(엔장, 인재, 의병) + //NPC인 경우 일정 확률로 임관(엔장, 인재, 의병) $npcType = $oldGeneral->getNPCType(); - if($admin['join_mode'] != 'onlyRandom' && 2 <= $npcType && $npcType <= 8 && $npcType != 5 && Util::randBool(0.1)) { + if($admin['join_mode'] != 'onlyRandom' && 2 <= $npcType && $npcType <= 8 && $npcType != 5 && Util::randBool(GameConst::$joinRuinedNPCProp)) { $cmd = buildGeneralCommandClass('che_임관', $oldGeneral, $admin, [ 'destNationID'=>$attackerNationID ]); - _setGeneralCommand($cmd, [0]); + $joinTurn = Util::randRangeInt(0, 12); + if($joinTurn){ + _setGeneralCommand(buildGeneralCommandClass('che_견문', $oldGeneral, $admin), iterator_to_array(Util::range($joinTurn))); + } + _setGeneralCommand($cmd, [$joinTurn]); } } diff --git a/hwe/sammo/GameConstBase.php b/hwe/sammo/GameConstBase.php index 8b2c14d4..6d7b24cc 100644 --- a/hwe/sammo/GameConstBase.php +++ b/hwe/sammo/GameConstBase.php @@ -110,6 +110,9 @@ class GameConstBase /** @var int 초기 시작 년도. 실제 값은 시나리오에서 정해지므로 딱히 의미는 없음. */ public static $defaultStartYear = 180; + /** @var float 멸망한 NPC 장수의 임관 확률 */ + public static $joinRuinedNPCProp = 0.1; + /** @var int 시작시 금 */ public static $defaultGold = 1000; /** @var int 시작시 쌀 */ diff --git a/hwe/scenario/scenario_0.json b/hwe/scenario/scenario_0.json index dc6c2055..143f1bb6 100644 --- a/hwe/scenario/scenario_0.json +++ b/hwe/scenario/scenario_0.json @@ -2,5 +2,8 @@ "title":"【공백지】 일반", "startYear":180, "history":[ - ] + ], + "const": { + "joinRuinedNPCProp":0 + } } \ No newline at end of file diff --git a/hwe/scenario/scenario_1.json b/hwe/scenario/scenario_1.json index c86ea1d7..5a7161e5 100644 --- a/hwe/scenario/scenario_1.json +++ b/hwe/scenario/scenario_1.json @@ -5,5 +5,8 @@ "mapName":"miniche" }, "history":[ - ] + ], + "const": { + "joinRuinedNPCProp":0 + } } \ No newline at end of file diff --git a/hwe/scenario/scenario_2.json b/hwe/scenario/scenario_2.json index 7b4b5156..0d97777d 100644 --- a/hwe/scenario/scenario_2.json +++ b/hwe/scenario/scenario_2.json @@ -10,6 +10,7 @@ "expandCityPopIncreaseAmount": 80000, "expandCityDevelIncreaseAmount": 1350, "expandCityWallIncreaseAmount": 1600, - "defaultMaxGeneral":300 + "defaultMaxGeneral":300, + "joinRuinedNPCProp":0 } } \ No newline at end of file