Skip to content

Commit 2286dfd

Browse files
committed
update "Number 91: Thunder Spark Dragon"
1 parent 275e8d5 commit 2286dfd

1 file changed

Lines changed: 27 additions & 42 deletions

File tree

official/c84417082.lua

Lines changed: 27 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,44 @@
1-
--No.91 サンダー・スパーク・ドラゴン
1+
--No.91 サンダー・スパーク・ドラゴン
22
--Number 91: Thunder Spark Dragon
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--xyz summon
6-
Xyz.AddProcedure(c,nil,4,3)
75
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
99
local e1=Effect.CreateEffect(c)
1010
e1:SetDescription(aux.Stringid(id,0))
1111
e1:SetCategory(CATEGORY_DESTROY)
1212
e1:SetType(EFFECT_TYPE_IGNITION)
1313
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)
1821
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)
3022
end
3123
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())
4526
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
5029
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)
5435
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
5536
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
5944
end

0 commit comments

Comments
 (0)