inheritBuff 준비
This commit is contained in:
+17
-1
@@ -35,6 +35,8 @@ class General implements iAction{
|
|||||||
protected $personalityObj = null;
|
protected $personalityObj = null;
|
||||||
/** @var iAction[] */
|
/** @var iAction[] */
|
||||||
protected $itemObjs = [];
|
protected $itemObjs = [];
|
||||||
|
/** @var iAction */
|
||||||
|
protected $inheritBuffObj = null;
|
||||||
|
|
||||||
protected $lastTurn = null;
|
protected $lastTurn = null;
|
||||||
protected $resultTurn = null;
|
protected $resultTurn = null;
|
||||||
@@ -136,6 +138,11 @@ class General implements iAction{
|
|||||||
$this->itemObjs['weapon'] = buildItemClass($raw['weapon']);
|
$this->itemObjs['weapon'] = buildItemClass($raw['weapon']);
|
||||||
$this->itemObjs['book'] = buildItemClass($raw['book']);
|
$this->itemObjs['book'] = buildItemClass($raw['book']);
|
||||||
$this->itemObjs['item'] = buildItemClass($raw['item']);
|
$this->itemObjs['item'] = buildItemClass($raw['item']);
|
||||||
|
|
||||||
|
$rawInheritBuff = $this->getAuxVar('inheritBuff');
|
||||||
|
if($rawInheritBuff !== null){
|
||||||
|
$this->inheritBuffObj = new TriggerInheritBuff($rawInheritBuff);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function initLogger(int $year, int $month){
|
function initLogger(int $year, int $month){
|
||||||
@@ -410,7 +417,8 @@ class General implements iAction{
|
|||||||
$this->officerLevelObj,
|
$this->officerLevelObj,
|
||||||
$this->specialDomesticObj,
|
$this->specialDomesticObj,
|
||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj
|
$this->personalityObj,
|
||||||
|
$this->inheritBuffObj,
|
||||||
] as $actionObj){
|
] as $actionObj){
|
||||||
if($actionObj !== null){
|
if($actionObj !== null){
|
||||||
$statValue = $actionObj->onCalcStat($this, $statName, $statValue);
|
$statValue = $actionObj->onCalcStat($this, $statName, $statValue);
|
||||||
@@ -785,6 +793,7 @@ class General implements iAction{
|
|||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
|
$this->inheritBuffObj,
|
||||||
], $this->itemObjs) as $iObj){
|
], $this->itemObjs) as $iObj){
|
||||||
|
|
||||||
if(!$iObj){
|
if(!$iObj){
|
||||||
@@ -804,6 +813,7 @@ class General implements iAction{
|
|||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
|
$this->inheritBuffObj,
|
||||||
], $this->itemObjs) as $iObj){
|
], $this->itemObjs) as $iObj){
|
||||||
if(!$iObj){
|
if(!$iObj){
|
||||||
continue;
|
continue;
|
||||||
@@ -823,6 +833,7 @@ class General implements iAction{
|
|||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
|
$this->inheritBuffObj,
|
||||||
], $this->itemObjs) as $iObj){
|
], $this->itemObjs) as $iObj){
|
||||||
if(!$iObj){
|
if(!$iObj){
|
||||||
continue;
|
continue;
|
||||||
@@ -841,6 +852,7 @@ class General implements iAction{
|
|||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
|
$this->inheritBuffObj,
|
||||||
], $this->itemObjs) as $iObj){
|
], $this->itemObjs) as $iObj){
|
||||||
if(!$iObj){
|
if(!$iObj){
|
||||||
continue;
|
continue;
|
||||||
@@ -859,6 +871,7 @@ class General implements iAction{
|
|||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
|
$this->inheritBuffObj,
|
||||||
], $this->itemObjs) as $iObj){
|
], $this->itemObjs) as $iObj){
|
||||||
if(!$iObj){
|
if(!$iObj){
|
||||||
continue;
|
continue;
|
||||||
@@ -880,6 +893,7 @@ class General implements iAction{
|
|||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
|
$this->inheritBuffObj,
|
||||||
], $this->itemObjs) as $iObj){
|
], $this->itemObjs) as $iObj){
|
||||||
if(!$iObj){
|
if(!$iObj){
|
||||||
continue;
|
continue;
|
||||||
@@ -900,6 +914,7 @@ class General implements iAction{
|
|||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
|
$this->inheritBuffObj,
|
||||||
], $this->itemObjs) as $iObj){
|
], $this->itemObjs) as $iObj){
|
||||||
if(!$iObj){
|
if(!$iObj){
|
||||||
continue;
|
continue;
|
||||||
@@ -927,6 +942,7 @@ class General implements iAction{
|
|||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
|
$this->inheritBuffObj,
|
||||||
], $this->itemObjs) as $iObj){
|
], $this->itemObjs) as $iObj){
|
||||||
if(!$iObj){
|
if(!$iObj){
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user