Skip to content

Commit d5fb95e

Browse files
authored
update utility.lua
"delayed operation" effects should not meet their condition if an affected card is moved from its location, but becomes affected again by a delayed operation registered by the same effect
1 parent 3215843 commit d5fb95e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

utility.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2805,12 +2805,17 @@ end
28052805
int|nil hint: a string to show on the affected cards
28062806
int|nil effect_desc: a string to be used as the description of the delayed effect (useful when the same effect registers multiple different delayed effects)
28072807
--]]
2808+
local delayed_operation_id=0
28082809
function Auxiliary.DelayedOperation(card_or_group,phase,flag,e,tp,oper,cond,reset,reset_count,hint,effect_desc)
28092810
local g=(type(card_or_group)=="Group" and card_or_group or Group.FromCards(card_or_group))
28102811
if #g==0 then return end
2812+
28112813
reset=reset or (RESET_PHASE|phase)
28122814
reset_count=reset_count or 1
2813-
local fid=e:GetFieldID()
2815+
2816+
delayed_operation_id=delayed_operation_id+1
2817+
local fid=delayed_operation_id
2818+
28142819
local function agfilter(c,lbl) return c:GetFlagEffectLabel(flag)==lbl end
28152820
local function get_affected_group(e) return e:GetLabelObject():Filter(agfilter,nil,e:GetLabel()) end
28162821

@@ -2840,7 +2845,6 @@ function Auxiliary.DelayedOperation(card_or_group,phase,flag,e,tp,oper,cond,rese
28402845
for tc in g:Iter() do
28412846
tc:RegisterFlagEffect(flag,RESET_EVENT+RESETS_STANDARD,flagprop,1,fid,hint):SetCondition(flagcond)
28422847
end
2843-
g:KeepAlive()
28442848

28452849
return e1
28462850
end

0 commit comments

Comments
 (0)