diff --git a/hwe/j_select_picked_general.php b/hwe/j_select_picked_general.php index af141e3a..392e7485 100644 --- a/hwe/j_select_picked_general.php +++ b/hwe/j_select_picked_general.php @@ -118,7 +118,7 @@ foreach(GameConst::$generalPoolAllowOption as $allowOption){ $builder->setOwner($userID); $builder->setKillturn(5); $builder->setNPCType(0); -$builder->setAuxVar('next_change', TimeUtil::nowAddMinutes(24 * $env['turnterm'])); +$builder->setAuxVar('next_change', TimeUtil::nowAddMinutes(12 * $env['turnterm'])); $builder->fillRemainSpecAsZero($env); $builder->build($env); $generalID = $builder->getGeneralID(); diff --git a/hwe/j_update_picked_general.php b/hwe/j_update_picked_general.php index ddd1b5cc..6f25eb9f 100644 --- a/hwe/j_update_picked_general.php +++ b/hwe/j_update_picked_general.php @@ -129,7 +129,7 @@ if(key_exists('specialDomestic', $info)){ if(key_exists('specialWar', $info)){ $generalObj->updateVar('special2', $info['specialWar']); } -$generalObj->setAuxVar('next_change', TimeUtil::nowAddMinutes(24 * $turnterm)); +$generalObj->setAuxVar('next_change', TimeUtil::nowAddMinutes(12 * $turnterm)); $userNick = $ownerInfo['name']; $josaYi = JosaUtil::pick($userNick, '이'); diff --git a/hwe/sammo/Event/Action/CreateManyNPC.php b/hwe/sammo/Event/Action/CreateManyNPC.php index 79ec2cc1..b9ce5da8 100644 --- a/hwe/sammo/Event/Action/CreateManyNPC.php +++ b/hwe/sammo/Event/Action/CreateManyNPC.php @@ -28,9 +28,11 @@ class CreateManyNPC extends \sammo\Event\Action{ ->setNPCType(3) ->setMoney(1000, 1000) ->setExpDed(0, 0) - ->setLifeSpan($birthYear, $deathYear) - ->fillRandomStat($pickTypeList) - ->fillRemainSpecAsZero($env); + ->setLifeSpan($birthYear, $deathYear); + if($newNPC->getStat()[0]===null){ + $newNPC->fillRandomStat($pickTypeList); + } + $newNPC->fillRemainSpecAsZero($env); $newNPC->build($env); $pickedNPC->occupyGeneralName(); $result[] = [ diff --git a/hwe/sammo/Scenario/GeneralBuilder.php b/hwe/sammo/Scenario/GeneralBuilder.php index 59856946..8decfe65 100644 --- a/hwe/sammo/Scenario/GeneralBuilder.php +++ b/hwe/sammo/Scenario/GeneralBuilder.php @@ -260,6 +260,14 @@ class GeneralBuilder{ return $this; } + public function getStat():array{ + return [ + $this->leadership, + $this->strength, + $this->intel + ]; + } + public function setAuxVar(string $key, $value):self{ if($value === null){ unset($this->aux[$key]); @@ -416,7 +424,9 @@ class GeneralBuilder{ $this->specAge2 = Util::valueFit(Util::round((GameConst::$retirementYear - $age)/6 - $relYear / 2), 3) + $age; } - if($this->leadership!==null && $this->strength!==null && $this->intel!== null){ + if ($this->leadership===null || $this->strength===null || $this->intel === null){ + $this->fillRandomStat($pickTypeList, $pickType); + }else{ $leadership = $this->leadership; $strength = $this->strength; $intel = $this->intel; @@ -442,9 +452,6 @@ class GeneralBuilder{ }while(0); } - else{ - $this->fillRandomStat($pickTypeList, $pickType); - } if($this->officerLevel === null){ if($this->nationID){