--鳥澄珠鳥 ~远东的托特神~ local m=33701379 local cm=_G["c"..m] 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:SetValue(SUMMON_TYPE_XYZ) e2:SetCondition(cm.sprcon) e2:SetOperation(cm.sprop) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetTarget(cm.sptg) e3:SetOperation(cm.spop) c:RegisterEffect(e3) --negate local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_NEGATE) e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetCode(EVENT_CHAINING) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e4:SetRange(LOCATION_MZONE) e4:SetCondition(cm.discon) e4:SetCost(cm.discost) e4:SetTarget(cm.distg) e4:SetOperation(cm.disop) c:RegisterEffect(e4) end function cm.sprfilter(c) return c:IsCanBeXyzMaterial(nil) end function cm.sprfilter1(c,tp,sg,sc) local sg1=Group.Clone(sg) sg1:AddCard(c) return c:IsCanBeXyzMaterial(nil) and Duel.GetLocationCountFromEx(tp,tp,sg1,sc)>0 end function cm.ccfilter(c) return bit.band(c:GetType(),TYPE_NORMAL+TYPE_RITUAL+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK+TYPE_FUSION+TYPE_SPELL+TYPE_TRAP) end function cm.ccfilter1(c) return bit.band(c:GetType(),TYPE_MONSTER+TYPE_EFFECT)==TYPE_MONSTER+TYPE_EFFECT end function cm.fselect(g,tp,sc) return g:GetClassCount(cm.ccfilter)==(g:GetCount()-1) and g:GetClassCount(Card.GetCode)==g:GetCount() and g:IsExists(cm.ccfilter1,1,nil) and g:IsExists(cm.sprfilter1,g:GetCount(),nil,tp,g,sc) end function cm.sprcon(e,c) if c==nil then return true end local tp=c:GetControler() local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil) return g:CheckSubGroup(cm.fselect,9,9,tp,c) end function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c) local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) local mg=g:SelectSubGroup(tp,cm.fselect,false,9,9,tp,c) local sg=Group.CreateGroup() local tc=mg:GetFirst() while tc do local sg1=tc:GetOverlayGroup() sg:Merge(sg1) tc=mg:GetNext() end Duel.SendtoGrave(sg,REASON_RULE) c:SetMaterial(mg) Duel.Overlay(c,mg) end function cm.spfilter(c,e,tp) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function cm.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end function cm.discon(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return tg and Duel.IsChainNegatable(ev) end function cm.cfilter(c) return c:IsPublic() and c:IsCode(83764718) end function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND,0,1,1,nil) e:SetLabelObject(g:GetFirst()) g:GetFirst():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1) Duel.ConfirmCards(1-tp,g) end function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) end function cm.disop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateActivation(ev) local tc=g:GetLabelObject() local c=e:GetHandler() if tc and tc:GetFlagEffect(m)>0 and tc:IsDiscardable(REASON_EFFECT) and c:IsRelateToEffect(e) and c:CheckRemoveOverlayCard(tp,9,REASON_EFFECT) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then Duel.SendtoGrave(tc,REASON_DISCARD+REASON_EFFECT) e:GetHandler():RemoveOverlayCard(tp,9,9,REASON_EFFECT) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_SKIP_TURN) e1:SetTargetRange(0,1) e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN) Duel.RegisterEffect(e1,tp) end end