-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathc100000045.lua
More file actions
82 lines (82 loc) · 2.81 KB
/
c100000045.lua
File metadata and controls
82 lines (82 loc) · 2.81 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
--スキエルA3
function c100000045.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c100000045.spcon)
e1:SetOperation(c100000045.spop)
c:RegisterEffect(e1)
--selfdes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_SELF_DESTROY)
e2:SetCondition(c100000045.sdcon2)
c:RegisterEffect(e2)
--direct attack
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100000045,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c100000045.atcon)
e3:SetTarget(c100000045.attg)
e3:SetOperation(c100000045.atop)
c:RegisterEffect(e3)
end
function c100000045.spfilter(c,code)
return c:GetCode()==code
end
function c100000045.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.CheckReleaseGroup(tp,c100000045.spfilter,1,nil,100000058)
end
function c100000045.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g1=Duel.SelectReleaseGroup(tp,c100000045.spfilter,1,1,nil,100000058)
Duel.Release(g1,REASON_COST)
end
function c100000045.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3013)
end
function c100000045.sdcon2(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c100000045.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler())
end
function c100000045.atcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=1 and Duel.GetCurrentPhase()~=0
end
function c100000045.filter(c)
return c:IsFaceup() and not c:IsHasEffect(EFFECT_CANNOT_ATTACK)
end
function c100000045.attg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100000045.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100000045.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c100000045.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c100000045.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_SET_ATTACK)
e2:SetValue(tc:GetAttack()/2)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end