Commit e5c6d1e9 authored by TanakaKotoha's avatar TanakaKotoha

fix count from ex

parent 806adae2
......@@ -20,9 +20,9 @@ function c26806010.descon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c26806010.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsAbleToRemove() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
......
--造神计划7 赤游鱼
function c33330107.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2,c33330107.lcheck)
aux.AddLinkProcedure(c,nil,2,99,c33330107.lcheck)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
......@@ -37,6 +37,7 @@ function c33330107.lcheck(g,lc)
return g:IsExists(Card.IsLinkRace,1,nil,RACE_AQUA)
end
function c33330107.disable(e,c)
local tp=e:GetHandlerPlayer()
local lg1=Duel.GetLinkedGroup(tp,1,1)
local lg2=Duel.GetLinkedGroup(1-tp,1,1)
lg1:Merge(lg2)
......@@ -62,13 +63,16 @@ function c33330107.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=lg:FilterSelect(tp,c33330107.relfil,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c33330107.spfil(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsRace(RACE_AQUA)
end
function c33330107.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCanBeSpecialSummoned,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,0,tp,false,false) end
if chk==0 then return Duel.IsExistingMatchingCard(c33330107.spfil,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_GRAVE)
end
function c33330107.cost(e,tp,eg,ep,ev,re,r,rp)
function c33330107.op(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<=0 then return end
local g=Duel.SelectMatchingCard(tp,Card.IsCanBeSpecialSummoned,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,0,tp,false,false)
local g=Duel.SelectMatchingCard(tp,c33330107.spfil,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
if g then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
......
......@@ -94,7 +94,7 @@ function c65020008.pcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_PZONE,0,1,e:GetHandler(),0x9da1)
end
function c65020008.pfilter(c,e,tp,scl1,scl2)
return c:IsSetCard(0x9da1) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetLevel()>scl1 and c:GetLevel()<scl2 and c:IsFaceup()
return c:IsSetCard(0x9da1) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetLevel()>scl1 and c:GetLevel()<scl2 and c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c65020008.ptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
......@@ -104,20 +104,20 @@ function c65020008.ptg(e,tp,eg,ep,ev,re,r,rp,chk)
local scl1=tc1:GetLeftScale()
local scl2=tc2:GetRightScale()
if scl1>scl2 then scl1,scl2=scl2,scl1 end
return Duel.IsExistingMatchingCard(c65020008.pfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,scl1,scl2) and Duel.GetLocationCountFromEx(tp)>0
return Duel.IsExistingMatchingCard(c65020008.pfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,scl1,scl2)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c65020008.pop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCountFromEx(tp)<=0 or not c:IsRelateToEffect(e) then return end
if not c:IsRelateToEffect(e) then return end
local tc1=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local tc2=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if not tc1 or not tc2 then return false end
local scl1=tc1:GetLeftScale()
local scl2=tc2:GetRightScale()
if scl1>scl2 then scl1,scl2=scl2,scl1 end
local num=Duel.GetLocationCountFromEx(tp)
local num=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
local num2=Duel.GetMatchingGroupCount(c65020008.pfilter,tp,LOCATION_EXTRA,0,nil,e,tp,scl1,scl2)
if num>num2 then num=num2 end
local g=Duel.SelectMatchingCard(tp,c65020008.pfilter,tp,LOCATION_EXTRA,0,num,num,nil,e,tp,scl1,scl2)
......
......@@ -48,7 +48,7 @@ function c65020011.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.Destroy(tc,REASON_EFFECT)~=0 and e:GetHandler():IsLocation(LOCATION_HAND+LOCATION_GRAVE) then
if Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) and Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) and Duel.GetLocationCountFromEx(tp,tp,e:GetHandler())>0 and Duel.IsExistingMatchingCard(c65020011.opfil,tp,LOCATION_MZONE,0,1,nil,tp) and Duel.SelectYesNo(tp,aux.Stringid(65020011,0)) then
if Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) and Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) and Duel.IsExistingMatchingCard(c65020011.opfil,tp,LOCATION_MZONE,0,1,nil,tp) and Duel.SelectYesNo(tp,aux.Stringid(65020011,0)) then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -54,11 +54,11 @@ function c65020067.cost(e,tp,eg,ep,ev,re,r,rp,chk)
c:RegisterFlagEffect(65020067,RESET_CHAIN,0,1)
end
function c65020067.xyzfilter2(c,mg)
return c:IsXyzSummonable(mg) and c:IsType(TYPE_XYZ)
return c:IsXyzSummonable(mg) and c:IsType(TYPE_XYZ) and Duel.GetLocationCountFromEx(tp,tp,mg,c)>0
end
function c65020067.xyzfilter1(c,tp)
return c:IsSetCard(0x9da3) and c:IsFaceup() and not c:IsType(TYPE_TOKEN) and Duel.GetLocationCountFromEx(tp,tp,c)>0
return c:IsSetCard(0x9da3) and c:IsFaceup() and not c:IsType(TYPE_TOKEN)
end
function c65020067.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
......
......@@ -53,12 +53,12 @@ function c65020068.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c:GetFlagEffect(65020068)==0 end
c:RegisterFlagEffect(65020068,RESET_CHAIN,0,1)
end
function c65020068.xyzfilter2(c,mg)
return c:IsXyzSummonable(mg) and c:IsType(TYPE_XYZ)
function c65020067.xyzfilter2(c,mg)
return c:IsXyzSummonable(mg) and c:IsType(TYPE_XYZ) and Duel.GetLocationCountFromEx(tp,tp,mg,c)>0
end
function c65020068.xyzfilter1(c,tp)
return c:IsSetCard(0x9da3) and c:IsFaceup() and not c:IsType(TYPE_TOKEN) and Duel.GetLocationCountFromEx(tp,tp,c)>0
function c65020067.xyzfilter1(c,tp)
return c:IsSetCard(0x9da3) and c:IsFaceup() and not c:IsType(TYPE_TOKEN)
end
function c65020068.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
......
......@@ -39,17 +39,16 @@ function c65020075.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c65020075.filter(c,e,tp)
return c:IsSetCard(0x9da3) and c:IsType(TYPE_XYZ) and not c:IsCode(65020075) and e:GetHandler():IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,e:GetHandler(),c)>0
end
function c65020075.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp,tp,e:GetHandler())>0
and aux.MustMaterialCheck(e:GetHandler(),tp,EFFECT_MUST_BE_XMATERIAL)
if chk==0 then return aux.MustMaterialCheck(e:GetHandler(),tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(c65020075.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c65020075.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCountFromEx(tp,tp,c)<=0 or not aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if not aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsControler(1-tp) or c:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c65020075.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c:GetRank()+1)
......@@ -74,23 +73,30 @@ function c65020075.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c65020075.desfilter(c)
return c:IsType(TYPE_TRAP) and c:IsFaceup()
function c65020075.desfilter(c,tp)
return c:IsType(TYPE_TRAP) and c:IsFaceup() and Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
end
function c65020075.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c65020075.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler())
and Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c65020075.desfilter,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
if chk==0 then return Duel.IsExistingTarget(c65020075.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g1=Duel.SelectTarget(tp,c65020075.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g2=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,g1)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,2,0,0)
end
function c65020075.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
local sg=g:Filter(Card.IsStatus,nil,STATUS_ACTIVATED)
if sg:GetCount()>0 then
local sc=sg:GetFirst()
while sc do
sc:CancelToGrave()
sc=sg:GetNext()
end
end
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
\ No newline at end of file
......@@ -64,7 +64,7 @@ function c65020147.sprcon(e,c)
return Duel.IsExistingMatchingCard(c65020147.sprfilter,tp,LOCATION_MZONE,0,2,nil,tp,c)
end
function c65020147.sprfilter(c,tp,fc)
return c:IsFusionType(TYPE_FLIP) and c:IsAbleToGraveAsCost() and c:IsCanBeFusionMaterial(fc) and Duel.GetLocationCountFromEx(tp,tp,c)>0
return c:IsFusionType(TYPE_FLIP) and c:IsAbleToGraveAsCost() and c:IsCanBeFusionMaterial(fc) and Duel.GetLocationCountFromEx(tp,tp,fc,c)>0
end
function c65020147.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......
......@@ -68,12 +68,11 @@ function c65020163.filter1(c,e,tp)
local rk=c:GetRank()
return c:IsFaceup() and c:IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(c65020163.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function c65020163.filter2(c,e,tp,mc,rk)
return c:IsRank(rk) and c:IsSetCard(0xcda8) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c65020163.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c65020163.filter1(e:GetHandler(),e,tp) and e:GetHandler():GetFlagEffect(65020163)==0 end
......@@ -82,7 +81,7 @@ function c65020163.target2(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c65020163.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler()
if Duel.GetLocationCountFromEx(tp,tp,tc)<=0 or not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c65020163.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank())
......
......@@ -64,7 +64,7 @@ function c65020164.filter1(c,e,tp)
end
function c65020164.filter2(c,e,tp,mc)
return c:IsCode(65020163) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and ((Duel.GetLocationCountFromEx(tp,tp,mc)>0 and c:IsLocation(LOCATION_EXTRA)) or (Duel.GetMZoneCount(tp,mc,tp)>0 and c:IsLocation(LOCATION_GRAVE)))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and ((Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsLocation(LOCATION_EXTRA)) or (Duel.GetMZoneCount(tp,mc,tp)>0 and c:IsLocation(LOCATION_GRAVE)))
end
function c65020164.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -75,7 +75,7 @@ function c65020164.activate(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT)
end
local tc=e:GetHandler()
if Duel.GetLocationCountFromEx(tp,tp,tc)<=0 or not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c65020164.filter2,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil,e,tp,tc)
......
......@@ -82,7 +82,7 @@ function c65020165.filter1(c,e,tp)
end
function c65020165.filter2(c,e,tp,mc)
return c:IsCode(65020163) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and ((Duel.GetLocationCountFromEx(tp,tp,mc)>0 and c:IsLocation(LOCATION_EXTRA)) or (Duel.GetMZoneCount(tp,mc,tp)>0 and c:IsLocation(LOCATION_GRAVE)))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and ((Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsLocation(LOCATION_EXTRA)) or (Duel.GetMZoneCount(tp,mc,tp)>0 and c:IsLocation(LOCATION_GRAVE)))
end
function c65020165.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -93,7 +93,7 @@ function c65020165.activate(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT)
end
local tc=e:GetHandler()
if Duel.GetLocationCountFromEx(tp,tp,tc)<=0 or not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c65020165.filter2,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil,e,tp,tc)
......
......@@ -53,7 +53,7 @@ function c65020166.filter1(c,e,tp)
end
function c65020166.filter2(c,e,tp,mc)
return c:IsCode(65020163) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and ((Duel.GetLocationCountFromEx(tp,tp,mc)>0 and c:IsLocation(LOCATION_EXTRA)) or (Duel.GetMZoneCount(tp,mc,tp)>0 and c:IsLocation(LOCATION_GRAVE)))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and ((Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsLocation(LOCATION_EXTRA)) or (Duel.GetMZoneCount(tp,mc,tp)>0 and c:IsLocation(LOCATION_GRAVE)))
end
function c65020166.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -64,7 +64,7 @@ function c65020166.activate(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT)
end
local tc=e:GetHandler()
if Duel.GetLocationCountFromEx(tp,tp,tc)<=0 or not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c65020166.filter2,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil,e,tp,tc)
......
......@@ -41,7 +41,7 @@ function c65020167.filter1(c,e,tp)
end
function c65020167.filter2(c,e,tp,mc)
return c:IsCode(65020163) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and ((Duel.GetLocationCountFromEx(tp,tp,mc)>0 and c:IsLocation(LOCATION_EXTRA)) or (Duel.GetMZoneCount(tp,mc,tp)>0 and c:IsLocation(LOCATION_GRAVE)))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and ((Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsLocation(LOCATION_EXTRA)) or (Duel.GetMZoneCount(tp,mc,tp)>0 and c:IsLocation(LOCATION_GRAVE)))
end
function c65020167.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -52,7 +52,7 @@ function c65020167.activate(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT)
end
local tc=e:GetHandler()
if Duel.GetLocationCountFromEx(tp,tp,tc)<=0 or not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c65020167.filter2,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil,e,tp,tc)
......
......@@ -32,14 +32,13 @@ function c65020171.accon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c65020171.acfil,1,nil,tp)
end
function c65020171.acsfil(c,e,tp)
return c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and c:IsSetCard(65020163)
return c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and c:IsSetCard(65020163) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c65020171.actg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65020171.acsfil,tp,LOCATION_EXTRA,0,1,nil,e,tp) and Duel.GetLocationCountFromEx(tp)>0 end
if chk==0 then return Duel.IsExistingMatchingCard(c65020171.acsfil,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c65020171.acop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<=0 then return end
local g=Duel.GetFirstMatchingCard(c65020171.acsfil,tp,LOCATION_EXTRA,0,nil,e,tp)
local tc=g:GetFirst()
if tc then
......
......@@ -113,10 +113,10 @@ function c65030010.spcon(e,tp,eg,ep,ev,re,r,rp)
and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c65030010.spfilter(c,e,tp)
return c:IsSetCard(0x6da1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsSetCard(0x6da1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c65030010.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65030010.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) and Duel.GetLocationCountFromEx(tp)>0 end
if chk==0 then return Duel.IsExistingMatchingCard(c65030010.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c65030010.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
......
......@@ -51,7 +51,7 @@ function c65030080.remfil(c,g)
return g:IsContains(c)
end
function c65030080.spfil(c,e,tp)
return c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)
end
function c65030080.op(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.GetMatchingGroupCount(Card.IsAbleToDeck,tp,LOCATION_EXTRA,0,nil)>0) then return end
......@@ -71,7 +71,7 @@ function c65030080.op(e,tp,eg,ep,ev,re,r,rp)
g:Remove(c65030080.remfil,nil,teg)
Duel.SendtoExtraP(teg,tp,REASON_EFFECT)
Duel.SendtoGrave(g,REASON_EFFECT)
if not (Duel.GetLocationCountFromEx(tp)>0 and Duel.IsPlayerCanSpecialSummon(tp)) then return end
if not Duel.IsPlayerCanSpecialSummon(tp) then return end
if Duel.IsExistingMatchingCard(c65030080.spfil,tp,LOCATION_EXTRA,0,1,nil,e,tp) then
local g=Duel.SelectMatchingCard(tp,c65030080.spfil,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
......
......@@ -41,7 +41,7 @@ function c65030086.cost(e,tp,eg,ep,ev,re,r,rp,chk)
c:RegisterFlagEffect(65030086,RESET_CHAIN,0,1)
end
function c65030086.tgfil(c,e,tp)
return ((c:IsLocation(LOCATION_HAND+LOCATION_GRAVE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or (c:IsLocation(LOCATION_EXTRA) and c:IsFaceup() and Duel.GetLocationCountFromEx(tp)>0)) and aux.IsCodeListed(c,65030086) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return ((c:IsLocation(LOCATION_HAND+LOCATION_GRAVE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or (c:IsLocation(LOCATION_EXTRA) and c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0)) and aux.IsCodeListed(c,65030086) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c65030086.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65030086.tgfil,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp) end
......
......@@ -13,10 +13,10 @@ end
function c65040031.tgfil(c,e,tp)
local code=c:GetOriginalCode()
local rk=c:GetOriginalRank()
return c:IsFaceup() and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) and c:IsType(TYPE_XYZ) and Duel.GetLocationCountFromEx(tp,tp,c)>0 and Duel.IsExistingMatchingCard(c65040031.xyzfil,tp,LOCATION_EXTRA,0,1,nil,e,tp,code,rk,c) and not c:IsImmuneToEffect(e)
return c:IsFaceup() and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) and c:IsType(TYPE_XYZ) and Duel.IsExistingMatchingCard(c65040031.xyzfil,tp,LOCATION_EXTRA,0,1,nil,e,tp,code,rk,c) and not c:IsImmuneToEffect(e)
end
function c65040031.xyzfil(c,e,tp,code,rk,matc)
return c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,true,false) and c:GetRank()>rk and c:IsCode(code) and matc:IsCanBeXyzMaterial(c)
return c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,true,false) and c:GetRank()>rk and c:IsCode(code) and matc:IsCanBeXyzMaterial(c) and Duel.GetLocationCountFromEx(tp,tp,matc,c)>0
end
function c65040031.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c65040031.tgfil(chkc,e,tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
......
......@@ -19,11 +19,10 @@ function c65050027.initial_effect(c)
c:RegisterEffect(e2)
end
function c65050027.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsType(TYPE_NORMAL) and c:IsFaceup()
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsType(TYPE_NORMAL) and c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c65050027.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(c65050027.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(c65050027.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c65050027.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -38,12 +38,11 @@ end
function c65050104.filter1(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(c65050104.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) and c:IsSetCard(0x3da8)
end
function c65050104.filter2(c,e,tp,mc)
return mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and c:IsSetCard(0x3da8)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and c:IsSetCard(0x3da8) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c65050104.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c65050104.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp)
......
......@@ -23,12 +23,11 @@ function c65050117.filter1(c,e,tp)
local rk=c:GetRank()
return c:IsFaceup() and c:IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(c65050117.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk+4)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) and c:IsSetCard(0x3da8)
end
function c65050117.filter2(c,e,tp,mc,rk)
return c:IsRank(rk) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and c:IsSetCard(0x3da8)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and c:IsSetCard(0x3da8) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c65050117.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c65050117.filter1(chkc,e,tp) end
......
......@@ -24,12 +24,11 @@ end
function c65050118.confil(c,e,tp)
local rk=c:GetRank()
return c:IsSetCard(0x3da8) and c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsControler(tp) and Duel.IsExistingMatchingCard(c65050118.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function c65050118.filter2(c,e,tp,mc,rk)
return c:GetRank()>rk and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and c:IsSetCard(0x3da8)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and c:IsSetCard(0x3da8) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c65050118.con2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c65050118.confil,1,nil,e,tp) and rp~=tp
......
......@@ -46,11 +46,10 @@ function c65050178.filter1(c,e,tp)
local rk=c:GetRank()
return c:IsSetCard(0x6da8) and c:IsFaceup() and c:IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(c65050178.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk+3)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function c65050178.filter2(c,e,tp,mc,rk)
return c:IsRank(rk) and c:IsSetCard(0x6da8) and mc:IsCanBeXyzMaterial(c)
return c:IsRank(rk) and c:IsSetCard(0x6da8) and mc:IsCanBeXyzMaterial(c) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c65050178.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -17,10 +17,10 @@ function c65050214.refil2(c)
return c:IsSetCard(0x9da8) and c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_TUNER) and c:IsAbleToRemove()
end
function c65050214.spfil(c,e,tp)
return c:IsSetCard(0x9da8) and c:IsType(TYPE_SYNCHRO) and c:IsLevel(6) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)
return c:IsSetCard(0x9da8) and c:IsType(TYPE_SYNCHRO) and c:IsLevel(6) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c65050214.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65050214.refil1,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(c65050214.refil2,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(c65050214.spfil,tp,LOCATION_EXTRA,0,1,nil,e,tp) and Duel.GetLocationCountFromEx(tp)>0 end
if chk==0 then return Duel.IsExistingMatchingCard(c65050214.refil1,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(c65050214.refil2,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(c65050214.spfil,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,2,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
......@@ -28,7 +28,7 @@ function c65050214.op(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.SelectMatchingCard(tp,c65050214.refil1,tp,LOCATION_GRAVE,0,1,1,nil)
local g2=Duel.SelectMatchingCard(tp,c65050214.refil2,tp,LOCATION_GRAVE,0,1,1,nil)
g1:Merge(g2)
if g1:GetCount()==2 and Duel.Remove(g1,POS_FACEUP,REASON_EFFECT)==2 and Duel.IsExistingMatchingCard(c65050214.spfil,tp,LOCATION_EXTRA,0,1,nil,e,tp) and Duel.GetLocationCountFromEx(tp)>0 then
if g1:GetCount()==2 and Duel.Remove(g1,POS_FACEUP,REASON_EFFECT)==2 and Duel.IsExistingMatchingCard(c65050214.spfil,tp,LOCATION_EXTRA,0,1,nil,e,tp) then
local sg=Duel.SelectMatchingCard(tp,c65050214.spfil,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
Duel.SpecialSummon(sg,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)
end
......
......@@ -52,7 +52,7 @@ function c65060007.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c65060007.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCountFromEx(tp)
local ft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_LINK)
local mt=Duel.GetMatchingGroupCount(c65060007.spfil,tp,LOCATION_EXTRA,0,nil,e,tp)
if mt>ft then mt=ft end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then mt=1 end
......
......@@ -64,7 +64,7 @@ function c65060008.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c65060008.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCountFromEx(tp)
local ft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_LINK)
local mt=Duel.GetMatchingGroupCount(c65060008.spfil,tp,LOCATION_EXTRA,0,nil,e,tp)
if mt>ft then mt=ft end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then mt=1 end
......
......@@ -50,7 +50,7 @@ function c65060009.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c65060009.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCountFromEx(tp)
local ft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_LINK)
local mt=Duel.GetMatchingGroupCount(c65060009.spfil,tp,LOCATION_EXTRA,0,nil,e,tp)
if mt>ft then mt=ft end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then mt=1 end
......
......@@ -103,7 +103,7 @@ function c65060010.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c65060010.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCountFromEx(tp)
local ft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_LINK)
local mt=Duel.GetMatchingGroupCount(c65060010.spfil,tp,LOCATION_EXTRA,0,nil,e,tp)
if mt>ft then mt=ft end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then mt=1 end
......
......@@ -79,7 +79,7 @@ function c65060011.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c65060011.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCountFromEx(tp)
local ft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_LINK)
local mt=Duel.GetMatchingGroupCount(c65060011.spfil,tp,LOCATION_EXTRA,0,nil,e,tp)
if mt>ft then mt=ft end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then mt=1 end
......
......@@ -79,10 +79,10 @@ function c81041003.ctop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e1)
end
function c81041003.rdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and e:GetHandler():IsLevelAbove(4) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
......
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