From 34204f6183b2cdcebc7ab97c1353c4aeabd61a93 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 2 Sep 2018 21:57:44 +0900 Subject: [PATCH] =?UTF-8?q?onCalcDomesticTurnScore=20=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?=20TriggerNationType=EC=97=90=EC=84=9C=20=EC=88=AB=EC=9E=90=20i?= =?UTF-8?q?d=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func.php | 17 +++++++-------- hwe/sammo/DefaultActionTrigger.php | 2 +- hwe/sammo/General.php | 14 ++++++++----- hwe/sammo/NationType/che_유가.php | 22 -------------------- hwe/sammo/Scenario/Nation.php | 2 +- hwe/sammo/TriggerNationType/che_덕가.php | 1 - hwe/sammo/TriggerNationType/che_도가.php | 1 - hwe/sammo/TriggerNationType/che_도적.php | 1 - hwe/sammo/TriggerNationType/che_명가.php | 1 - hwe/sammo/TriggerNationType/che_묵가.php | 1 - hwe/sammo/TriggerNationType/che_법가.php | 1 - hwe/sammo/TriggerNationType/che_병가.php | 1 - hwe/sammo/TriggerNationType/che_불가.php | 1 - hwe/sammo/TriggerNationType/che_오두미도.php | 12 +++++++++-- hwe/sammo/TriggerNationType/che_유가.php | 3 +-- hwe/sammo/TriggerNationType/che_음양가.php | 10 +++++++-- hwe/sammo/TriggerNationType/che_종횡가.php | 10 +++++++-- hwe/sammo/TriggerNationType/che_중립.php | 1 - hwe/sammo/TriggerNationType/che_태평도.php | 1 - hwe/sammo/iActionTrigger.php | 2 +- 20 files changed, 47 insertions(+), 57 deletions(-) delete mode 100644 hwe/sammo/NationType/che_유가.php 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 @@ -