Path: blob/master/Sonic 2/Scripts/WFZ/Eggman.txt
1483 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: Eggman Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.propertyValue : object.setLBounds1213private alias object.value0 : object.timer1415// States16private alias 0 : WFZEGGMAN_AWAITPLAYER17private alias 1 : WFZEGGMAN_WATCHFIGHT18private alias 2 : WFZEGGMAN_ESCAPE1920// Player Aliases21private alias object.xpos : player.xpos2223// Music Events24private alias 26 : SLOT_MUSICEVENT_BOSS2526private alias 0 : MUSICEVENT_FADETOBOSS27private alias 1 : MUSICEVENT_FADETOSTAGE282930// ========================31// Static Values32// ========================3334private value WFZEggman_laserType = 0353637// ========================38// Events39// ========================4041event ObjectUpdate42switch object.state43case WFZEGGMAN_AWAITPLAYER44temp0 = object.xpos45temp0 -= 0x20000046if player[0].xpos > temp047temp0 = stage.newYBoundary248temp0 -= screen.ysize49stage.newYBoundary1 = temp05051if object.setLBounds == true52temp0 = object.ixpos53temp0 -= 212 // (screen.xcenter with the standard screen width of 424)54stage.newXBoundary1 = temp055end if56object.xpos += 0xE000005758// Left barrier59object[+1].type = TypeName[Eggman Barrier]60object[+1].inkEffect = INK_ADD6162// Right barrier63object[+2].type = TypeName[Eggman Barrier]64object[+2].propertyValue = 165object[+2].inkEffect = INK_ADD6667object[+4].type = WFZEggman_laserType6869ResetObjectEntity(SLOT_MUSICEVENT_BOSS, TypeName[Music Event], MUSICEVENT_FADETOBOSS, 0, 0)70object[SLOT_MUSICEVENT_BOSS].priority = PRIORITY_ACTIVE7172object.priority = PRIORITY_ACTIVE73object.state = WFZEGGMAN_WATCHFIGHT74end if75break7677case WFZEGGMAN_WATCHFIGHT78break7980case WFZEGGMAN_ESCAPE81object.ypos += 0x1000082object.timer++83if object.timer == 24084stage.newYBoundary1 = 085object.type = TypeName[Blank Object]86ResetObjectEntity(SLOT_MUSICEVENT_BOSS, TypeName[Music Event], MUSICEVENT_FADETOSTAGE, 0, 0)87object[SLOT_MUSICEVENT_BOSS].priority = PRIORITY_ACTIVE88end if89break9091end switch9293object.animationTimer++94if object.animationTimer >= 695object.animationTimer = 096object.frame ^= 197end if98end event99100101event ObjectDraw102if object.state > 0103DrawSprite(object.frame)104DrawSprite(2)105end if106end event107108109event ObjectStartup110CheckCurrentStageFolder("Zone11")111if checkResult == true112LoadSpriteSheet("SCZ/Objects.gif")113SpriteFrame(-16, -28, 32, 52, 398, 203)114SpriteFrame(-16, -27, 32, 51, 431, 204)115SpriteFrame(-32, 24, 64, 24, 1, 146)116WFZEggman_laserType = TypeName[Eggman Laser]117else118LoadSpriteSheet("MBZ/Objects.gif")119SpriteFrame(-16, -28, 32, 52, 737, 58)120SpriteFrame(-16, -27, 32, 51, 770, 58)121SpriteFrame(-32, 24, 64, 24, 464, 999)122WFZEggman_laserType = TypeName[Eggman Laser 3]123end if124end event125126127// ========================128// Editor Events129// ========================130131event RSDKEdit132if editor.returnVariable == true133switch editor.variableID134case EDIT_VAR_PROPVAL // property value135checkResult = object.propertyValue136break137138case 0 // setLBounds139checkResult = object.propertyValue140break141142end switch143else144switch editor.variableID145case EDIT_VAR_PROPVAL // property value146object.propertyValue = editor.variableValue147break148149case 0 // setLBounds150object.propertyValue = editor.variableValue151break152153end switch154end if155end event156157158event RSDKDraw159DrawSprite(0)160end event161162163event RSDKLoad164CheckCurrentStageFolder("Zone11")165if checkResult == true166LoadSpriteSheet("SCZ/Objects.gif")167SpriteFrame(-16, -28, 32, 52, 398, 203)168else169LoadSpriteSheet("MBZ/Objects.gif")170SpriteFrame(-16, -28, 32, 52, 737, 58)171end if172173AddEditorVariable("setLBounds")174SetActiveVariable("setLBounds")175AddEnumVariable("false", false)176AddEnumVariable("true", true)177end event178179180