--Vampire's Bound function c212790.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,212790+EFFECT_COUNT_CODE_OATH) e1:SetCondition(c212790.condition) e1:SetTarget(c212790.target) e1:SetOperation(c212790.activate) c:RegisterEffect(e1) --lp recover local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(212790,0)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetRange(LOCATION_SZONE) e2:SetTarget(c212790.lptg) e2:SetOperation(c212790.lpop) c:RegisterEffect(e2) end function c212790.cfilter1(c) return c:IsFaceup() and c:IsSetCard(0x8e) end function c212790.cfilter2(c) return c:IsFaceup() and c:IsSetCard(0x8e) end function c212790.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(c212790.cfilter1,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(c212790.cfilter2,tp,LOCATION_MZONE,0,1,nil) end function c212790.filter(c,e,tp) if c:IsType(TYPE_MONSTER) then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 else local ct=Duel.GetLocationCount(tp,LOCATION_SZONE) if e:IsHasType(EFFECT_TYPE_ACTIVATE) and not e:GetHandler():IsLocation(LOCATION_SZONE) then ct=ct-1 end return c:IsSSetable(true) and (c:IsType(TYPE_FIELD) or ct>0) end end function c212790.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c212790.filter(chkc,e,tp) end if chk==0 then return Duel.IsExistingTarget(c212790.filter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,c212790.filter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp) if g:GetFirst():IsType(TYPE_MONSTER) then Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) else Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0) end end function c212790.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not tc:IsRelateToEffect(e) then return end if tc:IsType(TYPE_MONSTER) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) elseif (tc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) then Duel.SSet(tp,tc) end end function c212790.lpfilter(c) return c:IsSetCard(0x8e) end function c212790.lptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return eg:IsExists(c212790.lpfilter,1,nil) end end function c212790.lpop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,e:GetHandler():GetCode()) Duel.Recover(tp,500,REASON_EFFECT) end