name: Scrap-Iron
card_text: When your opponent activates a monster effect, while you control a Synchro Monster that mentions a Synchro Monster as material: Negate the activation, also, after that, Set this card face-down instead of sending it to the GY. You can only activate 1 "Scrap-Iron Signal" per turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_NEGATE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsType(TYPE_SYNCHRO) and aux.IsMaterialListType(c, TYPE_SYNCHRO) and c:IsFaceup()
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, nil) and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev) and rp == 1 - tp
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_NEGATE, eg, 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	Duel.NegateActivation(ev)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and c:IsCanTurnSet() then
  		Duel.BreakEffect()
  		c:CancelToGrave()
  		Duel.ChangePosition(c, POS_FACEDOWN)
  		Duel.RaiseEvent(c, EVENT_SSET, e, REASON_EFFECT, tp, tp, 0)
  	end
  end
  
  
source_text: Scrap-Iron
  When your opponent activates a monster effect, while you control a Synchro Monster that mentions a Synchro Monster as material: Negate the activation, also, after that, Set this card face-down instead of sending it to the GY. You can only activate 1 "Scrap-Iron Signal" per turn.
target_text: -- Scrap-Iron
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_NEGATE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsType(TYPE_SYNCHRO) and aux.IsMaterialListType(c, TYPE_SYNCHRO) and c:IsFaceup()
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, nil) and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev) and rp == 1 - tp
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_NEGATE, eg, 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	Duel.NegateActivation(ev)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and c:IsCanTurnSet() then
  		Duel.BreakEffect()
  		c:CancelToGrave()
  		Duel.ChangePosition(c, POS_FACEDOWN)
  		Duel.RaiseEvent(c, EVENT_SSET, e, REASON_EFFECT, tp, tp, 0)
  	end
  end
  
  