Commit d991a567 authored by VanillaSalt's avatar VanillaSalt

fix

parent 283c0302
...@@ -9,21 +9,21 @@ function c16494704.initial_effect(c) ...@@ -9,21 +9,21 @@ function c16494704.initial_effect(c)
e1:SetOperation(c16494704.operation) e1:SetOperation(c16494704.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c16494704.pfilter(c,rc)
return c:IsType(TYPE_PENDULUM) and c:IsCanBeRitualMaterial(rc)
end
function c16494704.exfilter0(c) function c16494704.exfilter0(c)
return c:IsSetCard(0x99) and c:GetLevel()>=1 and c:IsAbleToGrave() return c:IsSetCard(0x99) and c:GetLevel()>=1 and c:IsAbleToGrave()
end end
function c16494704.filter(c,e,tp,m) function c16494704.filter(c,e,tp,m)
if not c:IsRace(RACE_DRAGON) or bit.band(c:GetType(),0x81)~=0x81 if not c:IsRace(RACE_DRAGON) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(c16494704.pfilter,c,c) local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if c.mat_filter then
mg=mg:Filter(c.mat_filter,nil)
end
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c) return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
end end
function c16494704.target(e,tp,eg,ep,ev,re,r,rp,chk) function c16494704.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsType,nil,TYPE_PENDULUM)
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1 then if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1 then
local sg=Duel.GetMatchingGroup(c16494704.exfilter0,tp,LOCATION_EXTRA,0,nil) local sg=Duel.GetMatchingGroup(c16494704.exfilter0,tp,LOCATION_EXTRA,0,nil)
mg:Merge(sg) mg:Merge(sg)
...@@ -33,7 +33,7 @@ function c16494704.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -33,7 +33,7 @@ function c16494704.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end end
function c16494704.operation(e,tp,eg,ep,ev,re,r,rp) function c16494704.operation(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsType,nil,TYPE_PENDULUM)
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1 then if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1 then
local sg=Duel.GetMatchingGroup(c16494704.exfilter0,tp,LOCATION_EXTRA,0,nil) local sg=Duel.GetMatchingGroup(c16494704.exfilter0,tp,LOCATION_EXTRA,0,nil)
mg:Merge(sg) mg:Merge(sg)
...@@ -42,7 +42,10 @@ function c16494704.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,7 +42,10 @@ function c16494704.operation(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.SelectMatchingCard(tp,c16494704.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,mg) local tg=Duel.SelectMatchingCard(tp,c16494704.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
mg=mg:Filter(c16494704.pfilter,tc,tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc) local mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
tc:SetMaterial(mat) tc:SetMaterial(mat)
......
...@@ -50,15 +50,20 @@ function c84305651.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -50,15 +50,20 @@ function c84305651.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
local op=0 local op=0
if b1 and b2 then if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(84305651,1),aux.Stringid(84305651,2))+1 op=Duel.SelectOption(tp,aux.Stringid(84305651,1),aux.Stringid(84305651,2))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(84305651,1))
else
op=Duel.SelectOption(tp,aux.Stringid(84305651,1))+1
end end
if op==1 then if op==0 then
Duel.SetTargetCard(bc) Duel.SetTargetCard(bc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,bc,1,0,0)
end end
e:SetLabel(op) e:SetLabel(op)
end end
function c84305651.spop(e,tp,eg,ep,ev,re,r,rp) function c84305651.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==1 then if e:GetLabel()==0 then
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
......
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