--Divexplorer Nurse, Lettie local ref,id=GetID() function ref.initial_effect(c) --Destroy local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCost(ref.descost) e1:SetTarget(ref.destg) e1:SetOperation(ref.desop) e1:SetCountLimit(1,id) c:RegisterEffect(e1) --Special Summon --[[local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_REMOVE) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetCountLimit(1,id+1000) e2:SetTarget(ref.sstg) e2:SetOperation(ref.ssop) c:RegisterEffect(e2)]] local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_DESTROYED) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetRange(LOCATION_HAND+LOCATION_REMOVED) e2:SetCountLimit(1,id+1000) e2:SetCondition(ref.spcon) e2:SetTarget(ref.sptg) e2:SetOperation(ref.spop) c:RegisterEffect(e2) end function ref.descfilter(c) return c:IsSetCard(0x72e) and c:IsAbleToRemoveAsCost() end function ref.descost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(ref.descfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,ref.descfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function ref.desfilter(c) return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable() end function ref.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return ref.desfilter(chkc) and chkc:IsControler(tp) and chkc:IsLocation(LOCATION_ONFIELD) end if chk==0 then return Duel.IsExistingTarget(ref.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,ref.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function ref.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end function ref.ssfilter(c,e,tp) return c:IsSetCard(0x72e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function ref.sstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return ref.ssfilter(chkc,e,tp) and chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(ref.ssfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,ref.ssfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0) end function ref.ssop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end function ref.spcfilter(c,tp) return c:IsPreviousLocation(LOCATION_ONFIELD) --and c:GetPreviousControler()==tp end function ref.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(ref.spcfilter,1,nil,tp) end function ref.zoneloop(c,e,tp) local seq=c:GetPreviousSequence() --if c:IsPreviousLocation(LOCATION_SZONE) then seq=seq-8 else if not c:IsPreviousLocation(LOCATION_SZONE) then if seq==5 or seq==6 then if seq==5 then seq=1 else seq=3 end end end if c:GetPreviousControler()==1-tp then seq=4-seq end local zone = bit.lshift(1,seq) local val=bit.bor(e:GetLabel(),zone) e:SetLabel(val) end function ref.sptg(e,tp,eg,ep,ev,re,r,rp,chk) --Debug.Message("Targeting for revival") local c=e:GetHandler() e:SetLabel(0) local rg=eg:Filter(ref.spcfilter,nil,tp) rg:ForEach(ref.zoneloop,e,tp) local zone=e:GetLabel() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp)--,zone) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end function ref.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local zone=e:GetLabel() if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP,zone) end end