-
-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathc160001047.lua
46 lines (46 loc) · 1.13 KB
/
c160001047.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
--地縛霊の誘い
--Call of the Earthbound (Rush)
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ag,da=eg:GetFirst():GetAttackableTarget()
local at=Duel.GetAttackTarget()
return ag:IsExists(aux.TRUE,1,at) or (at~=nil and da)
end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local ag,da=eg:GetFirst():GetAttackableTarget()
local at=Duel.GetAttackTarget()
if da and at~=nil then
local sel=0
Duel.Hint(HINT_SELECTMSG,tp,31)
if ag:IsExists(aux.TRUE,1,at) then
sel=Duel.SelectOption(tp,1213,1214)
else
sel=Duel.SelectOption(tp,1213)
end
if sel==0 then
Duel.ChangeAttackTarget(nil)
return
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTACKTARGET)
local g=ag:Select(tp,1,1,at)
local tc=g:GetFirst()
if tc then
Duel.ChangeAttackTarget(tc)
end
end