--Sweethard-Powered: Tyla Kitten local cid,id=GetID() function cid.initial_effect(c) aux.AddOrigEvoluteType(c) c:EnableReviveLimit() aux.AddEvoluteProc(c,nil,6,cid.filter1,2) --spsummon proc local e0=Effect.CreateEffect(c) e0:SetDescription(aux.Stringid(id,0)) e0:SetType(EFFECT_TYPE_FIELD) e0:SetCode(EFFECT_SPSUMMON_PROC) e0:SetProperty(EFFECT_FLAG_UNCOPYABLE) e0:SetRange(LOCATION_EXTRA) e0:SetCountLimit(1,id) e0:SetCondition(cid.hspcon) e0:SetOperation(cid.hspop) e0:SetValue(SUMMON_TYPE_SPECIAL+388) c:RegisterEffect(e0) --deck check local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(0,0x11e0) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1) e1:SetCost(cid.cost) e1:SetTarget(cid.target) e1:SetOperation(cid.operation) c:RegisterEffect(e1) end function cid.filter1(c,ec,tp) return c:IsAttribute(ATTRIBUTE_DARK) or c:IsRace(RACE_BEASTWARRIOR) end function cid.spfilter(c,ec,tp) return c:IsFaceup() and c:IsCode(500310010) and c:IsCanBeEvoluteMaterial(ec) and Duel.GetLocationCountFromEx(tp,tp,c,ec)>0 and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_EVOLUTE_MATERIAL) end function cid.hspcon(e,c) if c==nil then return true end if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end local tp=c:GetControler() return Duel.IsExistingMatchingCard(cid.spfilter,tp,LOCATION_MZONE,0,1,nil,c,tp) end function cid.hspop(e,tp,eg,ep,ev,re,r,rp,c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_MATERIAL) local g=Duel.SelectMatchingCard(tp,cid.spfilter,tp,LOCATION_MZONE,0,1,1,nil,c,tp) Duel.SendtoGrave(g,REASON_MATERIAL+0x10000000) Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1) end function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanRemoveEC(tp,4,REASON_COST) end e:GetHandler():RemoveEC(tp,4,REASON_COST) end function cid.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetDecktopGroup(tp,3):GetCount()==3 end end function cid.operation(e,tp,eg,ep,ev,re,r,rp) if not (Duel.GetDecktopGroup(tp,3):GetCount()==3) then return end Duel.ConfirmDecktop(tp,3) local g=Duel.GetDecktopGroup(tp,3) local sel=0 if g:IsExists(function(tc) return tc:IsSetCard(0xa34) and tc:IsType(TYPE_MONSTER) end,1,nil) then sel=sel+1 end if g:IsExists(function(tc) return tc:IsSetCard(0xa34) and tc:IsType(TYPE_SPELL) end,1,nil) then sel=sel+2 end if g:IsExists(function(tc) return tc:IsSetCard(0xa34) and tc:IsType(TYPE_TRAP) end,1,nil) then sel=sel+4 end --setting the option if sel==1 then Duel.SelectOption(tp,aux.Stringid(id,1)) opt=0 elseif sel==2 then Duel.SelectOption(tp,aux.Stringid(id,2)) opt=1 elseif sel==3 then opt=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2)) elseif sel==4 then Duel.SelectOption(tp,aux.Stringid(id,3)) opt=2 elseif sel==5 then opt=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,3)) if opt==1 then opt=2 end elseif sel==6 then opt=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))+1 elseif sel==7 then opt=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2),aux.Stringid(id,3)) end Duel.ShuffleDeck(tp) --getting the option and executing if opt==0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local dg=Duel.SelectMatchingCard(tp,Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.Destroy(dg,REASON_EFFECT) end if opt==1 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local dg=Duel.SelectMatchingCard(tp,cid.rmfilter,tp,LOCATION_SZONE+LOCATION_GRAVE,LOCATION_SZONE+LOCATION_GRAVE,1,1,nil) Duel.Remove(dg,POS_FACEUP,REASON_EFFECT) end if opt==2 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local dg=Duel.SelectMatchingCard(tp,cid.rmfilter2,tp,LOCATION_SZONE+LOCATION_GRAVE,LOCATION_SZONE+LOCATION_GRAVE,1,1,nil) Duel.SendtoDeck(dg,nil,2,REASON_EFFECT) end end function cid.rmfilter(c) return c:IsFaceup() and c:IsType(TYPE_SPELL) and c:IsAbleToRemove() end function cid.rmfilter2(c) return c:IsFaceup() and c:IsType(TYPE_TRAP) and c:IsAbleToDeck() end function cid.retcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetReasonPlayer()==1-tp and e:GetHandler():GetPreviousControler()==tp end function cid.thfilter(c) return c:IsSetCard(0xa34) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function cid.rettg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function cid.retop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,cid.thfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end