fix: m장, 의병장 숙련이 설정되지 않는 버그 수정

This commit is contained in:
2021-09-04 03:42:09 +09:00
parent 7cd40fca03
commit e64812da72
+23 -24
View File
@@ -16,22 +16,22 @@ class GeneralBuilder{
protected $owner = 0; protected $owner = 0;
protected $ownerName = null; protected $ownerName = null;
protected $affinity=null; protected $affinity=null;
protected $nameCustomPrefix=null; protected $nameCustomPrefix=null;
protected $name; protected $name;
protected $imgsvr = 0; protected $imgsvr = 0;
protected $picturePath; protected $picturePath;
protected $nationID; protected $nationID;
protected $cityID; protected $cityID;
protected $leadership=null; protected $leadership=null;
protected $strength=null; protected $strength=null;
protected $intel=null; protected $intel=null;
protected $officerLevel; protected $officerLevel;
protected $birth=null; protected $birth=null;
protected $death=null; protected $death=null;
protected $ego=null; protected $ego=null;
protected $specialDomestic=null; protected $specialDomestic=null;
protected $specialWar=null; protected $specialWar=null;
protected $npc = 2; protected $npc = 2;
protected $text; protected $text;
static $prefixList = [ static $prefixList = [
@@ -42,7 +42,7 @@ class GeneralBuilder{
4 => 'ⓖ', //의병장(전략) 4 => 'ⓖ', //의병장(전략)
5 => '㉥', //부대장 5 => '㉥', //부대장
6 => 'ⓤ', //unselectable npc, 빙의 불가 npc 6 => 'ⓤ', //unselectable npc, 빙의 불가 npc
9 => 'ⓞ', //오랑캐? 9 => 'ⓞ', //오랑캐?
]; ];
@@ -66,12 +66,12 @@ class GeneralBuilder{
protected $aux = []; protected $aux = [];
public function __construct( public function __construct(
string $name, string $name,
bool $isDynamicImageSvr, bool $isDynamicImageSvr,
$picturePath, $picturePath,
int $nationID int $nationID
){ ){
$this->name = $name; $this->name = $name;
$this->imgsvr = $isDynamicImageSvr; $this->imgsvr = $isDynamicImageSvr;
$this->picturePath = $picturePath; $this->picturePath = $picturePath;
@@ -144,7 +144,7 @@ class GeneralBuilder{
$this->specialDomestic = $specialDomestic; $this->specialDomestic = $specialDomestic;
$this->specialWar = $specialWar; $this->specialWar = $specialWar;
return $this; return $this;
} }
public function setOfficerLevel(int $level):self{ public function setOfficerLevel(int $level):self{
@@ -380,7 +380,7 @@ class GeneralBuilder{
if($this->specialWar === null){ if($this->specialWar === null){
$this->specialWar = GameConst::$defaultSpecialWar; $this->specialWar = GameConst::$defaultSpecialWar;
} }
if($this->killturn === null && $this->owner){ if($this->killturn === null && $this->owner){
$this->killturn = 5; $this->killturn = 5;
} }
@@ -408,7 +408,7 @@ class GeneralBuilder{
$this->death = $this->birth+Util::randRangeInt(60, 80); $this->death = $this->birth+Util::randRangeInt(60, 80);
} }
if($this->specAge===null){ if($this->specAge===null){
$age = $env['year']-$this->birth; $age = $env['year']-$this->birth;
$relYear = Util::valueFit($env['year'] - $env['startyear'], 0); $relYear = Util::valueFit($env['year'] - $env['startyear'], 0);
@@ -459,7 +459,7 @@ class GeneralBuilder{
} }
} }
if($this->dex1 === null){ if(!$this->dex1 && in_array('dex_t', $avgGen)){
$dexTotal = $avgGen['dex_t']; $dexTotal = $avgGen['dex_t'];
if ($pickType == '무') { if ($pickType == '무') {
$dexVal = Util::choiceRandom([ $dexVal = Util::choiceRandom([
@@ -532,7 +532,7 @@ class GeneralBuilder{
public function build($env){ public function build($env){
//scenario에 life==1인 경우 수명 제한이 없어지는 모양. //scenario에 life==1인 경우 수명 제한이 없어지는 모양.
if(!key_exists('stored_icons', $env)){ if(!key_exists('stored_icons', $env)){
try{ try{
@@ -542,7 +542,7 @@ class GeneralBuilder{
catch(\Exception $e){ catch(\Exception $e){
$storedIcons = []; $storedIcons = [];
} }
$env['stored_icons'] = $storedIcons; $env['stored_icons'] = $storedIcons;
} }
@@ -559,7 +559,7 @@ class GeneralBuilder{
else{ else{
$name = $this->nameCustomPrefix.$this->name; $name = $this->nameCustomPrefix.$this->name;
} }
$this->realName = $name; $this->realName = $name;
if($this->death <= $year){ if($this->death <= $year){
@@ -635,7 +635,6 @@ class GeneralBuilder{
'@phan-var array<string,string|int> $cityObj'; '@phan-var array<string,string|int> $cityObj';
$this->cityID = $cityObj['id']; $this->cityID = $cityObj['id'];
} }
$experience = $this->experience?:$age * 100; $experience = $this->experience?:$age * 100;
$dedication = $this->dedication?:$age * 100; $dedication = $this->dedication?:$age * 100;