name: Generaider
card_text: Reveal 1 "Generaider" monster in your hand, and if you do, add up to 2 "Generaider" Spells/Traps with different names from each other from your Deck to your hand, except "Generaider Boss Quest". Then place the revealed card on the bottom of your Deck. You can only activate 1 "Generaider Boss Quest" per turn.
external_ids: local SETCARD_ID_0 = 0x134 --Generaider
  
lua: local SETCARD_ID_0 = 0x134 --Generaider
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SEARCH + CATEGORY_TOHAND + CATEGORY_TODECK)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter1(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() and not c:IsPublic()
  end
  function s.filter2(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_SPELL + TYPE_TRAP) and not c:IsCode(id) and c:IsAbleToHand()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter1, tp, LOCATION_HAND, 0, 1, nil) and Duel.IsExistingMatchingCard(s.filter2, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TODECK, nil, 1, tp, LOCATION_HAND)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
  	local g1 = Duel.SelectMatchingCard(tp, s.filter1, tp, LOCATION_HAND, 0, 1, 1, nil)
  	Duel.ConfirmCards(1 - tp, g1)
  	if g1:GetCount() == 0 then
  		return
  	end
  	local g2 = Duel.GetMatchingGroup(s.filter2, tp, LOCATION_DECK, 0, nil)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local sg = g2:SelectSubGroup(tp, aux.dncheck, false, 1, 2)
  	if sg and Duel.SendtoHand(sg, nil, REASON_EFFECT) ~= 0 then
  		Duel.ConfirmCards(1 - tp, sg)
  		Duel.ShuffleDeck(tp)
  		Duel.BreakEffect()
  		Duel.SendtoDeck(g1, nil, SEQ_DECKBOTTOM, REASON_EFFECT)
  	end
  end
  
  
source_text: Generaider
  Reveal 1 "Generaider" monster in your hand, and if you do, add up to 2 "Generaider" Spells/Traps with different names from each other from your Deck to your hand, except "Generaider Boss Quest". Then place the revealed card on the bottom of your Deck. You can only activate 1 "Generaider Boss Quest" per turn.
target_text: -- Generaider
  local SETCARD_ID_0 = 0x134 --Generaider
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SEARCH + CATEGORY_TOHAND + CATEGORY_TODECK)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter1(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() and not c:IsPublic()
  end
  function s.filter2(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_SPELL + TYPE_TRAP) and not c:IsCode(id) and c:IsAbleToHand()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter1, tp, LOCATION_HAND, 0, 1, nil) and Duel.IsExistingMatchingCard(s.filter2, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TODECK, nil, 1, tp, LOCATION_HAND)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
  	local g1 = Duel.SelectMatchingCard(tp, s.filter1, tp, LOCATION_HAND, 0, 1, 1, nil)
  	Duel.ConfirmCards(1 - tp, g1)
  	if g1:GetCount() == 0 then
  		return
  	end
  	local g2 = Duel.GetMatchingGroup(s.filter2, tp, LOCATION_DECK, 0, nil)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local sg = g2:SelectSubGroup(tp, aux.dncheck, false, 1, 2)
  	if sg and Duel.SendtoHand(sg, nil, REASON_EFFECT) ~= 0 then
  		Duel.ConfirmCards(1 - tp, sg)
  		Duel.ShuffleDeck(tp)
  		Duel.BreakEffect()
  		Duel.SendtoDeck(g1, nil, SEQ_DECKBOTTOM, REASON_EFFECT)
  	end
  end
  
  