내특을 int에서 string으로 변경

This commit is contained in:
2018-09-03 02:07:41 +09:00
parent 9c15dbd673
commit 1529913ae4
24 changed files with 133 additions and 126 deletions
+7 -1
View File
@@ -99,6 +99,12 @@ class GameConstBase
'che_도적', 'che_명가', 'che_음양가', 'che_종횡가', 'che_불가', 'che_오두미도', 'che_태평도', 'che_도가',
'che_묵가', 'che_덕가', 'che_병가', 'che_유가', 'che_법가'
];
/** @var array 기본 국가 성향 */
public static $neutralNationType = 'che_중립';
/** @var array 선택 가능한 장수 내정 특기 */
public static $availableSpecialDomestic = [
'che_경작', 'che_상재', 'che_발명', 'che_축성', 'che_수비', 'che_통찰', 'che_인덕', 'che_귀모',
];
/** @var array 기본 특기(공용) */
public static $defaultSpecial = 'None';
}
+1
View File
@@ -16,6 +16,7 @@ class General{
protected $nationType;
protected $levelObj;
protected $specialDomesticObj;
public function __construct(array $raw, ?array $city, int $year, int $month){
//TODO: 밖에서 가져오도록 하면 버그 확률이 높아짐. 필요한 raw 값을 직접 구해야함.
+13 -7
View File
@@ -20,7 +20,7 @@ class NPC{
public $birth;
public $death;
public $ego;
public $charDomestic = 0;
public $charDomestic;
public $charWar = 0;
public $npc = 2;
public $text;
@@ -62,6 +62,8 @@ class NPC{
'intel'=>$intel
];
$this->charDomestic = \sammo\GameConst::$defaultSpecial;
if($char === '랜덤전특'){
$this->charWar = \sammo\SpecialityConst::pickSpecialWar($general);
}
@@ -76,13 +78,17 @@ class NPC{
$this->charDomestic = \sammo\SpecialityConst::pickSpecialDomestic($general);
}
}
else if($char !== null){
}
else{
$char = \sammo\SpecCall($char);
if($char < 40){
$this->charDomestic = $char;
//TODO: 내특, 전특 구분 필요
try{
$domesticClass = \sammo\getGeneralSpecialDomesticClass($char);
$this->charDomestic = Util::getClassName($domesticClass);
}
else{
$this->charWar = $char;
catch (Exception $e) {
$this->charWar = \sammo\SpecCall($char);
}
}
}
@@ -153,7 +159,7 @@ class NPC{
if($isFictionMode){
$charWar = 0;
$charDomestic = 0;
$charDomestic = GameConst::$defaultSpecial;
}
$name = 'ⓝ'.$this->name;
+11 -12
View File
@@ -29,18 +29,17 @@ class SpecialityConst{
//음수 : 절대값 %, 양수 : 상대적 비중
const DOMESTIC = [
1 => ['경작', 1, [self::STAT_INTEL]],
2 => ['상재', 1, [self::STAT_INTEL]],
3 => ['발명', 1, [self::STAT_INTEL]],
'che_경작' => ['경작', 1, [self::STAT_INTEL]],
'che_상재' => ['상재', 1, [self::STAT_INTEL]],
'che_발명' => ['발명', 1, [self::STAT_INTEL]],
10 => ['축성', 1, [self::STAT_POWER]],
11 => ['수비', 1, [self::STAT_POWER]],
12 => ['통찰', 1, [self::STAT_POWER]],
'che_축성' => ['축성', 1, [self::STAT_POWER]],
'che_수비' => ['수비', 1, [self::STAT_POWER]],
'che_통찰' => ['통찰', 1, [self::STAT_POWER]],
20 => ['인덕', 1, [self::STAT_LEADERSHIP]],
'che_인덕' => ['인덕', 1, [self::STAT_LEADERSHIP]],
30 => ['거상', -2.5, [self::DISABLED]],
31 => ['귀모', -2.5, [self::STAT_LEADERSHIP, self::STAT_POWER, self::STAT_INTEL]],
'che_귀모' => ['귀모', -2.5, [self::STAT_LEADERSHIP, self::STAT_POWER, self::STAT_INTEL]],
];
const WAR = [
@@ -162,7 +161,7 @@ class SpecialityConst{
return array_keys($dex, max($dex))[0];
}
public static function pickSpecialDomestic(array $general) : int{
public static function pickSpecialDomestic(array $general) : string{
$pAbs = [];
$pRel = [];
@@ -204,7 +203,7 @@ class SpecialityConst{
return $id;
}
return static::pickStatickWar($general);
throw new MustNotBeReachedException();
}
public static function pickSpecialWar(array $general) : int{
@@ -258,6 +257,6 @@ class SpecialityConst{
return $id;
}
return static::pickStatickWar($general);
throw new MustNotBeReachedException();
}
}
+2 -2
View File
@@ -110,8 +110,8 @@ class WarUnit{
return $this->deadCurr;
}
function getSpecialDomestic():int{
return 0;
function getSpecialDomestic():string{
return GameConst::$defaultSpecial;
}
function getSpecialWar():int{
+1 -1
View File
@@ -53,7 +53,7 @@ class WarUnitGeneral extends WarUnit{
return $this->rawCity[$key];
}
function getSpecialDomestic():int{
function getSpecialDomestic():string{
return $this->getVar('special');
}