Commit 891248f1 authored by 未闻皂名's avatar 未闻皂名

2022/3/27 新增:未来开掘

parent b9e6467b
No preview for this file type
local m=120208045
local cm=_G["c"..m]
cm.name="未来开掘"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,2,nil)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<2 then return end
Duel.ConfirmDecktop(tp,2)
local g=Duel.GetDecktopGroup(tp,2)
if g:GetCount()>0 then
if g:IsExists(cm.thfilter,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,cm.thfilter,1,1,nil)
Duel.DisableShuffleCheck()
RD.SendToHandAndExists(sg,1-tp)
Duel.ShuffleHand(tp)
RD.SendDeckTopToBottom(tp,1)
else
Duel.SortDecktop(tp,tp,2)
RD.SendDeckTopToBottom(tp,2)
end
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