Commit 95ce5fb4 authored by wind2009's avatar wind2009

Fix RegisterMergedDelayedEvent_ToSingleCard

parent 334099bf
Pipeline #36535 passed with stages
in 3 minutes and 21 seconds
...@@ -1631,7 +1631,7 @@ function Auxiliary.MergedDelayEventCheck2(e,tp,eg,ep,ev,re,r,rp) ...@@ -1631,7 +1631,7 @@ function Auxiliary.MergedDelayEventCheck2(e,tp,eg,ep,ev,re,r,rp)
end end
end end
--Once the card has been moved to the public area, it should be listened to again --Once the card has been moved to the public area, it should be listened to again
Auxiliary.merge_single_effects={} Auxiliary.merge_single_effect_codes={}
function Auxiliary.RegisterMergedDelayedEvent_ToSingleCard(c,code,events) function Auxiliary.RegisterMergedDelayedEvent_ToSingleCard(c,code,events)
local g=Group.CreateGroup() local g=Group.CreateGroup()
g:KeepAlive() g:KeepAlive()
...@@ -1665,7 +1665,7 @@ function Auxiliary.RegisterMergedDelayedEvent_ToSingleCard(c,code,events) ...@@ -1665,7 +1665,7 @@ function Auxiliary.RegisterMergedDelayedEvent_ToSingleCard(c,code,events)
e3:SetLabelObject(g) e3:SetLabelObject(g)
e3:SetOperation(Auxiliary.ThisCardMovedToPublicResetCheck_ToSingleCard) e3:SetOperation(Auxiliary.ThisCardMovedToPublicResetCheck_ToSingleCard)
c:RegisterEffect(e3) c:RegisterEffect(e3)
table.insert(Auxiliary.merge_single_effects,e3) Auxiliary.merge_single_effect_codes[event_code_single]=g
--use global effect to raise event for face-down cards --use global effect to raise event for face-down cards
if not Auxiliary.merge_single_global_check then if not Auxiliary.merge_single_global_check then
Auxiliary.merge_single_global_check=true Auxiliary.merge_single_global_check=true
...@@ -1730,10 +1730,8 @@ function Auxiliary.MergedDelayEventCheck2_ToSingleCard(e,tp,eg,ep,ev,re,r,rp) ...@@ -1730,10 +1730,8 @@ function Auxiliary.MergedDelayEventCheck2_ToSingleCard(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function Auxiliary.RegisterMergedDelayedEvent_ToSingleCard_RaiseEvent(e,tp,eg,ep,ev,re,r,rp) function Auxiliary.RegisterMergedDelayedEvent_ToSingleCard_RaiseEvent(e,tp,eg,ep,ev,re,r,rp)
for _,mse in ipairs(Auxiliary.merge_single_effects) do for code,g in pairs(Auxiliary.merge_single_effect_codes) do
local code=mse:GetLabel() if #g>0 then
local g=mse:GetLabelObject()
if g and #g>0 then
local _eg=g:Clone() local _eg=g:Clone()
Duel.RaiseEvent(_eg,code,re,r,rp,ep,ev) Duel.RaiseEvent(_eg,code,re,r,rp,ep,ev)
g:Clear() g:Clear()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment