name: Astral
card_text: If your opponent's monster attacks a monster you control: You can make the attack a direct attack instead.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--target change
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e2:SetCode(EVENT_ATTACK_ANNOUNCE)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCondition(s.atkcon)
  	e2:SetTarget(s.atktg)
  	e2:SetOperation(s.atkop)
  	c:RegisterEffect(e2)
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	local a = Duel.GetAttacker()
  	local at = Duel.GetAttackTarget()
  	return a:IsControler(1 - tp) and at and at:IsControler(tp)
  end
  function s.atktg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return not Duel.GetAttacker():IsHasEffect(EFFECT_CANNOT_DIRECT_ATTACK)
  	end
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.ChangeAttackTarget(nil)
  end
  
  
source_text: Astral
  If your opponent's monster attacks a monster you control: You can make the attack a direct attack instead.
target_text: -- Astral
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--target change
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e2:SetCode(EVENT_ATTACK_ANNOUNCE)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCondition(s.atkcon)
  	e2:SetTarget(s.atktg)
  	e2:SetOperation(s.atkop)
  	c:RegisterEffect(e2)
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	local a = Duel.GetAttacker()
  	local at = Duel.GetAttackTarget()
  	return a:IsControler(1 - tp) and at and at:IsControler(tp)
  end
  function s.atktg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return not Duel.GetAttacker():IsHasEffect(EFFECT_CANNOT_DIRECT_ATTACK)
  	end
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.ChangeAttackTarget(nil)
  end
  
  