--Intent from the Dark local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:HOPT() e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --during ep local e2=Effect.CreateEffect(c) e2:Desc(2) e2:SetCategory(CATEGORY_DRAW) e2:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetRange(LOCATION_GB) e2:SetCode(EVENT_PHASE|PHASE_END) e2:SetCountLimit(1) e2:SetCondition(s.drawcon) e2:SetTarget(s.drawtg) e2:SetOperation(s.drawop) c:RegisterEffect(e2) --control local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,4)) e3:SetCategory(CATEGORY_CONTROL) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_GRAVE) e3:SetCost(aux.bfgcost) e3:SetTarget(s.ctltg) e3:SetOperation(s.ctlop) c:RegisterEffect(e3) end function s.actregcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return eg:IsContains(c) and c:IsFaceupEx() and c:HasFlagEffect(id) and c:IsReason(REASON_RULE) and c:GetReasonCard()==nil end function s.actreg(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() c:RegisterFlagEffect(id+100,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2)) e:Reset() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end if e:IsHasType(EFFECT_TYPE_ACTIVATE) then local c=e:GetHandler() c:RegisterFlagEffect(id,RESET_CHAIN,EFFECT_FLAG_OATH,1) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_TO_GRAVE) e1:SetCondition(s.actregcon) e1:SetOperation(s.actreg) e1:SetReset(RESET_CHAIN) Duel.RegisterEffect(e1,tp) local e2=e1:Clone() e2:SetCode(EVENT_REMOVE) Duel.RegisterEffect(e2,tp) end end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToChain() and tc:IsFaceup() then tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3)) local e1=Effect.CreateEffect(tc) e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_TRIGGER_F) e1:SetCategory(CATEGORY_HANDES) e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_TO_GRAVE) e1:SetCountLimit(1) e1:SetCondition(s.hdcon) e1:SetTarget(s.hdtg) e1:SetOperation(s.hdop) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) if not tc:IsType(TYPE_EFFECT) then local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_ADD_TYPE) e2:SetValue(TYPE_EFFECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e2,true) end end end function s.cfilter(c,tp) return c:IsPreviousLocation(LOCATION_ONFIELD) and c:GetPreviousControler()==1-tp end function s.hdcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) end function s.dcfilter(c) return c:IsMonster() and c:IsRace(RACE_ZOMBIE) and c:IsDiscardable(REASON_EFFECT) end function s.hdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,1) end function s.hdop(e,tp,eg,ep,ev,re,r,rp) Duel.DiscardHand(1-tp,s.dcfilter,1,1,REASON_EFFECT|REASON_DISCARD,nil) end function s.drawcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():HasFlagEffect(id+100) end function s.drawtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.drawop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) end function s.ctlfilter(c) return c:IsControlerCanBeChanged() and c:IsFaceup() and c:IsSetCard(ARCHE_FROM_THE_DARK) end function s.ctltg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.ctlfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.ctlfilter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) local g=Duel.SelectTarget(tp,s.ctlfilter,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetCardOperationInfo(g,CATEGORY_CONTROL) end function s.ctlop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToChain() then Duel.GetControl(tc,tp) end end