--Lana, Whiptail Girl of Magnificent VINE function c50031786.initial_effect(c) --link summon c:EnableReviveLimit() aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x85a),2,2) local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(50031786,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,50031786) e1:SetTarget(c50031786.target2) e1:SetOperation(c50031786.operation) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(50031786,0)) e2:SetCategory(CATEGORY_DISABLE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,50031787) e2:SetCost(c50031786.negcost) e2:SetTarget(c50031786.target1) e2:SetOperation(c50031786.activate) c:RegisterEffect(e2) end function c50031786.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Destroy(e:GetHandler(),REASON_EFFECT) end function c50031786.tgcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_EFFECT) and not e:GetHandler():IsReason(REASON_RETURN) end function c50031786.kfilter(c) return c:IsSetCard(0x85a) and c:IsType(TYPE_MONSTER) --and c:GetSequence()>=5 end function c50031786.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c50031786.kfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(c50031786.kfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(50031786,0)) Duel.SelectTarget(tp,c50031786.kfilter,tp,LOCATION_MZONE,0,1,1,nil) end function c50031786.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end Duel.Hint(HINT_SELECTMSG,tp,571) local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0) local nseq=math.log(s,2) Duel.MoveSequence(tc,nseq) end function c50031786.negcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) end function c50031786.target2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local zone=e:GetHandler():GetLinkedZone() return zone~=0 and Duel.IsExistingMatchingCard(c50031786.filter,tp,LOCATION_DECK,0,1,nil,e,tp,zone) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function c50031786.filter(c,e,tp,zone) return c:IsSetCard(0x85a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) end function c50031786.operation(e,tp,eg,ep,ev,re,r,rp) local zone=e:GetHandler():GetLinkedZone() if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if zone==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c50031786.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp,zone) local tc=g:GetFirst() if not tc then return end if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)~=0 then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetOperation(c50031786.desop) e1:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e1) end end