--created by manu, coded by Lyris local s,id=GetID() function s.initial_effect(c) Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCategory(CATEGORY_TODECK+CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_REMOVE) 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_F) e2:SetCode(EVENT_DRAW) e2:SetCountLimit(1,id+100) e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) e2:SetCondition(function(e,tp) return e:GetHandler():GetOwner()~=tp end) e2:SetCost(s.cost) e2:SetTarget(s.tg) e2:SetOperation(s.op) c:RegisterEffect(e2) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not e:GetHandler():IsPublic() end end function s.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 s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.ConfirmDecktop(tp,1) local g=Duel.GetDecktopGroup(tp,1) local tc=g:GetFirst() if not tc then return end if tc:IsSetCard(0x70b) and tc:GetOwner()==tp then local c=e:GetHandler() local seq=c:IsHasEffect(id+3) and 0 or 2 Duel.SendtoDeck(c,1-tp,seq,REASON_EFFECT) if not c:IsLocation(LOCATION_DECK) then return end if seq>0 then Duel.ShuffleDeck(1-tp) end c:ReverseInDeck() Duel.SendtoHand(tc,nil,REASON_EFFECT) elseif tc:IsAbleToRemove() then Duel.DisableShuffleCheck() Duel.Remove(tc,POS_FACEDOWN,REASON_EFFECT) end end function s.tg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsRelateToEffect(e) end Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,1-tp,2) end function s.op(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,tp,2,REASON_EFFECT) and c:IsLocation(LOCATION_DECK) then Duel.ShuffleDeck(tp) c:ReverseInDeck() Duel.Draw(1-tp,2,REASON_EFFECT) end end