Path: blob/master/Sonic 2/Scripts/Global/YellowSpring.txt
1478 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: Yellow Spring Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.value1 : object.active12private alias object.value2 : object.stoodPlayers13private alias object.value3 : object.timer14private alias object.value7 : object.enabledInAir1516// Only used on type 4 (up right)17private alias object.value0 : object.overrideVelocity.x18private alias object.value1 : object.overrideVelocity.y1920// Player Aliases21private alias object.state : player.state22private alias object.xpos : player.xpos23private alias object.ypos : player.ypos24private alias object.iypos : player.iypos25private alias object.xvel : player.xvel26private alias object.yvel : player.yvel27private alias object.speed : player.speed28private alias object.direction : player.direction29private alias object.gravity : player.gravity30private alias object.frame : player.frame31private alias object.prevAnimation : player.prevAnimation32private alias object.animationSpeed : player.animationSpeed33private alias object.animation : player.animation34private alias object.pushing : player.pushing35private alias object.controlLock : player.controlLock36private alias object.collisionMode : player.collisionMode37private alias object.collisionTop : player.collisionTop38private alias object.collisionBottom : player.collisionBottom39private alias object.tileCollisions : player.tileCollisions40private alias object.value1 : player.timer41private alias object.value10 : player.animationReserve // Used by springs to store what animation will play after the bounce animation42private alias object.value17 : debugMode.currentSelection43private alias object.value25 : player.gravityStrength444546// ========================47// Function Declarations48// ========================4950reserve function YellowSpring_DebugDraw51reserve function YellowSpring_DebugSpawn525354// ========================55// Static Values56// ========================5758private value YellowSpring_startDebugID = 0596061// ========================62// Tables63// ========================6465private table YellowSpring_directionTable660, 0, 0, 0670, 0, 2, 2680, 0, 1, 2690, 1, 2, 3700, 0, 1, 2710, 1, 2, 372end table7374private table YellowSpring_heightsTable7516, 16, 16, 16, 16, 16, 14, 12, 10, 8, 6, 4, 2, 0, -2, -476end table7778private table YellowSpring_collisionTypes791 // C_SOLID801 // C_SOLID811 // C_SOLID821 // C_SOLID831 // C_SOLID841 // C_SOLID853 // C_PLATFORM863 // C_PLATFORM873 // C_PLATFORM883 // C_PLATFORM893 // C_PLATFORM903 // C_PLATFORM913 // C_PLATFORM923 // C_PLATFORM931 // C_SOLID941 // C_SOLID95end table969798// ========================99// Function Definitions100// ========================101102private function YellowSpring_DebugDraw103temp1 = object.direction104temp0 = debugMode[0].currentSelection105temp0 -= YellowSpring_startDebugID106GetTableValue(object.direction, temp0, YellowSpring_directionTable)107DrawSpriteFX(temp0, FX_FLIP, object.xpos, object.ypos)108object.direction = temp1109end function110111112private function YellowSpring_DebugSpawn113temp0 = debugMode[0].currentSelection114temp0 -= YellowSpring_startDebugID115CreateTempObject(TypeName[Yellow Spring], temp0, object.xpos, object.ypos)116end function117118119// ========================120// Events121// ========================122123event ObjectUpdate124temp2 = 0125126foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)127temp1 = object.propertyValue128temp1 &= 0x7F129130switch temp1131case 0132temp0 = object.active133if player[currentPlayer].gravity == GRAVITY_AIR134temp0 = true135end if136137if player[currentPlayer].collisionMode > CMODE_FLOOR138if player[currentPlayer].yvel < 0139temp0 = true140end if141end if142143if temp0 == false144BoxCollisionTest(C_SOLID, object.entityPos, -14, -8, 14, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)145if player[currentPlayer].gravity == GRAVITY_AIR146BoxCollisionTest(C_TOUCH, object.entityPos, -14, -10, 14, -6, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)147else148BoxCollisionTest(C_TOUCH, object.entityPos, -14, -12, 14, -6, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)149end if150151if checkResult == true152player[currentPlayer].animationReserve = ANI_WALKING153if player[currentPlayer].animation == ANI_RUNNING154player[currentPlayer].animationReserve = ANI_RUNNING155end if156157if player[currentPlayer].animation == ANI_PEELOUT158player[currentPlayer].animationReserve = ANI_PEELOUT159end if160161object.timer = 1162#platform: USE_STANDALONE163player[currentPlayer].state = Player_State_Air164#endplatform165#platform: USE_ORIGINS166player[currentPlayer].state = Player_State_Air_NoDropDash167#endplatform168player[currentPlayer].tileCollisions = true169player[currentPlayer].gravity = GRAVITY_AIR170player[currentPlayer].speed = player[currentPlayer].xvel171player[currentPlayer].yvel = -0xA0000172173if object.propertyValue >= 0x80174player[currentPlayer].animation = ANI_TWIRL175player[currentPlayer].prevAnimation = ANI_TWIRL176player[currentPlayer].frame = 0177player[currentPlayer].animationSpeed = 40178else179player[currentPlayer].animation = ANI_BOUNCING180end if181player[currentPlayer].timer = 0182183PlaySfx(SfxName[Spring], false)184end if185else186if player[currentPlayer].yvel >= 0187BoxCollisionTest(C_PLATFORM, object.entityPos, -14, -8, 14, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)188189BoxCollisionTest(C_TOUCH, object.entityPos, -14, -10, 14, -6, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)190if checkResult == true191player[currentPlayer].animationReserve = ANI_WALKING192if player[currentPlayer].animation == ANI_RUNNING193player[currentPlayer].animationReserve = ANI_RUNNING194end if195196if player[currentPlayer].animation == ANI_PEELOUT197player[currentPlayer].animationReserve = ANI_PEELOUT198end if199200object.timer = 1201#platform: USE_STANDALONE202player[currentPlayer].state = Player_State_Air203#endplatform204#platform: USE_ORIGINS205player[currentPlayer].state = Player_State_Air_NoDropDash206#endplatform207player[currentPlayer].tileCollisions = true208player[currentPlayer].gravity = GRAVITY_AIR209player[currentPlayer].speed = player[currentPlayer].xvel210player[currentPlayer].yvel = -0xA0000211player[currentPlayer].yvel -= player[currentPlayer].gravityStrength212213if object.propertyValue >= 0x80214player[currentPlayer].animation = ANI_TWIRL215player[currentPlayer].prevAnimation = ANI_TWIRL216player[currentPlayer].frame = 0217player[currentPlayer].animationSpeed = 40218else219player[currentPlayer].animation = ANI_BOUNCING220end if221player[currentPlayer].timer = 0222223PlaySfx(SfxName[Spring], false)224end if225end if226end if227break228229case 1230BoxCollisionTest(C_SOLID, object.entityPos, -8, -14, 8, 14, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)231if player[currentPlayer].gravity == GRAVITY_GROUND232BoxCollisionTest(C_TOUCH, object.entityPos, 6, -14, 10, 14, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)233if checkResult == true234object.timer = 1235player[currentPlayer].tileCollisions = true236player[currentPlayer].speed = 0xA0000237player[currentPlayer].collisionMode = CMODE_FLOOR238player[currentPlayer].pushing = 0239player[currentPlayer].direction = FACING_RIGHT240player[currentPlayer].controlLock = 15241PlaySfx(SfxName[Spring], false)242243if player[currentPlayer].state != Player_State_Roll244player[currentPlayer].state = Player_State_Ground245player[currentPlayer].animation = ANI_RUNNING246end if247end if248else249if object.enabledInAir == true250BoxCollisionTest(C_TOUCH, object.entityPos, 6, -4, 11, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)251if checkResult == true252object.timer = 1253player[currentPlayer].tileCollisions = true254player[currentPlayer].speed = 0xA0000255player[currentPlayer].yvel = 0256player[currentPlayer].collisionMode = CMODE_FLOOR257player[currentPlayer].pushing = 0258player[currentPlayer].direction = FACING_RIGHT259player[currentPlayer].controlLock = 15260261PlaySfx(SfxName[Spring], false)262263if player[currentPlayer].state != Player_State_RollJump264player[currentPlayer].animation = ANI_BOUNCING265if player[currentPlayer].animation != ANI_JUMPING266player[currentPlayer].animation = ANI_RUNNING267end if268object.animationSpeed = object.speed269player[currentPlayer].animationSpeed *= 80270player[currentPlayer].animationSpeed /= 0x60000271end if272end if273end if274end if275break276277case 2278BoxCollisionTest(C_SOLID, object.entityPos, -8, -14, 8, 14, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)279if player[currentPlayer].gravity == GRAVITY_GROUND280BoxCollisionTest(C_TOUCH, object.entityPos, -10, -14, -6, 14, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)281if checkResult == true282object.timer = 1283player[currentPlayer].tileCollisions = true284player[currentPlayer].speed = -0xA0000285player[currentPlayer].collisionMode = CMODE_FLOOR286player[currentPlayer].pushing = 0287player[currentPlayer].direction = FACING_LEFT288player[currentPlayer].controlLock = 15289290PlaySfx(SfxName[Spring], false)291292if player[currentPlayer].state != Player_State_Roll293player[currentPlayer].state = Player_State_Ground294player[currentPlayer].animation = ANI_RUNNING295end if296end if297else298if object.enabledInAir == true299BoxCollisionTest(C_TOUCH, object.entityPos, -10, -14, -6, 14, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)300if checkResult == true301object.timer = 1302player[currentPlayer].tileCollisions = true303player[currentPlayer].speed = -0xA0000304player[currentPlayer].yvel = 0305player[currentPlayer].collisionMode = CMODE_FLOOR306player[currentPlayer].pushing = 0307player[currentPlayer].direction = FACING_LEFT308player[currentPlayer].controlLock = 15309310PlaySfx(SfxName[Spring], false)311312if player[currentPlayer].state != Player_State_RollJump313player[currentPlayer].animation = 12 // Yes, it's actually like this314if player[currentPlayer].animation != ANI_JUMPING315player[currentPlayer].animation = ANI_RUNNING316end if317318object.animationSpeed = object.speed319FlipSign(player[currentPlayer].animationSpeed)320player[currentPlayer].animationSpeed *= 80321player[currentPlayer].animationSpeed /= 0x60000322end if323end if324end if325end if326break327328case 3329BoxCollisionTest(C_SOLID, object.entityPos, -14, -8, 14, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)330BoxCollisionTest(C_TOUCH, object.entityPos, -14, 6, 14, 10, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)331if checkResult == true332object.timer = 1333if player[currentPlayer].collisionMode == CMODE_ROOF334FlipSign(player[currentPlayer].speed)335FlipSign(player[currentPlayer].xvel)336end if337338#platform: USE_STANDALONE339player[currentPlayer].state = Player_State_Air340#endplatform341#platform: USE_ORIGINS342player[currentPlayer].state = Player_State_Air_NoDropDash343#endplatform344player[currentPlayer].tileCollisions = true345player[currentPlayer].gravity = GRAVITY_AIR346player[currentPlayer].speed = player[currentPlayer].xvel347player[currentPlayer].yvel = 0xA0000348player[currentPlayer].timer = 0349350PlaySfx(SfxName[Spring], false)351end if352break353354case 4355temp0 = player[currentPlayer].xpos356temp0 -= object.xpos357temp0 += 0x100000358temp0 >>= 17359if temp0 < 0360temp0 = 0361end if362363if temp0 > 15364temp0 = 15365end if366367GetTableValue(temp1, temp0, YellowSpring_heightsTable)368FlipSign(temp1)369370GetTableValue(temp4, temp0, YellowSpring_collisionTypes)371BoxCollisionTest(temp4, object.entityPos, -16, temp1, 16, 24, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)372if checkResult != COL_TOP373GetBit(temp3, object.stoodPlayers, temp2)374if temp3 == true375temp3 = player[currentPlayer].xpos376temp3 -= object.xpos377temp3 >>= 16378Abs(temp3)379if temp3 < 16380if player[currentPlayer].yvel >= 0381player[currentPlayer].iypos = player[currentPlayer].collisionBottom382FlipSign(player[currentPlayer].ypos)383temp1 <<= 16384player[currentPlayer].ypos += temp1385player[currentPlayer].ypos += object.ypos386checkResult = COL_TOP387end if388end if389end if390end if391392if checkResult == COL_TOP393if temp0 >= 6394player[currentPlayer].animationReserve = ANI_WALKING395if player[currentPlayer].animation == ANI_RUNNING396player[currentPlayer].animationReserve = ANI_RUNNING397end if398399if player[currentPlayer].animation == ANI_PEELOUT400player[currentPlayer].animationReserve = ANI_PEELOUT401end if402403object.timer = 1404if player[currentPlayer].collisionMode == CMODE_ROOF405FlipSign(player[currentPlayer].speed)406FlipSign(player[currentPlayer].xvel)407end if408409#platform: USE_STANDALONE410player[currentPlayer].state = Player_State_Air411#endplatform412#platform: USE_ORIGINS413player[currentPlayer].state = Player_State_Air_NoDropDash414#endplatform415player[currentPlayer].tileCollisions = true416player[currentPlayer].gravity = GRAVITY_AIR417418if object.overrideVelocity.x == 0419player[currentPlayer].xvel = 0xA0000420player[currentPlayer].yvel = -0xA0000421else422player[currentPlayer].xvel = object.overrideVelocity.x423player[currentPlayer].xvel <<= 16424player[currentPlayer].yvel = object.overrideVelocity.y425player[currentPlayer].yvel *= -0x10000426end if427428player[currentPlayer].speed = player[currentPlayer].xvel429player[currentPlayer].yvel -= player[currentPlayer].gravityStrength430player[currentPlayer].timer = 0431player[currentPlayer].direction = FACING_RIGHT432433if object.propertyValue >= 0x80434player[currentPlayer].animation = ANI_TWIRL435else436player[currentPlayer].animation = ANI_BOUNCING437end if438PlaySfx(SfxName[Spring], false)439440SetBit(object.stoodPlayers, temp2, false)441else442SetBit(object.stoodPlayers, temp2, true)443end if444else445SetBit(object.stoodPlayers, temp2, false)446end if447break448449case 5450temp0 = player[currentPlayer].xpos451temp0 -= object.xpos452temp0 += 0x100000453temp0 >>= 17454if temp0 < 0455temp0 = 0456end if457458if temp0 > 15459temp0 = 15460end if461temp0 -= 15462463Abs(temp0)464GetTableValue(temp1, temp0, YellowSpring_heightsTable)465FlipSign(temp1)466467GetTableValue(temp4, temp0, YellowSpring_collisionTypes)468BoxCollisionTest(temp4, object.entityPos, -16, temp1, 16, 32, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)469if checkResult != COL_TOP470GetBit(temp3, object.stoodPlayers, temp2)471if temp3 == true472temp3 = player[currentPlayer].xpos473temp3 -= object.xpos474temp3 >>= 16475Abs(temp3)476if temp3 < 16477if player[currentPlayer].yvel >= 0478player[currentPlayer].iypos = player[currentPlayer].collisionBottom479FlipSign(player[currentPlayer].ypos)480temp1 <<= 16481player[currentPlayer].ypos += temp1482player[currentPlayer].ypos += object.ypos483checkResult = COL_TOP484end if485end if486end if487end if488489if checkResult == COL_TOP490if temp0 >= 6491player[currentPlayer].animationReserve = ANI_WALKING492if player[currentPlayer].animation == ANI_RUNNING493player[currentPlayer].animationReserve = ANI_RUNNING494end if495496if player[currentPlayer].animation == ANI_PEELOUT497player[currentPlayer].animationReserve = ANI_PEELOUT498end if499500object.timer = 1501if player[currentPlayer].collisionMode == CMODE_ROOF502FlipSign(player[currentPlayer].speed)503FlipSign(player[currentPlayer].xvel)504end if505506#platform: USE_STANDALONE507player[currentPlayer].state = Player_State_Air508#endplatform509#platform: USE_ORIGINS510player[currentPlayer].state = Player_State_Air_NoDropDash511#endplatform512player[currentPlayer].tileCollisions = true513player[currentPlayer].gravity = GRAVITY_AIR514player[currentPlayer].xvel = -0xA0000515player[currentPlayer].speed = player[currentPlayer].xvel516player[currentPlayer].yvel = -0xA0000517player[currentPlayer].yvel -= player[currentPlayer].gravityStrength518player[currentPlayer].timer = 0519player[currentPlayer].direction = FACING_LEFT520521if object.propertyValue >= 0x80522player[currentPlayer].animation = ANI_TWIRL523else524player[currentPlayer].animation = ANI_BOUNCING525end if526PlaySfx(SfxName[Spring], false)527528SetBit(object.stoodPlayers, temp2, false)529else530SetBit(object.stoodPlayers, temp2, true)531end if532else533SetBit(object.stoodPlayers, temp2, false)534end if535break536537case 6538temp0 = player[currentPlayer].xpos539temp0 -= object.xpos540temp0 += 0x100000541temp0 >>= 17542if temp0 < 0543temp0 = 0544end if545546if temp0 > 15547temp0 = 15548end if549550GetTableValue(temp1, temp0, YellowSpring_heightsTable)551BoxCollisionTest(C_SOLID, object.entityPos, -16, -16, 32, temp1, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)552if checkResult != COL_BOTTOM553GetBit(temp3, object.stoodPlayers, temp2)554if temp3 == true555temp3 = player[currentPlayer].xpos556temp3 -= object.xpos557temp3 >>= 16558Abs(temp3)559if temp3 < 16560if player[currentPlayer].yvel <= 0561player[currentPlayer].iypos = player[currentPlayer].collisionTop562FlipSign(player[currentPlayer].ypos)563temp1 <<= 16564player[currentPlayer].ypos += temp1565player[currentPlayer].ypos += object.ypos566checkResult = COL_TOP567end if568end if569end if570end if571572if checkResult == COL_BOTTOM573if temp0 >= 6574object.timer = 1575if player[currentPlayer].collisionMode == CMODE_ROOF576FlipSign(player[currentPlayer].speed)577FlipSign(player[currentPlayer].xvel)578end if579580#platform: USE_STANDALONE581player[currentPlayer].state = Player_State_Air582#endplatform583#platform: USE_ORIGINS584player[currentPlayer].state = Player_State_Air_NoDropDash585#endplatform586player[currentPlayer].tileCollisions = true587player[currentPlayer].gravity = GRAVITY_AIR588player[currentPlayer].xvel = 0xA0000589player[currentPlayer].speed = player[currentPlayer].xvel590player[currentPlayer].yvel = 0xA0000591player[currentPlayer].timer = 0592player[currentPlayer].direction = FACING_RIGHT593PlaySfx(SfxName[Spring], false)594595SetBit(object.stoodPlayers, temp2, false)596else597SetBit(object.stoodPlayers, temp2, true)598end if599else600SetBit(object.stoodPlayers, temp2, false)601end if602break603604case 7605temp0 = player[currentPlayer].xpos606temp0 -= object.xpos607temp0 += 0x100000608temp0 >>= 17609if temp0 < 0610temp0 = 0611end if612613if temp0 > 15614temp0 = 15615end if616617temp0 -= 15618Abs(temp0)619GetTableValue(temp1, temp0, YellowSpring_heightsTable)620BoxCollisionTest(C_SOLID, object.entityPos, -16, -16, 16, temp1, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)621if checkResult != COL_BOTTOM622GetBit(temp3, object.stoodPlayers, temp2)623if temp3 == true624temp3 = player[currentPlayer].xpos625temp3 -= object.xpos626temp3 >>= 16627Abs(temp3)628if temp3 < 16629if player[currentPlayer].yvel <= 0630player[currentPlayer].iypos = player[currentPlayer].collisionTop631FlipSign(player[currentPlayer].ypos)632temp1 <<= 16633player[currentPlayer].ypos += temp1634player[currentPlayer].ypos += object.ypos635checkResult = COL_TOP636end if637end if638end if639end if640641if checkResult == COL_BOTTOM642if temp0 >= 6643object.timer = 1644if player[currentPlayer].collisionMode == CMODE_ROOF645FlipSign(player[currentPlayer].speed)646FlipSign(player[currentPlayer].xvel)647end if648649#platform: USE_STANDALONE650player[currentPlayer].state = Player_State_Air651#endplatform652#platform: USE_ORIGINS653player[currentPlayer].state = Player_State_Air_NoDropDash654#endplatform655player[currentPlayer].tileCollisions = true656player[currentPlayer].gravity = GRAVITY_AIR657player[currentPlayer].xvel = -0xA0000658player[currentPlayer].speed = player[currentPlayer].xvel659player[currentPlayer].yvel = 0xA0000660player[currentPlayer].timer = 0661player[currentPlayer].direction = FACING_LEFT662PlaySfx(SfxName[Spring], false)663664SetBit(object.stoodPlayers, temp2, false)665else666SetBit(object.stoodPlayers, temp2, true)667end if668else669SetBit(object.stoodPlayers, temp2, false)670end if671break672673end switch674temp2++675next676677object.frame = object.propertyValue678object.frame &= 0x7F679680if object.timer != 0681switch object.timer682case 2683case 3684break685686case 1687object.frame += 8688break689690case 4691case 5692case 6693case 7694case 8695case 9696object.frame += 16697break698699end switch700701object.timer++702if object.timer >= 10703object.timer = 0704end if705end if706end event707708709event ObjectDraw710GetTableValue(object.direction, object.frame, YellowSpring_directionTable)711DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)712end event713714715event ObjectStartup716LoadSpriteSheet("Global/Items.gif")717SpriteFrame(-16, -8, 32, 16, 52, 17)718SpriteFrame(-8, -16, 16, 32, 101, 1)719SpriteFrame(-8, -16, 16, 32, 134, 67)720SpriteFrame(-16, -8, 32, 16, 157, 132)721SpriteFrame(-16, -16, 32, 32, 118, 34)722SpriteFrame(-16, -16, 32, 32, 157, 83)723SpriteFrame(-16, -16, 32, 32, 118, 34)724SpriteFrame(-16, -16, 32, 32, 157, 83)725726SpriteFrame(-16, 0, 32, 8, 52, 17)727SpriteFrame(-8, -16, 8, 32, 109, 1)728SpriteFrame(0, -16, 8, 32, 134, 67)729SpriteFrame(-16, -8, 32, 8, 157, 140)730SpriteFrame(-17, -10, 27, 27, 80, 186)731SpriteFrame(-17, -10, 27, 27, 80, 186)732SpriteFrame(-17, -10, 27, 27, 80, 186)733SpriteFrame(-17, -10, 27, 27, 80, 186)734735SpriteFrame(-16, -24, 32, 32, 52, 67)736SpriteFrame(-8, -16, 32, 32, 85, 67)737SpriteFrame(-8, -16, 32, 32, 85, 67)738SpriteFrame(-16, -24, 32, 32, 52, 67)739SpriteFrame(-16, -26, 43, 42, 96, 100)740SpriteFrame(-16, -26, 43, 42, 96, 100)741SpriteFrame(-16, -26, 43, 42, 96, 100)742SpriteFrame(-16, -26, 43, 42, 96, 100)743744temp0 = 0745YellowSpring_startDebugID = DebugMode_ObjCount746while temp0 < 8747SetTableValue(TypeName[Yellow Spring], DebugMode_ObjCount, DebugMode_TypesTable)748SetTableValue(YellowSpring_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)749SetTableValue(YellowSpring_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)750DebugMode_ObjCount++751temp0++752loop753end event754755756// ========================757// Editor Events758// ========================759760event RSDKEdit761if editor.returnVariable == true762switch editor.variableID763case EDIT_VAR_PROPVAL // property value764checkResult = object.propertyValue765break766767case 0 // flipFlags768checkResult = object.propertyValue769checkResult &= 0x7770break771772case 1 // useTwirlAnim773checkResult = object.propertyValue774checkResult >>= 7775checkResult &= 1776break777778end switch779else780switch editor.variableID781case EDIT_VAR_PROPVAL // property value782object.propertyValue = editor.variableValue783break784785case 0 // flipFlags786temp0 = editor.variableValue787temp0 &= 0x7788789temp1 = 7790Not(temp1)791792object.propertyValue &= temp1793object.propertyValue |= temp0794break795796case 1 // useTwirlAnim797temp0 = editor.variableValue798temp0 &= 1799temp0 <<= 7800801object.propertyValue &= 0x7802object.propertyValue |= temp0803break804805end switch806end if807end event808809810event RSDKDraw811object.frame = object.propertyValue812object.frame &= 7813814GetTableValue(object.direction, object.frame, YellowSpring_directionTable)815DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)816end event817818819event RSDKLoad820LoadSpriteSheet("Global/Items.gif")821SpriteFrame(-16, -8, 32, 16, 52, 17)822SpriteFrame(-8, -16, 16, 32, 101, 1)823SpriteFrame(-8, -16, 16, 32, 134, 67)824SpriteFrame(-16, -8, 32, 16, 157, 132)825SpriteFrame(-16, -16, 32, 32, 118, 34)826SpriteFrame(-16, -16, 32, 32, 157, 83)827SpriteFrame(-16, -16, 32, 32, 118, 34)828SpriteFrame(-16, -16, 32, 32, 157, 83)829SpriteFrame(-16, 0, 32, 8, 52, 17)830SpriteFrame(-8, -16, 8, 32, 109, 1)831SpriteFrame(0, -16, 8, 32, 134, 67)832SpriteFrame(-16, -8, 32, 8, 157, 140)833SpriteFrame(-17, -10, 27, 27, 80, 186)834SpriteFrame(-17, -10, 27, 27, 80, 186)835SpriteFrame(-17, -10, 27, 27, 80, 186)836SpriteFrame(-17, -10, 27, 27, 80, 186)837SpriteFrame(-16, -24, 32, 32, 52, 67)838SpriteFrame(-8, -16, 32, 32, 85, 67)839SpriteFrame(-8, -16, 32, 32, 85, 67)840SpriteFrame(-16, -24, 32, 32, 52, 67)841SpriteFrame(-16, -26, 43, 42, 96, 100)842SpriteFrame(-16, -26, 43, 42, 96, 100)843SpriteFrame(-16, -26, 43, 42, 96, 100)844SpriteFrame(-16, -26, 43, 42, 96, 100)845846AddEditorVariable("flipFlags")847SetActiveVariable("flipFlags")848AddEnumVariable("Up", 0)849AddEnumVariable("Right", 1)850AddEnumVariable("Left", 2)851AddEnumVariable("Down", 3)852AddEnumVariable("Up Right", 4)853AddEnumVariable("Up Left", 5)854AddEnumVariable("Down Right", 6)855AddEnumVariable("Down Left", 7)856857AddEditorVariable("useTwirlAnim")858SetActiveVariable("useTwirlAnim")859AddEnumVariable("false", false)860AddEnumVariable("true", true)861862// only used on type 4 (up right) springs863SetVariableAlias(ALIAS_VAR_VAL0, "overrideVelocity.x")864SetVariableAlias(ALIAS_VAR_VAL1, "overrideVelocity.y")865SetVariableAlias(ALIAS_VAR_VAL2, "unused")866SetVariableAlias(ALIAS_VAR_VAL3, "unused")867end event868869870