name: Armed
card_text: Cannot be Normal Summoned/Set. Must be Special Summoned by "Armed Dragon LV5". You can send 1 monster from your hand to the GY; destroy all monsters your opponent controls with ATK less than or equal to that sent monster's ATK.
external_ids: local CARD_ID_0 = 980973 --Armed Dragon LV3
  local CARD_ID_1 = 46384672 --Armed Dragon LV5
  
lua: local CARD_ID_0 = 980973 --Armed Dragon LV3
  local CARD_ID_1 = 46384672 --Armed Dragon LV5
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	--cannot special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e1:SetValue(aux.FALSE)
  	c:RegisterEffect(e1)
  	--destroy
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_DESTROY)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCost(s.descost)
  	e2:SetTarget(s.destg)
  	e2:SetOperation(s.desop)
  	c:RegisterEffect(e2)
  end
  s.lvup = { CARD_ID_1 }
  s.lvdn = { CARD_ID_1, CARD_ID_0 }
  function s.cfilter(c, tp)
  	local atk = c:GetAttack()
  	if atk < 0 then
  		atk = 0
  	end
  	return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(s.dfilter, tp, 0, LOCATION_MZONE, 1, nil, atk)
  end
  function s.dfilter(c, atk)
  	return c:IsFaceup() and c:GetAttack() <= atk
  end
  function s.descost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_HAND, 0, 1, nil, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_HAND, 0, 1, 1, nil, tp)
  	local atk = g:GetFirst():GetAttack()
  	if atk < 0 then
  		atk = 0
  	end
  	e:SetLabel(atk)
  	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.dfilter, 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.dfilter, tp, 0, LOCATION_MZONE, nil, e:GetLabel())
  	Duel.Destroy(g, REASON_EFFECT)
  end
  
  
source_text: Armed
  Cannot be Normal Summoned/Set. Must be Special Summoned by "Armed Dragon LV5". You can send 1 monster from your hand to the GY; destroy all monsters your opponent controls with ATK less than or equal to that sent monster's ATK.
target_text: -- Armed
  local CARD_ID_0 = 980973 --Armed Dragon LV3
  local CARD_ID_1 = 46384672 --Armed Dragon LV5
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	--cannot special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e1:SetValue(aux.FALSE)
  	c:RegisterEffect(e1)
  	--destroy
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_DESTROY)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCost(s.descost)
  	e2:SetTarget(s.destg)
  	e2:SetOperation(s.desop)
  	c:RegisterEffect(e2)
  end
  s.lvup = { CARD_ID_1 }
  s.lvdn = { CARD_ID_1, CARD_ID_0 }
  function s.cfilter(c, tp)
  	local atk = c:GetAttack()
  	if atk < 0 then
  		atk = 0
  	end
  	return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(s.dfilter, tp, 0, LOCATION_MZONE, 1, nil, atk)
  end
  function s.dfilter(c, atk)
  	return c:IsFaceup() and c:GetAttack() <= atk
  end
  function s.descost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_HAND, 0, 1, nil, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_HAND, 0, 1, 1, nil, tp)
  	local atk = g:GetFirst():GetAttack()
  	if atk < 0 then
  		atk = 0
  	end
  	e:SetLabel(atk)
  	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.dfilter, 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.dfilter, tp, 0, LOCATION_MZONE, nil, e:GetLabel())
  	Duel.Destroy(g, REASON_EFFECT)
  end
  
  