-
-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathc160013044.lua
50 lines (50 loc) · 1.88 KB
/
c160013044.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
--サイバー・タクティカル・ドラゴン
--Cyber Tactical Dragon
--scripted by YoshiDuels
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Fusion Summon procedure
Fusion.AddProcMix(c,true,true,160205022,CARD_CYBER_DRAGON)
--Destroy up to 2 monsters the opponent control with total ATK equal or less than this card's
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(s.descost)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
end
function s.cfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToDeckOrExtraAsCost()
end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,2,nil) end
end
function s.rescon(sg,e,tp,mg)
return sg:GetSum(Card.GetAttack)<=e:GetHandler():GetAttack()
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsNotMaximumModeSide),tp,0,LOCATION_MZONE,nil)
if chk==0 then return #g>0 and aux.SelectUnselectGroup(g,e,tp,1,2,s.rescon,0) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,LOCATION_MZONE)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
--Requirement
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.HintSelection(g,true)
if Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)==0 then return end
--Effect
local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsNotMaximumModeSide),tp,0,LOCATION_MZONE,nil)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=aux.SelectUnselectGroup(g,e,tp,1,2,s.rescon,1,tp,HINTMSG_DESTROY)
Duel.HintSelection(sg,true)
sg=sg:AddMaximumCheck()
Duel.Destroy(sg,REASON_EFFECT)
end
end