요양 입력하면 템치료 무효화

This commit is contained in:
2020-05-21 02:16:20 +09:00
parent 88fd94e1cc
commit be270df088
3 changed files with 8 additions and 4 deletions
@@ -16,6 +16,10 @@ class che_아이템치료 extends BaseGeneralTrigger{
$general = $this->object;
if($general->getVar('injury') >= 10){
if($general->getReservedTurn(0, $env) instanceof \sammo\Command\General\che_요양){
return $env;
}
$general->updateVar('injury', 0);
$general->activateSkill('pre.부상경감', 'pre.치료');
$itemObj = $general->getItem();
+1 -1
View File
@@ -118,7 +118,7 @@ abstract class TriggerCaller{
return $this;
}
function fire(?array $env = null, $arg = null):?array{
function fire(array $env, $arg = null):?array{
foreach($this->triggerListByPriority as $priority=>$subTriggerList){
/** @var ObjectTrigger[] $subTriggerList */
foreach($subTriggerList as $trigger){
+3 -3
View File
@@ -26,7 +26,7 @@ class TurnExecutionHelper
return $this->generalObj;
}
public function preprocessCommand(){
public function preprocessCommand(array $env){
$general = $this->getGeneral();
$caller = $general->getPreTurnExecuteTriggerList($general);
$caller->merge(new GeneralTriggerCaller(
@@ -34,7 +34,7 @@ class TurnExecutionHelper
new GeneralTrigger\che_병력군량소모($general)
));
$caller->fire();
$caller->fire($env);
}
public function processBlocked():bool{
@@ -256,7 +256,7 @@ class TurnExecutionHelper
$autorunMode = false;
$ai = null;
$turnObj->preprocessCommand();
$turnObj->preprocessCommand($env);
if($general->getNPCType() >= 2 || ($autorun_user['limit_minutes']??false)){
$ai = new GeneralAI($turnObj->getGeneral());