Skip to Content
The Alchemy Project

src/field/field_engine_tables.c

The field engine's tables: the actor scripts its effects run, the colour curves of the palette tints, and the lookup tables of its transitions, speakers, weather and Psynergy.

Variables

NameDescription
const Uint8FieldExamineCueMessageOffsets [6]The message of each searchable metatile behavior from 242 to 247, as an offset from MsgTileChecked and MsgTileResult.
const Sint16FieldEffectTargetRangeByMode [25]{field Psynergy kind, range in pixels}, ended by -1; a kind not listed reaches 16 pixels.
const Uint8MindReadCasterPaletteCycle [8]The palette cycle of Mind Read's caster (fdActorSetLayersColorMode, (TickCount >> 1) & 7): palettes 1 to 4 and back to 0, two ticks each.
const Sint32ItemDisplayGrowInScript []Grows from half size to full size, a step every 2 ticks.
const Sint32ItemDisplayPulseScript []Pulses twice, to 1.5 times full size, then rests, over and over: the found item's picture held over the leader (field_engine_item_display.c).
const Sint32FieldEffectParticleScript []Sinks a quarter pixel a tick for 60 ticks, then disappears.
const Sint32RevealMarkerScript []A Reveal marker: stays while fdIsRevealActive returns nonzero (SC_CALL runs it again each tick), and releases itself once Reveal ends.
const Uint8ScreenTransitionBarWidths [34]The width of the bars of WINDOW_TRANSITION_BARS, by progress.
const Sint8ScreenTransitionEdgeOffsets [32]The wobble of the circle edge of WINDOW_TRANSITION_RIPPLE.
const Uint8ScreenTransitionDitherTable [64]0 to 63 shuffled: the order in which the dissolve sets the pixels.
const Uint16ColorBufferChannelCurve [32]Colour channel curves of the palette tints (field_engine_palette_fade.c): each maps a 5-bit channel (0 to 31) to a palette fade channel, shifted up 10 bits, so 31 is 31 << 10 (31744).
const Uint16ColorBufferChannelCurveLight [32]
const Uint16ColorBufferChannelCurveContrast [32]
const SPEAKER_DEFINITIONSpeakerDefinitions [131]Speaker definitions: {sprite, voice, the lines it says while Halted}, each voice one of the eight that start at SE_VOICE_FIRST, four blips apart.
const Sint32RepeatedSquashScript [97]An actor squashes and springs back as many times as fdActorStartRepeatedMotion asks, 1 to 3: the motion is written three times, 32 words each, and a run of count motions starts (3 - count) * 32 words in and runs to the end.
const Uint8ActorBlinkSpriteColors [4]A blinking actor's colour mode by tick ((TickCount >> 1) & 3, fdActorUpdateBlink): white for two ticks out of eight.
const Sint16LineScrollWaveSine [256]One cycle of sine in 256 entries, 4.12 fixed point (4096 at the peak).
const Sint16WeatherRainSplashFrames [80]{dx, dy, tile, shape, size} for each of the 16 frames of a raindrop's splash (script_commands_weather.c): dx and dy in screen pixels from its spot, tile from its first tile.
const SPARKLE_PICTUREFieldEffectSparklePictures [32]{dy, tile} of a sparkle (script_commands_weather.c): dy in screen pixels from its spot, a row every two ticks.
const Uint32FieldEffectPulseScales [3]Two scales that alternate ((FrameCount >> 2) & 1): full size and 0.97 of it (fdEffectPulseActorScale, script_commands_jupiter.c); nothing reads the third word.
const Sint32FieldEffectSharedParticleScript []The script most field Psynergy particles run: from its start it releases the actor at once; from its second word (+ 1) it waits for the actor to arrive, then releases it.
const Sint32FieldEffectSourceHoldScript []Faces the watched actor every tick, forever: the caster holding its target while Move, Carry or Lift has it (each gives the caster its target first).
const Sint32FieldEffectFragmentScript []A shard or particle: waits to arrive, slows to 1/16 pixel a tick, and releases itself 10 ticks later.
const Uint16InputDpadAngles [16]An angle for each value of the right, left, up and down bits of the +Control Pad; DPAD_ANGLE_NONE for none (fdInputGetDpadAngle, script_commands_move.c).
const Uint8FieldEffectQuadrantModes [4]Move's hand animation by the quarter turns from its side of the target to the push (script_commands_move.c): 3 toward its side, 2 away from it, 1 either way across.
const Sint32GrowthLeafScript []Growth's falling leaves: each waits 60 ticks and releases itself.
const Uint8UnusedQuadrantModesCopy [4]Unused: the same four bytes as FieldEffectQuadrantModes; nothing reads them.
const Sint32ForceFistScript []Waits to arrive, sets off fdEffectSpawnHeavyImpact (script_commands_lift.c) and releases the actor.
const Sint32FieldEffectShortEffectScript []The three scripts of FieldEffectDurationScripts.
const Sint32FieldEffectMediumEffectScript []
const Sint32FieldEffectLongEffectScript []
const Sint8HaltFlickerColorModes [8]The colour modes a Halted actor flickers through at random (fdPsynergyUpdateHaltedActor, script_commands_halt.c): its own colours twice as often as each of the five channel swaps and grey.
const Uint8WorldMapMarkerBlendCycle [32]The World Map markers' blend weight in sixteenths, against the picture's 16 less it ((TickCount >> 1) & 31, fdMapScreenUpdateMarkers): solid for 32 ticks, then down to half and back over the next 32.
const Uint16WorldMapCursorDirectionAngles [16]An angle for each +Control Pad direction (eight of them); DPAD_ANGLE_NONE for none.

Description

The field engine's tables: the actor scripts its effects run, the colour curves of the palette tints, and the lookup tables of its transitions, speakers, weather and Psynergy.

Variables in detail

FieldExamineCueMessageOffsets

const Uint8 FieldExamineCueMessageOffsets[6]

The message of each searchable metatile behavior from 242 to 247, as an offset from MsgTileChecked and MsgTileResult.

Referenced by fdExamineMetatile().

Definition at line 18 of file field_engine_tables.c.

FieldEffectTargetRangeByMode

const Sint16 FieldEffectTargetRangeByMode[25]

{field Psynergy kind, range in pixels}, ended by -1; a kind not listed reaches 16 pixels.

Referenced by fdGetPsynergyTargetRange().

Definition at line 30 of file field_engine_tables.c.

MindReadCasterPaletteCycle

const Uint8 MindReadCasterPaletteCycle[8]

The palette cycle of Mind Read's caster (fdActorSetLayersColorMode, (TickCount >> 1) & 7): palettes 1 to 4 and back to 0, two ticks each.

Referenced by fdActorSetLayersColorMode().

Definition at line 48 of file field_engine_tables.c.

ItemDisplayGrowInScript

const Sint32 ItemDisplayGrowInScript[]

Grows from half size to full size, a step every 2 ticks.

References Sint32.

Referenced by fdItemDisplayShowItemInFront() and fdItemDisplayShowPicture().

Definition at line 51 of file field_engine_tables.c.

ItemDisplayPulseScript

const Sint32 ItemDisplayPulseScript[]

Pulses twice, to 1.5 times full size, then rests, over and over: the found item's picture held over the leader (field_engine_item_display.c).

References Sint32.

Referenced by fdItemDisplayRaiseAboveLeader().

Definition at line 71 of file field_engine_tables.c.

FieldEffectParticleScript

const Sint32 FieldEffectParticleScript[]

Sinks a quarter pixel a tick for 60 ticks, then disappears.

References Sint32.

Referenced by fdActorInitSparkle(), fdEffectReleaseRevealSparkles() and fdItemDisplayShowItemInFront().

Definition at line 103 of file field_engine_tables.c.

RevealMarkerScript

const Sint32 RevealMarkerScript[]

A Reveal marker: stays while fdIsRevealActive returns nonzero (SC_CALL runs it again each tick), and releases itself once Reveal ends.

References fdIsRevealActive() and Sint32.

Referenced by fdEffectSpawnRevealMarkers().

Definition at line 112 of file field_engine_tables.c.

ScreenTransitionBarWidths

const Uint8 ScreenTransitionBarWidths[34]

The width of the bars of WINDOW_TRANSITION_BARS, by progress.

Referenced by fdScreenTransitionUpdateScanlineTable().

Definition at line 118 of file field_engine_tables.c.

ScreenTransitionEdgeOffsets

const Sint8 ScreenTransitionEdgeOffsets[32]

The wobble of the circle edge of WINDOW_TRANSITION_RIPPLE.

Referenced by fdScreenTransitionUpdateScanlineTable().

Definition at line 124 of file field_engine_tables.c.

ScreenTransitionDitherTable

const Uint8 ScreenTransitionDitherTable[64]

0 to 63 shuffled: the order in which the dissolve sets the pixels.

Referenced by fdScreenTransitionUpdateDissolve().

Definition at line 130 of file field_engine_tables.c.

ColorBufferChannelCurve

const Uint16 ColorBufferChannelCurve[32]

Colour channel curves of the palette tints (field_engine_palette_fade.c): each maps a 5-bit channel (0 to 31) to a palette fade channel, shifted up 10 bits, so 31 is 31 << 10 (31744).

Referenced by fdPaletteFadeBuild().

Definition at line 139 of file field_engine_tables.c.

ColorBufferChannelCurveLight

const Uint16 ColorBufferChannelCurveLight[32]

Referenced by fdPaletteFadeBuild().

Definition at line 146 of file field_engine_tables.c.

ColorBufferChannelCurveContrast

const Uint16 ColorBufferChannelCurveContrast[32]

Referenced by fdPaletteFadeBuild().

Definition at line 153 of file field_engine_tables.c.

SpeakerDefinitions

const SPEAKER_DEFINITION SpeakerDefinitions[131]

Speaker definitions: {sprite, voice, the lines it says while Halted}, each voice one of the eight that start at SE_VOICE_FIRST, four blips apart.

Referenced by fdSpeakerFindDefinition().

Definition at line 162 of file field_engine_tables.c.

RepeatedSquashScript

const Sint32 RepeatedSquashScript[97]

An actor squashes and springs back as many times as fdActorStartRepeatedMotion asks, 1 to 3: the motion is written three times, 32 words each, and a run of count motions starts (3 - count) * 32 words in and runs to the end. Each motion draws the actor in to three quarters of its width and an eighth taller at once, eases it back to its size over six ticks, and rests four.

References Sint32.

Referenced by fdActorStartRepeatedMotion().

Definition at line 300 of file field_engine_tables.c.

ActorBlinkSpriteColors

const Uint8 ActorBlinkSpriteColors[4]

A blinking actor's colour mode by tick ((TickCount >> 1) & 3, fdActorUpdateBlink): white for two ticks out of eight.

Referenced by fdActorUpdateBlink().

Definition at line 345 of file field_engine_tables.c.

LineScrollWaveSine

const Sint16 LineScrollWaveSine[256]

One cycle of sine in 256 entries, 4.12 fixed point (4096 at the peak).

Referenced by fdLineScrollBuildPage().

Definition at line 349 of file field_engine_tables.c.

WeatherRainSplashFrames

const Sint16 WeatherRainSplashFrames[80]

{dx, dy, tile, shape, size} for each of the 16 frames of a raindrop's splash (script_commands_weather.c): dx and dy in screen pixels from its spot, tile from its first tile.

Referenced by fdWeatherUpdateRain().

Definition at line 354 of file field_engine_tables.c.

FieldEffectSparklePictures

const SPARKLE_PICTURE FieldEffectSparklePictures[32]

{dy, tile} of a sparkle (script_commands_weather.c): dy in screen pixels from its spot, a row every two ticks.

Referenced by fdEffectUpdateSparkles().

Definition at line 375 of file field_engine_tables.c.

FieldEffectPulseScales

const Uint32 FieldEffectPulseScales[3]

Two scales that alternate ((FrameCount >> 2) & 1): full size and 0.97 of it (fdEffectPulseActorScale, script_commands_jupiter.c); nothing reads the third word.

Referenced by fdEffectPulseActorScale().

Definition at line 412 of file field_engine_tables.c.

FieldEffectSharedParticleScript

const Sint32 FieldEffectSharedParticleScript[]

The script most field Psynergy particles run: from its start it releases the actor at once; from its second word (+ 1) it waits for the actor to arrive, then releases it.

References Sint32.

Referenced by fdDjinnRunVenusJoinEffect(), fdEffectInitFallingFragment(), fdEffectRunSparkEmitter(), fdEffectSpawnBurstParticleField(), fdEffectSpawnHeavyImpact(), fdEffectUpdateDouseDrop(), fdEffectUpdateDriftingFallActor(), fdEffectUpdateOrbitingParticleFade(), fdEffectUpdateScaledArcActorA(), fdEffectUpdateScaledArcActorB(), fdEffectUpdateShrinkingOrbitActor(), fdEffectWanderAroundAnchor() and fdPsynergyForce().

Definition at line 416 of file field_engine_tables.c.

FieldEffectSourceHoldScript

const Sint32 FieldEffectSourceHoldScript[]

Faces the watched actor every tick, forever: the caster holding its target while Move, Carry or Lift has it (each gives the caster its target first).

References Sint32.

Referenced by fdPsynergyLiftOnTarget(), fdPsynergySteerLiftedTarget() and fdPsynergySteerPushedTarget().

Definition at line 424 of file field_engine_tables.c.

FieldEffectFragmentScript

const Sint32 FieldEffectFragmentScript[]

A shard or particle: waits to arrive, slows to 1/16 pixel a tick, and releases itself 10 ticks later.

References Sint32.

Referenced by fdEffectBurstHand(), fdEffectSpawnHeavyImpact(), fdEffectSpawnMoveHand() and fdPsynergySteerLiftedTarget().

Definition at line 432 of file field_engine_tables.c.

InputDpadAngles

const Uint16 InputDpadAngles[16]

An angle for each value of the right, left, up and down bits of the +Control Pad; DPAD_ANGLE_NONE for none (fdInputGetDpadAngle, script_commands_move.c).

Referenced by fdInputGetDpadAngle().

Definition at line 442 of file field_engine_tables.c.

FieldEffectQuadrantModes

const Uint8 FieldEffectQuadrantModes[4]

Move's hand animation by the quarter turns from its side of the target to the push (script_commands_move.c): 3 toward its side, 2 away from it, 1 either way across.

Referenced by fdPsynergySteerPushedTarget().

Definition at line 451 of file field_engine_tables.c.

GrowthLeafScript

const Sint32 GrowthLeafScript[]

Growth's falling leaves: each waits 60 ticks and releases itself.

References Sint32.

Referenced by fdPsynergyGrowth().

Definition at line 454 of file field_engine_tables.c.

UnusedQuadrantModesCopy

const Uint8 UnusedQuadrantModesCopy[4]

Unused: the same four bytes as FieldEffectQuadrantModes; nothing reads them.

Definition at line 460 of file field_engine_tables.c.

ForceFistScript

const Sint32 ForceFistScript[]

Waits to arrive, sets off fdEffectSpawnHeavyImpact (script_commands_lift.c) and releases the actor.

References fdEffectSpawnHeavyImpact() and Sint32.

Referenced by fdPsynergyForce().

Definition at line 464 of file field_engine_tables.c.

FieldEffectShortEffectScript

const Sint32 FieldEffectShortEffectScript[]

The three scripts of FieldEffectDurationScripts.

References Sint32.

Referenced by FieldEffectDurationScripts.

Definition at line 471 of file field_engine_tables.c.

FieldEffectMediumEffectScript

const Sint32 FieldEffectMediumEffectScript[]

References Sint32.

Referenced by FieldEffectDurationScripts.

Definition at line 476 of file field_engine_tables.c.

FieldEffectLongEffectScript

const Sint32 FieldEffectLongEffectScript[]

References Sint32.

Referenced by FieldEffectDurationScripts.

Definition at line 481 of file field_engine_tables.c.

HaltFlickerColorModes

const Sint8 HaltFlickerColorModes[8]

The colour modes a Halted actor flickers through at random (fdPsynergyUpdateHaltedActor, script_commands_halt.c): its own colours twice as often as each of the five channel swaps and grey.

Referenced by fdPsynergyUpdateHaltedActor().

Definition at line 489 of file field_engine_tables.c.

WorldMapMarkerBlendCycle

const Uint8 WorldMapMarkerBlendCycle[32]

The World Map markers' blend weight in sixteenths, against the picture's 16 less it ((TickCount >> 1) & 31, fdMapScreenUpdateMarkers): solid for 32 ticks, then down to half and back over the next 32.

Referenced by fdMapScreenUpdateMarkers().

Definition at line 497 of file field_engine_tables.c.

WorldMapCursorDirectionAngles

const Uint16 WorldMapCursorDirectionAngles[16]

An angle for each +Control Pad direction (eight of them); DPAD_ANGLE_NONE for none.

Referenced by fdMapScreenUpdateMarkers().

Definition at line 503 of file field_engine_tables.c.