onCalcDomesticTurnScore 구조 변경
This commit is contained in:
@@ -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{
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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{
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user