Page 1 of 1

Sustains with a targeter question

Posted: Wed Apr 27, 2016 2:15 pm
by Micbran
If I make a sustain with a targeter, I.E. it selects an area and then does an effect on it once you activate it, but the player cancels the targeter by pressing esc. or whatever, would I be able to use forceUseTalent(MyTalent, {no_energy = true}) and then refund the player energy, thus giving them the turn back and turning the sustain off?

Re: Sustains with a targeter question

Posted: Wed Apr 27, 2016 11:34 pm
by stinkstink
Couldn't you just use

Code: Select all

local tg = self:getTalentTarget(t)
local x, y, target = self:getTarget(tg)
if not x or not y or not target then return nil end
in the activate function to prevent it from being turned on without a target?

Re: Sustains with a targeter question

Posted: Thu Apr 28, 2016 12:39 am
by Micbran
I wasn't sure if returning nil would prevent it from being turned on, since sustain activate functions usually return a table and not true like action functions do.