--VECTOR Engineer Liana --Scripted by Keddy, updated by Zerry function c67864642.initial_effect(c) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(67864642,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,67864642) e2:SetTarget(c67864642.sptg1) e2:SetOperation(c67864642.spop1) c:RegisterEffect(e2) --tohand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(67864642,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetCountLimit(1,67864642+100) e3:SetCondition(c67864642.spcon) e3:SetCost(c67864642.spcost) e3:SetTarget(c67864642.sptg2) e3:SetOperation(c67864642.spop2) c:RegisterEffect(e3) end function c67864642.spfilter1(c,e,tp) return c:IsSetCard(0x2a6) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(67864642) end function c67864642.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c67864642.spfilter1(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c67864642.spfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,c67864642.spfilter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function c67864642.spop1(e,tp,eg,ep,ev,re,r,rp,chk) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end function c67864642.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_GRAVE) end function c67864642.cfilter(c) return c:IsSetCard(0x2a6) and c:IsDiscardable() end function c67864642.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c67864642.cfilter,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,c67864642.cfilter,1,1,REASON_COST+REASON_DISCARD,nil) end function c67864642.spfilter2(c,e,tp) return c:IsSetCard(0x2a6) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(67864642) end function c67864642.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c67864642.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK) end function c67864642.spop2(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,c67864642.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetReset(RESET_PHASE+PHASE_END) e1:SetTargetRange(1,0) e1:SetTarget(c67864642.splimit) Duel.RegisterEffect(e1,tp) end end function c67864642.splimit(e,c,sump,sumtype,sumpos,targetp,se) return not c:IsSetCard(0x2a6) end