Commit 89904413 authored by TanakaKotoha's avatar TanakaKotoha

wdnmd

parent b15b2db7
......@@ -14,7 +14,7 @@ function cm.initial_effect(c)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetDescription(m*16)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetRange(LOCATION_MZONE)
......@@ -34,9 +34,8 @@ function cm.initial_effect(c)
end)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetDescription(m*16)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -47,49 +46,52 @@ function cm.initial_effect(c)
if chk==0 then return Duel.IsExistingMatchingCard(v_filter,tp,0,LOCATION_HAND+LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
cm.announce_filter={TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT}
local ac=Duel.AnnounceCard(tp,table.unpack(cm.announce_filter))
local ac=Duel.AnnounceCardFilter(tp,table.unpack(cm.announce_filter))
Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,ANNOUNCE_CARD_FILTER)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetMatchingGroup(v_filter,tp,0,LOCATION_HAND+LOCATION_ONFIELD,nil)
Duel.ConfirmCards(tp,tg)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local g=Duel.GetMatchingGroup(v_filter,tp,0,LOCATION_HAND+LOCATION_ONFIELD,nil):Filter(Card.IsCode,nil,ac)
local g=tg:Filter(Card.IsCode,nil,ac)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
Duel.ShuffleHand(1-tp)
end)
c:RegisterEffect(e2)
end
function cm.rfilter(c,tp,sc)
return c:IsFaceup() and c:IsAttack(2000) and c:IsReleasable() and Duel.GetLocationCountFromEx(tp,tp,c,sc)>0 and c:IsCanBeFusionMaterial(sc,SUMMON_TYPE_SPECIAL)
function cm.spfilter(c,fc)
return c:IsAttack(2000) and c:IsCanBeFusionMaterial(fc)
end
function cm.spfilter_(c,fc)
return c:IsAttack(2000) and c:IsCanBeFusionMaterial(fc) and c:IsFaceup()
end
function cm.spfilter1(c,tp,g)
return g:IsExists(cm.spfilter2,1,c,tp,c)
end
function cm.mzfilter(c,tp,sc)
return c:IsFaceup() and c:IsAttack(2000) and c:IsReleasable() and Duel.GetLocationCountFromEx(tp,tp,c,sc)>0 and c:IsCanBeFusionMaterial(sc,SUMMON_TYPE_SPECIAL)
function cm.spfilter2(c,tp,mc)
return Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft+1
if ct>2 then return false end
if ct>0 and not Duel.IsExistingMatchingCard(cm.mzfilter,tp,LOCATION_MZONE,0,ct,nil) then return false end
return Duel.IsExistingMatchingCard(cm.rfilter,tp,LOCATION_MZONE,LOCATION_MZONE,2,nil)
local g=Duel.GetReleaseGroup(tp):Filter(cm.spfilter,nil,c)
local g2=Duel.GetReleaseGroup(1-tp):Filter(cm.spfilter_,nil,c)
g:Merge(g2)
return g:IsExists(cm.spfilter1,1,nil,tp,g)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft+1
if ct<0 then ct=0 end
local g=Group.CreateGroup()
if ct>0 then
local g=Duel.GetReleaseGroup(tp):Filter(cm.spfilter,nil,c)
local g2=Duel.GetReleaseGroup(1-tp):Filter(cm.spfilter_,nil,c)
g:Merge(g2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=Duel.SelectMatchingCard(tp,cm.mzfilter,tp,LOCATION_MZONE,0,ct,ct,nil)
g:Merge(sg)
end
if ct<2 then
local g1=g:FilterSelect(tp,cm.spfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=Duel.SelectMatchingCard(tp,cm.rfilter,tp,LOCATION_MZONE,LOCATION_MZONE,2-ct,2-ct,g:GetFirst())
g:Merge(sg)
end
c:SetMaterial(g)
Duel.Release(g,REASON_COST)
local g2=g:FilterSelect(tp,cm.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
c:SetMaterial(g1)
Duel.Release(g1,REASON_COST+REASON_FUSION+REASON_MATERIAL)
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