From 435044dddde2a07abb65048489fb5fb3b016bfb4 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 20 Feb 2022 04:30:05 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=9E=84=EC=9D=98=20=EC=BB=A4=EB=A7=A8?= =?UTF-8?q?=EB=93=9C=EC=9A=A9=20=ED=8A=B8=EB=A6=AC=EA=B1=B0=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/DefaultAction.php | 4 ++++ hwe/sammo/General.php | 19 +++++++++++++++++++ hwe/sammo/iAction.php | 2 ++ 3 files changed, 25 insertions(+) diff --git a/hwe/sammo/DefaultAction.php b/hwe/sammo/DefaultAction.php index f6aec8e8..6b77c848 100644 --- a/hwe/sammo/DefaultAction.php +++ b/hwe/sammo/DefaultAction.php @@ -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; + } } \ No newline at end of file diff --git a/hwe/sammo/General.php b/hwe/sammo/General.php index d00912ca..b5027204 100644 --- a/hwe/sammo/General.php +++ b/hwe/sammo/General.php @@ -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 diff --git a/hwe/sammo/iAction.php b/hwe/sammo/iAction.php index d0393dec..54b5588e 100644 --- a/hwe/sammo/iAction.php +++ b/hwe/sammo/iAction.php @@ -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; } \ No newline at end of file