feat: StaticEventHandler 처리기 추가
- 커맨드 종료 시점에 호출 - pre, post 각각이 필요한지는 논의 필요 - 일단 용도에 따라 pre, post 둘중에 하나만 처리 - eventType으로는 full qualified class name 사용 - 꼭 그럴필요는 없지만, 커맨드에 한해서는 이렇게
This commit is contained in:
@@ -7,7 +7,8 @@ use \sammo\{
|
||||
CityConst,
|
||||
ActionLogger,
|
||||
LastTurn,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use \sammo\Constraint\Constraint;
|
||||
@@ -96,6 +97,7 @@ class che_NPC능동 extends Command\GeneralCommand{
|
||||
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
}
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
$general->applyDB($db);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -12,8 +12,7 @@ use function sammo\tryUniqueItemLottery;
|
||||
|
||||
use \sammo\Constraint\ConstraintHelper;
|
||||
use sammo\CityConst;
|
||||
|
||||
|
||||
use sammo\StaticEventHandler;
|
||||
|
||||
class che_강행 extends Command\GeneralCommand
|
||||
{
|
||||
@@ -158,8 +157,8 @@ class che_강행 extends Command\GeneralCommand
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
|
||||
$general->applyDB($db);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -7,7 +7,8 @@ use \sammo\{
|
||||
ActionLogger,
|
||||
GameConst, GameUnitConst,
|
||||
LastTurn,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
|
||||
@@ -174,6 +175,7 @@ class che_거병 extends Command\GeneralCommand{
|
||||
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
|
||||
$general->applyDB($db);
|
||||
|
||||
@@ -19,6 +19,7 @@ use function \sammo\getAllNationStaticInfo;
|
||||
use \sammo\Constraint\ConstraintHelper;
|
||||
use sammo\Enums\InheritanceKey;
|
||||
use sammo\Enums\PenaltyKey;
|
||||
use sammo\StaticEventHandler;
|
||||
|
||||
use function sammo\buildNationTypeClass;
|
||||
use function sammo\genGenericUniqueRNGFromGeneral;
|
||||
@@ -205,6 +206,7 @@ class che_건국 extends Command\GeneralCommand
|
||||
$general->increaseInheritancePoint(InheritanceKey::unifier, 250);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(genGenericUniqueRNGFromGeneral($general, static::$actionName), $general, '건국');
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@ use \sammo\{
|
||||
ActionLogger,
|
||||
GameConst, GameUnitConst,
|
||||
LastTurn,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use \sammo\Constraint\Constraint;
|
||||
@@ -112,6 +113,7 @@ class che_견문 extends Command\GeneralCommand{
|
||||
$general->addExperience($exp);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
|
||||
$general->applyDB($db);
|
||||
|
||||
@@ -9,7 +9,8 @@ use \sammo\{
|
||||
ActionLogger,
|
||||
GameConst, GameUnitConst,
|
||||
LastTurn,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use \sammo\Constraint\Constraint;
|
||||
@@ -178,6 +179,7 @@ class che_군량매매 extends Command\GeneralCommand{
|
||||
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
|
||||
$general->applyDB($db);
|
||||
|
||||
@@ -7,7 +7,8 @@ use \sammo\{
|
||||
ActionLogger,
|
||||
GameConst, GameUnitConst,
|
||||
LastTurn,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use \sammo\Constraint\Constraint;
|
||||
@@ -95,6 +96,7 @@ class che_귀환 extends Command\GeneralCommand{
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
|
||||
$general->applyDB($db);
|
||||
|
||||
@@ -6,7 +6,8 @@ use \sammo\{
|
||||
General,
|
||||
ActionLogger,
|
||||
LastTurn,
|
||||
Command, GameConst
|
||||
Command, GameConst,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use function sammo\{
|
||||
@@ -134,6 +135,7 @@ class che_기술연구 extends che_상업투자{
|
||||
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@ use \sammo\{
|
||||
ActionLogger,
|
||||
GameConst, GameUnitConst,
|
||||
LastTurn,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
|
||||
@@ -126,6 +127,7 @@ class che_단련 extends Command\GeneralCommand{
|
||||
$general->increaseVar($incStat, 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@ use \sammo\{
|
||||
General,
|
||||
LastTurn,
|
||||
Command,
|
||||
ScoutMessage
|
||||
ScoutMessage,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use function \sammo\getAllNationStaticInfo;
|
||||
@@ -169,6 +170,7 @@ class che_등용 extends Command\GeneralCommand
|
||||
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
|
||||
$general->applyDB($db);
|
||||
|
||||
@@ -6,6 +6,7 @@ use \sammo\{
|
||||
General,
|
||||
GameConst,
|
||||
Command,
|
||||
StaticEventHandler,
|
||||
};
|
||||
|
||||
use \sammo\Constraint\ConstraintHelper;
|
||||
@@ -207,6 +208,7 @@ class che_등용수락 extends Command\GeneralCommand{
|
||||
}
|
||||
|
||||
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
$general->applyDB($db);
|
||||
$destGeneral->applyDB($db);
|
||||
|
||||
|
||||
@@ -22,8 +22,7 @@ use \sammo\Constraint\ConstraintHelper;
|
||||
use sammo\CityConst;
|
||||
use sammo\Enums\InheritanceKey;
|
||||
use sammo\MustNotBeReachedException;
|
||||
|
||||
|
||||
use sammo\StaticEventHandler;
|
||||
|
||||
class che_랜덤임관 extends Command\GeneralCommand
|
||||
{
|
||||
@@ -281,6 +280,7 @@ class che_랜덤임관 extends Command\GeneralCommand
|
||||
$general->addExperience($exp);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(genGenericUniqueRNGFromGeneral($general, static::$actionName), $general, '랜덤 임관');
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@ use \sammo\{
|
||||
GameConst,
|
||||
LastTurn,
|
||||
GameUnitConst,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use \sammo\Constraint\Constraint;
|
||||
@@ -97,6 +98,7 @@ class che_모반시도 extends Command\GeneralCommand{
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->increaseInheritancePoint(InheritanceKey::active_action, 1);
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
$general->applyDB($db);
|
||||
$lordGeneral->applyDB($db);
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ use function \sammo\getAllNationStaticInfo;
|
||||
|
||||
use \sammo\Constraint\ConstraintHelper;
|
||||
use sammo\Enums\InheritanceKey;
|
||||
use sammo\StaticEventHandler;
|
||||
|
||||
use function sammo\buildNationTypeClass;
|
||||
use function sammo\genGenericUniqueRNGFromGeneral;
|
||||
@@ -216,6 +217,7 @@ class che_무작위건국 extends Command\GeneralCommand
|
||||
$general->increaseInheritancePoint(InheritanceKey::active_action, 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(genGenericUniqueRNGFromGeneral($general, static::$actionName), $general, '건국');
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@ use \sammo\{
|
||||
GameConst,
|
||||
LastTurn,
|
||||
GameUnitConst,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use function \sammo\getDomesticExpLevelBonus;
|
||||
@@ -148,6 +149,7 @@ class che_물자조달 extends Command\GeneralCommand{
|
||||
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
|
||||
$general->applyDB($db);
|
||||
|
||||
@@ -7,7 +7,8 @@ use \sammo\{
|
||||
ActionLogger,
|
||||
GameConst, GameUnitConst,
|
||||
LastTurn,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use \sammo\Constraint\Constraint;
|
||||
@@ -124,6 +125,7 @@ class che_방랑 extends Command\GeneralCommand{
|
||||
refreshNationStaticInfo();
|
||||
$general->increaseInheritancePoint(InheritanceKey::active_action, 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
$general->applyDB($db);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -11,7 +11,8 @@ use \sammo\{
|
||||
GameConst,
|
||||
GameUnitConst,
|
||||
LastTurn,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use function \sammo\tryUniqueItemLottery;
|
||||
@@ -121,6 +122,7 @@ class che_사기진작 extends Command\GeneralCommand
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@ use \sammo\{
|
||||
LastTurn,
|
||||
GameUnitConst,
|
||||
Command,
|
||||
RandUtil
|
||||
RandUtil,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use function \sammo\getDomesticExpLevelBonus;
|
||||
@@ -218,6 +219,7 @@ class che_상업투자 extends Command\GeneralCommand{
|
||||
$general->increaseVar(static::$statKey.'_exp', 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ use \sammo\Constraint\Constraint;
|
||||
use \sammo\Constraint\ConstraintHelper;
|
||||
use sammo\Enums\GeneralQueryMode;
|
||||
use sammo\Enums\InheritanceKey;
|
||||
use sammo\StaticEventHandler;
|
||||
|
||||
class che_선양 extends Command\GeneralCommand
|
||||
{
|
||||
@@ -138,6 +139,7 @@ class che_선양 extends Command\GeneralCommand
|
||||
$general->increaseInheritancePoint(InheritanceKey::active_action, 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
$general->applyDB($db);
|
||||
$destGeneral->applyDB($db);
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@ use \sammo\{
|
||||
ActionLogger,
|
||||
GameConst, GameUnitConst,
|
||||
LastTurn,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use \sammo\Constraint\Constraint;
|
||||
@@ -80,6 +81,7 @@ class che_소집해제 extends Command\GeneralCommand{
|
||||
$general->addDedication($ded);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
$general->applyDB($db);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -13,8 +13,7 @@ use function sammo\getDexLevelList;
|
||||
use function \sammo\tryUniqueItemLottery;
|
||||
|
||||
use \sammo\Constraint\ConstraintHelper;
|
||||
|
||||
|
||||
use sammo\StaticEventHandler;
|
||||
|
||||
class che_숙련전환 extends Command\GeneralCommand
|
||||
{
|
||||
@@ -179,6 +178,7 @@ class che_숙련전환 extends Command\GeneralCommand
|
||||
$general->increaseVar('leadership_exp', 2);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@ use \sammo\{
|
||||
ActionLogger,
|
||||
GameConst, GameUnitConst,
|
||||
LastTurn,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use \sammo\Constraint\Constraint;
|
||||
@@ -69,6 +70,7 @@ class che_요양 extends Command\GeneralCommand{
|
||||
$general->addDedication($ded);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
$general->applyDB($db);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -4,7 +4,8 @@ namespace sammo\Command\General;
|
||||
use \sammo\{
|
||||
DB,
|
||||
LastTurn,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use \sammo\Constraint\ConstraintHelper;
|
||||
@@ -75,6 +76,7 @@ class che_은퇴 extends Command\GeneralCommand{
|
||||
$logger->pushGeneralActionLog("은퇴하였습니다. <1>$date</>");
|
||||
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -12,8 +12,7 @@ use function sammo\tryUniqueItemLottery;
|
||||
|
||||
use \sammo\Constraint\ConstraintHelper;
|
||||
use sammo\CityConst;
|
||||
|
||||
|
||||
use sammo\StaticEventHandler;
|
||||
|
||||
class che_이동 extends Command\GeneralCommand
|
||||
{
|
||||
@@ -164,6 +163,7 @@ class che_이동 extends Command\GeneralCommand
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
|
||||
$general->applyDB($db);
|
||||
|
||||
@@ -18,6 +18,7 @@ use function \sammo\pickGeneralFromPool;
|
||||
use \sammo\Constraint\Constraint;
|
||||
use \sammo\Constraint\ConstraintHelper;
|
||||
use sammo\Enums\InheritanceKey;
|
||||
use sammo\StaticEventHandler;
|
||||
|
||||
class che_인재탐색 extends Command\GeneralCommand
|
||||
{
|
||||
@@ -218,6 +219,7 @@ class che_인재탐색 extends Command\GeneralCommand
|
||||
$general->increaseVar($incStat, 3);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
return true;
|
||||
|
||||
@@ -9,7 +9,8 @@ use \sammo\{
|
||||
GameConst,
|
||||
LastTurn,
|
||||
Command,
|
||||
KVStorage
|
||||
KVStorage,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use function \sammo\tryUniqueItemLottery;
|
||||
@@ -175,6 +176,7 @@ class che_임관 extends Command\GeneralCommand
|
||||
$general->addExperience($exp);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@ use \sammo\{
|
||||
GameUnitConst,
|
||||
LastTurn,
|
||||
Command,
|
||||
KVStorage
|
||||
KVStorage,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use function \sammo\buildItemClass;
|
||||
@@ -196,6 +197,7 @@ class che_장비매매 extends Command\GeneralCommand
|
||||
$general->addExperience($exp);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@ use \sammo\{
|
||||
LastTurn,
|
||||
Command,
|
||||
Json,
|
||||
KVStorage
|
||||
KVStorage,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use function sammo\getAllNationStaticInfo;
|
||||
@@ -170,6 +171,7 @@ class che_장수대상임관 extends Command\GeneralCommand{
|
||||
$general->addExperience($exp);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@ use \sammo\{
|
||||
GameConst, GameUnitConst,
|
||||
LastTurn,
|
||||
Command,
|
||||
MustNotBeReachedException
|
||||
MustNotBeReachedException,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use function \sammo\tryUniqueItemLottery;
|
||||
@@ -121,6 +122,7 @@ class che_전투태세 extends Command\GeneralCommand{
|
||||
$general->increaseVar('leadership_exp', 3);
|
||||
$this->setResultTurn($turnResult);
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@ use \sammo\{
|
||||
ActionLogger,
|
||||
GameConst, GameUnitConst,
|
||||
LastTurn,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use function \sammo\tryUniqueItemLottery;
|
||||
@@ -103,6 +104,7 @@ class che_전투특기초기화 extends Command\GeneralCommand{
|
||||
$logger->pushGeneralActionLog("새로운 {$specialName}를 가질 준비가 되었습니다. <1>$date</>");
|
||||
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@ use \sammo\{
|
||||
ActionLogger,
|
||||
GameConst, GameUnitConst,
|
||||
LastTurn,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use \sammo\Constraint\ConstraintHelper;
|
||||
@@ -98,6 +99,7 @@ class che_접경귀환 extends Command\GeneralCommand{
|
||||
//TODO: InstantAction일때에만 설정하지 않는게 나은데..
|
||||
//$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
$general->applyDB($db);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -9,7 +9,8 @@ use \sammo\{
|
||||
LastTurn,
|
||||
GameUnitConst,
|
||||
Command,
|
||||
RandUtil
|
||||
RandUtil,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use function \sammo\getDomesticExpLevelBonus;
|
||||
@@ -188,6 +189,7 @@ class che_정착장려 extends Command\GeneralCommand{
|
||||
$general->increaseVar(static::$statKey.'_exp', 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@ use \sammo\{
|
||||
LastTurn,
|
||||
GameUnitConst,
|
||||
Command,
|
||||
RandUtil
|
||||
RandUtil,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use function \sammo\getDomesticExpLevelBonus;
|
||||
@@ -188,6 +189,7 @@ class che_주민선정 extends Command\GeneralCommand{
|
||||
$general->increaseVar(static::$statKey.'_exp', 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ use \sammo\Command;
|
||||
use \sammo\Constraint\Constraint;
|
||||
use \sammo\Constraint\ConstraintHelper;
|
||||
use sammo\Enums\GeneralQueryMode;
|
||||
use sammo\StaticEventHandler;
|
||||
|
||||
use function sammo\tryUniqueItemLottery;
|
||||
|
||||
@@ -170,6 +171,7 @@ class che_증여 extends Command\GeneralCommand
|
||||
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
|
||||
$general->applyDB($db);
|
||||
|
||||
@@ -7,7 +7,8 @@ use \sammo\{
|
||||
ActionLogger,
|
||||
GameConst, GameUnitConst,
|
||||
LastTurn,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use function \sammo\tryUniqueItemLottery;
|
||||
@@ -103,6 +104,7 @@ class che_집합 extends Command\GeneralCommand{
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ use function sammo\getTechLevel;
|
||||
|
||||
use \sammo\Constraint\ConstraintHelper;
|
||||
use sammo\MustNotBeReachedException;
|
||||
use sammo\StaticEventHandler;
|
||||
|
||||
class che_징병 extends Command\GeneralCommand
|
||||
{
|
||||
@@ -226,6 +227,7 @@ class che_징병 extends Command\GeneralCommand
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
$general->setAuxVar('armType', $reqCrewType->armType);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
@@ -16,6 +16,7 @@ use function \sammo\searchDistance;
|
||||
use \sammo\Constraint\ConstraintHelper;
|
||||
use sammo\CityConst;
|
||||
use sammo\Enums\InheritanceKey;
|
||||
use sammo\StaticEventHandler;
|
||||
|
||||
class che_첩보 extends Command\GeneralCommand
|
||||
{
|
||||
@@ -212,6 +213,7 @@ class che_첩보 extends Command\GeneralCommand
|
||||
$general->addDedication($ded);
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
$general->checkStatChange();
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ use sammo\CityConst;
|
||||
use sammo\Enums\InheritanceKey;
|
||||
use sammo\LiteHashDRBG;
|
||||
use sammo\RandUtil;
|
||||
use sammo\StaticEventHandler;
|
||||
use sammo\UniqueConst;
|
||||
|
||||
class che_출병 extends Command\GeneralCommand
|
||||
@@ -253,6 +254,7 @@ class che_출병 extends Command\GeneralCommand
|
||||
|
||||
processWar($warRngSeed, $general, $this->nation, $this->destCity);
|
||||
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@ use \sammo\{
|
||||
ActionLogger,
|
||||
GameConst, GameUnitConst,
|
||||
LastTurn,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use \sammo\Constraint\Constraint;
|
||||
@@ -122,6 +123,7 @@ class che_하야 extends Command\GeneralCommand{
|
||||
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
$general->applyDB($db);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -10,6 +10,7 @@ use \sammo\{
|
||||
Command,
|
||||
Json,
|
||||
KVStorage,
|
||||
StaticEventHandler,
|
||||
TurnExecutionHelper
|
||||
};
|
||||
|
||||
@@ -109,6 +110,7 @@ class che_해산 extends Command\GeneralCommand{
|
||||
foreach($nationGenerals as $oldGeneral){
|
||||
$oldGeneral->applyDB($db);
|
||||
}
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
$general->applyDB($db);
|
||||
|
||||
// 이벤트 핸들러 동작
|
||||
|
||||
@@ -14,6 +14,7 @@ use \sammo\Command;
|
||||
|
||||
use \sammo\Constraint\Constraint;
|
||||
use \sammo\Constraint\ConstraintHelper;
|
||||
use sammo\StaticEventHandler;
|
||||
|
||||
use function sammo\tryUniqueItemLottery;
|
||||
|
||||
@@ -146,6 +147,7 @@ class che_헌납 extends Command\GeneralCommand
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ use sammo\CityConst;
|
||||
use sammo\Enums\GeneralQueryMode;
|
||||
use sammo\Enums\RankColumn;
|
||||
use sammo\RandUtil;
|
||||
use sammo\StaticEventHandler;
|
||||
|
||||
class che_화계 extends Command\GeneralCommand
|
||||
{
|
||||
@@ -332,6 +333,7 @@ class che_화계 extends Command\GeneralCommand
|
||||
$general->increaseVar($statType . '_exp', 1);
|
||||
$general->increaseRankVar(RankColumn::firenum, 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
$general->checkStatChange();
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -11,7 +11,8 @@ use \sammo\{
|
||||
GameConst,
|
||||
GameUnitConst,
|
||||
LastTurn,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use function \sammo\tryUniqueItemLottery;
|
||||
@@ -122,6 +123,7 @@ class che_훈련 extends Command\GeneralCommand
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ use function \sammo\getAllNationStaticInfo;
|
||||
|
||||
use \sammo\Constraint\ConstraintHelper;
|
||||
use sammo\Enums\InheritanceKey;
|
||||
use sammo\StaticEventHandler;
|
||||
|
||||
use function sammo\buildNationTypeClass;
|
||||
use function sammo\genGenericUniqueRNGFromGeneral;
|
||||
@@ -201,6 +202,7 @@ class cr_건국 extends Command\GeneralCommand
|
||||
$general->increaseInheritancePoint(InheritanceKey::active_action, 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(genGenericUniqueRNGFromGeneral($general, static::$actionName), $general, '건국');
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@ use \sammo\{
|
||||
ActionLogger,
|
||||
GameConst, GameUnitConst,
|
||||
LastTurn,
|
||||
Command
|
||||
Command,
|
||||
StaticEventHandler
|
||||
};
|
||||
|
||||
use function \sammo\tryUniqueItemLottery;
|
||||
@@ -105,6 +106,7 @@ class cr_맹훈련 extends Command\GeneralCommand{
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->checkStatChange();
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
tryUniqueItemLottery(\sammo\genGenericUniqueRNGFromGeneral($general, static::$actionName), $general);
|
||||
$general->applyDB($db);
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ use \sammo\Util;
|
||||
use \sammo\JosaUtil;
|
||||
use \sammo\LastTurn;
|
||||
use \sammo\DB;
|
||||
use sammo\StaticEventHandler;
|
||||
|
||||
class 휴식 extends Command\GeneralCommand{
|
||||
static protected $actionName = '휴식';
|
||||
@@ -39,6 +40,7 @@ class 휴식 extends Command\GeneralCommand{
|
||||
$logger->pushGeneralActionLog("아무것도 실행하지 않았습니다. <1>$date</>");
|
||||
|
||||
$this->setResultTurn(new LastTurn());
|
||||
StaticEventHandler::handleEvent($this->generalObj, $this->destGeneralObj, $this::class, $this->env, $this->arg);
|
||||
$general->applyDB(DB::db());
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user