name: Synchro
card_text: Your opponent cannot activate cards or effects in response to the effect activations of your Synchro Monsters with "Warrior", "Synchron", or "Stardust" in their original names. If you Synchro Summon a "Warrior", "Synchron", or "Stardust" Synchro Monster: You can target 1 monster in your GY used as its material; Special Summon it in Defense Position. You can only use this effect of "Synchro Chase" once per turn.
external_ids: local SETCARD_ID_0 = 0x66 --Warrior
  
lua: local SETCARD_ID_0 = 0x66 --Warrior
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--spsummon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DELAY)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCountLimit(1, id)
  	e2:SetCondition(s.spcon)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  	--can not chain
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e3:SetCode(EVENT_CHAINING)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetOperation(s.ccop)
  	c:RegisterEffect(e3)
  end
  function s.cfilter(c)
  	return c:IsSummonType(SUMMON_TYPE_SYNCHRO) and c:IsType(TYPE_SYNCHRO) and c:IsSetCard(SETCARD_ID_0, 0x1017, 0xa3)
  end
  function s.spfilter(c, e, tp)
  	return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP_DEFENSE)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return eg:IsExists(s.cfilter, 1, nil) and rp == tp
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	local mg = eg:Filter(s.cfilter, nil):GetFirst():GetMaterial()
  	if chkc then
  		return mg:IsContains(chkc) and s.spfilter(chkc, e, tp)
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and mg:IsExists(s.spfilter, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = mg:FilterSelect(tp, s.spfilter, 1, 1, nil, e, tp)
  	Duel.SetTargetCard(g)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g, 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.SpecialSummon(tc, 0, tp, tp, false, false, POS_FACEUP_DEFENSE)
  	end
  end
  function s.ccop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = re:GetHandler()
  	if ep == tp and re:IsActiveType(TYPE_MONSTER) and tc:IsType(TYPE_SYNCHRO) and tc:IsOriginalSetCard(SETCARD_ID_0, 0x1017, 0xa3) then
  		Duel.SetChainLimit(s.chainlm)
  	end
  end
  function s.chainlm(e, rp, tp)
  	return tp == rp
  end
  
  
source_text: Synchro
  Your opponent cannot activate cards or effects in response to the effect activations of your Synchro Monsters with "Warrior", "Synchron", or "Stardust" in their original names. If you Synchro Summon a "Warrior", "Synchron", or "Stardust" Synchro Monster: You can target 1 monster in your GY used as its material; Special Summon it in Defense Position. You can only use this effect of "Synchro Chase" once per turn.
target_text: -- Synchro
  local SETCARD_ID_0 = 0x66 --Warrior
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--spsummon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DELAY)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCountLimit(1, id)
  	e2:SetCondition(s.spcon)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  	--can not chain
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e3:SetCode(EVENT_CHAINING)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetOperation(s.ccop)
  	c:RegisterEffect(e3)
  end
  function s.cfilter(c)
  	return c:IsSummonType(SUMMON_TYPE_SYNCHRO) and c:IsType(TYPE_SYNCHRO) and c:IsSetCard(SETCARD_ID_0, 0x1017, 0xa3)
  end
  function s.spfilter(c, e, tp)
  	return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP_DEFENSE)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return eg:IsExists(s.cfilter, 1, nil) and rp == tp
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	local mg = eg:Filter(s.cfilter, nil):GetFirst():GetMaterial()
  	if chkc then
  		return mg:IsContains(chkc) and s.spfilter(chkc, e, tp)
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and mg:IsExists(s.spfilter, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = mg:FilterSelect(tp, s.spfilter, 1, 1, nil, e, tp)
  	Duel.SetTargetCard(g)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g, 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.SpecialSummon(tc, 0, tp, tp, false, false, POS_FACEUP_DEFENSE)
  	end
  end
  function s.ccop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = re:GetHandler()
  	if ep == tp and re:IsActiveType(TYPE_MONSTER) and tc:IsType(TYPE_SYNCHRO) and tc:IsOriginalSetCard(SETCARD_ID_0, 0x1017, 0xa3) then
  		Duel.SetChainLimit(s.chainlm)
  	end
  end
  function s.chainlm(e, rp, tp)
  	return tp == rp
  end
  
  