From 95487bba486e92e952f22513baa19243828e2c8b Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 6 Jun 2019 22:32:35 +0900 Subject: [PATCH] =?UTF-8?q?BaseWarUnitTrigger,=20TriggerCaller=20=EA=B5=AC?= =?UTF-8?q?=EC=A1=B0=20=EB=B3=80=EA=B2=BD,=20=ED=81=B4=EB=9E=98=EC=8A=A4?= =?UTF-8?q?=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/process_war.php | 49 ++----------------- hwe/sammo/ActionItem/che_사기_탁주.php | 6 +-- hwe/sammo/ActionItem/che_의술_청낭서.php | 8 +-- hwe/sammo/ActionItem/che_의술_태평청령.php | 9 ++-- hwe/sammo/ActionItem/che_저격_수극.php | 4 +- hwe/sammo/ActionItem/che_훈련_청주.php | 7 +-- hwe/sammo/ActionSpecialWar/che_견고.php | 4 +- hwe/sammo/ActionSpecialWar/che_돌격.php | 7 +-- hwe/sammo/ActionSpecialWar/che_반계.php | 13 ++--- hwe/sammo/ActionSpecialWar/che_위압.php | 8 +-- hwe/sammo/BaseWarUnitTrigger.php | 8 ++- hwe/sammo/General.php | 11 ++++- hwe/sammo/GeneralTrigger/che_도시치료.php | 2 +- hwe/sammo/GeneralTrigger/che_병력군량소모.php | 2 +- hwe/sammo/GeneralTrigger/che_부상경감.php | 2 +- hwe/sammo/GeneralTrigger/che_아이템치료.php | 2 +- hwe/sammo/ObjectTrigger.php | 17 ++++--- hwe/sammo/TriggerCaller.php | 2 +- hwe/sammo/WarUnit.php | 16 ------ .../WarUnitTrigger/WarActivateSkills.php | 2 +- hwe/sammo/WarUnitTrigger/che_격노발동.php | 2 +- hwe/sammo/WarUnitTrigger/che_계략발동.php | 2 +- hwe/sammo/WarUnitTrigger/che_계략시도.php | 2 +- hwe/sammo/WarUnitTrigger/che_계략실패.php | 2 +- hwe/sammo/WarUnitTrigger/che_반계발동.php | 4 +- hwe/sammo/WarUnitTrigger/che_반계시도.php | 2 +- hwe/sammo/WarUnitTrigger/che_부상무효.php | 2 +- hwe/sammo/WarUnitTrigger/che_성벽부상무효.php | 2 +- hwe/sammo/WarUnitTrigger/che_위압발동.php | 2 +- hwe/sammo/WarUnitTrigger/che_위압시도.php | 38 ++++++++++++++ hwe/sammo/WarUnitTrigger/che_저격발동.php | 2 +- hwe/sammo/WarUnitTrigger/che_저격시도.php | 2 +- hwe/sammo/WarUnitTrigger/che_저지발동.php | 2 +- hwe/sammo/WarUnitTrigger/che_저지시도.php | 2 +- hwe/sammo/WarUnitTrigger/che_전투치료발동.php | 2 +- hwe/sammo/WarUnitTrigger/che_전투치료시도.php | 2 +- hwe/sammo/WarUnitTrigger/che_필살발동.php | 2 +- hwe/sammo/WarUnitTrigger/che_필살시도.php | 2 +- hwe/sammo/WarUnitTrigger/che_회피발동.php | 2 +- hwe/sammo/WarUnitTrigger/che_회피시도.php | 2 +- hwe/sammo/WarUnitTrigger/능력치변경.php | 2 +- 41 files changed, 132 insertions(+), 127 deletions(-) create mode 100644 hwe/sammo/WarUnitTrigger/che_위압시도.php diff --git a/hwe/process_war.php b/hwe/process_war.php index 9c2ca91b..ff645276 100644 --- a/hwe/process_war.php +++ b/hwe/process_war.php @@ -298,57 +298,16 @@ function processWar_NG( $initCaller->merge($defender->getGeneral()->getBattleInitSkillTriggerList($defender)); $initCaller->fire([], [$attacker, $defender]); - //스킬류, 아이템, 스킬 및 아이템 적용 순이어야 할 것 - - /* - foreach(Util::zip( - $attacker->checkBattleBeginSkill(), - $defender->checkBattleBeginSkill() - ) as $b){ - //doNothing - } - - $attacker->checkBattleBeginItem(); - $defender->checkBattleBeginItem(); - - $attacker->applyBattleBeginSkillAndItem(); - $defender->applyBattleBeginSkillAndItem(); - */ } $attacker->beginPhase(); $defender->beginPhase(); - foreach(Util::zip( - $attacker->checkPreActiveSkill(), - $defender->checkPreActiveSkill() - ) as $b){ - //doNothing - } - - foreach(Util::zip( - $attacker->checkActiveSkill(), - $defender->checkActiveSkill() - ) as $b){ - //doNothing - } - //NOTE: 마법은 checkActiveSkill, checkPostActiveSkill 내에서 반영 - - foreach(Util::zip( - $attacker->checkPostActiveSkill(), - $defender->checkPostActiveSkill() - ) as $b){ - //doNothing - } - //NOTE: 반계류 등의 스킬을 post에서 반영 - - foreach(Util::zip( - $attacker->applyActiveSkill(), - $defender->applyActiveSkill() - ) as $b){ - //doNothing - } + $battleCaller = $attacker->getGeneral()->getBattlePhaseSkillTriggerList($attacker); + $battleCaller->merge($defender->getGeneral()->getBattlePhaseSkillTriggerList($defender)); + $battleCaller->fire([], [$attacker, $defender]); + $deadDefender = $attacker->calcDamage(); $deadAttacker = $defender->calcDamage(); diff --git a/hwe/sammo/ActionItem/che_사기_탁주.php b/hwe/sammo/ActionItem/che_사기_탁주.php index a211b2e7..f3758e19 100644 --- a/hwe/sammo/ActionItem/che_사기_탁주.php +++ b/hwe/sammo/ActionItem/che_사기_탁주.php @@ -14,8 +14,8 @@ class che_사기_탁주 extends \sammo\BaseItem{ protected static $buyable = true; public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ - return new WarUnitTriggerCaller([ - new 능력치변경($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 'atmos', '+', 3), - ]); + return new WarUnitTriggerCaller( + new 능력치변경($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 'atmos', '+', 3) + ); } } \ No newline at end of file diff --git a/hwe/sammo/ActionItem/che_의술_청낭서.php b/hwe/sammo/ActionItem/che_의술_청낭서.php index e43fad07..97c9e17f 100644 --- a/hwe/sammo/ActionItem/che_의술_청낭서.php +++ b/hwe/sammo/ActionItem/che_의술_청낭서.php @@ -18,17 +18,17 @@ class che_의술_청낭서 extends \sammo\BaseItem{ protected static $consumable = false; public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{ - return new GeneralTriggerCaller([ + return new GeneralTriggerCaller( new GeneralTrigger\che_도시치료($general) - ]); + ); } public function getBattlePhaseSkillTriggerList(\sammo\WarUnit $unit): ?WarUnitTriggerCaller { - return new WarUnitTriggerCaller([ + return new WarUnitTriggerCaller( new che_전투치료시도($unit, BaseWarUnitTrigger::TYPE_ITEM), new che_전투치료발동($unit, BaseWarUnitTrigger::TYPE_ITEM) - ]); + ); } } \ No newline at end of file diff --git a/hwe/sammo/ActionItem/che_의술_태평청령.php b/hwe/sammo/ActionItem/che_의술_태평청령.php index 8244180d..6f14bcda 100644 --- a/hwe/sammo/ActionItem/che_의술_태평청령.php +++ b/hwe/sammo/ActionItem/che_의술_태평청령.php @@ -4,6 +4,7 @@ use \sammo\iAction; use \sammo\General; use \sammo\GeneralTrigger; use \sammo\GeneralTriggerCaller; +use \sammo\BaseWarUnitTrigger; class che_의술_태평청령 extends \sammo\BaseItem{ @@ -14,17 +15,17 @@ class che_의술_태평청령 extends \sammo\BaseItem{ protected static $consumable = false; public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{ - return new GeneralTriggerCaller([ + return new GeneralTriggerCaller( new GeneralTrigger\che_도시치료($general) - ]); + ); } public function getBattlePhaseSkillTriggerList(\sammo\WarUnit $unit): ?WarUnitTriggerCaller { - return new WarUnitTriggerCaller([ + return new WarUnitTriggerCaller( new che_전투치료시도($unit, BaseWarUnitTrigger::TYPE_ITEM), new che_전투치료발동($unit, BaseWarUnitTrigger::TYPE_ITEM) - ]); + ); } } \ No newline at end of file diff --git a/hwe/sammo/ActionItem/che_저격_수극.php b/hwe/sammo/ActionItem/che_저격_수극.php index cedced4b..768d8205 100644 --- a/hwe/sammo/ActionItem/che_저격_수극.php +++ b/hwe/sammo/ActionItem/che_저격_수극.php @@ -18,9 +18,9 @@ class che_저격_수극 extends \sammo\BaseItem{ protected static $buyable = true; public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ - return new WarUnitTriggerCaller([ + return new WarUnitTriggerCaller( new che_저격시도($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 0.2, 20, 40), new che_저격발동($unit) - ]); + ); } } \ No newline at end of file diff --git a/hwe/sammo/ActionItem/che_훈련_청주.php b/hwe/sammo/ActionItem/che_훈련_청주.php index 82350faf..2f669a4c 100644 --- a/hwe/sammo/ActionItem/che_훈련_청주.php +++ b/hwe/sammo/ActionItem/che_훈련_청주.php @@ -2,6 +2,7 @@ namespace sammo\ActionItem; use \sammo\iAction; use \sammo\General; +use \sammo\BaseWarUnitTrigger; class che_훈련_청주 extends \sammo\BaseItem{ @@ -13,8 +14,8 @@ class che_훈련_청주 extends \sammo\BaseItem{ protected static $buyable = true; public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ - return new WarUnitTriggerCaller([ - new 능력치변경($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 'train', '+', 3), - ]); + return new WarUnitTriggerCaller( + new 능력치변경($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 'train', '+', 3) + ); } } \ No newline at end of file diff --git a/hwe/sammo/ActionSpecialWar/che_견고.php b/hwe/sammo/ActionSpecialWar/che_견고.php index c2477b37..69fe2cd7 100644 --- a/hwe/sammo/ActionSpecialWar/che_견고.php +++ b/hwe/sammo/ActionSpecialWar/che_견고.php @@ -23,8 +23,8 @@ class che_견고 implements iAction{ ]; public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ - return new WarUnitTriggerCaller([ + return new WarUnitTriggerCaller( new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '필살불가', '위압불가', '격노불가', '계략약화') - ]); + ); } } \ No newline at end of file diff --git a/hwe/sammo/ActionSpecialWar/che_돌격.php b/hwe/sammo/ActionSpecialWar/che_돌격.php index ce239478..1c74fe7f 100644 --- a/hwe/sammo/ActionSpecialWar/che_돌격.php +++ b/hwe/sammo/ActionSpecialWar/che_돌격.php @@ -4,6 +4,7 @@ use \sammo\iAction; use \sammo\General; use \sammo\SpecialityConst; use \sammo\WarUnit; +use \sammo\BaseWarUnitTrigger; class che_돌격 implements iAction{ use \sammo\DefaultAction; @@ -34,8 +35,8 @@ class che_돌격 implements iAction{ } public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ - return new WarUnitTriggerCaller([ - new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '회피불가') - ]); + return new WarUnitTriggerCaller( + (new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '회피불가'))->setPriority(BaseWarUnitTrigger::PRIORITY_BEGIN + 200) + ); } } \ No newline at end of file diff --git a/hwe/sammo/ActionSpecialWar/che_반계.php b/hwe/sammo/ActionSpecialWar/che_반계.php index dbf371f5..71c92643 100644 --- a/hwe/sammo/ActionSpecialWar/che_반계.php +++ b/hwe/sammo/ActionSpecialWar/che_반계.php @@ -5,9 +5,10 @@ use \sammo\General; use \sammo\SpecialityConst; use \sammo\WarUnit; use sammo\WarUnitTriggerCaller; +use \sammo\BaseWarUnitTrigger; use \sammo\WarUnitTrigger\WarActivateSkills; -use \sammo\WarUnitTrigger\che_반목시도; -use \sammo\WarUnitTrigger\che_반목발동; +use \sammo\WarUnitTrigger\che_반계시도; +use \sammo\WarUnitTrigger\che_반계발동; class che_반계 implements iAction{ use \sammo\DefaultAction; @@ -30,10 +31,10 @@ class che_반계 implements iAction{ } public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ - return new WarUnitTriggerCaller([ + return new WarUnitTriggerCaller( new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '계략약화'), - new che_반목시도($unit), - new che_반목발동($unit) - ]); + new che_반계시도($unit), + new che_반계발동($unit) + ); } } \ No newline at end of file diff --git a/hwe/sammo/ActionSpecialWar/che_위압.php b/hwe/sammo/ActionSpecialWar/che_위압.php index 94ceef33..a46ff8ab 100644 --- a/hwe/sammo/ActionSpecialWar/che_위압.php +++ b/hwe/sammo/ActionSpecialWar/che_위압.php @@ -26,9 +26,9 @@ class che_위압 implements iAction{ if($unit->getPhase() != 0){ return null; } - return new WarUnitTriggerCaller([ - new che_위압시도(), - new che_위압발동() - ]); + return new WarUnitTriggerCaller( + new che_위압시도($unit), + new che_위압발동($unit) + ); } } \ No newline at end of file diff --git a/hwe/sammo/BaseWarUnitTrigger.php b/hwe/sammo/BaseWarUnitTrigger.php index e67e0426..4544b01d 100644 --- a/hwe/sammo/BaseWarUnitTrigger.php +++ b/hwe/sammo/BaseWarUnitTrigger.php @@ -8,13 +8,19 @@ abstract class BaseWarUnitTrigger extends ObjectTrigger{ const TYPE_ITEM = 1; const TYPE_CONSUMABLE_ITEM = 2; - protected $raiseType; + protected $raiseType = self::TYPE_NONE; public function __construct(WarUnit $unit, int $raiseType = 0){ $this->object = $unit; $this->raiseType = $raiseType; } + public function getUniqueID():string{ + $priority = $this->priority; + $fqn = static::class; + return "{$priority}_{$fqn}_{$this->raiseType}"; + } + public function action(?array $env=null, $arg=null):?array{ if($env === null){ $env = []; diff --git a/hwe/sammo/General.php b/hwe/sammo/General.php index 21096df2..8de5c4d5 100644 --- a/hwe/sammo/General.php +++ b/hwe/sammo/General.php @@ -1,6 +1,7 @@ nationType, $this->levelObj, diff --git a/hwe/sammo/GeneralTrigger/che_도시치료.php b/hwe/sammo/GeneralTrigger/che_도시치료.php index 79279234..b1fe14ee 100644 --- a/hwe/sammo/GeneralTrigger/che_도시치료.php +++ b/hwe/sammo/GeneralTrigger/che_도시치료.php @@ -8,7 +8,7 @@ use sammo\Util; use sammo\JosaUtil; class che_도시치료 extends BaseGeneralTrigger{ - static protected $priority = 10000; + protected $priority = 10000; public function action(?array $env=null, $arg=null):?array{ diff --git a/hwe/sammo/GeneralTrigger/che_병력군량소모.php b/hwe/sammo/GeneralTrigger/che_병력군량소모.php index d5a7a79a..71669bd0 100644 --- a/hwe/sammo/GeneralTrigger/che_병력군량소모.php +++ b/hwe/sammo/GeneralTrigger/che_병력군량소모.php @@ -8,7 +8,7 @@ use sammo\Util; use sammo\JosaUtil; class che_병력군량소모 extends BaseGeneralTrigger{ - static protected $priority = 50000; + protected $priority = 50000; public function action(?array $env=null, $arg=null):?array{ diff --git a/hwe/sammo/GeneralTrigger/che_부상경감.php b/hwe/sammo/GeneralTrigger/che_부상경감.php index 9876c7c2..c3a426ba 100644 --- a/hwe/sammo/GeneralTrigger/che_부상경감.php +++ b/hwe/sammo/GeneralTrigger/che_부상경감.php @@ -8,7 +8,7 @@ use sammo\Util; use sammo\JosaUtil; class che_부상경감 extends BaseGeneralTrigger{ - static protected $priority = 30010; + protected $priority = 30010; public function action(?array $env=null, $arg=null):?array{ diff --git a/hwe/sammo/GeneralTrigger/che_아이템치료.php b/hwe/sammo/GeneralTrigger/che_아이템치료.php index 69fd393c..6287ffab 100644 --- a/hwe/sammo/GeneralTrigger/che_아이템치료.php +++ b/hwe/sammo/GeneralTrigger/che_아이템치료.php @@ -8,7 +8,7 @@ use sammo\Util; use sammo\JosaUtil; class che_아이템치료 extends BaseGeneralTrigger{ - static protected $priority = 20010; + protected $priority = 20010; public function action(?array $env=null, $arg=null):?array{ diff --git a/hwe/sammo/ObjectTrigger.php b/hwe/sammo/ObjectTrigger.php index 0a402678..9fab3fb7 100644 --- a/hwe/sammo/ObjectTrigger.php +++ b/hwe/sammo/ObjectTrigger.php @@ -9,17 +9,22 @@ abstract class ObjectTrigger{ const PRIORITY_POST = 40000; const PRIORITY_FINAL = 50000; - static protected $priority; + protected $priority; protected $object = null; - static public function getPriority():int{ - return static::$priority; + public function getPriority():int{ + return $this->priority; } + + public function setPriority(int $newPriority):self{ + $this->priority = $newPriority; + return $this; + } + abstract public function action(?array $env=null, $arg=null):?array; public function getUniqueID():string{ - $priority = static::$priority; - $objID = spl_object_id($this->object); + $priority = $this->priority; $fqn = static::class; - return "{$priority}_{$fqn}_{$objID}"; + return "{$priority}_{$fqn}"; } } \ No newline at end of file diff --git a/hwe/sammo/TriggerCaller.php b/hwe/sammo/TriggerCaller.php index 50928027..5ebf7731 100644 --- a/hwe/sammo/TriggerCaller.php +++ b/hwe/sammo/TriggerCaller.php @@ -10,7 +10,7 @@ abstract class TriggerCaller{ return !$this->triggerListByPriority; } - function __construct(?array $triggerList=null) + function __construct(ObjectTrigger ...$triggerList) { if(!$triggerList){ return; diff --git a/hwe/sammo/WarUnit.php b/hwe/sammo/WarUnit.php index d8c1023d..1cabb981 100644 --- a/hwe/sammo/WarUnit.php +++ b/hwe/sammo/WarUnit.php @@ -344,22 +344,6 @@ class WarUnit{ } } - function checkPreActiveSkill(){ - yield true; - } - - function checkActiveSkill(){ - yield true; - } - - function checkPostActiveSkill(){ - yield true; - } - - function applyActiveSkill(){ - yield true; - } - function getHP():int{ throw new NotInheritedMethodException(); return 0; diff --git a/hwe/sammo/WarUnitTrigger/WarActivateSkills.php b/hwe/sammo/WarUnitTrigger/WarActivateSkills.php index 09ea65dd..fb924924 100644 --- a/hwe/sammo/WarUnitTrigger/WarActivateSkills.php +++ b/hwe/sammo/WarUnitTrigger/WarActivateSkills.php @@ -9,7 +9,7 @@ use sammo\Util; use sammo\ObjectTrigger; class WarActivateSkills extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_INIT; + protected $priority = ObjectTrigger::PRIORITY_INIT; protected $isSelf; protected $activeSkills; diff --git a/hwe/sammo/WarUnitTrigger/che_격노발동.php b/hwe/sammo/WarUnitTrigger/che_격노발동.php index 269560fe..faa11e6a 100644 --- a/hwe/sammo/WarUnitTrigger/che_격노발동.php +++ b/hwe/sammo/WarUnitTrigger/che_격노발동.php @@ -9,7 +9,7 @@ use sammo\Util; use sammo\ObjectTrigger; class che_격노발동 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_POST + 600; + protected $priority = ObjectTrigger::PRIORITY_POST + 600; protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{ if(!$self->hasActivatedSkill('격노') && !$self->hasActivatedSkill('진노')){ diff --git a/hwe/sammo/WarUnitTrigger/che_계략발동.php b/hwe/sammo/WarUnitTrigger/che_계략발동.php index 0df5b8a2..00ed926b 100644 --- a/hwe/sammo/WarUnitTrigger/che_계략발동.php +++ b/hwe/sammo/WarUnitTrigger/che_계략발동.php @@ -9,7 +9,7 @@ use sammo\Util; use sammo\ObjectTrigger; class che_계략발동 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_POST + 100; + protected $priority = ObjectTrigger::PRIORITY_POST + 100; protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{ if(!$self->hasActivatedSkill('계략')){ diff --git a/hwe/sammo/WarUnitTrigger/che_계략시도.php b/hwe/sammo/WarUnitTrigger/che_계략시도.php index cf7357ae..fab2cb5f 100644 --- a/hwe/sammo/WarUnitTrigger/che_계략시도.php +++ b/hwe/sammo/WarUnitTrigger/che_계략시도.php @@ -8,7 +8,7 @@ use sammo\GameUnitDetail; use sammo\ObjectTrigger; class che_계략시도 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_PRE + 300; + protected $priority = ObjectTrigger::PRIORITY_PRE + 300; static protected $tableToGeneral = [ '위보'=>[1.2, 1.1], diff --git a/hwe/sammo/WarUnitTrigger/che_계략실패.php b/hwe/sammo/WarUnitTrigger/che_계략실패.php index f33dab8b..68a2ce99 100644 --- a/hwe/sammo/WarUnitTrigger/che_계략실패.php +++ b/hwe/sammo/WarUnitTrigger/che_계략실패.php @@ -9,7 +9,7 @@ use sammo\Util; use sammo\ObjectTrigger; class che_계략실패 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_POST + 200; + protected $priority = ObjectTrigger::PRIORITY_POST + 200; protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{ if(!$self->hasActivatedSkill('계략실패')){ diff --git a/hwe/sammo/WarUnitTrigger/che_반계발동.php b/hwe/sammo/WarUnitTrigger/che_반계발동.php index 598ad724..823a4682 100644 --- a/hwe/sammo/WarUnitTrigger/che_반계발동.php +++ b/hwe/sammo/WarUnitTrigger/che_반계발동.php @@ -8,8 +8,8 @@ use sammo\GameUnitDetail; use sammo\Util; use sammo\ObjectTrigger; -class che_계략발동 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_POST + 150; +class che_반계발동 extends BaseWarUnitTrigger{ + protected $priority = ObjectTrigger::PRIORITY_POST + 150; protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{ if(!$self->hasActivatedSkill('반계')){ diff --git a/hwe/sammo/WarUnitTrigger/che_반계시도.php b/hwe/sammo/WarUnitTrigger/che_반계시도.php index afc0e5e0..e516a541 100644 --- a/hwe/sammo/WarUnitTrigger/che_반계시도.php +++ b/hwe/sammo/WarUnitTrigger/che_반계시도.php @@ -8,7 +8,7 @@ use sammo\GameUnitDetail; use sammo\ObjectTrigger; class che_반계시도 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_BODY + 300; + protected $priority = ObjectTrigger::PRIORITY_BODY + 300; protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{ if(!$oppose->hasActivatedSkill('계략')){ diff --git a/hwe/sammo/WarUnitTrigger/che_부상무효.php b/hwe/sammo/WarUnitTrigger/che_부상무효.php index ea1475bd..3e4e3a11 100644 --- a/hwe/sammo/WarUnitTrigger/che_부상무효.php +++ b/hwe/sammo/WarUnitTrigger/che_부상무효.php @@ -8,7 +8,7 @@ use sammo\GameUnitDetail; use sammo\ObjectTrigger; class che_부상무효 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_BEGIN + 200; + protected $priority = ObjectTrigger::PRIORITY_BEGIN + 200; protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{ assert($self instanceof WarUnitGeneral, 'General만 발동 가능'); diff --git a/hwe/sammo/WarUnitTrigger/che_성벽부상무효.php b/hwe/sammo/WarUnitTrigger/che_성벽부상무효.php index 2a93c8b6..27f0ebb7 100644 --- a/hwe/sammo/WarUnitTrigger/che_성벽부상무효.php +++ b/hwe/sammo/WarUnitTrigger/che_성벽부상무효.php @@ -8,7 +8,7 @@ use sammo\GameUnitDetail; use sammo\ObjectTrigger; class che_성벽부상무효 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_BEGIN + 100; + protected $priority = ObjectTrigger::PRIORITY_BEGIN + 100; protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{ assert($self instanceof WarUnitGeneral, 'General만 발동 가능'); diff --git a/hwe/sammo/WarUnitTrigger/che_위압발동.php b/hwe/sammo/WarUnitTrigger/che_위압발동.php index 54397176..6ec5e6f3 100644 --- a/hwe/sammo/WarUnitTrigger/che_위압발동.php +++ b/hwe/sammo/WarUnitTrigger/che_위압발동.php @@ -9,7 +9,7 @@ use sammo\Util; use sammo\ObjectTrigger; class che_위압발동 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_POST + 700; + protected $priority = ObjectTrigger::PRIORITY_POST + 700; protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{ if(!$self->hasActivatedSkill('위압')){ diff --git a/hwe/sammo/WarUnitTrigger/che_위압시도.php b/hwe/sammo/WarUnitTrigger/che_위압시도.php new file mode 100644 index 00000000..2d4c5c05 --- /dev/null +++ b/hwe/sammo/WarUnitTrigger/che_위압시도.php @@ -0,0 +1,38 @@ +getPhase() != 0){ + return true; + } + if($self->getHP() < 1000){ + return true; + } + if($self->getComputedAtmos() < 90){ + return true; + } + if($self->getComputedTrain() < 90){ + return true; + } + if($self->hasActivatedSkill('위압불가')){ + return true; + } + + $this->activateSkill('위압'); + return true; + } +} \ No newline at end of file diff --git a/hwe/sammo/WarUnitTrigger/che_저격발동.php b/hwe/sammo/WarUnitTrigger/che_저격발동.php index 8695b6d5..4d208750 100644 --- a/hwe/sammo/WarUnitTrigger/che_저격발동.php +++ b/hwe/sammo/WarUnitTrigger/che_저격발동.php @@ -9,7 +9,7 @@ use sammo\Util; use sammo\ObjectTrigger; class che_저격발동 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_POST + 100; + protected $priority = ObjectTrigger::PRIORITY_POST + 100; protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{ if(!$oppose->hasActivatedSkill('저격')){ diff --git a/hwe/sammo/WarUnitTrigger/che_저격시도.php b/hwe/sammo/WarUnitTrigger/che_저격시도.php index 6781199e..f60ce4a9 100644 --- a/hwe/sammo/WarUnitTrigger/che_저격시도.php +++ b/hwe/sammo/WarUnitTrigger/che_저격시도.php @@ -8,7 +8,7 @@ use sammo\GameUnitDetail; use sammo\ObjectTrigger; class che_저격시도 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_PRE + 100; + protected $priority = ObjectTrigger::PRIORITY_PRE + 100; protected $woundMin; protected $woundMax; diff --git a/hwe/sammo/WarUnitTrigger/che_저지발동.php b/hwe/sammo/WarUnitTrigger/che_저지발동.php index 55070fc7..e0e79fe8 100644 --- a/hwe/sammo/WarUnitTrigger/che_저지발동.php +++ b/hwe/sammo/WarUnitTrigger/che_저지발동.php @@ -9,7 +9,7 @@ use sammo\Util; use sammo\ObjectTrigger; class che_저지발동 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_POST; //최우선 순위 + protected $priority = ObjectTrigger::PRIORITY_POST; //최우선 순위 protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{ if(!$self->hasActivatedSkill('저지')){ diff --git a/hwe/sammo/WarUnitTrigger/che_저지시도.php b/hwe/sammo/WarUnitTrigger/che_저지시도.php index 332820a3..095a8963 100644 --- a/hwe/sammo/WarUnitTrigger/che_저지시도.php +++ b/hwe/sammo/WarUnitTrigger/che_저지시도.php @@ -8,7 +8,7 @@ use sammo\GameUnitDetail; use sammo\ObjectTrigger; class che_저지시도 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_PRE; //최 우선 순위 + protected $priority = ObjectTrigger::PRIORITY_PRE; //최 우선 순위 protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{ assert($self instanceof WarUnitGeneral, 'General만 발동 가능'); diff --git a/hwe/sammo/WarUnitTrigger/che_전투치료발동.php b/hwe/sammo/WarUnitTrigger/che_전투치료발동.php index 662f2592..a5a537ee 100644 --- a/hwe/sammo/WarUnitTrigger/che_전투치료발동.php +++ b/hwe/sammo/WarUnitTrigger/che_전투치료발동.php @@ -9,7 +9,7 @@ use sammo\Util; use sammo\ObjectTrigger; class che_전투치료발동 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_POST + 300; + protected $priority = ObjectTrigger::PRIORITY_POST + 300; protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{ if(!$self->hasActivatedSkill('치료')){ diff --git a/hwe/sammo/WarUnitTrigger/che_전투치료시도.php b/hwe/sammo/WarUnitTrigger/che_전투치료시도.php index b0b469ca..a423d316 100644 --- a/hwe/sammo/WarUnitTrigger/che_전투치료시도.php +++ b/hwe/sammo/WarUnitTrigger/che_전투치료시도.php @@ -8,7 +8,7 @@ use sammo\GameUnitDetail; use sammo\ObjectTrigger; class che_전투치료시도 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_PRE + 300; + protected $priority = ObjectTrigger::PRIORITY_PRE + 300; protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{ assert($self instanceof WarUnitGeneral, 'General만 발동 가능'); diff --git a/hwe/sammo/WarUnitTrigger/che_필살발동.php b/hwe/sammo/WarUnitTrigger/che_필살발동.php index 94fe0f60..96708b5a 100644 --- a/hwe/sammo/WarUnitTrigger/che_필살발동.php +++ b/hwe/sammo/WarUnitTrigger/che_필살발동.php @@ -9,7 +9,7 @@ use sammo\Util; use sammo\ObjectTrigger; class che_필살발동 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_POST + 400; + protected $priority = ObjectTrigger::PRIORITY_POST + 400; protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{ if(!$self->hasActivatedSkill('필살')){ diff --git a/hwe/sammo/WarUnitTrigger/che_필살시도.php b/hwe/sammo/WarUnitTrigger/che_필살시도.php index ebc67754..68e2f0ae 100644 --- a/hwe/sammo/WarUnitTrigger/che_필살시도.php +++ b/hwe/sammo/WarUnitTrigger/che_필살시도.php @@ -8,7 +8,7 @@ use sammo\GameUnitDetail; use sammo\ObjectTrigger; class che_필살시도 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_PRE + 100; + protected $priority = ObjectTrigger::PRIORITY_PRE + 100; protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{ if(!($self instanceof WarUnitGeneral)){ diff --git a/hwe/sammo/WarUnitTrigger/che_회피발동.php b/hwe/sammo/WarUnitTrigger/che_회피발동.php index fc36721d..18991cbd 100644 --- a/hwe/sammo/WarUnitTrigger/che_회피발동.php +++ b/hwe/sammo/WarUnitTrigger/che_회피발동.php @@ -9,7 +9,7 @@ use sammo\Util; use sammo\ObjectTrigger; class che_회피발동 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_POST + 500; + protected $priority = ObjectTrigger::PRIORITY_POST + 500; protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{ if(!$self->hasActivatedSkill('회피')){ diff --git a/hwe/sammo/WarUnitTrigger/che_회피시도.php b/hwe/sammo/WarUnitTrigger/che_회피시도.php index b808bab4..2856579c 100644 --- a/hwe/sammo/WarUnitTrigger/che_회피시도.php +++ b/hwe/sammo/WarUnitTrigger/che_회피시도.php @@ -8,7 +8,7 @@ use sammo\GameUnitDetail; use sammo\ObjectTrigger; class che_회피시도 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_PRE + 200; + protected $priority = ObjectTrigger::PRIORITY_PRE + 200; protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{ if(!($self instanceof WarUnitGeneral)){ diff --git a/hwe/sammo/WarUnitTrigger/능력치변경.php b/hwe/sammo/WarUnitTrigger/능력치변경.php index 1dc461bb..0fc7f9de 100644 --- a/hwe/sammo/WarUnitTrigger/능력치변경.php +++ b/hwe/sammo/WarUnitTrigger/능력치변경.php @@ -8,7 +8,7 @@ use sammo\GameUnitDetail; use sammo\ObjectTrigger; class 능력치변경 extends BaseWarUnitTrigger{ - static protected $priority = ObjectTrigger::PRIORITY_BEGIN; + protected $priority = ObjectTrigger::PRIORITY_BEGIN; protected $variable; protected $operator;