Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
FLIP: All face-up monsters on the field loses 500 ATK, except Reptile-Type "Worm" monsters.
--ワーム・オペラ
--Worm Opera
local s,id=GetID()
function s.initial_effect(c)
	--flip
	local e1=Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_FLIP+EFFECT_TYPE_SINGLE)
	e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
	e1:SetOperation(s.valop)
	c:RegisterEffect(e1)
end
s.listed_series={SET_WORM}
function s.filter(c)
	return c:IsFaceup() and not (c:IsSetCard(SET_WORM) and c:IsRace(RACE_REPTILE))
end
function s.valop(e,tp,eg,ep,ev,re,r,rp)
	local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
	local tc=g:GetFirst()
	for tc in aux.Next(g) do
		local e1=Effect.CreateEffect(e:GetHandler())
		e1:SetType(EFFECT_TYPE_SINGLE)
		e1:SetCode(EFFECT_UPDATE_ATTACK)
		e1:SetValue(-500)
		e1:SetReset(RESET_EVENT|RESETS_STANDARD)
		tc:RegisterEffect(e1)
	end
end