Path: blob/master/Sonic 2/Scripts/DEZ/EggmanWindow.txt
1483 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: Eggman Window Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias 0 : EGGMANWINDOWANI_WINDOWCLOSED12private alias 1 : EGGMANWINDOWANI_OPENWINDOW13private alias 2 : EGGMANWINDOWANI_IDLE14private alias 3 : EGGMANWINDOWANI_LAUGH15private alias 4 : EGGMANWINDOWANI_STUNNED16private alias 5 : EGGMANWINDOWANI_CLOSEWINDOW1718// Player Aliases19private alias object.animation : player.animation202122// ========================23// Events24// ========================2526event ObjectUpdate27// This event exists in the code, but it's empty...2829// Perhaps animation was originally done here, before being moved to ObjectDraw instead?30// Normally you wouldn't want animation in an ObjectDraw, but it seems to be intentional here so that Eggman keeps laughing after Sonic dies31end event323334event ObjectDraw35switch object.animation36case EGGMANWINDOWANI_WINDOWCLOSED37DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos)38break3940case EGGMANWINDOWANI_OPENWINDOW41object.animationTimer++42if object.animationTimer == 443object.animationTimer = 044object.frame++45if object.frame == 446object.animation = EGGMANWINDOWANI_IDLE47end if48end if4950DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)51break5253case EGGMANWINDOWANI_IDLE54DrawSpriteFX(4, FX_FLIP, object.xpos, object.ypos)55break5657case EGGMANWINDOWANI_LAUGH58temp0 = object.animationTimer59temp0 &= 1560temp0 >>= 361temp0 += 562object.animationTimer++63if object.animationTimer == 5064object.animationTimer = 065if player[0].animation != ANI_DYING66object.animation = EGGMANWINDOWANI_IDLE67end if68end if6970DrawSpriteFX(temp0, FX_FLIP, object.xpos, object.ypos)71break7273case EGGMANWINDOWANI_STUNNED74temp0 = object.animationTimer75object.animationTimer++76if object.animationTimer == 5077object.animationTimer = 078object.animation = EGGMANWINDOWANI_IDLE79end if8081DrawSpriteFX(7, FX_FLIP, object.xpos, object.ypos)82break8384case EGGMANWINDOWANI_CLOSEWINDOW85object.animationTimer++86if object.animationTimer == 487object.animationTimer = 088object.frame--89if object.frame == 090object.animation = EGGMANWINDOWANI_WINDOWCLOSED91end if92end if9394DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)95break9697end switch98end event99100101event ObjectStartup102CheckCurrentStageFolder("Zone12")103if checkResult == true104LoadSpriteSheet("DEZ/Objects.gif")105106// 0 - 3: Opening Window Frames (played in reverse order for closing)107SpriteFrame(-16, -12, 32, 24, 133, 114)108SpriteFrame(-16, -12, 32, 24, 100, 114)109SpriteFrame(-16, -12, 32, 24, 67, 114)110SpriteFrame(-16, -12, 32, 24, 34, 114)111112// 4: Normal Frame113SpriteFrame(-16, -12, 32, 24, 1, 114)114115// 5 - 6: Laughing Frames116SpriteFrame(-16, -12, 32, 24, 166, 114)117SpriteFrame(-16, -12, 32, 24, 199, 114)118119// 7: Stunned Frame120SpriteFrame(-16, -12, 32, 24, 232, 114)121else122LoadSpriteSheet("MBZ/Objects.gif")123124// 0 - 3: Opening Window Frames (played in reverse order for closing)125SpriteFrame(-16, -12, 32, 24, 645, 114)126SpriteFrame(-16, -12, 32, 24, 612, 114)127SpriteFrame(-16, -12, 32, 24, 579, 114)128SpriteFrame(-16, -12, 32, 24, 546, 114)129130// 4: Normal Frame131SpriteFrame(-16, -12, 32, 24, 513, 114)132133// 5 - 6: Laughing Frames134SpriteFrame(-16, -12, 32, 24, 678, 114)135SpriteFrame(-16, -12, 32, 24, 711, 114)136137// 7: Stunned Frame138SpriteFrame(-16, -12, 32, 24, 744, 114)139end if140end event141142143// ========================144// Editor Events145// ========================146147event RSDKDraw148DrawSprite(0)149end event150151152event RSDKLoad153CheckCurrentStageFolder("Zone12")154if checkResult == true155LoadSpriteSheet("DEZ/Objects.gif")156SpriteFrame(-16, -12, 32, 24, 133, 114) // peekin'157else158LoadSpriteSheet("MBZ/Objects.gif")159SpriteFrame(-16, -12, 32, 24, 645, 114)160end if161162SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")163end event164165166