-
Notifications
You must be signed in to change notification settings - Fork 0
/
Contagion.groovy
31 lines (26 loc) · 890 Bytes
/
Contagion.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import core.board.ClientCell
import core.board.ClientAbility
import shared.board.Board
import shared.board.Buff
import shared.board.Cell
import shared.board.Ability
import shared.board.Unit
import shared.other.DataUtil
def onCheck(Ability spell, Board board, Cell target){
target.getContentsType() == Cell.CONTENTS_UNIT && target.getUnit().getState() != Unit.STATE_DEAD && DataUtil.distance(spell.caster, target.unit) <= 2
}
def onCheckAOE(Ability spell, Board board, Cell from, Cell to){
def x = Math.abs(from.x - to.x)
def y = Math.abs(from.y - to.y)
(x <= 1 && y <= 1)
}
def onCastBegin(ClientAbility spell, Board board, ClientCell target){
spell.caster.setFacing(target.unit);
0.5F
}
def onCastEnd(Ability spell, Board board, Cell target){
Buff buff = board.addBuff("ContagionBuff", 3, 2, target.unit)
target.unit.addBuff(buff)
board.nextTurn()
spell.putOnCoolDown()
}