name: Infestation
card_text: All face-up "lswarm" monsters you currently control are unaffected by other Spell/Trap effects this turn.
external_ids: local SETCARD_ID_0 = 0xa --lswarm
  
lua: local SETCARD_ID_0 = 0xa --lswarm
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--immune
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, nil)
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, 0, nil)
  	local tc = g:GetFirst()
  	while tc do
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  		e1:SetRange(LOCATION_MZONE)
  		e1:SetCode(EFFECT_IMMUNE_EFFECT)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		e1:SetValue(s.efilter)
  		tc:RegisterEffect(e1)
  		tc = g:GetNext()
  	end
  end
  function s.efilter(e, te)
  	return te:IsActiveType(TYPE_SPELL + TYPE_TRAP) and te:GetOwner() ~= e:GetOwner()
  end
  
  
source_text: Infestation
  All face-up "lswarm" monsters you currently control are unaffected by other Spell/Trap effects this turn.
target_text: -- Infestation
  local SETCARD_ID_0 = 0xa --lswarm
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--immune
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, nil)
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, 0, nil)
  	local tc = g:GetFirst()
  	while tc do
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  		e1:SetRange(LOCATION_MZONE)
  		e1:SetCode(EFFECT_IMMUNE_EFFECT)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		e1:SetValue(s.efilter)
  		tc:RegisterEffect(e1)
  		tc = g:GetNext()
  	end
  end
  function s.efilter(e, te)
  	return te:IsActiveType(TYPE_SPELL + TYPE_TRAP) and te:GetOwner() ~= e:GetOwner()
  end
  
  