diff --git a/hwe/sammo/Event/Action/RaiseNPCNation.php b/hwe/sammo/Event/Action/RaiseNPCNation.php index dd40e8fb..de604fa6 100644 --- a/hwe/sammo/Event/Action/RaiseNPCNation.php +++ b/hwe/sammo/Event/Action/RaiseNPCNation.php @@ -48,8 +48,9 @@ class RaiseNPCNation extends \sammo\Event\Action } $citySum += $city[$key]; } + $city['sum'] = $citySum; - $targetCities[] = [$city, $citySum]; + $targetCities[] = $city; } $cityCnt = count($targetCities); @@ -64,7 +65,7 @@ class RaiseNPCNation extends \sammo\Event\Action } usort($targetCities, function (array $lhs, array $rhs) { - return $lhs[1] <=> $rhs[1]; + return $lhs['sum'] <=> $rhs['sum']; }); @@ -152,12 +153,12 @@ class RaiseNPCNation extends \sammo\Event\Action 'trust' => 100 ]; foreach (static::CITY_KEYS as $key) { - $targetCity[$key] = min($targetCity["{$key}_max"], $avgCity[$key]); + $targetCity[$key] = min($baseCity["{$key}_max"], $avgCity[$key]); } $pickTypeList = ['무' => 1, '지' => 1]; - $cityID = $baseCity['id']; + $cityID = $baseCity['city']; $cityName = $baseCity['name']; $nationName = "ⓤ{$cityName}"; @@ -224,9 +225,8 @@ class RaiseNPCNation extends \sammo\Event\Action $avgGenCnt = $this->calcAvgNationGeneralCnt(); $serverID = UniqueConst::$serverID; - $existNations = $db->queryFirstColumn("SELECT nation FROM `nation`"); $lastNationID = max( - max($existNations), + $db->queryFirstField("SELECT max(`nation`) FROM `nation`"), $db->queryFirstField("SELECT max(`nation`) FROM `ng_old_nations` WHERE server_id = %s", $serverID), ); @@ -236,6 +236,8 @@ class RaiseNPCNation extends \sammo\Event\Action $occupiedCitiesID = array_keys($occupiedCities); $npcCitiesID = []; + refreshNationStaticInfo(); + foreach ($emptyCities as $emptyCity) { $cityID = $emptyCity['city']; diff --git a/hwe/sammo/Event/Condition/Logic.php b/hwe/sammo/Event/Condition/Logic.php index f521e6f0..9e042606 100644 --- a/hwe/sammo/Event/Condition/Logic.php +++ b/hwe/sammo/Event/Condition/Logic.php @@ -1,6 +1,8 @@ mode = $mode; - $this->conditions = $conditions; + $this->conditions = array_map(function($condition){ + return Condition::build($condition); + }, $conditions); } public function eval($env=null){ diff --git a/hwe/sammo/GeneralAI.php b/hwe/sammo/GeneralAI.php index 29b679b6..8b323f48 100644 --- a/hwe/sammo/GeneralAI.php +++ b/hwe/sammo/GeneralAI.php @@ -3067,6 +3067,9 @@ class GeneralAI if($general->getVar('makelimit')){ return null; } + if($general->getNPCType() > 2){ + return null; + } if(!$this->generalPolicy->can건국){ return null; } diff --git a/hwe/sammo/Scenario/Nation.php b/hwe/sammo/Scenario/Nation.php index b8a8ad95..4ddfc83a 100644 --- a/hwe/sammo/Scenario/Nation.php +++ b/hwe/sammo/Scenario/Nation.php @@ -76,7 +76,10 @@ class Nation{ $capital = 0; } - if(strpos($this->type, '_') === FALSE){ + if($this->type === null){ + $type = Util::choiceRandom(GameConst::$availableNationType); + } + else if(strpos($this->type, '_') === FALSE){ $type = 'che_'.$this->type; } else{ diff --git a/hwe/scenario/scenario_0.json b/hwe/scenario/scenario_0.json index 2f919edb..d44a61f1 100644 --- a/hwe/scenario/scenario_0.json +++ b/hwe/scenario/scenario_0.json @@ -8,7 +8,7 @@ }, "events":[ [ - ["Date", "==", null, 12], + ["or", ["Date", "==", null, 12], ["Date", "==", null, 6]], ["CreateManyNPC", 30], ["DeleteEvent"] ], diff --git a/hwe/scenario/scenario_1.json b/hwe/scenario/scenario_1.json index 53634559..31f45dd6 100644 --- a/hwe/scenario/scenario_1.json +++ b/hwe/scenario/scenario_1.json @@ -11,7 +11,7 @@ }, "events":[ [ - ["Date", "==", null, 12], + ["or", ["Date", "==", null, 12], ["Date", "==", null, 6]], ["CreateManyNPC", 30], ["DeleteEvent"] ], diff --git a/hwe/scenario/scenario_2.json b/hwe/scenario/scenario_2.json index c1d5c41e..e6f8f410 100644 --- a/hwe/scenario/scenario_2.json +++ b/hwe/scenario/scenario_2.json @@ -15,7 +15,7 @@ }, "events":[ [ - ["Date", "==", null, 12], + ["or", ["Date", "==", null, 12], ["Date", "==", null, 6]], ["CreateManyNPC", 30], ["DeleteEvent"] ],