Path: blob/master/Sonic 2/Scripts/Global/RedSpring.txt
1478 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: Red Spring Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.value0 : object.timer12private alias object.value1 : object.active13private alias object.value2 : object.stoodPlayers14private alias object.value7 : object.enabledInAir1516// Player Aliases17private alias object.state : player.state18private alias object.xpos : player.xpos19private alias object.ypos : player.ypos20private alias object.iypos : player.iypos21private alias object.xvel : player.xvel22private alias object.yvel : player.yvel23private alias object.speed : player.speed24private alias object.angle : player.angle25private alias object.direction : player.direction26private alias object.gravity : player.gravity27private alias object.frame : player.frame28private alias object.prevAnimation : player.prevAnimation29private alias object.animationSpeed : player.animationSpeed30private alias object.animation : player.animation31private alias object.pushing : player.pushing32private alias object.controlLock : player.controlLock33private alias object.collisionMode : player.collisionMode34private alias object.collisionTop : player.collisionTop35private alias object.collisionBottom : player.collisionBottom36private alias object.tileCollisions : player.tileCollisions37private alias object.value1 : player.timer38private alias object.value10 : player.animationReserve39private alias object.value17 : debugMode.currentSelection40private alias object.value25 : player.gravityStrength4142// ========================43// Function Declarations44// ========================4546reserve function RedSpring_DebugDraw47reserve function RedSpring_DebugSpawn484950// ========================51// Static Values52// ========================5354private value RedSpring_startDebugID = 0555657// ========================58// Tables59// ========================6061private table RedSpring_directionTable620, 0, 0, 0630, 0, 2, 2640, 0, 1, 2650, 1, 2, 3660, 0, 1, 2670, 1, 2, 368end table6970private table RedSpring_heightsTable7116, 16, 16, 16, 16, 16, 14, 12, 10, 8, 6, 4, 2, 0, -2, -472end table7374private table RedSpring_collisionTypes751, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 176end table777879// ========================80// Function Definitions81// ========================8283private function RedSpring_DebugDraw84temp1 = object.direction85temp0 = debugMode[0].currentSelection86temp0 -= RedSpring_startDebugID87GetTableValue(object.direction, temp0, RedSpring_directionTable)88DrawSpriteFX(temp0, FX_FLIP, object.xpos, object.ypos)89object.direction = temp190end function919293private function RedSpring_DebugSpawn94temp0 = debugMode[0].currentSelection95temp0 -= RedSpring_startDebugID96CreateTempObject(TypeName[Red Spring], temp0, object.xpos, object.ypos)97end function9899100// ========================101// Events102// ========================103104event ObjectUpdate105temp2 = 0106107foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)108temp1 = object.propertyValue109temp1 &= 0x7F110switch temp1111case 0 // Up112temp0 = object.active113if player[currentPlayer].gravity == GRAVITY_AIR114temp0 = true115end if116117if player[currentPlayer].collisionMode > CMODE_FLOOR118if player[currentPlayer].yvel < 0119temp0 = true120end if121end if122123if temp0 == false124BoxCollisionTest(C_SOLID, object.entityPos, -14, -8, 14, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)125if player[currentPlayer].gravity == GRAVITY_AIR126BoxCollisionTest(C_TOUCH, object.entityPos, -14, -10, 14, -6, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)127else128BoxCollisionTest(C_TOUCH, object.entityPos, -14, -12, 14, -6, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)129end if130131if checkResult == true132player[currentPlayer].animationReserve = ANI_WALKING133if player[currentPlayer].animation == ANI_RUNNING134player[currentPlayer].animationReserve = ANI_RUNNING135end if136137if player[currentPlayer].animation == ANI_PEELOUT138player[currentPlayer].animationReserve = ANI_PEELOUT139end if140141object.timer = 1142#platform: USE_STANDALONE143player[currentPlayer].state = Player_State_Air144#endplatform145#platform: USE_ORIGINS146player[currentPlayer].state = Player_State_Air_NoDropDash147#endplatform148player[currentPlayer].tileCollisions = true149player[currentPlayer].gravity = GRAVITY_AIR150player[currentPlayer].speed = player[currentPlayer].xvel151player[currentPlayer].yvel = -0x100000152player[currentPlayer].yvel -= player[currentPlayer].gravityStrength153154if object.propertyValue >= 0x80155player[currentPlayer].animation = ANI_TWIRL156player[currentPlayer].prevAnimation = ANI_TWIRL157player[currentPlayer].frame = 0158player[currentPlayer].animationSpeed = 40159else160player[currentPlayer].animation = ANI_BOUNCING161end if162player[currentPlayer].timer = 0163PlaySfx(SfxName[Spring], false)164end if165else166if player[currentPlayer].yvel >= 0167BoxCollisionTest(C_PLATFORM, object.entityPos, -14, -8, 14, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)168169BoxCollisionTest(C_TOUCH, object.entityPos, -14, -10, 14, -6, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)170if checkResult == true171player[currentPlayer].animationReserve = ANI_WALKING172if player[currentPlayer].animation == ANI_RUNNING173player[currentPlayer].animationReserve = ANI_RUNNING174end if175176if player[currentPlayer].animation == ANI_PEELOUT177player[currentPlayer].animationReserve = ANI_PEELOUT178end if179180object.timer = 1181#platform: USE_STANDALONE182player[currentPlayer].state = Player_State_Air183#endplatform184#platform: USE_ORIGINS185player[currentPlayer].state = Player_State_Air_NoDropDash186#endplatform187player[currentPlayer].tileCollisions = true188player[currentPlayer].gravity = GRAVITY_AIR189player[currentPlayer].speed = player[currentPlayer].xvel190player[currentPlayer].yvel = -0x100000191if object.propertyValue >= 0x80192player[currentPlayer].animation = ANI_TWIRL193player[currentPlayer].prevAnimation = ANI_TWIRL194player[currentPlayer].frame = 0195player[currentPlayer].animationSpeed = 40196else197player[currentPlayer].animation = ANI_BOUNCING198end if199200player[currentPlayer].timer = 0201PlaySfx(SfxName[Spring], false)202end if203end if204end if205break206207case 1 // Right208BoxCollisionTest(C_SOLID, object.entityPos, -8, -14, 8, 14, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)209if player[currentPlayer].gravity == GRAVITY_GROUND210BoxCollisionTest(C_TOUCH, object.entityPos, 6, -14, 11, 14, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)211if checkResult == true212213object.timer = 1214player[currentPlayer].tileCollisions = true215player[currentPlayer].angle = 0216player[currentPlayer].speed = 0x100000217player[currentPlayer].collisionMode = CMODE_FLOOR218player[currentPlayer].pushing = false219player[currentPlayer].direction = FACING_RIGHT220player[currentPlayer].controlLock = 12221222PlaySfx(SfxName[Spring], false)223if player[currentPlayer].state != Player_State_Roll224player[currentPlayer].state = Player_State_Ground225player[currentPlayer].animation = ANI_RUNNING226end if227end if228else229if object.enabledInAir == true230BoxCollisionTest(C_TOUCH, object.entityPos, 6, -4, 11, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)231if checkResult == true232object.timer = 1233234player[currentPlayer].tileCollisions = true235player[currentPlayer].angle = 0236player[currentPlayer].speed = 0x100000237player[currentPlayer].yvel = 0238player[currentPlayer].collisionMode = CMODE_FLOOR239player[currentPlayer].pushing = false240player[currentPlayer].direction = FACING_RIGHT241player[currentPlayer].controlLock = 12242243PlaySfx(SfxName[Spring], false)244if player[currentPlayer].state != Player_State_RollJump245player[currentPlayer].animation = ANI_BOUNCING246if player[currentPlayer].animation != ANI_JUMPING247player[currentPlayer].animation = ANI_RUNNING248end if249object.animationSpeed = object.speed250player[currentPlayer].animationSpeed *= 80251player[currentPlayer].animationSpeed /= 0x60000252end if253end if254end if255end if256break257258case 2 // Left259BoxCollisionTest(C_SOLID, object.entityPos, -8, -14, 8, 14, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)260if player[currentPlayer].gravity == GRAVITY_GROUND261BoxCollisionTest(C_TOUCH, object.entityPos, -10, -14, -6, 14, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)262if checkResult == true263object.timer = 1264player[currentPlayer].tileCollisions = true265player[currentPlayer].speed = -0x100000266player[currentPlayer].collisionMode = CMODE_FLOOR267player[currentPlayer].pushing = 0268player[currentPlayer].direction = FACING_LEFT269player[currentPlayer].controlLock = 15270PlaySfx(SfxName[Spring], false)271if player[currentPlayer].state != Player_State_Roll272player[currentPlayer].state = Player_State_Ground273player[currentPlayer].animation = ANI_RUNNING274end if275end if276else277if object.enabledInAir == true278BoxCollisionTest(C_TOUCH, object.entityPos, -10, -14, -6, 14, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)279if checkResult == true280object.timer = 1281282player[currentPlayer].tileCollisions = true283player[currentPlayer].speed = -0x100000284player[currentPlayer].yvel = 0285player[currentPlayer].collisionMode = CMODE_FLOOR286player[currentPlayer].pushing = 0287player[currentPlayer].direction = FACING_LEFT288player[currentPlayer].controlLock = 15289290PlaySfx(SfxName[Spring], false)291if player[currentPlayer].state != Player_State_RollJump292player[currentPlayer].animation = ANI_BOUNCING293if player[currentPlayer].animation != ANI_JUMPING294player[currentPlayer].animation = ANI_RUNNING295end if296object.animationSpeed = object.speed297FlipSign(player[currentPlayer].animationSpeed)298player[currentPlayer].animationSpeed *= 80299player[currentPlayer].animationSpeed /= 0x60000300end if301end if302end if303end if304break305306case 3 // Down307BoxCollisionTest(C_SOLID, object.entityPos, -14, -8, 14, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)308if player[currentPlayer].yvel <= 0309BoxCollisionTest(C_TOUCH, object.entityPos, -14, 6, 14, 10, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)310if checkResult == true311if player[currentPlayer].collisionMode == CMODE_ROOF312FlipSign(player[currentPlayer].speed)313FlipSign(player[currentPlayer].xvel)314end if315316object.timer = 1317#platform: USE_STANDALONE318player[currentPlayer].state = Player_State_Air319#endplatform320#platform: USE_ORIGINS321player[currentPlayer].state = Player_State_Air_NoDropDash322#endplatform323player[currentPlayer].tileCollisions = true324player[currentPlayer].gravity = GRAVITY_AIR325player[currentPlayer].speed = player[currentPlayer].xvel326player[currentPlayer].yvel = 0x100000327player[currentPlayer].timer = 0328329PlaySfx(SfxName[Spring], false)330end if331end if332break333334case 4 // Up Right335temp0 = player[currentPlayer].xpos336temp0 -= object.xpos337temp0 += 0x100000338temp0 >>= 17339if temp0 < 0340temp0 = 0341end if342if temp0 > 15343temp0 = 15344end if345346GetTableValue(temp1, temp0, RedSpring_heightsTable)347FlipSign(temp1)348GetTableValue(temp4, temp0, RedSpring_collisionTypes)349BoxCollisionTest(temp4, object.entityPos, -16, temp1, 16, 16, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)350if checkResult != COL_TOP351GetBit(temp3, object.stoodPlayers, temp2)352if temp3 == true353temp3 = player[currentPlayer].xpos354temp3 -= object.xpos355temp3 >>= 16356Abs(temp3)357if temp3 < 16358if player[currentPlayer].yvel >= 0359player[currentPlayer].iypos = player[currentPlayer].collisionBottom360FlipSign(player[currentPlayer].ypos)361temp1 <<= 16362player[currentPlayer].ypos += temp1363player[currentPlayer].ypos += object.ypos364checkResult = COL_TOP365end if366end if367end if368end if369370if checkResult == COL_TOP371if temp0 >= 6372player[currentPlayer].animationReserve = ANI_WALKING373374if player[currentPlayer].animation == ANI_RUNNING375player[currentPlayer].animationReserve = ANI_RUNNING376end if377378if player[currentPlayer].animation == ANI_PEELOUT379player[currentPlayer].animationReserve = ANI_PEELOUT380end if381382object.timer = 1383if player[currentPlayer].collisionMode == CMODE_ROOF384FlipSign(player[currentPlayer].speed)385FlipSign(player[currentPlayer].xvel)386end if387388#platform: USE_STANDALONE389player[currentPlayer].state = Player_State_Air390#endplatform391#platform: USE_ORIGINS392player[currentPlayer].state = Player_State_Air_NoDropDash393#endplatform394player[currentPlayer].tileCollisions = true395player[currentPlayer].gravity = GRAVITY_AIR396player[currentPlayer].xvel = 0x100000397player[currentPlayer].speed = player[currentPlayer].xvel398player[currentPlayer].yvel = -0x100000399player[currentPlayer].yvel -= player[currentPlayer].gravityStrength400player[currentPlayer].timer = 0401player[currentPlayer].direction = FACING_RIGHT402403if object.propertyValue >= 0x80404player[currentPlayer].animation = ANI_TWIRL405else406player[currentPlayer].animation = ANI_BOUNCING407end if408PlaySfx(SfxName[Spring], false)409410SetBit(object.stoodPlayers, temp2, false)411else412SetBit(object.stoodPlayers, temp2, true)413end if414else415SetBit(object.stoodPlayers, temp2, false)416end if417break418419case 5 // Up Left420temp0 = player[currentPlayer].xpos421temp0 -= object.xpos422temp0 += 0x100000423temp0 >>= 17424if temp0 < 0425temp0 = 0426end if427428if temp0 > 15429temp0 = 15430end if431temp0 -= 15432Abs(temp0)433434GetTableValue(temp1, temp0, RedSpring_heightsTable)435FlipSign(temp1)436437GetTableValue(temp4, temp0, RedSpring_collisionTypes)438BoxCollisionTest(temp4, object.entityPos, -16, temp1, 16, 16, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)439if checkResult != COL_TOP440GetBit(temp3, object.stoodPlayers, temp2)441if temp3 == true442temp3 = player[currentPlayer].xpos443temp3 -= object.xpos444temp3 >>= 16445Abs(temp3)446if temp3 < 16447if player[currentPlayer].yvel >= 0448player[currentPlayer].iypos = player[currentPlayer].collisionBottom449FlipSign(player[currentPlayer].ypos)450temp1 <<= 16451player[currentPlayer].ypos += temp1452player[currentPlayer].ypos += object.ypos453checkResult = COL_TOP454end if455end if456end if457end if458459if checkResult == COL_TOP460if temp0 >= 6461player[currentPlayer].animationReserve = ANI_WALKING462if player[currentPlayer].animation == ANI_RUNNING463player[currentPlayer].animationReserve = ANI_RUNNING464end if465466if player[currentPlayer].animation == ANI_PEELOUT467player[currentPlayer].animationReserve = ANI_PEELOUT468end if469470object.timer = 1471if player[currentPlayer].collisionMode == CMODE_ROOF472FlipSign(player[currentPlayer].speed)473FlipSign(player[currentPlayer].xvel)474end if475476#platform: USE_STANDALONE477player[currentPlayer].state = Player_State_Air478#endplatform479#platform: USE_ORIGINS480player[currentPlayer].state = Player_State_Air_NoDropDash481#endplatform482player[currentPlayer].tileCollisions = true483player[currentPlayer].gravity = GRAVITY_AIR484player[currentPlayer].xvel = -0x100000485player[currentPlayer].speed = player[currentPlayer].xvel486player[currentPlayer].yvel = -0x100000487player[currentPlayer].yvel -= player[currentPlayer].gravityStrength488player[currentPlayer].timer = 0489player[currentPlayer].direction = FACING_LEFT490491if object.propertyValue >= 0x80492player[currentPlayer].animation = ANI_TWIRL493else494player[currentPlayer].animation = ANI_BOUNCING495end if496497PlaySfx(SfxName[Spring], false)498SetBit(object.stoodPlayers, temp2, false)499else500SetBit(object.stoodPlayers, temp2, true)501end if502else503SetBit(object.stoodPlayers, temp2, false)504end if505break506507case 6 // Down Right508temp0 = player[currentPlayer].xpos509temp0 -= object.xpos510temp0 += 0x100000511temp0 >>= 17512if temp0 < 0513temp0 = 0514end if515516if temp0 > 15517temp0 = 15518end if519520GetTableValue(temp1, temp0, RedSpring_heightsTable)521BoxCollisionTest(C_SOLID, object.entityPos, -16, -16, 16, temp1, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)522if checkResult != COL_BOTTOM523GetBit(temp3, object.stoodPlayers, temp2)524if temp3 == true525temp3 = player[currentPlayer].xpos526temp3 -= object.xpos527temp3 >>= 16528Abs(temp3)529if temp3 < 16530if player[currentPlayer].yvel <= 0531player[currentPlayer].iypos = player[currentPlayer].collisionTop532FlipSign(player[currentPlayer].ypos)533temp1 <<= 16534player[currentPlayer].ypos += temp1535player[currentPlayer].ypos += object.ypos536checkResult = COL_TOP537end if538end if539end if540end if541542if checkResult == COL_BOTTOM543if temp0 >= 6544object.timer = 1545if player[currentPlayer].collisionMode == CMODE_ROOF546FlipSign(player[currentPlayer].speed)547FlipSign(player[currentPlayer].xvel)548end if549#platform: USE_STANDALONE550player[currentPlayer].state = Player_State_Air551#endplatform552#platform: USE_ORIGINS553player[currentPlayer].state = Player_State_Air_NoDropDash554#endplatform555player[currentPlayer].tileCollisions = true556player[currentPlayer].gravity = GRAVITY_AIR557player[currentPlayer].xvel = 0x100000558player[currentPlayer].speed = player[currentPlayer].xvel559player[currentPlayer].yvel = 0x100000560player[currentPlayer].timer = 0561player[currentPlayer].direction = FACING_RIGHT562PlaySfx(SfxName[Spring], false)563SetBit(object.stoodPlayers, temp2, false)564else565SetBit(object.stoodPlayers, temp2, true)566end if567else568SetBit(object.stoodPlayers, temp2, false)569end if570break571572case 7 // Down Left573temp0 = player[currentPlayer].xpos574temp0 -= object.xpos575temp0 += 0x100000576temp0 >>= 17577if temp0 < 0578temp0 = 0579end if580581if temp0 > 15582temp0 = 15583end if584temp0 -= 15585Abs(temp0)586587GetTableValue(temp1, temp0, RedSpring_heightsTable)588BoxCollisionTest(C_SOLID, object.entityPos, -16, -16, 16, temp1, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)589if checkResult != COL_BOTTOM590GetBit(temp3, object.stoodPlayers, temp2)591if temp3 == true592temp3 = player[currentPlayer].xpos593temp3 -= object.xpos594temp3 >>= 16595Abs(temp3)596if temp3 < 16597if player[currentPlayer].yvel <= 0598player[currentPlayer].iypos = player[currentPlayer].collisionTop599FlipSign(player[currentPlayer].ypos)600temp1 <<= 16601player[currentPlayer].ypos += temp1602player[currentPlayer].ypos += object.ypos603checkResult = COL_TOP604end if605end if606end if607end if608609if checkResult == COL_BOTTOM610if temp0 >= 6611object.timer = 1612if player[currentPlayer].collisionMode == CMODE_ROOF613FlipSign(player[currentPlayer].speed)614FlipSign(player[currentPlayer].xvel)615end if616617#platform: USE_STANDALONE618player[currentPlayer].state = Player_State_Air619#endplatform620#platform: USE_ORIGINS621player[currentPlayer].state = Player_State_Air_NoDropDash622#endplatform623player[currentPlayer].tileCollisions = true624player[currentPlayer].gravity = GRAVITY_AIR625player[currentPlayer].xvel = -0x100000626player[currentPlayer].speed = player[currentPlayer].xvel627player[currentPlayer].yvel = 0x100000628player[currentPlayer].timer = 0629player[currentPlayer].direction = FACING_LEFT630PlaySfx(SfxName[Spring], false)631632SetBit(object.stoodPlayers, temp2, false)633else634SetBit(object.stoodPlayers, temp2, true)635end if636else637SetBit(object.stoodPlayers, temp2, false)638end if639break640641end switch642643temp2++644next645646object.frame = object.propertyValue647object.frame &= 0x7F648649if object.timer != 0650switch object.timer651case 2652case 3653break654655case 1656object.frame += 8657break658659case 4660case 5661case 6662case 7663case 8664case 9665object.frame += 16666break667668end switch669670object.timer++671if object.timer >= 10672object.timer = 0673end if674end if675end event676677678event ObjectDraw679GetTableValue(object.direction, object.frame, RedSpring_directionTable)680DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)681end event682683684event ObjectStartup685686LoadSpriteSheet("Global/Items.gif")687688foreach (TypeName[Red Spring], arrayPos0, ALL_ENTITIES)689temp0 = object[arrayPos0].propertyValue690temp0 &= 0x7F691if temp0 > 8692object[arrayPos0].propertyValue -= 8693object[arrayPos0].enabledInAir = true694end if695next696697// Spring frames698SpriteFrame(-16, -8, 32, 16, 52, 1)699SpriteFrame(-8, -16, 16, 32, 85, 1)700SpriteFrame(-8, -16, 16, 32, 118, 67)701SpriteFrame(-16, -8, 32, 16, 157, 116)702SpriteFrame(-16, -16, 32, 32, 118, 1)703SpriteFrame(-16, -16, 32, 32, 157, 50)704SpriteFrame(-16, -16, 32, 32, 118, 1)705SpriteFrame(-16, -16, 32, 32, 157, 50)706SpriteFrame(-16, 0, 32, 8, 52, 1)707SpriteFrame(-8, -16, 8, 32, 93, 1)708SpriteFrame(0, -16, 8, 32, 118, 67)709SpriteFrame(-16, -8, 32, 8, 157, 124)710SpriteFrame(-17, -10, 27, 27, 52, 186)711SpriteFrame(-17, -10, 27, 27, 52, 186)712SpriteFrame(-17, -10, 27, 27, 52, 186)713SpriteFrame(-17, -10, 27, 27, 52, 186)714SpriteFrame(-16, -24, 32, 32, 52, 34)715SpriteFrame(-8, -16, 32, 32, 85, 34)716SpriteFrame(-8, -16, 32, 32, 85, 34)717SpriteFrame(-16, -24, 32, 32, 52, 34)718SpriteFrame(-16, -26, 43, 42, 52, 100)719SpriteFrame(-16, -26, 43, 42, 52, 100)720SpriteFrame(-16, -26, 43, 42, 52, 100)721SpriteFrame(-16, -26, 43, 42, 52, 100)722723temp0 = 0724RedSpring_startDebugID = DebugMode_ObjCount725while temp0 < 8726SetTableValue(TypeName[Red Spring], DebugMode_ObjCount, DebugMode_TypesTable)727SetTableValue(RedSpring_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)728SetTableValue(RedSpring_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)729DebugMode_ObjCount++730temp0++731loop732end event733734735// ========================736// Editor Events737// ========================738739event RSDKEdit740if editor.returnVariable == true741switch editor.variableID742case EDIT_VAR_PROPVAL // property value743checkResult = object.propertyValue744break745746case 0 // flipFlags747checkResult = object.propertyValue748checkResult &= 0x7749break750751case 1 // useTwirlAnim752GetBit(checkResult, object.propertyValue, 7)753break754755case 2 // enabledInAir756GetBit(checkResult, object.propertyValue, 3)757break758759end switch760else761switch editor.variableID762case EDIT_VAR_PROPVAL // property value763object.propertyValue = editor.variableValue764break765766case 0 // flipFlags767temp0 = editor.variableValue768temp0 &= 0x7769770temp1 = 7771Not(temp1)772773object.propertyValue &= temp1774object.propertyValue |= temp0775break776777case 1 // useTwirlAnim778CheckNotEqual(editor.variableValue, false)779SetBit(object.propertyValue, 7, checkResult)780break781782case 2 // enabledInAir783CheckNotEqual(editor.variableValue, false)784SetBit(object.propertyValue, 3, checkResult)785break786787end switch788end if789end event790791792event RSDKDraw793object.frame = object.propertyValue794object.frame &= 7795796GetTableValue(object.direction, object.frame, RedSpring_directionTable)797DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)798end event799800801event RSDKLoad802803LoadSpriteSheet("Global/Items.gif")804805// Spring frames806SpriteFrame(-16, -8, 32, 16, 52, 1)807SpriteFrame(-8, -16, 16, 32, 85, 1)808SpriteFrame(-8, -16, 16, 32, 118, 67)809SpriteFrame(-16, -8, 32, 16, 157, 116)810SpriteFrame(-16, -16, 32, 32, 118, 1)811SpriteFrame(-16, -16, 32, 32, 157, 50)812SpriteFrame(-16, -16, 32, 32, 118, 1)813SpriteFrame(-16, -16, 32, 32, 157, 50)814SpriteFrame(-16, 0, 32, 8, 52, 1)815SpriteFrame(-8, -16, 8, 32, 93, 1)816SpriteFrame(0, -16, 8, 32, 118, 67)817SpriteFrame(-16, -8, 32, 8, 157, 124)818SpriteFrame(-17, -10, 27, 27, 52, 186)819SpriteFrame(-17, -10, 27, 27, 52, 186)820SpriteFrame(-17, -10, 27, 27, 52, 186)821SpriteFrame(-17, -10, 27, 27, 52, 186)822SpriteFrame(-16, -24, 32, 32, 52, 34)823SpriteFrame(-8, -16, 32, 32, 85, 34)824SpriteFrame(-8, -16, 32, 32, 85, 34)825SpriteFrame(-16, -24, 32, 32, 52, 34)826SpriteFrame(-16, -26, 43, 42, 52, 100)827SpriteFrame(-16, -26, 43, 42, 52, 100)828SpriteFrame(-16, -26, 43, 42, 52, 100)829SpriteFrame(-16, -26, 43, 42, 52, 100)830831AddEditorVariable("flipFlags")832SetActiveVariable("flipFlags")833AddEnumVariable("Up", 0)834AddEnumVariable("Right", 1)835AddEnumVariable("Left", 2)836AddEnumVariable("Down", 3)837AddEnumVariable("Up Right", 4)838AddEnumVariable("Up Left", 5)839AddEnumVariable("Down Right", 6)840AddEnumVariable("Down Left", 7)841842AddEditorVariable("useTwirlAnim")843SetActiveVariable("useTwirlAnim")844AddEnumVariable("false", false)845AddEnumVariable("true", true)846847AddEditorVariable("enabledInAir")848SetActiveVariable("enabledInAir")849AddEnumVariable("false", false)850AddEnumVariable("true", true)851end event852853854