|
1 | | ---RUM-七皇の剣 (Anime) |
| 1 | +--RUM-七皇の剣 (Anime) |
2 | 2 | --Rank-Up-Magic - The Seventh One (Anime) |
3 | 3 | Duel.LoadScript("c420.lua") |
4 | 4 | local s,id=GetID() |
5 | 5 | function s.initial_effect(c) |
6 | 6 | --Activate |
7 | 7 | local e1=Effect.CreateEffect(c) |
| 8 | + e1:SetDescription(aux.Stringid(id,0)) |
8 | 9 | e1:SetCategory(CATEGORY_SPECIAL_SUMMON) |
9 | 10 | e1:SetType(EFFECT_TYPE_ACTIVATE) |
10 | | - e1:SetCode(EVENT_FREE_CHAIN) |
11 | 11 | e1:SetProperty(EFFECT_FLAG_CARD_TARGET) |
| 12 | + e1:SetCode(EVENT_FREE_CHAIN) |
12 | 13 | e1:SetTarget(s.target) |
13 | 14 | e1:SetOperation(s.activate) |
14 | 15 | c:RegisterEffect(e1) |
15 | 16 | end |
16 | | -s.listed_series={0x48} |
17 | | -function s.filter1(c,e,tp) |
18 | | - local m = c:GetMetatable(true) |
19 | | - if not m then return false end |
20 | | - local no, rk=tonumber(m.xyz_number), c:GetRank() |
21 | | - if not no or no < 101 or no > 107 or not c:IsSetCard(0x48) or rk <= 0 then return false end |
22 | | - return (c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsCanBeEffectTarget(e)) |
23 | | - or (c:IsLocation(LOCATION_GRAVE|LOCATION_EXTRA) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) |
24 | | - and ((c:IsLocation(LOCATION_GRAVE) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0) |
25 | | - or (c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c) > 0))) |
26 | | -end |
27 | | -function s.filter2(c,e,tp,mc,rk) |
28 | | - return c:IsC() and mc:IsCanBeXyzMaterial(c) and c:IsRank(rk) |
29 | | - and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c) > 0 |
| 17 | +s.listed_series={SET_NUMBER} |
| 18 | +function s.tgfilter(c,e,tp,mmzone_chk) |
| 19 | + local no=c.xyz_number |
| 20 | + if not (no and no>=101 and no<=107 and c:IsSetCard(SET_NUMBER) and c:IsType(TYPE_XYZ)) then return false end |
| 21 | + if c:IsLocation(LOCATION_MZONE) then |
| 22 | + return c:IsFaceup() and c:IsCanBeEffectTarget(e) |
| 23 | + elseif c:IsLocation(LOCATION_GRAVE) then |
| 24 | + return mmzone_chk>0 and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) |
| 25 | + elseif c:IsLocation(LOCATION_EXTRA) then |
| 26 | + return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,true,false) |
| 27 | + end |
30 | 28 | end |
31 | 29 | function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) |
32 | | - if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE|LOCATION_GRAVE|LOCATION_EXTRA) and s.filter1(chkc,e,tp) end |
33 | | - if chk == 0 then return Duel.IsExistingMatchingCard(s.filter1,tp,LOCATION_MZONE|LOCATION_GRAVE|LOCATION_EXTRA,0,1,nil,e,tp) end |
| 30 | + local mmzone_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 |
| 31 | + if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE|LOCATION_GRAVE|LOCATION_EXTRA) and s.tgfilter(chkc,e,tp,mmzone_chk) end |
| 32 | + if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_MZONE|LOCATION_GRAVE|LOCATION_EXTRA,0,1,nil,e,tp,mmzone_chk) end |
34 | 33 | Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) |
35 | | - local tc = Duel.SelectMatchingCard(tp,s.filter1,tp,LOCATION_MZONE|LOCATION_GRAVE|LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst() |
| 34 | + local tc=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_MZONE|LOCATION_GRAVE|LOCATION_EXTRA,0,1,1,nil,e,tp,mmzone_chk):GetFirst() |
36 | 35 | Duel.SetTargetCard(tc) |
37 | | - if not tc:IsLocation(LOCATION_MZONE) then |
38 | | - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,e:GetHandler():GetLocation()) |
39 | | - end |
| 36 | + local target_not_in_mzone=not tc:IsLocation(LOCATION_MZONE) |
| 37 | + local g=target_not_in_mzone and tc or nil |
| 38 | + local ct=target_not_in_mzone and 2 or 1 |
| 39 | + local loc=target_not_in_mzone and tc:GetLocation()|LOCATION_EXTRA or LOCATION_EXTRA |
| 40 | + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,ct,tp,LOCATION_EXTRA) |
| 41 | +end |
| 42 | +function s.exspfilter(c,e,tp,mc,rk) |
| 43 | + return c:IsC() and mc:IsCanBeXyzMaterial(c) and c:IsRank(rk) and c:IsType(TYPE_XYZ) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 |
| 44 | + and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) |
40 | 45 | end |
41 | 46 | function s.activate(e,tp,eg,ep,ev,re,r,rp) |
42 | 47 | local tc=Duel.GetFirstTarget() |
43 | | - if not tc then return end |
44 | | - if tc and tc:IsRelateToEffect(e) and tc:IsLocation(LOCATION_GRAVE|LOCATION_EXTRA) then |
45 | | - if (tc:IsLocation(LOCATION_GRAVE) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and not tc:IsHasEffect(EFFECT_NECRO_VALLEY)) |
46 | | - or (tc:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,tc) > 0)then |
47 | | - if Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP) then |
48 | | - local e1=Effect.CreateEffect(e:GetHandler()) |
49 | | - e1:SetType(EFFECT_TYPE_SINGLE) |
50 | | - e1:SetCode(EFFECT_DISABLE) |
51 | | - e1:SetReset(RESET_EVENT+RESETS_STANDARD) |
52 | | - tc:RegisterEffect(e1) |
53 | | - local e2=Effect.CreateEffect(e:GetHandler()) |
54 | | - e2:SetType(EFFECT_TYPE_SINGLE) |
55 | | - e2:SetCode(EFFECT_DISABLE_EFFECT) |
56 | | - e2:SetReset(RESET_EVENT+RESETS_STANDARD) |
57 | | - tc:RegisterEffect(e2) |
58 | | - Duel.SpecialSummonComplete() |
59 | | - end |
60 | | - end |
61 | | - if not Duel.IsPlayerCanSpecialSummonCount(tp,2) then return end |
| 48 | + if not tc:IsRelateToEffect(e) then return end |
| 49 | + if tc:IsLocation(LOCATION_MZONE) and (tc:IsFacedown() or tc:IsControler(1-tp)) then return end |
| 50 | + if tc:IsLocation(LOCATION_GRAVE|LOCATION_EXTRA) and Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP) then |
| 51 | + --Negate its effects |
| 52 | + tc:NegateEffects(e:GetHandler()) |
| 53 | + if Duel.SpecialSummonComplete()==0 then return end |
62 | 54 | end |
63 | | - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) |
64 | | - local sg=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,tc,e,tp,tc,tc:GetRank()+1) |
65 | | - if #sg>0 and Duel.SelectYesNo(tp,aux.Stringid(58988903,0)) then |
66 | | - local sc=sg:Select(tp,1,1,nil):GetFirst() |
67 | | - if tc:IsLocation(LOCATION_MZONE) then |
68 | | - Duel.Overlay(sc,tc) |
69 | | - end |
| 55 | + local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(tc),tp,nil,nil,REASON_XYZ) |
| 56 | + if #pg>1 or (#pg==1 and not pg:IsContains(tc)) then return end |
| 57 | + local g=Duel.GetMatchingGroup(s.exspfilter,tp,LOCATION_EXTRA,0,nil,e,tp,tc,tc:GetRank()+1) |
| 58 | + if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then |
| 59 | + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) |
| 60 | + local sc=g:Select(tp,1,1,nil):GetFirst() |
| 61 | + if not sc then return end |
| 62 | + Duel.BreakEffect() |
70 | 63 | sc:SetMaterial(tc) |
71 | | - Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP) |
72 | | - sc:CompleteProcedure() |
| 64 | + Duel.Overlay(sc,tc) |
| 65 | + if Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)>0 then |
| 66 | + sc:CompleteProcedure() |
| 67 | + end |
73 | 68 | end |
74 | 69 | end |
0 commit comments