diff --git a/hwe/sammo/DefaultActionTrigger.php b/hwe/sammo/DefaultActionTrigger.php index 66cd3d07..2b8ef456 100644 --- a/hwe/sammo/DefaultActionTrigger.php +++ b/hwe/sammo/DefaultActionTrigger.php @@ -5,8 +5,8 @@ trait DefaultActionTrigger{ public function onPreTurnExecute(General $general, ?array $nation):array{ return []; } - public function onCalcDomesticTurnScore(string $turnType, float $score, float $cost, float $successRate, float $failRate):array{ - return [$score, $cost, $successRate, $failRate]; + public function onCalcDomestic(string $turnType, string $varType, float $value):float{ + return $value; } public function onCalcSabotageProp(float $successRate):float{ diff --git a/hwe/sammo/TriggerNationType/che_덕가.php b/hwe/sammo/TriggerNationType/che_덕가.php index e9d75179..f2ec15db 100644 --- a/hwe/sammo/TriggerNationType/che_덕가.php +++ b/hwe/sammo/TriggerNationType/che_덕가.php @@ -11,22 +11,22 @@ class che_덕가 implements iActionTrigger{ static $pros = '치안↑ 인구↑ 민심↑'; static $cons = '쌀수입↓ 수성↓'; - public function onCalcDomesticTurnScore(string $turnType, float $score, float $cost, float $successRate, float $failRate):array{ + public function onCalcDomestic(string $turnType, string $varType, float $value):float{ if($turnType == 'secu'){ - $score *= 1.1; - $cost *= 0.8; + if($varType == 'score') return $value * 1.1; + if($varType == 'cost') return $value * 0.8; } else if($turnType == 'trust' || $turnType == 'pop'){ - $score *= 1.1; - $cost *= 0.8; + if($varType == 'score') return $value * 1.1; + if($varType == 'cost') return $value * 0.8; } else if($turnType == 'def' || $turnType == 'wall'){ - $score *= 0.9; - $cost *= 1.2; + if($varType == 'score') return $value * 0.9; + if($varType == 'cost') return $value * 1.2; } - return [$score, $cost, $successRate, $failRate]; + return $value; } public function onCalcNationalIncome(string $type, int $amount):int{ diff --git a/hwe/sammo/TriggerNationType/che_도가.php b/hwe/sammo/TriggerNationType/che_도가.php index 8a834f30..62e81182 100644 --- a/hwe/sammo/TriggerNationType/che_도가.php +++ b/hwe/sammo/TriggerNationType/che_도가.php @@ -11,17 +11,17 @@ class che_도가 implements iActionTrigger{ static $pros = '인구↑'; static $cons = '기술↓ 치안↓'; - public function onCalcDomesticTurnScore(string $turnType, float $score, float $cost, float $successRate, float $failRate):array{ + public function onCalcDomestic(string $turnType, string $varType, float $value):float{ if($turnType == 'tech'){ - $score *= 0.9; - $cost *= 1.2; + if($varType == 'score') return $value * 0.9; + if($varType == 'cost') return $value * 1.2; } else if($turnType == 'secu'){ - $score *= 0.9; - $cost *= 1.2; + if($varType == 'score') return $value * 0.9; + if($varType == 'cost') return $value * 1.2; } - return [$score, $cost, $successRate, $failRate]; + return $value; } public function onCalcNationalIncome(string $type, int $amount):int{ diff --git a/hwe/sammo/TriggerNationType/che_도적.php b/hwe/sammo/TriggerNationType/che_도적.php index b0853649..acab80aa 100644 --- a/hwe/sammo/TriggerNationType/che_도적.php +++ b/hwe/sammo/TriggerNationType/che_도적.php @@ -11,17 +11,17 @@ class che_도적 implements iActionTrigger{ static $pros = '계략↑'; static $cons = '금수입↓ 치안↓ 민심↓'; - public function onCalcDomesticTurnScore(string $turnType, float $score, float $cost, float $successRate, float $failRate):array{ + public function onCalcDomestic(string $turnType, string $varType, float $value):float{ if($turnType == 'secu'){ - $score *= 0.9; - $cost *= 1.2; + if($varType == 'score') return $value * 0.9; + if($varType == 'cost') return $value * 1.2; } else if($turnType == 'trust' || $turnType == 'pop'){ - $score *= 0.9; - $cost *= 1.2; + if($varType == 'score') return $value * 0.9; + if($varType == 'cost') return $value * 1.2; } - return [$score, $cost, $successRate, $failRate]; + return $value; } public function onCalcNationalIncome(string $type, int $amount):int{ diff --git a/hwe/sammo/TriggerNationType/che_명가.php b/hwe/sammo/TriggerNationType/che_명가.php index 6941aeb4..6e4ad7cd 100644 --- a/hwe/sammo/TriggerNationType/che_명가.php +++ b/hwe/sammo/TriggerNationType/che_명가.php @@ -11,18 +11,18 @@ class che_명가 implements iActionTrigger{ static $pros = '기술↑ 인구↑'; static $cons = '쌀수입↓ 수성↓'; - public function onCalcDomesticTurnScore(string $turnType, float $score, float $cost, float $successRate, float $failRate):array{ + public function onCalcDomestic(string $turnType, string $varType, float $value):float{ if($turnType == 'tech'){ - $score *= 1.1; - $cost *= 0.8; + if($varType == 'score') return $value * 1.1; + if($varType == 'cost') return $value * 0.8; } else if($turnType == 'def' || $turnType == 'wall'){ - $score *= 0.9; - $cost *= 1.2; + if($varType == 'score') return $value * 0.9; + if($varType == 'cost') return $value * 1.2; } - return [$score, $cost, $successRate, $failRate]; + return $value; } public function onCalcNationalIncome(string $type, int $amount):int{ diff --git a/hwe/sammo/TriggerNationType/che_묵가.php b/hwe/sammo/TriggerNationType/che_묵가.php index 0364a30e..1806dc77 100644 --- a/hwe/sammo/TriggerNationType/che_묵가.php +++ b/hwe/sammo/TriggerNationType/che_묵가.php @@ -11,17 +11,17 @@ class che_묵가 implements iActionTrigger{ static $pros = '수성↑'; static $cons = '기술↓'; - public function onCalcDomesticTurnScore(string $turnType, float $score, float $cost, float $successRate, float $failRate):array{ + public function onCalcDomestic(string $turnType, string $varType, float $value):float{ if($turnType == 'def' || $turnType == 'wall'){ - $score *= 1.1; - $cost *= 0.8; + if($varType == 'score') return $value * 1.1; + if($varType == 'cost') return $value * 0.8; } else if($turnType == 'tech'){ - $score *= 0.9; - $cost *= 1.2; + if($varType == 'score') return $value * 0.9; + if($varType == 'cost') return $value * 1.2; } - return [$score, $cost, $successRate, $failRate]; + return $value; } } \ No newline at end of file diff --git a/hwe/sammo/TriggerNationType/che_법가.php b/hwe/sammo/TriggerNationType/che_법가.php index bd2e678b..569cafb2 100644 --- a/hwe/sammo/TriggerNationType/che_법가.php +++ b/hwe/sammo/TriggerNationType/che_법가.php @@ -11,18 +11,18 @@ class che_법가 implements iActionTrigger{ static $pros = '금수입↑ 치안↑'; static $cons = '인구↓ 민심↓'; - public function onCalcDomesticTurnScore(string $turnType, float $score, float $cost, float $successRate, float $failRate):array{ + public function onCalcDomestic(string $turnType, string $varType, float $value):float{ if($turnType == 'secu'){ - $score *= 1.1; - $cost *= 0.8; + if($varType == 'score') return $value * 1.1; + if($varType == 'cost') return $value * 0.8; } else if($turnType == 'trust' || $turnType == 'pop'){ - $score *= 0.9; - $cost *= 1.2; + if($varType == 'score') return $value * 0.9; + if($varType == 'cost') return $value * 1.2; } - return [$score, $cost, $successRate, $failRate]; + return $value; } public function onCalcNationalIncome(string $type, int $amount):int{ diff --git a/hwe/sammo/TriggerNationType/che_병가.php b/hwe/sammo/TriggerNationType/che_병가.php index 6c28d491..26b1c309 100644 --- a/hwe/sammo/TriggerNationType/che_병가.php +++ b/hwe/sammo/TriggerNationType/che_병가.php @@ -11,22 +11,22 @@ class che_병가 implements iActionTrigger{ static $pros = '기술↑ 수성↑'; static $cons = '인구↓ 민심↓'; - public function onCalcDomesticTurnScore(string $turnType, float $score, float $cost, float $successRate, float $failRate):array{ + public function onCalcDomestic(string $turnType, string $varType, float $value):float{ if($turnType == 'tech'){ - $score *= 1.1; - $cost *= 0.8; + if($varType == 'score') return $value * 1.1; + if($varType == 'cost') return $value * 0.8; } else if($turnType == 'def' || $turnType == 'wall'){ - $score *= 1.1; - $cost *= 0.8; + if($varType == 'score') return $value * 1.1; + if($varType == 'cost') return $value * 0.8; } else if($turnType == 'trust' || $turnType == 'pop'){ - $score *= 0.9; - $cost *= 1.2; + if($varType == 'score') return $value * 0.9; + if($varType == 'cost') return $value * 1.2; } - return [$score, $cost, $successRate, $failRate]; + return $value; } public function onCalcNationalIncome(string $type, int $amount):int{ diff --git a/hwe/sammo/TriggerNationType/che_불가.php b/hwe/sammo/TriggerNationType/che_불가.php index bce1d232..77456a1a 100644 --- a/hwe/sammo/TriggerNationType/che_불가.php +++ b/hwe/sammo/TriggerNationType/che_불가.php @@ -11,17 +11,17 @@ class che_불가 implements iActionTrigger{ static $pros = '민심↑ 수성↑'; static $cons = '금수입↓'; - public function onCalcDomesticTurnScore(string $turnType, float $score, float $cost, float $successRate, float $failRate):array{ + public function onCalcDomestic(string $turnType, string $varType, float $value):float{ if($turnType == 'trust' || $turnType == 'pop'){ - $score *= 1.1; - $cost *= 0.8; + if($varType == 'score') return $value * 1.1; + if($varType == 'cost') return $value * 0.8; } else if($turnType == 'def' || $turnType == 'wall'){ - $score *= 1.1; - $cost *= 0.8; + if($varType == 'score') return $value * 1.1; + if($varType == 'cost') return $value * 0.8; } - return [$score, $cost, $successRate, $failRate]; + return $value; } public function onCalcNationalIncome(string $type, int $amount):int{ diff --git a/hwe/sammo/TriggerNationType/che_오두미도.php b/hwe/sammo/TriggerNationType/che_오두미도.php index be625852..fba1eefb 100644 --- a/hwe/sammo/TriggerNationType/che_오두미도.php +++ b/hwe/sammo/TriggerNationType/che_오두미도.php @@ -12,21 +12,21 @@ class che_오두미도 implements iActionTrigger{ static $cons = '기술↓ 수성↓ 내정↓'; - public function onCalcDomesticTurnScore(string $turnType, float $score, float $cost, float $successRate, float $failRate):array{ + public function onCalcDomestic(string $turnType, string $varType, float $value):float{ if($turnType == 'tech'){ - $score *= 0.9; - $cost *= 1.2; + if($varType == 'score') return $value * 0.9; + if($varType == 'cost') return $value * 1.2; } else if($turnType == 'def' || $turnType == 'wall'){ - $score *= 0.9; - $cost *= 1.2; + if($varType == 'score') return $value * 0.9; + if($varType == 'cost') return $value * 1.2; } else if($turnType == 'agri' || $turnType == 'comm'){ - $score *= 0.9; - $cost *= 1.2; + if($varType == 'score') return $value * 0.9; + if($varType == 'cost') return $value * 1.2; } - return [$score, $cost, $successRate, $failRate]; + return $value; } public function onCalcNationalIncome(string $type, int $amount):int{ diff --git a/hwe/sammo/TriggerNationType/che_유가.php b/hwe/sammo/TriggerNationType/che_유가.php index 622f9e53..64778b4c 100644 --- a/hwe/sammo/TriggerNationType/che_유가.php +++ b/hwe/sammo/TriggerNationType/che_유가.php @@ -11,17 +11,17 @@ class che_유가 implements iActionTrigger{ static $pros = '내정↑ 민심↑'; static $cons = '쌀수입↓'; - public function onCalcDomesticTurnScore(string $turnType, float $score, float $cost, float $successRate, float $failRate):array{ + public function onCalcDomestic(string $turnType, string $varType, float $value):float{ if($turnType == 'agri' || $turnType == 'comm'){ - $score *= 1.1; - $cost *= 0.8; + if($varType == 'score') return $value * 1.1; + if($varType == 'cost') return $value * 0.8; } else if($turnType == 'trust' || $turnType == 'pop'){ - $score *= 1.1; - $cost *= 0.8; + if($varType == 'score') return $value * 1.1; + if($varType == 'cost') return $value * 0.8; } - return [$score, $cost, $successRate, $failRate]; + return $value; } public function onCalcNationalIncome(string $type, int $amount):int{ diff --git a/hwe/sammo/TriggerNationType/che_음양가.php b/hwe/sammo/TriggerNationType/che_음양가.php index ef94b251..ceeed9a2 100644 --- a/hwe/sammo/TriggerNationType/che_음양가.php +++ b/hwe/sammo/TriggerNationType/che_음양가.php @@ -11,18 +11,18 @@ class che_음양가 implements iActionTrigger{ static $pros = '내정↑ 인구↑'; static $cons = '기술↓ 전략↓'; - public function onCalcDomesticTurnScore(string $turnType, float $score, float $cost, float $successRate, float $failRate):array{ + public function onCalcDomestic(string $turnType, string $varType, float $value):float{ if($turnType == 'agri' || $turnType == 'comm'){ - $score *= 1.1; - $cost *= 0.8; + if($varType == 'score') return $value * 1.1; + if($varType == 'cost') return $value * 0.8; } else if($turnType == 'tech'){ - $score *= 0.9; - $cost *= 1.2; + if($varType == 'score') return $value * 0.9; + if($varType == 'cost') return $value * 1.2; } - return [$score, $cost, $successRate, $failRate]; + return $value; } public function onCalcNationalIncome(string $type, int $amount):int{ diff --git a/hwe/sammo/TriggerNationType/che_종횡가.php b/hwe/sammo/TriggerNationType/che_종횡가.php index 57bc953c..0df6e961 100644 --- a/hwe/sammo/TriggerNationType/che_종횡가.php +++ b/hwe/sammo/TriggerNationType/che_종횡가.php @@ -11,18 +11,18 @@ class che_종횡가 implements iActionTrigger{ static $pros = '전략↑ 수성↑'; static $cons = '금수입↓ 내정↓'; - public function onCalcDomesticTurnScore(string $turnType, float $score, float $cost, float $successRate, float $failRate):array{ + public function onCalcDomestic(string $turnType, string $varType, float $value):float{ if($turnType == 'def' || $turnType == 'wall'){ - $score *= 1.1; - $cost *= 0.8; + if($varType == 'score') return $value * 1.1; + if($varType == 'cost') return $value * 0.8; } - + else if($turnType == 'agri' || $turnType == 'comm'){ - $score *= 0.9; - $cost *= 1.2; + if($varType == 'score') return $value * 0.9; + if($varType == 'cost') return $value * 1.2; } - return [$score, $cost, $successRate, $failRate]; + return $value; } public function onCalcNationalIncome(string $type, int $amount):int{ diff --git a/hwe/sammo/TriggerNationType/che_태평도.php b/hwe/sammo/TriggerNationType/che_태평도.php index 9f20c4c1..64c13868 100644 --- a/hwe/sammo/TriggerNationType/che_태평도.php +++ b/hwe/sammo/TriggerNationType/che_태평도.php @@ -11,22 +11,22 @@ class che_태평도 implements iActionTrigger{ static $pros = '인구↑ 민심↑'; static $cons = '기술↓ 수성↓'; - public function onCalcDomesticTurnScore(string $turnType, float $score, float $cost, float $successRate, float $failRate):array{ + public function onCalcDomestic(string $turnType, string $varType, float $value):float{ if($turnType == 'trust' || $turnType == 'pop'){ - $score *= 1.1; - $cost *= 0.8; + if($varType == 'score') return $value * 1.1; + if($varType == 'cost') return $value * 0.8; } else if($turnType == 'tech'){ - $score *= 0.9; - $cost *= 1.2; + if($varType == 'score') return $value * 0.9; + if($varType == 'cost') return $value * 1.2; } else if($turnType == 'def' || $turnType == 'wall'){ - $score *= 0.9; - $cost *= 1.2; + if($varType == 'score') return $value * 0.9; + if($varType == 'cost') return $value * 1.2; } - return [$score, $cost, $successRate, $failRate]; + return $value; } public function onCalcNationalIncome(string $type, int $amount):int{ diff --git a/hwe/sammo/iActionTrigger.php b/hwe/sammo/iActionTrigger.php index 155e2216..fc1b7f6e 100644 --- a/hwe/sammo/iActionTrigger.php +++ b/hwe/sammo/iActionTrigger.php @@ -11,7 +11,7 @@ interface iActionTrigger{ //TODO: 능력치는? public function onPreTurnExecute(General $general, ?array $nation):array; - public function onCalcDomesticTurnScore(string $turnType, float $score, float $cost, float $successRate, float $failRate):array; + public function onCalcDomestic(string $turnType, string $varType, float $value):float; public function onCalcSabotageProp(float $successRate):float; public function onPreGeneralStatUpdate(General $general, string $statName, $value);