name: XX-Saber
card_text: 1 Tuner + 1+ EARTH monsters
  You can Tribute 1 "X-Saber" monster; discard 1 random card from your opponent's hand.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--synchro summon
  	aux.AddSynchroMixProcedure(c, aux.Tuner(nil), nil, nil, aux.FilterBoolFunction(Card.IsAttribute, ATTRIBUTE_EARTH), 1, 99)
  	c:EnableReviveLimit()
  	--handes
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_HANDES)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--double tuner check
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_MATERIAL_CHECK)
  	e2:SetValue(s.valcheck)
  	c:RegisterEffect(e2)
  end
  function s.valcheck(e, c)
  	local g = c:GetMaterial()
  	if g:IsExists(Card.IsType, 2, nil, TYPE_TUNER) then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  		e1:SetCode(21142671)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD - RESET_TOFIELD + RESET_PHASE + PHASE_END)
  		c:RegisterEffect(e1)
  	end
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckReleaseGroup(tp, Card.IsSetCard, 1, nil, 0x100d)
  	end
  	local g = Duel.SelectReleaseGroup(tp, Card.IsSetCard, 1, 1, nil, 0x100d)
  	Duel.Release(g, REASON_COST)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND) > 0
  	end
  	Duel.SetOperationInfo(0, CATEGORY_HANDES, nil, 0, 1 - tp, 1)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetFieldGroup(1 - tp, LOCATION_HAND, 0)
  	local sg = g:RandomSelect(1 - tp, 1)
  	Duel.SendtoGrave(sg, REASON_DISCARD + REASON_EFFECT)
  end
  
  
source_text: XX-Saber
  1 Tuner + 1+ EARTH monsters
  You can Tribute 1 "X-Saber" monster; discard 1 random card from your opponent's hand.
target_text: -- XX-Saber
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--synchro summon
  	aux.AddSynchroMixProcedure(c, aux.Tuner(nil), nil, nil, aux.FilterBoolFunction(Card.IsAttribute, ATTRIBUTE_EARTH), 1, 99)
  	c:EnableReviveLimit()
  	--handes
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_HANDES)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--double tuner check
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_MATERIAL_CHECK)
  	e2:SetValue(s.valcheck)
  	c:RegisterEffect(e2)
  end
  function s.valcheck(e, c)
  	local g = c:GetMaterial()
  	if g:IsExists(Card.IsType, 2, nil, TYPE_TUNER) then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  		e1:SetCode(21142671)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD - RESET_TOFIELD + RESET_PHASE + PHASE_END)
  		c:RegisterEffect(e1)
  	end
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckReleaseGroup(tp, Card.IsSetCard, 1, nil, 0x100d)
  	end
  	local g = Duel.SelectReleaseGroup(tp, Card.IsSetCard, 1, 1, nil, 0x100d)
  	Duel.Release(g, REASON_COST)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetFieldGroupCount(tp, 0, LOCATION_HAND) > 0
  	end
  	Duel.SetOperationInfo(0, CATEGORY_HANDES, nil, 0, 1 - tp, 1)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetFieldGroup(1 - tp, LOCATION_HAND, 0)
  	local sg = g:RandomSelect(1 - tp, 1)
  	Duel.SendtoGrave(sg, REASON_DISCARD + REASON_EFFECT)
  end
  
  