From f28cdefffe11bed68b3d9ee4d13468aa1d431914 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 23 Jun 2018 05:00:57 +0900 Subject: [PATCH] =?UTF-8?q?npc=20=EB=B0=9C=EB=A0=B9=20=EC=A0=84=EB=9E=B5?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_npc.php | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/hwe/func_npc.php b/hwe/func_npc.php index 30afb75b..4b514ab6 100644 --- a/hwe/func_npc.php +++ b/hwe/func_npc.php @@ -1139,10 +1139,13 @@ function NPCStaffWork($general, $nation, $dipState){ // 병사있고 쌀있고 후방에 있는 장수 if($frontCitiesID){ - $workRemain = 5; + $workRemain = 3; foreach($nationGenerals as $nationGeneral){ $generalCity = $nationCities[$nationGeneral['city']]??null; if(!$generalCity){ + if(!in_array($nationGeneral['no'], $lostGeneralsID)){ + trigger_error('쓔?'); + } continue; } if($nationGeneral['crew'] < 2000){ @@ -1157,7 +1160,7 @@ function NPCStaffWork($general, $nation, $dipState){ $score = 5; if($nationGeneral['npc']<2){ - $score *= 8; + $score *= 4; } if(Util::randF(0.3) && $frontImportantCitiesID){ @@ -1167,13 +1170,15 @@ function NPCStaffWork($general, $nation, $dipState){ $targetCityID = Util::choiceRandom($frontCitiesID); } - $commandList[EncodeCommand(0, $nationGeneral['no'], $targetCityID, 27)] = $score; + $command = EncodeCommand(0, $nationGeneral['no'], $targetCityID, 27); - if($nationGeneral['npc']<2){ - $workRemain -= 5; + if($nationGeneral['npc']<2 && ($workRemain&2)){ + $workRemain ^= 2; + $commandList[$command] = $score; } - else{ - $workRemain--; + else if($nationGeneral['npc']>=2 && ($workRemain&1)){ + $workRemain ^= 1; + $commandList[$command] = $score; } if($workRemain <= 0){ @@ -1184,7 +1189,7 @@ function NPCStaffWork($general, $nation, $dipState){ //병사 없고 인구없는 전방에 있는 장수 if($frontCitiesID && $backupCitiesID){ - $workRemain = 5; + $workRemain = 3; foreach($nationGenerals as $nationGeneral){ $generalCity = $nationCities[$nationGeneral['city']]??null; if(!$generalCity){ @@ -1202,7 +1207,7 @@ function NPCStaffWork($general, $nation, $dipState){ $score = 5; if($nationGeneral['npc']<2){ - $score *= 8; + $score *= 4; } $popTrial = 5; @@ -1217,13 +1222,15 @@ function NPCStaffWork($general, $nation, $dipState){ } - $commandList[EncodeCommand(0, $nationGeneral['no'], $targetCity['city'], 27)] = $score; + $command = EncodeCommand(0, $nationGeneral['no'], $targetCity['city'], 27); - if($nationGeneral['npc']<2){ - $workRemain -= 5; + if($nationGeneral['npc']<2 && ($workRemain&2)){ + $workRemain ^= 2; + $commandList[$command] = $score; } - else{ - $workRemain--; + else if($nationGeneral['npc']>=2 && ($workRemain&1)){ + $workRemain ^= 1; + $commandList[$command] = $score; } if($workRemain <= 0){