Goblin
When this card is Normal Summoned, Trap Cards cannot be activated. Also, "Trap Hole" Trap Cards cannot be activated when a monster is Summoned, except "Dark Trap Hole".
local SETCARD_ID_0 = 0x4c --Trap

local SETCARD_ID_0 = 0x4c --Trap
local s, id, o = GetID()
function s.initial_effect(c)
	--summon success
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
	e1:SetCode(EVENT_SUMMON_SUCCESS)
	e1:SetOperation(s.sumsuc)
	c:RegisterEffect(e1)
	--activate limit
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
	e2:SetRange(LOCATION_MZONE)
	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
	e2:SetOperation(s.cedop)
	c:RegisterEffect(e2)
	local e3 = e2:Clone()
	e3:SetCode(EVENT_SUMMON_SUCCESS)
	e3:SetCondition(s.cedcon)
	c:RegisterEffect(e3)
	local e4 = e2:Clone()
	e4:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
	c:RegisterEffect(e4)
	local e5 = Effect.CreateEffect(c)
	e5:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
	e5:SetRange(LOCATION_MZONE)
	e5:SetCode(EVENT_CHAIN_END)
	e5:SetOperation(s.cedop2)
	c:RegisterEffect(e5)
end
function s.sumsuc(e, tp, eg, ep, ev, re, r, rp)
	Duel.SetChainLimitTillChainEnd(s.chlimit1)
end
function s.chlimit1(re, rp, tp)
	return not re:GetHandler():IsType(TYPE_TRAP) or not re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function s.cedcon(e, tp, eg, ep, ev, re, r, rp)
	return eg:GetFirst() ~= e:GetHandler()
end
function s.cedop(e, tp, eg, ep, ev, re, r, rp)
	if Duel.GetCurrentChain() == 0 then
		Duel.SetChainLimitTillChainEnd(s.chlimit2)
	elseif Duel.GetCurrentChain() == 1 then
		e:GetHandler():RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, 0, 1)
		local e1 = Effect.CreateEffect(e:GetHandler())
		e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
		e1:SetCode(EVENT_CHAINING)
		e1:SetOperation(s.resetop)
		Duel.RegisterEffect(e1, tp)
		local e2 = e1:Clone()
		e2:SetCode(EVENT_BREAK_EFFECT)
		e2:SetReset(RESET_CHAIN)
		Duel.RegisterEffect(e2, tp)
	end
end
function s.resetop(e, tp, eg, ep, ev, re, r, rp)
	e:GetHandler():ResetFlagEffect(id)
	e:Reset()
end
function s.cedop2(e, tp, eg, ep, ev, re, r, rp)
	if e:GetHandler():GetFlagEffect(id) > 0 then
		Duel.SetChainLimitTillChainEnd(s.chlimit2)
	end
	e:GetHandler():ResetFlagEffect(id)
end
function s.chlimit2(re, rp, tp)
	return not re:GetHandler():IsType(TYPE_TRAP) or not re:IsHasType(EFFECT_TYPE_ACTIVATE) or not re:GetHandler():IsSetCard(SETCARD_ID_0)
end


Goblin
When this card is Normal Summoned, Trap Cards cannot be activated. Also, "Trap Hole" Trap Cards cannot be activated when a monster is Summoned, except "Dark Trap Hole".
-- Goblin
local SETCARD_ID_0 = 0x4c --Trap
local s, id, o = GetID()
function s.initial_effect(c)
	--summon success
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
	e1:SetCode(EVENT_SUMMON_SUCCESS)
	e1:SetOperation(s.sumsuc)
	c:RegisterEffect(e1)
	--activate limit
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
	e2:SetRange(LOCATION_MZONE)
	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
	e2:SetOperation(s.cedop)
	c:RegisterEffect(e2)
	local e3 = e2:Clone()
	e3:SetCode(EVENT_SUMMON_SUCCESS)
	e3:SetCondition(s.cedcon)
	c:RegisterEffect(e3)
	local e4 = e2:Clone()
	e4:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
	c:RegisterEffect(e4)
	local e5 = Effect.CreateEffect(c)
	e5:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
	e5:SetRange(LOCATION_MZONE)
	e5:SetCode(EVENT_CHAIN_END)
	e5:SetOperation(s.cedop2)
	c:RegisterEffect(e5)
end
function s.sumsuc(e, tp, eg, ep, ev, re, r, rp)
	Duel.SetChainLimitTillChainEnd(s.chlimit1)
end
function s.chlimit1(re, rp, tp)
	return not re:GetHandler():IsType(TYPE_TRAP) or not re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function s.cedcon(e, tp, eg, ep, ev, re, r, rp)
	return eg:GetFirst() ~= e:GetHandler()
end
function s.cedop(e, tp, eg, ep, ev, re, r, rp)
	if Duel.GetCurrentChain() == 0 then
		Duel.SetChainLimitTillChainEnd(s.chlimit2)
	elseif Duel.GetCurrentChain() == 1 then
		e:GetHandler():RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, 0, 1)
		local e1 = Effect.CreateEffect(e:GetHandler())
		e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
		e1:SetCode(EVENT_CHAINING)
		e1:SetOperation(s.resetop)
		Duel.RegisterEffect(e1, tp)
		local e2 = e1:Clone()
		e2:SetCode(EVENT_BREAK_EFFECT)
		e2:SetReset(RESET_CHAIN)
		Duel.RegisterEffect(e2, tp)
	end
end
function s.resetop(e, tp, eg, ep, ev, re, r, rp)
	e:GetHandler():ResetFlagEffect(id)
	e:Reset()
end
function s.cedop2(e, tp, eg, ep, ev, re, r, rp)
	if e:GetHandler():GetFlagEffect(id) > 0 then
		Duel.SetChainLimitTillChainEnd(s.chlimit2)
	end
	e:GetHandler():ResetFlagEffect(id)
end
function s.chlimit2(re, rp, tp)
	return not re:GetHandler():IsType(TYPE_TRAP) or not re:IsHasType(EFFECT_TYPE_ACTIVATE) or not re:GetHandler():IsSetCard(SETCARD_ID_0)
end

