feat: 전투 상대방의 특정 수치를 접근할 수 있는 callback류 생성
This commit is contained in:
@@ -25,6 +25,10 @@ trait DefaultAction{
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function onCalcOpposeStat(General $general, string $statName, $value, $aux=null){
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
public function onCalcStrategic(string $turnType, string $varType, $value){
|
public function onCalcStrategic(string $turnType, string $varType, $value){
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -844,6 +844,26 @@ class General implements iAction{
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function onCalcOpposeStat(General $general, string $statName, $value, $aux=null){
|
||||||
|
//xxx: $general?
|
||||||
|
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 */
|
||||||
|
$value = $iObj->onCalcOpposeStat($this, $statName, $value, $aux);
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
public function onCalcStrategic(string $turnType, string $varType, $value){
|
public function onCalcStrategic(string $turnType, string $varType, $value){
|
||||||
foreach(array_merge([
|
foreach(array_merge([
|
||||||
$this->nationType,
|
$this->nationType,
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace sammo;
|
namespace sammo;
|
||||||
|
|
||||||
class WarUnitGeneral extends WarUnit{
|
class WarUnitGeneral extends WarUnit
|
||||||
|
{
|
||||||
protected $raw;
|
protected $raw;
|
||||||
|
|
||||||
function __construct(General $general, array $rawNation, bool $isAttacker){
|
function __construct(General $general, array $rawNation, bool $isAttacker)
|
||||||
|
{
|
||||||
$this->general = $general;
|
$this->general = $general;
|
||||||
$this->raw = $general->getRaw();
|
$this->raw = $general->getRaw();
|
||||||
$this->rawNation = $rawNation; //read-only
|
$this->rawNation = $rawNation; //read-only
|
||||||
@@ -23,35 +26,35 @@ class WarUnitGeneral extends WarUnit{
|
|||||||
if ($rawNation['capital'] == $this->getCityVar('city')) {
|
if ($rawNation['capital'] == $this->getCityVar('city')) {
|
||||||
$this->atmosBonus += 5;
|
$this->atmosBonus += 5;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
//수비자 보정
|
//수비자 보정
|
||||||
if ($cityLevel == 1) {
|
if ($cityLevel == 1) {
|
||||||
$this->trainBonus += 5;
|
$this->trainBonus += 5;
|
||||||
}
|
} else if ($cityLevel == 3) {
|
||||||
else if($cityLevel == 3){
|
|
||||||
$this->trainBonus += 5;
|
$this->trainBonus += 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getName():string{
|
function getName(): string
|
||||||
|
{
|
||||||
return $this->general->getName();
|
return $this->general->getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCityVar(string $key){
|
function getCityVar(string $key)
|
||||||
|
{
|
||||||
return $this->general->getRawCity()[$key];
|
return $this->general->getRawCity()[$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
function setOppose(?WarUnit $oppose){
|
function setOppose(?WarUnit $oppose)
|
||||||
|
{
|
||||||
parent::setOppose($oppose);
|
parent::setOppose($oppose);
|
||||||
$general = $this->general;
|
$general = $this->general;
|
||||||
$this->general->increaseRankVar('warnum', 1);
|
$this->general->increaseRankVar('warnum', 1);
|
||||||
|
|
||||||
if ($this->isAttacker) {
|
if ($this->isAttacker) {
|
||||||
$semiTurn = $general->getTurnTime();
|
$semiTurn = $general->getTurnTime();
|
||||||
}
|
} else if ($oppose !== null) {
|
||||||
else if($oppose !== null){
|
|
||||||
$semiTurn = $oppose->getGeneral()->getTurnTime();
|
$semiTurn = $oppose->getGeneral()->getTurnTime();
|
||||||
}
|
}
|
||||||
$phase = $this->getRealPhase();
|
$phase = $this->getRealPhase();
|
||||||
@@ -60,54 +63,71 @@ class WarUnitGeneral extends WarUnit{
|
|||||||
$general->setVar('recent_war', $semiTurn);
|
$general->setVar('recent_war', $semiTurn);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMaxPhase():int{
|
function getMaxPhase(): int
|
||||||
|
{
|
||||||
$phase = $this->getCrewType()->speed;
|
$phase = $this->getCrewType()->speed;
|
||||||
$phase = $this->general->onCalcStat($this->general, 'initWarPhase', $phase, ['isAttacker' => $this->isAttacker]);
|
$phase = $this->general->onCalcStat($this->general, 'initWarPhase', $phase, ['isAttacker' => $this->isAttacker]);
|
||||||
|
$phase = $this->oppose->general->onCalcOpposeStat($this->general, 'initWarPhase', $phase, ['isAttacker' => $this->isAttacker]);
|
||||||
return $phase + $this->bonusPhase;
|
return $phase + $this->bonusPhase;
|
||||||
}
|
}
|
||||||
|
|
||||||
function addTrain(int $train){
|
function addTrain(int $train)
|
||||||
|
{
|
||||||
$this->general->increaseVarWithLimit('train', $train, 0, GameConst::$maxTrainByWar);
|
$this->general->increaseVarWithLimit('train', $train, 0, GameConst::$maxTrainByWar);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addAtmos(int $atmos){
|
function addAtmos(int $atmos)
|
||||||
|
{
|
||||||
$this->general->increaseVarWithLimit('atmos', $atmos, 0, GameConst::$maxAtmosByWar);
|
$this->general->increaseVarWithLimit('atmos', $atmos, 0, GameConst::$maxAtmosByWar);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDex(GameUnitDetail $crewType){
|
function getDex(GameUnitDetail $crewType)
|
||||||
$rawDex = $this->general->getDex($crewType);
|
{
|
||||||
return $this->general->onCalcStat($this->general, 'dex'.$crewType->armType, $rawDex, [
|
$dex = $this->general->getDex($crewType);
|
||||||
|
$dex = $this->general->onCalcStat($this->general, 'dex' . $crewType->armType, $dex, [
|
||||||
'isAttacker' => $this->isAttacker,
|
'isAttacker' => $this->isAttacker,
|
||||||
'opposeType' => $this->oppose->getCrewType()
|
'opposeType' => $this->oppose->getCrewType()
|
||||||
]);
|
]);
|
||||||
|
$dex = $this->oppose->general->onCalcOpposeStat($this->general, 'dex' . $crewType->armType, $dex, [
|
||||||
|
'isAttacker' => $this->isAttacker,
|
||||||
|
'opposeType' => $this->oppose->getCrewType()
|
||||||
|
]);
|
||||||
|
return $dex;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getComputedTrain(){
|
function getComputedTrain()
|
||||||
|
{
|
||||||
$train = $this->general->getVar('train');
|
$train = $this->general->getVar('train');
|
||||||
$train = $this->general->onCalcStat($this->general, 'bonusTrain', $train, ['isAttacker' => $this->isAttacker]);
|
$train = $this->general->onCalcStat($this->general, 'bonusTrain', $train, ['isAttacker' => $this->isAttacker]);
|
||||||
|
$train = $this->oppose->general->onCalcOpposeStat($this->general, 'bonusTrain', $train, ['isAttacker' => $this->isAttacker]);
|
||||||
$train += $this->trainBonus;
|
$train += $this->trainBonus;
|
||||||
|
|
||||||
return $train;
|
return $train;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getComputedAtmos(){
|
function getComputedAtmos()
|
||||||
|
{
|
||||||
$atmos = $this->general->getVar('atmos');
|
$atmos = $this->general->getVar('atmos');
|
||||||
$atmos = $this->general->onCalcStat($this->general, 'bonusAtmos', $atmos, ['isAttacker' => $this->isAttacker]);
|
$atmos = $this->general->onCalcStat($this->general, 'bonusAtmos', $atmos, ['isAttacker' => $this->isAttacker]);
|
||||||
|
$atmos = $this->oppose->general->onCalcOpposeStat($this->general, 'bonusAtmos', $atmos, ['isAttacker' => $this->isAttacker]);
|
||||||
$atmos += $this->atmosBonus;
|
$atmos += $this->atmosBonus;
|
||||||
|
|
||||||
return $atmos;
|
return $atmos;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getComputedCriticalRatio():float{
|
function getComputedCriticalRatio(): float
|
||||||
|
{
|
||||||
$general = $this->general;
|
$general = $this->general;
|
||||||
$criticalRatio = $this->getCrewType()->getCriticalRatio($general);
|
$criticalRatio = $this->getCrewType()->getCriticalRatio($general);
|
||||||
|
|
||||||
/** @var float $criticalRatio */
|
/** @var float $criticalRatio */
|
||||||
$criticalRatio = $general->onCalcStat($general, 'warCriticalRatio', $criticalRatio, ['isAttacker' => $this->isAttacker]);
|
$criticalRatio = $general->onCalcStat($general, 'warCriticalRatio', $criticalRatio, ['isAttacker' => $this->isAttacker]);
|
||||||
|
$criticalRatio = $this->oppose->general->onCalcOpposeStat($general, 'warCriticalRatio', $criticalRatio, ['isAttacker' => $this->isAttacker]);
|
||||||
return $criticalRatio;
|
return $criticalRatio;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getComputedAvoidRatio():float{
|
function getComputedAvoidRatio(): float
|
||||||
|
{
|
||||||
$general = $this->general;
|
$general = $this->general;
|
||||||
|
|
||||||
$avoidRatio = $this->getCrewType()->avoid / 100;
|
$avoidRatio = $this->getCrewType()->avoid / 100;
|
||||||
@@ -115,6 +135,7 @@ class WarUnitGeneral extends WarUnit{
|
|||||||
|
|
||||||
/** @var float $avoidRatio */
|
/** @var float $avoidRatio */
|
||||||
$avoidRatio = $general->onCalcStat($general, 'warAvoidRatio', $avoidRatio, ['isAttacker' => $this->isAttacker]);
|
$avoidRatio = $general->onCalcStat($general, 'warAvoidRatio', $avoidRatio, ['isAttacker' => $this->isAttacker]);
|
||||||
|
$avoidRatio = $this->oppose->general->onCalcOpposeStat($general, 'warAvoidRatio', $avoidRatio, ['isAttacker' => $this->isAttacker]);
|
||||||
|
|
||||||
if ($this->getOppose()->getCrewType()->armType == GameUnitConst::T_FOOTMAN) {
|
if ($this->getOppose()->getCrewType()->armType == GameUnitConst::T_FOOTMAN) {
|
||||||
$avoidRatio *= 0.75;
|
$avoidRatio *= 0.75;
|
||||||
@@ -123,7 +144,8 @@ class WarUnitGeneral extends WarUnit{
|
|||||||
return $avoidRatio;
|
return $avoidRatio;
|
||||||
}
|
}
|
||||||
|
|
||||||
function addWin(){
|
function addWin()
|
||||||
|
{
|
||||||
$general = $this->general;
|
$general = $this->general;
|
||||||
$general->increaseRankVar('killnum', 1);
|
$general->increaseRankVar('killnum', 1);
|
||||||
|
|
||||||
@@ -137,7 +159,8 @@ class WarUnitGeneral extends WarUnit{
|
|||||||
$this->addStatExp(1);
|
$this->addStatExp(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addStatExp(int $value = 1){
|
function addStatExp(int $value = 1)
|
||||||
|
{
|
||||||
$general = $this->general;
|
$general = $this->general;
|
||||||
if ($this->crewType->armType == GameUnitConst::T_WIZARD) { // 귀병
|
if ($this->crewType->armType == GameUnitConst::T_WIZARD) { // 귀병
|
||||||
$general->increaseVar('intel_exp', $value);
|
$general->increaseVar('intel_exp', $value);
|
||||||
@@ -148,7 +171,8 @@ class WarUnitGeneral extends WarUnit{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addLevelExp(float $value){
|
function addLevelExp(float $value)
|
||||||
|
{
|
||||||
$general = $this->general;
|
$general = $this->general;
|
||||||
if (!$this->isAttacker) {
|
if (!$this->isAttacker) {
|
||||||
$value *= 0.8;
|
$value *= 0.8;
|
||||||
@@ -156,18 +180,21 @@ class WarUnitGeneral extends WarUnit{
|
|||||||
$general->addExperience($value);
|
$general->addExperience($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addDedication(float $value){
|
function addDedication(float $value)
|
||||||
|
{
|
||||||
$general = $this->general;
|
$general = $this->general;
|
||||||
$general->addDedication($value);
|
$general->addDedication($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addLose(){
|
function addLose()
|
||||||
|
{
|
||||||
$general = $this->general;
|
$general = $this->general;
|
||||||
$general->increaseRankVar('deathnum', 1);
|
$general->increaseRankVar('deathnum', 1);
|
||||||
$this->addStatExp(1);
|
$this->addStatExp(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function computeWarPower(){
|
function computeWarPower()
|
||||||
|
{
|
||||||
[$warPower, $opposeWarPowerMultiply] = parent::computeWarPower();
|
[$warPower, $opposeWarPowerMultiply] = parent::computeWarPower();
|
||||||
|
|
||||||
$general = $this->general;
|
$general = $this->general;
|
||||||
@@ -178,19 +205,15 @@ class WarUnitGeneral extends WarUnit{
|
|||||||
if ($this->isAttacker) {
|
if ($this->isAttacker) {
|
||||||
if ($officerLevel == 12) {
|
if ($officerLevel == 12) {
|
||||||
$warPower *= 1.10;
|
$warPower *= 1.10;
|
||||||
}
|
} else if ($officerLevel == 11 | $officerLevel == 10 || $officerLevel == 8 || $officerLevel == 6) {
|
||||||
else if($officerLevel == 11 | $officerLevel == 10 || $officerLevel == 8 || $officerLevel == 6){
|
|
||||||
$warPower *= 1.05;
|
$warPower *= 1.05;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
if ($officerLevel == 12) {
|
if ($officerLevel == 12) {
|
||||||
$opposeWarPowerMultiply *= 0.90;
|
$opposeWarPowerMultiply *= 0.90;
|
||||||
}
|
} else if ($officerLevel == 11 || $officerLevel == 9 || $officerLevel == 7 || $officerLevel == 5) {
|
||||||
else if($officerLevel == 11 || $officerLevel == 9 || $officerLevel == 7 || $officerLevel == 5){
|
|
||||||
$opposeWarPowerMultiply *= 0.95;
|
$opposeWarPowerMultiply *= 0.95;
|
||||||
}
|
} else if (2 <= $officerLevel && $officerLevel <= 4 && $officerCity == $cityID) {
|
||||||
else if(2 <= $officerLevel && $officerLevel <= 4 && $officerCity == $cityID){
|
|
||||||
$opposeWarPowerMultiply *= 0.95;
|
$opposeWarPowerMultiply *= 0.95;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -199,8 +222,7 @@ class WarUnitGeneral extends WarUnit{
|
|||||||
|
|
||||||
if ($this->getOppose() instanceof WarUnitCity) {
|
if ($this->getOppose() instanceof WarUnitCity) {
|
||||||
$warPower *= 1 + $expLevel / 600;
|
$warPower *= 1 + $expLevel / 600;
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$warPower /= max(0.01, 1 - $expLevel / 300);
|
$warPower /= max(0.01, 1 - $expLevel / 300);
|
||||||
$opposeWarPowerMultiply *= max(0.01, 1 - $expLevel / 300);
|
$opposeWarPowerMultiply *= max(0.01, 1 - $expLevel / 300);
|
||||||
}
|
}
|
||||||
@@ -215,15 +237,18 @@ class WarUnitGeneral extends WarUnit{
|
|||||||
return [$warPower, $opposeWarPowerMultiply];
|
return [$warPower, $opposeWarPowerMultiply];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getHP():int{
|
function getHP(): int
|
||||||
|
{
|
||||||
return $this->general->getVar('crew');
|
return $this->general->getVar('crew');
|
||||||
}
|
}
|
||||||
|
|
||||||
function addDex(GameUnitDetail $crewType, float $exp){
|
function addDex(GameUnitDetail $crewType, float $exp)
|
||||||
|
{
|
||||||
$this->general->addDex($crewType, $exp, false);
|
$this->general->addDex($crewType, $exp, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function decreaseHP(int $damage):int{
|
function decreaseHP(int $damage): int
|
||||||
|
{
|
||||||
$general = $this->general;
|
$general = $this->general;
|
||||||
$damage = min($damage, $general->getVar('crew'));
|
$damage = min($damage, $general->getVar('crew'));
|
||||||
|
|
||||||
@@ -240,7 +265,8 @@ class WarUnitGeneral extends WarUnit{
|
|||||||
return $general->getVar('crew');
|
return $general->getVar('crew');
|
||||||
}
|
}
|
||||||
|
|
||||||
function increaseKilled(int $damage):int{
|
function increaseKilled(int $damage): int
|
||||||
|
{
|
||||||
$general = $this->general;
|
$general = $this->general;
|
||||||
$this->addLevelExp($damage / 50);
|
$this->addLevelExp($damage / 50);
|
||||||
|
|
||||||
@@ -265,7 +291,8 @@ class WarUnitGeneral extends WarUnit{
|
|||||||
return $this->killed;
|
return $this->killed;
|
||||||
}
|
}
|
||||||
|
|
||||||
function tryWound():bool{
|
function tryWound(): bool
|
||||||
|
{
|
||||||
$general = $this->general;
|
$general = $this->general;
|
||||||
if ($this->hasActivatedSkillOnLog('부상무효')) {
|
if ($this->hasActivatedSkillOnLog('부상무효')) {
|
||||||
return false;
|
return false;
|
||||||
@@ -285,7 +312,8 @@ class WarUnitGeneral extends WarUnit{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function continueWar(&$noRice):bool{
|
function continueWar(&$noRice): bool
|
||||||
|
{
|
||||||
$general = $this->general;
|
$general = $this->general;
|
||||||
if ($this->getHP() <= 0) {
|
if ($this->getHP() <= 0) {
|
||||||
$noRice = false;
|
$noRice = false;
|
||||||
@@ -298,11 +326,13 @@ class WarUnitGeneral extends WarUnit{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkStatChange():bool{
|
function checkStatChange(): bool
|
||||||
|
{
|
||||||
return $this->general->checkStatChange();
|
return $this->general->checkStatChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
function finishBattle(){
|
function finishBattle()
|
||||||
|
{
|
||||||
if ($this->isFinished) {
|
if ($this->isFinished) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -325,10 +355,10 @@ class WarUnitGeneral extends WarUnit{
|
|||||||
$this->checkStatChange();
|
$this->checkStatChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyDB(\MeekroDB $db):bool{
|
function applyDB(\MeekroDB $db): bool
|
||||||
|
{
|
||||||
$affected = $this->getGeneral()->applyDB($db);
|
$affected = $this->getGeneral()->applyDB($db);
|
||||||
$this->getLogger()->flush();
|
$this->getLogger()->flush();
|
||||||
return $affected;
|
return $affected;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -27,8 +27,10 @@ class che_계략발동 extends BaseWarUnitTrigger{
|
|||||||
[$magic, $damage] = $selfEnv['magic'];
|
[$magic, $damage] = $selfEnv['magic'];
|
||||||
|
|
||||||
$damage = $general->onCalcStat($general, 'warMagicFailDamage', $damage, $magic);
|
$damage = $general->onCalcStat($general, 'warMagicFailDamage', $damage, $magic);
|
||||||
|
$damage = $oppose->getGeneral()->onCalcOpposeStat($general, 'warMagicFailDamage', $damage, $magic);
|
||||||
$josaUl = \sammo\JosaUtil::pick($magic, '을');
|
$josaUl = \sammo\JosaUtil::pick($magic, '을');
|
||||||
|
|
||||||
|
|
||||||
$general->getLogger()->pushGeneralBattleDetailLog("<D>{$magic}</>{$josaUl} <C>성공</>했다!", ActionLogger::PLAIN);
|
$general->getLogger()->pushGeneralBattleDetailLog("<D>{$magic}</>{$josaUl} <C>성공</>했다!", ActionLogger::PLAIN);
|
||||||
$oppose->getLogger()->pushGeneralBattleDetailLog("<D>{$magic}</>에 당했다!", ActionLogger::PLAIN);
|
$oppose->getLogger()->pushGeneralBattleDetailLog("<D>{$magic}</>에 당했다!", ActionLogger::PLAIN);
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ class che_계략시도 extends BaseWarUnitTrigger{
|
|||||||
$magicTrialProb *= $crewType->magicCoef;
|
$magicTrialProb *= $crewType->magicCoef;
|
||||||
|
|
||||||
$magicTrialProb = $general->onCalcStat($general, 'warMagicTrialProb', $magicTrialProb);
|
$magicTrialProb = $general->onCalcStat($general, 'warMagicTrialProb', $magicTrialProb);
|
||||||
|
$magicTrialProb = $oppose->getGeneral()->onCalcOpposeStat($general, 'warMagicTrialProb', $magicTrialProb);
|
||||||
|
|
||||||
if($magicTrialProb <= 0){
|
if($magicTrialProb <= 0){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -52,6 +54,7 @@ class che_계략시도 extends BaseWarUnitTrigger{
|
|||||||
|
|
||||||
$magicSuccessProb = 0.7;
|
$magicSuccessProb = 0.7;
|
||||||
$magicSuccessProb = $general->onCalcStat($general, 'warMagicSuccessProb', $magicSuccessProb);
|
$magicSuccessProb = $general->onCalcStat($general, 'warMagicSuccessProb', $magicSuccessProb);
|
||||||
|
$magicSuccessProb = $oppose->getGeneral()->onCalcOpposeStat($general, 'warMagicSuccessProb', $magicSuccessProb);
|
||||||
if($self->hasActivatedSkill('계략약화')){
|
if($self->hasActivatedSkill('계략약화')){
|
||||||
$magicSuccessProb -= 0.1; //NOTE: 앞으로 이건 oppose의 onCalcStat에 들어가야하지 않을까?
|
$magicSuccessProb -= 0.1; //NOTE: 앞으로 이건 oppose의 onCalcStat에 들어가야하지 않을까?
|
||||||
}
|
}
|
||||||
@@ -66,6 +69,8 @@ class che_계략시도 extends BaseWarUnitTrigger{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$successDamage = $general->onCalcStat($general, 'warMagicSuccessDamage', $successDamage, $magic);
|
$successDamage = $general->onCalcStat($general, 'warMagicSuccessDamage', $successDamage, $magic);
|
||||||
|
$successDamage = $oppose->getGeneral()->onCalcOpposeStat($general, 'warMagicSuccessDamage', $successDamage, $magic);
|
||||||
|
|
||||||
|
|
||||||
$self->activateSkill('계략시도', $magic);
|
$self->activateSkill('계략시도', $magic);
|
||||||
if(Util::randBool($magicSuccessProb)){
|
if(Util::randBool($magicSuccessProb)){
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class che_계략실패 extends BaseWarUnitTrigger{
|
|||||||
[$magic, $damage] = $selfEnv['magic'];
|
[$magic, $damage] = $selfEnv['magic'];
|
||||||
|
|
||||||
$damage = $general->onCalcStat($general, 'warMagicFailDamage', $damage, $magic);
|
$damage = $general->onCalcStat($general, 'warMagicFailDamage', $damage, $magic);
|
||||||
|
$damage = $oppose->getGeneral()->onCalcOpposeStat($general, 'warMagicFailDamage', $damage, $magic);
|
||||||
$josaUl = \sammo\JosaUtil::pick($magic, '을');
|
$josaUl = \sammo\JosaUtil::pick($magic, '을');
|
||||||
|
|
||||||
$general->getLogger()->pushGeneralBattleDetailLog("<D>{$magic}</>{$josaUl} <R>실패</>했다!", ActionLogger::PLAIN);
|
$general->getLogger()->pushGeneralBattleDetailLog("<D>{$magic}</>{$josaUl} <R>실패</>했다!", ActionLogger::PLAIN);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ interface iAction{
|
|||||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float;
|
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float;
|
||||||
|
|
||||||
public function onCalcStat(General $general, string $statName, $value, $aux=null);
|
public function onCalcStat(General $general, string $statName, $value, $aux=null);
|
||||||
|
public function onCalcOpposeStat(General $general, string $statName, $value, $aux=null);
|
||||||
public function onCalcStrategic(string $turnType, string $varType, $value);
|
public function onCalcStrategic(string $turnType, string $varType, $value);
|
||||||
public function onCalcNationalIncome(string $type, $amount);
|
public function onCalcNationalIncome(string $type, $amount);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user