name: Dark
card_text: Activate only when an opponent's monster declares an attack. Negate that attack, and select another face-up monster your opponent controls. That monster attacks instead. (If it is in face-up Defense Position, change it to Attack Position.)
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return tp ~= Duel.GetTurnPlayer()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return false
  	end
  	local a = Duel.GetAttacker()
  	if chk == 0 then
  		return a and a:IsCanBeEffectTarget(e) and Duel.IsExistingTarget(Card.IsFaceup, tp, 0, LOCATION_MZONE, 1, a)
  	end
  	Duel.SetTargetCard(a)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TARGET)
  	local g = Duel.SelectTarget(tp, Card.IsFaceup, tp, 0, LOCATION_MZONE, 1, 1, a)
  	e:SetLabelObject(g:GetFirst())
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = e:GetLabelObject()
  	if tc:IsRelateToEffect(e) and tc:IsFaceup() then
  		if tc:IsDefensePos() then
  			Duel.ChangePosition(tc, POS_FACEUP_ATTACK)
  		end
  		Duel.ChangeAttacker(tc)
  	end
  end
  
  
source_text: Dark
  Activate only when an opponent's monster declares an attack. Negate that attack, and select another face-up monster your opponent controls. That monster attacks instead. (If it is in face-up Defense Position, change it to Attack Position.)
target_text: -- Dark
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return tp ~= Duel.GetTurnPlayer()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return false
  	end
  	local a = Duel.GetAttacker()
  	if chk == 0 then
  		return a and a:IsCanBeEffectTarget(e) and Duel.IsExistingTarget(Card.IsFaceup, tp, 0, LOCATION_MZONE, 1, a)
  	end
  	Duel.SetTargetCard(a)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TARGET)
  	local g = Duel.SelectTarget(tp, Card.IsFaceup, tp, 0, LOCATION_MZONE, 1, 1, a)
  	e:SetLabelObject(g:GetFirst())
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = e:GetLabelObject()
  	if tc:IsRelateToEffect(e) and tc:IsFaceup() then
  		if tc:IsDefensePos() then
  			Duel.ChangePosition(tc, POS_FACEUP_ATTACK)
  		end
  		Duel.ChangeAttacker(tc)
  	end
  end
  
  