|
| 1 | +--速撃の騎士 |
| 2 | +--Quick Attack Knight |
| 3 | +--scripted by YoshiDuels |
| 4 | +local s,id=GetID() |
| 5 | +function s.initial_effect(c) |
| 6 | + --Send to GY |
| 7 | + local e1=Effect.CreateEffect(c) |
| 8 | + e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TOHAND) |
| 9 | + e1:SetType(EFFECT_TYPE_IGNITION) |
| 10 | + e1:SetRange(LOCATION_MZONE) |
| 11 | + e1:SetCountLimit(1) |
| 12 | + e1:SetCost(s.cost) |
| 13 | + e1:SetTarget(s.target) |
| 14 | + e1:SetOperation(s.operation) |
| 15 | + c:RegisterEffect(e1) |
| 16 | +end |
| 17 | +s.listed_names={55761792,160216039} |
| 18 | +function s.cfilter(c) |
| 19 | + return c:IsMonster() and c:IsAttack(500) and c:IsDefense(1000) and c:IsLevel(4) and not c:IsPublic() |
| 20 | +end |
| 21 | +function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) |
| 22 | + if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) or Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end |
| 23 | +end |
| 24 | +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) |
| 25 | + if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end |
| 26 | + Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) |
| 27 | +end |
| 28 | +function s.thfilter(c) |
| 29 | + return c:IsCode(55761792,160216039) and c:IsAbleToHand() |
| 30 | +end |
| 31 | +function s.operation(e,tp,eg,ep,ev,re,r,rp) |
| 32 | + --Requirement |
| 33 | + local b1=Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) |
| 34 | + local b2=Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) |
| 35 | + local op=Duel.SelectEffect(tp,{b1,aux.Stringid(id,1)},{b2,aux.Stringid(id,2)}) |
| 36 | + if op==1 then |
| 37 | + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) |
| 38 | + local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,nil) |
| 39 | + if Duel.SendtoGrave(g,REASON_COST)<1 then return end |
| 40 | + elseif op==2 then |
| 41 | + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) |
| 42 | + local tc=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,nil) |
| 43 | + Duel.ConfirmCards(1-tp,tc) |
| 44 | + Duel.ShuffleHand(tp) |
| 45 | + end |
| 46 | + --Effect |
| 47 | + if Duel.DiscardDeck(tp,1,REASON_EFFECT)==0 then return end |
| 48 | + if Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then |
| 49 | + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) |
| 50 | + local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE,0,1,1,nil) |
| 51 | + if #g>0 then |
| 52 | + Duel.BreakEffect() |
| 53 | + Duel.SendtoHand(g,nil,REASON_EFFECT) |
| 54 | + Duel.ConfirmCards(1-tp,g) |
| 55 | + end |
| 56 | + end |
| 57 | +end |
0 commit comments