name: Powered
card_text: If this card is Normal or Special Summoned: You can destroy 1 monster your opponent controls with less ATK than this card. You can only use this effect of "Powered Crawler" once per turn. All monsters your opponent controls must attack, if able.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--tohand
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY)
  	e1:SetCountLimit(1, id)
  	e1:SetTarget(s.destg)
  	e1:SetOperation(s.desop)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e2)
  	--must attack
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_MUST_ATTACK)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTargetRange(0, LOCATION_MZONE)
  	c:RegisterEffect(e3)
  end
  function s.desfilter(c, atk)
  	return c:IsFaceup() and c:GetAttack() < atk
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local atk = e:GetHandler():GetAttack()
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.desfilter, tp, 0, LOCATION_MZONE, 1, nil, atk)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, nil, 1, 1 - tp, LOCATION_MZONE)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsFaceup() and c:IsRelateToEffect(e) then
  		local atk = c:GetAttack()
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  		local g = Duel.SelectMatchingCard(tp, s.desfilter, tp, 0, LOCATION_MZONE, 1, 1, nil, atk)
  		if g:GetCount() > 0 then
  			Duel.HintSelection(g)
  			Duel.Destroy(g, REASON_EFFECT)
  		end
  	end
  end
  
  
source_text: Powered
  If this card is Normal or Special Summoned: You can destroy 1 monster your opponent controls with less ATK than this card. You can only use this effect of "Powered Crawler" once per turn. All monsters your opponent controls must attack, if able.
target_text: -- Powered
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--tohand
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY)
  	e1:SetCountLimit(1, id)
  	e1:SetTarget(s.destg)
  	e1:SetOperation(s.desop)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e2)
  	--must attack
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_MUST_ATTACK)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTargetRange(0, LOCATION_MZONE)
  	c:RegisterEffect(e3)
  end
  function s.desfilter(c, atk)
  	return c:IsFaceup() and c:GetAttack() < atk
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local atk = e:GetHandler():GetAttack()
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.desfilter, tp, 0, LOCATION_MZONE, 1, nil, atk)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, nil, 1, 1 - tp, LOCATION_MZONE)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsFaceup() and c:IsRelateToEffect(e) then
  		local atk = c:GetAttack()
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  		local g = Duel.SelectMatchingCard(tp, s.desfilter, tp, 0, LOCATION_MZONE, 1, 1, nil, atk)
  		if g:GetCount() > 0 then
  			Duel.HintSelection(g)
  			Duel.Destroy(g, REASON_EFFECT)
  		end
  	end
  end
  
  