Skip to content

Commit 3dbb8d4

Browse files
authored
Update "Sealed Gate"
-Should permit Special Summon from hand and Deck -Updated ID for "White Knight Lord"
1 parent 749f7ad commit 3dbb8d4

1 file changed

Lines changed: 15 additions & 17 deletions

File tree

unofficial/c511000597.lua

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1+
--封印の扉
12
--Sealed Gate
23
local s,id=GetID()
34
function s.initial_effect(c)
4-
--special summon
5+
--When this card is destroyed and sent to the Graveyard, you can remove from play 1 "White Knight Swordsman", "White Knight Lancer", and "White Knight Gardna" from your Graveyard to Special Summon 1 "White Knight Lord" from your hand or Deck.
56
local e1=Effect.CreateEffect(c)
67
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
78
e1:SetDescription(aux.Stringid(id,0))
89
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
910
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
1011
e1:SetCode(EVENT_TO_GRAVE)
11-
e1:SetCondition(s.spcon)
12+
e1:SetCondition(function(e) return e:GetHandler():IsReason(REASON_DESTROY) end)
1213
e1:SetCost(s.spcost)
1314
e1:SetTarget(s.sptg)
1415
e1:SetOperation(s.spop)
1516
c:RegisterEffect(e1)
1617
end
17-
s.listed_names={511000595}
18+
s.listed_names={511000593,511000594,511000596,14732294} --"White Knight Gardna", "White Knight Lancer", "White Knight Swordsman", "White Knight Lord"
1819
function s.rescon(sg,e,tp,mg)
19-
return aux.ChkfMMZ(1)(sg,e,tp,mg) and sg:IsExists(s.chk,1,nil,Group.CreateGroup(),sg,511000596,511000594,511000593)
20+
return aux.ChkfMMZ(1)(sg,e,tp,mg) and sg:IsExists(s.chk,1,nil,Group.CreateGroup(),sg,511000593,511000594,511000596)
2021
end
2122
function s.chk(c,g,sg,code,...)
2223
if not c:IsCode(code) then return false end
@@ -28,13 +29,13 @@ function s.chk(c,g,sg,code,...)
2829
end
2930
return res
3031
end
31-
function s.cfilter(c,...)
32+
function s.spcostfilter(c,...)
3233
return c:IsCode(...) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true)
3334
end
3435
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
35-
local rg1=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil,511000596)
36-
local rg2=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil,511000594)
37-
local rg3=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil,511000593)
36+
local rg1=Duel.GetMatchingGroup(s.spcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil,511000593)
37+
local rg2=Duel.GetMatchingGroup(s.spcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil,511000594)
38+
local rg3=Duel.GetMatchingGroup(s.spcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil,511000596)
3839
local rg=rg1:Clone()
3940
rg:Merge(rg2)
4041
rg:Merge(rg3)
@@ -43,21 +44,18 @@ function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
4344
local g=aux.SelectUnselectGroup(rg,e,tp,3,3,s.rescon,1,tp,HINTMSG_REMOVE)
4445
Duel.Remove(g,POS_FACEUP,REASON_COST)
4546
end
46-
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
47-
return e:GetHandler():IsReason(REASON_DESTROY)
48-
end
49-
function s.filter(c,e,tp)
50-
return c:IsCode(511000595) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
47+
function s.spfilter(c,e,tp)
48+
return c:IsCode(14732294) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
5149
end
5250
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
53-
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
54-
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
51+
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp) end
52+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK)
5553
end
5654
function s.spop(e,tp,eg,ep,ev,re,r,rp)
5755
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
58-
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
56+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp)
5957
if #g>0 then
6058
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
6159
Duel.ShuffleDeck(tp)
6260
end
63-
end
61+
end

0 commit comments

Comments
 (0)