// ----------------------------------
// RSDK Project: Sonic 1/Sonic 2
// Script Description: Belt Activation Object
// Script Author: Christan Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

//-------Aliases-------//
private alias 68 : TYPE_BELTACTIVATION


// Static Values

// Tables

event ObjectMain
end event


event ObjectDraw
end event


event ObjectStartup
	foreach (TypeName[Belt Activation], arrayPos0, ALL_ENTITIES)
		object[arrayPos0].priority = PRIORITY_XBOUNDS
		arrayPos1 = arrayPos0
		object[arrayPos0].value0 = object[arrayPos0].propertyValue
		temp0 = 0
		while temp0 == 0
			if object[arrayPos1].type == TypeName[Belt Platform]
				object[arrayPos0].value1 = arrayPos1
				temp0 = 1
			else
				arrayPos1++
				if arrayPos1 >= 0x420
					temp0 = 1
				end if
			end if
		loop
		object[arrayPos0].value0 += object[arrayPos0].value1
	next
end event

event RSDKDraw
	DrawSprite(0)
end event

event RSDKLoad
	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(-16, -16, 32, 32, 1, 143)
end event
