--La Viandante AoJ Maga, Demetria --Script by XGlitchy30 function c19772588.initial_effect(c) c:EnableReviveLimit() --to hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(19772588,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(c19772588.thcon) e1:SetTarget(c19772588.thtg) e1:SetOperation(c19772588.thop) c:RegisterEffect(e1) --atklimit local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_CANNOT_ATTACK) e2:SetCondition(c19772588.atkcon) c:RegisterEffect(e2) --spsummon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(19772588,1)) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCondition(c19772588.spcon) e3:SetTarget(c19772588.sptg) e3:SetOperation(c19772588.spop) c:RegisterEffect(e3) end --filters function c19772588.thfilter(c) return c:IsSetCard(0x197) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() end function c19772588.spfilter(c,e,tp) return c:IsSetCard(0x197) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) end --to hand function c19772588.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL) end function c19772588.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c19772588.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c19772588.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c19772588.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 --atklimit function c19772588.atkcon(e) return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_HAND,0)>=Duel.GetFieldGroupCount(1-e:GetHandlerPlayer(),LOCATION_HAND,0) end --spsummon function c19772588.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)0 and Duel.IsExistingMatchingCard(c19772588.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function c19772588.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c19772588.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end