--灯火之魔女·沉沦 local m=28327002 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) --destroy local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,m) e2:SetCost(cm.descost) e2:SetTarget(cm.destg) e2:SetOperation(cm.desop) c:RegisterEffect(e2) --to hand local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_TOHAND) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_ATTACK_ANNOUNCE) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,m+900) e3:SetCondition(cm.thcon) e3:SetTarget(cm.thtg) e3:SetOperation(cm.thop) c:RegisterEffect(e3) end function cm.cfilter(c) return (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) and aux.IsCodeListed(c,28327000) and c:IsAbleToGraveAsCost() end function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST) end function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) end function cm.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end end function cm.thcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local ac=Duel.GetAttacker() local tc=Duel.GetAttackTarget() if not ac:IsControler(tp) then ac,tc=tc,ac end return ac and ac:IsControler(tp) and ac:IsFaceup() and ac:IsType(TYPE_RITUAL) and ac:IsType(TYPE_MONSTER) and ac:IsRace(RACE_SPELLCASTER) end function cm.thfilter(c) return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_SPELL) and c:IsAbleToHand() and c:IsFaceup() end function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and cm.thfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(cm.thfilter,tp,LOCATION_REMOVED,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,cm.thfilter,tp,LOCATION_REMOVED,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function cm.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end