Path: blob/main/Scripts/Animals/R6_Bird.txt
1319 views
//----------------Sonic CD Flying Bird Script-----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.Timer6#alias Object.Value1 : Object.Angle78// HUD alias9#alias Object[24].PropertyValue : HUD.CurrentTimePeriod1011// States12#alias 0 : FLYINGBIRD_FLYRIGHT13#alias 1 : FLYINGBIRD_FLYLEFT1415// Time Period Aliases16#alias 2 : TIME_GOOD_FUTURE171819sub ObjectMain20switch Object.State21case FLYINGBIRD_FLYRIGHT22if Object.Angle > 023Object.Angle -= 224else25// Apex reached, turn around2627Object.State = FLYINGBIRD_FLYLEFT28Object.Direction = FACING_LEFT29end if30break3132case FLYINGBIRD_FLYLEFT33if Object.Angle < 25634Object.Angle += 235else36// Crest of the path reached, turn right back around again3738Object.State = FLYINGBIRD_FLYRIGHT39Object.Direction = FACING_RIGHT40end if41break4243end switch4445// Animate the Bird46Object.Timer++47if Object.Timer > 1948Object.Timer = 04950Object.Frame++51Object.Frame &= 152end if5354end sub555657sub ObjectDraw58if MetalSonic_Destroyed == true59Cos(TempValue0, Object.Angle)60TempValue0 <<= 1461TempValue0 += Object.XPos6263Sin(TempValue1, Object.Angle)64TempValue1 <<= 1465TempValue1 += Object.YPos6667DrawSpriteFX(Object.Frame, FX_FLIP, TempValue0, TempValue1)68else69if HUD.CurrentTimePeriod == TIME_GOOD_FUTURE70Cos(TempValue0, Object.Angle)71TempValue0 <<= 1472TempValue0 += Object.XPos7374Sin(TempValue1, Object.Angle)75TempValue1 <<= 1476TempValue1 += Object.YPos7778DrawSpriteFX(Object.Frame, FX_FLIP, TempValue0, TempValue1)79end if80end if8182end sub838485sub ObjectStartup8687LoadSpriteSheet("R6/Objects.gif")8889SpriteFrame(-12, -8, 24, 16, 197, 34)90SpriteFrame(-12, -8, 24, 16, 197, 51)9192// Find and setup all Flying Bird Objects in the Level93ArrayPos0 = 3294while ArrayPos0 < 105695if Object[ArrayPos0].Type == TypeName[Flying Bird]9697// Make all Flying Birds draw ontop of other objects & level tiles98Object[ArrayPos0].DrawOrder = 599100end if101102ArrayPos0++103loop104105end sub106107108// ========================109// Editor Subs110// ========================111112sub RSDKDraw113DrawSprite(0)114end sub115116117sub RSDKLoad118LoadSpriteSheet("R6/Objects.gif")119SpriteFrame(-12, -8, 24, 16, 197, 34)120121SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")122end sub123124125