-
Notifications
You must be signed in to change notification settings - Fork 1
/
c37564105.lua
127 lines (127 loc) · 4.32 KB
/
c37564105.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
--效果樱
local m=37564105
local cm=_G["c"..m]
function cm.initial_effect(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(cm.con)
e2:SetCost(cm.cost)
e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_SPSUMMON)
e3:SetCountLimit(1,37564105)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.discon)
e3:SetTarget(cm.distg)
e3:SetOperation(cm.disop)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
--e4:SetCondition(cm.condition)
e4:SetTarget(cm.thtg)
e4:SetOperation(cm.thop)
c:RegisterEffect(e4)
--
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(cm.spcon)
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e5:SetValue(1)
c:RegisterEffect(e5)
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x772) and c:IsType(TYPE_MONSTER)
end
function cm.con(e,c)
return Duel.IsExistingMatchingCard(cm.cfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToDeckAsCost() end
Duel.SendtoDeck(c,nil,2,REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function cm.filter(c,e,tp)
return c:IsSetCard(0x772) and c:IsAbleToDeck() and c:IsType(TYPE_MONSTER)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function cm.tfilter(c,e,tp)
return c:IsCode(37564101)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return e:GetHandler():IsDestructable()
and Duel.IsExistingMatchingCard(cm.tfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.Destroy(c,REASON_EFFECT)==0 or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.tfilter,tp,LOCATION_EXTRA,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)>0
end