name: And
card_text: Neither player can Special Summon monsters with the same Level as those they control. Neither player can Special Summon monsters with the same Rank as those they control.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--adjust
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  	e2:SetCode(EVENT_ADJUST)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetOperation(s.adjustop)
  	c:RegisterEffect(e2)
  	--disable spsummon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e3:SetTargetRange(1, 1)
  	e3:SetTarget(s.splimit)
  	c:RegisterEffect(e3)
  	local g = Group.CreateGroup()
  	g:KeepAlive()
  	e2:SetLabelObject(g)
  	e3:SetLabelObject(g)
  end
  function s.lvfilter(c, lv, tp)
  	return c:IsLevel(lv) and c:IsControler(tp)
  end
  function s.rkfilter(c, rk, tp)
  	return c:IsRank(rk) and c:IsControler(tp)
  end
  function s.splimit(e, c, sump, sumtype, sumpos, targetp)
  	local lv = c:GetLevel()
  	local rk = c:GetRank()
  	if lv > 0 then
  		return e:GetLabelObject():IsExists(s.lvfilter, 1, nil, lv, sump)
  	elseif rk > 0 then
  		return e:GetLabelObject():IsExists(s.rkfilter, 1, nil, rk, sump)
  	else
  		return false
  	end
  end
  function s.adjustop(e, tp, eg, ep, ev, re, r, rp)
  	local phase = Duel.GetCurrentPhase()
  	if (phase == PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase == PHASE_DAMAGE_CAL then
  		return
  	end
  	local g = Duel.GetMatchingGroup(Card.IsFaceup, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
  	e:GetLabelObject():Clear()
  	e:GetLabelObject():Merge(g)
  end
  
  
source_text: And
  Neither player can Special Summon monsters with the same Level as those they control. Neither player can Special Summon monsters with the same Rank as those they control.
target_text: -- And
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--adjust
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  	e2:SetCode(EVENT_ADJUST)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetOperation(s.adjustop)
  	c:RegisterEffect(e2)
  	--disable spsummon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e3:SetTargetRange(1, 1)
  	e3:SetTarget(s.splimit)
  	c:RegisterEffect(e3)
  	local g = Group.CreateGroup()
  	g:KeepAlive()
  	e2:SetLabelObject(g)
  	e3:SetLabelObject(g)
  end
  function s.lvfilter(c, lv, tp)
  	return c:IsLevel(lv) and c:IsControler(tp)
  end
  function s.rkfilter(c, rk, tp)
  	return c:IsRank(rk) and c:IsControler(tp)
  end
  function s.splimit(e, c, sump, sumtype, sumpos, targetp)
  	local lv = c:GetLevel()
  	local rk = c:GetRank()
  	if lv > 0 then
  		return e:GetLabelObject():IsExists(s.lvfilter, 1, nil, lv, sump)
  	elseif rk > 0 then
  		return e:GetLabelObject():IsExists(s.rkfilter, 1, nil, rk, sump)
  	else
  		return false
  	end
  end
  function s.adjustop(e, tp, eg, ep, ev, re, r, rp)
  	local phase = Duel.GetCurrentPhase()
  	if (phase == PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase == PHASE_DAMAGE_CAL then
  		return
  	end
  	local g = Duel.GetMatchingGroup(Card.IsFaceup, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
  	e:GetLabelObject():Clear()
  	e:GetLabelObject():Merge(g)
  end
  
  