name: Super
card_text: If you have 3 Insect monsters with the same name in your GY: You can target any number of them; Special Summon this card from your hand, then equip them to this card. You can send 1 monster equipped to this card by this card's effect to the GY; destroy all monsters your opponent controls with ATK greater than or equal to the ATK of the monster sent to the GY. You can only use each effect of "Super Armored Robot Armed Black Iron "C"" once per turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_EQUIP)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--Destroy
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_DESTROY)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1, id + 1)
  	e2:SetCost(s.descost)
  	e2:SetTarget(s.destg)
  	e2:SetOperation(s.desop)
  	c:RegisterEffect(e2)
  end
  function s.eqfilter(c, e, tp)
  	return c:IsRace(RACE_INSECT) and c:IsCanBeEffectTarget(e) and c:CheckUniqueOnField(tp) and Duel.IsExistingMatchingCard(Card.IsCode, tp, LOCATION_GRAVE, 0, 2, c, c:GetCode())
  end
  function s.fselect(g)
  	return g:GetClassCount(Card.GetCode) == 1
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return false
  	end
  	local g = Duel.GetMatchingGroup(s.eqfilter, tp, LOCATION_GRAVE, 0, nil, e, tp)
  	local ft = math.min((Duel.GetLocationCount(tp, LOCATION_SZONE)), 3)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and g:CheckSubGroup(s.fselect, 1, ft) and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local sg = g:SelectSubGroup(tp, s.fselect, false, 1, ft)
  	Duel.SetTargetCard(sg)
  	Duel.SetOperationInfo(0, CATEGORY_LEAVE_GRAVE, sg, sg:GetCount(), 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) ~= 0 then
  		local ft = Duel.GetLocationCount(tp, LOCATION_SZONE)
  		local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
  		if ft < g:GetCount() then
  			return
  		end
  		Duel.BreakEffect()
  		for tc in aux.Next(g) do
  			Duel.Equip(tp, tc, c, false, true)
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
  			e1:SetCode(EFFECT_EQUIP_LIMIT)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  			e1:SetValue(s.eqlimit)
  			tc:RegisterEffect(e1)
  			tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 1)
  		end
  		Duel.EquipComplete()
  	end
  end
  function s.eqlimit(e, c)
  	return e:GetOwner() == c
  end
  function s.tgfilter(c, tp)
  	return c:GetFlagEffect(id) ~= 0 and c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(s.desfilter, tp, 0, LOCATION_MZONE, 1, nil, c:GetTextAttack())
  end
  function s.desfilter(c, atk)
  	return c:IsFaceup() and c:IsAttackAbove(atk)
  end
  function s.descost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():GetEquipGroup():IsExists(s.tgfilter, 1, nil, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = e:GetHandler():GetEquipGroup():FilterSelect(tp, s.tgfilter, 1, 1, nil, tp)
  	e:SetLabel(g:GetFirst():GetTextAttack())
  	Duel.SendtoGrave(g, REASON_COST)
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = Duel.GetMatchingGroup(s.desfilter, tp, 0, LOCATION_MZONE, nil, e:GetLabel())
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.desfilter, tp, 0, LOCATION_MZONE, nil, e:GetLabel())
  	Duel.Destroy(g, REASON_EFFECT)
  end
  
  
source_text: Super
  If you have 3 Insect monsters with the same name in your GY: You can target any number of them; Special Summon this card from your hand, then equip them to this card. You can send 1 monster equipped to this card by this card's effect to the GY; destroy all monsters your opponent controls with ATK greater than or equal to the ATK of the monster sent to the GY. You can only use each effect of "Super Armored Robot Armed Black Iron "C"" once per turn.
target_text: -- Super
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_EQUIP)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--Destroy
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_DESTROY)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1, id + 1)
  	e2:SetCost(s.descost)
  	e2:SetTarget(s.destg)
  	e2:SetOperation(s.desop)
  	c:RegisterEffect(e2)
  end
  function s.eqfilter(c, e, tp)
  	return c:IsRace(RACE_INSECT) and c:IsCanBeEffectTarget(e) and c:CheckUniqueOnField(tp) and Duel.IsExistingMatchingCard(Card.IsCode, tp, LOCATION_GRAVE, 0, 2, c, c:GetCode())
  end
  function s.fselect(g)
  	return g:GetClassCount(Card.GetCode) == 1
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return false
  	end
  	local g = Duel.GetMatchingGroup(s.eqfilter, tp, LOCATION_GRAVE, 0, nil, e, tp)
  	local ft = math.min((Duel.GetLocationCount(tp, LOCATION_SZONE)), 3)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and g:CheckSubGroup(s.fselect, 1, ft) and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local sg = g:SelectSubGroup(tp, s.fselect, false, 1, ft)
  	Duel.SetTargetCard(sg)
  	Duel.SetOperationInfo(0, CATEGORY_LEAVE_GRAVE, sg, sg:GetCount(), 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) ~= 0 then
  		local ft = Duel.GetLocationCount(tp, LOCATION_SZONE)
  		local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
  		if ft < g:GetCount() then
  			return
  		end
  		Duel.BreakEffect()
  		for tc in aux.Next(g) do
  			Duel.Equip(tp, tc, c, false, true)
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
  			e1:SetCode(EFFECT_EQUIP_LIMIT)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  			e1:SetValue(s.eqlimit)
  			tc:RegisterEffect(e1)
  			tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 1)
  		end
  		Duel.EquipComplete()
  	end
  end
  function s.eqlimit(e, c)
  	return e:GetOwner() == c
  end
  function s.tgfilter(c, tp)
  	return c:GetFlagEffect(id) ~= 0 and c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(s.desfilter, tp, 0, LOCATION_MZONE, 1, nil, c:GetTextAttack())
  end
  function s.desfilter(c, atk)
  	return c:IsFaceup() and c:IsAttackAbove(atk)
  end
  function s.descost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():GetEquipGroup():IsExists(s.tgfilter, 1, nil, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = e:GetHandler():GetEquipGroup():FilterSelect(tp, s.tgfilter, 1, 1, nil, tp)
  	e:SetLabel(g:GetFirst():GetTextAttack())
  	Duel.SendtoGrave(g, REASON_COST)
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = Duel.GetMatchingGroup(s.desfilter, tp, 0, LOCATION_MZONE, nil, e:GetLabel())
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.desfilter, tp, 0, LOCATION_MZONE, nil, e:GetLabel())
  	Duel.Destroy(g, REASON_EFFECT)
  end
  
  