Path: blob/main/Scripts/R3/NoGripArea.txt
1319 views
//----------------Sonic CD No Grip Area Script----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// ========================5// Aliases6// ========================78#alias Object.Value0 : Object.PrevActive // (If this object was active last frame)910// Ink Effect Aliases11#alias 2 : INK_ALPHA121314// ========================15// Subs16// ========================1718sub ObjectPlayerInteraction19if Object.PrevActive == false20PlayerObjectCollision(C_TOUCH, -16, -16, 16, 16)21if CheckResult == true22if Player.Animation == ANI_CLIMBING23// If Knuckles is already climbing, let's make him drop from the wall24CallFunction(Player_Unstick)25end if2627if Player.Animation == ANI_GLIDING28// On the other hand, if he's gliding instead, then let's make sure he isn't going to be able to climb here29Object.PrevActive = true30CallFunction(Player_ForceNoGrip)31end if32end if33else34PlayerObjectCollision(C_TOUCH, -16, -16, 16, 32) // (note the larger hitbox downwards, compared to the normal version)35if CheckResult == false36Object.PrevActive = false3738// Before allowing Knuckles to climb again, let's make sure he isn't interacting with any other NoGripAreas, either39TempValue0 = false40ArrayPos0 = 3241while ArrayPos0 < 105642if Object[ArrayPos0].Type == TypeName[NoGripArea]43if Object[ArrayPos0].PrevActive == true44TempValue0 = true45end if46end if4748ArrayPos0++49loop5051if TempValue0 == false52CallFunction(Player_ForceGrip)53end if54end if55end if56end sub575859sub ObjectDraw60// They included a debug vis for this object, how cool!61if Stage.DebugMode == true62TempValue0 = Object.iXPos63TempValue0 -= 1664TempValue0 -= Screen.XOffset65TempValue1 = Object.iYPos66TempValue1 -= 1667TempValue1 -= Screen.YOffset68if Object.PrevActive == true69DrawRect(TempValue0, TempValue1, 32, 48, 0, 96, 48, 255)70else71DrawRect(TempValue0, TempValue1, 32, 32, 0, 96, 48, 255)72end if73end if74end sub7576// ========================77// Editor Subs78// ========================7980sub RSDKDraw81TempValue0 = Object.XPos82TempValue0 -= 0x10000083TempValue1 = Object.YPos84TempValue1 -= 0x1000008586// In the actual game, the object draws in debug mode as a solid color rectangle87// Here, let's have an Alpha of 128 in the editor so you can see through it88DrawRectWorld(TempValue0, TempValue1, 32, 32, 0, 96, 48, 128)8990Object.InkEffect = INK_ALPHA91Object.Alpha = 192DrawSpriteFX(0, FX_INK, Object.XPos, Object.YPos)93end sub9495sub RSDKLoad96LoadSpriteSheet("Global/Display.gif")97SpriteFrame(-16, -16, 32, 32, 1, 143)9899SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")100end sub101102103