lbonus를TriggerGeneralLevel, calcLeadershipBonus로통합
This commit is contained in:
@@ -5,10 +5,14 @@ class TriggerGeneralLevel implements iAction{
|
||||
use DefaultAction;
|
||||
|
||||
protected $generalLevel;
|
||||
protected $nationLevel;
|
||||
protected $lbonus;
|
||||
|
||||
public function __construct(array $general, ?array $city){
|
||||
public function __construct(array $general, int $nationLevel, ?array $city){
|
||||
$this->generalLevel = $general['level'];
|
||||
|
||||
$this->nationLevel = $nationLevel;
|
||||
|
||||
if($city === null){
|
||||
if(2 <= $this->generalLevel || $this->generalLevel <= 4){
|
||||
$this->generalLevel = 1;
|
||||
@@ -31,6 +35,8 @@ class TriggerGeneralLevel implements iAction{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->lbonus = calcLeadershipBonus($this->generalLevel, $nationLevel);
|
||||
}
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
||||
@@ -57,4 +63,11 @@ class TriggerGeneralLevel implements iAction{
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||
if($statName == 'leadership'){
|
||||
return $value + $this->lbonus;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user