-
Notifications
You must be signed in to change notification settings - Fork 1
/
c37564043.lua
205 lines (204 loc) · 6.47 KB
/
c37564043.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
--残留于世的美术
local m=37564043
local cm=_G["c"..m]
cm.Senya_name_with_elem=true
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,4,2,nil,nil,63)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.xyzlimit)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0x3c0)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCountLimit(1,37560043)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return not Duel.CheckEvent(EVENT_CHAINING)
end)
e2:SetCost(cm.copycost)
e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
local e22=e2:Clone()
e22:SetDescription(aux.Stringid(m,1))
e22:SetCost(cm.copycostx)
e22:SetCountLimit(1,37561043)
e22:SetTarget(cm.targetx)
c:RegisterEffect(e22)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetCountLimit(1,37560043)
e3:SetCost(cm.copycost)
e3:SetTarget(cm.target2)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
local e23=e3:Clone()
e23:SetDescription(aux.Stringid(m,1))
e23:SetCost(cm.copycostx)
e23:SetCountLimit(1,37561043)
e23:SetTarget(cm.target2x)
c:RegisterEffect(e23)
end
function cm.copycost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function cm.copycostx(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function cm.filter1(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false) and Senya.check_set_rose(c)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
local te=e:GetLabelObject()
local tg=te:GetTarget()
return te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0,chkc))
end
local og=e:GetHandler():GetOverlayGroup()
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return og:IsExists(cm.filter1,1,nil)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=og:FilterSelect(tp,cm.filter1,1,1,nil)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(true,true,true)
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
end
function cm.targetx(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then
local te=e:GetLabelObject()
local tg=te:GetTarget()
return te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0,chkc))
end
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_GRAVE,0,1,nil)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.filter1,tp,LOCATION_GRAVE,0,1,1,nil)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(true,true,true)
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if not te then return end
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
e:GetHandler():ReleaseEffectRelation(e)
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
function cm.filter2(c,e,tp,eg,ep,ev,re,r,rp)
if c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemoveAsCost() and Senya.check_set_rose(c) then
if c:CheckActivateEffect(true,true,false) then return true end
local te=c:GetActivateEffect()
if te:GetCode()~=EVENT_CHAINING then return false end
local tg=te:GetTarget()
if tg and not tg(e,tp,eg,ep,ev,re,r,rp,0) then return false end
return true
else return false end
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then
local te=e:GetLabelObject()
local tg=te:GetTarget()
return te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0,chkc))
end
local og=e:GetHandler():GetOverlayGroup()
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return og:IsExists(cm.filter2,1,nil,e,tp,eg,ep,ev,re,r,rp)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=og:FilterSelect(tp,cm.filter2,1,1,nil,e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
local te,ceg,cep,cev,cre,cr,crp
local fchain=cm.filter1(tc)
if fchain then
te,ceg,cep,cev,cre,cr,crp=tc:CheckActivateEffect(true,true,true)
else
te=tc:GetActivateEffect()
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then
if fchain then
tg(e,tp,ceg,cep,cev,cre,cr,crp,1)
else
tg(e,tp,eg,ep,ev,re,r,rp,1)
end
end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
end
function cm.target2x(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then
local te=e:GetLabelObject()
local tg=te:GetTarget()
return te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0,chkc))
end
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp,eg,ep,ev,re,r,rp)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.filter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
local te,ceg,cep,cev,cre,cr,crp
local fchain=cm.filter1(tc)
if fchain then
te,ceg,cep,cev,cre,cr,crp=tc:CheckActivateEffect(true,true,true)
else
te=tc:GetActivateEffect()
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then
if fchain then
tg(e,tp,ceg,cep,cev,cre,cr,crp,1)
else
tg(e,tp,eg,ep,ev,re,r,rp,1)
end
end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
end