Commit bf73a8e5a33031165078e42e297f36f50fa8a9b0
1 parent
fc93b122
阵营
Showing
1 changed file
with
8 additions
and
0 deletions
Show diff stats
src/adv/AdvPassive.lua
... | ... | @@ -6,6 +6,7 @@ Filter.HP_LOW_WITH_EQUAL = 3 -- 血量<=value% |
6 | 6 | Filter.HP_LOW = 4 -- 血量<value% |
7 | 7 | Filter.BUFF_BY_TYPE = 5 -- 指定类型buff |
8 | 8 | Filter.BUFF_BY_ID = 6 -- 指定id的buff |
9 | +Filter.CAMP = 7 -- 玩家是指定阵营 | |
9 | 10 | |
10 | 11 | local FilterFactory = {} |
11 | 12 | FilterFactory[Filter.HP_UP_WITH_EQUAL] = function (_Filter) |
... | ... | @@ -38,6 +39,13 @@ FilterFactory[Filter.BUFF_BY_ID] = function (_Filter) |
38 | 39 | return target:hadBuffById(self.value) |
39 | 40 | end |
40 | 41 | end |
42 | +FilterFactory[Filter.CAMP] = function (_Filter) | |
43 | + _Filter._execute = function (self, target) | |
44 | + local role = self.owner.battle.adv.owner | |
45 | + return role:getHerosCamp(role:getProperty("advTeam").heros) == self.value | |
46 | + end | |
47 | +end | |
48 | + | |
41 | 49 | |
42 | 50 | function Filter:ctor(params) |
43 | 51 | self.owner = params.owner | ... | ... |