1+ -- The Fallen & The Virtuous
2+ -- The Fallen & The Virtuous
3+ -- scripted by pyrQ
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Activate 1 of these effects
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
10+ e1 :SetProperty (EFFECT_FLAG_CARD_TARGET )
11+ e1 :SetCode (EVENT_FREE_CHAIN )
12+ e1 :SetCountLimit (1 ,id ,EFFECT_COUNT_CODE_OATH )
13+ e1 :SetCost (s .effcost )
14+ e1 :SetTarget (s .efftg )
15+ e1 :SetOperation (s .effop )
16+ e1 :SetHintTiming (TIMING_END_PHASE ,TIMING_STANDBY_PHASE |TIMING_MAIN_END |TIMINGS_CHECK_MONSTER_E )
17+ c :RegisterEffect (e1 )
18+ end
19+ s .listed_names = {CARD_ALBAZ }
20+ s .listed_series = {SET_BRANDED ,SET_DOGMATIKA ,SET_ECCLESIA }
21+ function s .descostfilter (c )
22+ return c :ListsCode (CARD_ALBAZ ) and c :IsAbleToGraveAsCost ()
23+ end
24+ function s .spconfilter (c )
25+ return c :IsSetCard (SET_ECCLESIA ) and c :IsMonster () and c :IsFaceup ()
26+ end
27+ function s .effcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
28+ -- Send 1 monster that mentions "Fallen of Albaz" from your Extra Deck to the GY, then target 1 face-up card on the field; destroy it
29+ local b1 = Duel .IsExistingMatchingCard (s .descostfilter ,tp ,LOCATION_EXTRA ,0 ,1 ,nil )
30+ and Duel .IsExistingTarget (Card .IsFaceup ,tp ,LOCATION_ONFIELD ,LOCATION_ONFIELD ,1 ,e :GetHandler ())
31+ -- If you have an "Ecclesia" monster in your field or GY: Target 1 monster in either GY; Special Summon it to your field
32+ local b2 = Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
33+ and Duel .IsExistingMatchingCard (s .spconfilter ,tp ,LOCATION_MZONE |LOCATION_GRAVE ,0 ,1 ,nil )
34+ and Duel .IsExistingTarget (Card .IsCanBeSpecialSummoned ,tp ,LOCATION_GRAVE ,LOCATION_GRAVE ,1 ,nil ,e ,0 ,tp ,false ,false )
35+ if chk == 0 then return b1 or b2 end
36+ local op = Duel .SelectEffect (tp ,
37+ {b1 ,aux .Stringid (id ,1 )},
38+ {b2 ,aux .Stringid (id ,2 )})
39+ e :SetLabel (op )
40+ if op == 1 then
41+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TOGRAVE )
42+ local g = Duel .SelectMatchingCard (tp ,s .descostfilter ,tp ,LOCATION_EXTRA ,0 ,1 ,1 ,nil )
43+ Duel .SendtoGrave (g ,REASON_COST )
44+ end
45+ end
46+ function s .efftg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
47+ local c = e :GetHandler ()
48+ if chkc then
49+ local op = Duel .GetChainInfo (0 ,CHAININFO_TARGET_PARAM )
50+ if op == 1 then
51+ return chkc :IsOnField () and chkc :IsFaceup () and chkc ~= c
52+ elseif op == 2 then
53+ return chkc :IsLocation (LOCATION_GRAVE ) and chkc :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
54+ end
55+ end
56+ -- Send 1 monster that mentions "Fallen of Albaz" from your Extra Deck to the GY, then target 1 face-up card on the field; destroy it
57+ local b1 = Duel .IsExistingMatchingCard (s .descostfilter ,tp ,LOCATION_EXTRA ,0 ,1 ,nil )
58+ and Duel .IsExistingTarget (Card .IsFaceup ,tp ,LOCATION_ONFIELD ,LOCATION_ONFIELD ,1 ,e :GetHandler ())
59+ -- If you have an "Ecclesia" monster in your field or GY: Target 1 monster in either GY; Special Summon it to your field
60+ local b2 = Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
61+ and Duel .IsExistingMatchingCard (s .spconfilter ,tp ,LOCATION_MZONE |LOCATION_GRAVE ,0 ,1 ,nil )
62+ and Duel .IsExistingTarget (Card .IsCanBeSpecialSummoned ,tp ,LOCATION_GRAVE ,LOCATION_GRAVE ,1 ,nil ,e ,0 ,tp ,false ,false )
63+ if chk == 0 then return b1 or b2 end
64+ local op = nil
65+ local label = e :GetLabel ()
66+ if label ~= 0 then
67+ op = label
68+ else
69+ op = Duel .SelectEffect (tp ,
70+ {b1 ,aux .Stringid (id ,1 )},
71+ {b2 ,aux .Stringid (id ,2 )})
72+ end
73+ e :SetLabel (0 )
74+ Duel .SetTargetParam (op )
75+ if op == 1 then
76+ e :SetCategory (CATEGORY_DESTROY )
77+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_DESTROY )
78+ local g = Duel .SelectTarget (tp ,Card .IsFaceup ,tp ,LOCATION_ONFIELD ,LOCATION_ONFIELD ,1 ,1 ,c )
79+ Duel .SetOperationInfo (0 ,CATEGORY_DESTROY ,g ,1 ,tp ,0 )
80+ elseif op == 2 then
81+ e :SetCategory (CATEGORY_SPECIAL_SUMMON )
82+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
83+ local g = Duel .SelectTarget (tp ,Card .IsCanBeSpecialSummoned ,tp ,LOCATION_GRAVE ,LOCATION_GRAVE ,1 ,1 ,nil ,e ,0 ,tp ,false ,false )
84+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,g ,1 ,tp ,0 )
85+ end
86+ end
87+ function s .effop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
88+ local tc = Duel .GetFirstTarget ()
89+ if not tc :IsRelateToEffect (e ) then return end
90+ local op = Duel .GetChainInfo (0 ,CHAININFO_TARGET_PARAM )
91+ if op == 1 then
92+ -- Send 1 monster that mentions "Fallen of Albaz" from your Extra Deck to the GY, then target 1 face-up card on the field; destroy it
93+ Duel .Destroy (tc ,REASON_EFFECT )
94+ elseif op == 2 then
95+ -- If you have an "Ecclesia" monster in your field or GY: Target 1 monster in either GY; Special Summon it to your field
96+ Duel .SpecialSummon (tc ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
97+ end
98+ end
0 commit comments