--灯火之魔女·晨读 local m=28327018 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) --disable spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(79864860,0)) e2:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_SPSUMMON) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,m) e2:SetCondition(cm.ccondition) e2:SetCost(cm.cost) e2:SetTarget(cm.ctarget) e2:SetOperation(cm.coperation) c:RegisterEffect(e2) --tograve local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_TOGRAVE) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,m+900) e3:SetCondition(cm.tgcon) e3:SetTarget(cm.tgtg) e3:SetOperation(cm.tgop) c:RegisterEffect(e3) end function cm.cfilter(c,tp) return c:GetSummonPlayer()==tp and c:IsPreviousLocation(LOCATION_HAND+LOCATION_DECK) end function cm.tgcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(cm.cfilter,1,nil,1-tp) end function cm.tgfilter(c) return c:IsType(TYPE_RITUAL) and c:IsAbleToGrave() end function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end function cm.tgop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoGrave(g,REASON_EFFECT) end end function cm.ccfilter(c,tp) return c:GetSummonPlayer()==tp and c:IsPreviousLocation(LOCATION_EXTRA) end function cm.ccondition(e,tp,eg,ep,ev,re,r,rp) return tp~=ep and eg:IsExists(cm.ccfilter,1,nil,1-tp) and Duel.GetCurrentChain()==0 end function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsCode,1,nil,28327000) end local g=Duel.SelectReleaseGroup(tp,Card.IsCode,1,1,nil,28327000) Duel.Release(g,REASON_COST) end function cm.ctarget(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0) end function cm.coperation(e,tp,eg,ep,ev,re,r,rp,chk) Duel.NegateSummon(eg) Duel.Destroy(eg,REASON_EFFECT) end