PDA

View Full Version : Effect keyword for initiative cards?



Debinani
November 3rd, 2019, 00:41
Hey all (but mostly Ikael)...

Has an effect keyword for initiative cards been implemented? I'd like to create a custom Edge that essentially redraws until the character gets a card greater than (whatever).
Would love to hear if anyone has a workaround besides manually redrawing every turn.

Thanks!
-CIH

Eru the One
November 3rd, 2019, 01:55
I would look at the code for the Quick edge as that already does what you want for cards < 6.

Eru the One
November 3rd, 2019, 01:06
scripts/manager_initiative.lua


function onInit()
...
registerAbilityHandler("quick", Interface.getString("edge_quick"), quickHandler)
...


function quickHandler(winGroup, oCard, fDraw)
if winGroup.isIncapacitated() then
return oCard
end
local sEdge = Interface.getString("edge_quick")
local sAbility = Interface.getString("edge_x_edge"):format(sEdge)
local fChecker = function(oCard)
return oCard.getValue().compareTo(CardLib.Value.five) <= 0
end
return redrawUntil(winGroup, oCard, fDraw, sAbility, fChecker)
end

I would copy this or the level headed function to get what you want and there might be other scripts I can't find; I'm not the expert Ikael is :).