Commit 5c206843 authored by VanillaSalt's avatar VanillaSalt

fix

parent 4e3cdfa7
...@@ -15,8 +15,8 @@ function c56343672.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -15,8 +15,8 @@ function c56343672.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST) Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST)
end end
function c56343672.spfilter(c,e,tp,zone) function c56343672.spfilter(c,e,tp)
return c:GetLevel()>0 and not c:IsCode(56343672) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) return c:GetLevel()>0 and not c:IsCode(56343672) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c56343672.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c56343672.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
...@@ -26,7 +26,7 @@ function c56343672.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -26,7 +26,7 @@ function c56343672.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if seq<5 and bit.extract(zone,seq)~=0 then ct=ct+1 end if seq<5 and bit.extract(zone,seq)~=0 then ct=ct+1 end
if ct<=0 then return false end if ct<=0 then return false end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
local g=Duel.GetMatchingGroup(c56343672.spfilter,tp,LOCATION_DECK,0,nil,e,tp,zone) local g=Duel.GetMatchingGroup(c56343672.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
return g:CheckWithSumEqual(Card.GetLevel,6,1,ct) return g:CheckWithSumEqual(Card.GetLevel,6,1,ct)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
...@@ -37,7 +37,7 @@ function c56343672.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -37,7 +37,7 @@ function c56343672.spop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone) local ct=Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)
if ct<=0 then return end if ct<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
local g=Duel.GetMatchingGroup(c56343672.spfilter,tp,LOCATION_DECK,0,nil,e,tp,zone) local g=Duel.GetMatchingGroup(c56343672.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if g:CheckWithSumEqual(Card.GetLevel,6,1,ct) then if g:CheckWithSumEqual(Card.GetLevel,6,1,ct) then
local fid=c:GetFieldID() local fid=c:GetFieldID()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
...@@ -68,14 +68,14 @@ function c81571633.filter(c,e,tp) ...@@ -68,14 +68,14 @@ function c81571633.filter(c,e,tp)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c81571633.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c81571633.sptg(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(c81571633.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(c81571633.filter,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 c81571633.spop(e,tp,eg,ep,ev,re,r,rp) function c81571633.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c81571633.filter,tp,LOCATION_EXTRA,0,nil,e,tp) local g=Duel.GetMatchingGroup(c81571633.filter,tp,LOCATION_EXTRA,0,nil,e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g:GetCount()>0 then if Duel.GetLocationCountFromEx(tp)>0 and g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil) local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst() local tc=sg:GetFirst()
......
...@@ -14,22 +14,22 @@ function c81913510.filter1(c,e,tp) ...@@ -14,22 +14,22 @@ function c81913510.filter1(c,e,tp)
local code=c:GetCode() local code=c:GetCode()
return c:IsFaceup() and c:IsSetCard(0x1f) return c:IsFaceup() and c:IsSetCard(0x1f)
and Duel.IsExistingMatchingCard(c81913510.filter2,tp,LOCATION_EXTRA,0,1,nil,code,e,tp) and Duel.IsExistingMatchingCard(c81913510.filter2,tp,LOCATION_EXTRA,0,1,nil,code,e,tp)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
end end
function c81913510.filter2(c,code,e,tp) function c81913510.filter2(c,code,e,tp)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end end
function c81913510.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c81913510.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c81913510.filter1(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c81913510.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 if chk==0 then return Duel.IsExistingTarget(c81913510.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
and Duel.IsExistingTarget(c81913510.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,c81913510.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c81913510.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
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 c81913510.activate(e,tp,eg,ep,ev,re,r,rp) function c81913510.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end
local tc1=Duel.GetFirstTarget() local tc1=Duel.GetFirstTarget()
if Duel.GetLocationCountFromEx(tp,tp,tc1)<=0 then return end
if tc1:IsRelateToEffect(e) and Duel.SendtoGrave(tc1,REASON_EFFECT)~=0 then if tc1:IsRelateToEffect(e) and Duel.SendtoGrave(tc1,REASON_EFFECT)~=0 then
local code=tc1:GetCode() local code=tc1:GetCode()
local tc2=Duel.GetFirstMatchingCard(c81913510.filter2,tp,LOCATION_EXTRA,0,nil,code,e,tp) local tc2=Duel.GetFirstMatchingCard(c81913510.filter2,tp,LOCATION_EXTRA,0,nil,code,e,tp)
......
...@@ -77,6 +77,7 @@ end ...@@ -77,6 +77,7 @@ end
function c83319610.spfilter1(c,e,tp) function c83319610.spfilter1(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x58) and c:IsType(TYPE_XYZ) return c:IsFaceup() and c:IsSetCard(0x58) and c:IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(c83319610.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetRank()+1) and Duel.IsExistingMatchingCard(c83319610.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetRank()+1)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
end end
function c83319610.spfilter2(c,e,tp,mc,rk) function c83319610.spfilter2(c,e,tp,mc,rk)
return c:GetRank()==rk and c:IsSetCard(0x58) and mc:IsCanBeXyzMaterial(c) return c:GetRank()==rk and c:IsSetCard(0x58) and mc:IsCanBeXyzMaterial(c)
...@@ -89,15 +90,14 @@ end ...@@ -89,15 +90,14 @@ end
function c83319610.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c83319610.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c83319610.spfilter1(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c83319610.spfilter1(chkc,e,tp) end
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING) if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c83319610.spfilter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end and Duel.IsExistingTarget(c83319610.spfilter1,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,c83319610.spfilter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp) Duel.SelectTarget(tp,c83319610.spfilter1,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 c83319610.spop(e,tp,eg,ep,ev,re,r,rp) function c83319610.spop(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,c83319610.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+1) local g=Duel.SelectMatchingCard(tp,c83319610.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+1)
......
...@@ -16,19 +16,19 @@ end ...@@ -16,19 +16,19 @@ end
function c84536654.filter(c,e,tp) function c84536654.filter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x8) and c:IsType(TYPE_FUSION) and c:IsAbleToExtra() return c:IsFaceup() and c:IsSetCard(0x8) and c:IsType(TYPE_FUSION) and c:IsAbleToExtra()
and Duel.IsExistingMatchingCard(c84536654.spfilter,tp,LOCATION_EXTRA,0,1,nil,c:GetCode(),c:GetOriginalLevel(),e,tp) and Duel.IsExistingMatchingCard(c84536654.spfilter,tp,LOCATION_EXTRA,0,1,nil,c:GetCode(),c:GetOriginalLevel(),e,tp)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
end end
function c84536654.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c84536654.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c84536654.filter(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c84536654.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 if chk==0 then return Duel.IsExistingTarget(c84536654.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
and Duel.IsExistingTarget(c84536654.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c84536654.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c84536654.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
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 c84536654.activate(e,tp,eg,ep,ev,re,r,rp) function c84536654.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 code=tc:GetCode() local code=tc:GetCode()
local lv=tc:GetOriginalLevel() local lv=tc:GetOriginalLevel()
......
...@@ -29,6 +29,9 @@ end ...@@ -29,6 +29,9 @@ end
function c84869738.desfilter(c) function c84869738.desfilter(c)
return not c84869738.cfilter(c) return not c84869738.cfilter(c)
end end
function c84869738.mzfilter(c)
return c:GetSequence()<5
end
function c84869738.spfilter(c,e,tp) function c84869738.spfilter(c,e,tp)
return c:IsSetCard(0x20f8) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) return c:IsSetCard(0x20f8) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end end
...@@ -36,8 +39,8 @@ function c84869738.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -36,8 +39,8 @@ function c84869738.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c84869738.desfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(c84869738.desfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then if chk==0 then
local loc=0 local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 then loc=loc+LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE end if Duel.GetLocationCount(tp,LOCATION_MZONE)>-g:FilterCount(c84869738.mzfilter,nil) then loc=loc+LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE end
if Duel.GetLocationCountFromEx(tp)>-1 then loc=loc+LOCATION_EXTRA end if Duel.GetLocationCountFromEx(tp,tp,g)>0 then loc=loc+LOCATION_EXTRA end
return g:GetCount()>0 and loc~=0 return g:GetCount()>0 and loc~=0
and Duel.IsExistingMatchingCard(c84869738.spfilter,tp,loc,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(c84869738.spfilter,tp,loc,0,1,nil,e,tp)
end end
...@@ -67,10 +70,10 @@ function c84869738.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -67,10 +70,10 @@ function c84869738.activate(e,tp,eg,ep,ev,re,r,rp)
local rg=Group.CreateGroup() local rg=Group.CreateGroup()
repeat repeat
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil):GetFirst() local tc=sg:Select(tp,1,1,nil):GetFirst()
rg:AddCard(tg) rg:AddCard(tc)
sg:Remove(Card.IsCode,nil,tg:GetCode()) sg:Remove(Card.IsCode,nil,tc:GetCode())
if tg:IsLocation(LOCATION_EXTRA) then ft2=ft2-1 if tc:IsLocation(LOCATION_EXTRA) then ft2=ft2-1
else ft1=ft1-1 end else ft1=ft1-1 end
if ft1<=0 then sg:Remove(Card.IsLocation,nil,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE) end if ft1<=0 then sg:Remove(Card.IsLocation,nil,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE) end
if ft2<=0 then sg:Remove(Card.IsLocation,nil,LOCATION_EXTRA) end if ft2<=0 then sg:Remove(Card.IsLocation,nil,LOCATION_EXTRA) 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