Path: blob/master/Sonic 1/Scripts/Mission/EggmanSignPost.txt
1483 views
// ----------------------------------1// RSDK Project: Sonic 12// Script Description: EggmanSignPost Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011// Aliases (As Eggman Watcher)12private alias object.value0 : object.eggmanID1314// Aliases (As Sign Post)15private alias object.value0 : object.spinCount16private alias object.value1 : object.spinTimer17// value2 is unused18private alias object.value3 : object.landingYPos1920// States21private alias 0 : EGGMANSIGNPOST_AWAITEGGMAN22private alias 1 : EGGMANSIGNPOST_AWAITDEFEAT23private alias 2 : EGGMANSIGNPOST_FALLTOGROUND24private alias 3 : EGGMANSIGNPOST_SPINNINGONGROUND25private alias 4 : EGGMANSIGNPOST_MISSIONCOMPLETE2627// Eggman Aliases28private alias 4 : EGGMAN_EXPLODE2930// Reserved Object Slot Aliases31private alias 30 : SLOT_ACTFINISH323334// ========================35// Events36// ========================3738event ObjectUpdate39switch object.state40case EGGMANSIGNPOST_AWAITEGGMAN41foreach (TypeName[Eggman], arrayPos0, ACTIVE_ENTITIES)42object.eggmanID = arrayPos043object.state = EGGMANSIGNPOST_AWAITDEFEAT44next45break4647case EGGMANSIGNPOST_AWAITDEFEAT48arrayPos0 = object.eggmanID49if object[arrayPos0].state == EGGMAN_EXPLODE50stage.timeEnabled = false51end if5253if object[arrayPos0].type == TypeName[Blank Object]54object.frame = 155object.spinCount = 1656object.priority = PRIORITY_XBOUNDS57object.landingYPos = object.ypos58object.ypos = screen.cameraY59object.ypos -= screen.ycenter60object.ypos -= 3261object.ypos <<= 1662screen.cameraEnabled = false63object.state = EGGMANSIGNPOST_FALLTOGROUND64end if65break6667case EGGMANSIGNPOST_FALLTOGROUND68object.ypos += object.yvel69object.yvel += 0xC0070if object.ypos >= object.landingYPos71object.ypos = object.landingYPos72PlaySfx(SfxName[Sliding], false)73object.spinCount = 474object.state = EGGMANSIGNPOST_SPINNINGONGROUND75end if7677object.spinTimer++78if object.spinTimer == 279object.spinTimer = 080object.frame++81if object.frame == 582Rand(temp0, 48)83temp0 <<= 1684temp0 += object.xpos85temp0 -= 0x18000086Rand(temp1, 32)87temp1 <<= 1688temp1 += object.ypos89temp1 -= 0x14000090CreateTempObject(TypeName[Ring Sparkle], 0, temp0, temp1)91end if9293if object.frame == 994object.frame = 195Rand(temp0, 48)96temp0 <<= 1697temp0 += object.xpos98temp0 -= 0x18000099Rand(temp1, 32)100temp1 <<= 16101temp1 += object.ypos102temp1 -= 0x140000103CreateTempObject(TypeName[Ring Sparkle], 0, temp0, temp1)104end if105end if106break107108case EGGMANSIGNPOST_SPINNINGONGROUND109music.volume -= 2110object.spinTimer++111if object.spinTimer == 2112object.spinTimer = 0113object.frame++114if object.frame == 5115Rand(temp0, 48)116temp0 <<= 16117temp0 += object.xpos118temp0 -= 0x180000119Rand(temp1, 32)120temp1 <<= 16121temp1 += object.ypos122temp1 -= 0x140000123CreateTempObject(TypeName[Ring Sparkle], 0, temp0, temp1)124end if125126if object.frame == 9127object.frame = 1128Rand(temp0, 48)129temp0 <<= 16130temp0 += object.xpos131temp0 -= 0x180000132Rand(temp1, 32)133temp1 <<= 16134temp1 += object.ypos135temp1 -= 0x140000136CreateTempObject(TypeName[Ring Sparkle], 0, temp0, temp1)137object.spinCount--138if object.spinCount == 0139object.frame = 5140object.state = EGGMANSIGNPOST_MISSIONCOMPLETE141end if142end if143end if144break145146case EGGMANSIGNPOST_MISSIONCOMPLETE147CallNativeFunction2(NotifyCallback, NOTIFY_TOUCH_SIGNPOST, 0)148object[SLOT_ACTFINISH].type = TypeName[Act Finish]149object[SLOT_ACTFINISH].drawOrder = 6150object[SLOT_ACTFINISH].priority = PRIORITY_ACTIVE151break152153end switch154end event155156157event ObjectDraw158if object.state > EGGMANSIGNPOST_AWAITDEFEAT159DrawSprite(0)160DrawSprite(object.frame)161end if162end event163164165event ObjectStartup166LoadSpriteSheet("Global/Items2.gif")167SpriteFrame(-24, 16, 48, 16, 34, 214)168SpriteFrame(-24, -16, 48, 32, 34, 182)169SpriteFrame(-16, -16, 32, 32, 1, 150)170SpriteFrame(-4, -16, 8, 32, 189, 131)171SpriteFrame(-16, -16, 32, 32, 1, 183)172SpriteFrame(-24, -16, 48, 32, 34, 83)173SpriteFrame(-16, -16, 32, 32, 1, 150)174SpriteFrame(-4, -16, 8, 32, 189, 131)175SpriteFrame(-16, -16, 32, 32, 1, 183)176end event177178179// ========================180// Editor Events181// ========================182183event RSDKDraw184DrawSprite(0)185end event186187188event RSDKLoad189LoadSpriteSheet("Global/Items2.gif")190SpriteFrame(-24, 16, 48, 16, 34, 214)191SpriteFrame(-24, -16, 48, 32, 34, 182)192193SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")194end event195196197