name: Legendary
card_text: 1 Warrior Tuner + 1+ non-Tuner "Six Samurai" monsters
  Once per turn, when your opponent activates a Spell/Trap Card (Quick Effect): You can negate the activation, and if you do, destroy it. If this card on the field would be destroyed by battle or card effect, you can destroy another "Six Samurai" monster you control instead.
external_ids: local SETCARD_ID_0 = 0x103d --Six
  
lua: local SETCARD_ID_0 = 0x103d --Six
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--synchro summon
  	aux.AddSynchroProcedure(c, aux.FilterBoolFunction(Card.IsRace, RACE_WARRIOR), aux.NonTuner(Card.IsSetCard, SETCARD_ID_0), 1)
  	c:EnableReviveLimit()
  	--negate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_NEGATE + CATEGORY_DESTROY)
  	e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DAMAGE_CAL)
  	e1:SetType(EFFECT_TYPE_QUICK_O)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCondition(s.discon)
  	e1:SetTarget(s.distg)
  	e1:SetOperation(s.disop)
  	c:RegisterEffect(e1)
  	--Destroy replace
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_DESTROY_REPLACE)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTarget(s.desreptg)
  	e2:SetOperation(s.desrepop)
  	c:RegisterEffect(e2)
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep ~= tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
  end
  function s.distg(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)
  	if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
  		Duel.SetOperationInfo(0, CATEGORY_DESTROY, eg, 1, 0, 0)
  	end
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
  		Duel.Destroy(eg, REASON_EFFECT)
  	end
  end
  function s.repfilter(c, e)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED + STATUS_BATTLE_DESTROYED)
  end
  function s.desreptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return c:IsReason(REASON_BATTLE + REASON_EFFECT) and not c:IsReason(REASON_REPLACE) and Duel.IsExistingMatchingCard(s.repfilter, tp, LOCATION_MZONE, 0, 1, c, e)
  	end
  	if Duel.SelectEffectYesNo(tp, c, 96) then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESREPLACE)
  		local g = Duel.SelectMatchingCard(tp, s.repfilter, tp, LOCATION_MZONE, 0, 1, 1, c, e)
  		e:SetLabelObject(g:GetFirst())
  		g:GetFirst():SetStatus(STATUS_DESTROY_CONFIRMED, true)
  		return true
  	else
  		return false
  	end
  end
  function s.desrepop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = e:GetLabelObject()
  	tc:SetStatus(STATUS_DESTROY_CONFIRMED, false)
  	Duel.Destroy(tc, REASON_EFFECT + REASON_REPLACE)
  end
  
  
source_text: Legendary
  1 Warrior Tuner + 1+ non-Tuner "Six Samurai" monsters
  Once per turn, when your opponent activates a Spell/Trap Card (Quick Effect): You can negate the activation, and if you do, destroy it. If this card on the field would be destroyed by battle or card effect, you can destroy another "Six Samurai" monster you control instead.
target_text: -- Legendary
  local SETCARD_ID_0 = 0x103d --Six
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--synchro summon
  	aux.AddSynchroProcedure(c, aux.FilterBoolFunction(Card.IsRace, RACE_WARRIOR), aux.NonTuner(Card.IsSetCard, SETCARD_ID_0), 1)
  	c:EnableReviveLimit()
  	--negate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_NEGATE + CATEGORY_DESTROY)
  	e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DAMAGE_CAL)
  	e1:SetType(EFFECT_TYPE_QUICK_O)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCondition(s.discon)
  	e1:SetTarget(s.distg)
  	e1:SetOperation(s.disop)
  	c:RegisterEffect(e1)
  	--Destroy replace
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_DESTROY_REPLACE)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTarget(s.desreptg)
  	e2:SetOperation(s.desrepop)
  	c:RegisterEffect(e2)
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep ~= tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
  end
  function s.distg(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)
  	if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
  		Duel.SetOperationInfo(0, CATEGORY_DESTROY, eg, 1, 0, 0)
  	end
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
  		Duel.Destroy(eg, REASON_EFFECT)
  	end
  end
  function s.repfilter(c, e)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED + STATUS_BATTLE_DESTROYED)
  end
  function s.desreptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return c:IsReason(REASON_BATTLE + REASON_EFFECT) and not c:IsReason(REASON_REPLACE) and Duel.IsExistingMatchingCard(s.repfilter, tp, LOCATION_MZONE, 0, 1, c, e)
  	end
  	if Duel.SelectEffectYesNo(tp, c, 96) then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESREPLACE)
  		local g = Duel.SelectMatchingCard(tp, s.repfilter, tp, LOCATION_MZONE, 0, 1, 1, c, e)
  		e:SetLabelObject(g:GetFirst())
  		g:GetFirst():SetStatus(STATUS_DESTROY_CONFIRMED, true)
  		return true
  	else
  		return false
  	end
  end
  function s.desrepop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = e:GetLabelObject()
  	tc:SetStatus(STATUS_DESTROY_CONFIRMED, false)
  	Duel.Destroy(tc, REASON_EFFECT + REASON_REPLACE)
  end
  
  