name: Super
card_text: Cannot be Normal Summoned or Set. Must first be Special Summoned (from your hand) in face-up Defense Position, by banishing "Crashbug X", "Crashbug Y", and "Crashbug Z" from your Graveyard. Switch the ATK and DEF of all face-up Attack Position monsters on the field. There can only be 1 face-up "Super Crashbug" on the field.
external_ids: local CARD_ID_0 = 50319138 --Crashbug Z
  local CARD_ID_1 = 23915499 --Crashbug Y
  local CARD_ID_2 = 87526784 --Crashbug X
  
lua: local CARD_ID_0 = 50319138 --Crashbug Z
  local CARD_ID_1 = 23915499 --Crashbug Y
  local CARD_ID_2 = 87526784 --Crashbug X
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	c:SetUniqueOnField(1, 1, id)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_SPSUM_PARAM)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetTargetRange(POS_FACEUP_DEFENSE, 0)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--swap ad
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_SWAP_AD)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
  	e2:SetTarget(s.adfilter)
  	c:RegisterEffect(e2)
  end
  s.spchecks = aux.CreateChecks(Card.IsCode, { CARD_ID_2, CARD_ID_1, CARD_ID_0 })
  function s.spfilter(c)
  	return c:IsCode(CARD_ID_2, CARD_ID_1, CARD_ID_0) and c:IsAbleToRemoveAsCost()
  end
  function s.spcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_GRAVE, 0, nil)
  	return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and g:CheckSubGroupEach(s.spchecks)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, c)
  	local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_GRAVE, 0, nil)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local sg = g:SelectSubGroupEach(tp, s.spchecks, true)
  	if sg then
  		sg:KeepAlive()
  		e:SetLabelObject(sg)
  		return true
  	else
  		return false
  	end
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp, c)
  	local g = e:GetLabelObject()
  	Duel.Remove(g, POS_FACEUP, REASON_SPSUMMON)
  	g:DeleteGroup()
  end
  function s.adfilter(e, c)
  	return c:IsPosition(POS_FACEUP_ATTACK)
  end
  
  
source_text: Super
  Cannot be Normal Summoned or Set. Must first be Special Summoned (from your hand) in face-up Defense Position, by banishing "Crashbug X", "Crashbug Y", and "Crashbug Z" from your Graveyard. Switch the ATK and DEF of all face-up Attack Position monsters on the field. There can only be 1 face-up "Super Crashbug" on the field.
target_text: -- Super
  local CARD_ID_0 = 50319138 --Crashbug Z
  local CARD_ID_1 = 23915499 --Crashbug Y
  local CARD_ID_2 = 87526784 --Crashbug X
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	c:SetUniqueOnField(1, 1, id)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_SPSUM_PARAM)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetTargetRange(POS_FACEUP_DEFENSE, 0)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--swap ad
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_SWAP_AD)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
  	e2:SetTarget(s.adfilter)
  	c:RegisterEffect(e2)
  end
  s.spchecks = aux.CreateChecks(Card.IsCode, { CARD_ID_2, CARD_ID_1, CARD_ID_0 })
  function s.spfilter(c)
  	return c:IsCode(CARD_ID_2, CARD_ID_1, CARD_ID_0) and c:IsAbleToRemoveAsCost()
  end
  function s.spcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_GRAVE, 0, nil)
  	return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and g:CheckSubGroupEach(s.spchecks)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, c)
  	local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_GRAVE, 0, nil)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local sg = g:SelectSubGroupEach(tp, s.spchecks, true)
  	if sg then
  		sg:KeepAlive()
  		e:SetLabelObject(sg)
  		return true
  	else
  		return false
  	end
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp, c)
  	local g = e:GetLabelObject()
  	Duel.Remove(g, POS_FACEUP, REASON_SPSUMMON)
  	g:DeleteGroup()
  end
  function s.adfilter(e, c)
  	return c:IsPosition(POS_FACEUP_ATTACK)
  end
  
  