초반 m장 스탯 관련 문제 해결, 장수 선택 term 해결

This commit is contained in:
2021-01-01 21:09:43 +09:00
parent 528d30c317
commit f33e645113
4 changed files with 18 additions and 9 deletions
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -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, '이');
+5 -3
View File
@@ -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[] = [
+11 -4
View File
@@ -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){