-
Notifications
You must be signed in to change notification settings - Fork 1
/
c37564024.lua
52 lines (50 loc) · 1.8 KB
/
c37564024.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
51
52
--元素精灵·啾啾
local m=37564024
local cm=_G["c"..m]
cm.Senya_name_with_elem=true
function cm.initial_effect(c)
--ss
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_SPSUMMON_PROC)
e4:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e4:SetRange(LOCATION_HAND)
e4:SetCondition(cm.hcon)
e4:SetValue(0x24)
c:RegisterEffect(e4)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(37564765,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(function(e)
return bit.band(e:GetHandler():GetSummonType(),0x24)~=0x24
end)
e1:SetCost(Senya.SelfReleaseCost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.ssfilter(c)
return c:IsFaceup() and Senya.check_set_elem(c)
end
function cm.hcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.ssfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function cm.filter(c,e,tp)
return Senya.check_set_elem(c) and c:GetLevel()==4 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(m) and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end