--动物朋友 Unico local m=33711407 local cm=_G["c"..m] function cm.initial_effect(c) aux.EnablePendulumAttribute(c) c:EnableReviveLimit() aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(cm.ffilter),4,true) local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE) e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e5:SetCode(EFFECT_SPSUMMON_CONDITION) e5:SetValue(cm.splimit1) c:RegisterEffect(e5) --splimit local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_FIELD) e0:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE) e0:SetRange(LOCATION_PZONE) e0:SetTargetRange(1,0) e0:SetCondition(cm.splimcon) e0:SetTarget(cm.splimit) c:RegisterEffect(e0) --recover local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(m,0)) e1:SetCategory(CATEGORY_RECOVER) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_PZONE) e1:SetCountLimit(1) e1:SetCost(cm.rccost) e1:SetTarget(cm.rctg) e1:SetOperation(cm.rcop) c:RegisterEffect(e1) --imm local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetRange(LOCATION_MZONE) e2:SetCode(EFFECT_IMMUNE_EFFECT) e2:SetCondition(cm.imcon) e2:SetTarget(aux.TargetBoolFunction(aux.AND(Card.IsSetCard,Card.IsFaceup),0x442)) e2:SetValue(function(e,te) return te:GetOwnerPlayer()~=e:GetHandlerPlayer() end) e2:SetTargetRange(LOCATION_ONFIELD,0) c:RegisterEffect(e2) --negate local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(m,1)) e3:SetCategory(CATEGORY_DISABLE) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_CHAINING) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e3:SetRange(LOCATION_MZONE) e3:SetCondition(cm.discon) e3:SetCost(cm.discost) e3:SetTarget(cm.distg) e3:SetOperation(cm.disop) c:RegisterEffect(e3) --leave field local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(m,2)) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e4:SetCode(EVENT_LEAVE_FIELD) e4:SetCondition(cm.setcon) e4:SetOperation(cm.setop) c:RegisterEffect(e4) end function cm.ffilter(c,fc) return c:IsSetCard(0x442) and (c:IsType(TYPE_XYZ) or c:IsType(TYPE_FUSION) or c:IsType(TYPE_SYNCHRO) or c:IsType(TYPE_LINK)) end function cm.splimit1(e,se,sp,st) return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION end function cm.filter22(c) if c:IsLocation(LOCATION_ONFIELD) and not c:IsFaceup() then return false end return c:IsSetCard(0x442) end function cm.imcon(e,tp) local g=Duel.GetMatchingGroup(cm.filter22,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil) local num1=Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_ONFIELD,nil) return g:GetClassCount(Card.GetCode)>num1 end function cm.splimcon(e) return not e:GetHandler():IsForbidden() end function cm.splimit(e,c,sump,sumtype,sumpos,targetp) return bit.band(sumtype,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM end function cm.rcfilter(c) return c:IsSetCard(0x442) and not c:IsPublic() end function cm.rccost(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0) if chk==0 then return Duel.GetMatchingGroupCount(cm.rcfilter,tp,LOCATION_HAND,0,nil)>0 end Duel.ConfirmCards(1-tp,g) Duel.ShuffleHand(tp) end function cm.rctg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0) end function cm.thfilter(c) return c:IsAbleToHand() and c:IsSetCard(0x442) end function cm.rcop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local num=Duel.GetMatchingGroupCount(cm.rcfilter,tp,LOCATION_HAND,0,nil) local num1=Duel.Recover(p,num*500,REASON_EFFECT) local num2=num1//1000 local tg=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_GRAVE,0,nil) if tg:GetCount()>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local thg=tg:Select(tp,1,math.min(#tg,num2),nil) Duel.SendtoHand(thg,tp,REASON_EFFECT) end end function cm.discon(e,tp,eg,ep,ev,re,r,rp) return rp==1-tp and Duel.IsChainDisablable(ev) end function cm.disfilter(c) return c:IsDiscardable() and c:IsSetCard(0x442) end function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.disfilter,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) local g=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_HAND,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD) end function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) end function cm.disop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateEffect(ev) end function cm.setcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup() end function cm.setop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,false) end end