--Abysslym Malice --Script by TaxingCorn117 local s,id=GetID() function s.initial_effect(c) --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_GRAVE) e1:HOPT(EFFECT_COUNT_CODE_DUEL) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --return to hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE|EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_REMOVE) e2:HOPT(EFFECT_COUNT_CODE_DUEL) e2:SetCondition(s.retcon) e2:SetTarget(s.rettg) e2:SetOperation(s.retop) c:RegisterEffect(e2) aux.RegisterTriggeringArchetypeCheck(c,ARCHE_ABYSSLYM) end function s.cfilter(c) return c:IsFaceup() and c:IsSetCard(ARCHE_ABYSSLYM) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end Duel.SetCardOperationInfo(c,CATEGORY_SPECIAL_SUMMON) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToChain() then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end function s.retcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsReason(REASON_COST) and re and re:IsActivated() and re:IsActiveType(TYPE_MONSTER) and aux.CheckArchetypeReasonEffect(s,re,ARCHE_ABYSSLYM) end function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetCardOperationInfo(e:GetHandler(),CATEGORY_TOHAND) end function s.retop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToChain() then Duel.SendtoHand(c,nil,REASON_EFFECT) end end