Skip to content

Commit ae69189

Browse files
committed
More replacements
1 parent e6f6465 commit ae69189

6 files changed

+27
-45
lines changed

official/c15939229.lua

+5-8
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,13 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
6666
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
6767
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
6868
end
69-
function s.desfilter(c)
70-
return c:IsType(TYPE_SPELL+TYPE_TRAP)
71-
end
7269
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
73-
if chk==0 then return Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
74-
local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
70+
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
71+
local g=Duel.GetMatchingGroup(Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
7572
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
7673
end
7774
function s.desop(e,tp,eg,ep,ev,re,r,rp)
78-
local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
75+
local g=Duel.GetMatchingGroup(Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
7976
Duel.Destroy(g,REASON_EFFECT)
8077
end
8178
function s.setfilter(c)
@@ -91,7 +88,7 @@ function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
9188
end
9289
function s.setop(e,tp,eg,ep,ev,re,r,rp)
9390
local tc=Duel.GetFirstTarget()
94-
if tc and tc:IsRelateToEffect(e) and tc:IsSSetable() then
91+
if tc:IsRelateToEffect(e) and tc:IsSSetable() then
9592
Duel.SSet(tp,tc)
9693
end
97-
end
94+
end

official/c16956455.lua

+4-7
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,16 @@ function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
2121
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
2222
Duel.DiscardHand(tp,s.cfilter,1,1,REASON_COST+REASON_DISCARD)
2323
end
24-
function s.filter(c)
25-
return c:IsType(TYPE_SPELL+TYPE_TRAP)
26-
end
2724
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
28-
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and s.filter(chkc) end
29-
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_ONFIELD,1,nil) end
25+
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsSpellTrap() end
26+
if chk==0 then return Duel.IsExistingTarget(Card.IsSpellTrap,tp,0,LOCATION_ONFIELD,1,nil) end
3027
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
31-
local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
28+
local g=Duel.SelectTarget(tp,Card.IsSpellTrap,tp,0,LOCATION_ONFIELD,1,1,nil)
3229
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
3330
end
3431
function s.desop(e,tp,eg,ep,ev,re,r,rp)
3532
local tc=Duel.GetFirstTarget()
3633
if tc:IsRelateToEffect(e) then
3734
Duel.Destroy(tc,REASON_EFFECT)
3835
end
39-
end
36+
end

official/c17045014.lua

+4-7
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,16 @@ function s.initial_effect(c)
1313
e1:SetOperation(s.desop)
1414
c:RegisterEffect(e1)
1515
end
16-
function s.desfilter(c)
17-
return c:IsType(TYPE_SPELL+TYPE_TRAP)
18-
end
1916
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
20-
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and s.desfilter(chkc) end
17+
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsSpellTrap() end
2118
if chk==0 then return true end
2219
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
23-
local g=Duel.SelectTarget(tp,s.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
20+
local g=Duel.SelectTarget(tp,Card.IsSpellTrap,tp,0,LOCATION_ONFIELD,1,1,nil)
2421
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
2522
end
2623
function s.desop(e,tp,eg,ep,ev,re,r,rp)
2724
local tc=Duel.GetFirstTarget()
28-
if tc and tc:IsRelateToEffect(e) then
25+
if tc:IsRelateToEffect(e) then
2926
Duel.Destroy(tc,REASON_EFFECT)
3027
end
31-
end
28+
end

official/c17760003.lua

+6-9
Original file line numberDiff line numberDiff line change
@@ -99,19 +99,16 @@ function s.operation1(e,tp,eg,ep,ev,re,r,rp)
9999
local sg=g:RandomSelect(tp,1)
100100
Duel.SendtoGrave(sg,REASON_EFFECT)
101101
end
102-
function s.filter2(c)
103-
return c:IsType(TYPE_SPELL+TYPE_TRAP)
104-
end
105102
function s.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
106-
if chkc then return chkc:IsOnField() and s.filter2(chkc) end
107-
if chk==0 then return Duel.IsExistingTarget(s.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
103+
if chkc then return chkc:IsOnField() and chkc:IsSpellTrap() end
104+
if chk==0 then return Duel.IsExistingTarget(Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
108105
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
109-
local g=Duel.SelectTarget(tp,s.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
106+
local g=Duel.SelectTarget(tp,Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
110107
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
111108
end
112109
function s.operation2(e,tp,eg,ep,ev,re,r,rp)
113110
local tc=Duel.GetFirstTarget()
114-
if tc and tc:IsRelateToEffect(e) then
111+
if tc:IsRelateToEffect(e) then
115112
Duel.Destroy(tc,REASON_EFFECT)
116113
end
117114
end
@@ -129,8 +126,8 @@ function s.target3(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
129126
end
130127
function s.operation3(e,tp,eg,ep,ev,re,r,rp)
131128
local tc=Duel.GetFirstTarget()
132-
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
129+
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
133130
Duel.Destroy(tc,REASON_EFFECT)
134131
Duel.Draw(tp,1,REASON_EFFECT)
135132
end
136-
end
133+
end

official/c17810268.lua

+4-7
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,16 @@ function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
5151
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x1019,2,REASON_COST) end
5252
e:GetHandler():RemoveCounter(tp,0x1019,2,REASON_COST)
5353
end
54-
function s.filter(c)
55-
return c:IsType(TYPE_SPELL+TYPE_TRAP)
56-
end
5754
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
58-
if chkc then return chkc:IsOnField() and s.filter(chkc) end
59-
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
55+
if chkc then return chkc:IsOnField() and chkc:IsSpellTrap() end
56+
if chk==0 then return Duel.IsExistingTarget(Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
6057
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
61-
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
58+
local g=Duel.SelectTarget(tp,Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
6259
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
6360
end
6461
function s.desop(e,tp,eg,ep,ev,re,r,rp)
6562
local tc=Duel.GetFirstTarget()
6663
if tc:IsRelateToEffect(e) then
6764
Duel.Destroy(tc,REASON_EFFECT)
6865
end
69-
end
66+
end

official/c1781310.lua

+4-7
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ function s.initial_effect(c)
1313
e1:SetOperation(s.activate)
1414
c:RegisterEffect(e1)
1515
end
16-
function s.dfilter2(c)
17-
return c:IsType(TYPE_SPELL+TYPE_TRAP)
18-
end
1916
function s.condition(e,tp,eg,ep,ev,re,r,rp)
2017
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsAttribute,ATTRIBUTE_WIND),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
2118
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsAttribute,ATTRIBUTE_WATER),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
@@ -24,7 +21,7 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp)
2421
end
2522
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
2623
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil)
27-
or Duel.IsExistingMatchingCard(s.dfilter2,tp,0,LOCATION_ONFIELD,1,nil)
24+
or Duel.IsExistingMatchingCard(Card.IsSpellTrap,tp,0,LOCATION_ONFIELD,1,nil)
2825
or Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>=2
2926
or Duel.IsPlayerCanDraw(tp,2) end
3027
end
@@ -37,7 +34,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
3734
opval[off-1]=1
3835
off=off+1
3936
end
40-
if Duel.IsExistingMatchingCard(s.dfilter2,tp,0,LOCATION_ONFIELD,1,nil) then
37+
if Duel.IsExistingMatchingCard(Card.IsSpellTrap,tp,0,LOCATION_ONFIELD,1,nil) then
4138
ops[off]=aux.Stringid(id,1)
4239
opval[off-1]=2
4340
off=off+1
@@ -58,12 +55,12 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
5855
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
5956
Duel.Destroy(g,REASON_EFFECT)
6057
elseif opval[op]==2 then
61-
local g=Duel.GetMatchingGroup(s.dfilter2,tp,0,LOCATION_ONFIELD,nil)
58+
local g=Duel.GetMatchingGroup(Card.IsSpellTrap,tp,0,LOCATION_ONFIELD,nil)
6259
Duel.Destroy(g,REASON_EFFECT)
6360
elseif opval[op]==3 then
6461
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(1-tp,2)
6562
Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD)
6663
elseif opval[op]==4 then
6764
Duel.Draw(tp,2,REASON_EFFECT)
6865
end
69-
end
66+
end

0 commit comments

Comments
 (0)