name: Gishki
card_text: Cannot be Special Summoned. During the End Phase of the turn this card is Normal Summoned or flipped face-up: Return it to the hand. When this card is Normal Summoned or flipped face-up: Negate all Trap Card effects on the field, until the End Phase. You must control another face-up "Gishki" monster to activate and to resolve this effect.
external_ids: local SETCARD_ID_0 = 0x3a --Gishki
  
lua: local SETCARD_ID_0 = 0x3a --Gishki
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--spirit return
  	aux.EnableSpiritReturn(c, EVENT_SUMMON_SUCCESS, EVENT_FLIP)
  	--cannot special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e1:SetValue(aux.FALSE)
  	c:RegisterEffect(e1)
  	--negate trap
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 1))
  	e4:SetCategory(CATEGORY_DISABLE)
  	e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e4:SetCode(EVENT_SUMMON_SUCCESS)
  	e4:SetCondition(s.negcon)
  	e4:SetOperation(s.negop)
  	c:RegisterEffect(e4)
  	local e5 = e4:Clone()
  	e5:SetCode(EVENT_FLIP)
  	c:RegisterEffect(e5)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.negcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, e:GetHandler())
  end
  function s.negop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, c) then
  		return
  	end
  	--disable
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_DISABLE)
  	e1:SetTargetRange(LOCATION_SZONE, LOCATION_SZONE)
  	e1:SetTarget(s.distg)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  	--disable effect
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_CHAIN_SOLVING)
  	e2:SetOperation(s.disop)
  	e2:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e2, tp)
  	--disable trap monster
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
  	e3:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
  	e3:SetTarget(s.distg)
  	e3:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e3, tp)
  end
  function s.distg(e, c)
  	return c ~= e:GetHandler() and c:IsType(TYPE_TRAP)
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	local tl = Duel.GetChainInfo(ev, CHAININFO_TRIGGERING_LOCATION)
  	if tl == LOCATION_SZONE and re:IsActiveType(TYPE_TRAP) then
  		Duel.NegateEffect(ev)
  	end
  end
  
  
source_text: Gishki
  Cannot be Special Summoned. During the End Phase of the turn this card is Normal Summoned or flipped face-up: Return it to the hand. When this card is Normal Summoned or flipped face-up: Negate all Trap Card effects on the field, until the End Phase. You must control another face-up "Gishki" monster to activate and to resolve this effect.
target_text: -- Gishki
  local SETCARD_ID_0 = 0x3a --Gishki
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--spirit return
  	aux.EnableSpiritReturn(c, EVENT_SUMMON_SUCCESS, EVENT_FLIP)
  	--cannot special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e1:SetValue(aux.FALSE)
  	c:RegisterEffect(e1)
  	--negate trap
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 1))
  	e4:SetCategory(CATEGORY_DISABLE)
  	e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e4:SetCode(EVENT_SUMMON_SUCCESS)
  	e4:SetCondition(s.negcon)
  	e4:SetOperation(s.negop)
  	c:RegisterEffect(e4)
  	local e5 = e4:Clone()
  	e5:SetCode(EVENT_FLIP)
  	c:RegisterEffect(e5)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.negcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, e:GetHandler())
  end
  function s.negop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, c) then
  		return
  	end
  	--disable
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_DISABLE)
  	e1:SetTargetRange(LOCATION_SZONE, LOCATION_SZONE)
  	e1:SetTarget(s.distg)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  	--disable effect
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_CHAIN_SOLVING)
  	e2:SetOperation(s.disop)
  	e2:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e2, tp)
  	--disable trap monster
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
  	e3:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
  	e3:SetTarget(s.distg)
  	e3:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e3, tp)
  end
  function s.distg(e, c)
  	return c ~= e:GetHandler() and c:IsType(TYPE_TRAP)
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	local tl = Duel.GetChainInfo(ev, CHAININFO_TRIGGERING_LOCATION)
  	if tl == LOCATION_SZONE and re:IsActiveType(TYPE_TRAP) then
  		Duel.NegateEffect(ev)
  	end
  end
  
  