--Neo-Tempester Bolt Wyvern function c249001096.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(249001096,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_BE_MATERIAL) e1:SetCondition(c249001096.spcon) e1:SetTarget(c249001096.sptg) e1:SetOperation(c249001096.spop) c:RegisterEffect(e1) --search local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetTarget(c249001096.target) e2:SetOperation(c249001096.operation) c:RegisterEffect(e2) end function c249001096.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsLocation(LOCATION_GRAVE) and (r==REASON_LINK or r==REASON_SYNCHRO) end function c249001096.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) end function c249001096.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_REDIRECT) e1:SetValue(LOCATION_REMOVED) c:RegisterEffect(e1,true) end end function c249001096.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end end function c249001096.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end Duel.ConfirmDecktop(tp,1) local g=Duel.GetDecktopGroup(tp,1) local tc=g:GetFirst() if tc:IsSetCard(0x228) and tc:IsAbleToHand() then Duel.DisableShuffleCheck() if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then Duel.ShuffleHand(tp) local dg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil) if dg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(28553439,0)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local des=dg:Select(tp,1,1,nil) Duel.HintSelection(des) Duel.BreakEffect() Duel.Destroy(des,REASON_EFFECT) end end else Duel.MoveSequence(tc,1) end end