--Sweethard-Powered: Sagi Rabbit local cid,id=GetID() function cid.initial_effect(c) aux.AddOrigEvoluteType(c) c:EnableReviveLimit() aux.AddEvoluteProc(c,nil,4,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) --to deck 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(500310030) 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,2,REASON_COST) end e:GetHandler():RemoveEC(tp,2,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.Damage(1-tp,500,REASON_EFFECT) end if opt==1 then local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCode(EFFECT_CANNOT_ACTIVATE) e2:SetTargetRange(0,1) e2:SetValue(cid.aclimit) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2) Duel.RegisterEffect(e2,tp) end end if opt==2 then g=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(tp,1) Duel.SendtoDeck(g,nil,2,REASON_EFFECT) -- local e2=Effect.CreateEffect(c) -- e2:SetType(EFFECT_TYPE_FIELD) -- e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) -- e2:SetCode(EFFECT_CANNOT_ACTIVATE) -- e2:SetTargetRange(0,1) -- e2:SetValue(cid.aclimit) -- e2:SetReset(RESET_PHASE+PHASE_END) -- Duel.RegisterEffect(e2,tp) end function cid.aclimit(e,re,tp) return re:GetActivateLocation()==LOCATION_GRAVE 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,e,tp) return c:IsSetCard(0xa34) 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_DECK) 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_DECK,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end