--Dayknight Moon local m=88888811 local cm=c88888811 function cm.initial_effect(c) aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xff9a),aux.NonTuner(nil),1) c:EnableReviveLimit() aux.CannotBeEDMaterial(c,nil,LOCATION_MZONE) local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(m,0)) e1:SetCategory(CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,m) e1:SetCondition(cm.rmcon) e1:SetTarget(cm.rmtg) e1:SetOperation(cm.rmop) c:RegisterEffect(e1) local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(m,1)) e4:SetCategory(CATEGORY_DESTROY) e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetCode(EVENT_FREE_CHAIN) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1,m) e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e4:SetCost(cm.descost) e4:SetTarget(cm.destg) e4:SetOperation(cm.desop) c:RegisterEffect(e4) end function cm.costfilter(c) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xff9a) end function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsOnField() and chkc~=c end if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c) Duel.SetOperationInfo(0,CATEGORY_DESTROY,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.Destroy(tc,REASON_EFFECT) end end function cm.rmcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tp=c:GetOwner() local aug = Duel.GetAugment(tp) local threshold=150 return aug >= threshold end function cm.rmfilter(c) return c:IsAbleToRemove() end function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():GetFlagEffect(m)==0 and Duel.IsExistingMatchingCard(cm.rmfilter,tp,0,LOCATION_MZONE,1,nil) end local g=Duel.GetMatchingGroup(cm.rmfilter,tp,0,LOCATION_MZONE,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0) end function cm.rmop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local g=Duel.GetMatchingGroup(cm.rmfilter,tp,0,LOCATION_MZONE,nil) if g:GetCount()>0 then Duel.Remove(g,POS_FACEUP,REASON_EFFECT) end end