22-- World Legacy's Mind Meld
33local s ,id = GetID ()
44function s .initial_effect (c )
5- -- A monster effect activated by the opponent becomes "return 1 face-up monster your opponent controls to the hand"
5+ -- Make an opponent's monster effect become "return 1 face-up monster your opponent controls to the hand"
66 local e1 = Effect .CreateEffect (c )
77 e1 :SetDescription (aux .Stringid (id ,0 ))
8- e1 :SetCategory (CATEGORY_TOHAND )
98 e1 :SetType (EFFECT_TYPE_ACTIVATE )
109 e1 :SetCode (EVENT_CHAINING )
1110 e1 :SetCountLimit (1 ,id )
12- e1 :SetCondition (s . cecon )
13- e1 :SetTarget (s .cetg )
14- e1 :SetOperation (s .ceop )
11+ e1 :SetCondition (function ( e , tp , eg , ep , ev , re , r , rp ) return ep == 1 - tp and re : IsMonsterEffect () and Duel . IsExistingMatchingCard ( aux . FaceupFilter ( Card . IsSetCard , SET_KRAWLER ), tp , LOCATION_MZONE , 0 , 1 , nil ) end )
12+ e1 :SetTarget (s .chngtg )
13+ e1 :SetOperation (s .chngop )
1514 c :RegisterEffect (e1 )
16- -- Special Summon 1 "Krawler" monster from your hand, Deck, or GY to your zone a Link monster points to
15+ -- Special Summon 1 "Krawler" monster from your hand, Deck, or GY to your zone a Link Monster points to
1716 local e2 = Effect .CreateEffect (c )
18- e2 :SetDescription (aux .Stringid (id ,0 ))
17+ e2 :SetDescription (aux .Stringid (id ,1 ))
1918 e2 :SetCategory (CATEGORY_SPECIAL_SUMMON )
2019 e2 :SetType (EFFECT_TYPE_QUICK_O )
20+ e2 :SetProperty (EFFECT_FLAG_CARD_TARGET )
2121 e2 :SetCode (EVENT_FREE_CHAIN )
2222 e2 :SetRange (LOCATION_GRAVE )
23- e2 :SetProperty (EFFECT_FLAG_CARD_TARGET )
2423 e2 :SetCountLimit (1 ,id )
24+ e2 :SetHintTiming (0 ,TIMING_STANDBY_PHASE |TIMING_MAIN_END |TIMINGS_CHECK_MONSTER_E )
2525 e2 :SetCost (Cost .SelfBanish )
2626 e2 :SetTarget (s .sptg )
2727 e2 :SetOperation (s .spop )
2828 c :RegisterEffect (e2 )
2929end
3030s .listed_series = {SET_KRAWLER }
31- function s .repop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
32- Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_RTOHAND )
33- local sg = Duel .SelectMatchingCard (tp ,s .thfilter ,tp ,0 ,LOCATION_MZONE ,1 ,1 ,nil )
34- if # sg > 0 then
35- Duel .SendtoHand (sg ,nil ,REASON_EFFECT )
36- end
37- end
38- function s .cecon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
39- return ep == 1 - tp and re :IsMonsterEffect () and Duel .IsExistingMatchingCard (aux .FaceupFilter (Card .IsSetCard ,SET_KRAWLER ),tp ,LOCATION_MZONE ,0 ,1 ,nil )
40- end
41- function s .thfilter (c )
42- return c :IsFaceup () and c :IsAbleToHand ()
31+ function s .chngtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
32+ if chk == 0 then return Duel .IsExistingMatchingCard (aux .FaceupFilter (Card .IsAbleToHand ),rp ,0 ,LOCATION_MZONE ,1 ,nil ) end
4333end
44- function s .cetg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
45- if chk == 0 then return Duel .IsExistingMatchingCard (s .thfilter ,rp ,0 ,LOCATION_MZONE ,1 ,nil ) end
46- end
47- function s .ceop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
34+ function s .chngop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
4835 local g = Group .CreateGroup ()
4936 Duel .ChangeTargetCard (ev ,g )
5037 Duel .ChangeChainOperation (ev ,s .repop )
5138end
52- function s .cfilter (c ,e ,tp )
39+ function s .repop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
40+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_RTOHAND )
41+ local g = Duel .SelectMatchingCard (tp ,aux .FaceupFilter (Card .IsAbleToHand ),tp ,0 ,LOCATION_MZONE ,1 ,1 ,nil )
42+ if # g > 0 then
43+ Duel .HintSelection (g )
44+ Duel .SendtoHand (g ,nil ,REASON_EFFECT )
45+ end
46+ end
47+ function s .tgfilter (c ,e ,tp )
5348 local zone = c :GetLinkedZone (tp )&ZONES_MMZ
54- return c :IsFaceup () and c :IsLinkMonster () and zone > 0
55- and Duel .IsExistingMatchingCard (s .spfilter ,tp ,LOCATION_HAND |LOCATION_DECK |LOCATION_GRAVE ,0 ,1 ,c ,e ,tp ,zone )
49+ return c :IsLinkMonster () and c :IsFaceup () and zone > 0
50+ and Duel .IsExistingMatchingCard (s .spfilter ,tp ,LOCATION_HAND |LOCATION_DECK |LOCATION_GRAVE ,0 ,1 ,nil ,e ,tp ,zone )
5651end
5752function s .spfilter (c ,e ,tp ,zone )
5853 return c :IsSetCard (SET_KRAWLER ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ,POS_FACEDOWN_DEFENSE ,tp ,zone )
5954end
6055function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
61- if chkc then return chkc :IsLocation (LOCATION_MZONE ) and s .cfilter (chkc ,e ,tp ) end
62- if chk == 0 then return Duel .IsExistingTarget (s .cfilter ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,nil ,e ,tp ) end
56+ if chkc then return chkc :IsLocation (LOCATION_MZONE ) and s .tgfilter (chkc ,e ,tp ) end
57+ if chk == 0 then return Duel .IsExistingTarget (s .tgfilter ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,nil ,e ,tp ) end
6358 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TARGET )
64- Duel .SelectTarget (tp ,s .cfilter ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,1 ,nil ,e ,tp )
59+ Duel .SelectTarget (tp ,s .tgfilter ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,1 ,nil ,e ,tp )
6560 Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_HAND |LOCATION_DECK |LOCATION_GRAVE )
6661end
6762function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
68- local c = e :GetHandler ()
6963 local tc = Duel .GetFirstTarget ()
7064 if tc :IsRelateToEffect (e ) then
7165 local zone = tc :GetLinkedZone (tp )&ZONES_MMZ
7266 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
73- local sg = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (s .spfilter ),tp ,LOCATION_HAND |LOCATION_DECK |LOCATION_GRAVE ,0 ,1 ,1 ,c ,e ,tp ,zone )
74- if # sg > 0 then
75- Duel .SpecialSummon (sg ,0 ,tp ,tp ,false ,false ,POS_FACEDOWN_DEFENSE ,zone )
76- Duel .ConfirmCards (1 - tp ,sg )
67+ local g = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (s .spfilter ),tp ,LOCATION_HAND |LOCATION_DECK |LOCATION_GRAVE ,0 ,1 ,1 ,nil ,e ,tp ,zone )
68+ if # g > 0 and Duel .SpecialSummon (g ,0 ,tp ,tp ,false ,false ,POS_FACEDOWN_DEFENSE ,zone )> 0 then
69+ Duel .ConfirmCards (1 - tp ,g )
7770 end
7871 end
79- end
72+ end
0 commit comments