diff --git a/hwe/func.php b/hwe/func.php index b66e984e..d8e18a86 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -31,14 +31,6 @@ require_once('func_command.php'); function getNationStaticInfo($nationID, $forceRefresh=false) { static $nationList = null; - static $freeNation = [ - 'nation'=>0, - 'name'=>'재야', - 'color'=>'#000000', - 'type'=>0, - 'level'=>0, - 'capital'=>0 - ]; if ($forceRefresh) { $nationList = null; @@ -48,7 +40,14 @@ function getNationStaticInfo($nationID, $forceRefresh=false) return null; } if($nationID === 0){ - return $freeNation; + return [ + 'nation'=>0, + 'name'=>'재야', + 'color'=>'#000000', + 'type'=>GameConst::$neutralNationType, + 'level'=>0, + 'capital'=>0 + ]; } if($nationList === null){ diff --git a/hwe/sammo/DefaultActionTrigger.php b/hwe/sammo/DefaultActionTrigger.php index a64dcea8..a5c7a6b2 100644 --- a/hwe/sammo/DefaultActionTrigger.php +++ b/hwe/sammo/DefaultActionTrigger.php @@ -5,7 +5,7 @@ trait DefaultActionTrigger{ public function onPreTurnExecute(General $general, ?array $nation):array{ return []; } - public function onCalcDomesticTurnScore(General $general, string $turnType, float $score, float $cost, float $successRate, float $failRate):array{ + public function onCalcDomesticTurnScore(string $turnType, float $score, float $cost, float $successRate, float $failRate):array{ return [$score, $cost, $successRate, $failRate]; } diff --git a/hwe/sammo/General.php b/hwe/sammo/General.php index abbbdd55..ed32e31a 100644 --- a/hwe/sammo/General.php +++ b/hwe/sammo/General.php @@ -6,7 +6,6 @@ class General{ use LazyVarUpdater; protected $raw = []; - protected $rawNation; protected $logger; @@ -14,14 +13,16 @@ class General{ protected $logActivatedSkill = []; protected $isFinished = false; + protected $nationType; + public function __construct(array $raw, int $year, int $month){ //TODO: 밖에서 가져오도록 하면 버그 확률이 높아짐. 필요한 raw 값을 직접 구해야함. - if($raw['nation']){ - $staticNation = getNationStaticInfo($raw['nation']); - setLeadershipBonus($raw, $staticNation['level']); - } + + $staticNation = getNationStaticInfo($raw['nation']); + setLeadershipBonus($raw, $staticNation['level']); $this->raw = $raw; + $this->logger = new ActionLogger( $this->getVar('no'), $this->getVar('nation'), @@ -29,6 +30,9 @@ class General{ $month, false ); + + $nationTypeClass = getNationTypeClass($staticNation['type']); + $this->nationType = new $nationTypeClass; } protected function clearActivatedSkill(){ diff --git a/hwe/sammo/NationType/che_유가.php b/hwe/sammo/NationType/che_유가.php deleted file mode 100644 index fffaa06f..00000000 --- a/hwe/sammo/NationType/che_유가.php +++ /dev/null @@ -1,22 +0,0 @@ -