name: Magician's
card_text: When a Spellcaster monster declares an attack: Each player Special Summons 1 Spellcaster monster with 2000 or less ATK from their Deck in Attack Position.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_ATTACK_ANNOUNCE)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetAttacker():IsRace(RACE_SPELLCASTER)
  end
  function s.filter(c, e, tp)
  	return c:IsAttackBelow(2000) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP_ATTACK)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_DECK, 0, 1, nil, e, tp) and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.GetLocationCount(1 - tp, LOCATION_MZONE) > 0
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_DECK, 0, 1, 1, nil, e, tp)
  		local tc = g:GetFirst()
  		if tc then
  			Duel.SpecialSummonStep(tc, 0, tp, tp, false, false, POS_FACEUP_ATTACK)
  		end
  	end
  	if Duel.GetLocationCount(1 - tp, LOCATION_MZONE) > 0 then
  		Duel.Hint(HINT_SELECTMSG, 1 - tp, HINTMSG_SPSUMMON)
  		local g = Duel.SelectMatchingCard(1 - tp, s.filter, 1 - tp, LOCATION_DECK, 0, 1, 1, nil, e, 1 - tp)
  		local tc = g:GetFirst()
  		if tc then
  			Duel.SpecialSummonStep(tc, 0, 1 - tp, 1 - tp, false, false, POS_FACEUP_ATTACK)
  		end
  	end
  	Duel.SpecialSummonComplete()
  end
  
  
source_text: Magician's
  When a Spellcaster monster declares an attack: Each player Special Summons 1 Spellcaster monster with 2000 or less ATK from their Deck in Attack Position.
target_text: -- Magician's
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_ATTACK_ANNOUNCE)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetAttacker():IsRace(RACE_SPELLCASTER)
  end
  function s.filter(c, e, tp)
  	return c:IsAttackBelow(2000) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP_ATTACK)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_DECK, 0, 1, nil, e, tp) and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.GetLocationCount(1 - tp, LOCATION_MZONE) > 0
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_DECK, 0, 1, 1, nil, e, tp)
  		local tc = g:GetFirst()
  		if tc then
  			Duel.SpecialSummonStep(tc, 0, tp, tp, false, false, POS_FACEUP_ATTACK)
  		end
  	end
  	if Duel.GetLocationCount(1 - tp, LOCATION_MZONE) > 0 then
  		Duel.Hint(HINT_SELECTMSG, 1 - tp, HINTMSG_SPSUMMON)
  		local g = Duel.SelectMatchingCard(1 - tp, s.filter, 1 - tp, LOCATION_DECK, 0, 1, 1, nil, e, 1 - tp)
  		local tc = g:GetFirst()
  		if tc then
  			Duel.SpecialSummonStep(tc, 0, 1 - tp, 1 - tp, false, false, POS_FACEUP_ATTACK)
  		end
  	end
  	Duel.SpecialSummonComplete()
  end
  
  