Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is activated: You can Ritual Summon 1 Beast-Warrior Ritual Monster from your hand, by Tributing monsters from your hand or field whose total Levels equal or exceed its Level. If this face-up card is sent from the Spell & Trap Zone to the GY: You can target 1 "Fire Fist" monster in your GY; Special Summon it. You can only use this effect of "Fire Formation - Domei" once per turn. You can only activate 1 "Fire Formation - Domei" per turn.
--炎舞－「洞明」
--Fire Formation - Domei
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
	--When activated, ritual summon 1 beast-warrior ritual monster from hand
	local e1=Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
	e1:SetTarget(s.target(Ritual.Target(s.filter,RITPROC_GREATER),Ritual.Operation(s.filter,RITPROC_GREATER)))
	c:RegisterEffect(e1)
	--If this face-up card is sent to GY, special summon 1 "Fire Fist" monster from GY
	local e2=Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id,1))
	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
	e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
	e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
	e2:SetCode(EVENT_TO_GRAVE)
	e2:SetCountLimit(1,{id,1})
	e2:SetCondition(s.spcon)
	e2:SetTarget(s.sptg)
	e2:SetOperation(s.spop)
	c:RegisterEffect(e2)
end
s.listed_series={SET_FIRE_FIST}
function s.filter(c)
	return c:IsRace(RACE_BEASTWARRIOR) and c:IsRitualMonster()
end
function s.target(tg,op)
	return function(e,tp,eg,ep,ev,re,r,rp,chk)
		if chk==0 then return true end
		if tg(e,tp,eg,ep,ev,re,r,rp,0) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
			e:SetCategory(CATEGORY_SPECIAL_SUMMON)
			e:SetOperation(s.rop(op))
			tg(e,tp,eg,ep,ev,re,r,rp,1)
		end
	end
end
function s.rop(op)
	return  function(e,tp,eg,ep,ev,re,r,rp)
				if not e:GetHandler():IsRelateToEffect(e) then return end
				op(e,tp,eg,ep,ev,re,r,rp)
			end
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
	return e:GetHandler():IsPreviousPosition(POS_FACEUP)
		and e:GetHandler():IsPreviousLocation(LOCATION_SZONE)
end
function s.spfilter(c,e,tp)
	return c:IsSetCard(SET_FIRE_FIST) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
	if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,tp) end
	if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
	local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
	Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
	local tc=Duel.GetFirstTarget()
	if tc and tc:IsRelateToEffect(e) then
		Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
	end
end