Path: blob/main/Scripts/R1/TagaTaga.txt
1319 views
//-----------------Sonic CD TagaTaga 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.YVelocity7#alias Object.Value2 : Object.YOriginPos89#alias Object.PropertyValue : Object.Quality1011// States12#alias 0 : TAGATAGA_SET_LAUNCH_SPEED13#alias 1 : TAGATAGA_EMERGE14#alias 2 : TAGATAGA_MOVE_PINCH_115#alias 3 : TAGATAGA_TURN_116#alias 4 : TAGATAGA_TURN_217#alias 5 : TAGATAGA_TURN_318#alias 6 : TAGATAGA_MOVE_PINCH_219#alias 7 : TAGATAGA_SUBMERGE2021// Stage SFX22#alias 3 : SFX_S_WATERSPLASH2324// Badnik Quality / Property Values25#alias 0 : GOOD_QUALITY26#alias 1 : BAD_QUALITY2728// Priority29#alias 0 : PRIORITY_BOUNDS30#alias 1 : PRIORITY_ACTIVE313233sub ObjectMain34if Object.Quality == GOOD_QUALITY3536switch Object.State37case TAGATAGA_SET_LAUNCH_SPEED38Object.YVelocity = -0x400003940Object.Timer = 14142Object.State = TAGATAGA_EMERGE43break4445case TAGATAGA_EMERGE46Object.YVelocity += 0x100047Object.YPos += Object.YVelocity4849Object.Timer++50if Object.Timer > 2451Object.State = TAGATAGA_MOVE_PINCH_152end if53break5455case TAGATAGA_MOVE_PINCH_156Object.YVelocity += 0x100057Object.YPos += Object.YVelocity5859Object.Timer++60if Object.Timer > 4861Object.State = TAGATAGA_TURN_162end if63break6465case TAGATAGA_TURN_166Object.YVelocity += 0x100067Object.YPos += Object.YVelocity6869Object.Timer++70if Object.Timer > 5671Object.State = TAGATAGA_TURN_272end if73break7475case TAGATAGA_TURN_276Object.YVelocity += 0x100077Object.YPos += Object.YVelocity7879Object.Timer++80if Object.Timer > 6481Object.State = TAGATAGA_TURN_382end if83break8485case TAGATAGA_TURN_386Object.YVelocity += 0x100087Object.YPos += Object.YVelocity8889Object.Timer++90if Object.Timer > 9691Object.State = TAGATAGA_MOVE_PINCH_292end if93break9495case TAGATAGA_MOVE_PINCH_296Object.YVelocity += 0x100097Object.YPos += Object.YVelocity9899Object.Timer++100if Object.Timer > 128101Object.State = TAGATAGA_SUBMERGE102PlayStageSfx(SFX_S_WATERSPLASH, false)103end if104break105106case TAGATAGA_SUBMERGE107Object.Timer++108if Object.Timer > 204109Object.State = TAGATAGA_SET_LAUNCH_SPEED110111Object.Timer = 0112113Object.YPos = Object.YOriginPos114PlayStageSfx(SFX_S_WATERSPLASH, false)115end if116break117118end switch119120else121switch Object.State122case TAGATAGA_SET_LAUNCH_SPEED123Object.YVelocity = -0x30000124125Object.Timer = 1126127Object.State = TAGATAGA_EMERGE128break129130case TAGATAGA_EMERGE131Object.YVelocity += 0xEC4132Object.YPos += Object.YVelocity133134Object.Timer++135if Object.Timer > 40136Object.State = TAGATAGA_MOVE_PINCH_1137end if138break139140case TAGATAGA_MOVE_PINCH_1141Object.YVelocity += 0xEC4142Object.YPos += Object.YVelocity143144Object.Timer++145if Object.Timer > 50146Object.State = TAGATAGA_TURN_1147end if148break149150case TAGATAGA_TURN_1151Object.YVelocity += 0xEC4152Object.YPos += Object.YVelocity153154Object.Timer++155if Object.Timer > 60156Object.State = TAGATAGA_TURN_2157end if158break159160case TAGATAGA_TURN_2161Object.YVelocity += 0xEC4162Object.YPos += Object.YVelocity163164Object.Timer++165if Object.Timer > 104166Object.State = TAGATAGA_TURN_3167PlayStageSfx(SFX_S_WATERSPLASH, false)168end if169break170171case TAGATAGA_TURN_3172Object.Timer++173if Object.Timer > 188174Object.State = TAGATAGA_SET_LAUNCH_SPEED175176Object.Timer = 0177178Object.YPos = Object.YOriginPos179PlayStageSfx(SFX_S_WATERSPLASH, false)180end if181break182183end switch184185end if186CallFunction(StageSetup_CheckGoodFuture) // Check if it should be a flower187end sub188189190sub ObjectPlayerInteraction191if Object.Quality == GOOD_QUALITY192if Object.State < TAGATAGA_SUBMERGE193#platform: Use_Origins194PlayerObjectCollision(C_ENEMY, -16, -16, 16, 16)195#endplatform196#platform: Use_Standalone197PlayerObjectCollision(C_TOUCH, -16, -16, 16, 16)198#endplatform199if CheckResult == true200CallFunction(Player_BadnikBreak)201end if202end if203else204if Object.State < TAGATAGA_TURN_3205#platform: Use_Origins206PlayerObjectCollision(C_ENEMY, -16, -16, 16, 16)207#endplatform208#platform: Use_Standalone209PlayerObjectCollision(C_TOUCH, -16, -16, 16, 16)210#endplatform211if CheckResult == true212CallFunction(Player_BadnikBreak)213end if214end if215end if216end sub217218219sub ObjectDraw220if Object.Quality == GOOD_QUALITY221switch Object.State222case TAGATAGA_SET_LAUNCH_SPEED223case TAGATAGA_EMERGE224DrawSprite(0)225break226227case TAGATAGA_MOVE_PINCH_1228TempValue0 = Object.Timer229TempValue0 &= 15230if TempValue0 < 8231DrawSprite(0)232else233DrawSprite(1)234end if235break236237case TAGATAGA_TURN_1238DrawSprite(2)239break240241case TAGATAGA_TURN_2242DrawSprite(3)243break244245case TAGATAGA_TURN_3246DrawSprite(4)247break248249case TAGATAGA_MOVE_PINCH_2250TempValue0 = Object.Timer251TempValue0 &= 15252if TempValue0 < 8253DrawSprite(4)254else255DrawSprite(5)256end if257break258259end switch260else261switch Object.State262case TAGATAGA_SET_LAUNCH_SPEED263case TAGATAGA_EMERGE264DrawSprite(6)265break266267case TAGATAGA_MOVE_PINCH_1268DrawSprite(7)269break270271case TAGATAGA_TURN_1272DrawSprite(8)273break274275case TAGATAGA_TURN_2276DrawSprite(9)277break278279end switch280end if281end sub282283284sub ObjectStartup285LoadSpriteSheet("R1/Objects.gif")286287// Good TagaTaga288SpriteFrame(-16, -22, 32, 44, 223, 154) // #0 - TagaTaga emerge Frame 0289SpriteFrame(-16, -22, 32, 44, 223, 199) // #1 - TagaTaga emerge Frame 1290SpriteFrame(-16, -16, 32, 32, 35, 109) // #2 - TagaTaga turning Frame 0291SpriteFrame(-16, -16, 32, 32, 68, 109) // #3 - TagaTaga turning Frame 1292SpriteFrame(-16, -22, 32, 44, 1, 101) // #4 - TagaTaga submerge Frame 0293SpriteFrame(-16, -22, 32, 44, 1, 146) // #5 - TagaTaga submerge Frame 1294295// Bad TagaTaga296SpriteFrame(-16, -22, 32, 44, 223, 154) // #6 - TagaTaga emerge Frame 0297SpriteFrame(-16, -16, 32, 32, 35, 109) // #7 - TagaTaga turning Frame 0298SpriteFrame(-16, -16, 32, 32, 35, 142) // #8 - TagaTaga turning Frame 1299SpriteFrame(-16, -22, 32, 44, 1, 191) // #9 - TagaTaga submerge Frame 0300301// Used to be below LoadSpriteSheet, moved here for consistency302ArrayPos0 = 32303while ArrayPos0 < 1056304if Object[ArrayPos0].Type == TypeName[TagaTaga]305Object[ArrayPos0].YOriginPos = Object[ArrayPos0].YPos306end if307ArrayPos0++308loop309end sub310311312// ========================313// Editor Subs314// ========================315316sub RSDKEdit317if Editor.ReturnVariable == true318switch Editor.VariableID319case EDIT_VAR_PROPVAL // Property Value320CheckResult = Object.PropertyValue321CheckResult &= 1322break323case 0 // type324CheckResult = Object.PropertyValue325CheckResult &= 1326break327end switch328else329switch Editor.VariableID330case EDIT_VAR_PROPVAL // Property Value331Object.PropertyValue = Editor.VariableValue332Object.PropertyValue &= 1333break334case 0 // type335Object.PropertyValue = Editor.VariableValue336Object.PropertyValue &= 1337break338end switch339end if340end sub341342343sub RSDKDraw344DrawSprite(Object.PropertyValue)345end sub346347348sub RSDKLoad349LoadSpriteSheet("R1/Objects.gif")350351// Good TagaTaga352SpriteFrame(-16, -22, 32, 44, 223, 154) // #0 - TagaTaga emerge353// Bad TagaTaga354SpriteFrame(-16, -22, 32, 44, 223, 154) // #1 - TagaTaga emerge355356AddEditorVariable("condition")357SetActiveVariable("condition")358AddEnumVariable("Good Quality", GOOD_QUALITY)359AddEnumVariable("Bad Quality", BAD_QUALITY)360end sub361362363