feat: 전투 상대방의 특정 수치를 접근할 수 있는 callback류 생성

This commit is contained in:
2021-09-15 19:06:15 +00:00
committed by Gitea
parent f2182c195b
commit c186f05dd3
7 changed files with 156 additions and 93 deletions
+20
View File
@@ -844,6 +844,26 @@ class General implements iAction{
return $value;
}
public function onCalcOpposeStat(General $general, string $statName, $value, $aux=null){
//xxx: $general?
foreach(array_merge([
$this->nationType,
$this->officerLevelObj,
$this->specialDomesticObj,
$this->specialWarObj,
$this->personalityObj,
$this->getCrewTypeObj(),
$this->inheritBuffObj,
], $this->itemObjs) as $iObj){
if(!$iObj){
continue;
}
/** @var iAction $iObj */
$value = $iObj->onCalcOpposeStat($this, $statName, $value, $aux);
}
return $value;
}
public function onCalcStrategic(string $turnType, string $varType, $value){
foreach(array_merge([
$this->nationType,