-
Notifications
You must be signed in to change notification settings - Fork 3
/
c100000044.lua
85 lines (85 loc) · 2.71 KB
/
c100000044.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
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
84
85
--スキエルC5
function c100000044.initial_effect(c)
c:EnableReviveLimit()
--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(c100000044.spcon)
e1:SetOperation(c100000044.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(c100000044.sdcon2)
c:RegisterEffect(e2)
--battle target
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100000044,1))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BE_BATTLE_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c100000044.cbcon)
e3:SetOperation(c100000044.cbop)
c:RegisterEffect(e3)
--damage
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DAMAGE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_BATTLE_DESTROYED)
e4:SetCondition(c100000044.descon)
e4:SetTarget(c100000044.tg)
e4:SetOperation(c100000044.op)
c:RegisterEffect(e4)
end
function c100000044.spfilter(c,code)
return c:GetCode()==code
end
function c100000044.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,c100000044.spfilter,1,nil,100000046)
end
function c100000044.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g1=Duel.SelectReleaseGroup(tp,c100000044.spfilter,1,1,nil,100000046)
Duel.Release(g1,REASON_COST)
end
function c100000044.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3013)
end
function c100000044.sdcon2(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c100000044.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler())
end
function c100000044.cbcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bt=eg:GetFirst()
return bt:GetControler()==c:GetControler()
end
function c100000044.cbop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateAttack()
end
function c100000044.cfil(c,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and c:GetPreviousControler()==tp
end
function c100000044.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100000044.cfil,1,nil,1-tp)
end
function c100000044.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(300)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,300)
end
function c100000044.op(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end