Alchemy
Loading...
Searching...
No Matches

markers.c File Reference

The map's markers: chests and Psynergy stones. More...

Go to the source code of this file.

Data Structures

struct  MarkerMap
 The start of the map's work. More...

Functions

void ObjectMotion_SnapToTerrain (void *object)
 Sets an actor's y and terrainHeight to the map's height at its x and z.
void Field_PlaceMapMarkers (void)
 Places an actor at each of the map's markers (ids 100 to 239) that the scene has an event for, up to ten: a chest (actor 20) for a chest event, shown open once its flag is set and gone once its mimic was beaten, and a Psynergy stone (actor 28) for a search event giving one, until it is taken.
s32 Marker_FindSlot (s32 id)
 Returns the marker slot (0 to 9) whose event trigger is id, or -1.
UNUSED void EffectRuntime_ReservedNoOp (void)
static __inline__ void SetMarkerAnimationAndPlaySound (s32 id, s32 animation, s32 sound)
 Gives the actor of marker id animation, plays sound and waits 12 frames.
void Marker_CloseChest (s32 id)
 Closes the chest of marker id again (its item could not be carried), with SE_125.
void Marker_LaunchMimic (s32 id)
 Makes the chest of marker id jump up as a mimic: after 18 frames it takes animation 7, plays SE_146 and gets an upward velocityY of 8 << 16.
void Marker_OpenChest (s32 id)
 Opens the chest of marker id (animation 4) with SE_124, and waits 12 frames.
void Marker_ShowOpened (s32 id)
 Shows the chest of marker id open (animation 2), with no sound.
struct ObjectRuntime * Marker_GetActor (s32 id)
 Returns the actor of marker id, or NULL when no slot has it.
void Marker_Hide (s32 id)
 Hides the actor of marker id by clearing its animationKind.
void Marker_SetActorPosition (s32 id, s32 x, s32 z)
 Moves the actor of marker id to (x, z) on the ground; -1 keeps the centre of its cell on that axis.

Detailed Description

The map's markers: chests and Psynergy stones.

Part of object.c, the field object, compiled only through it.

Definition in file markers.c.

Function Documentation

◆ ObjectMotion_SnapToTerrain()

void ObjectMotion_SnapToTerrain ( void * object)

Sets an actor's y and terrainHeight to the map's height at its x and z.

Called by Field_PlaceMapMarkers for each marker it places.

Definition at line 9 of file markers.c.

Referenced by Field_PlaceMapMarkers(), and ObjectMotion_SnapToTerrain().

◆ Field_PlaceMapMarkers()

void Field_PlaceMapMarkers ( void )

Places an actor at each of the map's markers (ids 100 to 239) that the scene has an event for, up to ten: a chest (actor 20) for a chest event, shown open once its flag is set and gone once its mimic was beaten, and a Psynergy stone (actor 28) for a search event giving one, until it is taken.

A marker with no such event takes no slot. Called by Field_RunScene on scene load; clears and fills work->markers.

Definition at line 30 of file markers.c.

Referenced by Field_PlaceMapMarkers(), and Field_RunScene().

◆ Marker_FindSlot()

s32 Marker_FindSlot ( s32 id)

Returns the marker slot (0 to 9) whose event trigger is id, or -1.

Called by the Marker_ functions below.

Definition at line 138 of file markers.c.

Referenced by Marker_FindSlot(), Marker_GetActor(), Marker_Hide(), Marker_LaunchMimic(), Marker_SetActorPosition(), Marker_ShowOpened(), and SetMarkerAnimationAndPlaySound().

◆ EffectRuntime_ReservedNoOp()

UNUSED void EffectRuntime_ReservedNoOp ( void )

Definition at line 154 of file markers.c.

Referenced by EffectRuntime_ReservedNoOp().

◆ SetMarkerAnimationAndPlaySound()

__inline__ void SetMarkerAnimationAndPlaySound ( s32 id,
s32 animation,
s32 sound )
static

Gives the actor of marker id animation, plays sound and waits 12 frames.

Definition at line 157 of file markers.c.

Referenced by Marker_CloseChest(), Marker_OpenChest(), and SetMarkerAnimationAndPlaySound().

◆ Marker_CloseChest()

void Marker_CloseChest ( s32 id)

Closes the chest of marker id again (its item could not be carried), with SE_125.

Called by Field_SearchTile.

Definition at line 176 of file markers.c.

Referenced by Field_SearchTile(), and Marker_CloseChest().

◆ Marker_LaunchMimic()

void Marker_LaunchMimic ( s32 id)

Makes the chest of marker id jump up as a mimic: after 18 frames it takes animation 7, plays SE_146 and gets an upward velocityY of 8 << 16.

Called by Field_SearchTile before the mimic's battle.

Definition at line 183 of file markers.c.

Referenced by Field_SearchTile(), and Marker_LaunchMimic().

◆ Marker_OpenChest()

void Marker_OpenChest ( s32 id)

Opens the chest of marker id (animation 4) with SE_124, and waits 12 frames.

Called by Field_SearchTile when a chest is searched.

Definition at line 205 of file markers.c.

Referenced by Field_SearchTile(), and Marker_OpenChest().

◆ Marker_ShowOpened()

void Marker_ShowOpened ( s32 id)

Shows the chest of marker id open (animation 2), with no sound.

Called by Field_SearchTile once a chest's contents are taken.

Definition at line 209 of file markers.c.

Referenced by Field_SearchTile(), and Marker_ShowOpened().

◆ Marker_GetActor()

struct ObjectRuntime * Marker_GetActor ( s32 id)

Returns the actor of marker id, or NULL when no slot has it.

Called by Field_SearchTile, and by the world map markers (field_fx.c) to skip a marker already placed.

Definition at line 226 of file markers.c.

Referenced by Field_SearchTile(), FieldEffect_SpawnNearbyMarkers(), and Marker_GetActor().

◆ Marker_Hide()

void Marker_Hide ( s32 id)

Hides the actor of marker id by clearing its animationKind.

Called by Field_SearchTile once a Psynergy stone is taken.

Definition at line 238 of file markers.c.

Referenced by Field_SearchTile(), and Marker_Hide().

◆ Marker_SetActorPosition()

void Marker_SetActorPosition ( s32 id,
s32 x,
s32 z )

Moves the actor of marker id to (x, z) on the ground; -1 keeps the centre of its cell on that axis.

Positions are 16.16. Scene overlays call it as Engine_MapObjectSetPosition.

Definition at line 255 of file markers.c.

Referenced by Marker_SetActorPosition().