--Sweethard-Powered: Mika Mouse local cid,id=GetID() function cid.initial_effect(c) aux.AddOrigEvoluteType(c) c:EnableReviveLimit() aux.AddEvoluteProc(c,nil,5,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(500310050) 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,3,REASON_COST) end e:GetHandler():RemoveEC(tp,3,REASON_COST) end function cid.target(e,tp,eg,ep,ev,re,r,rp,chk) local b1=Duel.IsPlayerCanDraw(tp,1) 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.Recover(tp,500,REASON_EFFECT) end if opt==1 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectMatchingCard(tp,cid.xfffilter,tp,0,LOCATION_MZONE,1,1,nil) if g:GetCount()>0 then local tc=g:GetFirst() local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetValue(RESET_TURN_SET) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e2) end end if opt==2 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectMatchingCard(tp,cid.xfffilter2,tp,0,LOCATION_SZONE,1,1,nil) if g:GetCount()>0 then local tc=g:GetFirst() local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetValue(RESET_TURN_SET) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e2) end end end function cid.xfffilter(c) return c:IsFaceup() and not c:IsDisabled() and c:IsType(TYPE_EFFECT) end function cid.xfffilter2(c) return c:IsFaceup() and not c:IsDisabled() and c:IsType(TYPE_SPELL+TYPE_TRAP) 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 not c:IsCode(id) and c:IsType(TYPE_MONSTER) --and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function cid.rettg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cid.thfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function cid.retop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,cid.thfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end