name: Altergeist
card_text: Monsters your opponent controls cannot target "Altergeist" monsters you control for attacks, except "Altergeist Fifinellag", also your opponent cannot target "Altergeist" monsters you control with card effects, except "Altergeist Fifinellag".
external_ids: local SETCARD_ID_0 = 0x103 --Altergeist
  
lua: local SETCARD_ID_0 = 0x103 --Altergeist
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--can't be target
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(0, LOCATION_MZONE)
  	e1:SetValue(s.atlimit)
  	c:RegisterEffect(e1)
  	--
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  	e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(LOCATION_MZONE, 0)
  	e2:SetTarget(s.tglimit)
  	e2:SetValue(aux.tgoval)
  	c:RegisterEffect(e2)
  end
  function s.atlimit(e, c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and not c:IsCode(id)
  end
  function s.tglimit(e, c)
  	return c:IsSetCard(SETCARD_ID_0) and not c:IsCode(id)
  end
  
  
source_text: Altergeist
  Monsters your opponent controls cannot target "Altergeist" monsters you control for attacks, except "Altergeist Fifinellag", also your opponent cannot target "Altergeist" monsters you control with card effects, except "Altergeist Fifinellag".
target_text: -- Altergeist
  local SETCARD_ID_0 = 0x103 --Altergeist
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--can't be target
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(0, LOCATION_MZONE)
  	e1:SetValue(s.atlimit)
  	c:RegisterEffect(e1)
  	--
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  	e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(LOCATION_MZONE, 0)
  	e2:SetTarget(s.tglimit)
  	e2:SetValue(aux.tgoval)
  	c:RegisterEffect(e2)
  end
  function s.atlimit(e, c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and not c:IsCode(id)
  end
  function s.tglimit(e, c)
  	return c:IsSetCard(SETCARD_ID_0) and not c:IsCode(id)
  end
  
  