name: Fake
card_text: You can only activate this card when your opponent uses an effect of a Spell, Trap, or Effect Monster to destroy Trap Card(s) on your side of the field. Destroy this card as a substitute of those Trap Card(s) and the other Trap Card(s) are not destroyed. If a Set card(s) would have been destroyed, pick up and see the Set card(s).
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c, tp)
  	return c:IsType(TYPE_TRAP) and c:IsLocation(LOCATION_SZONE) and c:IsControler(tp)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	if rp == tp then
  		return false
  	end
  	local ex, tg, tc = Duel.GetOperationInfo(ev, CATEGORY_DESTROY)
  	if ex and tg ~= nil and tg:GetCount() == tc and tg:IsExists(s.cfilter, 1, e:GetHandler(), tp) then
  		e:SetLabelObject(re)
  		return true
  	else
  		return false
  	end
  end
  function s.cffilter(c, tp)
  	return c:IsFacedown() and c:IsControler(tp)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:IsHasType(EFFECT_TYPE_ACTIVATE)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, e:GetHandler(), 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_FIELD)
  		e1:SetCode(EFFECT_DESTROY_REPLACE)
  		e1:SetRange(LOCATION_SZONE)
  		e1:SetTarget(s.reptg)
  		e1:SetValue(s.repvalue)
  		e1:SetOperation(s.repop)
  		e1:SetLabelObject(e:GetLabelObject())
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		c:RegisterEffect(e1)
  	end
  end
  function s.repfilter(c, tp)
  	return s.cfilter(c, tp) and not c:IsReason(REASON_REPLACE)
  end
  function s.reptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return re == e:GetLabelObject() and eg:IsExists(s.repfilter, 1, c, tp)
  	end
  	local sg = eg:Filter(s.repfilter, c, tp)
  	local fg = sg:Filter(s.cffilter, nil, tp)
  	if fg:GetCount() > 0 then
  		Duel.ConfirmCards(1 - tp, fg)
  	end
  	sg:KeepAlive()
  	e:SetLabelObject(sg)
  	return true
  end
  function s.repvalue(e, c)
  	local g = e:GetLabelObject()
  	return g:IsContains(c)
  end
  function s.repop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Destroy(e:GetHandler(), REASON_EFFECT + REASON_REPLACE)
  	local g = e:GetLabelObject()
  	g:DeleteGroup()
  end
  
  
source_text: Fake
  You can only activate this card when your opponent uses an effect of a Spell, Trap, or Effect Monster to destroy Trap Card(s) on your side of the field. Destroy this card as a substitute of those Trap Card(s) and the other Trap Card(s) are not destroyed. If a Set card(s) would have been destroyed, pick up and see the Set card(s).
target_text: -- Fake
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c, tp)
  	return c:IsType(TYPE_TRAP) and c:IsLocation(LOCATION_SZONE) and c:IsControler(tp)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	if rp == tp then
  		return false
  	end
  	local ex, tg, tc = Duel.GetOperationInfo(ev, CATEGORY_DESTROY)
  	if ex and tg ~= nil and tg:GetCount() == tc and tg:IsExists(s.cfilter, 1, e:GetHandler(), tp) then
  		e:SetLabelObject(re)
  		return true
  	else
  		return false
  	end
  end
  function s.cffilter(c, tp)
  	return c:IsFacedown() and c:IsControler(tp)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:IsHasType(EFFECT_TYPE_ACTIVATE)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, e:GetHandler(), 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_FIELD)
  		e1:SetCode(EFFECT_DESTROY_REPLACE)
  		e1:SetRange(LOCATION_SZONE)
  		e1:SetTarget(s.reptg)
  		e1:SetValue(s.repvalue)
  		e1:SetOperation(s.repop)
  		e1:SetLabelObject(e:GetLabelObject())
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		c:RegisterEffect(e1)
  	end
  end
  function s.repfilter(c, tp)
  	return s.cfilter(c, tp) and not c:IsReason(REASON_REPLACE)
  end
  function s.reptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return re == e:GetLabelObject() and eg:IsExists(s.repfilter, 1, c, tp)
  	end
  	local sg = eg:Filter(s.repfilter, c, tp)
  	local fg = sg:Filter(s.cffilter, nil, tp)
  	if fg:GetCount() > 0 then
  		Duel.ConfirmCards(1 - tp, fg)
  	end
  	sg:KeepAlive()
  	e:SetLabelObject(sg)
  	return true
  end
  function s.repvalue(e, c)
  	local g = e:GetLabelObject()
  	return g:IsContains(c)
  end
  function s.repop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Destroy(e:GetHandler(), REASON_EFFECT + REASON_REPLACE)
  	local g = e:GetLabelObject()
  	g:DeleteGroup()
  end
  
  