-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathc37564026.lua
57 lines (56 loc) · 1.96 KB
/
c37564026.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
53
54
55
56
57
--元素爆发·冰雪
local m=37564026
local cm=_G["c"..m]
cm.Senya_name_with_elem=true
function cm.initial_effect(c)
aux.AddXyzProcedure(c,nil,5,4,cm.ovfilter,aux.Stringid(m,0))
c:EnableReviveLimit()
--ctxm
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1)
--rm
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC_G)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.rmcon)
e2:SetOperation(cm.rmop)
c:RegisterEffect(e2)
--ret
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_ADJUST)
e3:SetCondition(cm.adcon)
e3:SetOperation(cm.retop)
c:RegisterEffect(e3)
end
function cm.ovfilter(c)
return c:IsFaceup() and Senya.check_set_elem(c) and c:IsXyzType(TYPE_XYZ) and c:GetOverlayCount()>=3
end
function cm.rmcon(e,c,og)
local tp=e:GetHandlerPlayer()
local c=e:GetHandler()
return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) and c:GetOverlayCount()>1 and c:IsFaceup() and not c:IsDisabled()
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
Duel.Hint(HINT_CARD,0,m)
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
if cm.adcon(e) then Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_EFFECT) end
end
function cm.adcon(e)
return e:GetHandler():GetOverlayCount()==0 and not e:GetHandler():IsDisabled() and e:GetHandler():IsAbleToExtra()
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsLocation(LOCATION_MZONE) or e:GetHandler():IsFacedown() then return end
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_EFFECT)
end