Skip to content

Commit de5798f

Browse files
authored
Update "Dogmatika Genesis"
Negation should reset when the negated monster leaves the field
1 parent 8e317b4 commit de5798f

1 file changed

Lines changed: 12 additions & 18 deletions

File tree

official/c56588755.lua

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
--Substitute ID
55
local s,id=GetID()
66
function s.initial_effect(c)
7-
--Negate 1 of opponent's monsters
7+
--Return 1 banished Fusion, Synchro, Xyz, or Link monster to the Extra Deck, then negate the effects of 1 opponent's monster of the same type as the returned monster
88
local e1=Effect.CreateEffect(c)
9-
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_TODECK)
9+
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DISABLE)
1010
e1:SetType(EFFECT_TYPE_ACTIVATE)
1111
e1:SetCode(EVENT_FREE_CHAIN)
1212
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
@@ -16,30 +16,31 @@ function s.initial_effect(c)
1616
e1:SetOperation(s.activate)
1717
c:RegisterEffect(e1)
1818
end
19-
--Check for a fusion, synchro, Xyz, or link monster
20-
function s.filter1(c,tp)
19+
--Check for a Fusion, Synchro, Xyz, or Link monster
20+
function s.retfilter(c,tp)
2121
local typ=c:GetType()&(TYPE_FUSION|TYPE_SYNCHRO|TYPE_XYZ|TYPE_LINK)
2222
return c:IsFaceup() and typ~=0 and c:IsAbleToExtra()
23-
and Duel.IsExistingTarget(s.filter2,tp,0,LOCATION_MZONE,1,nil,typ)
23+
and Duel.IsExistingTarget(s.disfilter,tp,0,LOCATION_MZONE,1,nil,typ)
2424
end
2525
--Check for an effect monster with same card type from filter1
26-
function s.filter2(c,ex)
26+
function s.disfilter(c,ex)
2727
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:IsType(ex) and not c:IsDisabled()
2828
end
2929
--Activation legality
3030
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
3131
if chkc then return false end
32-
if chk==0 then return Duel.IsExistingTarget(s.filter1,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil,tp) end
32+
if chk==0 then return Duel.IsExistingTarget(s.retfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil,tp) end
3333
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
34-
local g1=Duel.SelectTarget(tp,s.filter1,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,nil,tp)
34+
local g1=Duel.SelectTarget(tp,s.retfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,nil,tp)
3535
local typ=g1:GetFirst():GetType()&(TYPE_FUSION|TYPE_SYNCHRO|TYPE_XYZ|TYPE_LINK)
3636
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
37-
local g2=Duel.SelectTarget(tp,s.filter2,tp,0,LOCATION_MZONE,1,1,nil,typ)
37+
local g2=Duel.SelectTarget(tp,s.disfilter,tp,0,LOCATION_MZONE,1,1,nil,typ)
3838
Duel.SetOperationInfo(0,CATEGORY_TODECK,g1,1,0,LOCATION_REMOVED)
3939
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g2,1,0,0)
4040
end
4141
--Return 1 banished monster to extra deck, and if you do, negate targeted monster's effects
4242
function s.activate(e,tp,eg,ep,ev,re,r,rp)
43+
local c=e:GetHandler()
4344
local ex,g1=Duel.GetOperationInfo(0,CATEGORY_TODECK)
4445
local ex,g2=Duel.GetOperationInfo(0,CATEGORY_DISABLE)
4546
if g1:GetFirst():IsRelateToEffect(e) then
@@ -48,15 +49,8 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
4849
if og:GetFirst():IsLocation(LOCATION_EXTRA) then
4950
local tc=g2:GetFirst()
5051
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
51-
local e1=Effect.CreateEffect(e:GetHandler())
52-
e1:SetType(EFFECT_TYPE_SINGLE)
53-
e1:SetCode(EFFECT_DISABLE)
54-
tc:RegisterEffect(e1)
55-
local e2=Effect.CreateEffect(e:GetHandler())
56-
e2:SetType(EFFECT_TYPE_SINGLE)
57-
e2:SetCode(EFFECT_DISABLE_EFFECT)
58-
tc:RegisterEffect(e2)
52+
tc:NegateEffects(c)
5953
end
6054
end
6155
end
62-
end
56+
end

0 commit comments

Comments
 (0)