forked from ProjectIgnis/CardScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
proc_gemini.lua
35 lines (31 loc) · 999 Bytes
/
proc_gemini.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
Gemini={}
Card.IsGeminiStatus=Card.IsGeminiState
Card.EnableGeminiStatus=Card.EnableGeminiState
function Gemini.AddProcedure(c)
--Can be Normal Summoned again
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_GEMINI_SUMMONABLE)
c:RegisterEffect(e1)
--Becomes Normal Type if not yet summoned twice
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetRange(LOCATION_MZONE|LOCATION_GRAVE)
e2:SetCondition(Gemini.NormalStatusCondition)
e2:SetValue(TYPE_NORMAL)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_REMOVE_TYPE)
e3:SetValue(TYPE_EFFECT)
c:RegisterEffect(e3)
end
function Gemini.EffectStatusCondition(effect)
local c=effect:GetHandler()
return not c:IsDisabled() and c:IsGeminiStatus()
end
function Gemini.NormalStatusCondition(effect)
local c=effect:GetHandler()
return c:IsFaceup() and not c:IsGeminiStatus()
end