game,feat: 새 도구 아이템 추가, 아이템 효과에 필요한 기능 추가 #206

Merged
Hide_D merged 25 commits from items_add into devel 2022-02-22 00:50:13 +09:00
3 changed files with 25 additions and 0 deletions
Showing only changes of commit af3a60590e - Show all commits
+4
View File
@@ -46,4 +46,8 @@ trait DefaultAction{
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return null;
}
public function onArbitraryAction(General $general, string $actionType, ?string $phase=null, $aux=null): null|array{
return $aux;
}
}
+19
View File
@@ -1010,6 +1010,25 @@ class General implements iAction
return $amount;
}
public function onArbitraryAction(General $general, string $actionType, ?string $phase=null, $aux=null): null|array{
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 */
$aux = $iObj->onArbitraryAction($general, $actionType, $phase, $aux);
}
return $aux;
}
public function getWarPowerMultiplier(WarUnit $unit): array
{
//xxx:$unit
+2
View File
@@ -18,4 +18,6 @@ interface iAction{
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller;
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller;
//NOTE: getBattleEndSkillTriggerList도 필요한가?
public function onArbitraryAction(General $general, string $actionType, ?string $phase=null, ?array $aux=null): null|array;
}