--Latenshi Recoded function c249000980.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(87774234,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_TO_HAND) e1:SetCondition(c249000980.condition) e1:SetTarget(c249000980.target) e1:SetOperation(c249000980.operation) c:RegisterEffect(e1) --search local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DRAW) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_BE_MATERIAL) e2:SetCondition(c249000980.drcon) e2:SetTarget(c249000980.drtg) e2:SetOperation(c249000980.drop) c:RegisterEffect(e2) end function c249000980.condition(e,tp,eg,ep,ev,re,r,rp) return bit.band(r,REASON_EFFECT)~=0 end function c249000980.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function c249000980.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end function c249000980.drcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsLocation(LOCATION_GRAVE) and r==REASON_LINK end function c249000980.drfilter(c) return (c:IsSetCard(0x1FE) or c:IsCode(70238111)) and c:IsAbleToDeck() and not c:IsCode(249000980) end function c249000980.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c249000980.drfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function c249000980.drop(e,tp,eg,ep,ev,re,r,rp) if not Duel.IsExistingMatchingCard(c249000980.drfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) then return end local g=Duel.SelectMatchingCard(tp,c249000980.drfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil) Duel.ShuffleDeck(tp) Duel.SendtoDeck(g,nil,2,REASON_EFFECT) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) end