Path: blob/main/Scripts/DAGarden/MetalSonic.txt
1319 views
//--------------Sonic CD Metal Sonic 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.YOffSet7#alias Object.Value2 : Object.Wobble8#alias Object.Value3 : Object.XOffSet9#alias Object.Value4 : Object.Speed1011// States12#alias 0 : METALSONIC_SETUP13#alias 1 : METALSONIC_GOTO_CENTER14#alias 2 : METALSONIC_SET_DIRECTION15#alias 3 : METALSONIC_START_CHARGE16#alias 4 : METALSONIC_LEAVE171819sub ObjectMain20switch Object.State21case METALSONIC_SETUP22Object.XOffSet = Screen.CenterX23Object.XOffSet <<= 1624if Object.XPos < Object.XOffSet25Object.Direction = FACING_RIGHT26else27Object.Direction = FACING_LEFT28end if29Object.State++30break3132case METALSONIC_GOTO_CENTER33TempValue0 = Object.XOffSet34TempValue0 -= Object.XPos35TempValue0 >>= 53637TempValue1 = 0x78000038TempValue1 -= Object.YPos39TempValue1 >>= 54041Object.XPos += TempValue042Object.YPos += TempValue14344Object.Timer++45if Object.Timer == 12046Object.Timer = 047Object.YOffSet = Object.YPos48Object.State++49end if50Object.AnimationTimer++51Object.AnimationTimer &= 752break5354case METALSONIC_SET_DIRECTION55Object.Wobble += 856Object.Wobble &= 51157Sin(Object.YPos, Object.Wobble)58Object.YPos <<= 959Object.YPos += Object.YOffSet6061Object.Timer++62if Object.Timer == 10063Object.Timer = 064Object.YOffSet = Object.YPos6566Object.Direction++67Object.Direction &= FACING_LEFT68Object.State++69end if70Object.AnimationTimer++71Object.AnimationTimer &= 772break7374case METALSONIC_START_CHARGE75Object.Wobble += 6476Object.Wobble &= 51177Sin(Object.YPos, Object.Wobble)78Object.YPos <<= 779Object.YPos += Object.YOffSet8081if Object.Direction == FACING_LEFT82Object.XPos += 0x800083else84Object.XPos -= 0x800085end if8687Object.Timer++88if Object.Timer == 9089Object.Timer = 090Object.Speed = 0x1000091Object.State++92end if9394Object.AnimationTimer++95Object.AnimationTimer &= 796break9798case METALSONIC_LEAVE99if Object.Direction == FACING_RIGHT100Object.XPos += Object.Speed101else102Object.XPos -= Object.Speed103end if104Object.Speed += 0x3000105106Object.AnimationTimer += 2107Object.AnimationTimer %= 5108break109110end switch111112if Object.OutOfBounds == true113Object.Type = TypeName[Blank Object]114end if115end sub116117118sub ObjectDraw119// Jet Flame120TempValue0 = Object.AnimationTimer121TempValue0 >>= 1122TempValue0++123DrawSpriteFX(TempValue0, FX_FLIP, Object.XPos, Object.YPos)124125// Metal126DrawSpriteFX(0, FX_FLIP, Object.XPos, Object.YPos)127end sub128129130sub ObjectStartup131LoadSpriteSheet("DAGarden/Objects.gif")132133// 0 - Metal Sonic134SpriteFrame(-16, -24, 32, 48, 429, 804)135136// 1-4 - Jet Flame Animation Frames137SpriteFrame(-24, -12, 24, 24, 462, 804)138SpriteFrame(-24, -12, 24, 24, 487, 804)139SpriteFrame(-24, -12, 0, 0, 462, 804)140SpriteFrame(-24, -12, 0, 0, 487, 804)141end sub142143144// ========================145// Editor Subs146// ========================147148sub RSDKDraw149DrawSprite(0)150end sub151152153sub RSDKLoad154LoadSpriteSheet("DAGarden/Objects.gif")155SpriteFrame(-16, -24, 32, 48, 429, 804) // #0 - Metal Sonic156157SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")158end sub159160161