BaseWarUnitTrigger, TriggerCaller 구조 변경, 클래스 반영
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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('진노')){
|
||||
|
||||
@@ -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('계략')){
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -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('계략실패')){
|
||||
|
||||
@@ -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('반계')){
|
||||
|
||||
@@ -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('계략')){
|
||||
|
||||
@@ -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만 발동 가능');
|
||||
|
||||
@@ -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만 발동 가능');
|
||||
|
||||
@@ -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('위압')){
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
namespace sammo\WarUnitTrigger;
|
||||
use sammo\BaseWarUnitTrigger;
|
||||
use sammo\WarUnitGeneral;
|
||||
use sammo\WarUnitCity;
|
||||
use sammo\WarUnit;
|
||||
use sammo\GameUnitDetail;
|
||||
use sammo\ObjectTrigger;
|
||||
|
||||
class che_위압시도 extends BaseWarUnitTrigger{
|
||||
protected $priority = ObjectTrigger::PRIORITY_BEGIN + 100;
|
||||
|
||||
protected $woundMin;
|
||||
protected $woundMax;
|
||||
protected $ratio;
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
|
||||
assert($self instanceof WarUnitGeneral, 'General만 발동 가능');
|
||||
if($self->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;
|
||||
}
|
||||
}
|
||||
@@ -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('저격')){
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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('저지')){
|
||||
|
||||
@@ -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만 발동 가능');
|
||||
|
||||
@@ -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('치료')){
|
||||
|
||||
@@ -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만 발동 가능');
|
||||
|
||||
@@ -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('필살')){
|
||||
|
||||
@@ -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)){
|
||||
|
||||
@@ -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('회피')){
|
||||
|
||||
@@ -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)){
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user