|
2 | 2 | --Darktellarknight Batlamyus |
3 | 3 | local s,id=GetID() |
4 | 4 | function s.initial_effect(c) |
5 | | - --Xyz Summon |
6 | | - Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,0x9c),4,2) |
7 | 5 | c:EnableReviveLimit() |
8 | | - --Attribute change |
| 6 | + --Xyz Summon procedure: 2 Level 4 "tellarknight" monsters |
| 7 | + Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_TELLARKNIGHT),4,2) |
| 8 | + --All face-up monsters on the field become DARK |
9 | 9 | local e1=Effect.CreateEffect(c) |
10 | 10 | e1:SetType(EFFECT_TYPE_FIELD) |
11 | 11 | e1:SetCode(EFFECT_CHANGE_ATTRIBUTE) |
12 | 12 | e1:SetRange(LOCATION_MZONE) |
13 | 13 | e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) |
14 | 14 | e1:SetValue(ATTRIBUTE_DARK) |
15 | 15 | c:RegisterEffect(e1) |
16 | | - --Special Summon from Extra Deck |
| 16 | + --Special Summon 1 LIGHT "tellarknight" Xyz Monster from your Extra Deck by using this face-up card you control as the Xyz Material |
17 | 17 | local e2=Effect.CreateEffect(c) |
18 | 18 | e2:SetDescription(aux.Stringid(id,0)) |
19 | 19 | e2:SetCategory(CATEGORY_SPECIAL_SUMMON) |
20 | 20 | e2:SetType(EFFECT_TYPE_IGNITION) |
21 | 21 | e2:SetRange(LOCATION_MZONE) |
22 | | - e2:SetCondition(s.spcon) |
23 | | - e2:SetCost(aux.AND(aux.dxmcostgen(1,1,nil),s.spdiscost)) |
| 22 | + e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_CHAIN) |
| 23 | + e2:SetCondition(aux.NOT(s.quickcon)) |
| 24 | + e2:SetCost(Cost.AND(Cost.Detach(1),Cost.Discard())) |
24 | 25 | e2:SetTarget(s.sptg) |
25 | 26 | e2:SetOperation(s.spop) |
26 | 27 | c:RegisterEffect(e2,false,REGISTER_FLAG_DETACH_XMAT) |
27 | 28 | local e3=e2:Clone() |
28 | 29 | e3:SetType(EFFECT_TYPE_QUICK_O) |
29 | 30 | e3:SetCode(EVENT_FREE_CHAIN) |
30 | | - e3:SetCondition(aux.NOT(s.spcon)) |
| 31 | + e3:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) |
| 32 | + e3:SetCondition(s.quickcon) |
31 | 33 | c:RegisterEffect(e3) |
32 | 34 | end |
33 | | -s.listed_series={0x9c} |
34 | | -function s.cfilter(c) |
35 | | - return c:IsSetCard(0x9c) and c:IsMonster() |
| 35 | +s.listed_series={SET_TELLARKNIGHT} |
| 36 | +function s.quickconfilter(c) |
| 37 | + return c:IsSetCard(SET_TELLARKNIGHT) and c:IsMonster() |
36 | 38 | end |
37 | | -function s.spcon(e,tp,eg,ep,ev,re,r,rp) |
38 | | - local ct=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_GRAVE,0,nil) |
39 | | - return ct:GetClassCount(Card.GetCode)<7 |
| 39 | +function s.quickcon(e,tp,eg,ep,ev,re,r,rp) |
| 40 | + return Duel.GetMatchingGroup(s.quickconfilter,tp,LOCATION_GRAVE,0,nil):GetClassCount(Card.GetCode)>=7 |
40 | 41 | end |
41 | | -function s.spdiscost(e,tp,eg,ep,ev,re,r,rp,chk) |
42 | | - local c=e:GetHandler() |
43 | | - if chk==0 then |
44 | | - return c:GetFlagEffect(id)==0 and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) |
45 | | - end |
46 | | - c:RegisterFlagEffect(id,RESET_CHAIN,0,1) |
47 | | - Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) |
48 | | -end |
49 | | -function s.spfilter(c,e,tp,mc,pg) |
50 | | - return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsSetCard(0x9c) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 |
| 42 | +function s.spfilter(c,e,tp,mc) |
| 43 | + return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsSetCard(SET_TELLARKNIGHT) and c:IsType(TYPE_XYZ) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 |
51 | 44 | and mc:IsCanBeXyzMaterial(c,tp) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) |
52 | 45 | end |
53 | 46 | function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) |
54 | 47 | if chk==0 then |
55 | 48 | local c=e:GetHandler() |
56 | 49 | local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ) |
57 | | - return (#pg<=0 or (#pg==1 and pg:IsContains(c))) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,pg) |
| 50 | + return (#pg<=0 or (#pg==1 and pg:IsContains(c))) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) |
58 | 51 | end |
59 | 52 | Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) |
60 | 53 | end |
61 | 54 | function s.spop(e,tp,eg,ep,ev,re,r,rp) |
62 | 55 | local c=e:GetHandler() |
63 | 56 | local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ) |
64 | | - if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e) or #pg>1 or (#pg==1 and not pg:IsContains(tc)) then |
| 57 | + if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e) and (#pg<=0 or (#pg==1 and pg:IsContains(c))) then |
65 | 58 | Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) |
66 | | - local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c,pg) |
67 | | - local sc=g:GetFirst() |
68 | | - if sc then |
69 | | - sc:SetMaterial(c) |
70 | | - Duel.Overlay(sc,c) |
71 | | - Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP) |
72 | | - sc:CompleteProcedure() |
| 59 | + local xyzc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c):GetFirst() |
| 60 | + if xyzc then |
| 61 | + xyzc:SetMaterial(c) |
| 62 | + Duel.Overlay(xyzc,c) |
| 63 | + if Duel.SpecialSummon(xyzc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)>0 then |
| 64 | + xyzc:CompleteProcedure() |
| 65 | + end |
73 | 66 | end |
74 | 67 | end |
| 68 | + --You cannot Xyz Summon other monsters for the rest of this turn |
75 | 69 | local e1=Effect.CreateEffect(c) |
| 70 | + e1:SetDescription(aux.Stringid(id,1)) |
76 | 71 | e1:SetType(EFFECT_TYPE_FIELD) |
77 | | - e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) |
78 | 72 | e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) |
79 | | - e1:SetDescription(aux.Stringid(id,1)) |
| 73 | + e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) |
80 | 74 | e1:SetTargetRange(1,0) |
81 | | - e1:SetTarget(s.splimit) |
82 | | - e1:SetReset(RESET_PHASE+PHASE_END) |
| 75 | + e1:SetTarget(function(e,c,sump,sumtype) return (sumtype&SUMMON_TYPE_XYZ)==SUMMON_TYPE_XYZ end) |
| 76 | + e1:SetReset(RESET_PHASE|PHASE_END) |
83 | 77 | Duel.RegisterEffect(e1,tp) |
84 | 78 | end |
85 | | -function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) |
86 | | - return (sumtype&SUMMON_TYPE_XYZ)==SUMMON_TYPE_XYZ |
87 | | -end |
0 commit comments