Commit e5260f24 authored by nekrozar's avatar nekrozar Committed by VanillaSalt

fix (#850)

parent 92e28d37
...@@ -41,25 +41,34 @@ function c1686814.initial_effect(c) ...@@ -41,25 +41,34 @@ function c1686814.initial_effect(c)
e5:SetValue(1) e5:SetValue(1)
c:RegisterEffect(e5) c:RegisterEffect(e5)
end end
function c1686814.sprfilter1(c,tp) function c1686814.sprfilter(c,ft)
return c:IsFaceup() and c:GetLevel()>4 and c:IsAbleToGraveAsCost()
end
function c1686814.sprfilter1(c,ft,g)
local lv=c:GetLevel() local lv=c:GetLevel()
return lv>4 and c:IsFaceup() and c:IsType(TYPE_TUNER) and c:IsAbleToGraveAsCost() local chk=false
and Duel.IsExistingMatchingCard(c1686814.sprfilter2,tp,LOCATION_MZONE,0,1,nil,lv) if ft>0 or c:CheckMZoneFromEX() then chk=true end
return c:IsType(TYPE_TUNER) and g:IsExists(c1686814.sprfilter2,1,c,lv,ft,chk)
end end
function c1686814.sprfilter2(c,lv) function c1686814.sprfilter2(c,lv,ft,chk)
return c:IsFaceup() and c:GetLevel()==lv and not c:IsType(TYPE_TUNER) and c:IsAbleToGraveAsCost() return (chk or ft>0 or c:CheckMZoneFromEX()) and c:GetLevel()==lv and not c:IsType(TYPE_TUNER)
end end
function c1686814.sprcon(e,c) function c1686814.sprcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 local ft=Duel.GetLocationCountFromEx(tp)
and Duel.IsExistingMatchingCard(c1686814.sprfilter1,tp,LOCATION_MZONE,0,1,nil,tp) local g=Duel.GetMatchingGroup(c1686814.sprfilter,tp,LOCATION_MZONE,0,nil,ft)
return ft>-2 and g:IsExists(c1686814.sprfilter1,1,nil,ft,g)
end end
function c1686814.sprop(e,tp,eg,ep,ev,re,r,rp,c) function c1686814.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCountFromEx(tp)
local g=Duel.GetMatchingGroup(c1686814.sprfilter,tp,LOCATION_MZONE,0,nil,ft)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,c1686814.sprfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp) local g1=g:FilterSelect(tp,c1686814.sprfilter1,1,1,nil,ft,g)
local chk=false
if ft>0 or g1:GetFirst():CheckMZoneFromEX() then chk=true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectMatchingCard(tp,c1686814.sprfilter2,tp,LOCATION_MZONE,0,1,1,nil,g1:GetFirst():GetLevel()) local g2=g:FilterSelect(tp,c1686814.sprfilter2,1,1,g1:GetFirst(),g1:GetFirst():GetLevel(),ft,chk)
g1:Merge(g2) g1:Merge(g2)
Duel.SendtoGrave(g1,REASON_COST) Duel.SendtoGrave(g1,REASON_COST)
end end
...@@ -71,12 +80,12 @@ function c1686814.spfilter(c,e,tp) ...@@ -71,12 +80,12 @@ function c1686814.spfilter(c,e,tp)
and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c1686814.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c1686814.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(c1686814.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(c1686814.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 c1686814.spop(e,tp,eg,ep,ev,re,r,rp) function c1686814.spop(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,c1686814.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c1686814.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
......
...@@ -46,25 +46,34 @@ function c90884403.initial_effect(c) ...@@ -46,25 +46,34 @@ function c90884403.initial_effect(c)
e5:SetOperation(c90884403.spop) e5:SetOperation(c90884403.spop)
c:RegisterEffect(e5) c:RegisterEffect(e5)
end end
function c90884403.sprfilter1(c,tp) function c90884403.sprfilter(c,ft)
return c:IsFaceup() and c:GetLevel()>7 and c:IsAbleToGraveAsCost()
end
function c90884403.sprfilter1(c,ft,g)
local lv=c:GetLevel() local lv=c:GetLevel()
return lv>7 and c:IsFaceup() and c:IsType(TYPE_TUNER) and c:IsAbleToGraveAsCost() local chk=false
and Duel.IsExistingMatchingCard(c90884403.sprfilter2,tp,LOCATION_MZONE,0,1,nil,lv) if ft>0 or c:CheckMZoneFromEX() then chk=true end
return c:IsType(TYPE_TUNER) and g:IsExists(c90884403.sprfilter2,1,c,lv,ft,chk)
end end
function c90884403.sprfilter2(c,lv) function c90884403.sprfilter2(c,lv,ft,chk)
return c:IsFaceup() and c:GetLevel()==lv and not c:IsType(TYPE_TUNER) and c:IsAbleToGraveAsCost() return (chk or ft>0 or c:CheckMZoneFromEX()) and c:GetLevel()==lv and not c:IsType(TYPE_TUNER)
end end
function c90884403.sprcon(e,c) function c90884403.sprcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 local ft=Duel.GetLocationCountFromEx(tp)
and Duel.IsExistingMatchingCard(c90884403.sprfilter1,tp,LOCATION_MZONE,0,1,nil,tp) local g=Duel.GetMatchingGroup(c90884403.sprfilter,tp,LOCATION_MZONE,0,nil,ft)
return ft>-2 and g:IsExists(c90884403.sprfilter1,1,nil,ft,g)
end end
function c90884403.sprop(e,tp,eg,ep,ev,re,r,rp,c) function c90884403.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCountFromEx(tp)
local g=Duel.GetMatchingGroup(c90884403.sprfilter,tp,LOCATION_MZONE,0,nil,ft)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,c90884403.sprfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp) local g1=g:FilterSelect(tp,c90884403.sprfilter1,1,1,nil,ft,g)
local chk=false
if ft>0 or g1:GetFirst():CheckMZoneFromEX() then chk=true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectMatchingCard(tp,c90884403.sprfilter2,tp,LOCATION_MZONE,0,1,1,nil,g1:GetFirst():GetLevel()) local g2=g:FilterSelect(tp,c90884403.sprfilter2,1,1,g1:GetFirst(),g1:GetFirst():GetLevel(),ft,chk)
g1:Merge(g2) g1:Merge(g2)
Duel.SendtoGrave(g1,REASON_COST) Duel.SendtoGrave(g1,REASON_COST)
end 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