--苍之战士 行星宙蓝 local m=40006764 local cm=_G["c"..m] cm.named_with_blaucavalier=1 function cm.initial_effect(c) c:EnableReviveLimit() --spsummon condition local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) c:RegisterEffect(e1) --special summon rule local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetRange(LOCATION_EXTRA) e2:SetCondition(cm.con) e2:SetOperation(cm.op) c:RegisterEffect(e2) --tohand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(m,0)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_HANDES) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCountLimit(1,m) e3:SetTarget(cm.thtg) e3:SetOperation(cm.thop) c:RegisterEffect(e3) --banish local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(m,1)) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_DAMAGE_STEP_END) e4:SetCountLimit(1,m+1) e4:SetCost(cm.cost) e4:SetTarget(cm.sptg) e4:SetOperation(cm.spop) c:RegisterEffect(e4) end function cm.tgrfilter(c) return c:IsFaceup() and c:IsLevelAbove(1) and c:IsCanOverlay() end function cm.tgrfilter1(c) return c:IsType(TYPE_TUNER) and c:IsLevelAbove(1) end function cm.mnfilter(c,g) return g:IsExists(cm.mnfilter2,1,c,c) end function cm.mnfilter2(c,mc) return c:GetLevel()+mc:GetLevel()==8 end function cm.fselect(g,tp,sc) return g:GetCount()==2 and g:IsExists(cm.tgrfilter1,2,nil) and g:IsExists(cm.mnfilter,1,nil,g) and Duel.GetLocationCountFromEx(tp,tp,g,sc)>0 end function cm.con(e,c) if c==nil then return true end local tp=c:GetControler() local g=Duel.GetMatchingGroup(cm.tgrfilter,tp,LOCATION_MZONE,0,nil) return g:CheckSubGroup(cm.fselect,2,2,tp,c) end function cm.op(e,tp,eg,ep,ev,re,r,rp,c) local g=Duel.GetMatchingGroup(cm.tgrfilter,tp,LOCATION_MZONE,0,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) local matg=g:SelectSubGroup(tp,cm.fselect,false,2,2,tp,c) local og = Group.CreateGroup() for tc in aux.Next(matg) do og:Merge(tc:GetOverlayGroup()) end if #og>0 then Duel.SendtoGrave(og,REASON_RULE) end Duel.Overlay(c,matg) end function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,1) end function cm.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then if Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 then Duel.BreakEffect() local g=Duel.GetFieldGroup(1-tp,LOCATION_HAND,0) local sg=g:RandomSelect(1-tp,1) Duel.SendtoGrave(sg,REASON_DISCARD+REASON_EFFECT) end end end function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) end function cm.blaucavalier(c) local m=_G["c"..c:GetCode()] return m and m.named_with_blaucavalier end function cm.filter(c,e,tp,mc) return c:IsRank(11) and cm.blaucavalier(c) and mc:IsCanBeXyzMaterial(c) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 end function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function cm.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e) and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c) local tc=g:GetFirst() if tc then local mg=c:GetOverlayGroup() if mg:GetCount()~=0 then Duel.Overlay(tc,mg) end tc:SetMaterial(Group.FromCards(c)) Duel.Overlay(tc,Group.FromCards(c)) Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP) tc:CompleteProcedure() end end end