--Voodoll's Creation function c212875.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,212875) e1:SetTarget(c212875.target) e1:SetOperation(c212875.activate) c:RegisterEffect(e1) --to deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(212875,1)) e2:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,212876) e2:SetTarget(c212875.tdtg) e2:SetOperation(c212875.tdop) c:RegisterEffect(e2) end function c212875.spfilter(c,e,tp) return c:IsSetCard(0x26eb) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) end function c212875.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c212875.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,0,tp,LOCATION_EXTRA) end function c212875.tgfilter(c,mc) return c:IsSetCard(0x26eb) and c:IsType(TYPE_MONSTER) and c:IsAttribute(mc:GetAttribute()) and c:IsAbleToGrave() end function c212875.activate(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,aux.NecroValleyFilter(c212875.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp) if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_ATTACK)~=0 then local tg=Duel.GetMatchingGroup(c212875.tgfilter,tp,LOCATION_EXTRA,0,nil,g:GetFirst()) if tg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(212875,0)) then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local sg=tg:Select(tp,1,1,nil) Duel.SendtoGrave(sg,REASON_EFFECT) end end end function c212875.thfilter(c) return c:IsFaceup() and c:IsCode(212830) and c:IsAbleToHand() end function c212875.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c212875.thfilter(chkc) end if chk==0 then return e:GetHandler():IsAbleToDeck() and Duel.IsExistingTarget(c212875.thfilter,tp,LOCATION_REMOVED,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,c212875.thfilter,tp,LOCATION_REMOVED,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function c212875.tdop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,2,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end