-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathc22923081.lua
More file actions
83 lines (83 loc) · 2.7 KB
/
Copy pathc22923081.lua
File metadata and controls
83 lines (83 loc) · 2.7 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
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
--黒魔導戦士 ブレイカー
function c22923081.initial_effect(c)
c:EnableCounterPermit(0x1)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22923081,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c22923081.addtg)
e1:SetOperation(c22923081.addop)
e1:SetLabel(2)
c:RegisterEffect(e1)
--spsummon success
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(22923081,1))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c22923081.addcon)
e2:SetTarget(c22923081.addtg)
e2:SetOperation(c22923081.addop)
e2:SetLabel(3)
c:RegisterEffect(e2)
--atk
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(c22923081.atkval)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(22923081,2))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1,22923081)
e4:SetCost(c22923081.descost)
e4:SetTarget(c22923081.destg)
e4:SetOperation(c22923081.desop)
c:RegisterEffect(e4)
end
c22923081.mentioned_counter={
[0x1]=true,
}
function c22923081.addtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,e:GetLabel(),0,0x1)
end
function c22923081.addop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x1,e:GetLabel())
end
end
function c22923081.addcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c22923081.atkval(e,c)
return c:GetCounter(0x1)*400
end
function c22923081.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x1,1,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x1,1,REASON_COST)
end
function c22923081.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c22923081.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c22923081.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c22923081.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c22923081.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c22923081.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end