name: Arcana
card_text: "Queen's Knight" + "Jack's Knight" + "King's Knight"
  A Fusion Summon of this card can only be done with the above materials. Once per turn, when a Spell/Trap Card, or monster effect, is activated that targets this face-up card on the field (Quick Effect): You can discard the same type of card (Monster, Spell, or Trap); negate the effect.
external_ids: local CARD_ID_0 = 64788463 --King's Knight
  local CARD_ID_1 = 90876561 --Jack's Knight
  local CARD_ID_2 = 25652259 --Queen's Knight
  
lua: local CARD_ID_0 = 64788463 --King's Knight
  local CARD_ID_1 = 90876561 --Jack's Knight
  local CARD_ID_2 = 25652259 --Queen's Knight
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCode3(c, CARD_ID_2, CARD_ID_1, CARD_ID_0, false, false)
  	--negate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DISABLE)
  	e1:SetType(EFFECT_TYPE_QUICK_O)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCondition(s.discon)
  	e1:SetCost(s.discost)
  	e1:SetTarget(s.distg)
  	e1:SetOperation(s.disop)
  	c:RegisterEffect(e1)
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsStatus(STATUS_BATTLE_DESTROYED) then
  		return false
  	end
  	if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then
  		return
  	end
  	local tg = Duel.GetChainInfo(ev, CHAININFO_TARGET_CARDS)
  	return tg and tg:IsContains(c) and Duel.IsChainDisablable(ev)
  end
  function s.filter(c, tpe)
  	return c:IsType(tpe) and c:IsDiscardable()
  end
  function s.discost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local rtype = bit.band(re:GetActiveType(), 0x7)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_HAND, 0, 1, nil, rtype)
  	end
  	Duel.DiscardHand(tp, s.filter, 1, 1, REASON_COST + REASON_DISCARD, nil, rtype)
  end
  function s.distg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DISABLE, eg, 1, 0, 0)
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.NegateEffect(ev)
  end
  
  
source_text: Arcana
  "Queen's Knight" + "Jack's Knight" + "King's Knight"
  A Fusion Summon of this card can only be done with the above materials. Once per turn, when a Spell/Trap Card, or monster effect, is activated that targets this face-up card on the field (Quick Effect): You can discard the same type of card (Monster, Spell, or Trap); negate the effect.
target_text: -- Arcana
  local CARD_ID_0 = 64788463 --King's Knight
  local CARD_ID_1 = 90876561 --Jack's Knight
  local CARD_ID_2 = 25652259 --Queen's Knight
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCode3(c, CARD_ID_2, CARD_ID_1, CARD_ID_0, false, false)
  	--negate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DISABLE)
  	e1:SetType(EFFECT_TYPE_QUICK_O)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCondition(s.discon)
  	e1:SetCost(s.discost)
  	e1:SetTarget(s.distg)
  	e1:SetOperation(s.disop)
  	c:RegisterEffect(e1)
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsStatus(STATUS_BATTLE_DESTROYED) then
  		return false
  	end
  	if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then
  		return
  	end
  	local tg = Duel.GetChainInfo(ev, CHAININFO_TARGET_CARDS)
  	return tg and tg:IsContains(c) and Duel.IsChainDisablable(ev)
  end
  function s.filter(c, tpe)
  	return c:IsType(tpe) and c:IsDiscardable()
  end
  function s.discost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local rtype = bit.band(re:GetActiveType(), 0x7)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_HAND, 0, 1, nil, rtype)
  	end
  	Duel.DiscardHand(tp, s.filter, 1, 1, REASON_COST + REASON_DISCARD, nil, rtype)
  end
  function s.distg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DISABLE, eg, 1, 0, 0)
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.NegateEffect(ev)
  end
  
  