-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc40607210.lua
More file actions
73 lines (73 loc) · 2.61 KB
/
c40607210.lua
File metadata and controls
73 lines (73 loc) · 2.61 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
--ヴァンパイア・グレイス
function c40607210.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(40607210,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_GRAVE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,40607210)
e1:SetCondition(c40607210.condition)
e1:SetCost(c40607210.cost)
e1:SetTarget(c40607210.target)
e1:SetOperation(c40607210.operation)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(40607210,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c40607210.tgtg)
e2:SetOperation(c40607210.tgop)
c:RegisterEffect(e2)
end
function c40607210.cfilter(c,tp)
return c:IsLevelAbove(5) and c:IsRace(RACE_ZOMBIE) and c:IsControler(tp)
end
function c40607210.condition(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return rc and rc:IsRace(RACE_ZOMBIE) and eg:IsExists(c40607210.cfilter,1,nil,tp)
and (re:GetCode()~=EFFECT_SPSUMMON_PROC or not rc:IsHasEffect(EFFECT_REVIVE_LIMIT))
end
function c40607210.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000) end
Duel.PayLPCost(tp,2000)
end
function c40607210.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c40607210.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c40607210.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,555)
local op=Duel.SelectOption(tp,70,71,72)
e:SetLabel(op)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_DECK)
end
function c40607210.tgfilter(c,ty)
return c:IsType(ty) and c:IsAbleToGrave()
end
function c40607210.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=nil
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
if e:GetLabel()==0 then g=Duel.SelectMatchingCard(1-tp,c40607210.tgfilter,1-tp,LOCATION_DECK,0,1,1,nil,TYPE_MONSTER)
elseif e:GetLabel()==1 then g=Duel.SelectMatchingCard(1-tp,c40607210.tgfilter,1-tp,LOCATION_DECK,0,1,1,nil,TYPE_SPELL)
else g=Duel.SelectMatchingCard(1-tp,c40607210.tgfilter,1-tp,LOCATION_DECK,0,1,1,nil,TYPE_TRAP) end
if g:GetCount()~=0 then
Duel.SendtoGrave(g,REASON_EFFECT)
else
local cg=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
Duel.ConfirmCards(tp,cg)
Duel.ShuffleDeck(1-tp)
end
end