forked from Fluorohydride/ygopro-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
c1003028.lua
34 lines (34 loc) · 1.06 KB
/
c1003028.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
--トラブル・ダイバー
function c1003028.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,1003028)
e1:SetCondition(c1003028.spcon)
c:RegisterEffect(e1)
--xyzlimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetValue(c1003028.xyzlimit)
c:RegisterEffect(e2)
end
function c1003028.cfilter(c)
return c:IsFaceup() and not c:IsLevel(4)
end
function c1003028.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0
and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
and not Duel.IsExistingMatchingCard(c1003028.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c1003028.xyzlimit(e,c)
if not c then return false end
return not c:IsRace(RACE_WARRIOR)
end