--Moonvale Archer function c10505097.initial_effect(c) --search local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCountLimit(1,10505097) e1:SetOperation(c10505097.regop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) --spsummon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(10505097,1)) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCost(c10505097.spcost) e3:SetTarget(c10505097.sptg) e3:SetOperation(c10505097.spop) c:RegisterEffect(e3) end function c10505097.thfilter(c) return c:IsSetCard(0x1a4) or c:IsSetCard(0x1a5) and c:IsAbleToHand() end function c10505097.regop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1) e1:SetCondition(c10505097.thcon) e1:SetOperation(c10505097.thop) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end function c10505097.thcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(c10505097.thfilter,tp,LOCATION_GRAVE,0,1,nil) end function c10505097.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,10505097) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c10505097.thfilter),tp,LOCATION_GRAVE,0,1,1,nil) if g:GetCount()>0 then Duel.HintSelection(g) Duel.SendtoHand(g,nil,REASON_EFFECT) end end function c10505097.cfilter(c) return c:IsFaceup() and c:IsSetCard(0x1a5) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGraveAsCost() end function c10505097.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c10505097.cfilter,tp,LOCATION_ONFIELD,0,2,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,c10505097.cfilter,tp,LOCATION_ONFIELD,0,2,2,nil) Duel.SendtoGrave(g,REASON_COST) end function c10505097.spfilter(c,e,tp) return c:IsSetCard(0x1a4) and c:GetCode()~=43748308 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c10505097.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c10505097.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c10505097.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,c10505097.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function c10505097.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end