--灯火之魔女·勿忘 local m=28327036 local cm=_G["c"..m] Duel.LoadScript("c28327000.lua") function cm.initial_effect(c) Yukino.ShikiNoAkari(c) --draw local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TODECK) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,m) e1:SetCondition(cm.drcon) e1:SetTarget(cm.drtg) e1:SetOperation(cm.drop) c:RegisterEffect(e1) --disable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_CANNOT_TRIGGER) e2:SetRange(LOCATION_MZONE) e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e2:SetTarget(cm.target) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EFFECT_DISABLE) c:RegisterEffect(e3) local e4=e2:Clone() e4:SetCode(EFFECT_CANNOT_ATTACK) c:RegisterEffect(e4) end function cm.target(e,c) return c:IsStatus(STATUS_SPSUMMON_TURN) and c:GetSummonLocation()==LOCATION_EXTRA end function cm.drcon(e,tp,eg,ep,ev,re,r,rp) local a=Duel.GetAttacker() local d=Duel.GetAttackTarget() return (a:IsControler(tp) and a:IsType(TYPE_RITUAL) and a:IsRace(RACE_SPELLCASTER)) or (d and d:IsControler(tp) and d:IsFaceup() and d:IsType(TYPE_RITUAL) and d:IsRace(RACE_SPELLCASTER)) end function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) end function cm.drop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) if g:GetCount()>0 then Duel.HintSelection(g) Duel.SendtoDeck(g,nil,1,REASON_EFFECT) end end