--虚影魔 天煞 local m=14060006 local cm=_G["c"..m] function cm.initial_effect(c) Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK) c:EnableReviveLimit() aux.AddXyzProcedure(c,cm.xyzfilter,2,2,nil,nil,99) --pendulum summon aux.EnablePendulumAttribute(c,false) --base attack local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetCode(EFFECT_SET_BASE_ATTACK) e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e0:SetRange(LOCATION_MZONE) e0:SetValue(cm.atkval) c:RegisterEffect(e0) --to extra local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(m,0)) e1:SetCategory(CATEGORY_TOEXTRA) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_TO_GRAVE) e1:SetTarget(cm.rettg) e1:SetOperation(cm.retop) c:RegisterEffect(e1) --To grave local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(m,1)) e2:SetCategory(CATEGORY_TOGRAVE) e2:SetProperty(EFFECT_FLAG_NO_TURN_RESET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_EXTRA) e2:SetCountLimit(1) e2:SetCondition(cm.tgcon) e2:SetTarget(cm.tgtg) e2:SetOperation(cm.tgop) c:RegisterEffect(e2) end cm.pendulum_level=2 function cm.xyzfilter(c,e,tp) return c:IsRace(RACE_ZOMBIE) and c:IsAttribute(ATTRIBUTE_DARK) end function cm.atkfilter(c,e,tp) return c:IsSetCard(0x1406) and c:IsFaceup() end function cm.atkval(e,c) return Duel.GetMatchingGroupCount(cm.atkfilter,c:GetControler(),LOCATION_DECK+LOCATION_EXTRA,0,nil)*500 end function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return not c:IsForbidden() end Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,c,1,0,0) if c:IsLocation(LOCATION_GRAVE) then Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0) end end function cm.retop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SendtoExtraP(c,tp,REASON_EFFECT) end end function cm.tgcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsFaceup() and not Duel.IsExistingMatchingCard(Card.IsType,c:GetControler(),LOCATION_GRAVE,0,1,nil,TYPE_MONSTER) end function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,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,Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoGrave(g,REASON_EFFECT) end end