name: Beetrooper
card_text: Special Summon 1 "Beetrooper Token" (Insect/EARTH/Level 3/ATK 1000/DEF 1000), then if you control an Insect monster with 3000 or more ATK, you can destroy 1 other Spell/Trap on the field. You can only activate 1 "Beetrooper Descent" per turn.
external_ids: local CARD_ID_0 = 87240372 --Beetrooper Token
  local CARD_ID_1 = 64213018 --Beetrooper Token
  local SETCARD_ID_0 = 0x170 --Beetrooper
  
lua: local CARD_ID_0 = 87240372 --Beetrooper Token
  local CARD_ID_1 = 64213018 --Beetrooper Token
  local SETCARD_ID_0 = 0x170 --Beetrooper
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_TOKEN + CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsPlayerCanSpecialSummonMonster(tp, CARD_ID_1, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 1000, 1000, 3, RACE_INSECT, ATTRIBUTE_EARTH)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 or not Duel.IsPlayerCanSpecialSummonMonster(tp, CARD_ID_1, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 1000, 1000, 3, RACE_INSECT, ATTRIBUTE_EARTH) then
  		return
  	end
  	local token = Duel.CreateToken(tp, id + 1)
  	local ec = aux.ExceptThisCard(e)
  	if
  		Duel.SpecialSummon(token, 0, tp, tp, false, false, POS_FACEUP) > 0
  		and Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  		and Duel.IsExistingMatchingCard(s.dfilter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, ec)
  		and Duel.SelectYesNo(tp, aux.Stringid(id, 0))
  	then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  		local sg = Duel.SelectMatchingCard(tp, s.dfilter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, 1, ec)
  		Duel.BreakEffect()
  		Duel.HintSelection(sg)
  		Duel.Destroy(sg, REASON_EFFECT)
  	end
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsRace(RACE_INSECT) and c:IsAttackAbove(3000)
  end
  function s.dfilter(c)
  	return c:IsType(TYPE_SPELL + TYPE_TRAP)
  end
  
  
source_text: Beetrooper
  Special Summon 1 "Beetrooper Token" (Insect/EARTH/Level 3/ATK 1000/DEF 1000), then if you control an Insect monster with 3000 or more ATK, you can destroy 1 other Spell/Trap on the field. You can only activate 1 "Beetrooper Descent" per turn.
target_text: -- Beetrooper
  local CARD_ID_0 = 87240372 --Beetrooper Token
  local CARD_ID_1 = 64213018 --Beetrooper Token
  local SETCARD_ID_0 = 0x170 --Beetrooper
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_TOKEN + CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsPlayerCanSpecialSummonMonster(tp, CARD_ID_1, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 1000, 1000, 3, RACE_INSECT, ATTRIBUTE_EARTH)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 or not Duel.IsPlayerCanSpecialSummonMonster(tp, CARD_ID_1, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 1000, 1000, 3, RACE_INSECT, ATTRIBUTE_EARTH) then
  		return
  	end
  	local token = Duel.CreateToken(tp, id + 1)
  	local ec = aux.ExceptThisCard(e)
  	if
  		Duel.SpecialSummon(token, 0, tp, tp, false, false, POS_FACEUP) > 0
  		and Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  		and Duel.IsExistingMatchingCard(s.dfilter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, ec)
  		and Duel.SelectYesNo(tp, aux.Stringid(id, 0))
  	then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  		local sg = Duel.SelectMatchingCard(tp, s.dfilter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, 1, ec)
  		Duel.BreakEffect()
  		Duel.HintSelection(sg)
  		Duel.Destroy(sg, REASON_EFFECT)
  	end
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsRace(RACE_INSECT) and c:IsAttackAbove(3000)
  end
  function s.dfilter(c)
  	return c:IsType(TYPE_SPELL + TYPE_TRAP)
  end
  
  