|
| 1 | +--対峙する黒竜 |
| 2 | +--Confronting the Black Dragon |
| 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_POSITION+CATEGORY_TOHAND) |
| 10 | + e1:SetType(EFFECT_TYPE_ACTIVATE) |
| 11 | + e1:SetCode(EVENT_SUMMON_SUCCESS) |
| 12 | + e1:SetCondition(s.condition) |
| 13 | + e1:SetTarget(s.target) |
| 14 | + e1:SetOperation(s.operation) |
| 15 | + c:RegisterEffect(e1) |
| 16 | +end |
| 17 | +function s.cfilter(c) |
| 18 | + return c:IsFaceup() and c:IsLevelAbove(7) and c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_FIRE|ATTRIBUTE_DARK) |
| 19 | +end |
| 20 | +function s.condition(e,tp,eg,ep,ev,re,r,rp) |
| 21 | + if #eg~=1 then return false end |
| 22 | + local tc=eg:GetFirst() |
| 23 | + return tc:IsFaceup() and tc:IsType(TYPE_EFFECT) and tc:IsCanTurnSet() and tc:IsCanChangePositionRush() |
| 24 | + and tc:IsSummonPlayer(1-tp) and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) |
| 25 | +end |
| 26 | +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) |
| 27 | + if chk==0 then return true end |
| 28 | + Duel.SetOperationInfo(0,CATEGORY_POSITION,eg:GetFirst(),1,0,0) |
| 29 | + Duel.SetPossibleOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,1) |
| 30 | +end |
| 31 | +function s.operation(e,tp,eg,ep,ev,re,r,rp) |
| 32 | + local tc=eg:GetFirst() |
| 33 | + local dg=Duel.GetFieldGroup(tp,0,LOCATION_HAND) |
| 34 | + if Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)>0 and #dg>=3 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then |
| 35 | + local g=dg:RandomSelect(tp,1) |
| 36 | + Duel.SendtoGrave(g,REASON_EFFECT) |
| 37 | + end |
| 38 | +end |
0 commit comments