-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc52352005.lua
More file actions
47 lines (47 loc) · 1.62 KB
/
c52352005.lua
File metadata and controls
47 lines (47 loc) · 1.62 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
--XX-セイバー ガトムズ
function c52352005.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_EARTH),1)
c:EnableReviveLimit()
--handes
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(52352005,0))
e1:SetCategory(CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c52352005.cost)
e1:SetTarget(c52352005.target)
e1:SetOperation(c52352005.operation)
c:RegisterEffect(e1)
--double tuner check
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(c52352005.valcheck)
c:RegisterEffect(e2)
end
function c52352005.valcheck(e,c)
local g=c:GetMaterial()
if g:IsExists(Card.IsType,2,nil,TYPE_TUNER) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(21142671)
e1:SetReset(RESET_EVENT+0xfe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c52352005.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,nil,0x100d) end
local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,nil,0x100d)
Duel.Release(g,REASON_COST)
end
function c52352005.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,1)
end
function c52352005.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(1-tp,LOCATION_HAND,0,nil)
local sg=g:RandomSelect(1-tp,1)
Duel.SendtoGrave(sg,REASON_DISCARD+REASON_EFFECT)
end