-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathc37564054.lua
50 lines (50 loc) · 1.8 KB
/
c37564054.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
--Subterranean Rose
local m=37564054
local cm=_G["c"..m]
cm.Senya_name_with_rose=true
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_EXTRA)
end
function cm.sfilter(c)
return c:IsFaceup() and c:IsCanBeXyzMaterial()
end
function cm.filter(c,tg,tp)
return Duel.IsExistingMatchingCard(cm.xfilter,tp,LOCATION_EXTRA,0,1,nil,tg,tc)
end
function cm.xfilter(c,tg,tc)
return tg:IsExists(cm.mfilter,1,nil,c,tc)
end
function cm.mfilter(c,xyzc,exc)
return c:IsCanBeXyzMaterial(xyzc) and exc:IsCanBeXyzMaterial(xyzc) and xyzc:IsXyzSummonable(Group.FromCards(c,exc),2,2)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local tg=Duel.GetMatchingGroup(cm.sfilter,p,LOCATION_MZONE,0,nil)
local g=Duel.GetFieldGroup(p,0,LOCATION_HAND)
if g:GetCount()>0 then
Duel.ConfirmCards(p,g)
if g:IsExists(cm.filter,1,nil,tg,p) and Duel.SelectYesNo(p,37564007*16) then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_XMATERIAL)
local g1=g:FilterSelect(p,cm.filter,1,1,nil,tg,p)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_SPSUMMON)
local xyzc=Duel.SelectMatchingCard(p,cm.xfilter,p,LOCATION_EXTRA,0,1,1,nil,tg,g1:GetFirst()):GetFirst()
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_XMATERIAL)
local g2=tg:FilterSelect(p,cm.mfilter,1,1,nil,xyzc,g1:GetFirst())
g1:Merge(g2)
Duel.XyzSummon(p,xyzc,g1)
end
end
end