#define overlay_id	v0
#define overlay_speed	v1

spawn_entity ex_standard_overlay 0 0 PROCESS_NEXT
let last_child.secondary_frame = 4
let last_child.INTERPOLATED_FRAME = 5
let last_child.passed_param_1 = parent
let last_child.passed_param_2 = OPENGL_BOOLEAN_BLEND_add
let last_child.multi_sprite = large_graphics[arb]
let overlay_id = last_child

let signal = 0

let overlay_id.INTERPOLATION_Y_PERCENTAGE = 0

.reset

let overlay_speed = rand 60 120

let counter  = rand 120 180

start
	if counter  = 0 then
		goto pulse
	end_if

	let counter = counter - 1

	if parent.alive < 0 then
		let last_child.signal = 1
		kill_entity own_id
	end_if
end

.pulse

let counter = 0

start
	let counter = counter + overlay_speed

	let overlay_id.INTERPOLATION_X_PERCENTAGE = counter

	if counter >= 10000 then
		goto reset
	end_if

	if parent.alive < 0 then
		let last_child.signal = 1
		kill_entity own_id
	end_if

end
