-
Notifications
You must be signed in to change notification settings - Fork 1
/
c37564049.lua
49 lines (48 loc) · 1.62 KB
/
c37564049.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
--竹之花 -SDVX Remix-
local m=37564049
local cm=_G["c"..m]
cm.Senya_name_with_remix=true
cm.Senya_name_with_elem=true
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,6,4,nil,nil,5)
Senya.NegateEffectWithoutChainingModule(c,cm.discon,cm.DiscardHandCost,nil,m*16,true,nil)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(cm.xcon)
e3:SetTarget(cm.mttg)
e3:SetOperation(cm.mtop)
c:RegisterEffect(e3)
end
function cm.xcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():IsExists(cm.xfilter,1,nil,4) and e:GetHandler():GetOverlayGroup():IsExists(cm.xfilter,1,nil,5)
end
function cm.xfilter(c,rr)
return c:IsType(TYPE_XYZ) and Senya.check_set_elem(c) and c:GetRank()==rr
end
function cm.mtfilter(c)
return true
end
function cm.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.mtfilter,tp,LOCATION_HAND,0,1,nil) end
end
function cm.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,cm.mtfilter,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
Duel.Overlay(c,g)
end
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp~=tp and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) and cm.xcon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.DiscardHandCost(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT)
end