Skip to content

Commit b0f50cd

Browse files
authored
more updates
- Megalith Notrah Plura: not triggering - updated the remaining 'unaffected by... except "archetype"...' cards - replaced 're:IsCardType(TYPE_MONSTER)' with 're:IsMonsterEffect()' in scripts - Cost.DetachFromSelf: use 'Effect.GetChainData' for consistency with everything else
1 parent aec312c commit b0f50cd

16 files changed

Lines changed: 138 additions & 123 deletions

official/c15001940.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function s.initial_effect(c)
4141
end
4242
s.listed_series={SET_RECIPE,SET_NOUVELLES}
4343
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
44-
return re and re:IsCardType(TYPE_MONSTER) and re:IsCardSetcode(SET_NOUVELLES)
44+
return re and re:IsMonsterEffect() and re:IsCardSetcode(SET_NOUVELLES)
4545
end
4646
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
4747
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToDeck() end
@@ -89,4 +89,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
8989
Duel.SpecialSummon(g,0,tp,tp,false,true,POS_FACEUP)
9090
end
9191
end
92-
end
92+
end

official/c26223582.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function s.initial_effect(c)
4141
end
4242
s.listed_series={SET_NOUVELLES,SET_RECIPE}
4343
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
44-
return re and re:IsCardType(TYPE_MONSTER) and re:IsCardSetcode(SET_NOUVELLES)
44+
return re and re:IsMonsterEffect() and re:IsCardSetcode(SET_NOUVELLES)
4545
end
4646
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
4747
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 end
@@ -98,4 +98,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
9898
Duel.SpecialSummon(g,0,tp,tp,false,true,POS_FACEUP)
9999
end
100100
end
101-
end
101+
end

official/c42632209.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ function s.initial_effect(c)
1111
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
1212
e1:SetCode(EFFECT_IMMUNE_EFFECT)
1313
e1:SetRange(LOCATION_EMZONE)
14-
e1:SetValue(function(e,te) return not te:GetOwner():IsSetCard(SET_MATHMECH) end)
14+
e1:SetValue(function(e,te)
15+
return not te:IsCardSetcode(SET_MATHMECH)
16+
end)
1517
c:RegisterEffect(e1)
1618
--If this card in the Extra Monster Zone battles an opponent's monster, any battle damage it inflicts to your opponent is doubled
1719
local e2=e1:Clone()
1820
e2:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
19-
e2:SetCondition(function(e) local bc=e:GetHandler():GetBattleTarget() return bc and bc:IsControler(1-e:GetHandlerPlayer()) end)
21+
e2:SetCondition(function(e)
22+
local bc=e:GetHandler():GetBattleTarget()
23+
return bc and bc:IsControler(1-e:GetHandlerPlayer())
24+
end)
2025
e2:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE))
2126
c:RegisterEffect(e2)
2227
--Add 1 "Mathmech" card from your Deck to your hand

official/c44293356.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp)
4545
Duel.RegisterEffect(e1,tp)
4646
end
4747
function s.inactop(e,tp,eg,ep,ev,re,r,rp)
48-
if ep==tp and Chain.IsTriggeringCompositeType(ev,TYPE_RITUAL|TYPE_MONSTER) and Chain.IsTriggeringSetcode(ev,SET_MEGALITH) then
48+
if ep==tp and Chain.IsSetcode(ev,SET_MEGALITH) and Chain.IsCompositeType(ev,TYPE_RITUAL|TYPE_MONSTER) then
4949
Duel.SetChainLimit(function(e,rp,tp) return rp==tp end)
5050
end
5151
end
@@ -80,4 +80,4 @@ function s.negop(e,tp,eg,ep,ev,re,r,rp)
8080
end
8181
end
8282
end
83-
end
83+
end

official/c52495649.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function s.initial_effect(c)
4444
end
4545
s.listed_series={SET_NOUVELLES,SET_RECIPE}
4646
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
47-
return re and re:IsCardType(TYPE_MONSTER) and re:IsCardSetcode(SET_NOUVELLES)
47+
return re and re:IsMonsterEffect() and re:IsCardSetcode(SET_NOUVELLES)
4848
end
4949
function s.thfilter(c)
5050
return c:IsSetCard({SET_NOUVELLES,SET_RECIPE}) and c:IsAbleToHand()
@@ -87,4 +87,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
8787
Duel.SpecialSummon(g,0,tp,tp,false,true,POS_FACEUP)
8888
end
8989
end
90-
end
90+
end

official/c53618197.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function s.initial_effect(c)
4141
end
4242
s.listed_series={SET_NOUVELLES,SET_RECIPE}
4343
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
44-
return re and re:IsCardType(TYPE_MONSTER) and re:IsCardSetcode(SET_NOUVELLES)
44+
return re and re:IsMonsterEffect() and re:IsCardSetcode(SET_NOUVELLES)
4545
end
4646
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
4747
if chkc then return chkc:IsOnField() and chkc:IsSpellTrap() end
@@ -90,4 +90,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
9090
Duel.SpecialSummon(g,0,tp,tp,false,true,POS_FACEUP)
9191
end
9292
end
93-
end
93+
end

official/c54701958.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ function s.initial_effect(c)
1212
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
1313
e1:SetCode(EFFECT_IMMUNE_EFFECT)
1414
e1:SetRange(LOCATION_MZONE)
15-
e1:SetValue(function(e,te) return not te:GetHandler():IsSetCard(SET_LUNALIGHT) end)
15+
e1:SetValue(function(e,te)
16+
return not te:IsCardSetcode(SET_LUNALIGHT)
17+
end)
1618
c:RegisterEffect(e1)
1719
--Can make a second attack during each Battle Phase
1820
local e2=Effect.CreateEffect(c)

official/c58995660.lua

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ function s.initial_effect(c)
1616
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
1717
e1:SetRange(LOCATION_SZONE)
1818
e1:SetCountLimit(1)
19-
e1:SetCondition(function(e,tp) return Duel.GetBattleMonster(tp) end)
19+
e1:SetCondition(function(e,tp)
20+
return Duel.GetBattleMonster(tp)
21+
end)
2022
e1:SetTarget(s.efftg)
2123
e1:SetOperation(s.effop)
2224
c:RegisterEffect(e1)
@@ -27,25 +29,27 @@ function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
2729
if chk==0 then return true end
2830
local bc1=Duel.GetBattleMonster(tp)
2931
local bc2=bc1:GetBattleTarget()
30-
local cd=e:GetChainData()
31-
cd.in_same_column=bc2 and bc1:GetColumnGroup():IsContains(bc2)
32-
cd.own_monster=bc1
32+
if bc2 and bc1:GetColumnGroup():IsContains(bc2) then
33+
e:SetLabel(1)
34+
else
35+
e:SetLabel(0)
36+
end
37+
e:SetLabelObject(bc1)
3338
bc1:CreateEffectRelation(e)
3439
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
3540
end
3641
function s.effop(e,tp,eg,ep,ev,re,r,rp)
37-
local cd=e:GetChainData()
38-
local bc=cd.own_monster
42+
local bc=e:GetLabelObject()
3943
if not bc:IsRelateToEffect(e) then return end
4044
local op=nil
41-
if cd.in_same_column then
45+
if e:GetLabel()==0 then
46+
op=Duel.TossDice(tp,1)
47+
else
4248
local is_faceup=bc:IsFaceup()
4349
op=Duel.SelectEffect(tp,
4450
{true,aux.Stringid(id,1)},
4551
{is_faceup,aux.Stringid(id,2)},
4652
{is_faceup,aux.Stringid(id,3)})
47-
else
48-
op=Duel.TossDice(tp,1)
4953
end
5054
local c=e:GetHandler()
5155
if op==1 or op==4 then
@@ -56,7 +60,9 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp)
5660
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
5761
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
5862
e1:SetCountLimit(1)
59-
e1:SetValue(function(e,re,r,rp) return r&(REASON_BATTLE|REASON_EFFECT)>0 end)
63+
e1:SetValue(function(e,re,r,rp)
64+
return r&(REASON_BATTLE|REASON_EFFECT)>0
65+
end)
6066
e1:SetReset(RESETS_STANDARD_PHASE_END)
6167
bc:RegisterEffect(e1)
6268
elseif op==2 or op==5 then
@@ -67,7 +73,9 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp)
6773
e2:SetType(EFFECT_TYPE_SINGLE)
6874
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
6975
e2:SetCode(EFFECT_IMMUNE_EFFECT)
70-
e2:SetValue(function(e,te) return te:IsActivated() and te:IsSpellTrapEffect() and not te:GetHandler():IsCode(id) end)
76+
e2:SetValue(function(e,te)
77+
return te:IsActivated() and te:IsSpellTrapEffect() and not te:IsCardCode(id)
78+
end)
7179
e2:SetReset(RESETS_STANDARD_PHASE_END)
7280
bc:RegisterEffect(e2)
7381
elseif op==3 or op==6 then
@@ -82,4 +90,4 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp)
8290
e3:SetReset(RESETS_STANDARD_PHASE_END)
8391
bc:RegisterEffect(e3)
8492
end
85-
end
93+
end

official/c70488851.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ function s.initial_effect(c)
5353
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
5454
e4:SetCode(EFFECT_IMMUNE_EFFECT)
5555
e4:SetRange(LOCATION_MZONE)
56-
e4:SetValue(function(e,te) return te:IsMonsterEffect() and not te:GetOwner():IsSetCard(SET_POWER_PATRON) end)
56+
e4:SetValue(function(e,te)
57+
return te:IsMonsterEffect() and not te:IsCardSetcode(SET_POWER_PATRON)
58+
end)
5759
c:RegisterEffect(e4)
5860
end
5961
s.listed_series={SET_POWER_PATRON}

official/c84025439.lua

Lines changed: 75 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -2,101 +2,102 @@
22
--Super Quantal Mech King Great Magnus
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--Xyz summon procedure
6-
Xyz.AddProcedure(c,nil,12,3)
75
c:EnableReviveLimit()
8-
--Shuffle card into the deck
6+
--Xyz Summon procedure: 3 Level 12 monsters
7+
Xyz.AddProcedure(c,nil,12,3)
8+
--If this card is sent to the GY: You can Special Summon 3 "Super Quantal Mech Beast" Xyz Monsters with different names from your GY
99
local e1=Effect.CreateEffect(c)
1010
e1:SetDescription(aux.Stringid(id,0))
11-
e1:SetCategory(CATEGORY_TODECK)
12-
e1:SetType(EFFECT_TYPE_QUICK_O)
13-
e1:SetCode(EVENT_FREE_CHAIN)
14-
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END)
15-
e1:SetRange(LOCATION_MZONE)
16-
e1:SetCountLimit(1)
17-
e1:SetCondition(s.tdcon)
18-
e1:SetCost(Cost.DetachFromSelf(1))
19-
e1:SetTarget(s.tdtg)
20-
e1:SetOperation(s.tdop)
11+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
12+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
13+
e1:SetProperty(EFFECT_FLAG_DELAY)
14+
e1:SetCode(EVENT_TO_GRAVE)
15+
e1:SetTarget(s.sptg)
16+
e1:SetOperation(s.spop)
2117
c:RegisterEffect(e1)
22-
--Unaffected by other effects
18+
--This card gains these effects, based on the number of materials with different names attached to it
19+
--● 2+: Once per turn, during the Main Phase (Quick Effect): You can detach 1 material from this card; shuffle 1 card on the field into the Deck
2320
local e2=Effect.CreateEffect(c)
24-
e2:SetType(EFFECT_TYPE_SINGLE)
25-
e2:SetCode(EFFECT_IMMUNE_EFFECT)
26-
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
21+
e2:SetDescription(aux.Stringid(id,1))
22+
e2:SetCategory(CATEGORY_TODECK)
23+
e2:SetType(EFFECT_TYPE_QUICK_O)
24+
e2:SetCode(EVENT_FREE_CHAIN)
2725
e2:SetRange(LOCATION_MZONE)
28-
e2:SetCondition(s.imcon)
29-
e2:SetValue(s.efilter)
26+
e2:SetCountLimit(1)
27+
e2:SetCondition(aux.AND(
28+
function()
29+
return Duel.IsMainPhase()
30+
end,
31+
s.effcon(2))
32+
)
33+
e2:SetCost(Cost.DetachFromSelf(1))
34+
e2:SetTarget(s.tdtg)
35+
e2:SetOperation(s.tdop)
36+
e2:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER)
3037
c:RegisterEffect(e2)
31-
--Prevents adding cards to the hand
38+
--● 4+: It is unaffected by card effects, except "Super Quant" cards
3239
local e3=Effect.CreateEffect(c)
33-
e3:SetType(EFFECT_TYPE_FIELD)
34-
e3:SetCode(EFFECT_CANNOT_TO_HAND)
40+
e3:SetType(EFFECT_TYPE_SINGLE)
41+
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
42+
e3:SetCode(EFFECT_IMMUNE_EFFECT)
3543
e3:SetRange(LOCATION_MZONE)
36-
e3:SetTargetRange(0,LOCATION_DECK)
37-
e3:SetCondition(s.drcon)
44+
e3:SetCondition(s.effcon(4))
45+
e3:SetValue(function(e,te)
46+
return not te:IsCardSetcode(SET_SUPER_QUANT)
47+
end)
3848
c:RegisterEffect(e3)
39-
local e4=Effect.CreateEffect(c)
40-
e4:SetType(EFFECT_TYPE_FIELD)
41-
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
42-
e4:SetRange(LOCATION_MZONE)
43-
e4:SetCode(EFFECT_CANNOT_DRAW)
44-
e4:SetCondition(s.drcon)
45-
e4:SetTargetRange(0,1)
46-
c:RegisterEffect(e4)
47-
--Special Summon when sent to the GY
48-
local e5=Effect.CreateEffect(c)
49-
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
50-
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
51-
e5:SetProperty(EFFECT_FLAG_DELAY)
52-
e5:SetCode(EVENT_TO_GRAVE)
53-
e5:SetTarget(s.sptg)
54-
e5:SetOperation(s.spop)
55-
c:RegisterEffect(e5)
49+
--● 6+: Your opponent cannot add cards from the Deck to the hand by card effects
50+
local e4a=Effect.CreateEffect(c)
51+
e4a:SetType(EFFECT_TYPE_FIELD)
52+
e4a:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
53+
e4a:SetCode(EFFECT_CANNOT_TO_HAND)
54+
e4a:SetRange(LOCATION_MZONE)
55+
e4a:SetTargetRange(0,1)
56+
e4a:SetCondition(s.effcon(6))
57+
e4a:SetTarget(function(e,c,rp,re)
58+
return c:IsLocation(LOCATION_DECK)
59+
end)
60+
c:RegisterEffect(e4a)
61+
local e4b=e4a:Clone()
62+
e4b:SetCode(EFFECT_CANNOT_DRAW)
63+
c:RegisterEffect(e4b)
5664
end
5765
s.listed_series={SET_SUPER_QUANT,SET_SUPER_QUANTAL_MECH_BEAST}
58-
function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
59-
return e:GetHandler():GetOverlayGroup():GetClassCount(Card.GetCode)>=2 and Duel.IsMainPhase()
60-
end
61-
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
62-
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
63-
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
64-
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
65-
end
66-
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
67-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
68-
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
69-
if #sg>0 then
70-
Duel.HintSelection(sg)
71-
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
72-
end
73-
end
74-
function s.imcon(e)
75-
return e:GetHandler():GetOverlayGroup():GetClassCount(Card.GetCode)>=4
76-
end
77-
function s.efilter(e,te)
78-
return not te:GetOwner():IsSetCard(SET_SUPER_QUANT)
79-
end
80-
function s.drcon(e)
81-
return e:GetHandler():GetOverlayGroup():GetClassCount(Card.GetCode)>=6
82-
end
8366
function s.spfilter(c,e,tp)
84-
return c:IsSetCard(SET_SUPER_QUANTAL_MECH_BEAST) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
67+
return c:IsSetCard(SET_SUPER_QUANTAL_MECH_BEAST) and c:IsXyzMonster() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
8568
end
8669
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
8770
if chk==0 then
71+
if Duel.GetLocationCount(tp,LOCATION_MZONE)<3 or Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return false end
8872
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
89-
return not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)
90-
and Duel.GetLocationCount(tp,LOCATION_MZONE)>2 and g:GetClassCount(Card.GetCode)>2
73+
return #g>=3 and g:GetClassCount(Card.GetCode)>=3
9174
end
9275
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,3,tp,LOCATION_GRAVE)
9376
end
9477
function s.spop(e,tp,eg,ep,ev,re,r,rp)
95-
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end
96-
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
78+
if Duel.GetLocationCount(tp,LOCATION_MZONE)<3 or Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end
9779
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
98-
if ft>2 and g:GetClassCount(Card.GetCode)>2 then
99-
local tg=aux.SelectUnselectGroup(g,e,tp,3,3,aux.dncheck,1,tp,HINTMSG_SPSUMMON)
100-
Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP)
80+
if #g>=3 and g:GetClassCount(Card.GetCode)>=3 then
81+
local sg=aux.SelectUnselectGroup(g,e,tp,3,3,aux.dncheck,1,tp,HINTMSG_SPSUMMON)
82+
if #sg==3 then
83+
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
84+
end
10185
end
10286
end
87+
function s.effcon(material_count)
88+
return function(e,tp,eg,ep,ev,re,r,rp)
89+
return e:GetHandler():GetOverlayGroup():GetClassCount(Card.GetCode)>=material_count
90+
end
91+
end
92+
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
93+
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
94+
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,PLAYER_EITHER,LOCATION_ONFIELD)
95+
end
96+
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
97+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
98+
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
99+
if #g>0 then
100+
Duel.HintSelection(g)
101+
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
102+
end
103+
end

0 commit comments

Comments
 (0)