--Hellstrain Embodiment function c212029.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,212029) e1:SetTarget(c212029.target) e1:SetOperation(c212029.activate) c:RegisterEffect(e1) --tohand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(212029,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCondition(aux.exccon) e2:SetCost(aux.bfgcost) e2:SetTarget(c212029.thtg) e2:SetOperation(c212029.thop) c:RegisterEffect(e2) end function c212029.filter(c) return c:IsSetCard(0x22f) and c:IsAbleToDeck() end function c212029.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,3) and Duel.IsExistingMatchingCard(c212029.filter,tp,LOCATION_HAND,0,2,e:GetHandler()) end Duel.SetTargetPlayer(tp) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,3) end function c212029.activate(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local g=Duel.GetMatchingGroup(c212029.filter,p,LOCATION_HAND,0,nil) if g:GetCount()>=2 then Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK) local sg=g:Select(p,2,2,nil) Duel.ConfirmCards(1-p,sg) Duel.SendtoDeck(sg,nil,2,REASON_EFFECT) Duel.ShuffleDeck(p) Duel.BreakEffect() Duel.Draw(p,3,REASON_EFFECT) end end function c212029.thfilter(c) return c:IsSetCard(0x22f) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function c212029.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c212029.thfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(c212029.thfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=Duel.SelectTarget(tp,c212029.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,sg:GetCount(),0,0) end function c212029.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end