This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathc511000254.lua
52 lines (52 loc) · 1.83 KB
/
c511000254.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--Dimension Fusion Destruction
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_names={511000253}
function s.tffilter(c)
local code=c:GetCode()
return c:IsAbleToRemove()
and (code==32491823 or code==69890969 or code==6007214)
end
function s.tfilter(c,e,tp)
return c:IsCode(511000253) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function s.filter(c,code)
return c:IsCode(code) and c:IsAbleToRemove()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil,6007214)
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil,32491823)
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil,69890969)
and Duel.IsExistingMatchingCard(s.tfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(s.tffilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=sg:Select(tp,1,1,nil)
sg:Remove(Card.IsCode,nil,g1:GetFirst():GetCode())
local ft=2
local g2=nil
while ft>0 do
g2=sg:Select(tp,1,1,nil)
g1:Merge(g2)
sg:Remove(Card.IsCode,nil,g2:GetFirst():GetCode())
ft=ft-1
end
Duel.Remove(g1,POS_FACEUP,REASON_EFFECT)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end
local sg=Duel.SelectMatchingCard(tp,s.tfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if #sg>0 then
Duel.BreakEffect()
Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEUP)
end
end