name: Assault
card_text: Tribute 1 "/Assault Mode" monster; Special Summon 1 "/Assault Mode" monster from your Deck with a different name in Defense Position, ignoring its Summoning conditions. You can banish this card from your GY, then target any number of cards in your GY, with different names, that are "Assault Mode Activate" and/or specifically list "Assault Mode Activate" in their text, except "Assault Reboot"; shuffle them into the Deck. You can only use each effect of "Assault Reboot" once per turn.
external_ids: local CARD_ID_0 = 80280737 --Assault Mode Activate
  local SETCARD_ID_0 = 0x104f --/Assault
  
lua: local CARD_ID_0 = 80280737 --Assault Mode Activate
  local SETCARD_ID_0 = 0x104f --/Assault
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMING_END_PHASE)
  	e1:SetLabel(0)
  	e1:SetCountLimit(1, id)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--to deck
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_TODECK)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetRange(LOCATION_GRAVE)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetCountLimit(1, id + 1)
  	e2:SetCost(aux.bfgcost)
  	e2:SetTarget(s.tdtg)
  	e2:SetOperation(s.tdop)
  	c:RegisterEffect(e2)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	e:SetLabel(100)
  	return true
  end
  function s.cfilter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_0) and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_DECK, 0, 1, nil, e, tp, c:GetCode()) and Duel.GetMZoneCount(tp, c) > 0
  end
  function s.spfilter(c, e, tp, code)
  	return not c:IsCode(code) and c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e, 0, tp, true, false, POS_FACEUP_DEFENSE)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		if e:GetLabel() ~= 100 then
  			return false
  		end
  		e:SetLabel(0)
  		return Duel.CheckReleaseGroup(tp, s.cfilter, 1, nil, e, tp)
  	end
  	local rg = Duel.SelectReleaseGroup(tp, s.cfilter, 1, 1, nil, e, tp)
  	Duel.SetTargetParam(rg:GetFirst():GetCode())
  	Duel.Release(rg, REASON_COST)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	local code = Duel.GetChainInfo(0, CHAININFO_TARGET_PARAM)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_DECK, 0, 1, 1, nil, e, tp, code)
  	if g:GetCount() > 0 then
  		Duel.SpecialSummon(g, 0, tp, tp, true, false, POS_FACEUP_DEFENSE)
  	end
  end
  function s.tdfilter(c, e)
  	return not c:IsCode(id) and aux.IsCodeOrListed(c, CARD_ID_0) and c:IsAbleToDeck() and (not e or c:IsCanBeEffectTarget(e))
  end
  function s.tdtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.tdfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.tdfilter, tp, LOCATION_GRAVE, 0, 1, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
  	local g = Duel.GetMatchingGroup(s.tdfilter, tp, LOCATION_GRAVE, 0, e:GetHandler(), e)
  	aux.GCheckAdditional = aux.dncheck
  	local sg = g:SelectSubGroup(tp, aux.TRUE, false, 1, #g)
  	aux.GCheckAdditional = nil
  	Duel.SetTargetCard(sg)
  	Duel.SetOperationInfo(0, CATEGORY_TODECK, sg, #sg, 0, 0)
  end
  function s.tdop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
  	if g:GetCount() > 0 then
  		Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
  	end
  end
  
  
source_text: Assault
  Tribute 1 "/Assault Mode" monster; Special Summon 1 "/Assault Mode" monster from your Deck with a different name in Defense Position, ignoring its Summoning conditions. You can banish this card from your GY, then target any number of cards in your GY, with different names, that are "Assault Mode Activate" and/or specifically list "Assault Mode Activate" in their text, except "Assault Reboot"; shuffle them into the Deck. You can only use each effect of "Assault Reboot" once per turn.
target_text: -- Assault
  local CARD_ID_0 = 80280737 --Assault Mode Activate
  local SETCARD_ID_0 = 0x104f --/Assault
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMING_END_PHASE)
  	e1:SetLabel(0)
  	e1:SetCountLimit(1, id)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--to deck
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_TODECK)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetRange(LOCATION_GRAVE)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetCountLimit(1, id + 1)
  	e2:SetCost(aux.bfgcost)
  	e2:SetTarget(s.tdtg)
  	e2:SetOperation(s.tdop)
  	c:RegisterEffect(e2)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	e:SetLabel(100)
  	return true
  end
  function s.cfilter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_0) and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_DECK, 0, 1, nil, e, tp, c:GetCode()) and Duel.GetMZoneCount(tp, c) > 0
  end
  function s.spfilter(c, e, tp, code)
  	return not c:IsCode(code) and c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e, 0, tp, true, false, POS_FACEUP_DEFENSE)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		if e:GetLabel() ~= 100 then
  			return false
  		end
  		e:SetLabel(0)
  		return Duel.CheckReleaseGroup(tp, s.cfilter, 1, nil, e, tp)
  	end
  	local rg = Duel.SelectReleaseGroup(tp, s.cfilter, 1, 1, nil, e, tp)
  	Duel.SetTargetParam(rg:GetFirst():GetCode())
  	Duel.Release(rg, REASON_COST)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	local code = Duel.GetChainInfo(0, CHAININFO_TARGET_PARAM)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_DECK, 0, 1, 1, nil, e, tp, code)
  	if g:GetCount() > 0 then
  		Duel.SpecialSummon(g, 0, tp, tp, true, false, POS_FACEUP_DEFENSE)
  	end
  end
  function s.tdfilter(c, e)
  	return not c:IsCode(id) and aux.IsCodeOrListed(c, CARD_ID_0) and c:IsAbleToDeck() and (not e or c:IsCanBeEffectTarget(e))
  end
  function s.tdtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.tdfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.tdfilter, tp, LOCATION_GRAVE, 0, 1, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
  	local g = Duel.GetMatchingGroup(s.tdfilter, tp, LOCATION_GRAVE, 0, e:GetHandler(), e)
  	aux.GCheckAdditional = aux.dncheck
  	local sg = g:SelectSubGroup(tp, aux.TRUE, false, 1, #g)
  	aux.GCheckAdditional = nil
  	Duel.SetTargetCard(sg)
  	Duel.SetOperationInfo(0, CATEGORY_TODECK, sg, #sg, 0, 0)
  end
  function s.tdop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
  	if g:GetCount() > 0 then
  		Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
  	end
  end
  
  