Commit 7e7c000b authored by Tachibana's avatar Tachibana

得得得得得

parent 133e91b9
Pipeline #13499 passed with stages
in 24 minutes and 54 seconds
......@@ -22,7 +22,7 @@ function cm.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetCondition(cm.condition)
e2:SetCondition(cm.condition2)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=e2:Clone()
......@@ -61,7 +61,7 @@ end
function cm.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetDecktopGroup(1-tp,5)
if c:IsRelateToEffect(e) and g:GetCount()==5 then
if c:IsRelateToEffect(e) and g:GetCount()==5 then
Duel.ConfirmCards(tp,g)
local g2=g:Select(tp,1,1,nil)
Duel.DisableShuffleCheck()
......@@ -69,7 +69,10 @@ function cm.matop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
return (not Duel.IsExistingMatchingCard(cm.ckfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil))
and e:GetHandler():GetOverlayGroup():GetCount()>0
end
......
......@@ -54,11 +54,11 @@ function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local rg=Duel.GetReleaseGroup(tp)
return rg:CheckSubGroup(cm.gfilter,1,#g,tp,c)
return rg:CheckSubGroup(cm.gfilter,1,#rg,tp,c)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local rg=Duel.GetReleaseGroup(tp)
local g=rg:SelectSubGroup(tp,cm.gfilter,false,1,#g,tp,c)
local g=rg:SelectSubGroup(tp,cm.gfilter,false,1,#rg,tp,c)
c:SetMaterial(g)
Duel.Release(g,REASON_COST)
end
......
......@@ -14,6 +14,7 @@ function cm.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.condition)
e1:SetOperation(cm.cpop)
c:RegisterEffect(e1)
--
......@@ -37,14 +38,40 @@ function cm.initial_effect(c)
e9:SetCondition(cm.backon)
e9:SetOperation(cm.backop)
c:RegisterEffect(e9)
--
if not cm.check_for_self then
cm.check_for_self=true
cm.table_self_0={}
cm.table_self_1={}
for i=33400300,33400328 do
table.insert(cm.table_self_0,i)
table.insert(cm.table_self_1,i)
end
end
end
function cm.condition(e,tp)
return #cm["table_self_"..tp]>0
end
function cm.cfilter(c)
return c:IsSetCard(0x3342) and c:IsAbleToGraveAsCost()
end
function cm.cpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
getmetatable(e:GetHandler()).announce_filter={0x5341,OPCODE_ISSETCARD,TYPE_SPELL+TYPE_TRAP,OPCODE_ISTYPE,OPCODE_NOT,OPCODE_AND}
local ac=Duel.AnnounceCard(tp,table.unpack(getmetatable(e:GetHandler()).announce_filter))
Debug.Message(#cm["table_self_"..tp])
local rt={cm["table_self_"..tp][1],OPCODE_ISCODE}
for i=2,#cm["table_self_"..tp] do
table.insert(rt,cm["table_self_"..tp][i])
table.insert(rt,OPCODE_ISCODE)
table.insert(rt,OPCODE_OR)
end
local ac=Duel.AnnounceCard(tp,table.unpack(rt))
local temp={}
for i=1,#cm["table_self_"..tp] do
if cm["table_self_"..tp][i]~=ac then
table.insert(temp,cm["table_self_"..tp][i])
end
end
cm["table_self_"..tp]=temp
--effect gain
local key=1
local tg=Duel.GetMatchingGroup(Card.IsOriginalCodeRule,tp,LOCATION_ONFIELD+LOCATION_EXTRA+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,33400329)
......
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