name: Defense
card_text: For each monster a player controls in their Main Monster Zone, their Spells/Traps in the same column as that monster cannot be destroyed by their opponent's card effects, and their opponent cannot target them with card effects.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e0 = Effect.CreateEffect(c)
  	e0:SetType(EFFECT_TYPE_ACTIVATE)
  	e0:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e0)
  	--cannot be target/indestructable
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  	e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE + EFFECT_FLAG_SET_AVAILABLE)
  	e1:SetRange(LOCATION_FZONE)
  	e1:SetTargetRange(LOCATION_SZONE, 0)
  	e1:SetTarget(s.tgtg)
  	e1:SetValue(aux.tgoval)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e2:SetValue(aux.indoval)
  	c:RegisterEffect(e2)
  	local e3 = e1:Clone()
  	e3:SetTargetRange(0, LOCATION_SZONE)
  	e3:SetValue(aux.tgsval)
  	c:RegisterEffect(e3)
  	local e4 = e3:Clone()
  	e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e4:SetValue(aux.indsval)
  	c:RegisterEffect(e4)
  end
  function s.tgfilter(c, tp)
  	return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence() < 5
  end
  function s.tgtg(e, c)
  	return c:GetSequence() < 5 and c:GetColumnGroup():FilterCount(s.tgfilter, nil, c:GetControler()) > 0
  end
  
  
source_text: Defense
  For each monster a player controls in their Main Monster Zone, their Spells/Traps in the same column as that monster cannot be destroyed by their opponent's card effects, and their opponent cannot target them with card effects.
target_text: -- Defense
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e0 = Effect.CreateEffect(c)
  	e0:SetType(EFFECT_TYPE_ACTIVATE)
  	e0:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e0)
  	--cannot be target/indestructable
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  	e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE + EFFECT_FLAG_SET_AVAILABLE)
  	e1:SetRange(LOCATION_FZONE)
  	e1:SetTargetRange(LOCATION_SZONE, 0)
  	e1:SetTarget(s.tgtg)
  	e1:SetValue(aux.tgoval)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e2:SetValue(aux.indoval)
  	c:RegisterEffect(e2)
  	local e3 = e1:Clone()
  	e3:SetTargetRange(0, LOCATION_SZONE)
  	e3:SetValue(aux.tgsval)
  	c:RegisterEffect(e3)
  	local e4 = e3:Clone()
  	e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e4:SetValue(aux.indsval)
  	c:RegisterEffect(e4)
  end
  function s.tgfilter(c, tp)
  	return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence() < 5
  end
  function s.tgtg(e, c)
  	return c:GetSequence() < 5 and c:GetColumnGroup():FilterCount(s.tgfilter, nil, c:GetControler()) > 0
  end
  
  