Commit d0c7d992 authored by 聖園ミカ's avatar 聖園ミカ 🐟

7

parent 51ec6c76
......@@ -21,8 +21,8 @@ function cm.initial_effect(c)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e4:SetCategory(CATEGORY_TODECK)
e4:SetCode(EVENT_REMOVE)
e4:SetTarget(cm.thtg)
e4:SetOperation(cm.thop)
e4:SetTarget(cm.target)
e4:SetOperation(cm.operation)
c:RegisterEffect(e4)
end
function cm.ffilter(c,fc,sub,mg,sg)
......@@ -49,30 +49,25 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1)
end
end
function cm.thfilter(c,e)
function cm.filter(c,e,fc,sub,mg,sg)
return c:IsFaceupEx() and c:IsAbleToDeck() and c:IsCanBeEffectTarget(e)
end
function cm.thfilter2(c,g)
return g:IsExists(Card.IsCode,2,c,c:GetCode())
function cm.fselect(g)
return g:GetClassCount(Card.GetCode)==1
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and cm.thfilter(chkc,e) end
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e)
if chk==0 then return g:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=g:FilterSelect(tp,cm.thfilter2,1,1,nil,g)
if g1:GetCount()>0 then
local g2=g:FilterSelect(tp,Card.IsCode,2,2,g1:GetFirst(),g1:GetFirst():GetCode())
g1:Merge(g2)
Duel.SetTargetCard(g1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g1,3,0,0)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e)
if chkc then return false end
if chk==0 then return g:CheckSubGroup(cm.fselect,3,3) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local sg=g:SelectSubGroup(tp,cm.fselect,false,3,3)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,3,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not g then return end
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>0 then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
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