--De-Evolute function c16000226.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(c16000226.target) e1:SetOperation(c16000226.activate) c:RegisterEffect(e1) end function c16000226.filter(c) return c:IsFaceup() and c:IsType(TYPE_EVOLUTE) and c:IsAbleToExtra() end function c16000226.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and c16000226.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(c16000226.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,c16000226.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) end function c16000226.mgfilter(c,e,tp,sync) return not c:IsControler(tp) or not c:IsLocation(LOCATION_GRAVE) or not r==REASON_MATERIAL+0x10000000 or not c:IsCanBeSpecialSummoned(e,0,tp,false,false) or c:IsHasEffect(EFFECT_NECRO_VALLEY) end function c16000226.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end local mg=tc:GetMaterial() local sumable=true local sumtype=tc:GetSummonType() if Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)==0 or sumtype~=SUMMON_TYPE_SPECIAL+388 or mg:GetCount()==0 or mg:GetCount()>Duel.GetLocationCount(tp,LOCATION_MZONE) or mg:IsExists(c16000226.mgfilter,1,nil,e,tp,tc) then sumable=false end if sumable and Duel.SelectYesNo(tp,aux.Stringid(16000226,0)) then Duel.BreakEffect() Duel.SpecialSummon(mg,0,tp,tp,false,false,POS_FACEUP) end end