-
Notifications
You must be signed in to change notification settings - Fork 3
/
c100000064.lua
34 lines (34 loc) · 1.08 KB
/
c100000064.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
--グランエルG
function c100000064.initial_effect(c)
--selfdes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SELF_DESTROY)
e1:SetCondition(c100000064.sdcon2)
c:RegisterEffect(e1)
--change battle target
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100000064,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BE_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c100000064.cbcon)
e2:SetOperation(c100000064.cbop)
c:RegisterEffect(e2)
end
function c100000064.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3013)
end
function c100000064.sdcon2(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c100000064.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler())
end
function c100000064.cbcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bt=eg:GetFirst()
return c~=bt and bt:GetControler()==c:GetControler()
end
function c100000064.cbop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeAttackTarget(e:GetHandler())
end