Commit 192d9ddf authored by Grajade's avatar Grajade

Update c12047052.lua

parent 9e949301
...@@ -31,40 +31,35 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -31,40 +31,35 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
c:RegisterEffect(e1,true) c:RegisterEffect(e1,true)
e:SetLabel(2) e:SetLabel(2)
end end
function cm.disfilter(c)
return c:IsAbleToDeck()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.disfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(cm.disfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) and (Duel.IsPlayerCanDraw(tp,1) or (not e:GetHandler():IsLocation(LOCATION_SZONE))) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tc=Duel.SelectTarget(tp,cm.disfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil) local tc=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,tc,1,0,0)
end
function cm.spfilter1(c)
return c:IsAbleToGrave()
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local shuffle=0
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT) if Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)>0 then
shuffle=1
end end
if true then
local dp=tc:GetOwner()
if Duel.IsExistingMatchingCard(cm.spfilter1,dp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(dp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,dp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(dp,cm.spfilter1,dp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end end
local dp=tc:GetOwner()
if Duel.IsExistingMatchingCard(Card.IsAbleToGrave,dp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(dp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,dp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(dp,Card.IsAbleToGrave,dp,LOCATION_DECK,0,1,1,nil)
if Duel.SendtoGrave(sg,REASON_EFFECT)>0 then
shuffle=1
end end
end end
if not c:IsStatus(STATUS_ACT_FROM_HAND) and c:IsLocation(LOCATION_SZONE) and e:GetLabel()~=2 then if shuffle==1 then Duel.ShuffleDeck(dp) end
if not c:IsStatus(STATUS_ACT_FROM_HAND) and e:GetLabel()~=2 then
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
end end
end end
function cm.handcon(e) function cm.handcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_ONFIELD,0)==0 return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_ONFIELD,0)==0
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