Skip to content

Commit 4ab0862

Browse files
committed
Fixed some "Super Quantal Mech" monsters
- fixed a bug where they would be able to attach a "Super Quantum" Spell/Trap with their effects - fixed a bug with "Super Quantal Mech Beast Grampulse" where target redirects (e.g. Cairngorgon) would redirect the destruction to incorrect targets
1 parent 5ac61fb commit 4ab0862

File tree

4 files changed

+115
-164
lines changed

4 files changed

+115
-164
lines changed

official/c11646785.lua

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,88 +2,78 @@
22
--Super Quantal Mech Beast Aeroboros
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--xyz summon
6-
Xyz.AddProcedure(c,nil,4,2)
75
c:EnableReviveLimit()
8-
--cannot attack
6+
--Xyz Summon procedure: 2 Level 4 monsters
7+
Xyz.AddProcedure(c,nil,4,2)
8+
--Cannot attack unless it has Xyz Material
99
local e1=Effect.CreateEffect(c)
1010
e1:SetType(EFFECT_TYPE_SINGLE)
1111
e1:SetCode(EFFECT_CANNOT_ATTACK)
12-
e1:SetCondition(s.atcon)
12+
e1:SetCondition(function(e) return e:GetHandler():GetOverlayCount()==0 end)
1313
c:RegisterEffect(e1)
14-
--pos
14+
--Change 1 monster to face-down Defense Position
1515
local e2=Effect.CreateEffect(c)
1616
e2:SetDescription(aux.Stringid(id,0))
1717
e2:SetCategory(CATEGORY_POSITION)
1818
e2:SetType(EFFECT_TYPE_IGNITION)
1919
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
2020
e2:SetRange(LOCATION_MZONE)
2121
e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE)
22-
e2:SetCondition(s.setcon1)
23-
e2:SetCost(s.setcost)
22+
e2:SetCondition(aux.NOT(s.quickeffcond))
23+
e2:SetCost(Cost.Detach(1))
2424
e2:SetTarget(s.settg)
2525
e2:SetOperation(s.setop)
2626
c:RegisterEffect(e2,false,REGISTER_FLAG_DETACH_XMAT)
27+
--This is a Quick effect if this card has "Super Quantum Green Layer" as Xyz Material
2728
local e3=e2:Clone()
2829
e3:SetType(EFFECT_TYPE_QUICK_O)
2930
e3:SetCode(EVENT_FREE_CHAIN)
3031
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E)
31-
e3:SetCondition(s.setcon2)
32+
e3:SetCondition(s.quickeffcond)
3233
c:RegisterEffect(e3)
33-
--material
34+
--Attach 1 "Super Quantum" monster from your hand or field to this card
3435
local e4=Effect.CreateEffect(c)
3536
e4:SetDescription(aux.Stringid(id,1))
3637
e4:SetType(EFFECT_TYPE_IGNITION)
3738
e4:SetRange(LOCATION_MZONE)
3839
e4:SetCountLimit(1)
39-
e4:SetTarget(s.mttg)
40-
e4:SetOperation(s.mtop)
40+
e4:SetTarget(s.attachtg)
41+
e4:SetOperation(s.attachop)
4142
c:RegisterEffect(e4)
4243
end
43-
s.listed_series={0x10dc}
44-
s.listed_names={85374678}
45-
function s.atcon(e)
46-
return e:GetHandler():GetOverlayCount()==0
47-
end
48-
function s.setcon1(e,tp,eg,ep,ev,re,r,rp)
49-
return not e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,85374678)
50-
end
51-
function s.setcon2(e,tp,eg,ep,ev,re,r,rp)
44+
s.listed_series={SET_SUPER_QUANTUM}
45+
s.listed_names={85374678} --"Super Quantum Green Layer"
46+
function s.quickeffcond(e,tp,eg,ep,ev,re,r,rp)
5247
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,85374678)
5348
end
54-
function s.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
55-
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
56-
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
57-
end
58-
function s.setfilter(c)
59-
return c:IsFaceup() and c:IsCanTurnSet()
60-
end
6149
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
62-
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.setfilter(chkc) and chkc~=e:GetHandler() end
63-
if chk==0 then return Duel.IsExistingTarget(s.setfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
50+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsCanTurnSet() and chkc~=e:GetHandler() end
51+
if chk==0 then return Duel.IsExistingTarget(Card.IsCanTurnSet,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
6452
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
65-
local g=Duel.SelectTarget(tp,s.setfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler())
66-
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
53+
local g=Duel.SelectTarget(tp,Card.IsCanTurnSet,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler())
54+
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,tp,0)
6755
end
6856
function s.setop(e,tp,eg,ep,ev,re,r,rp)
6957
local tc=Duel.GetFirstTarget()
7058
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
7159
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
7260
end
7361
end
74-
function s.mtfilter(c,e)
75-
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and not c:IsType(TYPE_TOKEN) and c:IsSetCard(0x10dc) and not c:IsImmuneToEffect(e)
62+
function s.attachfilter(c,e,tp,xc)
63+
return c:IsSetCard(SET_SUPER_QUANTUM) and c:IsMonster() and not c:IsType(TYPE_TOKEN)
64+
and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsCanBeXyzMaterial(xc,tp,REASON_EFFECT)
7665
end
77-
function s.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
78-
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ)
79-
and Duel.IsExistingMatchingCard(s.mtfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,e) end
66+
function s.attachtg(e,tp,eg,ep,ev,re,r,rp,chk)
67+
local c=e:GetHandler()
68+
if chk==0 then return c:IsType(TYPE_XYZ)
69+
and Duel.IsExistingMatchingCard(s.attachfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil,e,tp,c) end
8070
end
81-
function s.mtop(e,tp,eg,ep,ev,re,r,rp)
71+
function s.attachop(e,tp,eg,ep,ev,re,r,rp)
8272
local c=e:GetHandler()
8373
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
8474
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
85-
local tc=Duel.SelectMatchingCard(tp,s.mtfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,e):GetFirst()
86-
if tc then
75+
local tc=Duel.SelectMatchingCard(tp,s.attachfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil,e,tp,c):GetFirst()
76+
if tc and not tc:IsImmuneToEffect(e) then
8777
Duel.Overlay(c,tc,true)
8878
end
89-
end
79+
end

official/c57031794.lua

Lines changed: 28 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,86 +2,78 @@
22
--Super Quantal Mech Beast Magnaliger
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--xyz summon
6-
Xyz.AddProcedure(c,nil,5,2)
75
c:EnableReviveLimit()
8-
--cannot attack
6+
--Xyz Summon procedure: 2 Level 5 monsters
7+
Xyz.AddProcedure(c,nil,5,2)
8+
--Cannot attack unless it has Xyz Material
99
local e1=Effect.CreateEffect(c)
1010
e1:SetType(EFFECT_TYPE_SINGLE)
1111
e1:SetCode(EFFECT_CANNOT_ATTACK)
12-
e1:SetCondition(s.atcon)
12+
e1:SetCondition(function(e) return e:GetHandler():GetOverlayCount()==0 end)
1313
c:RegisterEffect(e1)
14-
--destroy
14+
--Destroy 1 monster on the field
1515
local e2=Effect.CreateEffect(c)
1616
e2:SetCategory(CATEGORY_DESTROY)
1717
e2:SetDescription(aux.Stringid(id,0))
1818
e2:SetType(EFFECT_TYPE_IGNITION)
1919
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
2020
e2:SetRange(LOCATION_MZONE)
2121
e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE)
22-
e2:SetCondition(s.descon1)
23-
e2:SetCost(s.descost)
22+
e2:SetCondition(aux.NOT(s.quickeffcond))
23+
e2:SetCost(Cost.Detach(1))
2424
e2:SetTarget(s.destg)
2525
e2:SetOperation(s.desop)
2626
c:RegisterEffect(e2,false,REGISTER_FLAG_DETACH_XMAT)
27+
--This is a Quick effect if this card has "Super Quantum Red Layer" as Xyz Material
2728
local e3=e2:Clone()
2829
e3:SetType(EFFECT_TYPE_QUICK_O)
2930
e3:SetCode(EVENT_FREE_CHAIN)
3031
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E)
3132
e3:SetCondition(s.descon2)
3233
c:RegisterEffect(e3,false,REGISTER_FLAG_DETACH_XMAT)
33-
--material
34+
--Attach 1 "Super Quantum" monster from your hand or field to this card
3435
local e4=Effect.CreateEffect(c)
3536
e4:SetDescription(aux.Stringid(id,1))
3637
e4:SetType(EFFECT_TYPE_IGNITION)
3738
e4:SetRange(LOCATION_MZONE)
3839
e4:SetCountLimit(1)
39-
e4:SetTarget(s.mttg)
40-
e4:SetOperation(s.mtop)
40+
e4:SetTarget(s.attachtg)
41+
e4:SetOperation(s.attachop)
4142
c:RegisterEffect(e4)
4243
end
43-
s.listed_series={0x10dc}
44-
s.listed_names={59975920}
45-
function s.atcon(e)
46-
return e:GetHandler():GetOverlayCount()==0
47-
end
48-
function s.descon1(e,tp,eg,ep,ev,re,r,rp)
49-
return not e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,59975920)
50-
end
51-
function s.descon2(e,tp,eg,ep,ev,re,r,rp)
44+
s.listed_series={SET_SUPER_QUANTUM}
45+
s.listed_names={59975920} --"Super Quantum Red Layer"
46+
function s.quickeffcond(e,tp,eg,ep,ev,re,r,rp)
5247
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,59975920)
5348
end
54-
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
55-
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
56-
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
57-
end
5849
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
5950
if chkc then return chkc:IsLocation(LOCATION_MZONE) end
60-
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
51+
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
6152
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
62-
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
63-
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
53+
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
54+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0)
6455
end
6556
function s.desop(e,tp,eg,ep,ev,re,r,rp)
6657
local tc=Duel.GetFirstTarget()
6758
if tc:IsRelateToEffect(e) then
6859
Duel.Destroy(tc,REASON_EFFECT)
6960
end
7061
end
71-
function s.mtfilter(c,e)
72-
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and not c:IsType(TYPE_TOKEN) and c:IsSetCard(0x10dc) and not c:IsImmuneToEffect(e)
62+
function s.attachfilter(c,e,tp,xc)
63+
return c:IsSetCard(SET_SUPER_QUANTUM) and c:IsMonster() and not c:IsType(TYPE_TOKEN)
64+
and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsCanBeXyzMaterial(xc,tp,REASON_EFFECT)
7365
end
74-
function s.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
75-
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ)
76-
and Duel.IsExistingMatchingCard(s.mtfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,e) end
66+
function s.attachtg(e,tp,eg,ep,ev,re,r,rp,chk)
67+
local c=e:GetHandler()
68+
if chk==0 then return c:IsType(TYPE_XYZ)
69+
and Duel.IsExistingMatchingCard(s.attachfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil,e,tp,c) end
7770
end
78-
function s.mtop(e,tp,eg,ep,ev,re,r,rp)
71+
function s.attachop(e,tp,eg,ep,ev,re,r,rp)
7972
local c=e:GetHandler()
8073
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
8174
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
82-
local g=Duel.SelectMatchingCard(tp,s.mtfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,e)
83-
local tc=g:GetFirst()
84-
if tc then
75+
local tc=Duel.SelectMatchingCard(tp,s.attachfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil,e,tp,c):GetFirst()
76+
if tc and not tc:IsImmuneToEffect(e) then
8577
Duel.Overlay(c,tc,true)
8678
end
87-
end
79+
end

official/c57450198.lua

Lines changed: 27 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,36 @@
33
--Scripted by Eerie Code
44
local s,id=GetID()
55
function s.initial_effect(c)
6-
--xyz summon
7-
Xyz.AddProcedure(c,nil,7,2)
86
c:EnableReviveLimit()
9-
--cannot attack
7+
--Xyz Summon procedure: 2 Level 7 monsters
8+
Xyz.AddProcedure(c,nil,7,2)
9+
--Cannot attack unless it has Xyz Material
1010
local e1=Effect.CreateEffect(c)
1111
e1:SetType(EFFECT_TYPE_SINGLE)
1212
e1:SetCode(EFFECT_CANNOT_ATTACK)
13-
e1:SetCondition(s.atcon)
13+
e1:SetCondition(function(e) return e:GetHandler():GetOverlayCount()==0 end)
1414
c:RegisterEffect(e1)
15-
--negate
15+
--Negate the effects of a face-up monster until the end of this turn
1616
local e2=Effect.CreateEffect(c)
1717
e2:SetDescription(aux.Stringid(id,0))
1818
e2:SetCategory(CATEGORY_DISABLE)
1919
e2:SetType(EFFECT_TYPE_IGNITION)
2020
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
2121
e2:SetRange(LOCATION_MZONE)
2222
e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE)
23-
e2:SetCondition(s.discon1)
24-
e2:SetCost(s.discost)
23+
e2:SetCondition(aux.NOT(s.quickeffcond))
24+
e2:SetCost(Cost.Detach(1))
2525
e2:SetTarget(s.distg)
2626
e2:SetOperation(s.disop)
2727
c:RegisterEffect(e2,false,REGISTER_FLAG_DETACH_XMAT)
28+
--This is a Quick effect if this card has "Super Quantum White Layer" as Xyz Material
2829
local e3=e2:Clone()
2930
e3:SetType(EFFECT_TYPE_QUICK_O)
3031
e3:SetCode(EVENT_FREE_CHAIN)
3132
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E)
32-
e3:SetCondition(s.discon2)
33+
e3:SetCondition(s.quickeffcond)
3334
c:RegisterEffect(e3,false,REGISTER_FLAG_DETACH_XMAT)
34-
--material
35+
--Attach 1 "Super Quantum" monster from your hand or field to this card
3536
local e4=Effect.CreateEffect(c)
3637
e4:SetDescription(aux.Stringid(id,1))
3738
e4:SetType(EFFECT_TYPE_IGNITION)
@@ -41,64 +42,43 @@ function s.initial_effect(c)
4142
e4:SetOperation(s.mtop)
4243
c:RegisterEffect(e4)
4344
end
44-
s.listed_series={0x10dc}
45-
s.listed_names={73422829}
46-
function s.atcon(e)
47-
return e:GetHandler():GetOverlayCount()==0
48-
end
49-
function s.discon1(e,tp,eg,ep,ev,re,r,rp)
50-
return not e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,73422829)
51-
end
52-
function s.discon2(e,tp,eg,ep,ev,re,r,rp)
45+
s.listed_series={SET_SUPER_QUANTUM}
46+
s.listed_names={73422829} --"Super Quantum White Layer"
47+
function s.quickeffcond(e,tp,eg,ep,ev,re,r,rp)
5348
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,73422829)
5449
end
55-
function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
56-
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
57-
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
58-
end
5950
function s.disfilter(c)
6051
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and not c:IsDisabled()
6152
end
6253
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
6354
if chkc then return s.disfilter(chkc) and chkc:IsLocation(LOCATION_MZONE) end
6455
if chk==0 then return Duel.IsExistingTarget(s.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
65-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
56+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE)
6657
Duel.SelectTarget(tp,s.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
6758
end
6859
function s.disop(e,tp,eg,ep,ev,re,r,rp)
6960
local c=e:GetHandler()
7061
local tc=Duel.GetFirstTarget()
7162
if tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsDisabled() then
72-
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
73-
local e1=Effect.CreateEffect(c)
74-
e1:SetType(EFFECT_TYPE_SINGLE)
75-
e1:SetCode(EFFECT_DISABLE)
76-
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
77-
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
78-
tc:RegisterEffect(e1)
79-
local e2=Effect.CreateEffect(c)
80-
e2:SetType(EFFECT_TYPE_SINGLE)
81-
e2:SetCode(EFFECT_DISABLE_EFFECT)
82-
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
83-
e2:SetValue(RESET_TURN_SET)
84-
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
85-
tc:RegisterEffect(e2)
63+
--Negate its effects until the end of this turn
64+
tc:NegateEffects(c,RESETS_STANDARD_PHASE_END)
8665
end
8766
end
88-
function s.mtfilter(c,e)
89-
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and not c:IsType(TYPE_TOKEN) and c:IsSetCard(0x10dc) and not c:IsImmuneToEffect(e)
67+
function s.attachfilter(c,e,tp,xc)
68+
return c:IsSetCard(SET_SUPER_QUANTUM) and c:IsMonster() and not c:IsType(TYPE_TOKEN)
69+
and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsCanBeXyzMaterial(xc,tp,REASON_EFFECT)
9070
end
91-
function s.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
92-
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ)
93-
and Duel.IsExistingMatchingCard(s.mtfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,e) end
71+
function s.attachtg(e,tp,eg,ep,ev,re,r,rp,chk)
72+
local c=e:GetHandler()
73+
if chk==0 then return c:IsType(TYPE_XYZ)
74+
and Duel.IsExistingMatchingCard(s.attachfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil,e,tp,c) end
9475
end
95-
function s.mtop(e,tp,eg,ep,ev,re,r,rp)
76+
function s.attachop(e,tp,eg,ep,ev,re,r,rp)
9677
local c=e:GetHandler()
9778
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
9879
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
99-
local g=Duel.SelectMatchingCard(tp,s.mtfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,e)
100-
local tc=g:GetFirst()
101-
if tc then
80+
local tc=Duel.SelectMatchingCard(tp,s.attachfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil,e,tp,c):GetFirst()
81+
if tc and not tc:IsImmuneToEffect(e) then
10282
Duel.Overlay(c,tc,true)
10383
end
104-
end
84+
end

0 commit comments

Comments
 (0)