--Nazarelic Apophis function c212555.initial_effect(c) --synchro summon c:EnableReviveLimit() aux.AddSynchroMixProcedure(c,c212555.matfilter1,nil,nil,aux.NonTuner(Card.IsSetCard,0x2609),1,99) --return local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(212555,2)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCondition(c212555.condition) e1:SetOperation(c212555.regop) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(212555,0)) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,212555) e2:SetRange(LOCATION_MZONE) e2:SetTarget(c212555.target) e2:SetOperation(c212555.operation) c:RegisterEffect(e2) --search local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(212555,1)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_TO_DECK) e3:SetCountLimit(1,212556) e3:SetCondition(c212555.rtcon) e3:SetTarget(c212555.thtg) e3:SetOperation(c212555.thop) c:RegisterEffect(e3) end function c212555.matfilter1(c) return c:IsSynchroType(TYPE_TUNER) or (c:IsSynchroType(TYPE_SPIRIT) ) end function c212555.condition(e) return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) end function c212555.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetTarget(c212555.rettg) e1:SetOperation(c212555.retop) e1:SetReset(RESET_EVENT+0x1ec0000+RESET_PHASE+PHASE_END) c:RegisterEffect(e1) end function c212555.rettg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0) end function c212555.retop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SendtoHand(c,nil,REASON_EFFECT) end end function c212555.filter(c) return c:IsFaceup() end function c212555.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c212555.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(c212555.filter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,c212555.filter,tp,0,LOCATION_MZONE,1,1,nil) local atk=g:GetFirst():GetTextAttack() if atk<0 then atk=0 end Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk) end function c212555.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then local atk=tc:GetTextAttack() if atk<0 then atk=0 end if Duel.Destroy(tc,REASON_EFFECT)~=0 then Duel.Damage(1-tp,math.floor(tc:GetBaseAttack()/2),REASON_EFFECT) end end end function c212555.rtfilter(c) return c:IsFaceup() and c:IsSetCard(0x2609) end function c212555.rtcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(c212555.rtfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end function c212555.thfilter(c) return c:IsType(TYPE_MONSTER) and c:IsType(TYPE_SPIRIT) and c:IsAbleToHand() end function c212555.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c212555.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c212555.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c212555.thfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end