inheritBuff 준비

This commit is contained in:
2021-09-10 02:33:47 +09:00
parent 96e14fd6fc
commit b0113a7856
2 changed files with 33 additions and 1 deletions
+17 -1
View File
@@ -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;
+16
View File
@@ -0,0 +1,16 @@
<?php
namespace sammo;
class TriggerInheritBuff implements iAction{
use DefaultAction;
protected array $inheritBuffList;
public function __construct(array $inheritBuffList){
$this->inheritBuffList = $inheritBuffList;
}
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
return $value;
}
}