Commit eacc15c7 authored by DailyShana's avatar DailyShana

fix

parent 87cc5243
......@@ -12,9 +12,14 @@ function c90500169.initial_effect(c)
end
function c90500169.filter(c,e,tp)
if c:IsFacedown() or not c:IsSetCard(0x41) or not c:IsAbleToDeck() then return false end
local op=c:GetOwner()
local locct=Duel.GetLocationCount(op,LOCATION_MZONE)
local cp=c:GetControler()
if op==cp and locct<=-1 then return false end
if op~=cp and locct<=0 then return false end
local code=c:GetCode()
local class=_G["c"..code]
return class and class.lvdncount~=nil and Duel.IsExistingMatchingCard(c90500169.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,class,e,tp,c:GetOwner())
return class and class.lvdncount~=nil and Duel.IsExistingMatchingCard(c90500169.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,class,e,tp,op)
end
function c90500169.spfilter(c,class,e,tp,op)
if not c:IsControler(op) then return false end
......@@ -26,9 +31,8 @@ function c90500169.spfilter(c,class,e,tp,op)
end
function c90500169.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c90500169.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c90500169.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
if chk==0 then return Duel.IsExistingTarget(c90500169.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c90500169.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
......@@ -38,8 +42,8 @@ function c90500169.activate(e,tp,eg,ep,ev,re,r,rp)
local code=tc:GetCode()
local op=tc:GetOwner()
if not tc:IsRelateToEffect(e) or not tc:IsFaceup() then return end
if not Duel.SendtoDeck(tc,nil,2,REASON_EFFECT) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)==0 then return end
if Duel.GetLocationCount(op,LOCATION_MZONE)<=0 then return end
local class=_G["c"..code]
if class==nil or class.lvdncount==nil then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
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