|
1 | | ---No.91 サンダー・スパーク・ドラゴン |
| 1 | +--No.91 サンダー・スパーク・ドラゴン |
2 | 2 | --Number 91: Thunder Spark Dragon |
3 | 3 | local s,id=GetID() |
4 | 4 | function s.initial_effect(c) |
5 | | - --xyz summon |
6 | | - Xyz.AddProcedure(c,nil,4,3) |
7 | 5 | c:EnableReviveLimit() |
8 | | - --destroy1 |
| 6 | + --Xyz Summon procedure: 3 Level 4 monsters |
| 7 | + Xyz.AddProcedure(c,nil,4,3) |
| 8 | + --Activate 1 of these effects |
9 | 9 | local e1=Effect.CreateEffect(c) |
10 | 10 | e1:SetDescription(aux.Stringid(id,0)) |
11 | 11 | e1:SetCategory(CATEGORY_DESTROY) |
12 | 12 | e1:SetType(EFFECT_TYPE_IGNITION) |
13 | 13 | e1:SetRange(LOCATION_MZONE) |
14 | | - e1:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) |
15 | | - e1:SetCost(s.cost1) |
16 | | - e1:SetTarget(s.target1) |
17 | | - e1:SetOperation(s.operation1) |
| 14 | + e1:SetCountLimit(1) |
| 15 | + e1:SetCost(Cost.Choice( |
| 16 | + {Cost.Detach(3),aux.Stringid(id,1),s.desmonscheck}, |
| 17 | + {Cost.Detach(5),aux.Stringid(id,2),s.desallcheck} |
| 18 | + )) |
| 19 | + e1:SetTarget(s.destg) |
| 20 | + e1:SetOperation(s.desop) |
18 | 21 | c:RegisterEffect(e1) |
19 | | - --destroy2 |
20 | | - local e2=Effect.CreateEffect(c) |
21 | | - e2:SetDescription(aux.Stringid(id,1)) |
22 | | - e2:SetCategory(CATEGORY_DESTROY) |
23 | | - e2:SetType(EFFECT_TYPE_IGNITION) |
24 | | - e2:SetRange(LOCATION_MZONE) |
25 | | - e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) |
26 | | - e2:SetCost(s.cost2) |
27 | | - e2:SetTarget(s.target2) |
28 | | - e2:SetOperation(s.operation2) |
29 | | - c:RegisterEffect(e2) |
30 | 22 | end |
31 | 23 | s.xyz_number=91 |
32 | | -function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk) |
33 | | - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,3,REASON_COST) end |
34 | | - Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) |
35 | | - e:GetHandler():RemoveOverlayCard(tp,3,3,REASON_COST) |
36 | | -end |
37 | | -function s.target1(e,tp,eg,ep,ev,re,r,rp,chk) |
38 | | - if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end |
39 | | - local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler()) |
40 | | - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) |
41 | | -end |
42 | | -function s.operation1(e,tp,eg,ep,ev,re,r,rp) |
43 | | - local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler()) |
44 | | - Duel.Destroy(g,REASON_EFFECT) |
| 24 | +function s.desmonscheck(e,tp,eg,ep,ev,re,r,rp,chk) |
| 25 | + return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) |
45 | 26 | end |
46 | | -function s.cost2(e,tp,eg,ep,ev,re,r,rp,chk) |
47 | | - if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,5,REASON_COST) end |
48 | | - Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) |
49 | | - e:GetHandler():RemoveOverlayCard(tp,5,5,REASON_COST) |
| 27 | +function s.desallcheck(e,tp,eg,ep,ev,re,r,rp,chk) |
| 28 | + return Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>0 |
50 | 29 | end |
51 | | -function s.target2(e,tp,eg,ep,ev,re,r,rp,chk) |
52 | | - if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end |
53 | | - local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) |
| 30 | +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) |
| 31 | + if chk==0 then return true end |
| 32 | + local g=e:GetLabel()==1 |
| 33 | + and Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler()) |
| 34 | + or Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) |
54 | 35 | Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) |
55 | 36 | end |
56 | | -function s.operation2(e,tp,eg,ep,ev,re,r,rp) |
57 | | - local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) |
58 | | - Duel.Destroy(g,REASON_EFFECT) |
| 37 | +function s.desop(e,tp,eg,ep,ev,re,r,rp) |
| 38 | + local g=e:GetLabel()==1 |
| 39 | + and Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler()) |
| 40 | + or Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) |
| 41 | + if #g>0 then |
| 42 | + Duel.Destroy(g,REASON_EFFECT) |
| 43 | + end |
59 | 44 | end |
0 commit comments