name: Abyss-strom
card_text: Send 1 face-up "Umi" you control to the Graveyard; send all Spell and Trap Cards on the field to the Graveyard.
external_ids: local CARD_ID_0 = 22702055 --Umi
  
lua: local CARD_ID_0 = 22702055 --Umi
  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_TOGRAVE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsCode(CARD_ID_0)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	e:SetLabel(1)
  	local g = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_ONFIELD, 0, nil)
  	if chk == 0 then
  		return g:GetCount() > 0 and g:FilterCount(Card.IsAbleToGraveAsCost, nil) == g:GetCount()
  	end
  	Duel.SendtoGrave(g, REASON_COST)
  end
  function s.filter(c, tp)
  	return (c:IsFacedown() or c:IsControler(1 - tp) or not c:IsCode(CARD_ID_0)) and c:IsType(TYPE_SPELL + TYPE_TRAP)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		if e:GetLabel() == 0 then
  			return Duel.IsExistingMatchingCard(Card.IsType, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, e:GetHandler(), TYPE_SPELL + TYPE_TRAP)
  		end
  		e:SetLabel(0)
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, e:GetHandler(), tp)
  	end
  	e:SetLabel(0)
  	local g = Duel.GetMatchingGroup(Card.IsType, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, e:GetHandler(), TYPE_SPELL + TYPE_TRAP)
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, g, g:GetCount(), 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(Card.IsType, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, aux.ExceptThisCard(e), TYPE_SPELL + TYPE_TRAP)
  	Duel.SendtoGrave(g, REASON_EFFECT)
  end
  
  
source_text: Abyss-strom
  Send 1 face-up "Umi" you control to the Graveyard; send all Spell and Trap Cards on the field to the Graveyard.
target_text: -- Abyss-strom
  local CARD_ID_0 = 22702055 --Umi
  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_TOGRAVE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsCode(CARD_ID_0)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	e:SetLabel(1)
  	local g = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_ONFIELD, 0, nil)
  	if chk == 0 then
  		return g:GetCount() > 0 and g:FilterCount(Card.IsAbleToGraveAsCost, nil) == g:GetCount()
  	end
  	Duel.SendtoGrave(g, REASON_COST)
  end
  function s.filter(c, tp)
  	return (c:IsFacedown() or c:IsControler(1 - tp) or not c:IsCode(CARD_ID_0)) and c:IsType(TYPE_SPELL + TYPE_TRAP)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		if e:GetLabel() == 0 then
  			return Duel.IsExistingMatchingCard(Card.IsType, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, e:GetHandler(), TYPE_SPELL + TYPE_TRAP)
  		end
  		e:SetLabel(0)
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, e:GetHandler(), tp)
  	end
  	e:SetLabel(0)
  	local g = Duel.GetMatchingGroup(Card.IsType, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, e:GetHandler(), TYPE_SPELL + TYPE_TRAP)
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, g, g:GetCount(), 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(Card.IsType, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, aux.ExceptThisCard(e), TYPE_SPELL + TYPE_TRAP)
  	Duel.SendtoGrave(g, REASON_EFFECT)
  end
  
  