Path: blob/master/Sonic 2/Scripts/WFZ/WindCurrent.txt
1479 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: Wind Current Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.value0 : object.minPos.x12private alias object.value1 : object.minPos.y13private alias object.value2 : object.maxPos.x14private alias object.value3 : object.maxPos.y1516// Player Aliases17private alias object.state : player.state18private alias object.animation : player.animation19private alias object.xpos : player.xpos20private alias object.ypos : player.ypos21private alias object.xvel : player.xvel22private alias object.yvel : player.yvel23private alias object.speed : player.speed24private alias object.tileCollisions : player.tileCollisions252627// ========================28// Events29// ========================3031event ObjectUpdate32temp6 = PRIORITY_XBOUNDS3334foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)35CheckLower(player[currentPlayer].xpos, object.minPos.x)36temp0 = checkResult37CheckGreater(player[currentPlayer].xpos, object.minPos.y)38temp0 |= checkResult39CheckLower(player[currentPlayer].ypos, object.maxPos.x)40temp0 |= checkResult41CheckGreater(player[currentPlayer].ypos, object.maxPos.y)42temp0 |= checkResult43if temp0 == false44temp6 = PRIORITY_ACTIVE4546CheckEqual(player[currentPlayer].state, Player_State_GotHit)47temp0 = checkResult48CheckEqual(player[currentPlayer].state, Player_State_Hurt)49temp0 |= checkResult50CheckEqual(player[currentPlayer].state, Player_State_Death)51temp0 |= checkResult52CheckEqual(player[currentPlayer].state, Player_State_Drown)53temp0 |= checkResult54CheckEqual(player[currentPlayer].state, WFZSetup_State_Clinging)55temp0 |= checkResult56if temp0 == false57player[currentPlayer].state = WFZSetup_State_Clinging58player[currentPlayer].animation = ANI_FANROTATE59player[currentPlayer].tileCollisions = true60end if6162if player[currentPlayer].animation == ANI_FANROTATE63if player[currentPlayer].xvel == 064temp1 = object.maxPos.y65temp1 -= object.maxPos.x66temp1 >>= 167temp1 += object.maxPos.x68if player[currentPlayer].ypos < temp169player[currentPlayer].ypos += 0x4000070else71player[currentPlayer].ypos -= 0x4000072end if73end if74end if75else76if player[currentPlayer].state == WFZSetup_State_Clinging77#platform: USE_STANDALONE78player[currentPlayer].state = Player_State_Air79#endplatform80#platform: USE_ORIGINS81player[currentPlayer].state = Player_State_Air_NoDropDash82#endplatform83player[currentPlayer].xvel = -0x4000084player[currentPlayer].speed = -0x4000085end if86end if87next8889object.priority = temp690if object.propertyValue == 091object[+1].priority = temp692else93object[-1].priority = temp694end if95end event969798event ObjectStartup99foreach (TypeName[Wind Current], arrayPos0, ALL_ENTITIES)100if object[arrayPos0].propertyValue == 0101arrayPos1 = arrayPos0102arrayPos1++103object[arrayPos0].minPos.x = object[arrayPos0].xpos104object[arrayPos0].minPos.y = object[arrayPos1].xpos105temp1 = object[arrayPos0].ypos106temp2 = object[arrayPos1].ypos107else108arrayPos1 = arrayPos0109arrayPos1--110object[arrayPos0].minPos.x = object[arrayPos1].xpos111object[arrayPos0].minPos.y = object[arrayPos0].xpos112temp1 = object[arrayPos1].ypos113temp2 = object[arrayPos0].ypos114end if115116if temp1 < temp2117object[arrayPos0].maxPos.x = temp1118object[arrayPos0].maxPos.y = temp2119else120object[arrayPos0].maxPos.x = temp2121object[arrayPos0].maxPos.y = temp1122end if123124object[arrayPos0].priority = PRIORITY_XBOUNDS125next126end event127128129// ========================130// Editor Events131// ========================132133event RSDKEdit134if editor.returnVariable == true135switch editor.variableID136case EDIT_VAR_PROPVAL // property value137checkResult = object.propertyValue138break139140case 0 // childType141checkResult = object.propertyValue142break143144end switch145else146switch editor.variableID147case EDIT_VAR_PROPVAL // property value148object.propertyValue = editor.variableValue149break150151case 0 // childType152object.propertyValue = editor.variableValue153break154155end switch156end if157end event158159160event RSDKDraw161DrawSprite(0)162end event163164165event RSDKLoad166LoadSpriteSheet("Global/Display.gif")167SpriteFrame(-16, -16, 32, 32, 1, 143)168169AddEditorVariable("childType")170SetActiveVariable("childType")171AddEnumVariable("Next Slot", 0)172AddEnumVariable("Previous Slot", 1)173end event174175176