Path: blob/main/Scripts/Global/ObjectScore.txt
1319 views
//----------------Sonic CD Object Score Script----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.BadnikBonus // Used this way by Object[26]6#alias Object.Value0 : Object.Timer // Used this way by temp spawned objects7#alias Object.Value1 : Object.Gravity // (Stores the Player's gravity, this object itself doesn't move or need gravity or anything)89// States10#alias 0 : OBJECTSCORE_SCORE // Temp object spawned after destroying a badnik11#alias 1 : OBJECTSCORE_CONTROL // Object[26], keeping track of the Player's Badnik Bonus1213// Priority14#alias 1 : PRIORITY_ACTIVE1516sub ObjectDraw17if Object.State == OBJECTSCORE_SCORE18#platform: Use_Origins19if game.playMode == BOOT_PLAYMODE_MIRRORING20Object.Direction = FACING_LEFT21DrawSpriteFX(Object.PropertyValue, FX_FLIP, Object.XPos, Object.YPos)22else23DrawSprite(Object.PropertyValue)24end if25#endplatform2627#platform: Use_Standalone28DrawSprite(Object.PropertyValue)29#endplatform3031Object.YPos -= 0x200003233Object.Timer++34// Note:35// the way that CD 2011 / Origins has implemented this object & the incrementation system is inaccurate to the 1993 release.36// This check below only increments the combo bonus when the object despawns.37// -> if there is more than one Object Score on screen, it will not count up the combo bonus until they despawn.38if Object.Timer == 2439Object.Type = TypeName[Blank Object]40if Object[26].Type == TypeName[Object Score] // Do we already have a chain going?41// small note: Sonic CD 1993 *does* actually have the proper 16-hit combo bonus, but it wasn't included in the remake.42if Object[26].BadnikBonus < 3 // If the hit combo is less than 3 (4-hit combo bonus)...43Object[26].BadnikBonus++ // Increase the count!44end if45else46Object[26].Type = TypeName[Object Score]47Object[26].BadnikBonus = 148end if4950Object[26].State = OBJECTSCORE_CONTROL51Object[26].Gravity = Player.Gravity52Object[26].Priority = PRIORITY_ACTIVE53end if54else55// Bug Details:56// This checks the Score Object's stored gravity against the Player's, and while this technically works here for resetting most of the time57// -> it actually causes an issue where it resets upon jumping, making the player unable to continue the combo bonus.58// -> Sonic CD 1993 acts more like S1 where you can continue the combo bonus after rolling, then jumping from a stand-still or from the roll.59// -> The only difference is that you can preserve your combo bonus in the original MCD release by standing on objects (which is a bug of that version).60if Object.Gravity != Player.Gravity61ResetObjectEntity(26, TypeName[Blank Object], 0, 0, 0)62end if63end if64end sub656667sub ObjectStartup68LoadSpriteSheet("Global/Items3.gif")6970SpriteFrame(-6, -4, 12, 8, 0, 246) // #0 - 10071SpriteFrame(-7, -4, 13, 8, 20, 246) // #1 - 20072SpriteFrame(-7, -4, 13, 8, 33, 246) // #2 - 50073SpriteFrame(-8, -4, 16, 8, 0, 246) // #3 - 100074end sub757677// ========================78// Editor Subs79// ========================8081sub RSDKDraw82DrawSprite(0)83end sub848586sub RSDKLoad87LoadSpriteSheet("Global/Items3.gif")88SpriteFrame(-6, -4, 12, 8, 0, 246) // #0 - 1008990SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")91end sub929394