diff --git a/hwe/sammo/Constraint/Constraint.php b/hwe/sammo/Constraint/Constraint.php index 1383bef4..1d99956e 100644 --- a/hwe/sammo/Constraint/Constraint.php +++ b/hwe/sammo/Constraint/Constraint.php @@ -79,6 +79,9 @@ abstract class Constraint{ static public function build(array $input):this{ $self = new static(); foreach($input as $key=>$value){ + if($value === null){ + continue; + } switch($key){ case 'general': $self->general($value); break; case 'city': $self->city($value); break; diff --git a/hwe/sammo/DefaultActionTrigger.php b/hwe/sammo/DefaultActionTrigger.php index 2b8ef456..9b767ca1 100644 --- a/hwe/sammo/DefaultActionTrigger.php +++ b/hwe/sammo/DefaultActionTrigger.php @@ -9,10 +9,6 @@ trait DefaultActionTrigger{ return $value; } - public function onCalcSabotageProp(float $successRate):float{ - return $successRate; - } - public function onPreGeneralStatUpdate(General $general, string $statName, $value){ return $value; } diff --git a/hwe/sammo/TriggerCharacter/None.php b/hwe/sammo/TriggerCharacter/None.php new file mode 100644 index 00000000..f362e591 --- /dev/null +++ b/hwe/sammo/TriggerCharacter/None.php @@ -0,0 +1,11 @@ +generalLevel, [12, 11, 9, 7, 5, 3])){ return $value * 1.05; } } - else if($turnType == 'tech'){ + else if($turnType == '기술'){ if(in_array($this->generalLevel, [12, 11, 9, 7, 5])){ return $value * 1.05; } } - else if($turnType == 'trust' || $turnType == 'pop'){ + else if($turnType == '민심' || $turnType == '인구'){ if(in_array($this->generalLevel, [12, 11, 2])){ return $value * 1.05; } } - else if($turnType == 'def' || $turnType == 'wall' || $turnType == 'secu'){ + else if($turnType == '수비' || $turnType == '성벽' || $turnType == '치안'){ if(in_array($this->generalLevel, [12, 11, 10, 8, 6, 4])){ return $value * 1.05; } diff --git a/hwe/sammo/TriggerNationType/che_덕가.php b/hwe/sammo/TriggerNationType/che_덕가.php index f2ec15db..dc041b84 100644 --- a/hwe/sammo/TriggerNationType/che_덕가.php +++ b/hwe/sammo/TriggerNationType/che_덕가.php @@ -12,16 +12,16 @@ class che_덕가 implements iActionTrigger{ static $cons = '쌀수입↓ 수성↓'; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'secu'){ + if($turnType == '치안'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; } - else if($turnType == 'trust' || $turnType == 'pop'){ + else if($turnType == '민심' || $turnType == '인구'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; } - else if($turnType == 'def' || $turnType == 'wall'){ + else if($turnType == '수비' || $turnType == '성벽'){ if($varType == 'score') return $value * 0.9; if($varType == 'cost') return $value * 1.2; } diff --git a/hwe/sammo/TriggerNationType/che_도가.php b/hwe/sammo/TriggerNationType/che_도가.php index 62e81182..6165b6d8 100644 --- a/hwe/sammo/TriggerNationType/che_도가.php +++ b/hwe/sammo/TriggerNationType/che_도가.php @@ -12,11 +12,11 @@ class che_도가 implements iActionTrigger{ static $cons = '기술↓ 치안↓'; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'tech'){ + if($turnType == '기술'){ if($varType == 'score') return $value * 0.9; if($varType == 'cost') return $value * 1.2; } - else if($turnType == 'secu'){ + else if($turnType == '치안'){ if($varType == 'score') return $value * 0.9; if($varType == 'cost') return $value * 1.2; } diff --git a/hwe/sammo/TriggerNationType/che_도적.php b/hwe/sammo/TriggerNationType/che_도적.php index acab80aa..6191ee0c 100644 --- a/hwe/sammo/TriggerNationType/che_도적.php +++ b/hwe/sammo/TriggerNationType/che_도적.php @@ -12,14 +12,18 @@ class che_도적 implements iActionTrigger{ static $cons = '금수입↓ 치안↓ 민심↓'; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'secu'){ + if($turnType == '치안'){ if($varType == 'score') return $value * 0.9; if($varType == 'cost') return $value * 1.2; } - else if($turnType == 'trust' || $turnType == 'pop'){ + else if($turnType == '민심' || $turnType == '인구'){ if($varType == 'score') return $value * 0.9; if($varType == 'cost') return $value * 1.2; } + else if($turnType == '계략'){ + if($varType == 'succ') return $value + 0.1; + } + return $value; } @@ -31,8 +35,4 @@ class che_도적 implements iActionTrigger{ return $amount; } - - public function onCalcSabotageProp(float $successRate):float{ - return $successRate + 0.1; - } } \ No newline at end of file diff --git a/hwe/sammo/TriggerNationType/che_명가.php b/hwe/sammo/TriggerNationType/che_명가.php index 6e4ad7cd..a10ab152 100644 --- a/hwe/sammo/TriggerNationType/che_명가.php +++ b/hwe/sammo/TriggerNationType/che_명가.php @@ -12,12 +12,12 @@ class che_명가 implements iActionTrigger{ static $cons = '쌀수입↓ 수성↓'; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'tech'){ + if($turnType == '기술'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; } - else if($turnType == 'def' || $turnType == 'wall'){ + else if($turnType == '수비' || $turnType == '성벽'){ if($varType == 'score') return $value * 0.9; if($varType == 'cost') return $value * 1.2; } diff --git a/hwe/sammo/TriggerNationType/che_묵가.php b/hwe/sammo/TriggerNationType/che_묵가.php index 1806dc77..fdc12c13 100644 --- a/hwe/sammo/TriggerNationType/che_묵가.php +++ b/hwe/sammo/TriggerNationType/che_묵가.php @@ -12,12 +12,12 @@ class che_묵가 implements iActionTrigger{ static $cons = '기술↓'; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'def' || $turnType == 'wall'){ + if($turnType == '수비' || $turnType == '성벽'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; } - else if($turnType == 'tech'){ + else if($turnType == '기술'){ if($varType == 'score') return $value * 0.9; if($varType == 'cost') return $value * 1.2; } diff --git a/hwe/sammo/TriggerNationType/che_법가.php b/hwe/sammo/TriggerNationType/che_법가.php index 569cafb2..3c647584 100644 --- a/hwe/sammo/TriggerNationType/che_법가.php +++ b/hwe/sammo/TriggerNationType/che_법가.php @@ -12,12 +12,12 @@ class che_법가 implements iActionTrigger{ static $cons = '인구↓ 민심↓'; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'secu'){ + if($turnType == '치안'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; } - else if($turnType == 'trust' || $turnType == 'pop'){ + else if($turnType == '민심' || $turnType == '인구'){ if($varType == 'score') return $value * 0.9; if($varType == 'cost') return $value * 1.2; } diff --git a/hwe/sammo/TriggerNationType/che_병가.php b/hwe/sammo/TriggerNationType/che_병가.php index 26b1c309..174a1ed4 100644 --- a/hwe/sammo/TriggerNationType/che_병가.php +++ b/hwe/sammo/TriggerNationType/che_병가.php @@ -12,16 +12,16 @@ class che_병가 implements iActionTrigger{ static $cons = '인구↓ 민심↓'; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'tech'){ + if($turnType == '기술'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; } - else if($turnType == 'def' || $turnType == 'wall'){ + else if($turnType == '수비' || $turnType == '성벽'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; } - else if($turnType == 'trust' || $turnType == 'pop'){ + else if($turnType == '민심' || $turnType == '인구'){ if($varType == 'score') return $value * 0.9; if($varType == 'cost') return $value * 1.2; } diff --git a/hwe/sammo/TriggerNationType/che_불가.php b/hwe/sammo/TriggerNationType/che_불가.php index 77456a1a..fbb0a615 100644 --- a/hwe/sammo/TriggerNationType/che_불가.php +++ b/hwe/sammo/TriggerNationType/che_불가.php @@ -12,11 +12,11 @@ class che_불가 implements iActionTrigger{ static $cons = '금수입↓'; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'trust' || $turnType == 'pop'){ + if($turnType == '민심' || $turnType == '인구'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; } - else if($turnType == 'def' || $turnType == 'wall'){ + else if($turnType == '수비' || $turnType == '성벽'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; } diff --git a/hwe/sammo/TriggerNationType/che_오두미도.php b/hwe/sammo/TriggerNationType/che_오두미도.php index fba1eefb..70f4075f 100644 --- a/hwe/sammo/TriggerNationType/che_오두미도.php +++ b/hwe/sammo/TriggerNationType/che_오두미도.php @@ -13,15 +13,15 @@ class che_오두미도 implements iActionTrigger{ public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'tech'){ + if($turnType == '기술'){ if($varType == 'score') return $value * 0.9; if($varType == 'cost') return $value * 1.2; } - else if($turnType == 'def' || $turnType == 'wall'){ + else if($turnType == '수비' || $turnType == '성벽'){ if($varType == 'score') return $value * 0.9; if($varType == 'cost') return $value * 1.2; } - else if($turnType == 'agri' || $turnType == 'comm'){ + else if($turnType == '농업' || $turnType == '상업'){ if($varType == 'score') return $value * 0.9; if($varType == 'cost') return $value * 1.2; } diff --git a/hwe/sammo/TriggerNationType/che_유가.php b/hwe/sammo/TriggerNationType/che_유가.php index 64778b4c..c992c639 100644 --- a/hwe/sammo/TriggerNationType/che_유가.php +++ b/hwe/sammo/TriggerNationType/che_유가.php @@ -12,11 +12,11 @@ class che_유가 implements iActionTrigger{ static $cons = '쌀수입↓'; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'agri' || $turnType == 'comm'){ + if($turnType == '농업' || $turnType == '상업'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; } - else if($turnType == 'trust' || $turnType == 'pop'){ + else if($turnType == '민심' || $turnType == '인구'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; } diff --git a/hwe/sammo/TriggerNationType/che_음양가.php b/hwe/sammo/TriggerNationType/che_음양가.php index ceeed9a2..3834e8a9 100644 --- a/hwe/sammo/TriggerNationType/che_음양가.php +++ b/hwe/sammo/TriggerNationType/che_음양가.php @@ -12,12 +12,12 @@ class che_음양가 implements iActionTrigger{ static $cons = '기술↓ 전략↓'; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'agri' || $turnType == 'comm'){ + if($turnType == '농업' || $turnType == '상업'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; } - else if($turnType == 'tech'){ + else if($turnType == '기술'){ if($varType == 'score') return $value * 0.9; if($varType == 'cost') return $value * 1.2; } diff --git a/hwe/sammo/TriggerNationType/che_종횡가.php b/hwe/sammo/TriggerNationType/che_종횡가.php index 0df6e961..3fa83c3b 100644 --- a/hwe/sammo/TriggerNationType/che_종횡가.php +++ b/hwe/sammo/TriggerNationType/che_종횡가.php @@ -12,12 +12,12 @@ class che_종횡가 implements iActionTrigger{ static $cons = '금수입↓ 내정↓'; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'def' || $turnType == 'wall'){ + if($turnType == '수비' || $turnType == '성벽'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; } - else if($turnType == 'agri' || $turnType == 'comm'){ + else if($turnType == '농업' || $turnType == '상업'){ if($varType == 'score') return $value * 0.9; if($varType == 'cost') return $value * 1.2; } diff --git a/hwe/sammo/TriggerNationType/che_태평도.php b/hwe/sammo/TriggerNationType/che_태평도.php index 64c13868..4ab58bbc 100644 --- a/hwe/sammo/TriggerNationType/che_태평도.php +++ b/hwe/sammo/TriggerNationType/che_태평도.php @@ -12,16 +12,16 @@ class che_태평도 implements iActionTrigger{ static $cons = '기술↓ 수성↓'; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'trust' || $turnType == 'pop'){ + if($turnType == '민심' || $turnType == '인구'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; } - else if($turnType == 'tech'){ + else if($turnType == '기술'){ if($varType == 'score') return $value * 0.9; if($varType == 'cost') return $value * 1.2; } - else if($turnType == 'def' || $turnType == 'wall'){ + else if($turnType == '수비' || $turnType == '성벽'){ if($varType == 'score') return $value * 0.9; if($varType == 'cost') return $value * 1.2; } diff --git a/hwe/sammo/TriggerSpecialDomestic/che_경작.php b/hwe/sammo/TriggerSpecialDomestic/che_경작.php index 7eed5ca8..523c03a6 100644 --- a/hwe/sammo/TriggerSpecialDomestic/che_경작.php +++ b/hwe/sammo/TriggerSpecialDomestic/che_경작.php @@ -18,7 +18,7 @@ class che_경작 implements iActionTrigger{ ]; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'agri'){ + if($turnType == '농업'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; if($varType == 'succ') return $value + 0.1; diff --git a/hwe/sammo/TriggerSpecialDomestic/che_귀모.php b/hwe/sammo/TriggerSpecialDomestic/che_귀모.php index 17cf8014..aacf2656 100644 --- a/hwe/sammo/TriggerSpecialDomestic/che_귀모.php +++ b/hwe/sammo/TriggerSpecialDomestic/che_귀모.php @@ -19,7 +19,12 @@ class che_귀모 implements iActionTrigger{ SpecialityConst::STAT_INTEL ]; - public function onCalcSabotageProp(float $successRate):float{ - return $successRate + 0.2; + public function onCalcDomestic(string $turnType, string $varType, float $value):float{ + if($turnType == '계략'){ + if($varType == 'succ') return $value + 0.1; + } + + + return $value; } } \ No newline at end of file diff --git a/hwe/sammo/TriggerSpecialDomestic/che_발명.php b/hwe/sammo/TriggerSpecialDomestic/che_발명.php index 4c1101b6..61fe179b 100644 --- a/hwe/sammo/TriggerSpecialDomestic/che_발명.php +++ b/hwe/sammo/TriggerSpecialDomestic/che_발명.php @@ -18,7 +18,7 @@ class che_발명 implements iActionTrigger{ ]; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'tech'){ + if($turnType == '기술'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; if($varType == 'succ') return $value + 0.1; diff --git a/hwe/sammo/TriggerSpecialDomestic/che_상재.php b/hwe/sammo/TriggerSpecialDomestic/che_상재.php index 45109b9b..7325d631 100644 --- a/hwe/sammo/TriggerSpecialDomestic/che_상재.php +++ b/hwe/sammo/TriggerSpecialDomestic/che_상재.php @@ -18,7 +18,7 @@ class che_상재 implements iActionTrigger{ ]; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'comm'){ + if($turnType == '상업'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; if($varType == 'succ') return $value + 0.1; diff --git a/hwe/sammo/TriggerSpecialDomestic/che_수비.php b/hwe/sammo/TriggerSpecialDomestic/che_수비.php index 67f9d7dd..f0eda7ad 100644 --- a/hwe/sammo/TriggerSpecialDomestic/che_수비.php +++ b/hwe/sammo/TriggerSpecialDomestic/che_수비.php @@ -18,7 +18,7 @@ class che_수비 implements iActionTrigger{ ]; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'def'){ + if($turnType == '수비'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; if($varType == 'succ') return $value + 0.1; diff --git a/hwe/sammo/TriggerSpecialDomestic/che_인덕.php b/hwe/sammo/TriggerSpecialDomestic/che_인덕.php index 5478cd1f..c0e6b76d 100644 --- a/hwe/sammo/TriggerSpecialDomestic/che_인덕.php +++ b/hwe/sammo/TriggerSpecialDomestic/che_인덕.php @@ -18,7 +18,7 @@ class che_통찰 implements iActionTrigger{ ]; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'trust' || $turnType == 'pop'){ + if($turnType == '민심' || $turnType == '인구'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; if($varType == 'succ') return $value + 0.1; diff --git a/hwe/sammo/TriggerSpecialDomestic/che_축성.php b/hwe/sammo/TriggerSpecialDomestic/che_축성.php index 687ff0c0..c91ec03c 100644 --- a/hwe/sammo/TriggerSpecialDomestic/che_축성.php +++ b/hwe/sammo/TriggerSpecialDomestic/che_축성.php @@ -18,7 +18,7 @@ class che_축성 implements iActionTrigger{ ]; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'wall'){ + if($turnType == '성벽'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; if($varType == 'succ') return $value + 0.1; diff --git a/hwe/sammo/TriggerSpecialDomestic/che_통찰.php b/hwe/sammo/TriggerSpecialDomestic/che_통찰.php index 7559c56f..7d8e7211 100644 --- a/hwe/sammo/TriggerSpecialDomestic/che_통찰.php +++ b/hwe/sammo/TriggerSpecialDomestic/che_통찰.php @@ -18,7 +18,7 @@ class che_통찰 implements iActionTrigger{ ]; public function onCalcDomestic(string $turnType, string $varType, float $value):float{ - if($turnType == 'secu'){ + if($turnType == '치안'){ if($varType == 'score') return $value * 1.1; if($varType == 'cost') return $value * 0.8; if($varType == 'succ') return $value + 0.1; diff --git a/hwe/sammo/iActionTrigger.php b/hwe/sammo/iActionTrigger.php index fc1b7f6e..1ea18ef3 100644 --- a/hwe/sammo/iActionTrigger.php +++ b/hwe/sammo/iActionTrigger.php @@ -12,7 +12,6 @@ interface iActionTrigger{ //TODO: 능력치는? public function onPreTurnExecute(General $general, ?array $nation):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);