name: Silent
card_text: During the Battle Phase, if you control a "Silent Magician" monster, and have more cards in your hand than your opponent: Each player draws until they have 6 cards in their hand. This card's activation and effect cannot be negated. You can banish this card from your Graveyard; add 1 "Silent Magician" monster from your Deck to your hand.
external_ids: local SETCARD_ID_0 = 0xe8 --Silent
  
lua: local SETCARD_ID_0 = 0xe8 --Silent
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DRAW)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_CAN_FORBIDDEN)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--to hand
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_GRAVE)
  	e2:SetCost(aux.bfgcost)
  	e2:SetTarget(s.thtg)
  	e2:SetOperation(s.thop)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local ct1 = Duel.GetFieldGroupCount(tp, LOCATION_HAND, 0)
  	local ct2 = Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND)
  	local ph = Duel.GetCurrentPhase()
  	return ct1 > ct2 and ph >= PHASE_BATTLE_START and ph <= PHASE_BATTLE and Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local ct1 = 6 - Duel.GetFieldGroupCount(tp, LOCATION_HAND, 0)
  	local ct2 = 6 - Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND)
  	if chk == 0 then
  		return ct1 > 0 and Duel.IsPlayerCanDraw(tp, ct1) and ct2 > 0 and Duel.IsPlayerCanDraw(1 - tp, ct2)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, ct1)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, 1 - tp, ct2)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local ct1 = 6 - Duel.GetFieldGroupCount(tp, LOCATION_HAND, 0)
  	local ct2 = 6 - Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND)
  	if ct1 > 0 then
  		Duel.Draw(tp, ct1, REASON_EFFECT)
  	end
  	if ct2 > 0 then
  		Duel.Draw(1 - tp, ct2, REASON_EFFECT)
  	end
  end
  function s.thfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.thfilter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectMatchingCard(tp, s.thfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  	if g:GetCount() > 0 then
  		Duel.SendtoHand(g, nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, g)
  	end
  end
  
  
source_text: Silent
  During the Battle Phase, if you control a "Silent Magician" monster, and have more cards in your hand than your opponent: Each player draws until they have 6 cards in their hand. This card's activation and effect cannot be negated. You can banish this card from your Graveyard; add 1 "Silent Magician" monster from your Deck to your hand.
target_text: -- Silent
  local SETCARD_ID_0 = 0xe8 --Silent
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DRAW)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_CAN_FORBIDDEN)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--to hand
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_GRAVE)
  	e2:SetCost(aux.bfgcost)
  	e2:SetTarget(s.thtg)
  	e2:SetOperation(s.thop)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local ct1 = Duel.GetFieldGroupCount(tp, LOCATION_HAND, 0)
  	local ct2 = Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND)
  	local ph = Duel.GetCurrentPhase()
  	return ct1 > ct2 and ph >= PHASE_BATTLE_START and ph <= PHASE_BATTLE and Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local ct1 = 6 - Duel.GetFieldGroupCount(tp, LOCATION_HAND, 0)
  	local ct2 = 6 - Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND)
  	if chk == 0 then
  		return ct1 > 0 and Duel.IsPlayerCanDraw(tp, ct1) and ct2 > 0 and Duel.IsPlayerCanDraw(1 - tp, ct2)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, ct1)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, 1 - tp, ct2)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local ct1 = 6 - Duel.GetFieldGroupCount(tp, LOCATION_HAND, 0)
  	local ct2 = 6 - Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND)
  	if ct1 > 0 then
  		Duel.Draw(tp, ct1, REASON_EFFECT)
  	end
  	if ct2 > 0 then
  		Duel.Draw(1 - tp, ct2, REASON_EFFECT)
  	end
  end
  function s.thfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.thfilter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectMatchingCard(tp, s.thfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  	if g:GetCount() > 0 then
  		Duel.SendtoHand(g, nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, g)
  	end
  end
  
  