name: S-Force
card_text: 1 non-Link "S-Force" monster
  Each of your opponent's monsters in the same column as one of your "S-Force" monsters cannot target the monsters in its same column for attacks. During the Main Phase (Quick Effect): You can target 1 "S-Force" monster you control; shuffle it into the Deck, then you can Special Summon 1 of your banished "S-Force" monsters. You can only use this effect of "S-Force Nightchaser" once per turn.
external_ids: local SETCARD_ID_0 = 0x156 --S-Force
  
lua: local SETCARD_ID_0 = 0x156 --S-Force
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--link summon
  	aux.AddLinkProcedure(c, s.mat, 1, 1)
  	c:EnableReviveLimit()
  	--attack limit
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(0, LOCATION_MZONE)
  	e1:SetTarget(s.attg)
  	e1:SetValue(s.atlimit)
  	c:RegisterEffect(e1)
  	--special summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_TODECK + CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetHintTiming(0, TIMINGS_CHECK_MONSTER + TIMING_MAIN_END)
  	e2:SetCountLimit(1, id)
  	e2:SetCondition(s.tdcon)
  	e2:SetTarget(s.tdtg)
  	e2:SetOperation(s.tdop)
  	c:RegisterEffect(e2)
  end
  function s.mat(c)
  	return c:IsLinkSetCard(SETCARD_ID_0) and not c:IsLinkType(TYPE_LINK)
  end
  function s.atfilter(c, tp)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
  end
  function s.attg(e, c)
  	local cg = c:GetColumnGroup()
  	e:SetLabelObject(c)
  	return cg:IsExists(s.atfilter, 1, nil, e:GetHandlerPlayer())
  end
  function s.atlimit(e, c)
  	local lc = e:GetLabelObject()
  	return lc:GetColumnGroup():IsContains(c)
  end
  function s.tdcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetCurrentPhase() == PHASE_MAIN1 or Duel.GetCurrentPhase() == PHASE_MAIN2
  end
  function s.tdfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsAbleToDeck()
  end
  function s.tdtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tdfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.tdfilter, tp, LOCATION_MZONE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
  	local g = Duel.SelectTarget(tp, s.tdfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TODECK, g, 1, 0, 0)
  end
  function s.spfilter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsFaceup() and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.tdop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc, nil, SEQ_DECKSHUFFLE, REASON_EFFECT) > 0 and tc:IsLocation(LOCATION_DECK + LOCATION_EXTRA) then
  		local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  		local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_REMOVED, 0, nil, e, tp)
  		if ft > 0 and #g > 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 1)) then
  			Duel.BreakEffect()
  			Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  			local sg = g:Select(tp, 1, 1, nil)
  			Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP)
  		end
  	end
  end
  
  
source_text: S-Force
  1 non-Link "S-Force" monster
  Each of your opponent's monsters in the same column as one of your "S-Force" monsters cannot target the monsters in its same column for attacks. During the Main Phase (Quick Effect): You can target 1 "S-Force" monster you control; shuffle it into the Deck, then you can Special Summon 1 of your banished "S-Force" monsters. You can only use this effect of "S-Force Nightchaser" once per turn.
target_text: -- S-Force
  local SETCARD_ID_0 = 0x156 --S-Force
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--link summon
  	aux.AddLinkProcedure(c, s.mat, 1, 1)
  	c:EnableReviveLimit()
  	--attack limit
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(0, LOCATION_MZONE)
  	e1:SetTarget(s.attg)
  	e1:SetValue(s.atlimit)
  	c:RegisterEffect(e1)
  	--special summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_TODECK + CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetHintTiming(0, TIMINGS_CHECK_MONSTER + TIMING_MAIN_END)
  	e2:SetCountLimit(1, id)
  	e2:SetCondition(s.tdcon)
  	e2:SetTarget(s.tdtg)
  	e2:SetOperation(s.tdop)
  	c:RegisterEffect(e2)
  end
  function s.mat(c)
  	return c:IsLinkSetCard(SETCARD_ID_0) and not c:IsLinkType(TYPE_LINK)
  end
  function s.atfilter(c, tp)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
  end
  function s.attg(e, c)
  	local cg = c:GetColumnGroup()
  	e:SetLabelObject(c)
  	return cg:IsExists(s.atfilter, 1, nil, e:GetHandlerPlayer())
  end
  function s.atlimit(e, c)
  	local lc = e:GetLabelObject()
  	return lc:GetColumnGroup():IsContains(c)
  end
  function s.tdcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetCurrentPhase() == PHASE_MAIN1 or Duel.GetCurrentPhase() == PHASE_MAIN2
  end
  function s.tdfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsAbleToDeck()
  end
  function s.tdtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tdfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.tdfilter, tp, LOCATION_MZONE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
  	local g = Duel.SelectTarget(tp, s.tdfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TODECK, g, 1, 0, 0)
  end
  function s.spfilter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsFaceup() and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.tdop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc, nil, SEQ_DECKSHUFFLE, REASON_EFFECT) > 0 and tc:IsLocation(LOCATION_DECK + LOCATION_EXTRA) then
  		local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
  		local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_REMOVED, 0, nil, e, tp)
  		if ft > 0 and #g > 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 1)) then
  			Duel.BreakEffect()
  			Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  			local sg = g:Select(tp, 1, 1, nil)
  			Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP)
  		end
  	end
  end
  
  