-
Notifications
You must be signed in to change notification settings - Fork 3
/
c100000027.lua
42 lines (42 loc) · 1.47 KB
/
c100000027.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
--中生代化石騎士 スカルナイト
function c100000027.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,c100000027.ffilter1,c100000027.ffilter2,1,true,true)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.FALSE)
c:RegisterEffect(e1)
--chain attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCountLimit(1)
e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetCondition(c100000027.atcon)
e2:SetOperation(c100000027.atop)
c:RegisterEffect(e2)
end
function c100000027.ffilter1(c)
return c:IsRace(RACE_ROCK) and c:GetOwner()==Duel.GetTurnPlayer()
end
function c100000027.ffilter2(c)
return (c:GetLevel()==5 or c:GetLevel()==6) and c:GetOwner()~=Duel.GetTurnPlayer() and not c:IsType(TYPE_XYZ)
end
function c100000027.atcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttacker() and e:GetHandler():IsChainAttackable()
and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)~=0
end
function c100000027.atop(e,tp,eg,ep,ev,re,r,rp)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EXTRA_ATTACK)
e3:SetCondition(c100000023.spcon)
e3:SetValue(1)
e:GetHandler():RegisterEffect(e3)
end
function c100000027.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(e:GetOwnerPlayer(),0,LOCATION_MZONE)>0
end