--Memento Avariamoritas function c111765877.initial_effect(c) --link summon aux.AddLinkProcedure(c,nil,2,99,c111765877.lcheck) c:EnableReviveLimit() --immune local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(c111765877.etarget) e1:SetCondition(c111765877.econdition) c:RegisterEffect(e1) --destroyreplace local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_DESTROY_REPLACE) e2:SetRange(LOCATION_MZONE) e2:SetTarget(c111765877.reptg) e2:SetValue(c111765877.repval) e2:SetOperation(c111765877.repop) c:RegisterEffect(e2) --FLOAT local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(111765877,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_TO_GRAVE) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCountLimit(1,111765877) e3:SetCondition(c111765877.thcon) e3:SetTarget(c111765877.thtg) e3:SetOperation(c111765877.thop) c:RegisterEffect(e3) end --link summon function c111765877.lcheck(g,lc) return g:IsExists(Card.IsSetCard,1,nil,0x736) end --immune function c111765877.econdition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>Duel.GetFieldGroupCount(tp,0,LOCATION_DECK) end function c111765877.etarget(e,c) return c:IsSetCard(0x736) end --destroyreplace function c111765877.repfilter(c,tp) return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD) and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT)) and not c:IsReason(REASON_REPLACE) end function c111765877.desfilter(c,e,tp) return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsSetCard(0x736) and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED+STATUS_BATTLE_DESTROYED) end function c111765877.reptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return eg:IsExists(c111765877.repfilter,1,nil,tp) and Duel.IsExistingMatchingCard(c111765877.desfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE) local g=Duel.SelectMatchingCard(tp,c111765877.desfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) e:SetLabelObject(g:GetFirst()) g:GetFirst():SetStatus(STATUS_DESTROY_CONFIRMED,true) return true end return false end function c111765877.repval(e,c) return c111765877.repfilter(c,e:GetHandlerPlayer()) end function c111765877.repop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() tc:SetStatus(STATUS_DESTROY_CONFIRMED,false) Duel.Destroy(tc,REASON_EFFECT+REASON_REPLACE) end --float function c111765877.thcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_MZONE) and c:IsType(TYPE_LINK) end function c111765877.spfilter(c,e,tp) return c:IsSetCard(0x736) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(111765877) end function c111765877.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c111765877.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function c111765877.thop(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,aux.NecroValleyFilter(c111765877.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end