Skip to content

Commit bc5788a

Browse files
authored
Fixed effects that set cards to the opponent's field (#1182)
1 parent b42616f commit bc5788a

File tree

8 files changed

+58
-68
lines changed

8 files changed

+58
-68
lines changed

official/c23002292.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ local s,id=GetID()
44
function s.initial_effect(c)
55
--Negate the activation of a Trap Card
66
local e1=Effect.CreateEffect(c)
7+
e1:SetDescription(aux.Stringid(id,0))
78
e1:SetCategory(CATEGORY_NEGATE)
89
e1:SetType(EFFECT_TYPE_ACTIVATE)
910
e1:SetCode(EVENT_CHAINING)
@@ -14,16 +15,15 @@ function s.initial_effect(c)
1415
c:RegisterEffect(e1)
1516
--Can be activated from the hand
1617
local e2=Effect.CreateEffect(c)
17-
e2:SetDescription(aux.Stringid(id,2))
18+
e2:SetDescription(aux.Stringid(id,1))
1819
e2:SetType(EFFECT_TYPE_SINGLE)
1920
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
2021
e2:SetValue(function(e,c) e:SetLabel(1) end)
2122
c:RegisterEffect(e2)
2223
e1:SetLabelObject(e2)
2324
end
2425
function s.condition(e,tp,eg,ep,ev,re,r,rp)
25-
return rp~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE)
26-
and re:IsTrapEffect() and Duel.IsChainNegatable(ev)
26+
return rp==1-tp and re:IsTrapEffect() and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
2727
end
2828
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
2929
if chk==0 then e:GetLabelObject():SetLabel(0) return true end
@@ -32,8 +32,8 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
3232
Duel.PayLPCost(tp,Duel.GetLP(tp)//2)
3333
end
3434
end
35-
function s.setfilter(c)
36-
return c:IsTrap() and c:IsSSetable(true)
35+
function s.setfilter(c,tp)
36+
return c:IsTrap() and c:IsSSetable(false,1-tp)
3737
end
3838
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
3939
if chk==0 then return true end
@@ -47,15 +47,15 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
4747
rc:SetStatus(STATUS_ACTIVATE_DISABLED,false)
4848
rc:SetStatus(STATUS_SET_TURN,false)
4949
Duel.RaiseEvent(rc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
50-
local g=Duel.GetMatchingGroup(s.setfilter,tp,0,LOCATION_DECK,nil)
51-
if #g>0 and Duel.GetLocationCount(1-tp,LOCATION_SZONE)>0 and Duel.SelectYesNo(1-tp,aux.Stringid(id,0)) then
50+
local g=Duel.GetMatchingGroup(s.setfilter,tp,0,LOCATION_DECK,nil,tp)
51+
if #g>0 and Duel.GetLocationCount(1-tp,LOCATION_SZONE)>0 and Duel.SelectYesNo(1-tp,aux.Stringid(id,2)) then
5252
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
5353
local sg=g:Select(1-tp,1,1,nil)
5454
Duel.SSet(1-tp,sg:GetFirst())
5555
end
5656
end
5757
local e1=Effect.CreateEffect(e:GetHandler())
58-
e1:SetDescription(aux.Stringid(id,1))
58+
e1:SetDescription(aux.Stringid(id,3))
5959
e1:SetType(EFFECT_TYPE_FIELD)
6060
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
6161
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)

official/c47766694.lua

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
--Wild Tornado
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--Activate
5+
--Destroy 1 face-up card in the Spell/Trap Zone
66
local e1=Effect.CreateEffect(c)
7+
e1:SetDescription(aux.Stringid(id,0))
78
e1:SetCategory(CATEGORY_DESTROY)
89
e1:SetType(EFFECT_TYPE_ACTIVATE)
910
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
1011
e1:SetCode(EVENT_FREE_CHAIN)
1112
e1:SetTarget(s.target)
1213
e1:SetOperation(s.activate)
1314
c:RegisterEffect(e1)
14-
--Destroy
15+
--Destroy 1 face-up card on the field
1516
local e2=Effect.CreateEffect(c)
1617
e2:SetDescription(aux.Stringid(id,1))
1718
e2:SetCategory(CATEGORY_DESTROY)
@@ -23,21 +24,19 @@ function s.initial_effect(c)
2324
e2:SetOperation(s.desop)
2425
c:RegisterEffect(e2)
2526
end
26-
function s.filter(c)
27-
return c:IsFaceup() and c:GetSequence()<5
28-
end
2927
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
30-
if chkc then return chkc:IsLocation(LOCATION_SZONE) and s.filter(chkc) and chkc~=e:GetHandler() end
31-
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,e:GetHandler()) end
28+
local c=e:GetHandler()
29+
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsFaceup() and chkc~=c end
30+
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_STZONE,LOCATION_STZONE,1,c) end
3231
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
33-
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,e:GetHandler())
32+
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_STZONE,LOCATION_STZONE,1,1,c)
3433
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
3534
end
3635
function s.activate(e,tp,eg,ep,ev,re,r,rp)
3736
local tc=Duel.GetFirstTarget()
38-
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
37+
if tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then
3938
local dp=tc:GetControler()
40-
local g=Duel.GetMatchingGroup(Card.IsSSetable,dp,LOCATION_HAND,0,nil)
39+
local g=Duel.GetMatchingGroup(Card.IsSSetable,dp,LOCATION_HAND,0,nil,false,dp)
4140
if #g>0 and Duel.SelectYesNo(dp,aux.Stringid(id,0)) then
4241
Duel.BreakEffect()
4342
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)

official/c57314798.lua

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function s.initial_effect(c)
55
--Xyz Summon
66
Xyz.AddProcedure(c,s.xyzfilter,nil,2,nil,nil,nil,nil,false,s.xyzcheck)
77
c:EnableReviveLimit()
8-
--Gain ATK equal to the combined Ranks x 1000
8+
--Gains ATK equal to the combined Ranks of all Xyz monsters on the field x 1000
99
local e1=Effect.CreateEffect(c)
1010
e1:SetDescription(aux.Stringid(id,0))
1111
e1:SetCategory(CATEGORY_ATKCHANGE)
@@ -16,17 +16,17 @@ function s.initial_effect(c)
1616
e1:SetTarget(s.atktg)
1717
e1:SetOperation(s.atkop)
1818
c:RegisterEffect(e1,false,REGISTER_FLAG_DETACH_XMAT)
19-
--Destroy when destroyed and set Spell/Trap
19+
--Destroy as many monsters on the field as possible and each player sets 1 Spell/Trap from the GY
2020
local e2=Effect.CreateEffect(c)
2121
e2:SetDescription(aux.Stringid(id,1))
2222
e2:SetCategory(CATEGORY_DESTROY)
2323
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
2424
e2:SetCode(EVENT_DESTROYED)
25-
e2:SetCondition(s.descon)
25+
e2:SetCondition(function(e) return e:GetHandler():IsReason(REASON_EFFECT) end)
2626
e2:SetTarget(s.destg)
2727
e2:SetOperation(s.desop)
2828
c:RegisterEffect(e2)
29-
--Special Summon itself from GY when opp attacks
29+
--Special Summon this card from the GY
3030
local e3=Effect.CreateEffect(c)
3131
e3:SetDescription(aux.Stringid(id,2))
3232
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
@@ -66,11 +66,8 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp)
6666
e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END|RESET_OPPO_TURN)
6767
c:RegisterEffect(e1)
6868
end
69-
function s.descon(e,tp,eg,ep,ev,re,r,rp)
70-
return e:GetHandler():IsReason(REASON_EFFECT)
71-
end
72-
function s.setfilter(c)
73-
return c:IsSpellTrap() and c:IsSSetable()
69+
function s.setfilter(c,tp)
70+
return c:IsSpellTrap() and c:IsSSetable(false,tp)
7471
end
7572
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
7673
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
@@ -83,9 +80,9 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp)
8380
if Duel.Destroy(g,REASON_EFFECT)==0 then return end
8481
Duel.BreakEffect()
8582
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
86-
local tc1=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
83+
local tc1=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
8784
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SET)
88-
local tc2=Duel.SelectMatchingCard(1-tp,s.setfilter,1-tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
85+
local tc2=Duel.SelectMatchingCard(1-tp,s.setfilter,1-tp,LOCATION_GRAVE,0,1,1,nil,1-tp):GetFirst()
8986
if (tc1 and tc1:IsHasEffect(EFFECT_NECRO_VALLEY)) or (tc2 and tc2:IsHasEffect(EFFECT_NECRO_VALLEY)) then return end
9087
if tc1 then
9188
Duel.SSet(tp,tc1)

official/c63086455.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function s.tgfilter(c,e)
2020
return c:IsAbleToGrave() and c:IsCanBeEffectTarget(e)
2121
end
2222
function s.setfilter(c,e,tp)
23-
return c:IsCanBeEffectTarget(e) and ((c:IsSpellTrap() and c:IsSSetable(true))
23+
return c:IsCanBeEffectTarget(e) and ((c:IsSpellTrap() and c:IsSSetable(true,1-tp))
2424
or c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp))
2525
end
2626
function s.rescon(sg,e,tp)
@@ -60,7 +60,7 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp)
6060
if sc:IsMonster() and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
6161
and Duel.SpecialSummon(sc,0,tp,1-tp,false,false,POS_FACEDOWN_DEFENSE)>0 then
6262
Duel.ConfirmCards(1-tp,sc)
63-
elseif sc:IsSpellTrap() and sc:IsSSetable() then
63+
elseif sc:IsSpellTrap() and sc:IsSSetable(false,1-tp) then
6464
Duel.SSet(tp,sc,1-tp)
6565
end
6666
end

official/c64659851.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
--Scripted by Eerie Code
44
local s,id=GetID()
55
function s.initial_effect(c)
6-
--Activate
6+
--Your opponent can Set 1 Trap from their hand or Deck
77
local e1=Effect.CreateEffect(c)
88
e1:SetDescription(aux.Stringid(id,0))
99
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
@@ -29,12 +29,12 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
2929
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
3030
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
3131
end
32-
function s.setfilter(c)
33-
return c:IsTrap() and c:IsSSetable(true)
32+
function s.setfilter(c,tp)
33+
return c:IsTrap() and c:IsSSetable(false,1-tp)
3434
end
3535
function s.activate(e,tp,eg,ep,ev,re,r,rp)
3636
local summon=false
37-
local g=Duel.GetMatchingGroup(s.setfilter,tp,0,LOCATION_HAND|LOCATION_DECK,nil)
37+
local g=Duel.GetMatchingGroup(s.setfilter,tp,0,LOCATION_HAND|LOCATION_DECK,nil,tp)
3838
if Duel.GetLocationCount(1-tp,LOCATION_SZONE,1-tp,LOCATION_REASON_TOFIELD)>0 and #g>0 and Duel.SelectYesNo(1-tp,aux.Stringid(id,1)) then
3939
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SET)
4040
local sg=g:Select(1-tp,1,1,nil)

official/c64961254.lua

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ function s.initial_effect(c)
1111
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
1212
e1:SetOperation(s.activate)
1313
c:RegisterEffect(e1)
14-
--see top
15-
local e3=Effect.CreateEffect(c)
16-
e3:SetDescription(aux.Stringid(id,1))
17-
e3:SetType(EFFECT_TYPE_IGNITION)
18-
e3:SetCountLimit(1)
19-
e3:SetRange(LOCATION_SZONE)
20-
e3:SetTarget(s.target)
21-
e3:SetOperation(s.operation)
22-
c:RegisterEffect(e3)
14+
--Reveal the top card of your opponent's Deck and if it was the declared type, they Set it to their field
15+
local e2=Effect.CreateEffect(c)
16+
e2:SetDescription(aux.Stringid(id,1))
17+
e2:SetType(EFFECT_TYPE_IGNITION)
18+
e2:SetRange(LOCATION_SZONE)
19+
e2:SetCountLimit(1)
20+
e2:SetTarget(s.target)
21+
e2:SetOperation(s.operation)
22+
c:RegisterEffect(e2)
2323
end
2424
s.listed_series={SET_VALKYRIE}
25-
s.listed_names={91969909}
25+
s.listed_names={91969909} --"Goddess Urd's Verdict"
2626
function s.thcfilter(c)
2727
return c:IsFacedown() or not c:IsSetCard(SET_VALKYRIE)
2828
end
@@ -34,7 +34,6 @@ function s.thfilter(c)
3434
return c:IsCode(91969909) and c:IsAbleToHand()
3535
end
3636
function s.activate(e,tp,eg,ep,ev,re,r,rp)
37-
if not e:GetHandler():IsRelateToEffect(e) then return end
3837
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
3938
if #g>0 and s.thcon(e,tp,eg,ep,ev,re,r,rp) and
4039
Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
@@ -47,11 +46,10 @@ end
4746
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
4847
if chk==0 then return Duel.IsPlayerCanDiscardDeck(1-tp,1) end
4948
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
50-
Duel.SetTargetParam(Duel.SelectOption(tp,70,71,72))
49+
Duel.SetTargetParam(Duel.SelectOption(tp,DECLTYPE_MONSTER,DECLTYPE_SPELL,DECLTYPE_TRAP))
5150
end
5251
function s.operation(e,tp,eg,ep,ev,re,r,rp)
53-
if Duel.GetFieldGroupCount(1-tp,0,LOCATION_DECK)<=0
54-
or not e:GetHandler():IsRelateToEffect(e)then return end
52+
if Duel.GetFieldGroupCount(1-tp,0,LOCATION_DECK)<=0 then return end
5553
Duel.DisableShuffleCheck()
5654
Duel.ConfirmDecktop(1-tp,1)
5755
local g=Duel.GetDecktopGroup(1-tp,1)
@@ -62,7 +60,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
6260
and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
6361
and tc:IsCanBeSpecialSummoned(e,0,1-tp,false,false,POS_FACEDOWN_DEFENSE,1-tp)) then
6462
Duel.SpecialSummon(tc,0,1-tp,1-tp,false,false,POS_FACEDOWN_DEFENSE)
65-
elseif ((opt==1 and tc:IsSpell()) or (opt==2 and tc:IsTrap())) and tc:IsSSetable() then
63+
elseif ((opt==1 and tc:IsSpell()) or (opt==2 and tc:IsTrap())) and tc:IsSSetable(false,1-tp) then
6664
Duel.DisableShuffleCheck()
6765
Duel.SSet(1-tp,tc)
6866
else

official/c67248304.lua

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
--リバースポッド
22
--Reverse Jar
3-
--Logical Nonsense
4-
--Substitute ID
3+
--scripted by Logical Nonsense
54
local s,id=GetID()
65
function s.initial_effect(c)
76
--Change as many other monsters to face-down defense
@@ -17,16 +16,15 @@ end
1716
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
1817
if chk==0 then return true end
1918
local fdg=Duel.GetMatchingGroup(Card.IsCanTurnSet,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
20-
local thg=Duel.GetMatchingGroup(aux.AND(Card.IsAbleToHand,aux.FaceupFilter(Card.IsType,TYPE_SPELL|TYPE_TRAP)),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
19+
local thg=Duel.GetMatchingGroup(aux.AND(Card.IsAbleToHand,aux.FaceupFilter(Card.IsSpellTrap)),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
2120
Duel.SetOperationInfo(0,CATEGORY_POSITION,fdg,#fdg,0,0)
2221
Duel.SetOperationInfo(0,CATEGORY_TOHAND,thg,#thg,0,0)
2322
end
24-
--Change as many other monsters to face-down defense
2523
function s.operation(e,tp,eg,ep,ev,re,r,rp)
2624
local g=Duel.GetMatchingGroup(Card.IsCanTurnSet,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
2725
if #g==0 then return end
2826
if Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)==0 then return end
29-
local g2=Duel.GetMatchingGroup(aux.AND(Card.IsAbleToHand,aux.FaceupFilter(Card.IsType,TYPE_SPELL|TYPE_TRAP)),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
27+
local g2=Duel.GetMatchingGroup(aux.AND(Card.IsAbleToHand,aux.FaceupFilter(Card.IsSpellTrap)),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
3028
if #g2==0 then return end
3129
Duel.BreakEffect()
3230
if Duel.SendtoHand(g2,nil,REASON_EFFECT)==0 then return end
@@ -38,7 +36,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
3836
local turn_p=Duel.GetTurnPlayer()
3937
local step=turn_p==0 and 1 or -1
4038
for p=turn_p,1-turn_p,step do
41-
local setg=Duel.GetMatchingGroup(Card.IsSSetable,p,LOCATION_HAND,0,nil)
39+
local setg=Duel.GetMatchingGroup(Card.IsSSetable,p,LOCATION_HAND,0,nil,false,p)
4240
local setmax_ct=0
4341
if p==tp then
4442
setmax_ct=math.min(#setg,ct1)
@@ -55,7 +53,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
5553
end
5654
end
5755
function s.rescon(sg,e,tp,mg)
58-
return sg:FilterCount(Card.IsSSetable,nil)==#sg
56+
return sg:FilterCount(Card.IsSSetable,nil,false,tp)==#sg
5957
and sg:FilterCount(aux.NOT(Card.IsType),nil,TYPE_FIELD)<=Duel.GetLocationCount(tp,LOCATION_SZONE)
6058
and sg:FilterCount(Card.IsType,nil,TYPE_FIELD)<=1
6159
end

unofficial/c511000583.lua

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,30 @@
1+
--トラップ・リクエスト
12
--Trap Request
23
local s,id=GetID()
34
function s.initial_effect(c)
4-
--activate
5+
--Activate
56
local e1=Effect.CreateEffect(c)
67
e1:SetType(EFFECT_TYPE_ACTIVATE)
78
e1:SetCode(EVENT_FREE_CHAIN)
89
c:RegisterEffect(e1)
9-
--set
10+
--Set 1 Trap Card from your opponent's Deck to their Spell/Trap Zone
1011
local e2=Effect.CreateEffect(c)
1112
e2:SetDescription(aux.Stringid(id,0))
1213
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
1314
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
1415
e2:SetRange(LOCATION_SZONE)
1516
e2:SetCountLimit(1)
16-
e2:SetCondition(s.condition)
17+
e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end)
1718
e2:SetOperation(s.operation)
1819
c:RegisterEffect(e2)
1920
end
20-
function s.condition(e,tp,eg,ep,ev,re,r,rp)
21-
return tp==Duel.GetTurnPlayer()
22-
end
23-
function s.filter(c)
24-
return c:IsTrap() and c:IsSSetable()
21+
function s.filter(c,tp)
22+
return c:IsTrap() and c:IsSSetable(1-tp)
2523
end
2624
function s.operation(e,tp,eg,ep,ev,re,r,rp)
2725
local c=e:GetHandler()
2826
if Duel.GetLocationCount(1-tp,LOCATION_SZONE)<=0 then return end
29-
local sg=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_DECK,nil)
27+
local sg=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_DECK,nil,tp)
3028
Duel.ConfirmCards(tp,sg)
3129
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
3230
local g=sg:Select(tp,1,1,nil)
@@ -37,14 +35,14 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
3735
local e1=Effect.CreateEffect(c)
3836
e1:SetType(EFFECT_TYPE_SINGLE)
3937
e1:SetCode(EFFECT_CANNOT_TRIGGER)
40-
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
38+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
4139
e1:SetValue(1)
4240
tc:RegisterEffect(e1)
4341
local e2=Effect.CreateEffect(c)
4442
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
4543
e2:SetCode(EVENT_LEAVE_FIELD_P)
4644
e2:SetOperation(s.regop)
47-
e2:SetReset(RESET_EVENT+RESETS_REDIRECT)
45+
e2:SetReset(RESET_EVENT|RESETS_REDIRECT)
4846
tc:RegisterEffect(e2,true)
4947
end
5048
end

0 commit comments

Comments
 (0)