Burst
Tribute 1 Dragon-Type monster; destroy all face-up monsters on the field whose DEF is less than or equal to the ATK the Tributed monster had on the field.
local s, id, o = GetID()
function s.initial_effect(c)
	--Activate
	local e1 = Effect.CreateEffect(c)
	e1:SetCategory(CATEGORY_DESTROY)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetHintTiming(0, TIMING_END_PHASE + TIMINGS_CHECK_MONSTER)
	e1:SetLabel(1)
	e1:SetCost(s.cost)
	e1:SetTarget(s.target)
	e1:SetOperation(s.activate)
	c:RegisterEffect(e1)
end
function s.cfilter(c, def)
	return c:IsRace(RACE_DRAGON) and c:IsAttackAbove(def)
end
function s.filter(c, atk)
	return c:IsFaceup() and (not atk or c:IsDefenseBelow(atk))
end
function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
		if g:GetCount() == 0 then
			return false
		end
		local mg, mdef = g:GetMinGroup(Card.GetDefense)
		e:SetLabel(0)
		return Duel.CheckReleaseGroup(tp, s.cfilter, 1, nil, mdef)
	end
	local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
	local mg, mdef = g:GetMinGroup(Card.GetDefense)
	local rg = Duel.SelectReleaseGroup(tp, s.cfilter, 1, 1, nil, mdef)
	e:SetLabel(rg:GetFirst():GetAttack())
	Duel.Release(rg, REASON_COST)
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return e:GetLabel() == 0
	end
	local dg = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, nil, e:GetLabel())
	Duel.SetOperationInfo(0, CATEGORY_DESTROY, dg, dg:GetCount(), 0, 0)
end
function s.activate(e, tp, eg, ep, ev, re, r, rp)
	local dg = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, nil, e:GetLabel())
	Duel.Destroy(dg, REASON_EFFECT)
end


Burst
Tribute 1 Dragon-Type monster; destroy all face-up monsters on the field whose DEF is less than or equal to the ATK the Tributed monster had on the field.
-- Burst
local s, id, o = GetID()
function s.initial_effect(c)
	--Activate
	local e1 = Effect.CreateEffect(c)
	e1:SetCategory(CATEGORY_DESTROY)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetHintTiming(0, TIMING_END_PHASE + TIMINGS_CHECK_MONSTER)
	e1:SetLabel(1)
	e1:SetCost(s.cost)
	e1:SetTarget(s.target)
	e1:SetOperation(s.activate)
	c:RegisterEffect(e1)
end
function s.cfilter(c, def)
	return c:IsRace(RACE_DRAGON) and c:IsAttackAbove(def)
end
function s.filter(c, atk)
	return c:IsFaceup() and (not atk or c:IsDefenseBelow(atk))
end
function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
		if g:GetCount() == 0 then
			return false
		end
		local mg, mdef = g:GetMinGroup(Card.GetDefense)
		e:SetLabel(0)
		return Duel.CheckReleaseGroup(tp, s.cfilter, 1, nil, mdef)
	end
	local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
	local mg, mdef = g:GetMinGroup(Card.GetDefense)
	local rg = Duel.SelectReleaseGroup(tp, s.cfilter, 1, 1, nil, mdef)
	e:SetLabel(rg:GetFirst():GetAttack())
	Duel.Release(rg, REASON_COST)
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return e:GetLabel() == 0
	end
	local dg = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, nil, e:GetLabel())
	Duel.SetOperationInfo(0, CATEGORY_DESTROY, dg, dg:GetCount(), 0, 0)
end
function s.activate(e, tp, eg, ep, ev, re, r, rp)
	local dg = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, nil, e:GetLabel())
	Duel.Destroy(dg, REASON_EFFECT)
end

