|
| 1 | +--いとをかしねこ |
| 2 | +--Grace Cat |
| 3 | +--scripted by YoshiDuels |
| 4 | +local s,id=GetID() |
| 5 | +function s.initial_effect(c) |
| 6 | + --Excavate the top 6 cards of your Deck and add cards to the hand |
| 7 | + local e1=Effect.CreateEffect(c) |
| 8 | + e1:SetDescription(aux.Stringid(id,0)) |
| 9 | + e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) |
| 10 | + e1:SetType(EFFECT_TYPE_IGNITION) |
| 11 | + e1:SetRange(LOCATION_MZONE) |
| 12 | + e1:SetCountLimit(1) |
| 13 | + e1:SetCost(s.cost) |
| 14 | + e1:SetTarget(s.target) |
| 15 | + e1:SetOperation(s.operation) |
| 16 | + c:RegisterEffect(e1) |
| 17 | +end |
| 18 | +s.listed_names={160004013} |
| 19 | +function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) |
| 20 | + local c=e:GetHandler() |
| 21 | + if chk==0 then return c:IsAttackPos() and c:IsCanChangePositionRush() end |
| 22 | +end |
| 23 | +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) |
| 24 | + if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=6 end |
| 25 | + Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) |
| 26 | +end |
| 27 | +function s.filter(c) |
| 28 | + return c:IsCode(160004013) and c:IsAbleToHand() |
| 29 | +end |
| 30 | +function s.operation(e,tp,eg,ep,ev,re,r,rp) |
| 31 | + --Requirement |
| 32 | + if Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE,0,0,0)<1 then return end |
| 33 | + --Effect |
| 34 | + if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<6 then return end |
| 35 | + Duel.ConfirmDecktop(tp,6) |
| 36 | + local g=Duel.GetDecktopGroup(tp,6) |
| 37 | + Duel.DisableShuffleCheck() |
| 38 | + if g:IsExists(s.filter,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then |
| 39 | + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) |
| 40 | + local tg=g:FilterSelect(tp,s.filter,1,1,nil) |
| 41 | + if #tg>0 then |
| 42 | + Duel.SendtoHand(tg,nil,REASON_EFFECT) |
| 43 | + Duel.ConfirmCards(1-tp,tg) |
| 44 | + Duel.ShuffleHand(tp) |
| 45 | + g:RemoveCard(tg) |
| 46 | + end |
| 47 | + end |
| 48 | + local ct=#g |
| 49 | + if ct>0 then |
| 50 | + Duel.MoveToDeckBottom(ct,tp) |
| 51 | + Duel.SortDeckbottom(tp,tp,ct) |
| 52 | + end |
| 53 | +end |
0 commit comments