name: Desert
card_text: 1 Tuner + 1+ non-Tuner monsters
  If this card is Synchro Summoned: The turn player discards 1 card. You can only use this effect of "Desert Locusts" once per turn. Once per Chain, during your opponent's Main Phase, you can (Quick Effect): Immediately after this effect resolves, Synchro Summon using this card you control.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--synchro summon
  	c:EnableReviveLimit()
  	aux.AddSynchroProcedure(c, nil, aux.NonTuner(nil), 1)
  	--discard
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_HANDES)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.diccon)
  	e1:SetTarget(s.dictg)
  	e1:SetOperation(s.dicop)
  	c:RegisterEffect(e1)
  	--synchro summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetHintTiming(0, TIMINGS_CHECK_MONSTER + TIMING_MAIN_END)
  	e2:SetCountLimit(1, EFFECT_COUNT_CODE_CHAIN)
  	e2:SetCondition(s.sscon)
  	e2:SetTarget(s.sstg)
  	e2:SetOperation(s.ssop)
  	c:RegisterEffect(e2)
  end
  function s.diccon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
  end
  function s.dictg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetParam(1)
  	Duel.SetOperationInfo(0, CATEGORY_HANDES, nil, 0, Duel.GetTurnPlayer(), 1)
  end
  function s.dicop(e, tp, eg, ep, ev, re, r, rp)
  	local p = Duel.GetTurnPlayer()
  	local d = Duel.GetChainInfo(0, CHAININFO_TARGET_PARAM)
  	local g = Duel.GetFieldGroup(p, LOCATION_HAND, 0)
  	if g:GetCount() > 0 then
  		Duel.Hint(HINT_SELECTMSG, p, HINTMSG_DISCARD)
  		local sg = g:Select(p, 1, 1, nil)
  		Duel.SendtoGrave(sg, REASON_EFFECT + REASON_DISCARD)
  	end
  end
  function s.sscon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() ~= tp and (Duel.GetCurrentPhase() == PHASE_MAIN1 or Duel.GetCurrentPhase() == PHASE_MAIN2)
  end
  function s.sstg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable, tp, LOCATION_EXTRA, 0, 1, nil, c)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_EXTRA)
  end
  function s.ssop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsControler(1 - tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then
  		return
  	end
  	local g = Duel.GetMatchingGroup(Card.IsSynchroSummonable, tp, LOCATION_EXTRA, 0, nil, c)
  	if g:GetCount() > 0 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local sg = g:Select(tp, 1, 1, nil)
  		Duel.SynchroSummon(tp, sg:GetFirst(), c)
  	end
  end
  
  
source_text: Desert
  1 Tuner + 1+ non-Tuner monsters
  If this card is Synchro Summoned: The turn player discards 1 card. You can only use this effect of "Desert Locusts" once per turn. Once per Chain, during your opponent's Main Phase, you can (Quick Effect): Immediately after this effect resolves, Synchro Summon using this card you control.
target_text: -- Desert
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--synchro summon
  	c:EnableReviveLimit()
  	aux.AddSynchroProcedure(c, nil, aux.NonTuner(nil), 1)
  	--discard
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_HANDES)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.diccon)
  	e1:SetTarget(s.dictg)
  	e1:SetOperation(s.dicop)
  	c:RegisterEffect(e1)
  	--synchro summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetHintTiming(0, TIMINGS_CHECK_MONSTER + TIMING_MAIN_END)
  	e2:SetCountLimit(1, EFFECT_COUNT_CODE_CHAIN)
  	e2:SetCondition(s.sscon)
  	e2:SetTarget(s.sstg)
  	e2:SetOperation(s.ssop)
  	c:RegisterEffect(e2)
  end
  function s.diccon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
  end
  function s.dictg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetParam(1)
  	Duel.SetOperationInfo(0, CATEGORY_HANDES, nil, 0, Duel.GetTurnPlayer(), 1)
  end
  function s.dicop(e, tp, eg, ep, ev, re, r, rp)
  	local p = Duel.GetTurnPlayer()
  	local d = Duel.GetChainInfo(0, CHAININFO_TARGET_PARAM)
  	local g = Duel.GetFieldGroup(p, LOCATION_HAND, 0)
  	if g:GetCount() > 0 then
  		Duel.Hint(HINT_SELECTMSG, p, HINTMSG_DISCARD)
  		local sg = g:Select(p, 1, 1, nil)
  		Duel.SendtoGrave(sg, REASON_EFFECT + REASON_DISCARD)
  	end
  end
  function s.sscon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() ~= tp and (Duel.GetCurrentPhase() == PHASE_MAIN1 or Duel.GetCurrentPhase() == PHASE_MAIN2)
  end
  function s.sstg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable, tp, LOCATION_EXTRA, 0, 1, nil, c)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_EXTRA)
  end
  function s.ssop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsControler(1 - tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then
  		return
  	end
  	local g = Duel.GetMatchingGroup(Card.IsSynchroSummonable, tp, LOCATION_EXTRA, 0, nil, c)
  	if g:GetCount() > 0 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local sg = g:Select(tp, 1, 1, nil)
  		Duel.SynchroSummon(tp, sg:GetFirst(), c)
  	end
  end
  
  