|
| 1 | +--流聖のプリアージュ |
| 2 | +--Pliage the Sacred Shooting Star |
| 3 | +--Scripted by YoshiDuels |
| 4 | +local s,id=GetID() |
| 5 | +function s.initial_effect(c) |
| 6 | + --Add card to hand |
| 7 | + local e1=Effect.CreateEffect(c) |
| 8 | + e1:SetDescription(aux.Stringid(id,0)) |
| 9 | + e1:SetCategory(CATEGORY_TOHAND) |
| 10 | + e1:SetType(EFFECT_TYPE_IGNITION) |
| 11 | + e1:SetRange(LOCATION_MZONE) |
| 12 | + e1:SetCountLimit(1) |
| 13 | + e1:SetCondition(s.condition) |
| 14 | + e1:SetTarget(s.target) |
| 15 | + e1:SetOperation(s.operation) |
| 16 | + c:RegisterEffect(e1) |
| 17 | + aux.GlobalCheck(s,function() |
| 18 | + local ge1=Effect.CreateEffect(c) |
| 19 | + ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) |
| 20 | + ge1:SetCode(EVENT_DRAW) |
| 21 | + ge1:SetOperation(s.checkop) |
| 22 | + Duel.RegisterEffect(ge1,0) |
| 23 | + end) |
| 24 | +end |
| 25 | +s.listed_names={160204045,160212074} |
| 26 | +function s.checkop(e,tp,eg,ep,ev,re,r,rp) |
| 27 | + if Duel.IsMainPhase() then |
| 28 | + Duel.RegisterFlagEffect(rp,id,RESET_PHASE|PHASE_END,0,1) |
| 29 | + end |
| 30 | +end |
| 31 | +function s.condition(e,tp,eg,ep,ev,re,r,rp) |
| 32 | + return Duel.GetFlagEffect(tp,id)==0 |
| 33 | +end |
| 34 | +function s.thfilter(c) |
| 35 | + return c:IsCode(160204045,160212074) and c:IsAbleToHand() |
| 36 | +end |
| 37 | +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) |
| 38 | + if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsPlayerCanDraw(tp,1) end |
| 39 | + Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) |
| 40 | +end |
| 41 | +function s.operation(e,tp,eg,ep,ev,re,r,rp) |
| 42 | + --Effect |
| 43 | + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) |
| 44 | + local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler()) |
| 45 | + if #g>0 then |
| 46 | + Duel.SendtoHand(g,nil,REASON_EFFECT) |
| 47 | + Duel.ConfirmCards(1-tp,g) |
| 48 | + Duel.BreakEffect() |
| 49 | + Duel.Draw(tp,1,REASON_EFFECT) |
| 50 | + end |
| 51 | +end |
0 commit comments