Commit 2074e09d authored by salix5's avatar salix5

Merge pull request #279 from nekrozar/patch-1

fix Pot of Avarice and so on
parents f6e615f5 b7df3be4
......@@ -55,8 +55,8 @@ function c12079734.operation(e,tp,eg,ep,ev,re,r,rp)
tc:SetStatus(STATUS_UNION,true)
end
else
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 then
Duel.ShuffleDeck(tp)
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) then
if tc:IsLocation(LOCATION_DECK) then Duel.ShuffleDeck(tp) end
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
......
......@@ -85,7 +85,7 @@ function c14816688.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)~=0
and tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) then
Duel.ShuffleDeck(tc:GetControler())
if tc:IsLocation(LOCATION_DECK) then Duel.ShuffleDeck(tc:GetControler()) end
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
......
......@@ -28,9 +28,9 @@ function c17183908.operation(e,tp,eg,ep,ev,re,r,rp)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=3 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==3 then
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
......
......@@ -22,14 +22,15 @@ function c24285858.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c24285858.tgfilter(c,e)
return not c:IsRelateToEffect(e)
end
function c24285858.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if tg:IsExists(c24285858.tgfilter,1,nil,e) then return end
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=3 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==3 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
......@@ -48,10 +48,13 @@ function c24694698.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c24694698.drop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g:FilterCount(Card.IsRelateToEffect,nil,e)==2 then
Duel.SendtoDeck(g,nil,0,REASON_EFFECT)
Duel.ShuffleDeck(tp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=2 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==2 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
......
......@@ -22,6 +22,6 @@ end
function c36039163.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_GRAVE,0)
if Duel.SendtoDeck(g,nil,0,REASON_EFFECT)~=0 then
Duel.ShuffleDeck(tp)
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
end
end
......@@ -23,15 +23,16 @@ function c37806313.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,1)
end
function c37806313.tgfilter(c,e)
return not c:IsRelateToEffect(e)
end
function c37806313.operation(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if tg:IsExists(c37806313.tgfilter,1,nil,e) then return end
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=2 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
Duel.Draw(1-tp,1,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==2 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
Duel.Draw(1-tp,1,REASON_EFFECT)
end
end
......@@ -22,14 +22,15 @@ function c3868277.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c3868277.tgfilter(c,e)
return not c:IsRelateToEffect(e)
end
function c3868277.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if tg:IsExists(c3868277.tgfilter,1,nil,e) then return end
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=3 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==3 then
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
end
......@@ -26,9 +26,8 @@ end
function c38815069.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
local ct=Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)
if ct>0 then
Duel.ShuffleDeck(tp)
if Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) then
if tc:IsLocation(LOCATION_DECK) then Duel.ShuffleDeck(tp) end
Duel.Draw(tp,1,REASON_EFFECT)
end
end
......
......@@ -29,9 +29,9 @@ function c54040221.op(e,tp,eg,ep,ev,re,r,rp)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=4 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==4 then
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
......
......@@ -30,9 +30,9 @@ function c55428811.activate(e,tp,eg,ep,ev,re,r,rp)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=5 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==5 then
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,e:GetLabel(),REASON_EFFECT)
end
......
......@@ -75,14 +75,15 @@ function c57690191.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c57690191.tgfilter(c,e)
return not c:IsRelateToEffect(e)
end
function c57690191.drop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if tg:IsExists(c57690191.tgfilter,1,nil,e) then return end
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=3 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==3 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
......@@ -55,16 +55,17 @@ function c581014.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,c581014.filter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c581014.tgfilter(c,e)
return not c:IsRelateToEffect(e)
end
function c581014.operation1(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if tg:IsExists(c581014.tgfilter,1,nil,e) then return end
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=3 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==3 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c581014.operation2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -35,9 +35,9 @@ function c63274863.operation(e,tp,eg,ep,ev,re,r,rp)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=5 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==5 then
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
......
......@@ -27,9 +27,9 @@ function c67169062.activate(e,tp,eg,ep,ev,re,r,rp)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=5 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==5 then
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
......
......@@ -71,17 +71,15 @@ function c69840739.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,PLAYER_ALL,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,1)
end
function c69840739.drfilter(c,tp)
return c:IsLocation(LOCATION_DECK) and c:GetPreviousControler()==tp
end
function c69840739.drop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,LOCATION_HAND)
if Duel.SendtoDeck(g,nil,0,REASON_EFFECT)~=0 then
Duel.ShuffleDeck(tp)
Duel.ShuffleDeck(1-tp)
local og=g:Filter(Card.IsLocation,nil,LOCATION_DECK)
if og:IsExists(Card.IsControler,1,nil,tp) then Duel.ShuffleDeck(tp) end
if og:IsExists(Card.IsControler,1,nil,1-tp) then Duel.ShuffleDeck(1-tp) end
Duel.BreakEffect()
local ct1=g:FilterCount(c69840739.drfilter,nil,tp)
local ct2=g:FilterCount(c69840739.drfilter,nil,1-tp)
local ct1=og:FilterCount(aux.FilterEqualFunction(Card.GetPreviousControler,tp),nil)
local ct2=og:FilterCount(aux.FilterEqualFunction(Card.GetPreviousControler,1-tp),nil)
Duel.Draw(tp,ct1,REASON_EFFECT)
Duel.Draw(1-tp,ct2,REASON_EFFECT)
end
......
......@@ -17,8 +17,9 @@ function c78706415.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,0x1e,0x1e)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
Duel.ShuffleDeck(tp)
Duel.ShuffleDeck(1-tp)
local tg=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_DECK)
if tg:IsExists(Card.IsControler,1,nil,tp) then Duel.ShuffleDeck(tp) end
if tg:IsExists(Card.IsControler,1,nil,1-tp) then Duel.ShuffleDeck(1-tp) end
Duel.BreakEffect()
Duel.Draw(tp,5,REASON_EFFECT)
Duel.Draw(1-tp,5,REASON_EFFECT)
......
......@@ -78,8 +78,8 @@ function c78949372.drop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=5 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
Duel.ShuffleDeck(tp)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==5 then
Duel.BreakEffect()
......
......@@ -27,9 +27,9 @@ function c82633308.activate(e,tp,eg,ep,ev,re,r,rp)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=3 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==3 then
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
......
......@@ -45,8 +45,10 @@ function c96598015.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=g:Select(tp,3,3,nil)
if sg:IsExists(Card.IsHasEffect,1,nil,EFFECT_NECRO_VALLEY) then return end
Duel.SendtoDeck(sg,nil,0,REASON_EFFECT)
Duel.ShuffleDeck(tp)
if sg:IsExists(Card.IsLocation,3,nil,LOCATION_DECK+LOCATION_EXTRA) then
local og=Duel.GetOperatedGroup()
if og:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=og:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==3 then
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
......
......@@ -55,9 +55,9 @@ function c98672567.activate(e,tp,eg,ep,ev,re,r,rp)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=3 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==3 then
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
......
......@@ -27,8 +27,8 @@ function c98954106.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if tg:FilterCount(Card.IsRelateToEffect,nil,e)~=5 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
Duel.ShuffleDeck(tp)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==5 then
Duel.BreakEffect()
......
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