Path: blob/master/Sonic 2/Scripts/Ending/Bird.txt
1479 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: Bird Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.value0 : object.timer12private alias object.value1 : object.startPos.y13private alias object.value2 : object.velStore.y1415// States16private alias 0 : BIRD_SETUP17private alias 1 : BIRD_FLYIN18private alias 2 : BIRD_ENTERBIRD19private alias 3 : BIRD_FLYWITHPLANE20private alias 4 : BIRD_FLYOUT2122// Player Aliases23private alias object.ypos : player.ypos24private alias 0 : SUPERSTATE_NONE252627// ========================28// Events29// ========================3031event ObjectUpdate32switch object.state33case BIRD_SETUP34Rand(object.xpos, 112)35object.xpos += -16036object.xpos <<= 163738Rand(object.ypos, 224)39object.ypos -= 11240object.ypos += camera[0].ypos41object.ypos <<= 1642if stage.playerListPos == PLAYER_TAILS_A43object.frame = 444end if4546if Player_superState != SUPERSTATE_NONE47object.frame = 248end if4950if object.ypos < player[0].ypos51object.yvel = 0x200052else53object.yvel = -0x200054end if55object.state = BIRD_FLYIN56break5758case BIRD_FLYIN59object.timer--60if object.timer < 061object.timer = 2446263if object.ypos < player[0].ypos64object.ypos -= 0x6800065else66object.ypos += 0x6800067end if6869object.state = BIRD_ENTERBIRD70end if71break7273case BIRD_ENTERBIRD74object.xpos += 0x1000075object.ypos += object.yvel7677object.timer--78if object.timer < 079object.timer = 38480object.startPos.y = object.ypos81object.velStore.y = object.yvel82object.yvel = 0x800083object.state = BIRD_FLYWITHPLANE84end if85break8687case BIRD_FLYWITHPLANE88object.ypos += object.yvel89if object.ypos > object.startPos.y90object.yvel -= 0x40091else92object.yvel += 0x40093end if9495object.timer--96if object.timer < 097object.timer = 24498object.yvel = object.velStore.y99object.state = BIRD_FLYOUT100end if101break102103case BIRD_FLYOUT104object.xpos -= 0x10000105object.ypos += object.yvel106107object.timer--108if object.timer < 0109object.type = TypeName[Blank Object]110end if111break112113end switch114115// Animate the object116object.animationTimer++117if object.animationTimer == 6118object.animationTimer = 0119object.frame ^= 1120end if121end event122123124event ObjectDraw125DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)126end event127128129event ObjectStartup130LoadSpriteSheet("Global/Items2.gif")131132// 0-1 - Blue Flicky Frames133SpriteFrame(-8, -7, 16, 15, 66, 239)134SpriteFrame(-8, -8, 16, 15, 83, 239)135136// 2-3 - Eagle Frames137SpriteFrame(-8, -8, 16, 15, 32, 239)138SpriteFrame(-8, -7, 16, 15, 49, 239)139140// 4-5 - Cucky Frames141SpriteFrame(-7, -8, 14, 16, 1, 239)142SpriteFrame(-7, -8, 15, 16, 16, 239)143end event144145146// ========================147// Editor Events148// ========================149150event RSDKDraw151DrawSprite(0)152end event153154155event RSDKLoad156LoadSpriteSheet("Global/Items2.gif")157SpriteFrame(-8, -7, 16, 15, 66, 239)158159SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")160end event161162163