|
| 1 | +--竜破壊の導き |
| 2 | +--Beacon of Dragon Destroyer |
| 3 | +--scripted by YoshiDuels |
| 4 | +local s,id=GetID() |
| 5 | +function s.initial_effect(c) |
| 6 | + --Activate |
| 7 | + local e1=Effect.CreateEffect(c) |
| 8 | + e1:SetDescription(aux.Stringid(id,0)) |
| 9 | + e1:SetCategory(CATEGORY_SPECIAL_SUMMON) |
| 10 | + e1:SetType(EFFECT_TYPE_ACTIVATE) |
| 11 | + e1:SetCode(EVENT_FREE_CHAIN) |
| 12 | + e1:SetCondition(s.condition) |
| 13 | + e1:SetTarget(s.target) |
| 14 | + e1:SetOperation(s.activate) |
| 15 | + c:RegisterEffect(e1) |
| 16 | + aux.GlobalCheck(s,function() |
| 17 | + local ge1=Effect.CreateEffect(c) |
| 18 | + ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) |
| 19 | + ge1:SetCode(EVENT_CHAIN_SOLVED) |
| 20 | + ge1:SetOperation(s.checkop) |
| 21 | + Duel.RegisterEffect(ge1,0) |
| 22 | + end) |
| 23 | +end |
| 24 | +function s.checkop(e,tp,eg,ep,ev,re,r,rp) |
| 25 | + if re:GetHandler():IsCode(160218066) then |
| 26 | + Duel.RegisterFlagEffect(rp,id,RESET_PHASE|PHASE_END,0,1) |
| 27 | + end |
| 28 | +end |
| 29 | +function s.condition(e,tp,eg,ep,ev,re,r,rp) |
| 30 | + return Duel.GetFlagEffect(tp,id)==0 |
| 31 | +end |
| 32 | +function s.filter(c,e,tp) |
| 33 | + return c:IsRace(RACE_WARRIOR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) |
| 34 | +end |
| 35 | +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) |
| 36 | + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 |
| 37 | + and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end |
| 38 | + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) |
| 39 | +end |
| 40 | +function s.activate(e,tp,eg,ep,ev,re,r,rp) |
| 41 | + --Effect |
| 42 | + if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end |
| 43 | + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) |
| 44 | + local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst() |
| 45 | + if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)>0 then |
| 46 | + if Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,78193831),tp,LOCATION_MZONE,0,1,nil) and Duel.IsPlayerCanDraw(tp,2) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then |
| 47 | + Duel.BreakEffect() |
| 48 | + Duel.Draw(tp,2,REASON_EFFECT) |
| 49 | + end |
| 50 | + end |
| 51 | +end |
0 commit comments