--coded by Lyris local s,id=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetCountLimit(1,id) e2:SetCondition(s.tgcon) e2:SetTarget(s.tgtg) e2:SetOperation(s.tgop) c:RegisterEffect(e2) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsDiscardable() end Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD) end function s.thfilter(c) return c:IsSetCard(0x617) and c:IsType(TYPE_FIELD) and c:IsAbleToHand() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function s.tgcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_GRAVE) end function s.filter(c) return c:IsSetCard(0x617) and c:IsSSetable() end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end end function s.tgop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SSet(tp,g:GetFirst()) Duel.ConfirmCards(1-tp,g) end end