-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathc26495087.lua
40 lines (40 loc) · 1.39 KB
/
c26495087.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
--ヴァンパイア・レディ
function c26495087.initial_effect(c)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(26495087,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(c26495087.tgcon)
e1:SetTarget(c26495087.tgtg)
e1:SetOperation(c26495087.tgop)
c:RegisterEffect(e1)
end
function c26495087.tgcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c26495087.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 c26495087.tgfilter(c,ty)
return c:IsType(ty) and c:IsAbleToGrave()
end
function c26495087.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,c26495087.tgfilter,1-tp,LOCATION_DECK,0,1,1,nil,TYPE_MONSTER)
elseif e:GetLabel()==1 then g=Duel.SelectMatchingCard(1-tp,c26495087.tgfilter,1-tp,LOCATION_DECK,0,1,1,nil,TYPE_SPELL)
else g=Duel.SelectMatchingCard(1-tp,c26495087.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