Skip to content

Commit a9b6247

Browse files
authored
Update "Cup of Sealed Soul"
- Should list "Seal of Serket", "Temple of the Kings", and "Mystical Beast of Serket" - General indestructibility should be EFFECT_INDESTRUCTABLE_EFFECT - Script modernization and code clean-up
1 parent ae03337 commit a9b6247

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

unofficial/c511001306.lua

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
--封魂の聖杯
12
--Cup of Sealed Soul
23
local s,id=GetID()
34
function s.initial_effect(c)
@@ -6,12 +7,12 @@ function s.initial_effect(c)
67
e1:SetType(EFFECT_TYPE_ACTIVATE)
78
e1:SetCode(EVENT_FREE_CHAIN)
89
c:RegisterEffect(e1)
9-
--remain field
10+
--This card remains on the field
1011
local e2=Effect.CreateEffect(c)
1112
e2:SetType(EFFECT_TYPE_SINGLE)
1213
e2:SetCode(EFFECT_REMAIN_FIELD)
1314
c:RegisterEffect(e2)
14-
--sp summon
15+
--Once while on the field, Special Summon "Mystical Beast of Serket" ignoring Summoning conditions
1516
local e3=Effect.CreateEffect(c)
1617
e3:SetDescription(aux.Stringid(id,0))
1718
e3:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
@@ -22,38 +23,31 @@ function s.initial_effect(c)
2223
e3:SetTarget(s.sptg)
2324
e3:SetOperation(s.spop)
2425
c:RegisterEffect(e3)
25-
--indestructable
26+
--"Mystical Beast of Serket" cannot be destroyed by card effects while this card and "Seal of Serket" are on the field
2627
local e4=Effect.CreateEffect(c)
2728
e4:SetType(EFFECT_TYPE_FIELD)
28-
e4:SetCode(EFFECT_INDESTRUCTABLE)
29+
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
2930
e4:SetRange(LOCATION_SZONE)
3031
e4:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
31-
e4:SetCondition(s.incon)
32-
e4:SetTarget(s.infilter)
32+
e4:SetCondition(function(e) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,511001305),e:GetHandlerPlayer(),LOCATION_SZONE,0,1,nil) end)
33+
e4:SetTarget(function(e,c) return c:IsFaceup() and c:IsCode(89194033) end)
34+
e4:SetValue(1)
3335
c:RegisterEffect(e4)
3436
end
35-
function s.cfilter(c,code)
36-
return c:IsFaceup() and c:IsCode(code)
37-
end
37+
s.listed_names={511001305,CARD_TEMPLE_OF_THE_KINGS,89194033} --"Seal of Serket, Mystical Beast of Serket"
3838
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
39-
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_SZONE,0,1,nil,511001305)
40-
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_SZONE,0,1,nil,29762407)
39+
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,511001305),tp,LOCATION_SZONE,0,1,nil)
40+
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_TEMPLE_OF_THE_KINGS),tp,LOCATION_SZONE,0,1,nil)
4141
end
4242
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
4343
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
44-
and Duel.IsPlayerCanSpecialSummonMonster(tp,89194033,0,0x21,2500,2000,6,RACE_FAIRY,ATTRIBUTE_EARTH) end
44+
and Duel.IsPlayerCanSpecialSummonMonster(tp,89194033,0,TYPE_MONSTER|TYPE_EFFECT,2500,2000,6,RACE_FAIRY,ATTRIBUTE_EARTH) end
4545
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
4646
end
4747
function s.spop(e,tp,eg,ep,ev,re,r,rp)
4848
if not e:GetHandler():IsRelateToEffect(e) then return end
4949
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
50-
or not Duel.IsPlayerCanSpecialSummonMonster(tp,89194033,0,0x21,2500,2000,6,RACE_FAIRY,ATTRIBUTE_EARTH) then return end
50+
or not Duel.IsPlayerCanSpecialSummonMonster(tp,89194033,0,TYPE_MONSTER|TYPE_EFFECT,2500,2000,6,RACE_FAIRY,ATTRIBUTE_EARTH) then return end
5151
local token=Duel.CreateToken(tp,89194033)
5252
Duel.SpecialSummon(token,0,tp,tp,true,false,POS_FACEUP)
5353
end
54-
function s.incon(e)
55-
return Duel.IsExistingMatchingCard(s.cfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil,511001305)
56-
end
57-
function s.infilter(e,c)
58-
return c:GetCode()==89194033
59-
end

0 commit comments

Comments
 (0)