Path: blob/master/Sonic 2/Scripts/Mission/MissionAreaBL.txt
1480 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: MissionAreaBL Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.state : object.setBounds1213// Player Aliases14private alias object.xpos : player.xpos15private alias object.ypos : player.ypos16private alias object.xvel : player.xvel17private alias object.yvel : player.yvel18private alias object.speed : player.speed1920// Priority Aliases21private alias 1 : PRIORITY_ACTIVE22private alias 5 : PRIORITY_INACTIVE232425// ========================26// Events27// ========================2829event ObjectUpdate30if object.setBounds == false31stage.newXBoundary1 = object.xpos32stage.newXBoundary1 >>= 1633stage.newXBoundary1 -= 163435stage.newYBoundary2 = object.ypos36stage.newYBoundary2 >>= 1637stage.newYBoundary2 += 163839object.setBounds = true40end if4142if stage.state == STAGE_RUNNING43// Make sure Sonic doesn't go lower than this Object44if player[0].ypos > object.ypos45player[0].yvel = 046player[0].speed = 047player[0].ypos = object.ypos4849game.forceKillPlayer = true50object.priority = PRIORITY_INACTIVE // This Object's job is done, we don't need to be here anymore51end if5253// Make sure Sonic doesn't go before this Object, either54if player[0].xpos < object.xpos55player[0].xvel = 056player[0].speed = 057player[0].xpos = object.xpos5859// In this case though, we aren't gonna unload because we're only enforcing normal walls, not death bounds60end if61end if62end event636465event ObjectDraw66// A whole event exists here, and yet nothing's in it...67end event686970event ObjectStartup71// Cycle through all MissionAreaBL objects in the level and make them active72foreach (TypeName[MissionAreaBL], arrayPos0, ALL_ENTITIES)73object[arrayPos0].priority = PRIORITY_ACTIVE74next75end event767778// ========================79// Editor Events80// ========================8182event RSDKDraw83DrawSprite(0)8485editor.drawingOverlay = true8687temp0 = object.xpos88temp0 -= 0x1000008990temp1 = object.ypos91temp1 += 0x1000009293temp2 = temp094temp2 += 0x3800009596temp3 = temp197temp3 -= 0x3800009899// draw some long corners100// TODO: i don't think this works, ask for a render101DrawLine(temp0, temp1, temp0, temp3, 255, 0, 255)102DrawLine(temp0, temp1, temp2, temp1, 255, 0, 255)103104editor.drawingOverlay = false105end event106107108event RSDKLoad109LoadSpriteSheet("Global/Display.gif")110SpriteFrame(-16, -16, 32, 32, 1, 143)111112SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")113end event114115116