--Cassiopeia of the Sands function c11000149.initial_effect(c) --Add local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(11000149,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(c11000149.target) e1:SetOperation(c11000149.operation) c:RegisterEffect(e1) --Draw local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(11000101,0)) e2:SetCategory(CATEGORY_DRAW) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(c11000149.condition) e2:SetCost(c11000149.cost) e2:SetTarget(c11000149.target2) e2:SetOperation(c11000149.operation2) c:RegisterEffect(e2) end function c11000149.filter(c) return c:IsCode(11000144) and c:IsAbleToHand() end function c11000149.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c11000149.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c11000149.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c11000149.filter,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 c11000149.cfilter(c) return c:IsFaceup() and c:IsCode(11000144) end function c11000149.condition(e) local tp=e:GetHandlerPlayer() return Duel.IsExistingMatchingCard(c11000149.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end function c11000149.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckLPCost(tp,500) end Duel.PayLPCost(tp,500) end function c11000149.target2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function c11000149.operation2(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) end