Commit 5657046d authored by Nemo Ma's avatar Nemo Ma

Update c82209120.lua

parent 096fa006
......@@ -29,7 +29,9 @@ function cm.spfilter(c,e,tp)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.fselect(g,c,tp)
return g:IsContains(c) and Duel.IsExistingMatchingCard(cm.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,g) and g:GetCount()<=Duel.GetLocationCount(tp,LOCATION_MZONE)
local mg=Group.Clone(g)
mg:AddCard(c)
return Duel.IsExistingMatchingCard(cm.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
end
function cm.xyzfilter(c,g)
return c:IsType(TYPE_XYZ) and c:IsRace(RACE_MACHINE) and c:IsXyzSummonable(g,g:GetCount(),g:GetCount())
......@@ -40,27 +42,31 @@ end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
if not cm.spfilter(c,e,tp) then return false end
if not Duel.IsPlayerCanSpecialSummonCount(tp,2) or Duel.IsPlayerAffectedByEffect(tp,59822133) then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return false end
if ft<=1 then return false end
local cg=Duel.GetMatchingGroup(cm.chkfilter,tp,LOCATION_EXTRA,0,nil,tp)
if cg:GetCount()==0 then return false end
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
return g:CheckSubGroup(cm.fselect,2,g:GetCount(),c,tp)
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,c,e,tp)
if g:GetCount()==0 then return false end
return g:CheckSubGroup(cm.fselect,1,ft-1,c,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not cm.spfilter(c,e,tp) then return false end
if not Duel.IsPlayerCanSpecialSummonCount(tp,2) or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,c,e,tp)
local cg=Duel.GetMatchingGroup(cm.chkfilter,tp,LOCATION_EXTRA,0,nil,tp)
if ft>0 and cg:GetCount()>0 then
if ft>0 and g:GetCount()>0 and cg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,cm.fselect,false,2,g:GetCount(),c,tp)
local sg=g:SelectSubGroup(tp,cm.fselect,false,1,ft-1,c,tp)
if not sg then return end
sg:AddCard(c)
local tc=sg:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment