Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions c11020863.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if not Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) then return false end
local tg=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
return tg:CheckSubGroup(aux.dlvcheck,5,5)
return tg:WithCheckSpec(aux.dlvcheck_spec):CheckSubGroup(nil,5,5)
end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,5,tp,LOCATION_HAND+LOCATION_DECK)
Expand All @@ -54,7 +54,7 @@ end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=tg:SelectSubGroup(tp,aux.dlvcheck,false,5,5)
local sg=tg:WithCheckSpec(aux.dlvcheck_spec):SelectSubGroup(tp,nil,false,5,5)
if sg then
Duel.SendtoGrave(sg,REASON_EFFECT)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Expand Down
4 changes: 1 addition & 3 deletions c12215894.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ function c12215894.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c12215894.cfilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD,0,nil)
if chk==0 then return g:GetClassCount(Card.GetCode)>=9 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
aux.GCheckAdditional=aux.dncheck
local rg=g:SelectSubGroup(tp,aux.TRUE,false,9,9)
aux.GCheckAdditional=nil
local rg=g:WithCheckSpec(aux.dncheck_spec):SelectSubGroup(tp,aux.TRUE,false,9,9)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
end
function c12215894.target2(e,tp,eg,ep,ev,re,r,rp,chk)
Expand Down
14 changes: 10 additions & 4 deletions c12289247.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ function c12289247.initial_effect(c)
end
end
c12289247.hnchecks=aux.CreateChecks(Card.IsSetCard,{0x10f2,0x2073,0x2017,0x1046})
function c12289247.hnclassifier(c)
if c:IsLocation(LOCATION_MZONE) then return nil end
return aux.GetCheckMask(c,c12289247.hnchecks)
end
function c12289247.spcfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT)
and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD)
Expand Down Expand Up @@ -127,11 +131,13 @@ end
function c12289247.hncost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(c12289247.cfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil)
if chk==0 then return c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c12289247.hnfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
and mg:CheckSubGroupEach(c12289247.hnchecks,c12289247.hngoal,e,tp,c) end
if chk==0 then
if not (c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c12289247.hnfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)) then return false end
return mg:WithSubGroupContext(nil,c12289247.hnclassifier):CheckSubGroupEach(c12289247.hnchecks,c12289247.hngoal,e,tp,c)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=mg:SelectSubGroupEach(tp,c12289247.hnchecks,false,c12289247.hngoal,e,tp,c)
local sg=mg:WithSubGroupContext(nil,c12289247.hnclassifier):SelectSubGroupEach(tp,c12289247.hnchecks,false,c12289247.hngoal,e,tp,c)
sg:AddCard(c)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
Expand Down
4 changes: 1 addition & 3 deletions c14386013.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ function c14386013.drop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c14386013.drfilter),p,LOCATION_HAND+LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
aux.GCheckAdditional=aux.dncheck
local sg=g:SelectSubGroup(p,aux.TRUE,false,1,Duel.GetFieldGroupCount(p,LOCATION_DECK,0))
aux.GCheckAdditional=nil
local sg=g:WithCheckSpec(aux.dncheck_spec):SelectSubGroup(p,aux.TRUE,false,1,Duel.GetFieldGroupCount(p,LOCATION_DECK,0))
if sg then
Duel.ConfirmCards(1-p,sg)
local ct=aux.PlaceCardsOnDeckBottom(p,sg)
Expand Down
2 changes: 1 addition & 1 deletion c15094540.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return ft>=5 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_REMOVED,0,5,nil,e,tp) and g:GetClassCount(Card.GetCode)>=5
and not Duel.IsPlayerAffectedByEffect(tp,59822133) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=g:SelectSubGroup(tp,aux.dncheck,false,5,5)
local tg=g:WithCheckSpec(aux.dncheck_spec):SelectSubGroup(tp,nil,false,5,5)
Duel.SetTargetCard(tg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tg,tg:GetCount(),0,0)
end
Expand Down
4 changes: 1 addition & 3 deletions c16329071.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ function c16329071.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c16329071.filter),tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_ONFIELD+LOCATION_REMOVED,0,nil)
if g:GetClassCount(Card.GetCode)<5 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
aux.GCheckAdditional=aux.dncheck
local sg=g:SelectSubGroup(tp,aux.TRUE,false,5,5)
aux.GCheckAdditional=nil
local sg=g:WithCheckSpec(aux.dncheck_spec):SelectSubGroup(tp,aux.TRUE,false,5,5)
local cg=sg:Filter(Card.IsLocation,nil,LOCATION_HAND)
if cg:GetCount()>0 then
Duel.ConfirmCards(1-tp,cg)
Expand Down
2 changes: 1 addition & 1 deletion c17197110.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function c17197110.activate(e,tp,eg,ep,ev,re,r,rp)
if ft<ct or ft<=0 then return end
local g=Duel.GetMatchingGroup(c17197110.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,ct,ct)
local sg=g:WithCheckSpec(aux.dncheck_spec):SelectSubGroup(tp,nil,false,ct,ct)
if sg then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
Expand Down
2 changes: 1 addition & 1 deletion c20537097.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function c20537097.thop(e,tp,eg,ep,ev,re,r,rp)
if c:IsControler(1-tp) then ct=ct+1 end
if ct<=0 or g:GetClassCount(Card.GetCode)<ct then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local hg=g:SelectSubGroup(tp,aux.dncheck,false,ct,ct)
local hg=g:WithCheckSpec(aux.dncheck_spec):SelectSubGroup(tp,nil,false,ct,ct)
Duel.SendtoHand(hg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,hg)
end
24 changes: 11 additions & 13 deletions c22398665.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ function c22398665.operation(e,tp,eg,ep,ev,re,r,rp)
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=c22398665.RitualCheckAdditional(tc,tc:GetAttack(),"Greater")
local mat=mg:SelectSubGroup(tp,c22398665.RitualCheck,true,1,#mg,tp,tc,tc:GetAttack(),"Greater")
aux.GCheckAdditional=nil
local mat=mg:WithSubGroupContext(c22398665.RitualCheckAdditional(tc,tc:GetAttack(),"Greater"),c22398665.RitualClassifier):SelectSubGroup(tp,c22398665.RitualCheck,true,1,#mg,tp,tc,tc:GetAttack(),"Greater")
if not mat then goto cancel end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Expand Down Expand Up @@ -98,16 +96,19 @@ function c22398665.RitualCheckAdditional(c,atk,greater_or_equal)
return (not aux.RGCheckAdditional or aux.RGCheckAdditional(g)) and g:GetSum(aux.GetCappedAttack)<=atk
end
else
return function(g,ec)
return function(g)
if atk==0 then return #g<=1 end
if ec then
return (not aux.RGCheckAdditional or aux.RGCheckAdditional(g,ec)) and g:GetSum(aux.GetCappedAttack)-aux.GetCappedAttack(ec)<=atk
else
return not aux.RGCheckAdditional or aux.RGCheckAdditional(g)
end
local sum=g:GetSum(aux.GetCappedAttack)
if aux.RGCheckAdditional and not aux.RGCheckAdditional(g) then return false end
local _,minatk=g:GetMinGroup(aux.GetCappedAttack)
return sum-minatk<atk
end
end
end
function c22398665.RitualClassifier(c)
if c:IsLocation(LOCATION_MZONE) then return nil end
return aux.GetCappedAttack(c)
end
function c22398665.RitualUltimateFilter(c,filter,e,tp,m1,m2,attack_function,greater_or_equal,chk)
if bit.band(c:GetType(),0x81)~=0x81 or (filter and not filter(c,e,tp,chk)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c)
Expand All @@ -120,8 +121,5 @@ function c22398665.RitualUltimateFilter(c,filter,e,tp,m1,m2,attack_function,grea
mg:RemoveCard(c)
end
local atk=attack_function(c)
aux.GCheckAdditional=c22398665.RitualCheckAdditional(c,atk,greater_or_equal)
local res=mg:CheckSubGroup(c22398665.RitualCheck,1,#mg,tp,c,atk,greater_or_equal)
aux.GCheckAdditional=nil
return res
return mg:WithSubGroupContext(c22398665.RitualCheckAdditional(c,atk,greater_or_equal),c22398665.RitualClassifier):CheckSubGroup(c22398665.RitualCheck,1,#mg,tp,c,atk,greater_or_equal)
end
11 changes: 5 additions & 6 deletions c24166324.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,12 @@ function s.RitualCheckAdditional(c,atk,greater_or_equal)
return (not aux.RGCheckAdditional or aux.RGCheckAdditional(g)) and g:GetSum(aux.GetCappedAttack)<=atk
end
else
return function(g,ec)
return function(g)
if atk==0 then return #g<=1 end
if ec then
return (not aux.RGCheckAdditional or aux.RGCheckAdditional(g,ec)) and g:GetSum(aux.GetCappedAttack)-aux.GetCappedAttack(ec)<=atk
else
return not aux.RGCheckAdditional or aux.RGCheckAdditional(g)
end
local sum=g:GetSum(aux.GetCappedAttack)
if aux.RGCheckAdditional and not aux.RGCheckAdditional(g) then return false end
local _,minatk=g:GetMinGroup(aux.GetCappedAttack)
return sum-minatk<atk
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion c28189908.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil):SelectSubGroup(tp,aux.dncheck,false,2,2)
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil):WithCheckSpec(aux.dncheck_spec):SelectSubGroup(tp,nil,false,2,2)
if g then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Expand Down
2 changes: 1 addition & 1 deletion c32270212.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local ct=math.min(ft,2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,ct)
local sg=g:WithCheckSpec(aux.dncheck_spec):SelectSubGroup(tp,nil,false,1,ct)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Expand Down
2 changes: 1 addition & 1 deletion c41516133.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(s.costfilter,tp,LOCATION_DECK+LOCATION_HAND,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=g:SelectSubGroup(tp,aux.dncheck,false,1,5)
local tg=g:WithCheckSpec(aux.dncheck_spec):SelectSubGroup(tp,nil,false,1,5)
Duel.SendtoGrave(tg,REASON_COST)
e:SetLabel(tg:GetCount())
end
Expand Down
2 changes: 1 addition & 1 deletion c57093995.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function c57093995.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c57093995.tgfilter,tp,LOCATION_DECK,0,nil)
local ct=Duel.GetMatchingGroupCount(Card.IsSummonLocation,tp,0,LOCATION_MZONE,nil,LOCATION_EXTRA)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,ct+1)
local sg=g:WithCheckSpec(aux.dncheck_spec):SelectSubGroup(tp,nil,false,1,ct+1)
if sg and sg:GetCount()>0 then
Duel.SendtoGrave(sg,REASON_EFFECT)
end
Expand Down
9 changes: 7 additions & 2 deletions c61411502.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ function c61411502.initial_effect(c)
c:RegisterEffect(e1)
end
c61411502.rchecks=aux.CreateChecks(Card.IsAttribute,{ATTRIBUTE_WIND,ATTRIBUTE_WATER,ATTRIBUTE_FIRE,ATTRIBUTE_EARTH})
function c61411502.rclassifier(c)
return aux.GetCheckMask(c,c61411502.rchecks)
end
function c61411502.rgoal(g,tp)
return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,g)
end
function c61411502.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetReleaseGroup(tp)
if chk==0 then return g:CheckSubGroupEach(c61411502.rchecks,c61411502.rgoal,tp) end
if chk==0 then
return g:WithSubGroupContext(nil,c61411502.rclassifier):CheckSubGroupEach(c61411502.rchecks,c61411502.rgoal,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g:SelectSubGroupEach(tp,c61411502.rchecks,false,c61411502.rgoal,tp)
local rg=g:WithSubGroupContext(nil,c61411502.rclassifier):SelectSubGroupEach(tp,c61411502.rchecks,false,c61411502.rgoal,tp)
aux.UseExtraReleaseCount(rg,tp)
Duel.Release(rg,REASON_COST)
end
Expand Down
9 changes: 6 additions & 3 deletions c6309986.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ function c6309986.initial_effect(c)
c:RegisterEffect(e1)
end
c6309986.spchecks=aux.CreateChecks(Card.IsCode,{44632120,71036835,7021574,34419588,40640057})
function c6309986.spclassifier(c)
return aux.GetCheckMask(c,c6309986.spchecks)
end
function c6309986.cfilter(c,tp)
return c:IsFaceup() and c:IsLevel(5) and c:IsReleasable() and Duel.GetMZoneCount(tp,c)>=5
end
Expand All @@ -31,16 +34,16 @@ function c6309986.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
e:SetLabel(0)
local g=Duel.GetMatchingGroup(c6309986.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
return res and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and g:CheckSubGroupEach(c6309986.spchecks)
if not (res and not Duel.IsPlayerAffectedByEffect(tp,59822133)) then return false end
return g:WithSubGroupContext(nil,c6309986.spclassifier):CheckSubGroupEach(c6309986.spchecks)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,5,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function c6309986.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>=5 and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c6309986.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroupEach(tp,c6309986.spchecks,false)
local sg=g:WithSubGroupContext(nil,c6309986.spclassifier):SelectSubGroupEach(tp,c6309986.spchecks,false)
if sg then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
for tc in aux.Next(sg) do
Expand Down
11 changes: 8 additions & 3 deletions c70914287.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ function c70914287.initial_effect(c)
c:RegisterEffect(e5)
end
c70914287.spchecks=aux.CreateChecks(Card.IsCode,{44632120,71036835,7021574,34419588,40640057})
function c70914287.spclassifier(c)
return aux.GetCheckMask(c,c70914287.spchecks)
end
function c70914287.spcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER)>Duel.GetMatchingGroupCount(Card.IsType,1-tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER)
end
Expand Down Expand Up @@ -71,8 +74,10 @@ end
function c70914287.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c70914287.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return c:IsAbleToHand() and Duel.GetMZoneCount(tp,c)>=5 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and g:CheckSubGroupEach(c70914287.spchecks) end
if chk==0 then
if not (c:IsAbleToHand() and Duel.GetMZoneCount(tp,c)>=5 and not Duel.IsPlayerAffectedByEffect(tp,59822133)) then return false end
return g:WithSubGroupContext(nil,c70914287.spclassifier):CheckSubGroupEach(c70914287.spchecks)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,5,tp,LOCATION_HAND+LOCATION_GRAVE)
end
Expand All @@ -82,7 +87,7 @@ function c70914287.spop2(e,tp,eg,ep,ev,re,r,rp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>=5 and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c70914287.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroupEach(tp,c70914287.spchecks,false)
local sg=g:WithSubGroupContext(nil,c70914287.spclassifier):SelectSubGroupEach(tp,c70914287.spchecks,false)
if sg then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_ATTACK)
end
Expand Down
14 changes: 10 additions & 4 deletions c76794549.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ function c76794549.initial_effect(c)
end
end
c76794549.hnchecks=aux.CreateChecks(Card.IsSetCard,{0x10f2,0x2073,0x2017,0x1046})
function c76794549.hnclassifier(c)
if c:IsLocation(LOCATION_MZONE) then return nil end
return aux.GetCheckMask(c,c76794549.hnchecks)
end
function c76794549.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
Expand Down Expand Up @@ -155,11 +159,13 @@ end
function c76794549.hncost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(c76794549.cfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil)
if chk==0 then return c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c76794549.hnfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,nil)
and mg:CheckSubGroupEach(c76794549.hnchecks,c76794549.hngoal,e,tp,c) end
if chk==0 then
if not (c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c76794549.hnfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,nil)) then return false end
return mg:WithSubGroupContext(nil,c76794549.hnclassifier):CheckSubGroupEach(c76794549.hnchecks,c76794549.hngoal,e,tp,c)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=mg:SelectSubGroupEach(tp,c76794549.hnchecks,false,c76794549.hngoal,e,tp,c)
local sg=mg:WithSubGroupContext(nil,c76794549.hnclassifier):SelectSubGroupEach(tp,c76794549.hnchecks,false,c76794549.hngoal,e,tp,c)
sg:AddCard(c)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
Expand Down
4 changes: 1 addition & 3 deletions c77075360.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ function c77075360.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local ct=math.min(g:GetClassCount(Card.GetLevel),ft)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
aux.GCheckAdditional=aux.dlvcheck
local sg=g:SelectSubGroup(tp,aux.TRUE,false,ct,ct)
aux.GCheckAdditional=nil
local sg=g:WithCheckSpec(aux.dlvcheck_spec):SelectSubGroup(tp,aux.TRUE,false,ct,ct)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
function c77075360.regop(e,tp,eg,ep,ev,re,r,rp)
Expand Down
2 changes: 1 addition & 1 deletion c7986397.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ end
function c7986397.rcheck(tp,g,c)
return g:FilterCount(Card.IsLocation,nil,LOCATION_DECK)<=1
end
function c7986397.rgcheck(g,ec)
function c7986397.rgcheck(g)
return g:FilterCount(Card.IsLocation,nil,LOCATION_DECK)<=1
end
function c7986397.target(e,tp,eg,ep,ev,re,r,rp,chk)
Expand Down
8 changes: 6 additions & 2 deletions c80033124.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ function c80033124.initial_effect(c)
c:RegisterEffect(e1)
end
c80033124.fchecks=aux.CreateChecks(Card.IsFusionCode,{41230939,77625948,3019642})
function c80033124.fclassifier(c)
if c:IsLocation(LOCATION_MZONE) then return nil end
return aux.GetCheckMask(c,c80033124.fchecks)
end
function c80033124.ffilter0(c)
return c:IsFusionCode(41230939,77625948,3019642) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck()
end
Expand All @@ -30,7 +34,7 @@ function c80033124.target(e,tp,eg,ep,ev,re,r,rp,chk)
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL) then return false end
if not Duel.IsExistingMatchingCard(c80033124.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,nil) then return false end
local mg=Duel.GetMatchingGroup(c80033124.ffilter0,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
return mg:CheckSubGroupEach(c80033124.fchecks,c80033124.fgoal,e,tp)
return mg:WithSubGroupContext(nil,c80033124.fclassifier):CheckSubGroupEach(c80033124.fchecks,c80033124.fgoal,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
Expand All @@ -44,7 +48,7 @@ function c80033124.activate(e,tp,eg,ep,ev,re,r,rp)
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL) then return end
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c80033124.ffilter),tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=mg:SelectSubGroupEach(tp,c80033124.fchecks,false,c80033124.fgoal,e,tp)
local sg=mg:WithSubGroupContext(nil,c80033124.fclassifier):SelectSubGroupEach(tp,c80033124.fchecks,false,c80033124.fgoal,e,tp)
if not sg then return end
local cg=sg:Filter(c80033124.cfilter,nil)
if cg:GetCount()>0 then
Expand Down
7 changes: 1 addition & 6 deletions c81560239.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,15 @@ end
function s.mfilter(c)
return c:GetLevel()>0 and c:IsRace(RACE_REPTILE) and c:IsReleasable(REASON_EFFECT|REASON_MATERIAL|REASON_RITUAL)
end
function s.rcheck(tp,g,c)
return g:GetCount()<3
end
function s.rgcheck(g,ec)
function s.rgcheck(g)
return g:GetCount()<3
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local mg1=Duel.GetRitualMaterial(tp):Filter(Card.IsRace,nil,RACE_REPTILE)
local mg2=Duel.GetMatchingGroup(s.mfilter,tp,LOCATION_DECK,0,nil)
local s1=Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_DECK,0,1,nil,s.filter,e,tp,mg1,nil,Card.GetLevel,"Equal")
aux.RCheckAdditional=s.rcheck
aux.RGCheckAdditional=s.rgcheck
local s2=Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,s.filter,e,tp,mg1,mg2,Card.GetLevel,"Equal")
aux.RCheckAdditional=nil
aux.RGCheckAdditional=nil
local b1=s1 and (Duel.GetFlagEffect(tp,id)==0 or not e:IsCostChecked())
local b2=s2 and (Duel.GetFlagEffect(tp,id+o)==0 or not e:IsCostChecked())
Expand Down
Loading