// ----------------------------------
// RSDK Project: Sonic 2
// Script Description: Chemical Splash Object
// Script Author: Christian Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

// ========================
// Aliases
// ========================

// Path ID Aliases
private alias 0 : PATH_A


// ========================
// Events
// ========================

event ObjectUpdate
	object.xpos += object.xvel
	object.ypos += object.yvel
	object.yvel += 0x3800

	temp0 = object.xpos
	temp0 >>= 16
	temp0 -= camera[0].xpos
	Abs(temp0)
	temp0 -= 32

	temp1 = object.ypos
	temp1 >>= 16
	temp1 -= camera[0].ypos
	Abs(temp1)
	temp1 -= 32

	if temp0 >= screen.xcenter
		object.type = TypeName[Blank Object]
	end if

	if temp1 >= screen.ycenter
		object.type = TypeName[Blank Object]
	end if

	ObjectTileCollision(CSIDE_FLOOR, 0, 4, PATH_A)
	if checkResult == true
		object.type = TypeName[Blank Object]
	end if
end event


event ObjectDraw
	DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos)
end event


event ObjectStartup
	// Interestingly, while most objects would just check for their normal zone (Zone02 in this case) and then load MBZ's sheet with an `else`,
	// this object instead checks for the two zone's folders individually
	// How strange.

		LoadSpriteSheet("CPZ/Objects.gif")
		SpriteFrame(-4, -4, 8, 8, 93, 122)
	
end event


// ========================
// Editor Events
// ========================

event RSDKDraw
	DrawSprite(0)
end event


event RSDKLoad
	
		LoadSpriteSheet("CPZ/Objects.gif")
		SpriteFrame(-4, -4, 8, 8, 93, 122)
	
	
	SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
end event
