11-- 星鍵士リイヴ
2- -- Lib the World Keymaster
2+ -- Lib the World Key Blademaster
33-- Scripted by AlphaKretin
44local s ,id = GetID ()
55function s .initial_effect (c )
66 -- Must be properly summoned before reviving
77 c :EnableReviveLimit ()
8+ -- Link Summon procedure: 2 monsters
89 Link .AddProcedure (c ,nil ,2 ,2 )
9- -- splimit
10+ -- Can only be Link Summoned while you have a "World Legacy" card in your GY
1011 local e1 = Effect .CreateEffect (c )
1112 e1 :SetType (EFFECT_TYPE_SINGLE )
1213 e1 :SetCode (EFFECT_SPSUMMON_COST )
1314 e1 :SetCost (s .spcost )
1415 c :RegisterEffect (e1 )
15- -- set
16+ -- Set 1 "World Legacy" Spell/Trap directly from your Deck
1617 local e2 = Effect .CreateEffect (c )
1718 e2 :SetDescription (aux .Stringid (id ,0 ))
1819 e2 :SetCategory (CATEGORY_TODECK )
@@ -22,7 +23,7 @@ function s.initial_effect(c)
2223 e2 :SetTarget (s .settg )
2324 e2 :SetOperation (s .setop )
2425 c :RegisterEffect (e2 )
25- -- to deck
26+ -- Shuffle 1 card on the field into the Deck
2627 local e3 = Effect .CreateEffect (c )
2728 e3 :SetDescription (aux .Stringid (id ,1 ))
2829 e3 :SetCategory (CATEGORY_TODECK )
@@ -35,13 +36,13 @@ function s.initial_effect(c)
3536 e3 :SetOperation (s .tdop )
3637 c :RegisterEffect (e3 )
3738end
38- s .listed_series = {0xfe }
39+ s .listed_series = {SET_WORLD_LEGACY }
3940function s .spcost (e ,c ,tp ,st )
4041 if (st &SUMMON_TYPE_LINK )~= SUMMON_TYPE_LINK then return true end
41- return Duel .IsExistingMatchingCard (Card .IsSetCard ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,0xfe )
42+ return Duel .IsExistingMatchingCard (Card .IsSetCard ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,SET_WORLD_LEGACY )
4243end
4344function s .setfilter (c )
44- return c :IsSetCard (0xfe ) and c :IsType ( TYPE_TRAP + TYPE_SPELL ) and c :IsSSetable ()
45+ return c :IsSetCard (SET_WORLD_LEGACY ) and c :IsSpellTrap ( ) and c :IsSSetable ()
4546end
4647function s .settg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
4748 if chk == 0 then return Duel .IsExistingMatchingCard (s .setfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil )
@@ -53,32 +54,34 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
5354 local tc = Duel .SelectMatchingCard (tp ,s .setfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil ):GetFirst ()
5455 if tc then
5556 Duel .SSet (tp ,tc )
57+ -- Cannot be activated this turn while you have no "World Legacy" monster in your GY
5658 local e1 = Effect .CreateEffect (e :GetHandler ())
5759 e1 :SetType (EFFECT_TYPE_SINGLE )
5860 e1 :SetCode (EFFECT_CANNOT_TRIGGER )
59- e1 :SetReset (RESET_EVENT + RESETS_STANDARD_EXC_GRAVE + RESET_PHASE + PHASE_END )
60- e1 :SetCondition (s .ctcon )
61+ e1 :SetReset (RESETS_STANDARD_PHASE_END )
62+ e1 :SetCondition (function ( e ) return tc : IsFacedown () and s .ctcon ( e ) end )
6163 tc :RegisterEffect (e1 )
6264 end
6365end
6466function s .cfilter (c )
65- return c :IsSetCard (0xfe ) and c :IsMonster ()
67+ return c :IsSetCard (SET_WORLD_LEGACY ) and c :IsMonster ()
6668end
67- function s .ctcon (e , tp , eg , ep , ev , re , r , rp )
69+ function s .ctcon (e )
6870 return not Duel .IsExistingMatchingCard (s .cfilter ,e :GetHandlerPlayer (),LOCATION_GRAVE ,0 ,1 ,nil )
6971end
7072function s .tdcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
7173 local c = e :GetHandler ()
7274 return c :IsLocation (LOCATION_GRAVE ) and r == REASON_LINK and c :IsSummonType (SUMMON_TYPE_LINK )
7375end
7476function s .tdtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
75- if chk == 0 then return Duel .IsExistingMatchingCard (Card .IsAbleToDeck ,tp ,LOCATION_ONFIELD ,LOCATION_ONFIELD ,1 ,nil ) end
77+ local g = Duel .GetMatchingGroup (Card .IsAbleToDeck ,tp ,LOCATION_ONFIELD ,LOCATION_ONFIELD ,nil )
78+ if chk == 0 then return # g > 0 end
79+ Duel .SetOperationInfo (0 ,CATEGORY_TODECK ,g ,1 ,tp ,0 )
7680end
7781function s .tdop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
7882 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TODECK )
7983 local g = Duel .SelectMatchingCard (tp ,Card .IsAbleToDeck ,tp ,LOCATION_ONFIELD ,LOCATION_ONFIELD ,1 ,1 ,nil )
8084 if # g > 0 then
8185 Duel .SendtoDeck (g ,nil ,SEQ_DECKSHUFFLE ,REASON_EFFECT )
8286 end
83- end
84-
87+ end
0 commit comments