Commit f84635a8 authored by wind2009's avatar wind2009 Committed by GitHub

Fix attach xyz material effect (#2545)

* Facedown monster can get material

* Add Card.IsCanOverlay

* Add Card.IsCanOverlay

* Fix 超量機獣

* Fix 超量機艦マグナキャリア
parent 58cecbcb
......@@ -67,7 +67,7 @@ function c10424147.spop1(e,tp,eg,ep,ev,re,r,rp)
end
end
function c10424147.spfilter3(c,e)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsSetCard(0x20dc) and c:IsType(TYPE_XYZ) and c:IsCanBeEffectTarget(e)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsSetCard(0x20dc) and c:IsType(TYPE_XYZ) and c:IsCanBeEffectTarget(e) and c:IsCanOverlay()
end
function c10424147.spfilter4(c,e,tp)
return c:IsCode(84025439) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
......@@ -87,7 +87,7 @@ function c10424147.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c10424147.mtfilter(c,e)
return c:IsRelateToEffect(e) and not c:IsImmuneToEffect(e)
return c:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) and tc:IsCanOverlay()
end
function c10424147.spop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -129,7 +129,7 @@ function c11221418.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local mc=Duel.GetFirstTarget()
if tc:GetFlagEffect(11221418)~=0 and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
if mc and mc:IsRelateToEffect(e) then
if mc and mc:IsRelateToEffect(e) and mc:IsCanOverlay() then
Duel.Overlay(tc,Group.FromCards(mc))
end
end
......
......@@ -69,10 +69,13 @@ function c11510448.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,c11510448.filter2,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function c11510448.opfilter(c)
return c:IsLocation(LOCATION_GRAVE) and c:IsCanOverlay()
end
function c11510448.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local tc1=g:Filter(Card.IsLocation,nil,LOCATION_MZONE):GetFirst()
local g2=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
local g2=g:Filter(c11510448.opfilter,nil)
if tc1 and tc1:IsFaceup() and not tc1:IsImmuneToEffect(e) and g2:GetCount()>0 then
Duel.Overlay(tc1,g2)
end
......
......@@ -77,10 +77,14 @@ function c11646785.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c11646785.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,c11646785.mtfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,e)
if g:GetCount()>0 then
local mg=g:GetFirst():GetOverlayGroup()
if mg:GetCount()>0 then
Duel.SendtoGrave(mg,REASON_RULE)
end
Duel.Overlay(c,g)
end
end
......@@ -75,7 +75,7 @@ end
function c12615446.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsCanOverlay() then
Duel.Overlay(c,tc)
end
end
......@@ -38,7 +38,7 @@ end
function c12744567.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) and not tc:IsImmuneToEffect(e) then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
......
......@@ -33,7 +33,7 @@ function c14602126.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local lc=tg:GetFirst()
if lc==tc then lc=tg:GetNext() end
if tc:IsRelateToEffect(e) and tc:IsControler(tp) and not tc:IsImmuneToEffect(e) and lc:IsRelateToEffect(e) and lc:IsControler(1-tp) and not lc:IsImmuneToEffect(e) then
if tc:IsRelateToEffect(e) and tc:IsControler(tp) and not tc:IsImmuneToEffect(e) and lc:IsRelateToEffect(e) and lc:IsControler(1-tp) and lc:IsType(TYPE_MONSTER) and not lc:IsImmuneToEffect(e) then
local og=lc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
......
......@@ -70,7 +70,7 @@ function c15092394.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
if c:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
if c:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and c:IsCanOverlay() then
Duel.Overlay(tc,Group.FromCards(c))
end
end
......
......@@ -59,7 +59,7 @@ function c18678554.matop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.GetFieldGroup(tp,0,LOCATION_GRAVE)
if aux.NecroValleyNegateCheck(g) then return end
local tg=g:Select(tp,1,1,nil)
local tg=g:FilterSelect(tp,Card.IsCanOverlay,1,1,nil)
if #tg>0 then
Duel.Overlay(tc,tg)
end
......
......@@ -35,6 +35,9 @@ end
function c19272658.ovfilter(c)
return c:IsType(TYPE_XYZ) and c:IsFaceup()
end
function c19272658.ovfilter2(c)
return c:IsType(TYPE_MONSTER) and c:IsCanOverlay()
end
function c19272658.ovtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c19272658.ovfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c19272658.ovfilter,tp,LOCATION_MZONE,0,1,nil)
......@@ -45,8 +48,8 @@ function c19272658.ovtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c19272658.ovop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(Card.IsType),tp,0,LOCATION_GRAVE,nil,TYPE_MONSTER)
if tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsImmuneToEffect(e) and g:GetCount()>0 then
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c19272658.ovfilter2),tp,0,LOCATION_GRAVE,nil)
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg=g:Select(tp,1,1,nil)
Duel.Overlay(tc,sg)
......
......@@ -29,10 +29,13 @@ function c19310321.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g2=Duel.SelectTarget(tp,c19310321.filter2,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g2,2,0,0)
end
function c19310321.ovfilter(c,e)
return c:IsRelateToEffect(e) and c:IsCanOverlay()
end
function c19310321.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,tc,e)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c19310321.ovfilter,tc,e)
if g:GetCount()>0 then
Duel.Overlay(tc,g)
end
......
......@@ -59,10 +59,13 @@ function c1992816.oltg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,c1992816.matfilter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,2,0,0)
end
function c1992816.olfilter(c,e)
return c:IsRelateToEffect(e) and c:IsCanOverlay()
end
function c1992816.olop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c1992816.olfilter,nil,e)
if g:GetCount()>0 then
Duel.Overlay(c,g)
end
......
......@@ -58,7 +58,7 @@ end
function c20424878.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) then
if c:IsRelateToEffect(e) and c:IsCanOverlay() and tc:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) then
local og=c:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
......
......@@ -44,7 +44,7 @@ end
function c23689428.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and c:IsRelateToEffect(e) then
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and c:IsRelateToEffect(e) and c:IsCanOverlay() then
Duel.Overlay(tc,Group.FromCards(c))
end
end
......
......@@ -53,9 +53,12 @@ function s.gmattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,s.gmattgfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,2,nil,c)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,#g,0,0)
end
function s.gmafilter(c,e)
return not c:IsImmuneToEffect(e) and c:IsCanOverlay()
end
function s.gmatop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetTargetsRelateToChain():Filter(aux.NOT(Card.IsImmuneToEffect),nil,e)
local g=Duel.GetTargetsRelateToChain():Filter(s.gmafilter,nil,e)
if c:IsRelateToChain() and #g>0 then
Duel.Overlay(c,g)
end
......@@ -72,7 +75,7 @@ end
function s.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=re:GetHandler()
if c:IsRelateToChain() and tc:IsRelateToChain() and not tc:IsImmuneToEffect(e) then
if c:IsRelateToChain() and tc:IsRelateToChain() and tc:IsCanOverlay() and not tc:IsImmuneToEffect(e) then
tc:CancelToGrave()
Duel.Overlay(c,tc)
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp)
......
......@@ -76,7 +76,7 @@ end
function c24701066.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsCanOverlay() then
Duel.Overlay(c,tc)
end
end
......
......@@ -65,7 +65,7 @@ function s.sptgexfilter(c,e,tp,code)
and c:IsType(TYPE_XYZ) and sc:IsCanBeXyzMaterial(c) and Duel.GetLocationCountFromEx(tp,tp,sc,c)>0
end
function s.sptgfilter(c,e,tp)
return not c:IsPublic() and c:IsType(TYPE_QUICKPLAY) and c:IsSetCard(0x18c)
return not c:IsPublic() and c:IsType(TYPE_QUICKPLAY) and c:IsSetCard(0x18c) and c:IsCanOverlay()
and Duel.IsExistingMatchingCard(s.sptgexfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetCode())
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -89,5 +89,5 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Overlay(tc,Group.FromCards(c))
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
if not sc:IsImmuneToEffect(e) then Duel.Overlay(tc,g) end
if not sc:IsImmuneToEffect(e) and sc:IsCanOverlay() then Duel.Overlay(tc,g) end
end
......@@ -63,7 +63,7 @@ function c2609443.atkop(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(math.ceil(atk/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
ac:RegisterEffect(e1)
if not ac:IsHasEffect(EFFECT_REVERSE_UPDATE) and e:GetHandler():IsRelateToEffect(e) then
if not ac:IsHasEffect(EFFECT_REVERSE_UPDATE) and e:GetHandler():IsRelateToEffect(e) and tc:IsCanOverlay() then
Duel.BreakEffect()
Duel.Overlay(e:GetHandler(),tc)
end
......
......@@ -26,7 +26,7 @@ end
function c26708437.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 and c:IsRelateToEffect(e) then
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 and c:IsRelateToEffect(e) and c:IsCanOverlay() then
c:CancelToGrave()
Duel.Overlay(tc,Group.FromCards(c))
end
......
......@@ -32,7 +32,7 @@ end
function c27068117.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsImmuneToEffect(e) and c:IsRelateToEffect(e) then
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and c:IsRelateToEffect(e) then
c:CancelToGrave()
Duel.Overlay(tc,Group.FromCards(c))
end
......
......@@ -38,7 +38,7 @@ end
function c28770951.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
if c:IsRelateToEffect(e) and c:IsCanOverlay() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Overlay(tc,Group.FromCards(c))
end
end
......
......@@ -66,7 +66,7 @@ end
function s.xop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and tc:IsCanOverlay() then
tc:CancelToGrave()
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
......
......@@ -52,7 +52,7 @@ end
function c29601381.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) and c:IsCanOverlay() then
local og=c:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
......
......@@ -73,7 +73,7 @@ function s.xyzop(e,tp,eg,ep,ev,re,r,rp)
if #g~=2 then return end
local tc1=e:GetLabelObject()
local tc2=g:Filter(Card.IsControler,tc1,1-tp):GetFirst()
if tc1:IsType(TYPE_XYZ) and not tc1:IsImmuneToEffect(e) and tc2 and not tc2:IsImmuneToEffect(e) then
if tc1:IsType(TYPE_XYZ) and tc1:IsFaceup() and not tc1:IsImmuneToEffect(e) and tc2 and not tc2:IsImmuneToEffect(e) and tc2:IsControler(1-tp) and tc2:IsType(TYPE_MONSTER) then
local og=tc2:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
......
......@@ -35,7 +35,7 @@ end
function c31755044.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and c:IsCanOverlay() then
Duel.Overlay(tc,Group.FromCards(c))
end
end
......
......@@ -75,7 +75,7 @@ function c32245230.spop(e,tp,eg,ep,ev,re,r,rp)
sc:SetMaterial(nil)
if Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)~=0 then
sc:CompleteProcedure()
if c:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and c:IsCanOverlay() then
Duel.Overlay(sc,Group.FromCards(c))
end
end
......
......@@ -45,7 +45,7 @@ end
function c32559361.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToBattle() and not tc:IsImmuneToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToBattle() and tc:IsType(TYPE_MONSTER) and not tc:IsImmuneToEffect(e) and tc:IsCanOverlay() then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
......
......@@ -70,7 +70,7 @@ function c34721681.posop(e,tp,eg,ep,ev,re,r,rp)
if opt==0 then
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
else
if c:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
if c:IsRelateToEffect(e) and c:IsCanOverlay() and not tc:IsImmuneToEffect(e) then
Duel.Overlay(tc,c)
end
end
......
......@@ -39,7 +39,7 @@ function c34876719.ovcost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c34876719.ovfilter(c,sc)
local no=aux.GetXyzNumber(c)
return no and no>=101 and no<=107 and c:IsSetCard(0x48) and c:IsType(TYPE_XYZ) and c:IsCanBeXyzMaterial(sc)
return no and no>=101 and no<=107 and c:IsSetCard(0x48) and c:IsType(TYPE_XYZ) and c:IsCanBeXyzMaterial(sc) and c:IsCanOverlay()
end
function c34876719.ovtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c34876719.ovfilter,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
......
......@@ -46,7 +46,7 @@ function c39030163.mttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetTargetCard(tg)
end
function c39030163.matfilter(c,e)
return c:IsRelateToEffect(e) and not c:IsImmuneToEffect(e)
return c:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) and c:IsCanOverlay()
end
function c39030163.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -50,7 +50,7 @@ end
function c39943352.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc:IsImmuneToEffect(e) and tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) then
if not tc:IsImmuneToEffect(e) and tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and c:IsCanOverlay() then
Duel.Overlay(tc,Group.FromCards(c))
end
end
......
......@@ -29,11 +29,13 @@ function c43841694.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g2=Duel.SelectTarget(tp,c43841694.filter2,tp,LOCATION_REMOVED,0,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,1,0,0)
end
function c43841694.ovfilter(c,e)
return c:IsRelateToEffect(e) and c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL) and c:IsCanOverlay()
end
function c43841694.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
local tc=e:GetLabelObject()
sg:RemoveCard(tc)
local sg=g:Filter(c43841694.ovfilter,tc,e)
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.BreakEffect()
if sg:GetCount()>0 then
......
......@@ -74,7 +74,7 @@ end
function c46060017.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsImmuneToEffect(e) then
if c:IsRelateToEffect(e) and c:IsCanOverlay() and tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsImmuneToEffect(e) then
Duel.Overlay(tc,Group.FromCards(c))
end
end
......@@ -53,7 +53,7 @@ function c46261704.spop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(c46261704.mfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if Duel.ChangeAttackTarget(tc) and mg:GetCount()>0
and c:IsRelateToChain() and c:IsLocation(LOCATION_GRAVE) and aux.NecroValleyFilter()(c)
and Duel.SelectYesNo(tp,aux.Stringid(46261704,2)) then
and c:IsCanOverlay() and Duel.SelectYesNo(tp,aux.Stringid(46261704,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local sc=mg:Select(tp,1,1,nil):GetFirst()
......
......@@ -51,7 +51,7 @@ end
function c46576366.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) and not tc:IsImmuneToEffect(e) then
if c:IsRelateToEffect(e) and c:IsCanOverlay() and tc:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Overlay(tc,Group.FromCards(c))
end
end
......@@ -71,10 +71,13 @@ function c4820694.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g2=Duel.SelectTarget(tp,c4820694.mfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g2,1,0,0)
end
function c4820694.matfilter(c,e)
return c:IsRelateToEffect(e) and c:IsCanOverlay()
end
function c4820694.matop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,tc,e)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c4820694.matfilter,tc,e)
if g:GetCount()>0 then
Duel.Overlay(tc,g)
end
......
......@@ -40,7 +40,7 @@ end
function c48739166.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and tc:IsType(TYPE_MONSTER) and tc:IsCanOverlay() then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
......
......@@ -45,7 +45,7 @@ function c49033797.activate(e,tp,eg,ep,ev,re,r,rp)
if sc then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and c:IsCanOverlay() then
c:CancelToGrave()
Duel.Overlay(sc,Group.FromCards(c))
end
......
......@@ -74,7 +74,7 @@ end
function s.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=re:GetHandler()
if c:IsRelateToChain() and tc:IsRelateToChain() and not tc:IsImmuneToEffect(e) then
if c:IsRelateToChain() and tc:IsRelateToChain() and not tc:IsImmuneToEffect(e) and tc:IsCanOverlay() then
tc:CancelToGrave()
Duel.Overlay(c,tc)
if Duel.IsExistingMatchingCard(s.rthfilter,tp,0,LOCATION_ONFIELD,1,nil)
......
......@@ -72,7 +72,7 @@ function c53334641.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c53334641.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,c53334641.mtfilter,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
......
......@@ -34,8 +34,13 @@ function c55285840.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetDecktopGroup(1-tp,1)
if c:IsRelateToEffect(e) and g:GetCount()==1 then
local tc=g:GetFirst()
Duel.DisableShuffleCheck()
Duel.Overlay(c,g)
if tc:IsCanOverlay() then
Duel.Overlay(c,g)
else
Duel.SendtoGrave(g,REASON_RULE)
end
end
end
function c55285840.tgfilter(c)
......
......@@ -61,7 +61,7 @@ function c55470553.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0
and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and tc:IsType(TYPE_MONSTER) and tc:IsCanOverlay() then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
......
......@@ -59,7 +59,7 @@ end
function c56818977.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) and c:IsCanOverlay() then
local og=c:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
......
......@@ -74,10 +74,14 @@ function c57031794.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c57031794.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,c57031794.mtfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,e)
if g:GetCount()>0 then
local mg=g:GetFirst():GetOverlayGroup()
if mg:GetCount()>0 then
Duel.SendtoGrave(mg,REASON_RULE)
end
Duel.Overlay(c,g)
end
end
......@@ -85,10 +85,14 @@ function c57450198.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c57450198.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,c57450198.mtfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,e)
if g:GetCount()>0 then
local mg=g:GetFirst():GetOverlayGroup()
if mg:GetCount()>0 then
Duel.SendtoGrave(mg,REASON_RULE)
end
Duel.Overlay(c,g)
end
end
......@@ -64,7 +64,7 @@ function c5916510.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0
and tc:IsRelateToEffect(e) and tc:IsFaceup() then
and tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) then
Duel.Overlay(c,Group.FromCards(tc))
end
end
......@@ -66,7 +66,7 @@ end
function c60195675.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsCanOverlay() then
Duel.Overlay(c,tc)
end
end
......
......@@ -58,7 +58,7 @@ function c60944809.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c60944809.matop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
if tc and tc:IsType(TYPE_MONSTER) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,Card.IsCanOverlay,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
......
......@@ -90,7 +90,7 @@ end
function c60954556.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsCanOverlay() then
Duel.Overlay(c,Group.FromCards(tc))
end
end
......@@ -59,7 +59,7 @@ end
function c67436768.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) and c:IsCanOverlay() then
local og=c:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
......
......@@ -106,7 +106,7 @@ end
function c67865534.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsCanOverlay() then
Duel.Overlay(c,Group.FromCards(tc))
end
end
......@@ -60,7 +60,7 @@ function c68250822.operation1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c68250822.filter1,tp,LOCATION_MZONE,0,1,1,tc)
if #g==0 then return end
local tc2=g:GetFirst()
if not tc:IsImmuneToEffect(e) and not tc2:IsImmuneToEffect(e) then
if not tc:IsImmuneToEffect(e) and not tc2:IsImmuneToEffect(e) and tc:IsCanOverlay() then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
......
......@@ -55,7 +55,7 @@ function c69073023.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
if tc==hc then tc=g:GetNext() end
if hc:IsRelateToEffect(e) and Duel.SpecialSummon(hc,0,tp,tp,false,false,POS_FACEUP)>0 then
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and tc:IsControler(1-tp) and tc:IsCanOverlay() then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
......
......@@ -60,28 +60,47 @@ function c69757518.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function c69757518.tdfilter(c)
return c:IsAbleToDeck() or c:IsCanOverlay()
function c69757518.tdfilter(c,e)
return c:IsCanBeEffectTarget(e) and (c:IsAbleToDeck() or c:IsCanOverlay())
end
function c69757518.gcheck(g)
return g:IsExists(Card.IsCanOverlay,1,nil)
end
function c69757518.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ)
and Duel.IsExistingTarget(c69757518.tdfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,2,nil) end
local g=Duel.GetMatchingGroup(c69757518.tdfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and g:CheckSubGroup(c69757518.gcheck,2,2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c69757518.tdfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,2,0,0)
local sg=g:SelectSubGroup(tp,c69757518.gcheck,false,2,2)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,sg,2,0,0)
end
function c69757518.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg1=sg:Select(tp,1,1,nil)
if sg:GetCount()==1 then
Duel.HintSelection(sg)
Duel.SendtoDeck(sg,nil,SEQ_DECKTOP,REASON_EFFECT)
elseif sg:GetCount()>1 then
local og=sg:Filter(Card.IsCanOverlay,nil)
local sg1=nil
if og:GetCount()==0 then
return
elseif og:GetCount()==1 then
sg1=sg-og
elseif og:GetCount()==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
sg1=sg:Select(tp,1,1,nil)
end
local c=e:GetHandler()
Duel.HintSelection(sg1)
if Duel.SendtoDeck(sg1,nil,SEQ_DECKTOP,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
sg:Sub(sg1)
Duel.Overlay(c,sg)
local sc=sg:GetFirst()
if sc:IsCanOverlay() then
Duel.Overlay(c,sg)
end
end
end
end
......@@ -62,7 +62,7 @@ function c69809989.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c69809989.matop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c69809989.mfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
......
......@@ -79,6 +79,7 @@ function c70597485.thop(e,tp,eg,ep,ev,re,r,rp)
local tg=g:FilterSelect(tp,Card.IsAbleToHand,1,1,nil)
if tg:GetCount()>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
end
......@@ -61,7 +61,7 @@ end
function c71166481.xop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and c:IsCanOverlay() then
local mg=c:GetOverlayGroup()
if mg:GetCount()>0 then Duel.Overlay(tc,mg,false) end
Duel.Overlay(tc,Group.FromCards(c))
......
......@@ -25,7 +25,7 @@ end
function c72502414.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and c:IsCanOverlay() then
Duel.Overlay(tc,Group.FromCards(c))
end
end
......@@ -37,7 +37,7 @@ function c73881652.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c73881652.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
if tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,c73881652.matfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
......
......@@ -32,10 +32,10 @@ function c74852810.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc2=g:GetFirst()
if tc1==tc2 then tc2=g:GetNext() end
if tc1:IsFacedown() or not tc1:IsRelateToEffect(e) then return end
if not tc1:IsControler(1-tp) or not tc1:IsRelateToEffect(e) then return end
local og=tc1:GetOverlayGroup()
if og:GetCount()==0 then return end
if Duel.SendtoGrave(og,REASON_EFFECT)~=0 and tc2:IsFaceup() and tc2:IsRelateToEffect(e) and c:IsRelateToEffect(e) then
if Duel.SendtoGrave(og,REASON_EFFECT)~=0 and tc2:IsControler(tp) and tc2:IsRelateToEffect(e) and c:IsRelateToEffect(e) and c:IsCanOverlay() then
c:CancelToGrave()
Duel.Overlay(tc2,Group.FromCards(c))
end
......
......@@ -31,7 +31,7 @@ function c76587747.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and rc:IsRelateToEffect(re) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,c76587747.cfilter2,tp,LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 and not g:GetFirst():IsImmuneToEffect(e) then
if g:GetCount()>0 and not g:GetFirst():IsImmuneToEffect(e) and rc:IsCanOverlay() then
rc:CancelToGrave()
Duel.Overlay(g:GetFirst(),Group.FromCards(rc))
end
......
......@@ -73,7 +73,7 @@ function c78876707.spop(e,tp,eg,ep,ev,re,r,rp)
tc:SetMaterial(nil)
if Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)>0 then
tc:CompleteProcedure()
if c:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and c:IsCanOverlay() then
Duel.Overlay(tc,Group.FromCards(c))
end
end
......
......@@ -38,7 +38,7 @@ end
function c79094383.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
if c:IsRelateToEffect(e) and c:IsCanOverlay() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Overlay(tc,Group.FromCards(c))
end
end
......
......@@ -48,7 +48,7 @@ function s.sptgexfilter(c,e,tp,code)
and c:IsType(TYPE_XYZ) and sc:IsCanBeXyzMaterial(c) and Duel.GetLocationCountFromEx(tp,tp,sc,c)>0
end
function s.sptgfilter(c,e,tp)
return c:IsType(TYPE_QUICKPLAY) and c:IsSetCard(0x18c)
return c:IsType(TYPE_QUICKPLAY) and c:IsSetCard(0x18c) and c:IsCanOverlay()
and Duel.IsExistingMatchingCard(s.sptgexfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetCode())
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......@@ -74,5 +74,5 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Overlay(tc,c)
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
if not sc:IsImmuneToEffect(e) then Duel.Overlay(tc,sc) end
if not sc:IsImmuneToEffect(e) and sc:IsCanOverlay() then Duel.Overlay(tc,sc) end
end
......@@ -38,7 +38,7 @@ end
function c83203672.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) and c:IsCanOverlay() then
local og=c:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
......
......@@ -48,6 +48,10 @@ function c83319610.mtop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,c83319610.filter2,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,tc,e)
if g:GetCount()>0 then
local mg=g:GetFirst():GetOverlayGroup()
if mg:GetCount()>0 then
Duel.SendtoGrave(mg,REASON_RULE)
end
Duel.Overlay(tc,g)
end
end
......
......@@ -65,7 +65,7 @@ function c83888009.activate(e,tp,eg,ep,ev,re,r,rp)
end
function c83888009.ovfilter(c)
local no=aux.GetXyzNumber(c)
return no and no>=101 and no<=107 and c:IsType(TYPE_XYZ) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
return no and no>=101 and no<=107 and c:IsType(TYPE_XYZ) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsCanOverlay()
end
function c83888009.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,83888009)
......
......@@ -77,10 +77,14 @@ function c85252081.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c85252081.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,c85252081.mtfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,e)
if g:GetCount()>0 then
local mg=g:GetFirst():GetOverlayGroup()
if mg:GetCount()>0 then
Duel.SendtoGrave(mg,REASON_RULE)
end
Duel.Overlay(c,g)
end
end
......@@ -70,7 +70,7 @@ end
function c8696773.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsCanOverlay() then
Duel.Overlay(c,Group.FromCards(tc))
end
end
......@@ -59,7 +59,7 @@ end
function c8809344.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsCanOverlay() then
local og=c:GetOverlayGroup()
if og:GetCount()==0 then return end
Duel.SendtoGrave(og,REASON_EFFECT)
......
......@@ -68,7 +68,7 @@ end
function c90126061.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsCanOverlay() then
Duel.Overlay(c,Group.FromCards(tc))
end
end
......
......@@ -82,7 +82,7 @@ end
function c92015800.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:RemoveOverlayCard(tp,1,1,REASON_EFFECT) and tc:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and c:RemoveOverlayCard(tp,1,1,REASON_EFFECT) and tc:IsRelateToEffect(e) and tc:IsCanOverlay() then
Duel.Overlay(c,Group.FromCards(tc))
end
end
......@@ -48,7 +48,7 @@ function c9349094.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
if tc and tc:IsRelateToEffect(e) and tc:IsCanOverlay() then
Duel.Overlay(c,Group.FromCards(tc))
end
end
......
......@@ -74,7 +74,8 @@ function c96142517.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c96142517.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,rk+1,tg)
local sc=g:GetFirst()
if sc then
Duel.Overlay(sc,mg)
local og=mg:Filter(Card.IsCanOverlay,nil)
Duel.Overlay(sc,og)
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -74,7 +74,7 @@ end
function c97584719.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsCanOverlay() then
Duel.Overlay(c,tc)
end
end
......
......@@ -70,7 +70,7 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp)
end
function s.matcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and rp==tp
and re:IsActiveType(TYPE_QUICKPLAY) and re:GetHandler():IsSetCard(0x18c)
and re:IsActiveType(TYPE_QUICKPLAY) and re:GetHandler():IsSetCard(0x18c) and re:GetHandler():IsCanOverlay()
end
function s.mattg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return re:GetHandler():IsCanOverlay() end
......@@ -80,7 +80,7 @@ end
function s.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=re:GetHandler()
if c:IsRelateToChain() and tc:IsRelateToChain() and not tc:IsImmuneToEffect(e) then
if c:IsRelateToChain() and tc:IsRelateToChain() and not tc:IsImmuneToEffect(e) and tc:IsCanOverlay() then
tc:CancelToGrave()
Duel.Overlay(c,tc)
if Duel.IsExistingMatchingCard(Card.IsCanChangePosition,tp,0,LOCATION_MZONE,1,nil)
......
......@@ -23,7 +23,7 @@ end
function c99397762.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and c:IsRelateToEffect(e) then
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and c:IsRelateToEffect(e) and c:IsCanOverlay() then
c:CancelToGrave()
Duel.Overlay(tc,Group.FromCards(c))
--
......
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