name: Fabled
card_text: If your opponent has 2 or more cards in their hand than you do: You can reveal 1 "Fabled" monster in your hand and Tribute this face-up card, then target 2 Spell/Trap Cards your opponent controls; destroy those targets.
external_ids: local SETCARD_ID_0 = 0x35 --Fabled
  
lua: local SETCARD_ID_0 = 0x35 --Fabled
  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_DESTROY)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCondition(s.con)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.tg)
  	e1:SetOperation(s.op)
  	c:RegisterEffect(e1)
  end
  function s.con(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND) - Duel.GetFieldGroupCount(tp, LOCATION_HAND, 0) >= 2
  end
  function s.cfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsReleasable() and Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_HAND, 0, 1, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CONFIRM)
  	local g = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_HAND, 0, 1, 1, e:GetHandler())
  	Duel.ConfirmCards(1 - tp, g)
  	Duel.Release(e:GetHandler(), REASON_COST)
  	Duel.ShuffleHand(tp)
  end
  function s.filter(c)
  	return c:IsType(TYPE_SPELL + TYPE_TRAP)
  end
  function s.tg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsOnField() and chkc:IsControler(1 - tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, 0, LOCATION_ONFIELD, 2, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_ONFIELD, 2, 2, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 2, 0, 0)
  end
  function s.op(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS)
  	local sg = g:Filter(Card.IsRelateToEffect, nil, e)
  	if sg:GetCount() > 0 then
  		Duel.Destroy(sg, REASON_EFFECT)
  	end
  end
  
  
source_text: Fabled
  If your opponent has 2 or more cards in their hand than you do: You can reveal 1 "Fabled" monster in your hand and Tribute this face-up card, then target 2 Spell/Trap Cards your opponent controls; destroy those targets.
target_text: -- Fabled
  local SETCARD_ID_0 = 0x35 --Fabled
  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_DESTROY)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCondition(s.con)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.tg)
  	e1:SetOperation(s.op)
  	c:RegisterEffect(e1)
  end
  function s.con(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND) - Duel.GetFieldGroupCount(tp, LOCATION_HAND, 0) >= 2
  end
  function s.cfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsReleasable() and Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_HAND, 0, 1, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CONFIRM)
  	local g = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_HAND, 0, 1, 1, e:GetHandler())
  	Duel.ConfirmCards(1 - tp, g)
  	Duel.Release(e:GetHandler(), REASON_COST)
  	Duel.ShuffleHand(tp)
  end
  function s.filter(c)
  	return c:IsType(TYPE_SPELL + TYPE_TRAP)
  end
  function s.tg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsOnField() and chkc:IsControler(1 - tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, 0, LOCATION_ONFIELD, 2, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_ONFIELD, 2, 2, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 2, 0, 0)
  end
  function s.op(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS)
  	local sg = g:Filter(Card.IsRelateToEffect, nil, e)
  	if sg:GetCount() > 0 then
  		Duel.Destroy(sg, REASON_EFFECT)
  	end
  end
  
  