-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathc11741041.lua
More file actions
52 lines (52 loc) · 1.64 KB
/
Copy pathc11741041.lua
File metadata and controls
52 lines (52 loc) · 1.64 KB
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
--サンダー・ボトル
function c11741041.initial_effect(c)
c:EnableCounterPermit(0xc)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_SZONE)
e2:SetOperation(c11741041.ctop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11741041,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c11741041.descon)
e3:SetCost(c11741041.descost)
e3:SetTarget(c11741041.destg)
e3:SetOperation(c11741041.desop)
c:RegisterEffect(e3)
end
c11741041.mentioned_counter={
[0xc]=true,
}
function c11741041.ctop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetAttacker():IsControler(tp) then
e:GetHandler():AddCounter(0xc,1)
end
end
function c11741041.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetCounter(0xc)>=4
end
function c11741041.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c11741041.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c11741041.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end