--灯火之魔女·舞蝶 local m=28327020 local cm=_G["c"..m] xpcall(function() require("expansions/script/c28327000") end,function() require("script/c28327000") end) function cm.initial_effect(c) Yukino.ShikiNoAkari(c) --draw local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,m) e1:SetCondition(cm.drcon) e1:SetTarget(cm.drtg) e1:SetOperation(cm.drop) c:RegisterEffect(e1) --tohand local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_RELEASE) e2:SetCountLimit(1,m+900) e2:SetCondition(cm.thcon) e2:SetTarget(cm.thtg) e2:SetOperation(cm.thop) c:RegisterEffect(e2) end function cm.drcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL) end function cm.drfilter(c) return c:IsFaceup() and c:IsCode(28327000) end function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk) local ct=Duel.GetMatchingGroupCount(cm.drfilter,tp,LOCATION_MZONE,0,nil) if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end Duel.SetTargetPlayer(tp) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct) end function cm.drop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local d=Duel.GetMatchingGroupCount(cm.drfilter,tp,LOCATION_MZONE,0,nil) Duel.Draw(p,d,REASON_EFFECT) end function cm.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_RITUAL) end function cm.thfilter(c) return aux.IsCodeListed(c,28327000) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() end function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function cm.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end