-
Notifications
You must be signed in to change notification settings - Fork 132
/
c10312660.lua
63 lines (63 loc) · 2.1 KB
/
c10312660.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
53
54
55
56
57
58
59
60
61
62
63
--未界域の歓待
---@param c Card
function c10312660.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,10312660+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c10312660.target)
e1:SetOperation(c10312660.activate)
c:RegisterEffect(e1)
end
function c10312660.spfilter(c,e,tp)
return c:IsSetCard(0x11e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c10312660.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local dg=Duel.GetMatchingGroup(c10312660.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
return dg:GetClassCount(Card.GetCode)>=3 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c10312660.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c10312660.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or g:GetClassCount(Card.GetCode)<3 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,3,3)
if sg then
Duel.ConfirmCards(1-tp,sg)
local tc=sg:RandomSelect(1-tp,1):GetFirst()
Duel.ConfirmCards(tp,tc)
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
local fid=tc:GetFieldID()
tc:RegisterFlagEffect(10312660,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(c10312660.descon)
e1:SetOperation(c10312660.desop)
Duel.RegisterEffect(e1,tp)
end
Duel.ShuffleDeck(tp)
end
end
function c10312660.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(10312660)~=e:GetLabel() then
e:Reset()
return false
else
return true
end
end
function c10312660.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.Destroy(tc,REASON_EFFECT)
end