name: Dark
card_text: Declare 1 Monster Card name. If the declared card is in your opponent's Deck, add 1 of that card to your opponent's hand.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SEARCH)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsAbleToHand, tp, 0, LOCATION_DECK, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CODE)
  	getmetatable(e:GetHandler()).announce_filter = { TYPE_MONSTER, OPCODE_ISTYPE, TYPE_FUSION + TYPE_SYNCHRO + TYPE_XYZ + TYPE_LINK, OPCODE_ISTYPE, OPCODE_NOT, OPCODE_AND }
  	local code = Duel.AnnounceCard(tp, table.unpack(getmetatable(e:GetHandler()).announce_filter))
  	Duel.SetTargetParam(code)
  	Duel.SetOperationInfo(0, CATEGORY_ANNOUNCE, nil, 0, tp, 0)
  end
  function s.filter(c, code)
  	return c:IsType(TYPE_MONSTER) and c:IsCode(code) and c:IsAbleToHand()
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local code = Duel.GetChainInfo(0, CHAININFO_TARGET_PARAM)
  	Duel.Hint(HINT_SELECTMSG, 1 - tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectMatchingCard(1 - tp, s.filter, 1 - tp, LOCATION_DECK, 0, 1, 1, nil, code)
  	local tc = g:GetFirst()
  	if tc then
  		Duel.SendtoHand(tc, nil, REASON_EFFECT)
  		Duel.ConfirmCards(tp, tc)
  	end
  end
  
  
source_text: Dark
  Declare 1 Monster Card name. If the declared card is in your opponent's Deck, add 1 of that card to your opponent's hand.
target_text: -- Dark
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SEARCH)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsAbleToHand, tp, 0, LOCATION_DECK, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CODE)
  	getmetatable(e:GetHandler()).announce_filter = { TYPE_MONSTER, OPCODE_ISTYPE, TYPE_FUSION + TYPE_SYNCHRO + TYPE_XYZ + TYPE_LINK, OPCODE_ISTYPE, OPCODE_NOT, OPCODE_AND }
  	local code = Duel.AnnounceCard(tp, table.unpack(getmetatable(e:GetHandler()).announce_filter))
  	Duel.SetTargetParam(code)
  	Duel.SetOperationInfo(0, CATEGORY_ANNOUNCE, nil, 0, tp, 0)
  end
  function s.filter(c, code)
  	return c:IsType(TYPE_MONSTER) and c:IsCode(code) and c:IsAbleToHand()
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local code = Duel.GetChainInfo(0, CHAININFO_TARGET_PARAM)
  	Duel.Hint(HINT_SELECTMSG, 1 - tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectMatchingCard(1 - tp, s.filter, 1 - tp, LOCATION_DECK, 0, 1, 1, nil, code)
  	local tc = g:GetFirst()
  	if tc then
  		Duel.SendtoHand(tc, nil, REASON_EFFECT)
  		Duel.ConfirmCards(tp, tc)
  	end
  end
  
  