--黯食偶像的柱山 function c65040008.initial_effect(c) --Activate local e0=Effect.CreateEffect(c) e0:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetCode(EVENT_FREE_CHAIN) e0:SetCountLimit(1,65040008) e0:SetTarget(c65040008.target) e0:SetOperation(c65040008.activate) c:RegisterEffect(e0) --choose local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_FZONE) e1:SetCountLimit(1,65040108) e1:SetCondition(c65040008.thcon) e1:SetCost(c65040008.thcost) e1:SetTarget(c65040008.thtg) e1:SetOperation(c65040008.thop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCategory(CATEGORY_DRAW) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCondition(c65040008.drcon) e2:SetTarget(c65040008.drtg) e2:SetOperation(c65040008.drop) c:RegisterEffect(e2) end function c65040008.drcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()~=tp end function c65040008.drtg(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 c65040008.drop(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 function c65040008.thcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()==tp end function c65040008.cfilter(c) return c:IsSetCard(0x3da3) and c:IsType(TYPE_MONSTER) and c:IsReleasable() end function c65040008.thcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c65040008.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end local sg=Duel.SelectMatchingCard(tp,c65040008.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil) Duel.Release(sg,REASON_COST) end function c65040008.thfil(c) return c:IsSetCard(0x3da3) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function c65040008.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c65040008.thfil,tp,LOCATION_GRAVE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_GRAVE) end function c65040008.thop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.SelectMatchingCard(tp,c65040008.thfil,tp,LOCATION_GRAVE,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,tp,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function c65040008.filter(c) return c:IsSetCard(0x3da3) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function c65040008.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c65040008.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c65040008.activate(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c65040008.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