Commit ecb7c4b9 authored by VanillaSalt's avatar VanillaSalt

fix

parent c39725ce
...@@ -12,8 +12,9 @@ function c92365601.initial_effect(c) ...@@ -12,8 +12,9 @@ function c92365601.initial_effect(c)
end end
function c92365601.filter1(c,e,tp) function c92365601.filter1(c,e,tp)
local rk=c:GetRank() local rk=c:GetRank()
return c:IsFaceup() and c:IsType(TYPE_XYZ) and rk==4 return c:IsFaceup() and c:IsType(TYPE_XYZ) and rk==4
and Duel.IsExistingMatchingCard(c92365601.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk+1) and Duel.IsExistingMatchingCard(c92365601.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk+1)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
end end
function c92365601.filter2(c,e,tp,mc,rk) function c92365601.filter2(c,e,tp,mc,rk)
if c:GetOriginalCode()==6165656 and not mc:IsCode(48995978) then return false end if c:GetOriginalCode()==6165656 and not mc:IsCode(48995978) then return false end
...@@ -22,15 +23,14 @@ function c92365601.filter2(c,e,tp,mc,rk) ...@@ -22,15 +23,14 @@ function c92365601.filter2(c,e,tp,mc,rk)
end end
function c92365601.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c92365601.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c92365601.filter1(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c92365601.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 if chk==0 then return Duel.IsExistingTarget(c92365601.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
and Duel.IsExistingTarget(c92365601.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c92365601.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp) Duel.SelectTarget(tp,c92365601.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c92365601.activate(e,tp,eg,ep,ev,re,r,rp) function c92365601.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.GetLocationCountFromEx(tp,tp,tc)<=0 then return end
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) 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) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c92365601.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+1) local g=Duel.SelectMatchingCard(tp,c92365601.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+1)
......
...@@ -15,20 +15,22 @@ end ...@@ -15,20 +15,22 @@ end
function c92572371.cfilter(c) function c92572371.cfilter(c)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and (c:IsSetCard(0x79) or c:IsSetCard(0x7c)) and c:IsAbleToGraveAsCost() return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and (c:IsSetCard(0x79) or c:IsSetCard(0x7c)) and c:IsAbleToGraveAsCost()
end end
function c92572371.mzfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5
end
function c92572371.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c92572371.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft+1 local ct=-ft+1
local sg=Duel.GetMatchingGroup(c92572371.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil) local sg=Duel.GetMatchingGroup(c92572371.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
if chk==0 then return sg:GetCount()>=2 if chk==0 then return sg:GetCount()>=2
and (ft>0 or (ct<3 and sg:IsExists(Card.IsLocation,ct,nil,LOCATION_MZONE))) end and (ft>0 or (ct<3 and sg:IsExists(c92572371.mzfilter,ct,nil))) end
local g=nil local g=nil
if ft<=0 then if ft<=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
g=sg:FilterSelect(tp,Card.IsLocation,ct,ct,nil,LOCATION_MZONE) g=sg:FilterSelect(tp,c92572371.mzfilter,ct,ct,nil)
if ct<2 then if ct<2 then
sg:Sub(g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=sg:Select(tp,2-ct,2-ct,nil) local g1=sg:Select(tp,2-ct,2-ct,g)
g:Merge(g1) g:Merge(g1)
end end
else else
......
...@@ -21,6 +21,7 @@ function c93600443.filter(c,e,tp) ...@@ -21,6 +21,7 @@ function c93600443.filter(c,e,tp)
local att=c:GetAttribute() local att=c:GetAttribute()
return lv>0 and c:IsFaceup() return lv>0 and c:IsFaceup()
and Duel.IsExistingMatchingCard(c93600443.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,lv,att) and Duel.IsExistingMatchingCard(c93600443.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,lv,att)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
end end
function c93600443.spfilter(c,e,tp,lv,att) function c93600443.spfilter(c,e,tp,lv,att)
return c:IsSetCard(0xa008) and c:GetLevel()>lv and c:IsAttribute(att) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) return c:IsSetCard(0xa008) and c:GetLevel()>lv and c:IsAttribute(att) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
...@@ -41,8 +42,8 @@ function c93600443.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -41,8 +42,8 @@ function c93600443.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:SetLabelObject(g:GetFirst()) e:SetLabelObject(g:GetFirst())
end end
function c93600443.activate(e,tp,eg,ep,ev,re,r,rp) function c93600443.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.GetLocationCountFromEx(tp,tp,tc)<=0 then return end
if not tc:IsRelateToEffect(e) then return end if not tc:IsRelateToEffect(e) then return end
local att=tc:GetAttribute() local att=tc:GetAttribute()
local lv=tc:GetLevel() local lv=tc:GetLevel()
......
...@@ -24,49 +24,58 @@ function c94160895.initial_effect(c) ...@@ -24,49 +24,58 @@ function c94160895.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c94160895.desfilter(c) function c94160895.desfilter(c)
return c:IsType(TYPE_MONSTER) and ((c:IsLocation(LOCATION_MZONE) and c:IsFaceup()) or c:IsLocation(LOCATION_HAND)) return c:IsType(TYPE_MONSTER) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup())
end
function c94160895.desfilter2(c)
return c:IsFaceup() and c:GetSequence()<5
end
function c94160895.mzfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5
end end
function c94160895.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c94160895.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local loc=LOCATION_MZONE+LOCATION_HAND local g=nil
if ft<0 then loc=LOCATION_MZONE end if ft>-1 then
local loc2=0 local loc=0
if Duel.IsPlayerAffectedByEffect(tp,88581108) then loc2=LOCATION_MZONE end if Duel.IsPlayerAffectedByEffect(tp,88581108) then loc=LOCATION_MZONE end
local g=Duel.GetMatchingGroup(c94160895.desfilter,tp,loc,loc2,c) g=Duel.GetMatchingGroup(c94160895.desfilter,tp,LOCATION_MZONE+LOCATION_HAND,loc,c)
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) else
g=Duel.GetMatchingGroup(c94160895.desfilter2,tp,LOCATION_MZONE,0,c)
end
if chk==0 then return ft>-2 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and g:GetCount()>=2 and g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WIND) and g:GetCount()>=2 and g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WIND)
and (ft>0 or g:IsExists(Card.IsLocation,-ft+1,nil,LOCATION_MZONE)) end and (ft~=0 or g:IsExists(c94160895.mzfilter,1,nil,tp)) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,2,tp,loc) Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,2,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end end
function c94160895.rmfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove(tp)
end
function c94160895.spop(e,tp,eg,ep,ev,re,r,rp) function c94160895.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local loc=LOCATION_MZONE+LOCATION_HAND local g=nil
if ft<0 then loc=LOCATION_MZONE end if ft>-1 then
local loc2=0 local loc=0
if Duel.IsPlayerAffectedByEffect(tp,88581108) then loc2=LOCATION_MZONE end if Duel.IsPlayerAffectedByEffect(tp,88581108) then loc=LOCATION_MZONE end
local g=Duel.GetMatchingGroup(c94160895.desfilter,tp,loc,loc2,c) g=Duel.GetMatchingGroup(c94160895.desfilter,tp,LOCATION_MZONE+LOCATION_HAND,loc,c)
else
g=Duel.GetMatchingGroup(c94160895.desfilter2,tp,LOCATION_MZONE,0,c)
end
if g:GetCount()<2 or not g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WIND) then return end if g:GetCount()<2 or not g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WIND) then return end
local g1=nil local g2=nil local g1=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
if ft<1 then if ft==0 then
g1=g:FilterSelect(tp,Card.IsLocation,1,1,nil,LOCATION_MZONE) g1=g:FilterSelect(tp,c94160895.mzfilter,1,1,nil,tp)
else else
g1=g:Select(tp,1,1,nil) g1=g:Select(tp,1,1,nil)
end end
g:RemoveCard(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
if g1:GetFirst():IsAttribute(ATTRIBUTE_WIND) then if g1:GetFirst():IsAttribute(ATTRIBUTE_WIND) then
g2=g:Select(tp,1,1,nil) local g2=g:Select(tp,1,1,g1:GetFirst())
g1:Merge(g2)
else else
g2=g:FilterSelect(tp,Card.IsAttribute,1,1,nil,ATTRIBUTE_WIND) local g2=g:FilterSelect(tp,Card.IsAttribute,1,1,g1:GetFirst(),ATTRIBUTE_WIND)
g1:Merge(g2)
end end
g1:Merge(g2)
local rm=g1:IsExists(Card.IsAttribute,2,nil,ATTRIBUTE_WIND) local rm=g1:IsExists(Card.IsAttribute,2,nil,ATTRIBUTE_WIND)
if Duel.Destroy(g1,REASON_EFFECT)==2 then if Duel.Destroy(g1,REASON_EFFECT)==2 then
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
......
...@@ -26,6 +26,7 @@ function c94220427.filter1(c,e,tp) ...@@ -26,6 +26,7 @@ function c94220427.filter1(c,e,tp)
local rk=c:GetRank() local rk=c:GetRank()
return rk>4 and c:IsFaceup() and c:IsType(TYPE_XYZ) return rk>4 and c:IsFaceup() and c:IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(c94220427.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk+1,c:GetCode()) and Duel.IsExistingMatchingCard(c94220427.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk+1,c:GetCode())
and Duel.GetLocationCountFromEx(tp,tp,c)>0
end end
function c94220427.filter2(c,e,tp,mc,rk,code) function c94220427.filter2(c,e,tp,mc,rk,code)
if c:GetOriginalCode()==6165656 and code~=48995978 then return false end if c:GetOriginalCode()==6165656 and code~=48995978 then return false end
...@@ -34,15 +35,14 @@ function c94220427.filter2(c,e,tp,mc,rk,code) ...@@ -34,15 +35,14 @@ function c94220427.filter2(c,e,tp,mc,rk,code)
end end
function c94220427.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c94220427.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c94220427.filter1(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c94220427.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 if chk==0 then return Duel.IsExistingTarget(c94220427.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
and Duel.IsExistingTarget(c94220427.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c94220427.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp) Duel.SelectTarget(tp,c94220427.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c94220427.activate(e,tp,eg,ep,ev,re,r,rp) function c94220427.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.GetLocationCountFromEx(tp,tp,tc)<=0 then return end
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) 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) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c94220427.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+1,tc:GetCode()) local g=Duel.SelectMatchingCard(tp,c94220427.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+1,tc:GetCode())
......
...@@ -67,12 +67,12 @@ function c96157835.spfilter2(c,e,tp) ...@@ -67,12 +67,12 @@ function c96157835.spfilter2(c,e,tp)
return c:IsSetCard(0xba) and c:IsType(TYPE_XYZ) and not c:IsCode(96157835) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0xba) and c:IsType(TYPE_XYZ) and not c:IsCode(96157835) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c96157835.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) function c96157835.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(c96157835.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(c96157835.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c96157835.spop2(e,tp,eg,ep,ev,re,r,rp) function c96157835.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCountFromEx(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c96157835.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c96157835.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -79,21 +79,19 @@ function c96227613.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -79,21 +79,19 @@ function c96227613.thop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function c96227613.desfilter(c,ft) function c96227613.desfilter(c,ec,tp)
if ft<-1 then return false end return c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,ec))>0
return c:IsFaceup() and (ft>=0 or c:IsLocation(LOCATION_MZONE))
end end
function c96227613.spfilter(c,e,tp) function c96227613.spfilter(c,e,tp)
return c:IsType(TYPE_FUSION+TYPE_SYNCHRO) and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsType(TYPE_FUSION+TYPE_SYNCHRO) and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c96227613.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c96227613.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c96227613.desfilter(chkc,c,tp) and chkc~=c end
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c96227613.desfilter(chkc,ft) and chkc~=c end if chk==0 then return Duel.IsExistingTarget(c96227613.desfilter,tp,LOCATION_ONFIELD,0,1,c,c,tp)
if chk==0 then return Duel.IsExistingTarget(c96227613.desfilter,tp,LOCATION_ONFIELD,0,1,c,ft)
and Duel.IsExistingMatchingCard(c96227613.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(c96227613.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c96227613.desfilter,tp,LOCATION_ONFIELD,0,1,1,c,ft) local g=Duel.SelectTarget(tp,c96227613.desfilter,tp,LOCATION_ONFIELD,0,1,1,c,c,tp)
g:AddCard(c) g:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
...@@ -104,6 +102,7 @@ function c96227613.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -104,6 +102,7 @@ function c96227613.spop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) then return end
local dg=Group.FromCards(c,tc) local dg=Group.FromCards(c,tc)
if Duel.Destroy(dg,REASON_EFFECT)==2 then if Duel.Destroy(dg,REASON_EFFECT)==2 then
if Duel.GetLocationCountFromEx(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c96227613.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c96227613.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()==0 then return end if g:GetCount()==0 then return end
......
...@@ -22,23 +22,29 @@ function c96746083.initial_effect(c) ...@@ -22,23 +22,29 @@ function c96746083.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c96746083.desfilter(c) function c96746083.desfilter(c)
return c:IsType(TYPE_MONSTER) and ((c:IsLocation(LOCATION_MZONE) and c:IsFaceup()) or c:IsLocation(LOCATION_HAND)) return c:IsType(TYPE_MONSTER) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup())
end end
function c96746083.locfilter(c,tp) function c96746083.desfilter2(c)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) return c:IsFaceup() and c:GetSequence()<5
end
function c96746083.mzfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5
end end
function c96746083.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c96746083.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local loc=LOCATION_MZONE+LOCATION_HAND local g=nil
if ft<0 then loc=LOCATION_MZONE end if ft>-1 then
local loc2=0 local loc=0
if Duel.IsPlayerAffectedByEffect(tp,88581108) then loc2=LOCATION_MZONE end if Duel.IsPlayerAffectedByEffect(tp,88581108) then loc=LOCATION_MZONE end
local g=Duel.GetMatchingGroup(c96746083.desfilter,tp,loc,loc2,c) g=Duel.GetMatchingGroup(c96746083.desfilter,tp,LOCATION_MZONE+LOCATION_HAND,loc,c)
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) else
g=Duel.GetMatchingGroup(c96746083.desfilter2,tp,LOCATION_MZONE,0,c)
end
if chk==0 then return ft>-2 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and g:GetCount()>=2 and g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_FIRE) and g:GetCount()>=2 and g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_FIRE)
and (ft>0 or g:IsExists(c96746083.locfilter,-ft+1,nil,tp)) end and (ft~=0 or g:IsExists(c96746083.mzfilter,1,nil,tp)) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,2,tp,loc) Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,2,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end end
function c96746083.rmfilter(c,tp) function c96746083.rmfilter(c,tp)
...@@ -47,27 +53,30 @@ end ...@@ -47,27 +53,30 @@ end
function c96746083.spop(e,tp,eg,ep,ev,re,r,rp) function c96746083.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local loc=LOCATION_MZONE+LOCATION_HAND local g=nil
if ft<0 then loc=LOCATION_MZONE end if ft>-1 then
local loc2=0 local loc=0
if Duel.IsPlayerAffectedByEffect(tp,88581108) then loc2=LOCATION_MZONE end if Duel.IsPlayerAffectedByEffect(tp,88581108) then loc=LOCATION_MZONE end
local g=Duel.GetMatchingGroup(c96746083.desfilter,tp,loc,loc2,c) g=Duel.GetMatchingGroup(c96746083.desfilter,tp,LOCATION_MZONE+LOCATION_HAND,loc,c)
else
g=Duel.GetMatchingGroup(c96746083.desfilter2,tp,LOCATION_MZONE,0,c)
end
if g:GetCount()<2 or not g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_FIRE) then return end if g:GetCount()<2 or not g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_FIRE) then return end
local g1=nil local g2=nil local g1=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
if ft<1 then if ft==0 then
g1=g:FilterSelect(tp,c96746083.locfilter,1,1,nil,tp) g1=g:FilterSelect(tp,c96746083.mzfilter,1,1,nil,tp)
else else
g1=g:Select(tp,1,1,nil) g1=g:Select(tp,1,1,nil)
end end
g:RemoveCard(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
if g1:GetFirst():IsAttribute(ATTRIBUTE_FIRE) then if g1:GetFirst():IsAttribute(ATTRIBUTE_FIRE) then
g2=g:Select(tp,1,1,nil) local g2=g:Select(tp,1,1,g1:GetFirst())
g1:Merge(g2)
else else
g2=g:FilterSelect(tp,Card.IsAttribute,1,1,nil,ATTRIBUTE_FIRE) local g2=g:FilterSelect(tp,Card.IsAttribute,1,1,g1:GetFirst(),ATTRIBUTE_FIRE)
g1:Merge(g2)
end end
g1:Merge(g2)
local rm=g1:IsExists(Card.IsAttribute,2,nil,ATTRIBUTE_FIRE) local rm=g1:IsExists(Card.IsAttribute,2,nil,ATTRIBUTE_FIRE)
if Duel.Destroy(g1,REASON_EFFECT)==2 then if Duel.Destroy(g1,REASON_EFFECT)==2 then
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
......
...@@ -55,13 +55,13 @@ function c97219708.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -55,13 +55,13 @@ function c97219708.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(e:GetHandler(),REASON_COST) Duel.Release(e:GetHandler(),REASON_COST)
end end
function c97219708.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c97219708.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 if chk==0 then return Duel.GetLocationCountFromEx(tp,tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(c97219708.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(c97219708.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c97219708.spop(e,tp,eg,ep,ev,re,r,rp) function c97219708.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then if Duel.GetLocationCountFromEx(tp)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c97219708.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c97219708.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -11,11 +11,22 @@ function c98446407.initial_effect(c) ...@@ -11,11 +11,22 @@ function c98446407.initial_effect(c)
e1:SetOperation(c98446407.spop) e1:SetOperation(c98446407.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c98446407.mzfilter(c,tp)
return c:IsControler(tp) and c:GetSequence()<5
end
function c98446407.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c98446407.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsReleasable() and Duel.CheckReleaseGroup(tp,nil,1,c) end local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if c:GetSequence()<5 then ft=ft+1 end
if chk==0 then return ft>-1 and c:IsReleasable() and Duel.CheckReleaseGroup(tp,nil,1,c)
and (ft>0 or Duel.CheckReleaseGroup(tp,c98446407.mzfilter,1,c,tp)) end
local rg=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=Duel.SelectReleaseGroup(tp,nil,1,1,c) if ft>0 then
rg=Duel.SelectReleaseGroup(tp,nil,1,1,c)
else
rg=Duel.SelectReleaseGroup(tp,c98446407.mzfilter,1,1,c,tp)
end
rg:AddCard(c) rg:AddCard(c)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
...@@ -23,8 +34,7 @@ function c98446407.filter(c,e,tp) ...@@ -23,8 +34,7 @@ function c98446407.filter(c,e,tp)
return c:IsCode(61441708) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(61441708) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c98446407.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c98446407.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 if chk==0 then return Duel.IsExistingMatchingCard(c98446407.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
and Duel.IsExistingMatchingCard(c98446407.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end end
function c98446407.spop(e,tp,eg,ep,ev,re,r,rp) function c98446407.spop(e,tp,eg,ep,ev,re,r,rp)
......
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