--created by Discord \ Walrus, coded by Lyris, art from Shadowverse's "Blood Drinker's Brand" --マーク・オブ・カオス local s,id,o=GetID() function s.initial_effect(c) c:SetUniqueOnField(1,0,id) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCategory(CATEGORY_TODECK) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE) e2:SetRange(LOCATION_SZONE) e2:SetCode(EFFECT_TO_GRAVE_REDIRECT) e2:SetTargetRange(0xff,0xff) e2:SetCondition(function() return Duel.IsExistingMatchingCard(s.filter,e2:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end) e2:SetValue(LOCATION_REMOVED) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_CHANGE_ATTRIBUTE) e3:SetRange(LOCATION_SZONE) e3:SetTargetRange(LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED) e3:SetCondition(function(e) return Duel.IsExistingMatchingCard(s.cfilter,e:GetHandlerPlayer(),LOCATION_REMOVED,LOCATION_REMOVED,5,nil) end) e3:SetValue(ATTRIBUTE_DARK) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EFFECT_CHANGE_RACE) e4:SetValue(RACE_FIEND) c:RegisterEffect(e4) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then Duel.SendtoDeck(Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil),nil,2,REASON_EFFECT) end end function s.filter(c) return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_FIEND) and c:IsLevelAbove(8) end function s.cfilter(c) return c:IsFaceup() and c:GetOriginalAttribute()&ATTRIBUTE_DARK>0 and c:GetOriginalRace()&RACE_FIEND>0 end