name: Fortress
card_text: You take no battle damage from attacks involving this card. Once per turn, this card cannot be destroyed by battle.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--battle indes
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
  	e1:SetCountLimit(1)
  	e1:SetValue(s.valcon)
  	c:RegisterEffect(e1)
  	--
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
  	e2:SetValue(1)
  	c:RegisterEffect(e2)
  end
  function s.valcon(e, re, r, rp)
  	return bit.band(r, REASON_BATTLE) ~= 0
  end
  
  
source_text: Fortress
  You take no battle damage from attacks involving this card. Once per turn, this card cannot be destroyed by battle.
target_text: -- Fortress
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--battle indes
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
  	e1:SetCountLimit(1)
  	e1:SetValue(s.valcon)
  	c:RegisterEffect(e1)
  	--
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
  	e2:SetValue(1)
  	c:RegisterEffect(e2)
  end
  function s.valcon(e, re, r, rp)
  	return bit.band(r, REASON_BATTLE) ~= 0
  end
  
  