Skip to content

Commit d1bcefa

Browse files
committed
Update cards using maxxyzct
Handle the case where the value is the Xyz.InfiniteMats token
1 parent 16e774e commit d1bcefa

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

unofficial/c511000700.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ function s.initial_effect(c)
2727
s[1]=false
2828
end)
2929
end)
30-
end
30+
end
3131
function s.condition(e,tp,eg,ep,ev,re,r,rp)
3232
return Duel.GetCurrentPhase()==PHASE_END and s[tp]
3333
end
3434
s.listed_series={0x48}
3535
function s.cfilter(c)
36-
return c:IsSetCard(SET_NUMBER) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
36+
return c:IsSetCard(SET_NUMBER) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
3737
and (c:GetReason()&REASON_DESTROY)==REASON_DESTROY
3838
end
3939
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
@@ -44,7 +44,7 @@ function s.checkop(e,tp,eg,ep,ev,re,r,rp)
4444
end
4545
function s.filter(c,e,tp,ft,g,pg)
4646
local ct=c.minxyzct
47-
return ft>=ct and c:IsRankBelow(4) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_FIEND) and c:IsType(TYPE_XYZ)
47+
return ft>=ct and c:IsRankBelow(4) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_FIEND) and c:IsType(TYPE_XYZ)
4848
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
4949
and aux.SelectUnselectGroup(g,e,tp,ct,ct,aux.FilterBoolFunction(Group.Includes,pg),0)
5050
end
@@ -69,6 +69,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
6969
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
7070
local ct=tc.minxyzct
7171
local ct2=tc.maxxyzct
72+
if ct2==Xyz.InfiniteMats then ct2=ft end
7273
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then if ct>1 then return end ct2=math.min(ct2,1) end
7374
if ft<ct then return end
7475
if ft<ct2 then ct2=ft end
@@ -93,4 +94,4 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
9394
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
9495
tc:CompleteProcedure()
9596
end
96-
end
97+
end

unofficial/c511000829.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
3131
if chkc then return false end
3232
local g=Duel.GetMatchingGroup(s.matfilter,tp,LOCATION_GRAVE,0,nil,e)
3333
local pg=aux.GetMustBeMaterialGroup(tp,g,tp,nil,nil,REASON_XYZ)
34-
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
34+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
3535
and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,g,pg) end
3636
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
3737
local tc=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,g,pg):GetFirst()
3838
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,0)
3939
local ct=tc.minxyzct
4040
local ct2=tc.maxxyzct
41+
if ct2==Xyz.InfiniteMats then ct2=(#g-1) end
4142
g:RemoveCard(tc)
4243
local sg=aux.SelectUnselectGroup(g,e,tp,ct,ct2,s.rescon(pg),1,tp,HINTMSG_XMATERIAL,s.rescon(pg))
4344
Duel.SetTargetCard(sg)
@@ -54,4 +55,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
5455
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,true,POS_FACEUP)
5556
tc:CompleteProcedure()
5657
end
57-
end
58+
end

unofficial/c511001576.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
3838
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
3939
local ct=tc.minxyzct
4040
local ct2=tc.maxxyzct
41-
local og=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.atfilter),tp,LOCATION_GRAVE,0,ct,ct2,nil)
42-
Duel.Overlay(tc,og)
41+
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.atfilter),tp,LOCATION_GRAVE,0,nil)
42+
if ct2==Xyz.InfiniteMats then ct2=#g end
43+
Duel.Overlay(tc,g:Select(tp,ct,ct2,nil))
4344
end
44-
end
45+
end

0 commit comments

Comments
 (0)