-
Notifications
You must be signed in to change notification settings - Fork 0
/
Heal.groovy
33 lines (27 loc) · 935 Bytes
/
Heal.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
32
33
import core.board.ClientBoard
import core.board.ClientCell
import core.board.ClientAbility
import core.graphics.scenes.BattleScene
import core.graphics.scenes.Scenes;
import program.main.SceneUtil
import shared.board.Board
import shared.board.Cell
import shared.board.Ability
import shared.board.Unit
def onCheck(Ability spell, Board board, Cell target){
target.getContentsType() == Cell.CONTENTS_UNIT && target.getUnit().getState() != Unit.STATE_DEAD
}
def onCheckAOE(Ability spell, Board board, Cell from, Cell to){
from == to
}
def onCastBegin(ClientAbility spell, Board board, ClientCell target){
spell.caster.setFacing(target.unit)
1.0f
}
def onCastEnd(Ability spell, ClientBoard board, Cell target){
def attach = SceneUtil.getScene(Scenes.BATTLE, BattleScene.class).getSpatialByUnit(target.unit).node
target.unit.doHeal(6)
board.nextTurn()
spell.putOnCoolDown()
board.addEffect("heal-effect", attach)
}