forked from Fluorohydride/ygopro-scripts
-
Notifications
You must be signed in to change notification settings - Fork 6
/
c10071151.lua
71 lines (71 loc) · 2.53 KB
/
c10071151.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
--トワイライトロード・ソーサラー ライラ
---@param c Card
function c10071151.initial_effect(c)
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10071151,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c10071151.descon)
e1:SetCost(c10071151.descost)
e1:SetTarget(c10071151.destg)
e1:SetOperation(c10071151.desop)
c:RegisterEffect(e1)
--mill
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(10071151,1))
e3:SetCategory(CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c10071151.ddcon)
e3:SetTarget(c10071151.ddtg)
e3:SetOperation(c10071151.ddop)
c:RegisterEffect(e3)
end
function c10071151.descon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function c10071151.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x38) and c:IsAbleToRemoveAsCost()
end
function c10071151.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10071151.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c10071151.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c10071151.desfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c10071151.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c10071151.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c10071151.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c10071151.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c10071151.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c10071151.ddcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and rc~=c
and rc:IsSetCard(0x38) and rc:IsControler(tp)
end
function c10071151.ddtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
end
function c10071151.ddop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(tp,3,REASON_EFFECT)
end