Path: blob/main/Scripts/Mission/EggmanSignPost.txt
1319 views
//--------------Sonic CD Eggman Sign Post Script--------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//3//-------Intended for Mission "M099 - Eggman: Speed Up"-------//45// Aliases6#alias Object.Value0 : Object.Timer7#alias Object.Value1 : Object.FrameTimer8#alias Object.Value2 : Object.YVelocity9#alias Object.Value3 : Object.JetpackEntity1011// States12#alias 0 : EGGSIGNPOST_CHECK_JETPACK13#alias 1 : EGGSIGNPOST_CHECK_BOSS_LEAVE14#alias 2 : EGGSIGNPOST_SET_SPAWN15#alias 3 : EGGSIGNPOST_AIR_FLIP16#alias 4 : EGGSIGNPOST_FLIP17#alias 5 : EGGSIGNPOST_RESET18#alias 6 : EGGSIGNPOST_TRIGGER_ACTFINISH19#alias 7 : EGGSIGNPOST_STOP_PLAYER2021// Eggman Jetpack States22#alias 2 : R1_EGGMAN_ESCAPE2324// Priority25#alias 1 : PRIORITY_ACTIVE26#alias 3 : PRIORITY_XBOUNDS2728// Collision Sides29#alias 0 : CSIDE_FLOOR3031// Control Mode32#alias -1 : CONTROLMODE_NONE333435sub ObjectMain3637switch Object.State38case EGGSIGNPOST_CHECK_JETPACK39ArrayPos0 = 3240while ArrayPos0 < 105641if Object[ArrayPos0].Type == TypeName[Eggman Jetpack]42Object.JetpackEntity = ArrayPos043Object.State = EGGSIGNPOST_CHECK_BOSS_LEAVE4445ArrayPos0 = 200046end if4748ArrayPos0++49loop50break5152case EGGSIGNPOST_CHECK_BOSS_LEAVE53ArrayPos0 = Object.JetpackEntity54if Object[ArrayPos0].Type == TypeName[Blank Object]55Object.Frame = 156Object.Timer = 1657Object.State = EGGSIGNPOST_SET_SPAWN58Object.Priority = PRIORITY_XBOUNDS59end if60break6162case EGGSIGNPOST_SET_SPAWN63Object.XPos = Screen.XOffset64Object.XPos += Screen.CenterX65Object.XPos <<= 1666Object.YPos = Screen.YOffset67Object.YPos <<= 1668Object.State = EGGSIGNPOST_AIR_FLIP69break7071case EGGSIGNPOST_AIR_FLIP72Object.YPos += Object.YVelocity73Object.YVelocity += 0xC0074ObjectTileCollision(CSIDE_FLOOR,0,8,0)75if CheckResult == true76Object.Timer = 477Object.State = EGGSIGNPOST_FLIP78end if7980Object.FrameTimer++81if Object.FrameTimer == 282Object.FrameTimer = 083Object.Frame++84if Object.Frame == 585Rand(TempValue0, 48)86TempValue0 <<= 1687TempValue0 += Object.XPos88TempValue0 -= 0x18000089Rand(TempValue1, 32)90TempValue1 <<= 1691TempValue1 += Object.YPos92TempValue1 -= 0x14000093CreateTempObject(TypeName[Ring Sparkle], 0, TempValue0, TempValue1)94end if9596if Object.Frame == 997Object.Frame = 198Rand(TempValue0, 48)99TempValue0 <<= 16100TempValue0 += Object.XPos101TempValue0 -= 0x180000102Rand(TempValue1, 32)103TempValue1 <<= 16104TempValue1 += Object.YPos105TempValue1 -= 0x140000106CreateTempObject(TypeName[Ring Sparkle], 0, TempValue0, TempValue1)107end if108end if109break110111case EGGSIGNPOST_FLIP112Music.Volume -= 2113Object.FrameTimer++114if Object.FrameTimer == 2115Object.FrameTimer = 0116Object.Frame++117if Object.Frame == 5118Rand(TempValue0, 48)119TempValue0 <<= 16120TempValue0 += Object.XPos121TempValue0 -= 0x180000122Rand(TempValue1, 32)123TempValue1 <<= 16124TempValue1 += Object.YPos125TempValue1 -= 0x140000126CreateTempObject(TypeName[Ring Sparkle], 0, TempValue0, TempValue1)127end if128129if Object.Frame == 9130Rand(TempValue0, 48)131TempValue0 <<= 16132TempValue0 += Object.XPos133TempValue0 -= 0x180000134Rand(TempValue1, 32)135TempValue1 <<= 16136TempValue1 += Object.YPos137TempValue1 -= 0x140000138CreateTempObject(TypeName[Ring Sparkle], 0, TempValue0, TempValue1)139Object.Timer--140if Object.Timer == 0141Object.Frame = 5142Object.State = EGGSIGNPOST_RESET143else144Object.Frame = 1145end if146end if147end if148break149150case EGGSIGNPOST_RESET151ResetObjectEntity(Object.JetpackEntity,TypeName[Sign Post], 0, Object.XPos, Object.YPos)152Object.YVelocity = 1153Object.Frame = 1154Object.Timer = 16155Object.Priority = PRIORITY_XBOUNDS156Object.State = EGGSIGNPOST_TRIGGER_ACTFINISH157break158159case EGGSIGNPOST_TRIGGER_ACTFINISH160if Object[ArrayPos0].State == R1_EGGMAN_ESCAPE161PlayMusic(1)162Object.State = EGGSIGNPOST_FLIP163Object[30].Type = TypeName[ActFinish]164Object[30].DrawOrder = 6165Object[30].Priority = PRIORITY_ACTIVE166Object.State = EGGSIGNPOST_STOP_PLAYER167end if168break169170case EGGSIGNPOST_STOP_PLAYER171CheckEqual(Player.State, Player_State_Ground)172TempValue0 = CheckResult173CheckEqual(Player.OutOfBounds, true)174TempValue0 |= CheckResult175176TempValue1 = Screen.XOffset177TempValue1 += Screen.XSize178TempValue1 += 32179CheckGreater(Player.iXPos, TempValue1)180TempValue0 |= CheckResult181if TempValue0 == true182Player.ControlMode = CONTROLMODE_NONE183Player.JumpHold = false184Player.Right = false185Player.Left = false186Player.Up = false187Player.Down = false188189if Player.State == Player_State_Ground190Player.XVelocity = 0191Player.YVelocity = 0192end if193Player.Speed = 0194195Screen.CameraEnabled = false196end if197break198199end switch200end sub201202203sub ObjectDraw204if Object.State > EGGSIGNPOST_SET_SPAWN205if Object.State < EGGSIGNPOST_RESET206DrawSprite(0)207DrawSprite(Object.Frame)208end if209end if210end sub211212213sub ObjectStartup214215LoadSpriteSheet("Global/Items2.gif")216217SpriteFrame(-12, -12, 24, 24, 0, 150) // #0 - Sign Post218SpriteFrame(-24, -44, 48, 32, 34, 99) // #1 - Sign Post Head (Eggman)219SpriteFrame(-16, -44, 32, 32, 1, 183) // #2 - Sign Post Head (Flip 1)220SpriteFrame(-4, -44, 8, 32, 25, 150) // #3 - Sign Post Head (Flip 2)221SpriteFrame(-16, -44, 32, 32, 1, 216) // #4 - Sign Post Head (Flip 3)222SpriteFrame(-24, -44, 48, 32, 34, 132) // #5 - Sign Post Head (Player)223SpriteFrame(-16, -44, 32, 32, 1, 183) // #6 - Sign Post Head (Flip 1)224SpriteFrame(-4, -44, 8, 32, 25, 150) // #7 - Sign Post Head (Flip 2)225SpriteFrame(-16, -44, 32, 32, 1, 216) // #8 - Sign Post Head (Flip 3)226227end sub228229230// ========================231// Editor Subs232// ========================233234sub RSDKDraw235DrawSprite(0)236DrawSprite(1)237end sub238239240sub RSDKLoad241242LoadSpriteSheet("Global/Items2.gif")243244SpriteFrame(-12, -12, 24, 24, 0, 150) // #0 - Sign Post245SpriteFrame(-24, -44, 48, 32, 34, 99) // #1 - Sign Post Head (Eggman)246247SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")248end sub249250251252253