Path: blob/master/Sonic 2/Scripts/Mission/MissionBlockCollisionM040.txt
1480 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: MBC_M040 Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011// Player Aliases12private alias object.pushing : player.pushing1314// Octus Aliases15private alias object.value0 : object.timer1617private alias 0 : OCTUS_SETUP18private alias 4 : OCTUS_FALL192021// ========================22// Events23// ========================2425event ObjectUpdate26temp0 = false2728// Check collision between every MissionBlock and Octus29foreach (TypeName[MissionBlock], arrayPos0, ACTIVE_ENTITIES)30foreach (TypeName[Octus], arrayPos1, ACTIVE_ENTITIES)31BoxCollisionTest(C_SOLID, arrayPos0, -16, -16, 16, 16, arrayPos1, -21, -12, 21, 13)32if checkResult == COL_TOP33if object[arrayPos1].state == OCTUS_FALL34object[arrayPos1].timer = 035object[arrayPos1].yvel = 036object[arrayPos1].animationTimer = 037object[arrayPos1].state = OCTUS_SETUP38end if39end if40next4142// Huh? A Mission Block's value0 is never referenced or used at all beyond here, what's this supposed to mean?43temp0 |= object[arrayPos0].value044next4546if temp0 == false47// If that flag was not set, then reset Player 1's pushing value48// (but like, why?? these are Octuses, the player doesn't matter here...49// this mission is in SCZ where pushing shouldn't be done anyway, but i still don't see why this exists at all)50player[0].pushing = 051end if52end event535455event ObjectDraw56// This object doesn't even load a sheet, nor does it set up any Sprite Frames, and yet it tries to draw with... something5758DrawSprite(0)59end event606162event ObjectStartup63// Not sure why checkResult isn't just looked at directly here, though this object seems to be based off the M027 version of the MBC so it may come from editing off that64// This object is only used in the Mission_Zone10 folder at all anyway, this is kinda redundant...65CheckCurrentStageFolder("Mission_Zone10")66temp0 = checkResult67if temp0 == true68foreach (TypeName[MBC_M040], arrayPos0, ALL_ENTITIES)69object[arrayPos0].priority = PRIORITY_ACTIVE70next71else72foreach (TypeName[MBC_M040], arrayPos0, ALL_ENTITIES)73object[arrayPos0].type = TypeName[Blank Object]74next75end if76end event777879// ========================80// Editor Events81// ========================8283event RSDKDraw84DrawSprite(0)85end event868788event RSDKLoad89LoadSpriteSheet("Global/Display.gif")90SpriteFrame(-16, -16, 32, 32, 1, 143)9192SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")93end event949596