name: Masked
card_text: Once per turn, if you control a "Ninja" monster other than "Masked Ninja Ebisu": You can activate this effect; return Spells/Traps your opponent controls to the hand, equal to the number of "Ninja" monsters you control, also each of your "Goe Goe the Gallant Ninja" can attack directly this turn.
external_ids: local CARD_ID_0 = 10236520 --Goe Goe the Gallant Ninja
  local SETCARD_ID_0 = 0x2b --Ninja
  
lua: local CARD_ID_0 = 10236520 --Goe Goe the Gallant Ninja
  local SETCARD_ID_0 = 0x2b --Ninja
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_TOHAND)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCondition(s.thcon)
  	e1:SetTarget(s.thtg)
  	e1:SetOperation(s.thop)
  	c:RegisterEffect(e1)
  end
  function s.cfilter1(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and not c:IsCode(id)
  end
  function s.cfilter2(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.thcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter1, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.filter(c)
  	return c:IsType(TYPE_SPELL + TYPE_TRAP) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		local ct = Duel.GetMatchingGroupCount(s.cfilter2, tp, LOCATION_MZONE, 0, nil)
  		local dt = Duel.GetMatchingGroupCount(s.filter, tp, 0, LOCATION_ONFIELD, nil)
  		e:SetLabel(ct)
  		return dt >= ct
  	end
  	local g = Duel.GetMatchingGroup(s.filter, tp, 0, LOCATION_ONFIELD, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, e:GetLabel(), 0, 0)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	local ct = Duel.GetMatchingGroupCount(s.cfilter2, tp, LOCATION_MZONE, 0, nil)
  	local g = Duel.GetMatchingGroup(s.filter, tp, 0, LOCATION_ONFIELD, nil)
  	if ct > g:GetCount() then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RTOHAND)
  	local sg = g:Select(tp, ct, ct, nil)
  	Duel.SendtoHand(sg, nil, REASON_EFFECT)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_DIRECT_ATTACK)
  	e1:SetTargetRange(LOCATION_MZONE, 0)
  	e1:SetTarget(aux.TargetBoolFunction(Card.IsCode, CARD_ID_0))
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  end
  
  
source_text: Masked
  Once per turn, if you control a "Ninja" monster other than "Masked Ninja Ebisu": You can activate this effect; return Spells/Traps your opponent controls to the hand, equal to the number of "Ninja" monsters you control, also each of your "Goe Goe the Gallant Ninja" can attack directly this turn.
target_text: -- Masked
  local CARD_ID_0 = 10236520 --Goe Goe the Gallant Ninja
  local SETCARD_ID_0 = 0x2b --Ninja
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_TOHAND)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCondition(s.thcon)
  	e1:SetTarget(s.thtg)
  	e1:SetOperation(s.thop)
  	c:RegisterEffect(e1)
  end
  function s.cfilter1(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and not c:IsCode(id)
  end
  function s.cfilter2(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.thcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter1, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.filter(c)
  	return c:IsType(TYPE_SPELL + TYPE_TRAP) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		local ct = Duel.GetMatchingGroupCount(s.cfilter2, tp, LOCATION_MZONE, 0, nil)
  		local dt = Duel.GetMatchingGroupCount(s.filter, tp, 0, LOCATION_ONFIELD, nil)
  		e:SetLabel(ct)
  		return dt >= ct
  	end
  	local g = Duel.GetMatchingGroup(s.filter, tp, 0, LOCATION_ONFIELD, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, e:GetLabel(), 0, 0)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	local ct = Duel.GetMatchingGroupCount(s.cfilter2, tp, LOCATION_MZONE, 0, nil)
  	local g = Duel.GetMatchingGroup(s.filter, tp, 0, LOCATION_ONFIELD, nil)
  	if ct > g:GetCount() then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RTOHAND)
  	local sg = g:Select(tp, ct, ct, nil)
  	Duel.SendtoHand(sg, nil, REASON_EFFECT)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_DIRECT_ATTACK)
  	e1:SetTargetRange(LOCATION_MZONE, 0)
  	e1:SetTarget(aux.TargetBoolFunction(Card.IsCode, CARD_ID_0))
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  end
  
  