특기 초기화 추가

This commit is contained in:
2020-05-09 13:14:11 +09:00
parent 7104d983cd
commit ad868f1df3
7 changed files with 188 additions and 11 deletions
+16 -2
View File
@@ -179,7 +179,7 @@ class SpecialityHelper{
return $result;
}
public static function pickSpecialDomestic(array $general) : string{
public static function pickSpecialDomestic(array $general, array $prevSpecials=[]) : string{
$pAbs = [];
$pRel = [];
@@ -201,6 +201,9 @@ class SpecialityHelper{
if(!$valid){
continue;
}
if(in_array($specialID, $prevSpecials)){
continue;
}
if($weightType === static::WEIGHT_PERCENT){
@@ -226,10 +229,14 @@ class SpecialityHelper{
return $id;
}
if($prevSpecials){
return static::pickSpecialDomestic($general, []);
}
throw new MustNotBeReachedException();
}
public static function pickSpecialWar(array $general) : string{
public static function pickSpecialWar(array $general, array $prevSpecials=[]) : string{
$reqDex = [];
$pAbs = [];
$pRel = [];
@@ -254,6 +261,9 @@ class SpecialityHelper{
if(!$valid){
continue;
}
if(in_array($specialID, $prevSpecials)){
continue;
}
if($cond & self::REQ_DEXTERITY){
@@ -286,6 +296,10 @@ class SpecialityHelper{
return $id;
}
if($prevSpecials){
return static::pickSpecialWar($general, []);
}
throw new MustNotBeReachedException();
}
}