--Vampire Noble function c212760.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(212760,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,212760) e1:SetCost(c212760.spcost1) e1:SetTarget(c212760.sptg1) e1:SetOperation(c212760.spop1) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetOperation(c212760.regop) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(212760,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_PHASE+PHASE_BATTLE) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCondition(c212760.spcon) e3:SetTarget(c212760.sptg) e3:SetOperation(c212760.spop) c:RegisterEffect(e3) end function c212760.spcost1(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsDiscardable() and Duel.CheckLPCost(tp,1000) end Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) Duel.PayLPCost(tp,1000) end function c212760.spfilter1(c,e,tp) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x8e) and not c:IsCode(212760) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c212760.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c212760.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function c212760.spop1(e,tp,eg,ep,ev,re,r,rp,chk) if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c212760.spfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetTargetRange(1,0) e1:SetTarget(c212760.splimit) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end function c212760.splimit(e,c) return not c:IsRace(RACE_ZOMBIE) end function c212760.regop(e,tp,eg,ep,ev,re,r,rp) e:GetHandler():RegisterFlagEffect(212760,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE,0,1) end function c212760.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetFlagEffect(212760)~=0 end function c212760.spfilter(c,e,tp,rc,tid) return c:IsReason(REASON_BATTLE) and c:GetReasonCard()==rc and c:GetTurnID()==tid and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c212760.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c212760.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp,e:GetHandler(),Duel.GetTurnCount()) end local g=Duel.GetMatchingGroup(c212760.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e,tp,e:GetHandler(),Duel.GetTurnCount()) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function c212760.spop(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local tg=Duel.GetMatchingGroup(c212760.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e,tp,e:GetHandler(),Duel.GetTurnCount()) if ft<=0 then return end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end local g=nil if tg:GetCount()>ft then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) g=tg:Select(tp,ft,ft,nil) else g=tg end if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end