From b0113a785653bdc00f7fa4a462584f29a116d408 Mon Sep 17 00:00:00 2001 From: hide_d Date: Fri, 10 Sep 2021 02:33:47 +0900 Subject: [PATCH] =?UTF-8?q?inheritBuff=20=EC=A4=80=EB=B9=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/General.php | 18 +++++++++++++++++- hwe/sammo/TriggerInheritBuff.php | 16 ++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 hwe/sammo/TriggerInheritBuff.php diff --git a/hwe/sammo/General.php b/hwe/sammo/General.php index 206a2b8d..91adcf4d 100644 --- a/hwe/sammo/General.php +++ b/hwe/sammo/General.php @@ -35,6 +35,8 @@ class General implements iAction{ protected $personalityObj = null; /** @var iAction[] */ protected $itemObjs = []; + /** @var iAction */ + protected $inheritBuffObj = null; protected $lastTurn = null; protected $resultTurn = null; @@ -136,6 +138,11 @@ class General implements iAction{ $this->itemObjs['weapon'] = buildItemClass($raw['weapon']); $this->itemObjs['book'] = buildItemClass($raw['book']); $this->itemObjs['item'] = buildItemClass($raw['item']); + + $rawInheritBuff = $this->getAuxVar('inheritBuff'); + if($rawInheritBuff !== null){ + $this->inheritBuffObj = new TriggerInheritBuff($rawInheritBuff); + } } function initLogger(int $year, int $month){ @@ -410,7 +417,8 @@ class General implements iAction{ $this->officerLevelObj, $this->specialDomesticObj, $this->specialWarObj, - $this->personalityObj + $this->personalityObj, + $this->inheritBuffObj, ] as $actionObj){ if($actionObj !== null){ $statValue = $actionObj->onCalcStat($this, $statName, $statValue); @@ -785,6 +793,7 @@ class General implements iAction{ $this->specialWarObj, $this->personalityObj, $this->getCrewTypeObj(), + $this->inheritBuffObj, ], $this->itemObjs) as $iObj){ if(!$iObj){ @@ -804,6 +813,7 @@ class General implements iAction{ $this->specialWarObj, $this->personalityObj, $this->getCrewTypeObj(), + $this->inheritBuffObj, ], $this->itemObjs) as $iObj){ if(!$iObj){ continue; @@ -823,6 +833,7 @@ class General implements iAction{ $this->specialWarObj, $this->personalityObj, $this->getCrewTypeObj(), + $this->inheritBuffObj, ], $this->itemObjs) as $iObj){ if(!$iObj){ continue; @@ -841,6 +852,7 @@ class General implements iAction{ $this->specialWarObj, $this->personalityObj, $this->getCrewTypeObj(), + $this->inheritBuffObj, ], $this->itemObjs) as $iObj){ if(!$iObj){ continue; @@ -859,6 +871,7 @@ class General implements iAction{ $this->specialWarObj, $this->personalityObj, $this->getCrewTypeObj(), + $this->inheritBuffObj, ], $this->itemObjs) as $iObj){ if(!$iObj){ continue; @@ -880,6 +893,7 @@ class General implements iAction{ $this->specialWarObj, $this->personalityObj, $this->getCrewTypeObj(), + $this->inheritBuffObj, ], $this->itemObjs) as $iObj){ if(!$iObj){ continue; @@ -900,6 +914,7 @@ class General implements iAction{ $this->specialWarObj, $this->personalityObj, $this->getCrewTypeObj(), + $this->inheritBuffObj, ], $this->itemObjs) as $iObj){ if(!$iObj){ continue; @@ -927,6 +942,7 @@ class General implements iAction{ $this->specialWarObj, $this->personalityObj, $this->getCrewTypeObj(), + $this->inheritBuffObj, ], $this->itemObjs) as $iObj){ if(!$iObj){ continue; diff --git a/hwe/sammo/TriggerInheritBuff.php b/hwe/sammo/TriggerInheritBuff.php new file mode 100644 index 00000000..a0029997 --- /dev/null +++ b/hwe/sammo/TriggerInheritBuff.php @@ -0,0 +1,16 @@ +inheritBuffList = $inheritBuffList; + } + + public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{ + return $value; + } +} \ No newline at end of file