Skip to Content
The Alchemy Project

include/scene/magma_rock.h

What Magma Rock's outside (magma_rock.c) and inside (magma_rock_inside.c) share: where a statue's fire stops, the flag set while its Burst plays, and the outside's tables and scripts.

Included by magma_rock.c and magma_rock_inside.c.

Structures

NameDescription
structMAGMA_ROCK_CRUMBLING_PILLARA crumbling pillar of Magma Rock (scMagmaRockCrumblePillar): its actor and its flag.

Macros

NameDescription
#defineFLAG_FIRE_BURST_PLAYING FLAG_SCENE_TEMP(0xf0)Set while a statue's fire bursts where it lands, so that Burst there does not target the statue again (scMagmaRockFireFromStatue, scMagmaRockInsideFireFromStatue).

Enumerations

NameDescription
enumMAGMA_ROCK_FIRE_STOP_METATILE { METATILE_BEHAVIOR_MAGMA_ROCK_FIRE_EDGE, METATILE_BEHAVIOR_MA … }The collision codes a statue's fire stops at as it flies (scMagmaRockFireFromStatue, scMagmaRockInsideFireFromStatue): the edge of its way, and a lava fall, which it floods the room from (scMagmaRockInsideRaiseLava).

Functions

NameDescription
Sint32scMapMetatileGetAttributes (Uint32 layer, Sint32 x, Sint32 z)Returns a metatile's collision code and attributes as a halfword.
voidscMagmaRockMoveFireball (struct ACTOR *actor)A fireball's update: it flies toward the other statue of its pair leaving embers; running into Felix raises CUE_FIREBALL_HITS_LEADER and takes it away, and reaching the statue hands it over (scMagmaRockThrowEmbers).
voidscMagmaRockBurnStatue (struct ACTOR *actor)A statue's update once it burns: embers first, then at tick 33 its flame column of four parts rises, and the cap on its top with it (scMagmaRockRaiseFlameTop).
voidscStatueFlashUnderBurst (struct ACTOR *actor)The update of a statue Burst is going off at: it blinks red on the ticks its mask picks.
voidscMagmaRockDropRocks (Sint32 x, Sint32 y, Sint32 z, Sint32 count)Drops count rocks from (x, y, z), each flung out at a random angle.
voidscMagmaRockStartFallingRocks (void)Starts the falling rocks: loads their picture, prepares a small sprite for each rock and adds the event that draws them.
voidscMagmaRockBurstCrackedPillar (Sint32 mode, Sint32 sound)Burst goes off at a cracked pillar: rocks fly up round it, one a tick while the explosions shake the ground and eight at the last blast, the pillar crumbles to a stump at PILLAR_CRUMBLE_TICK, and the last blast takes it away.
voidfdActorSetMetatileShape (Sint32 level, Sint32 layer, Sint32 id)Gives the metatile of layer under an actor the shape of the ground there, level steps of 8 pixels (METATILE_HEIGHT_STEPS) higher, or lower when negative, as a crumbling pillar sinks 4.
struct ACTOR *scActorFindInMetatile (Sint32 *pos, struct ACTOR *self)Returns the first placed actor (ACTOR_FIRST_PLACED up to the treasure spots, FIELD_TREASURE_ACTOR) standing in the same 16-pixel metatile as position (x, y and z), or NULL.
voidscMagmaRockRestoreCrumblingPillars (const Uint16 *table)On entry: sets each listed pillar from its two flags (cracked, then fallen), then lifts the leader onto the ground under it.
voidscMagmaRockPlaceTightrope ()Lays a tightrope between its two posts (fdTightropePlace, through the overlay's own import row).
voidscDustScatter (Sint32 spread)Eight clouds of dust rise in a row across the leader, 2 pixels apart, and fly out from him in eight directions when spread is set.
voidscMagmaRockFireStatue (void)After Felix's Burst, the yellow statue he cast it at flashes white and spits a fireball straight ahead: on the entrance's statues' ledge and the high west level at the cracked pillar beyond it, which the fireball's blast breaks, and on the top at the great fire.
voidscMagmaRockIgniteStatue (void)After Felix's Burst, a yellow statue with a grey cap blinks red for about ten seconds, faster at first; then fire bursts from it and its cap rides up on a column of flame for about five seconds, carrying Felix up to the ledge above if he is standing on it, before it sinks again.
voidscMagmaRockResetCaveDoor (void)Nothing visible happens when Felix, come out of the Ember Stone's room (MAGMA_ROCK_ENTRANCE_MAGMA_ROCK_INSIDE_EMBER_STONE), takes his first step of his own in the cave mouth above the entrance's cracked pillars (metatile (16, 28)).
voidscMagmaRockEnterCave (void)Felix walks north into the dark cave mouth above the entrance's cracked pillars (metatile (16, 28)) and goes inside Magma Rock, to the room of the Ember Stone.
voidscMagmaRockResolveBeforeBurst (void)Nothing visible happens as Felix begins to cast Burst at one of the yellow statues; the game settles whatever the field engine has pending before the statue's own scripts run (scMagmaRockTargetStatue).
voidscMagmaRockCheckCrumblingPillars (void)
voidscMagmaRockReadyHighWestStatue (void)Nothing visible happens when Felix steps onto the metatile just behind the yellow statue on the cliff's high west level (metatile (15, 34)); from then on Burst cast at the statue wakes it, so that it spits a fireball east at the cracked pillar.
voidscMagmaRockResetHighWestStatue (void)Nothing visible happens when Felix steps a metatile further west from behind the high west level's yellow statue (metatile (14, 34)); Burst no longer wakes the statue until he steps back behind it.
voidscMagmaRockKnockLeaderOffWall (void)A fireball flying between a pair of yellow statues on the cliff's high east wall hits Felix as he climbs: he turns grey among dark puffs, falls to the foot of the wall with a thump that shakes the ground, and shakes his head.
voidscMagmaRockPushPillarEast (void)
voidscMagmaRockPushPillarWest (void)Felix walks west into the striped stone pillar beside the cracked pillar on the cliff's low east level, from any of metatiles (37, 38) to (40, 38), and pushes it a metatile west along a grey track; after four pushes it stands on the grey square at the track's end, metatile (35, 38), and stays there when the party comes back.

Variables

NameDescription
extern Sint16MagmaRockEntrancePillars []The pillars Move pushes at the entrance, ended by -1.
extern Sint16MagmaRockCliffHighWestPillars []The pillars Move pushes on the cliff's high west level, ended by -1.
extern Sint16MagmaRockCliffHighEastPillars []The pillars Move pushes on the high east level, ended by -1.
extern Sint16MagmaRockCliffLowWestPillars []The pillars Move pushes on the low west level, ended by -1.
extern Sint16MagmaRockCliffLowEastPillars []The pillars Move pushes on the low east level, ended by -1.
extern Uint32MagmaRockEmberScript []An ember's actor script.
extern Sint16MagmaRockEntranceStatues []The entrance's statues (scStatueFindUnderBurst): each row a statue, the metatile Burst finds it by and the cap its flame column raises (-1 for none), ended by -1.
extern Sint16MagmaRockCliffHighWestStatues []The high west level's statues, as MagmaRockEntranceStatues.
extern Sint16MagmaRockCliffHighEastStatues []The high east level's statues, as MagmaRockEntranceStatues.
extern Sint16MagmaRockCliffLowWestStatues []The low west level's statues, as MagmaRockEntranceStatues.
extern Sint16MagmaRockCliffLowEastStatues []The low east level's statues, as MagmaRockEntranceStatues.
extern Sint16MagmaRockSummitStatues []The statue on the top, as MagmaRockEntranceStatues.
extern Sint16MagmaRockCrumblingPillars []The high west level's crumbling pillars: (actor, flag) rows ended by -1, the flag set once the pillar has cracked and the next once it has fallen.
extern Uint32DustScatterScript []It lasts 33 ticks, then stops and is gone.
extern Uint32DustBurstScript []It lasts 44 ticks, then stops and is gone.
extern Uint32FieldEffectShortScript []
extern Uint32FieldEffectMediumScript []The flash about the Tomegathericon: held 45 ticks, then put away and freed.
extern Uint32FieldEffectLongScript []

Description

What Magma Rock's outside (magma_rock.c) and inside (magma_rock_inside.c) share: where a statue's fire stops, the flag set while its Burst plays, and the outside's tables and scripts.

Macros in detail

FLAG_FIRE_BURST_PLAYING

#define FLAG_FIRE_BURST_PLAYING FLAG_SCENE_TEMP(0xf0)

Set while a statue's fire bursts where it lands, so that Burst there does not target the statue again (scMagmaRockFireFromStatue, scMagmaRockInsideFireFromStatue).

Referenced by MagmaRockCliffHighWestCues, MagmaRockCliffLowEastCues, MagmaRockCues, MagmaRockInsideCrackedPillarsCues, MagmaRockSummitCues, scMagmaRockFireFromStatue() and scMagmaRockInsideFireFromStatue().

Definition at line 25 of file magma_rock.h.

Enumerations in detail

MAGMA_ROCK_FIRE_STOP_METATILE

enum MAGMA_ROCK_FIRE_STOP_METATILE

The collision codes a statue's fire stops at as it flies (scMagmaRockFireFromStatue, scMagmaRockInsideFireFromStatue): the edge of its way, and a lava fall, which it floods the room from (scMagmaRockInsideRaiseLava).

EnumeratorValueDescription
METATILE_BEHAVIOR_MAGMA_ROCK_FIRE_EDGE212
METATILE_BEHAVIOR_MAGMA_ROCK_LAVA_FALL222

Definition at line 16 of file magma_rock.h.

Functions in detail

scMagmaRockPlaceTightrope

void scMagmaRockPlaceTightrope()

Lays a tightrope between its two posts (fdTightropePlace, through the overlay's own import row).

Referenced by scInit().

Definition at line 75 of file magma_rock.h.