Skip to Content
The Alchemy Project

src/field/script_commands_climbing.c

Jumping and climbing on the field. More…

Included by script_commands.c.

Macros

NameDescription
#defineMAPGRID_METATILES_SOUTH (MAPGRID_METATILES + MAPGRID_SIZE)The map grid's metatiles seen one row south and one row north: MAPGRID_METATILES_SOUTH[i] is the metatile below MAPGRID_METATILES[i].
#defineMAPGRID_METATILES_NORTH (MAPGRID_METATILES - MAPGRID_SIZE)
#defineMETATILE_MIDDLE (pixels)The middle pixel of the map metatile a whole pixel lies in.

Functions

NameDescription
Sint32fdTryJumpForward (void)Makes the leader jump two metatiles forward, over the metatile in front, when the map allows it (fdMapGridCheckCollision).
Sint32fdClimbDown (void)Climbs the leader down onto a climbable wall below it, or lets go of the wall it is on (the player presses down at a climbable wall); -1 when there is none to climb.
Sint32fdClimbUp (void)Jumps the leader onto a climbable wall ahead, or climbs it over the top of the wall it is on (the player presses up at a climbable wall); -1 when there is none to climb.

Description

Jumping and climbing on the field. Part of script_commands.c.

Macros in detail

MAPGRID_METATILES_SOUTH

#define MAPGRID_METATILES_SOUTH (MAPGRID_METATILES + MAPGRID_SIZE)

The map grid's metatiles seen one row south and one row north: MAPGRID_METATILES_SOUTH[i] is the metatile below MAPGRID_METATILES[i].

Referenced by fdClimbDown().

Definition at line 7 of file script_commands_climbing.c.

MAPGRID_METATILES_NORTH

#define MAPGRID_METATILES_NORTH (MAPGRID_METATILES - MAPGRID_SIZE)

Referenced by fdClimbUp().

Definition at line 8 of file script_commands_climbing.c.

METATILE_MIDDLE

#define METATILE_MIDDLE(pixels)

The middle pixel of the map metatile a whole pixel lies in.

Referenced by fdClimbDown() and fdClimbUp().

Definition at line 10 of file script_commands_climbing.c.

Functions in detail

fdTryJumpForward

Sint32 fdTryJumpForward(void)

Makes the leader jump two metatiles forward, over the metatile in front, when the map allows it (fdMapGridCheckCollision).

References fdActorFindNearestFacingTarget(), fdActorGetById(), fdActorMoveToAndWaitById(), fdActorSelectAnimationStub(), fdActorSetSpriteFlagsStub(), fdMapGridCheckCollisionStub(), fdMapGridGetMetatileBehaviorAtStub(), fdScriptEnd(), fdScriptStart(), MainRoutineStateWork, Sint32, state, syMulFX(), sySoundPlayStub(), sySynch() and syVectorAddPolarOffset().

Referenced by fdRunPushMetatile(), scBilibinHopAcross(), scColosseumAzartMatchPushRockOrHopAcross(), scColosseumNavampaMatchHopFromLogAreaEnd(), scColosseumNavampaMatchPushWeightOrHopAcross(), scColosseumNavampaMatchTalkToSteppingStoneAttendant(), scColosseumSatrageMatchHopWestFromPost(), scColosseumSatrageMatchTalkToShiftingFloorAttendant(), scCrossboneIsleKeysHopOntoPostBelow(), scCrossboneIsleKeysJumpEastOrPushFirstPillar(), scCrossboneIsleKeysUnusedJumpOntoPost(), scCrossboneIsleKeysUseLadder(), scGomaCavePillarJumpGapWest(), scGondowanCaveJumpCrevice(), scKolimaForestFloodgateJumpSouth(), scLogRoomsAJumpAcrossHoleInAtticFloor(), scLunpaTryJumpForward(), scSolSanctumElementalStarRoomJumpAhead(), scSolSanctumStatueJumpNorth(), scSolSanctumStatueJumpSouth() and scTreeRoomsJumpOffLeaf().

Definition at line 15 of file script_commands_climbing.c.

fdClimbDown

Sint32 fdClimbDown(void)

Climbs the leader down onto a climbable wall below it, or lets go of the wall it is on (the player presses down at a climbable wall); -1 when there is none to climb.

References fdActorFaceDirectionById(), fdActorGetById(), fdActorMoveToAndWaitById(), fdActorSelectAnimationStub(), fdActorSetMoveTargetStub(), fdActorSetSpriteFlagsStub(), fdActorWaitForMoveById(), fdActorWaitForScriptEndById(), fdMapGridIsWallAtStub(), fdScriptEnd(), fdScriptStart(), fdScriptWait(), MainRoutineStateWork and Sint32.

Referenced by fdRunPushMetatile(), scBabiLighthouseClimbOrPushRoadPillar(), scBabiLighthousePushPillarOrClimbDownHole(), scCrossboneIsleKeysPushFirstPillar(), scCrossboneIsleKeysUseLadder(), scCrossboneIsleSteppingStonesPushOrClimbDown() and scTolbiShipMastClimbDownMast().

Definition at line 110 of file script_commands_climbing.c.

fdClimbUp

Sint32 fdClimbUp(void)

Jumps the leader onto a climbable wall ahead, or climbs it over the top of the wall it is on (the player presses up at a climbable wall); -1 when there is none to climb.

References fdActorGetById(), fdActorMoveToAndWaitById(), fdActorSelectAnimationStub(), fdActorSetMoveTargetStub(), fdActorSetSpriteFlagsStub(), fdActorWaitForMoveById(), fdMapGridIsWallAtStub(), fdScriptEnd(), fdScriptStart(), fdScriptWait(), MainRoutineStateWork, Sint32 and sySynch().

Referenced by fdRunPushMetatile(), scBabiLighthouseClimbOrPushRoadPillar(), scColosseumNavampaMatchTalkToFreeClimbAttendant(), scColosseumSatrageMatchTalkToWallAttendant(), scCrossboneIsleKeysPushFirstPillar(), scCrossboneIsleKeysUseLadder(), scCrossboneIsleSteppingStonesClimbUp() and scInit().

Definition at line 197 of file script_commands_climbing.c.