Skip to content

Commit 5cd9ca9

Browse files
authored
Various script fixes
- Crusadia Vanguard: Should be negatable by an effect such as that of "Ghost Belle & Haunted Mansion" if you activate it by Tributing a monster. - Cubic Rebirth: Should be treated as an effect that includes Special Summoning from the hand, Deck, and GY. - Goddess Verdande's Guidance: Its second effect should be negatable by an effect such as that of "Ash Blossom & Joyous Spring". - Luminous Dragon Ritual: Banishing and Special Summoning should be treated as happening at the same time. Should still banish even if there's no "Paladin of Photon Dragon" in your hand on resolution. - Rebirth of the Seventh Emperors: The damaging effect should be applied even if the target isn't there anymore on resolution. - Reincarnation of the Seventh Emperors: Should be treated as an effect that includes Special Summoning and inflict damage.
1 parent 528ce8f commit 5cd9ca9

File tree

9 files changed

+246
-259
lines changed

9 files changed

+246
-259
lines changed

official/c34834619.lua

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,47 @@
22
--Luminous Dragon Ritual
33
local s,id=GetID()
44
function s.initial_effect(c)
5+
--Ritual Summon 1 "Paladin of Photon Dragon" from your hand
56
Ritual.AddProcEqualCode(c,4,nil,85346853)
6-
--Special summon and treat it as a Ritual summon
7+
--Banish monsters from your GY whose total Levels equal exactly 4, then Special Summon 1 "Paladin of Photon Dragon" from your hand (this is treated as a Ritual Summon)
78
local e1=Effect.CreateEffect(c)
8-
e1:SetDescription(aux.Stringid(id,0))
9-
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
9+
e1:SetDescription(aux.Stringid(id,1))
10+
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
1011
e1:SetType(EFFECT_TYPE_IGNITION)
1112
e1:SetRange(LOCATION_GRAVE)
1213
e1:SetCost(Cost.SelfBanish)
1314
e1:SetTarget(s.sptg)
1415
e1:SetOperation(s.spop)
1516
c:RegisterEffect(e1)
1617
end
17-
s.listed_names={85346853}
18-
function s.mtfilter(c,e)
18+
s.listed_names={85346853} --"Paladin of Photon Dragon"
19+
function s.rmfilter(c,e,tp)
1920
return c:HasLevel() and c:IsAbleToRemove() and not c:IsImmuneToEffect(e) and aux.SpElimFilter(c,true)
2021
end
21-
function s.spfilter(c,e,tp,m)
22+
function s.rescon(sg,e,tp,mg)
23+
return Duel.GetMZoneCount(tp,sg)>0 and sg:GetSum(Card.GetLevel)==4
24+
end
25+
function s.spfilter(c,e,tp)
2226
return c:IsCode(85346853) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,false)
23-
and m:CheckWithSumEqual(Card.GetRitualLevel,4,1,99,c)
2427
end
2528
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
2629
if chk==0 then
27-
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
28-
local mg=Duel.GetMatchingGroup(s.mtfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,e:GetHandler(),e)
29-
return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp,mg)
30+
local rg=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil,e,tp)
31+
return #rg>0 and aux.SelectUnselectGroup(rg,e,tp,1,4,s.rescon,0)
32+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
3033
end
34+
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
3135
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
32-
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,tp,LOCATION_GRAVE)
3336
end
3437
function s.spop(e,tp,eg,ep,ev,re,r,rp)
35-
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
36-
local mg=Duel.GetMatchingGroup(s.mtfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil,e)
37-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
38-
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg)
39-
local tc=g:GetFirst()
40-
if tc then
41-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
42-
local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,4,1,99,tc)
43-
tc:SetMaterial(mat)
44-
Duel.ReleaseRitualMaterial(mat)
45-
Duel.BreakEffect()
46-
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,false,POS_FACEUP)
47-
tc:CompleteProcedure()
38+
local g=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil,e,tp)
39+
if #g==0 then return end
40+
local rg=aux.SelectUnselectGroup(g,e,tp,1,4,s.rescon,1,tp,HINTMSG_REMOVE)
41+
if #rg>0 and Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)>0 and rg:IsExists(Card.IsLocation,1,nil,LOCATION_REMOVED) then
42+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
43+
local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst()
44+
if sc and Duel.SpecialSummon(sc,SUMMON_TYPE_RITUAL,tp,tp,true,false,POS_FACEUP)>0 then
45+
sc:CompleteProcedure()
46+
end
4847
end
4948
end

official/c55312487.lua

Lines changed: 34 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,79 +2,62 @@
22
--Crusadia Vanguard
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--activate
5+
--When you activate this card: You can also Tribute 1 "Crusadia" or "World Legacy" monster; if you did, Special Summon 1 "Crusadia" or "World Legacy" monster, with a different original name, from your Deck or GY
66
local e1=Effect.CreateEffect(c)
7+
e1:SetDescription(aux.Stringid(id,0))
78
e1:SetType(EFFECT_TYPE_ACTIVATE)
89
e1:SetCode(EVENT_FREE_CHAIN)
9-
e1:SetHintTiming(0,TIMING_END_PHASE)
10+
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMING_BATTLE_START|TIMINGS_CHECK_MONSTER_E)
1011
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
12+
e1:SetCost(s.cost)
1113
e1:SetTarget(s.target)
14+
e1:SetOperation(s.activate)
1215
c:RegisterEffect(e1)
13-
--cannot select, except link thing
16+
--While you control a "Crusadia" Link Monster, your opponent's monsters can only target Link Monsters for attacks
1417
local e2=Effect.CreateEffect(c)
1518
e2:SetType(EFFECT_TYPE_FIELD)
19+
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
1620
e2:SetRange(LOCATION_SZONE)
1721
e2:SetTargetRange(0,LOCATION_MZONE)
18-
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
19-
e2:SetCondition(s.catcondition)
20-
e2:SetValue(s.catlimit)
22+
e2:SetCondition(function(e) return Duel.IsExistingMatchingCard(function(c) return c:IsSetCard(SET_CRUSADIA) and c:IsLinkMonster() end,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end)
23+
e2:SetValue(function(e,c) return not c:IsLinkMonster() end)
2124
c:RegisterEffect(e2)
2225
end
2326
s.listed_series={SET_CRUSADIA,SET_WORLD_LEGACY}
24-
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
27+
function s.spcostfilter(c,e,tp)
28+
return c:IsSetCard({SET_CRUSADIA,SET_WORLD_LEGACY}) and Duel.GetMZoneCount(tp,c)>0
29+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,nil,e,tp,c:GetOriginalCodeRule())
30+
end
31+
function s.spfilter(c,e,tp,code)
32+
return c:IsSetCard({SET_CRUSADIA,SET_WORLD_LEGACY}) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
33+
and not c:IsOriginalCodeRule(code)
34+
end
35+
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
2536
if chk==0 then return true end
26-
if s.spcost(e,tp,eg,ep,ev,re,r,rp,0) and s.sptarget(e,tp,eg,ep,ev,re,r,rp,0)
27-
and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
28-
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
29-
s.spcost(e,tp,eg,ep,ev,re,r,rp,1)
30-
s.sptarget(e,tp,eg,ep,ev,re,r,rp,1)
31-
e:SetOperation(s.spoperation)
37+
if Duel.CheckReleaseGroupCost(tp,s.spcostfilter,1,false,nil,nil,e,tp)
38+
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
39+
local sc=Duel.SelectReleaseGroupCost(tp,s.spcostfilter,1,1,false,nil,nil,e,tp):GetFirst()
40+
e:SetLabel(sc:GetOriginalCodeRule())
41+
Duel.Release(sc,REASON_COST)
3242
else
33-
e:SetCategory(0)
34-
e:SetOperation(nil)
43+
e:SetLabel(-1)
3544
end
3645
end
37-
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
38-
e:SetLabel(1)
46+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
3947
if chk==0 then return true end
40-
end
41-
function s.costfilter(c,e,tp)
42-
return c:IsMonster() and (c:IsSetCard(SET_CRUSADIA) or c:IsSetCard(SET_WORLD_LEGACY))
43-
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,nil,e,tp,c)
44-
end
45-
function s.spfilter(c,e,tp,tc)
46-
return c:IsMonster() and (c:IsSetCard(SET_CRUSADIA) or c:IsSetCard(SET_WORLD_LEGACY)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
47-
and not c:IsOriginalCode(tc:GetOriginalCode())
48-
end
49-
function s.sptarget(e,tp,eg,ep,ev,re,r,rp,chk)
50-
if chk==0 then
51-
if e:GetLabel()~=1 then return false end
52-
e:SetLabel(0)
53-
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
54-
and Duel.CheckReleaseGroupCost(tp,s.costfilter,1,false,nil,nil,e,tp)
48+
if e:GetLabel()>0 then
49+
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
50+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE)
51+
else
52+
e:SetCategory(0)
5553
end
56-
e:SetLabel(0)
57-
local g=Duel.SelectReleaseGroupCost(tp,s.costfilter,1,1,false,nil,nil,e,tp)
58-
Duel.Release(g,REASON_COST)
59-
Duel.SetTargetCard(g)
60-
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
6154
end
62-
function s.spoperation(e,tp,eg,ep,ev,re,r,rp)
63-
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
64-
local c=e:GetHandler()
65-
local tc=Duel.GetFirstTarget()
55+
function s.activate(e,tp,eg,ep,ev,re,r,rp)
56+
local label=e:GetLabel()
57+
if label==-1 or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
6658
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
67-
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil,e,tp,tc)
59+
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil,e,tp,label)
6860
if #g>0 then
6961
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
7062
end
71-
end
72-
function s.catfilter(c)
73-
return c:IsFaceup() and c:IsSetCard(SET_CRUSADIA) and c:IsLinkMonster()
74-
end
75-
function s.catcondition(e)
76-
return Duel.IsExistingMatchingCard(s.catfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
77-
end
78-
function s.catlimit(e,c)
79-
return not c:IsLinkMonster()
8063
end

official/c57499304.lua

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,59 +5,58 @@ local s,id=GetID()
55
function s.initial_effect(c)
66
--Activate
77
local e1=Effect.CreateEffect(c)
8-
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
910
e1:SetType(EFFECT_TYPE_ACTIVATE)
1011
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
1112
e1:SetCondition(s.condition)
1213
e1:SetTarget(s.target)
13-
e1:SetOperation(s.operation)
14+
e1:SetOperation(s.activate)
1415
c:RegisterEffect(e1)
1516
end
1617
s.listed_series={SET_NUMBER}
17-
function s.cfilter(c)
18+
function s.confilter(c)
1819
if not c:IsType(TYPE_XYZ) then return false end
1920
local no=c.xyz_number
2021
return (c:IsSetCard(SET_NUMBER) and no and no>=101 and no<=107)
21-
or c:GetOverlayGroup():IsExists(s.cfilter,1,nil)
22+
or c:GetOverlayGroup():IsExists(s.confilter,1,nil)
2223
end
2324
function s.condition(e,tp,eg,ep,ev,re,r,rp)
24-
local tc=Duel.GetBattleMonster(tp)
25-
return tc and s.cfilter(tc)
25+
local bc=Duel.GetBattleMonster(tp)
26+
return bc and s.confilter(bc)
2627
end
2728
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
28-
local tc=Duel.GetBattleMonster(tp)
29-
local g=tc:GetOverlayGroup()
30-
if chk==0 then return tc:IsAbleToRemove() and (#g==0 or #g==g:FilterCount(Card.IsAbleToRemove,nil)) end
31-
Duel.SetTargetCard(tc)
32-
g:AddCard(tc)
33-
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
29+
local bc=Duel.GetBattleMonster(tp)
30+
local g=bc:GetOverlayGroup()
31+
if chk==0 then return bc:IsAbleToRemove() and (#g==0 or #g==g:FilterCount(Card.IsAbleToRemove,nil)) end
32+
e:SetLabelObject(bc)
33+
bc:CreateEffectRelation(e)
34+
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g+bc,#g,tp,0)
3435
end
35-
function s.operation(e,tp,eg,ep,ev,re,r,rp)
36-
local tc=Duel.GetFirstTarget()
37-
if tc and tc:IsRelateToEffect(e) and tc:IsControler(tp) then
38-
local g=tc:GetOverlayGroup()
39-
g:AddCard(tc)
40-
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
36+
function s.activate(e,tp,eg,ep,ev,re,r,rp)
37+
local bc=e:GetLabelObject()
38+
if bc:IsRelateToEffect(e) and bc:IsControler(tp) then
39+
Duel.Remove(bc+bc:GetOverlayGroup(),POS_FACEUP,REASON_EFFECT)
4140
end
4241
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
43-
--Special Summon 1 Rank 3 or lower Xyz during the End Phase
42+
--During the End Phase of the turn you activated this card, Special Summon 1 Rank 3 or lower Xyz Monser from your Extra Deck, and if you do, inflict damage to your opponent equal to its original ATK
4443
local e1=Effect.CreateEffect(e:GetHandler())
4544
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
4645
e1:SetCode(EVENT_PHASE+PHASE_END)
4746
e1:SetCountLimit(1)
48-
e1:SetOperation(s.op)
47+
e1:SetOperation(s.spop)
4948
e1:SetReset(RESET_PHASE|PHASE_END)
5049
Duel.RegisterEffect(e1,tp)
5150
end
5251
function s.spfilter(c,e,tp)
53-
return c:IsRankBelow(3) and not c:IsSetCard(SET_NUMBER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
52+
return c:IsRankBelow(3) and c:IsType(TYPE_XYZ) and not c:IsSetCard(SET_NUMBER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
5453
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
5554
end
56-
function s.op(e,tp,eg,ep,ev,re,r,rp)
55+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
5756
Duel.Hint(HINT_CARD,0,id)
5857
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
59-
local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
60-
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
61-
Duel.Damage(1-tp,tc:GetBaseAttack(),REASON_EFFECT)
58+
local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
59+
if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)>0 then
60+
Duel.Damage(1-tp,sc:GetBaseAttack(),REASON_EFFECT)
6261
end
6362
end

0 commit comments

Comments
 (0)