Commit 5e7e25d8 authored by mercury233's avatar mercury233 Committed by GitHub

add Duel.AdjustAll (#1910)

parent a0bceff0
......@@ -63,6 +63,7 @@ end
function c197042.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 then
Duel.AdjustAll()
local b1=Duel.IsExistingMatchingCard(c197042.xyzfilter,tp,LOCATION_EXTRA,0,1,nil)
local b2=Duel.GetFlagEffect(tp,197042)>0 and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil)
local off=1
......
......@@ -39,7 +39,7 @@ function c1980574.synop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) or Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 then return end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
Duel.RaiseEvent(c,EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
local mg=Group.FromCards(c,tc)
if mg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil,mg)
......
......@@ -53,7 +53,7 @@ function c20050865.scop(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
if not c:IsRelateToEffect(e) then return end
Duel.RaiseEvent(c,EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
local mg=Group.FromCards(c,tc)
if mg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(c20050865.scfilter2,tp,LOCATION_EXTRA,0,nil,mg)
......
......@@ -63,7 +63,7 @@ function c20285786.activate(e,tp,eg,ep,ev,re,r,rp)
tc=g:GetNext()
end
Duel.SpecialSummonComplete()
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
if g:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local xyzg=Duel.GetMatchingGroup(c20285786.xyzfilter,tp,LOCATION_EXTRA,0,nil,g)
if xyzg:GetCount()>0 then
......
......@@ -71,7 +71,7 @@ function c23536866.operation(e,tp,eg,ep,ev,re,r,rp)
local e4=e3:Clone()
tc2:RegisterEffect(e4)
Duel.SpecialSummonComplete()
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
if g:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local xyzg=Duel.GetMatchingGroup(c23536866.xyzfilter,tp,LOCATION_EXTRA,0,nil,g,tp)
if xyzg:GetCount()>0 then
......
......@@ -47,7 +47,7 @@ function c25148255.scop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==0 then return end
if not c:IsRelateToEffect(e) then return end
Duel.RaiseEvent(c,EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
local mg=Group.FromCards(c,tc)
if mg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(c25148255.scfilter,tp,LOCATION_EXTRA,0,nil,mg,tp)
......
......@@ -51,7 +51,7 @@ function c28534130.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(RESET_TURN_SET)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
Duel.RaiseEvent(c,EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
if not tc:IsLocation(LOCATION_MZONE) then return end
local tg=Duel.GetMatchingGroup(c28534130.lkfilter,tp,LOCATION_EXTRA,0,nil,tc)
if tg:GetCount()>0 then
......
......@@ -58,7 +58,7 @@ function c28827503.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(RESET_TURN_SET)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
Duel.RaiseEvent(c,EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
if not tc:IsLocation(LOCATION_MZONE) then return end
local tg=Duel.GetMatchingGroup(c28827503.lkfilter,tp,LOCATION_EXTRA,0,nil,tc)
if tg:GetCount()>0 then
......
......@@ -43,7 +43,7 @@ function c29087919.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c29087919.filter2,nil,e,tp)
local ct=Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
if g:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<ct then return end
local xyzg=Duel.GetMatchingGroup(c29087919.spfilter,tp,LOCATION_EXTRA,0,nil,g,ct)
if ct>=2 and xyzg:GetCount()>0 then
......
......@@ -145,7 +145,7 @@ function c30983281.scop(e,tp,eg,ep,ev,re,r,rp)
end
end
Duel.SpecialSummonComplete()
Duel.RaiseEvent(c,EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
local tg=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil)
if res and tg:GetCount()>0 then
Duel.BreakEffect()
......
......@@ -56,7 +56,7 @@ function c40493210.activate(e,tp,eg,ep,ev,re,r,rp)
g=g:Select(tp,ft,ft,nil)
end
local res=Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
local b1=Duel.IsExistingMatchingCard(c40493210.syncsumfilter,tp,LOCATION_EXTRA,0,1,nil)
local b2=Duel.IsExistingMatchingCard(c40493210.xyzsumfilter,tp,LOCATION_EXTRA,0,1,nil)
if res~=0 and (b1 or b2) then
......
......@@ -67,7 +67,7 @@ function c40975243.activate(e,tp,eg,ep,ev,re,r,rp)
end
Duel.SpecialSummonComplete()
local og=Duel.GetOperatedGroup()
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
if og:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<sg:GetCount() then return end
local tg=Duel.GetMatchingGroup(c40975243.lkfilter,tp,LOCATION_EXTRA,0,nil,og)
if og:GetCount()==sg:GetCount() and tg:GetCount()>0 then
......
......@@ -75,7 +75,7 @@ function c44161893.spop(e,tp,eg,ep,ev,re,r,rp)
local e4=e3:Clone()
tc2:RegisterEffect(e4)
Duel.SpecialSummonComplete()
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
if sg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local xyzg=Duel.GetMatchingGroup(c44161893.xyzfilter,tp,LOCATION_EXTRA,0,nil,sg)
if xyzg:GetCount()>0 then
......
......@@ -77,7 +77,7 @@ function c46005939.activate(e,tp,eg,ep,ev,re,r,rp)
local e4=e2:Clone()
tc2:RegisterEffect(e4)
Duel.SpecialSummonComplete()
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
if g:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local e5=nil
local e6=nil
......
......@@ -74,7 +74,7 @@ function c50797682.activate(e,tp,eg,ep,ev,re,r,rp)
tc=g1:GetNext()
end
Duel.SpecialSummonComplete()
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
if g1:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local xyzg=Duel.GetMatchingGroup(c50797682.xyzfilter,tp,LOCATION_EXTRA,0,nil,e,tp,g1)
if #xyzg>0 then
......
......@@ -48,7 +48,7 @@ function c61314842.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c61314842.filter2,nil,e,tp)
if g:GetCount()<2 then return end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
if g:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local xyzg=Duel.GetMatchingGroup(c61314842.xyzfilter,tp,LOCATION_EXTRA,0,nil,g)
if xyzg:GetCount()>0 then
......
......@@ -85,7 +85,7 @@ function c62829077.activate(e,tp,eg,ep,ev,re,r,rp)
tc=g:GetNext()
end
Duel.SpecialSummonComplete()
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
if g:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<3 then return end
local xyzg=Duel.GetMatchingGroup(c62829077.xyzfilter,tp,LOCATION_EXTRA,0,nil,g)
if xyzg:GetCount()>0 then
......
......@@ -60,7 +60,7 @@ function c63748694.spop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
sc:RegisterEffect(e2)
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
local g=Group.FromCards(c,sc)
if g:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local xyzg=Duel.GetMatchingGroup(c63748694.xyzfilter,tp,LOCATION_EXTRA,0,nil,e,tp,c,sc)
......
......@@ -53,7 +53,7 @@ function c66938505.scop(e,tp,eg,ep,ev,re,r,rp)
end
if Duel.SpecialSummonComplete()==0 then return end
if not c:IsRelateToEffect(e) then return end
Duel.RaiseEvent(c,EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
local mg=Group.FromCards(c,tc)
if mg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(c66938505.scfilter2,tp,LOCATION_EXTRA,0,nil,mg)
......
......@@ -114,7 +114,7 @@ function c71095768.spop(e,tp,eg,ep,ev,re,r,rp)
local e4=e3:Clone()
tc2:RegisterEffect(e4)
Duel.SpecialSummonComplete()
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
if sg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local xyzg=Duel.GetMatchingGroup(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,nil,sg,2,2)
if xyzg:GetCount()>0 then
......
......@@ -77,7 +77,7 @@ function c76937326.spop(e,tp,eg,ep,ev,re,r,rp)
end
Duel.SpecialSummonComplete()
local og=Duel.GetOperatedGroup()
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
if og:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local tg=Duel.GetMatchingGroup(c76937326.synfilter,tp,LOCATION_EXTRA,0,nil,og)
if og:GetCount()==sg:GetCount() and tg:GetCount()>0 then
......
......@@ -135,7 +135,7 @@ function c82224646.scop(e,tp,eg,ep,ev,re,r,rp)
end
if Duel.SpecialSummonComplete()==0 then return end
if not c:IsRelateToEffect(e) then return end
Duel.RaiseEvent(c,EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
local mg=Group.FromCards(c,tc)
if mg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(c82224646.scfilter2,tp,LOCATION_EXTRA,0,nil,tp,mg)
......
......@@ -84,7 +84,7 @@ function c87804365.activate(e,tp,eg,ep,ev,re,r,rp)
end
Duel.SpecialSummonComplete()
local og=Duel.GetOperatedGroup()
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
if og:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<g:GetCount() then return end
if op==0 then
local tg=Duel.GetMatchingGroup(c87804365.synfilter,tp,LOCATION_EXTRA,0,nil,og)
......
......@@ -41,7 +41,7 @@ function c89974904.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(RESET_TURN_SET)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
Duel.RaiseEvent(c,EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
if not tc:IsLocation(LOCATION_MZONE) then return end
local g=Duel.GetMatchingGroup(c89974904.cfilter,tp,LOCATION_EXTRA,0,nil,tc)
if g:GetCount()>0 then
......
......@@ -84,7 +84,7 @@ function c92932860.scop(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
if not c:IsRelateToEffect(e) then return end
Duel.RaiseEvent(c,EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
local mg=Group.FromCards(c,tc)
if mg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(c92932860.scfilter2,tp,LOCATION_EXTRA,0,nil,mg)
......
......@@ -50,7 +50,7 @@ function c93665266.scop(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
if not c:IsRelateToEffect(e) then return end
Duel.RaiseEvent(c,EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
local mg=Group.FromCards(c,tc)
if mg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(c93665266.scfilter2,tp,LOCATION_EXTRA,0,nil,mg)
......
......@@ -131,7 +131,7 @@ function c97769122.xyzop(e,tp,eg,ep,ev,re,r,rp)
tc=g:GetNext()
end
Duel.SpecialSummonComplete()
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
Duel.AdjustAll()
if g:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<#g then return end
local exg=Duel.GetMatchingGroup(c97769122.xyzfilter2,tp,LOCATION_EXTRA,0,nil)
local xyzg=exg:Filter(c97769122.ovfilter,nil,tp,g)
......
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