name: Tyr
card_text: Your opponent's monsters cannot target "Nordic" monsters for attacks, except "Tyr of the Nordic Champions". If there is no other "Nordic" monster on the field, destroy this card.
external_ids: local SETCARD_ID_0 = 0x42 --Nordic
  
lua: local SETCARD_ID_0 = 0x42 --Nordic
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--self destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCode(EFFECT_SELF_DESTROY)
  	e1:SetCondition(s.descon)
  	c:RegisterEffect(e1)
  	--battle target
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(0, LOCATION_MZONE)
  	e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
  	e2:SetValue(s.atlimit)
  	c:RegisterEffect(e2)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.descon(e)
  	return not Duel.IsExistingMatchingCard(s.filter, 0, LOCATION_MZONE, LOCATION_MZONE, 1, e:GetHandler())
  end
  function s.atlimit(e, c)
  	return c:IsFaceup() and not c:IsCode(id) and c:IsSetCard(SETCARD_ID_0)
  end
  
  
source_text: Tyr
  Your opponent's monsters cannot target "Nordic" monsters for attacks, except "Tyr of the Nordic Champions". If there is no other "Nordic" monster on the field, destroy this card.
target_text: -- Tyr
  local SETCARD_ID_0 = 0x42 --Nordic
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--self destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCode(EFFECT_SELF_DESTROY)
  	e1:SetCondition(s.descon)
  	c:RegisterEffect(e1)
  	--battle target
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(0, LOCATION_MZONE)
  	e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
  	e2:SetValue(s.atlimit)
  	c:RegisterEffect(e2)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.descon(e)
  	return not Duel.IsExistingMatchingCard(s.filter, 0, LOCATION_MZONE, LOCATION_MZONE, 1, e:GetHandler())
  end
  function s.atlimit(e, c)
  	return c:IsFaceup() and not c:IsCode(id) and c:IsSetCard(SETCARD_ID_0)
  end
  
  