Path: blob/main/Scripts/Animals/R4_RedFish.txt
1319 views
//-----------------Sonic CD Red Fish 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 : REDFISH_SWIMRIGHT13#alias 1 : REDFISH_SWIMLEFT1415// Time Period Aliases16#alias 2 : TIME_GOOD_FUTURE171819sub ObjectMain20switch Object.State21case REDFISH_SWIMRIGHT22if Object.Angle < 51223Object.Angle += 22425// Move a pixel right26Object.XPos += 0x1000027else28// Apex reached, turn around29Object.State = REDFISH_SWIMLEFT30Object.Direction = FACING_LEFT31end if32break3334case REDFISH_SWIMLEFT35if Object.Angle > 036Object.Angle -= 23738// Just keep swimming, move a pixel left now39Object.XPos -= 0x1000040else41// Other side's apex reached, turn right back around again42Object.State = REDFISH_SWIMRIGHT43Object.Direction = FACING_RIGHT44end if45break4647end switch4849// Animate the Fish50Object.Timer++51if Object.Timer > 1952Object.Timer = 053Object.Frame++54Object.Frame &= 155end if5657end sub585960sub ObjectDraw61// With this current system set up, that does indeed mean the sprite gets drawn twice if62// in the Good Future and the Metal Sonic Projector has been destroyed6364if MetalSonic_Destroyed == true65Sin(TempValue1, Object.Angle)66TempValue1 <<= 1267TempValue1 += Object.YPos6869DrawSpriteFX(Object.Frame, FX_FLIP, Object.XPos, TempValue1)70end if7172if HUD.CurrentTimePeriod == TIME_GOOD_FUTURE73Sin(TempValue1, Object.Angle)74TempValue1 <<= 1275TempValue1 += Object.YPos7677DrawSpriteFX(Object.Frame, FX_FLIP, Object.XPos, TempValue1)78end if7980end sub818283sub ObjectStartup8485LoadSpriteSheet("R4/Objects3.gif")8687// Fishy Frames8889SpriteFrame(-8, -12, 16, 24, 1, 67)90SpriteFrame(-8, -12, 16, 24, 18, 67)9192end sub939495// ========================96// Editor Subs97// ========================9899sub RSDKDraw100DrawSprite(0)101end sub102103104sub RSDKLoad105LoadSpriteSheet("R4/Objects3.gif")106SpriteFrame(-8, -12, 16, 24, 1, 67)107108SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")109end sub110111112