--魍影魔 亡降 local m=14060019 local cm=_G["c"..m] function cm.initial_effect(c) --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 deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(m,1)) e2:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_HAND+LOCATION_EXTRA) e2:SetCondition(cm.tdcon) e2:SetTarget(cm.tdtg) e2:SetOperation(cm.tdop) c:RegisterEffect(e2) --defence down local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_UPDATE_DEFENSE) e3:SetRange(LOCATION_MZONE) e3:SetTargetRange(0,LOCATION_MZONE) e3:SetValue(cm.defval) c:RegisterEffect(e3) --cannot special summon local e4=Effect.CreateEffect(c) e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_SPSUMMON_CONDITION) e4:SetValue(aux.FALSE) c:RegisterEffect(e4) 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)*400 end function cm.defval(e,c) local rec=e:GetHandler():GetBaseAttack() if rec<0 then rec=0 end return rec*-1 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) 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.tdcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) and not Duel.IsExistingMatchingCard(Card.IsType,c:GetControler(),LOCATION_GRAVE,0,1,nil,TYPE_MONSTER) end function cm.thfilter(c,e,tp) return c:IsSetCard(0x1406) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToDeck() end Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,LOCATION_HAND+LOCATION_EXTRA) end function cm.tdop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then if Duel.SendtoDeck(c,nil,2,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,2))then Duel.BreakEffect() local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_HAND,0,1,1,nil) if Duel.SendtoGrave(g1,REASON_EFFECT)==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g2=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil) if g2:GetCount()>0 then Duel.SendtoHand(g2,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g2) end end end end