--Proto-Summoner 幼千早 function c33701121.initial_effect(c) --pendulum summon aux.EnablePendulumAttribute(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(33701121,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_BE_BATTLE_TARGET) e1:SetRange(LOCATION_PZONE) e1:SetCountLimit(1) e1:SetCondition(c33701121.spcon1) e1:SetTarget(c33701121.sptg1) e1:SetOperation(c33701121.spop1) c:RegisterEffect(e1) --code local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_CHANGE_CODE) e1:SetRange(LOCATION_MZONE+LOCATION_GRAVE) e1:SetValue(33700030) c:RegisterEffect(e1) --search local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(33701121,1)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(c33701121.thtg) e1:SetOperation(c33701121.thop) c:RegisterEffect(e1) --spsummon bgm local e8=Effect.CreateEffect(c) e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e8:SetCode(EVENT_SPSUMMON_SUCCESS) e8:SetOperation(c33701121.sumsuc) c:RegisterEffect(e8) local e9=e8:Clone() e9:SetCode(EVENT_SUMMON_SUCCESS) c:RegisterEffect(e9) end function c33701121.sumsuc(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_MUSIC,0,aux.Stringid(33701121,0)) end function c33701121.thfilter(c) return c:IsLevel(5) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsAbleToHand() end function c33701121.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c33701121.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c33701121.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c33701121.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 function c33701121.spcon1(e,tp,eg,ep,ev,re,r,rp) return Duel.GetAttackTarget() and Duel.GetAttackTarget():IsControler(tp) end function c33701121.spfilter(c,e,tp) return (c:IsLocation(LOCATION_EXTRA) or c:IsFaceup()) and c:IsCode(33700036,33701071) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) end function c33701121.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA) and chkc:IsControler(tp) and c33701121.spfilter(chkc,e,tp) end if chk==0 then return c:IsAbleToRemove() and Duel.GetMZoneCount(tp,c)>0 and Duel.IsExistingTarget(c33701121.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,c33701121.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function c33701121.spop1(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsRelateToEffect(e) and Duel.Remove(c,POS_FACEUP,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_REMOVED) and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK) end end