Commit 6c954e12 authored by GuGu's avatar GuGu

Update c74561099.lua

parent 7d463ab9
Pipeline #42365 passed with stage
in 7 seconds
......@@ -5,7 +5,7 @@ local cCardno = c74561099
function cCardno.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x999),9,2,nil,aux.Stringid(Cardno,5),12)
cCardno.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x999),9,2,nil,aux.Stringid(Cardno,5),12)
--dark synchro summon
DS.AddDarkSynchroProcedure(c,nil,aux.FilterBoolFunction(Card.IsSetCard,0x999),9)
--EN
......@@ -168,4 +168,154 @@ function cCardno.enop(e,tp,eg,ep,ev,re,r,rp)
Duel.Overlay(c,g)
end
end
end
--
function cCardno.AddXyzProcedure(c,f,lv,ct,alterf,alterdesc,maxct,alterop)
if not maxct then maxct=ct end
local e1=Effect.CreateEffect(c)
e1:SetDescription(1165)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(cCardno.XyzCondition(f,lv,ct,maxct,alterf,alterdesc,alterop))
e1:SetTarget(cCardno.XyzTarget(f,lv,ct,maxct,alterf,alterdesc,alterop))
e1:SetOperation(cCardno.XyzOperation(f,lv,ct,maxct,alterf,alterdesc,alterop))
e1:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e1)
end
function cCardno.XyzCondition(f,lv,minct,maxct,alterf,alterdesc,alterop)
return function(e,c,og,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local mg=nil
if og then
og=Group.FromCards(og)
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
end
if alterf and (not min or min<=1) then
if mg:IsExists(aux.XyzAlterFilter,1,nil,alterf,c,e,tp,alterop) then
return true
end
end
local minc=minct
local maxc=maxct
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
if minct>=3 and mg:IsExists(aux.Xyz2XMaterialEffectFilter,1,nil,c,lv,f,tp) then
return aux.CheckXyz2XMaterial(c,f,lv,minc,maxc,mg)
else
if minc>maxc then return false end
return Duel.CheckXyzMaterial(c,f,lv,minc,maxc,og)
end
end
end
function cCardno.XyzTarget(f,lv,minct,maxct,alterf,alterdesc,alterop)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then
return true
end
local minc=minct
local maxc=maxct
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local b1=true
local b2=false
local altg=nil
local mg=nil
if og then
og=Group.FromCards(og)
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
end
if alterf and (not min or min<=1) then
altg=mg:Filter(aux.XyzAlterFilter,nil,alterf,c,e,tp,alterop)
if minct>=3 and mg:IsExists(aux.Xyz2XMaterialEffectFilter,1,nil,c,lv,f,tp) then
b1=aux.CheckXyz2XMaterial(c,f,lv,minc,maxc,mg)
else
b1=Duel.CheckXyzMaterial(c,f,lv,minc,maxc,og)
end
b2=#altg>0
end
local g=nil
if b2 and (not b1 or Duel.SelectYesNo(tp,alterdesc)) then
e:SetLabel(1)
local cancel=Duel.IsSummonCancelable()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local tc=altg:SelectUnselect(nil,tp,false,cancel,1,1)
if tc then
g=Group.FromCards(tc)
if alterop then alterop(e,tp,1,tc) end
end
else
e:SetLabel(0)
if minct>=3 and mg:IsExists(aux.Xyz2XMaterialEffectFilter,1,nil,c,lv,f,tp) then
mg=mg:Filter(aux.Xyz2XMaterialFilter,nil,c,lv,f)
local cancel=Duel.IsSummonCancelable()
local sg=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_XMATERIAL)
Duel.SetSelectedCard(sg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
aux.GCheckAdditional=aux.TuneMagicianCheckAdditionalX(EFFECT_TUNE_MAGICIAN_X)
g=mg:SelectSubGroup(tp,aux.Xyz2XMaterialGoal,cancel,2,maxc,tp,c,minc)
aux.GCheckAdditional=nil
else
g=Duel.SelectXyzMaterial(tp,c,f,lv,minc,maxc,og)
end
end
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
end
function cCardno.XyzOperation(f,lv,minct,maxct,alterf,alterdesc,alterop)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
og=Group.FromCards(og)
aux.Xyz2XMaterialOperation(tp,og,c,minct,maxct)
local sg=Group.CreateGroup()
local tc=og:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=og:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
if e:GetLabel()==1 then
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
else
aux.Xyz2XMaterialOperation(tp,mg,c,minct,maxct)
local sg=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=mg:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
end
\ No newline at end of file
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