Commit 6dfa9cde authored by Tachibana's avatar Tachibana

watele

parent 1065ee3b
Pipeline #6823 passed with stages
in 39 minutes and 2 seconds
......@@ -43,7 +43,7 @@ function cm.thfilter(c,e,tp)
return rk.check(c,"FAIRY") and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelBelow(5)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.thfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,LOCATION_GRAVE)
......
......@@ -89,7 +89,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.spc,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
local sg=Duel.SelectMatchingCard(tp,cm.spc,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
......
......@@ -29,8 +29,8 @@ function cm.filter(c,e,tp,m)
return false
end
local num=c:GetLevel()+c:GetRank()
return c:IsCanBeSpecialSummoned(e,b,tp,false,true) and (c:IsLevelAbove(1) or c:IsRankAbove(1)) and m:CheckWithSumEqual(cm.sumfun,num,m:GetCount(),m:GetCount()) and (c:IsLocation(LOCATION_DECK) and Duel.GetMZoneCount(tp,m)>0
or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,m,c)>0)
return c:IsCanBeSpecialSummoned(e,b,tp,false,true) and (c:IsLevelAbove(1) or c:IsRankAbove(1)) and m:CheckWithSumEqual(cm.sumfun,num,1,m:GetCount()) and (c:IsLocation(LOCATION_DECK) and Duel.GetMZoneCount(tp)>0
or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0)
end
function cm.sumfun(c)
return c:GetLevel()+c:GetRank()+c:GetLink()
......@@ -48,36 +48,41 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_GRAVE+LOCATION_MZONE+LOCATION_HAND,0,nil)
return mg:CheckSubGroup(cm.gfilter,1,mg:GetCount(),e,tp)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA+LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_GRAVE+LOCATION_MZONE+LOCATION_HAND,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
local sg=mg:SelectSubGroup(tp,cm.gfilter,false,1,mg:GetCount(),e,tp,mg)
if sg:GetCount()>0 then
local mat1=sg:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
sg:Sub(mat1)
Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT)
Duel.Release(sg,REASON_EFFECT)
Duel.BreakEffect()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD+LOCATION_EXTRA,LOCATION_ONFIELD,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_EXTRA+LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp,sg)
local tg=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,mg)
if tg:GetCount()>0 then
local tc=tg:GetFirst()
local num=tc:GetLevel()+tc:GetRank()
mg=mg:Filter(cm.matfilter,nil,tc)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1))
local mat=mg:SelectWithSumEqual(tp,cm.sumfun,num,1,99)
tc:SetMaterial(mat)
local mat1=mat:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
mat:Sub(mat1)
Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT)
Duel.Release(mat,REASON_EFFECT)
Duel.BreakEffect()
if tg:GetCount()>0 then
local b=0
if c:IsType(TYPE_SYNCHRO) then
if tc:IsType(TYPE_SYNCHRO) then
b=SUMMON_TYPE_SYNCHRO
elseif c:IsType(TYPE_FUSION) then
elseif tc:IsType(TYPE_FUSION) then
b=SUMMON_TYPE_FUSION
elseif c:IsType(TYPE_XYZ) then
elseif tc:IsType(TYPE_XYZ) then
b=SUMMON_TYPE_XYZ
elseif c:IsType(TYPE_RITUAL) then
elseif tc:IsType(TYPE_RITUAL) then
b=TYPE_RITUAL
end
Duel.SpecialSummon(tc,b,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
tc:CompleteProcedure()
end
end
\ No newline at end of file
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