WarUnitTrigger 개편, 병종 Trigger 개념 추가, 저지, 성벽부상무효
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
class GameUnitActionBase implements iAction{
|
||||
use DefaultAction;
|
||||
|
||||
|
||||
public function getWarPowerMultiplier(WarUnit $unit):array{
|
||||
return [1, 1];
|
||||
}
|
||||
|
||||
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||
return new WarUnitTriggerCaller([new GameUnitInitTriggerBase($unit)]);
|
||||
}
|
||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||
return new WarUnitTriggerCaller([new GameUnitPhaseTriggerBase($unit)]);
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,8 @@ class GameUnitConstBase{
|
||||
999999, null, null, 999999,
|
||||
[],//성벽은 공격할 수 없다.
|
||||
[self::T_FOOTMAN=>1.2],
|
||||
['성벽입니다.','생성할 수 없습니다.']
|
||||
['성벽입니다.','생성할 수 없습니다.'],
|
||||
null, null
|
||||
],
|
||||
|
||||
[
|
||||
@@ -48,7 +49,8 @@ class GameUnitConstBase{
|
||||
0, null, null, 0,
|
||||
[self::T_ARCHER=>1.2, self::T_CAVALRY=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_ARCHER=>0.8, self::T_CAVALRY=>1.2, self::T_SIEGE=>0.8],
|
||||
['표준적인 보병입니다.','보병은 방어특화이며, 상대가 회피하기 어렵습니다.']
|
||||
['표준적인 보병입니다.','보병은 방어특화이며, 상대가 회피하기 어렵습니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
1, self::T_FOOTMAN, '청주병',
|
||||
@@ -56,7 +58,8 @@ class GameUnitConstBase{
|
||||
1000, null, ['중원'], 0,
|
||||
[self::T_ARCHER=>1.2, self::T_CAVALRY=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_ARCHER=>0.8, self::T_CAVALRY=>1.2, self::T_SIEGE=>0.8],
|
||||
['저렴하고 튼튼합니다.']
|
||||
['저렴하고 튼튼합니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
2, self::T_FOOTMAN, '수병',
|
||||
@@ -64,7 +67,8 @@ class GameUnitConstBase{
|
||||
1000, null, ['오월'], 0,
|
||||
[self::T_ARCHER=>1.2, self::T_CAVALRY=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_ARCHER=>0.8, self::T_CAVALRY=>1.2, self::T_SIEGE=>0.8],
|
||||
['저렴하고 강력합니다.']
|
||||
['저렴하고 강력합니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
3, self::T_FOOTMAN, '자객병',
|
||||
@@ -72,7 +76,8 @@ class GameUnitConstBase{
|
||||
2000, ['저'], null, 0,
|
||||
[self::T_ARCHER=>1.2, self::T_CAVALRY=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_ARCHER=>0.8, self::T_CAVALRY=>1.2, self::T_SIEGE=>0.8],
|
||||
['은밀하고 날쌥니다.']
|
||||
['은밀하고 날쌥니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
4, self::T_FOOTMAN, '근위병',
|
||||
@@ -80,7 +85,8 @@ class GameUnitConstBase{
|
||||
3000, ['낙양'], null, 0,
|
||||
[self::T_ARCHER=>1.2, self::T_CAVALRY=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_ARCHER=>0.8, self::T_CAVALRY=>1.2, self::T_SIEGE=>0.8],
|
||||
['최강의 보병입니다.']
|
||||
['최강의 보병입니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
5, self::T_FOOTMAN, '등갑병',
|
||||
@@ -88,7 +94,8 @@ class GameUnitConstBase{
|
||||
1000, null, ['남중'], 0,
|
||||
[self::T_ARCHER=>1.2, self::T_CAVALRY=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_ARCHER=>0.8, self::T_CAVALRY=>1.2, self::T_SIEGE=>0.8],
|
||||
['등갑을 두른 보병입니다.']
|
||||
['등갑을 두른 보병입니다.'],
|
||||
null, null
|
||||
],
|
||||
|
||||
[
|
||||
@@ -97,7 +104,8 @@ class GameUnitConstBase{
|
||||
0, null, null, 0,
|
||||
[self::T_CAVALRY=>1.2, self::T_FOOTMAN=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_CAVALRY=>0.8, self::T_FOOTMAN=>1.2, self::T_SIEGE=>0.8],
|
||||
['표준적인 궁병입니다.','궁병은 회피특화입니다.']
|
||||
['표준적인 궁병입니다.','궁병은 회피특화입니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
11, self::T_ARCHER, '궁기병',
|
||||
@@ -105,7 +113,8 @@ class GameUnitConstBase{
|
||||
1000, null, ['동이'], 0,
|
||||
[self::T_CAVALRY=>1.2, self::T_FOOTMAN=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_CAVALRY=>0.8, self::T_FOOTMAN=>1.2, self::T_SIEGE=>0.8],
|
||||
['말을 타고 잘 피합니다.']
|
||||
['말을 타고 잘 피합니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
12, self::T_ARCHER, '연노병',
|
||||
@@ -113,7 +122,8 @@ class GameUnitConstBase{
|
||||
1000, null, ['서촉'], 0,
|
||||
[self::T_CAVALRY=>1.2, self::T_FOOTMAN=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_CAVALRY=>0.8, self::T_FOOTMAN=>1.2, self::T_SIEGE=>0.8],
|
||||
['화살을 연사합니다.']
|
||||
['화살을 연사합니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
13, self::T_ARCHER, '강궁병',
|
||||
@@ -121,7 +131,8 @@ class GameUnitConstBase{
|
||||
3000, ['양양'], null, 0,
|
||||
[self::T_CAVALRY=>1.2, self::T_FOOTMAN=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_CAVALRY=>0.8, self::T_FOOTMAN=>1.2, self::T_SIEGE=>0.8],
|
||||
['강건한 궁병입니다.']
|
||||
['강건한 궁병입니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
14, self::T_ARCHER, '석궁병',
|
||||
@@ -129,7 +140,8 @@ class GameUnitConstBase{
|
||||
3000, ['건업'], null, 0,
|
||||
[self::T_CAVALRY=>1.2, self::T_FOOTMAN=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_CAVALRY=>0.8, self::T_FOOTMAN=>1.2, self::T_SIEGE=>0.8],
|
||||
['강력한 화살을 쏩니다.']
|
||||
['강력한 화살을 쏩니다.'],
|
||||
null, null
|
||||
],
|
||||
|
||||
[
|
||||
@@ -138,7 +150,8 @@ class GameUnitConstBase{
|
||||
0, null, null, 0,
|
||||
[self::T_FOOTMAN=>1.2, self::T_ARCHER=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_FOOTMAN=>0.8, self::T_ARCHER=>1.2, self::T_SIEGE=>0.8],
|
||||
['표준적인 기병입니다.','기병은 공격특화입니다.']
|
||||
['표준적인 기병입니다.','기병은 공격특화입니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
21, self::T_CAVALRY, '백마병',
|
||||
@@ -146,7 +159,8 @@ class GameUnitConstBase{
|
||||
1000, null, ['하북'], 0,
|
||||
[self::T_FOOTMAN=>1.2, self::T_ARCHER=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_FOOTMAN=>0.8, self::T_ARCHER=>1.2, self::T_SIEGE=>0.8],
|
||||
['백마의 위용을 보여줍니다.']
|
||||
['백마의 위용을 보여줍니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
22, self::T_CAVALRY, '중장기병',
|
||||
@@ -154,7 +168,8 @@ class GameUnitConstBase{
|
||||
1000, null, ['서북'], 0,
|
||||
[self::T_FOOTMAN=>1.2, self::T_ARCHER=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_FOOTMAN=>0.8, self::T_ARCHER=>1.2, self::T_SIEGE=>0.8],
|
||||
['갑주를 두른 기병입니다.']
|
||||
['갑주를 두른 기병입니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
23, self::T_CAVALRY, '돌격기병',
|
||||
@@ -162,7 +177,8 @@ class GameUnitConstBase{
|
||||
2000, ['흉노'], null, 0,
|
||||
[self::T_FOOTMAN=>1.2, self::T_ARCHER=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_FOOTMAN=>0.8, self::T_ARCHER=>1.2, self::T_SIEGE=>0.8],
|
||||
['저돌적으로 공격합니다.']
|
||||
['저돌적으로 공격합니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
24, self::T_CAVALRY, '철기병',
|
||||
@@ -170,14 +186,17 @@ class GameUnitConstBase{
|
||||
2000, ['강'], null, 0,
|
||||
[self::T_FOOTMAN=>1.2, self::T_ARCHER=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_FOOTMAN=>0.8, self::T_ARCHER=>1.2, self::T_SIEGE=>0.8],
|
||||
['철갑을 두른 기병입니다.']],
|
||||
['철갑을 두른 기병입니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
25, self::T_CAVALRY, '수렵기병',
|
||||
150, 100, 8, 15, 0, 12, 12,
|
||||
2000, ['산월'], null, 0,
|
||||
[self::T_FOOTMAN=>1.2, self::T_ARCHER=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_FOOTMAN=>0.8, self::T_ARCHER=>1.2, self::T_SIEGE=>0.8],
|
||||
['날쎄고 빠른 기병입니다.']
|
||||
['날쎄고 빠른 기병입니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
26, self::T_CAVALRY, '맹수병',
|
||||
@@ -185,7 +204,8 @@ class GameUnitConstBase{
|
||||
2000, ['남만'], null, 0,
|
||||
[self::T_FOOTMAN=>1.2, self::T_ARCHER=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_FOOTMAN=>0.8, self::T_ARCHER=>1.2, self::T_SIEGE=>0.8],
|
||||
['어느 누구보다 강력합니다.']
|
||||
['어느 누구보다 강력합니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
27, self::T_CAVALRY, '호표기병',
|
||||
@@ -193,7 +213,8 @@ class GameUnitConstBase{
|
||||
3000, ['허창'], null, 0,
|
||||
[self::T_FOOTMAN=>1.2, self::T_ARCHER=>0.8, self::T_SIEGE=>1.2],
|
||||
[self::T_FOOTMAN=>0.8, self::T_ARCHER=>1.2, self::T_SIEGE=>0.8],
|
||||
['정예 기병입니다.']
|
||||
['정예 기병입니다.'],
|
||||
null, null
|
||||
],
|
||||
|
||||
[
|
||||
@@ -202,7 +223,8 @@ class GameUnitConstBase{
|
||||
0, null, null, 0,
|
||||
[self::T_SIEGE=>1.2],
|
||||
[self::T_SIEGE=>0.8],
|
||||
['계략을 사용하는 병종입니다.']
|
||||
['계략을 사용하는 병종입니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
31, self::T_WIZARD, '신귀병',
|
||||
@@ -210,7 +232,8 @@ class GameUnitConstBase{
|
||||
1000, null, ['초'], 0,
|
||||
[self::T_SIEGE=>1.2],
|
||||
[self::T_SIEGE=>0.8],
|
||||
['신출귀몰한 귀병입니다.']
|
||||
['신출귀몰한 귀병입니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
32, self::T_WIZARD, '백귀병',
|
||||
@@ -218,7 +241,8 @@ class GameUnitConstBase{
|
||||
2000, ['오환'], null, 0,
|
||||
[self::T_SIEGE=>1.2],
|
||||
[self::T_SIEGE=>0.8],
|
||||
['저렴하고 튼튼합니다.']
|
||||
['저렴하고 튼튼합니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
33, self::T_WIZARD, '흑귀병',
|
||||
@@ -226,7 +250,8 @@ class GameUnitConstBase{
|
||||
2000, ['왜'], null, 0,
|
||||
[self::T_SIEGE=>1.2],
|
||||
[self::T_SIEGE=>0.8],
|
||||
['저렴하고 강력합니다.']
|
||||
['저렴하고 강력합니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
34, self::T_WIZARD, '악귀병',
|
||||
@@ -234,7 +259,8 @@ class GameUnitConstBase{
|
||||
3000, ['장안'], null, 0,
|
||||
[self::T_SIEGE=>1.2],
|
||||
[self::T_SIEGE=>0.8],
|
||||
['백병전에도 능숙합니다.']
|
||||
['백병전에도 능숙합니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
35, self::T_WIZARD, '남귀병',
|
||||
@@ -242,7 +268,8 @@ class GameUnitConstBase{
|
||||
1000, null, null, 0,
|
||||
[self::T_SIEGE=>1.2],
|
||||
[self::T_SIEGE=>0.8],
|
||||
['전투를 포기하고 계략에 몰두합니다.']
|
||||
['전투를 포기하고 계략에 몰두합니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
36, self::T_WIZARD, '황귀병',
|
||||
@@ -250,7 +277,8 @@ class GameUnitConstBase{
|
||||
3000, ['낙양'], null, 0,
|
||||
[self::T_SIEGE=>1.2],
|
||||
[self::T_SIEGE=>0.8],
|
||||
['고도로 훈련된 귀병입니다.']
|
||||
['고도로 훈련된 귀병입니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
37, self::T_WIZARD, '천귀병',
|
||||
@@ -258,7 +286,8 @@ class GameUnitConstBase{
|
||||
3000, ['성도'], null, 0,
|
||||
[self::T_SIEGE=>1.2],
|
||||
[self::T_SIEGE=>0.8],
|
||||
['갑주를 두른 귀병입니다.']
|
||||
['갑주를 두른 귀병입니다.'],
|
||||
null, null
|
||||
],
|
||||
[
|
||||
38, self::T_WIZARD, '마귀병',
|
||||
@@ -266,7 +295,8 @@ class GameUnitConstBase{
|
||||
3000, ['업'], null, 0,
|
||||
[self::T_SIEGE=>1.2],
|
||||
[self::T_SIEGE=>0.8],
|
||||
['날카로운 무기를 가진 귀병입니다.']
|
||||
['날카로운 무기를 가진 귀병입니다.'],
|
||||
null, null
|
||||
],
|
||||
|
||||
[
|
||||
@@ -275,7 +305,8 @@ class GameUnitConstBase{
|
||||
0, null, null, 3,
|
||||
[self::T_FOOTMAN=>0.8, self::T_ARCHER=>0.8, self::T_CAVALRY=>0.8, self::T_WIZARD=>0.8, self::T_CASTLE=>1.8],
|
||||
[self::T_FOOTMAN=>1.2, self::T_ARCHER=>1.2, self::T_CAVALRY=>1.2, self::T_WIZARD=>1.2],
|
||||
['높은 구조물 위에서 공격합니다.']
|
||||
['높은 구조물 위에서 공격합니다.'],
|
||||
['che_성벽부상무효'], null
|
||||
],
|
||||
[
|
||||
41, self::T_SIEGE, '충차',
|
||||
@@ -283,7 +314,8 @@ class GameUnitConstBase{
|
||||
1000, null, null, 3,
|
||||
[self::T_FOOTMAN=>0.8, self::T_ARCHER=>0.8, self::T_CAVALRY=>0.8, self::T_WIZARD=>0.8, self::T_CASTLE=>2.4],
|
||||
[self::T_FOOTMAN=>1.2, self::T_ARCHER=>1.2, self::T_CAVALRY=>1.2, self::T_WIZARD=>1.2],
|
||||
['엄청난 위력으로 성벽을 부수어버립니다.']
|
||||
['엄청난 위력으로 성벽을 부수어버립니다.'],
|
||||
['che_성벽부상무효'], null
|
||||
],
|
||||
[
|
||||
42, self::T_SIEGE, '벽력거',
|
||||
@@ -291,7 +323,8 @@ class GameUnitConstBase{
|
||||
3000, ['업'], null, 0,
|
||||
[self::T_FOOTMAN=>0.8, self::T_ARCHER=>0.8, self::T_CAVALRY=>0.8, self::T_WIZARD=>0.8, self::T_CASTLE=>1.8],
|
||||
[self::T_FOOTMAN=>1.2, self::T_ARCHER=>1.2, self::T_CAVALRY=>1.2, self::T_WIZARD=>1.2],
|
||||
['상대에게 돌덩이를 날립니다.']
|
||||
['상대에게 돌덩이를 날립니다.'],
|
||||
['che_성벽부상무효'], null
|
||||
],
|
||||
[
|
||||
43, self::T_SIEGE, '목우',
|
||||
@@ -299,7 +332,8 @@ class GameUnitConstBase{
|
||||
3000, ['성도'], null, 0,
|
||||
[self::T_FOOTMAN=>0.8, self::T_ARCHER=>0.8, self::T_CAVALRY=>0.8, self::T_WIZARD=>0.8],
|
||||
[self::T_FOOTMAN=>1.2, self::T_ARCHER=>1.2, self::T_CAVALRY=>1.2, self::T_WIZARD=>1.2],
|
||||
['상대를 저지하는 특수병기입니다.']
|
||||
['상대를 저지하는 특수병기입니다.'],
|
||||
['che_성벽부상무효'], ['che_저지시도', 'che_저지발동']
|
||||
]
|
||||
];
|
||||
|
||||
@@ -416,7 +450,9 @@ class GameUnitConstBase{
|
||||
$reqYear,
|
||||
$attackCoef,
|
||||
$defenceCoef,
|
||||
$info
|
||||
$info,
|
||||
$initSkillTrigger,
|
||||
$phaseSkillTrigger,
|
||||
] = $rawUnit;
|
||||
|
||||
if($reqYear > 0){
|
||||
@@ -458,7 +494,9 @@ class GameUnitConstBase{
|
||||
$reqYear,
|
||||
$attackCoef,
|
||||
$defenceCoef,
|
||||
$info
|
||||
$info,
|
||||
$initSkillTrigger,
|
||||
$phaseSkillTrigger
|
||||
);
|
||||
|
||||
$constID[$id] = $unit;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
class GameUnitDetail extends GameUnitActionBase{
|
||||
class GameUnitDetail implements iAction{
|
||||
use DefaultAction;
|
||||
|
||||
public $id;
|
||||
public $armType;
|
||||
@@ -20,6 +21,8 @@ class GameUnitDetail extends GameUnitActionBase{
|
||||
public $attackCoef;
|
||||
public $defenceCoef;
|
||||
public $info;
|
||||
public $initSkillTrigger;
|
||||
public $phaseSkillTrigger;
|
||||
|
||||
public function __construct(
|
||||
int $id,
|
||||
@@ -38,7 +41,9 @@ class GameUnitDetail extends GameUnitActionBase{
|
||||
int $reqYear,
|
||||
array $attackCoef,
|
||||
array $defenceCoef,
|
||||
array $info
|
||||
array $info,
|
||||
?array $initSkillTrigger,
|
||||
?array $phaseSkillTrigger
|
||||
){
|
||||
$this->id = $id;
|
||||
$this->name = $name;
|
||||
@@ -57,6 +62,9 @@ class GameUnitDetail extends GameUnitActionBase{
|
||||
$this->attackCoef = $attackCoef;
|
||||
$this->defenceCoef = $defenceCoef;
|
||||
$this->info = $info;
|
||||
$this->initSkillTrigger = $initSkillTrigger;
|
||||
$this->phaseSkillTrigger = $phaseSkillTrigger;
|
||||
|
||||
}
|
||||
|
||||
public function getShortName():string{
|
||||
@@ -199,4 +207,45 @@ class GameUnitDetail extends GameUnitActionBase{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//iAction
|
||||
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||
if(!$this->initSkillTrigger){
|
||||
return null;
|
||||
}
|
||||
$triggerList = [];
|
||||
foreach($this->initSkillTrigger as $triggerArgs){
|
||||
if(is_string($triggerArgs)){
|
||||
$typeName = $triggerArgs;
|
||||
$triggerList[] = buildWarUnitTriggerClass($typeName, $unit);
|
||||
}
|
||||
else{
|
||||
$typeName = $triggerArgs[0];
|
||||
//WarUnit 다음 인자는 $raiseType이며, 0이어야할 것이다
|
||||
$triggerArgs[0] = 0;
|
||||
$triggerList[] = buildWarUnitTriggerClass($typeName, $unit, $triggerArgs);
|
||||
}
|
||||
}
|
||||
return new WarUnitTriggerCaller($triggerList);
|
||||
}
|
||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||
if(!$this->phaseSkillTrigger){
|
||||
return null;
|
||||
}
|
||||
$triggerList = [];
|
||||
foreach($this->phaseSkillTrigger as $triggerArgs){
|
||||
if(is_string($triggerArgs)){
|
||||
$typeName = $triggerArgs;
|
||||
$triggerList[] = buildWarUnitTriggerClass($typeName, $unit);
|
||||
}
|
||||
else{
|
||||
$typeName = $triggerArgs[0];
|
||||
//WarUnit 다음 인자는 $raiseType이며, 0이어야할 것이다
|
||||
$triggerArgs[0] = 0;
|
||||
$triggerList[] = buildWarUnitTriggerClass($typeName, $unit, $triggerArgs);
|
||||
}
|
||||
}
|
||||
return new WarUnitTriggerCaller($triggerList);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
class GameUnitInitTriggerBase extends BaseWarUnitTrigger{
|
||||
static protected $priority = 10000;
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):void{
|
||||
//TODO: 충차는 성벽 상대로 부상입지 않음
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
class GameUnitPhaseTriggerBase extends BaseWarUnitTrigger{
|
||||
static protected $priority = 10000;
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):void{
|
||||
//TODO: 목우 목우
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?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{
|
||||
static protected $priority = ObjectTrigger::PRIORITY_BEGIN;
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
|
||||
assert($self instanceof WarUnitGeneral, 'General만 발동 가능');
|
||||
if(!$oppose instanceof WarUnitCity){
|
||||
return true;
|
||||
}
|
||||
|
||||
$self->activateSkill('부상무효');
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ use sammo\WarUnitGeneral;
|
||||
use sammo\WarUnitCity;
|
||||
use sammo\WarUnit;
|
||||
use sammo\GameUnitDetail;
|
||||
use sammo\ObjectTrigger;
|
||||
|
||||
class che_저격시도 extends BaseWarUnitTrigger{
|
||||
static protected $priority = ObjectTrigger::PRIORITY_PRE + 100;
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
namespace sammo\WarUnitTrigger;
|
||||
use sammo\BaseWarUnitTrigger;
|
||||
use sammo\WarUnitGeneral;
|
||||
use sammo\WarUnitCity;
|
||||
use sammo\WarUnit;
|
||||
use sammo\GameUnitDetail;
|
||||
use sammo\Util;
|
||||
use sammo\ObjectTrigger;
|
||||
|
||||
class che_저지발동 extends BaseWarUnitTrigger{
|
||||
static protected $priority = ObjectTrigger::PRIORITY_POST; //최우선 순위
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
|
||||
if(!$self->hasActivatedSkill('저지')){
|
||||
return true;
|
||||
}
|
||||
|
||||
if($selfEnv['저지발동']??false){
|
||||
return true;
|
||||
}
|
||||
$selfEnv['저지발동'] = true;
|
||||
|
||||
$self->getLogger()->pushGeneralBattleDetailLog("상대를 <C>저지</>했다!", ActionLogger::PLAIN);
|
||||
$oppose->getLogger()->pushGeneralBattleDetailLog("저지</>당했다!", ActionLogger::PLAIN);
|
||||
|
||||
$self->addDex($oppose->getCrewType(), $oppose->getWarPower() * 0.9);
|
||||
$self->addDex($self->getCrewType(), $self->getWarPower() * 0.9);
|
||||
|
||||
$self->setWarPowerMultiply(0);
|
||||
$oppose->setWarPowerMultiply(0);
|
||||
|
||||
return false; //저지는 모든 특수 이벤트를 중지시킨다.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?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{
|
||||
static protected $priority = ObjectTrigger::PRIORITY_PRE; //최 우선 순위
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
|
||||
assert($self instanceof WarUnitGeneral, 'General만 발동 가능');
|
||||
if($self->isAttacker()){
|
||||
return true;
|
||||
}
|
||||
if($self->hasActivatedSkill('특수')){
|
||||
return true;
|
||||
}
|
||||
if($self->hasActivatedSkill('저지불가')){
|
||||
return true;
|
||||
}
|
||||
|
||||
$ratio = $self->getComputedAtmos() + $self->getComputedTrain();
|
||||
if(Util::randBool($ratio / 400)){
|
||||
$self->activateSkill('특수', '저지');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user