Skip to Content
The Alchemy Project

src/field/field_engine_actor_commands.c

Script commands on actors: placing, moving and animating them. More…

Included by field_engine.c.

Macros

NameDescription
#defineREPEATED_MOTION_MAX 3The most squash-and-spring motions RepeatedSquashScript holds: it plays the motion that many times over, REPEATED_MOTION_SCRIPT_BYTES (32 words) each.
#defineREPEATED_MOTION_SCRIPT_BYTES (32 * sizeof(Sint32))
#defineACTOR_WATCH_ACTOR_MASK 0xffthe actor's bits
#defineFOLLOW_DISTANCE 40The distance, in pixels, a follower stays behind the actor it watches (fdActorMoveTowardTarget reads it from the follower's timer).

Enumerations

NameDescription
enumACTOR_WATCH_FLAG { ACTOR_WATCH_KEEP_MOTION }fdActorWatchAndStartScript's targetId: the actor to watch, and a flag to keep the watcher's own motion.

Functions

NameDescription
ACTOR *fdActorGetById (Uint32 actorId)Returns an actor, or NULL if it does not exist.
voidfdActorSetSpeedParams (Sint32 actorId, FIXED speedLimit, FIXED acceleration)The script command "set actor speed": its top speed and acceleration, 16.16 pixels per tick.
voidfdActorSetMovementTypeById (Sint32 actorId, const void *script)Gives an actor a movement type or actor script (fdActorSetMovementType) and makes it face where it moves (ACTOR_FACES_MOTION).
voidfdActorStop (Sint32 actorId)The script command "stop actor": stops its movement type and puts it back under script control, on the idle script (a lone SC_END), and makes it face where it moves.
voidfdActorResetTargetsAndVelocity (Uint32 actorId)As fdActorStop, and also clears the actor's target and velocity, so it stands where it is.
voidfdActorWatchAndSetScript (Sint32 actorId, Sint32 watchedActorId)Makes an actor follow another (the watched actor script): writes its watchedActor.
voidfdActorWaitForScriptEndById (Uint32 actorId)Waits, at most 300 ticks, for an actor's script to reach its end (SC_END).
voidfdActorSetMovementTypeAndWaitById (Sint32 actorId, const void *script)Starts a movement type or supplied actor script, as fdActorSetMovementTypeById does, then waits up to 300 ticks for its script to end.
voidfdActorSetDestinationById (Uint32 actorId, Sint32 x, Sint32 z)The script command "set actor destination": the actor heads for (x, z), in pixels, keeping its current animation.
voidfdActorMoveToAndWaitById (Uint32 actorId, Sint32 x, Sint32 z)The script command "move actor and wait": as fdActorSetDestinationById, then waits (at most 600 ticks) for the actor to arrive.
voidfdActorWalkToById (Sint32 actorId, Sint32 x, Sint32 z)The script command "walk actor to": the actor walks toward (x, z), in pixels.
voidfdActorWalkToAndWaitById (Sint32 actorId, Sint32 x, Sint32 z)The script command "walk actor to and wait": walks the actor to (x, z), in pixels, waits for it to arrive and stands it still.
voidfdActorCenterOnColumn (Uint32 actorId, Sint32 priority, Sint32 zOffset)The script command "center actor and walk": walks the actor sideways to the middle of its 16-pixel column, sets its sprite priority to priority (fdActorSetSpritePriority), then sends it zOffset pixels along z.
voidfdActorSetDestinationOffsetById (Sint32 actorId, Sint32 xOffset, Sint32 zOffset)The script command "set actor destination offset": the actor heads (xOffset, zOffset) pixels from where it stands.
voidfdActorWalkByById (Uint32 actorId, Sint32 xOffset, Sint32 zOffset)Walks the actor (xOffset, zOffset) pixels from where it stands, through the offset script.
voidfdActorWalkByAndWaitById (Uint32 actorId, Sint32 xOffset, Sint32 zOffset)Walks the actor (xOffset, zOffset) pixels, waits for it to arrive and stands it still.
voidfdActorLaunchFromLeader (Sint32 actorId, Sint32 xOffset, Sint32 zOffset, Sint32 facing)Places an actor on the leader, a pixel nearer the back, and sends it walking (xOffset, zOffset) pixels away at speed 0.8 and acceleration 0.4, through the launch script, which ends by turning it to facing (fdActorStepAngle).
voidfdActorWaitForMoveById (Sint32 actorId)The script command "wait for actor": waits (at most 600 ticks) for the actor to arrive and stands it still.
voidfdActorSetHorizontalPosWithTerrain (Uint32 actorId, FIXED x, FIXED z)The script command "set actor position": puts the actor at (x, z), 16.16 pixels, at rest; an actor that follows the ground keeps its height above it.
voidfdActorSetHorizontalPosAndAngleWithTerrain (actorId, x, z, angle) Sint32 actorId; Sint32 x; Sint32 z; Sint16 angle;As fdActorSetHorizontalPosWithTerrain, and turns the actor to angle.
voidfdActorSetPosWithTerrain (Uint32 actorId, FIXED x, FIXED y, FIXED z)Puts the actor at (x, y, z), 16.16 pixels, at rest; an actor that follows the ground is raised by the ground height there, as fdActorSetHorizontalPosWithTerrain raises it.
voidfdActorPlaceOnActor (Uint32 actorId, Uint32 otherId)Puts the first actor where the second stands, at rest, on the same ground height.
voidfdActorSetAnimationById (Uint32 actorId, Sint32 animation)The script command "set actor animation" (an ACTOR_ANIMATION: ANIM_STAND, ANIM_WALK, ANIM_NOD, ANIM_SHAKE_HEAD and so on).
voidfdActorSetAnimationSpeedById (Sint32 actorId, Sint32 steps)Sets the animation timer steps of each of an actor's sprites.
voidfdActorWaitForAnimationChange (Uint32 actorId)Waits, at most 90 ticks, for an actor's animation to change or for its first sprite animation's script to reach its hold command (ANIMCMD_HOLD).
voidfdActorSetAnimationAndWait (Sint32 actorId, Sint32 animation)The script command "set actor animation and wait": plays the animation and waits for it to end.
voidfdActorJump (Sint32 actorId, Sint32 speed, Sint32 ticks)The script command "actor jump": throws the actor upward at speed pixels per tick with a jump sound (a higher one above 5), then waits ticks ticks.
voidfdActorStartRepeatedMotion (Uint32 actorId, Sint32 count)The script command "start repeated motion": the actor squashes and springs back count times (1 to REPEATED_MOTION_MAX), through RepeatedSquashScript.
voidfdActorRunRepeatedMotion (Uint32 actorId, Sint32 count)The script command "run repeated motion": as fdActorStartRepeatedMotion, then waits for it to end.
voidfdEffectUpdateDustPuff (ACTOR *particle)Moves a dust puff of fdEffectSpawnDustPuff: it drifts with its x and z velocity (kept in speed and acceleration), which drag slows each tick, and rises 1/64 pixel a tick.
voidfdEffectSpawnDustPuff (ACTOR *src, Sint32 colorMode)Kicks up a dust puff (SPRITE_DUST_CLOUD) where source stands: it flies off toward the back at 0.5 to 1.4 pixels a tick and sideways at up to 1.4, with one of two animations, drawn at source's priority, in colorMode unless 0.
voidfdActorJumpDownLedge (Sint32 actorId, Sint32 pose, Sint32 dust)Makes an actor jump down off a ledge in front of it: it shows pose for 10 ticks, hops 12 pixels south from the middle of its 16-pixel column, turns toward FACING_SOUTH_SOUTHWEST while sinking 28 pixels with a dust puff every other tick in the colour mode dust (none when dust is -1), then jumps on to 16 pixels south of where it started and lands, waiting at most 180 ticks for it unless dust has LEDGE_JUMP_NO_LANDING_WAIT.
voidfdActorFaceActorById (Sint32 firstId, Sint32 secondId, Sint32 ticks)The script command "actor face actor": turns the first actor at once to face the second, then waits the given number of ticks.
voidfdActorTurnToFaceEachOther (Sint32 firstId, Sint32 secondId, Sint32 ticks)The script command "actors face each other": turns two actors toward each other, then waits the given number of ticks.
voidfdActorTurnPairToFaceEachOther (ACTOR *first, ACTOR *second)Turns two actors to face each other, at most 1/16 turn a tick each, until both do (at most 60 ticks).
voidfdActorReleaseById (Sint32 actorId)The script command "release actor": releases the actor and empties its slot in the field state's actor table.
voidfdActorConfigureSpriteColor (Sint32 actorId, Sint32 colorMode)The script command "set actor sprite colour": gives every sprite animation of the actor the colour mode (fdActorSetSpriteColor); with SPRITE_COLOR_BLINK the actor blinks instead (fdActorUpdateBlink).
voidfdActorUpdateBlink (ACTOR *actor)Per-tick update function of a blinking actor: sets its sprite animations' colour mode from ActorBlinkSpriteColors, each entry lasting two ticks.
voidfdActorSetSpriteColor (ACTOR *actor, Sint32 colorMode)Sets the colour mode (SPR_COL_MODE) of every running sprite animation of an actor's sprite.
voidfdActorWatchAndStartScript (Uint32 actorId, Sint32 targetId, const void *script)Makes an actor follow the actor in targetId's ACTOR_WATCH_ACTOR_MASK bits and starts script on it.

Description

Script commands on actors: placing, moving and animating them. Part of field_engine.c.

Macros in detail

REPEATED_MOTION_MAX

#define REPEATED_MOTION_MAX 3

The most squash-and-spring motions RepeatedSquashScript holds: it plays the motion that many times over, REPEATED_MOTION_SCRIPT_BYTES (32 words) each.

Referenced by fdActorStartRepeatedMotion().

Definition at line 465 of file field_engine_actor_commands.c.

REPEATED_MOTION_SCRIPT_BYTES

#define REPEATED_MOTION_SCRIPT_BYTES (32 * sizeof(Sint32))

Referenced by fdActorStartRepeatedMotion().

Definition at line 466 of file field_engine_actor_commands.c.

ACTOR_WATCH_ACTOR_MASK

#define ACTOR_WATCH_ACTOR_MASK 0xff

the actor's bits

Referenced by fdActorWatchAndStartScript().

Definition at line 802 of file field_engine_actor_commands.c.

FOLLOW_DISTANCE

#define FOLLOW_DISTANCE 40

The distance, in pixels, a follower stays behind the actor it watches (fdActorMoveTowardTarget reads it from the follower's timer).

Referenced by fdActorWatchAndStartScript().

Definition at line 805 of file field_engine_actor_commands.c.

Enumerations in detail

ACTOR_WATCH_FLAG

enum ACTOR_WATCH_FLAG

fdActorWatchAndStartScript's targetId: the actor to watch, and a flag to keep the watcher's own motion.

EnumeratorValueDescription
ACTOR_WATCH_KEEP_MOTION0x10000

Definition at line 797 of file field_engine_actor_commands.c.

Functions in detail

fdActorGetById

ACTOR *fdActorGetById(Uint32 actorId)

Returns an actor, or NULL if it does not exist.

References fdActorLookup().

Referenced by btGeyserDraw(), dbPsynergyTestClearSandLayer(), dbPsynergyTestSetSandLayer(), dbShopTestDropActor(), dbShopTestGrowActor(), dbShopTestRaiseStatue(), EFFECT_SPAWN, fdActorAppearInWhirlwind(), fdActorCopyGraphics(), fdActorDescendInWhirlwind(), fdActorDisableById(), fdActorFallOverById(), fdActorFallOverWithAnimationById(), fdActorGet(), fdActorJumpDownLedge(), fdActorLiftTargetBlock(), fdActorPlaceBlocks(), fdActorSetMetatileOpen(), fdActorSetMetatileShape(), fdActorSetMovementType(), fdActorSetSpriteRotationById(), fdActorShowItemIconById(), fdActorWatchAndSetScript(), fdChestOpenAndShowItem(), fdClimbDown(), fdClimbUp(), fdCycloneCopyTouchedMetatiles(), fdDjinnRunBattleStartHop(), fdDjinnRunJupiterJoinEffect(), fdDjinnRunMarsJoinEffect(), fdDjinnRunMercuryJoinEffect(), fdDjinnRunVenusJoinEffect(), fdEffectRunAngledApproachPhases(), fdEffectSpawnResident(), fdEffectUpdateDescendingOrbitActor(), fdEffectUpdateMarsSpark(), fdEffectUpdateRadialSpread(), fdEffectUpdateRandomTargetParticle(), fdEngineRun(), fdFlagBlockApplyFlags(), fdFlagBlockPlaceAll(), fdFlagBlockPlaceAllMarkingEdges(), fdHangingVineHang(), fdHangingVinePlace(), fdHangingVineSwing(), fdHangingVineUpdate(), fdLeaderCanPushObjectAhead(), fdLeaderFindActorAhead(), fdLeaderPushObjectAhead(), fdMadPlantLeapAtLeader() and 664 more.

Definition at line 7 of file field_engine_actor_commands.c.

fdActorSetSpeedParams

void fdActorSetSpeedParams(Sint32 actorId, FIXED speedLimit, FIXED acceleration)

The script command "set actor speed": its top speed and acceleration, 16.16 pixels per tick. Writes the actor's speedLimit and acceleration.

References fdActorLookup() and Sint32.

Referenced by fdActorLaunchFromLeader(), fdActorSetSpeedFX(), scAirsRockInsideRideFaceVent(), scAirsRockInsideRideStatuesVent(), scIzumoEnterDoor(), scIzumoStopThePartyToThankThem() and scIzumoTellTheCloudBrandLegend().

Definition at line 18 of file field_engine_actor_commands.c.

fdActorSetMovementTypeById

void fdActorSetMovementTypeById(Sint32 actorId, const void *script)

Gives an actor a movement type or actor script (fdActorSetMovementType) and makes it face where it moves (ACTOR_FACES_MOTION).

References fdActorLookup(), fdActorSetMovementType() and Sint32.

Referenced by fdActorSetScript(), scAirsRockInsideShebaLearnsReveal(), scAlhafraMadransArrive(), scAnemosInnerSanctumDullahanLightRises(), scAquaRockInsidePiersLearnsParch(), scChampaCliffCavesObabaMournsSalamander(), scContigoInitShops(), scContigoOpenSanctumDoor(), scContigoReturnToNewHome(), scContigoTheReunion(), scEasternAlhafraShipBriggsIsCaught(), scEasternAlhafraShipMayorArrives(), scGabombaStatueChamberGabombaNamesWitchDoctor(), scGabombaStatueChamberWhereIsTheOrb(), scGaiaRockInsideFelixLearnsSand(), scInit(), scJupiterLighthouseBringInBeam(), scKandoreanTempleAskAboutPoi(), scKandoreanTempleMeetPoi(), scKandoreanTempleStartFogRoom(), scKandoreanTempleStartMeditating(), scKibomboDeadEndByTheStatue(), scKibomboEnterDoor(), scKibomboGabombaSeesJewel(), scKibomboMeetPiers(), scKibomboPiersJoinsParty(), scKibomboWarriorsPanic(), scShrineOfTheSeaGodInitSideRoom(), scShrineOfTheSeaGodLashRope(), scShrineOfTheSeaGodStartleRiki(), scTrialRoadShowTraps(), scVenusLighthouseRepelLeader() and scYampiDesertTravelersLookUp().

Definition at line 31 of file field_engine_actor_commands.c.

fdActorStop

void fdActorStop(Sint32 actorId)

The script command "stop actor": stops its movement type and puts it back under script control, on the idle script (a lone SC_END), and makes it face where it moves.

References fdActorLookup() and Sint32.

Referenced by scAlhafraMadransArrive(), scAlhafraManorBriggsEscapes(), scChampaCliffCavesObabaMournsSalamander(), scContigoInitVillage(), scContigoTheReunion(), scDehkanPlateauCannonCracksLastPillar(), scDehkanPlateauCannonCracksPillars(), scFieldActorStop(), scGabombaStatueChamberWhereIsTheOrb(), scInit(), scIsletCaveTremorRevealsSerac(), scIsletsTradeWithCow(), scJupiterLighthousePlacePathBlock(), scKandoreanTempleAskAboutPoi(), scKandoreanTempleMeetPoi(), scKibomboDeadEndByTheStatue(), scKibomboPiersJoinsParty(), scKibomboWarriorsPanic(), scLemurianShipStepOnLift(), scLemuriaPalaceMeetKingHydros(), scLemuriaRoomsPiersVisitsUncle(), scShamanVillageHopFortuneTeller(), scShamanVillageShebaClearsSand(), scShamanVillageShowShamansRod(), scShrineOfTheSeaGodDjinniFleesSouth(), scShrineOfTheSeaGodDjinniRunsNorth(), scShrineOfTheSeaGodDjinniRunsWest(), scShrineOfTheSeaGodLashRope(), scShrineOfTheSeaGodStartDjinniDash(), scShrineOfTheSeaGodStartleRiki(), scYampiDesertCornerScorpion(), scYampiDesertStirScorpion(), scYampiDesertStirScorpionAgain() and scYampiDesertTravelersLookUp().

Definition at line 45 of file field_engine_actor_commands.c.

fdActorResetTargetsAndVelocity

void fdActorResetTargetsAndVelocity(Uint32 actorId)

As fdActorStop, and also clears the actor's target and velocity, so it stands where it is.

References fdActorLookup().

Referenced by scGaiaRockInsideSaveSusa(), scKibomboMountainsDropOffLedge(), scKibomboMountainsGuardSpotsParty() and scKibomboMountainsGuardsReport().

Definition at line 57 of file field_engine_actor_commands.c.

fdActorWatchAndSetScript

void fdActorWatchAndSetScript(Sint32 actorId, Sint32 watchedActorId)

Makes an actor follow another (the watched actor script): writes its watchedActor.

References ActorFaceWatchedScript, fdActorGetById(), fdActorLookup(), fdActorSetMovementType() and Sint32.

Referenced by scAlhafraMadransArrive(), scAlhafraManorBriggsEscapes(), scAlhafraManorDefendTheMayor(), scAlhafraManorPointOutAirsRock(), scAttekaInletSetUpTheHarbor(), scChampaCliffCavesObabaMournsSalamander(), scContigoTheReunion(), scDehkanPlateauCannonCornered(), scDehkanPlateauCannonCracksLastPillar(), scDehkanPlateauCannonCracksPillars(), scDehkanPlateauCannonPoundsStake(), scFieldActorWatchAndSetScript(), scGabombaStatueChamberWhereIsTheOrb(), scInit(), scIsletsTradeWithCow(), scKandoreanTempleMeetPoi(), scKandoreanTempleReceiveLash(), scKibomboDeadEndByTheStatue(), scKibomboPiersJoinsParty(), scLemurianShipStepOnLift(), scLemuriaPalaceMeetKingHydros(), scLemuriaRoomsPiersVisitsUncle(), scLemuriaRoomsTalkToPiersUncle(), scShamanVillageCheckTrialEntry(), scShamanVillageShebaClearsSand(), scShamanVillageShowShamansRod(), scShrineOfTheSeaGodDjinniFleesEast(), scShrineOfTheSeaGodDjinniHopsOntoLedge(), scShrineOfTheSeaGodDjinniRunsNorth(), scShrineOfTheSeaGodDjinniRunsWest(), scShrineOfTheSeaGodEndDjinniDash(), scShrineOfTheSeaGodInitBreath(), scShrineOfTheSeaGodLashRope(), scTundariaTowerRefluxAppears(), scYampiDesertCornerScorpion(), scYampiDesertStirScorpion(), scYampiDesertStirScorpionAgain(), scYampiDesertTravelersLookUp() and scYampiDesertWatchScorpionStop().

Definition at line 75 of file field_engine_actor_commands.c.

fdActorWaitForScriptEndById

void fdActorWaitForScriptEndById(Uint32 actorId)

Waits, at most 300 ticks, for an actor's script to reach its end (SC_END).

References fdActorLookup() and fdActorWaitForScriptEndStub().

Referenced by fdActorFaceDirectionAndRefreshById(), fdActorRunRepeatedMotion(), fdClimbDown(), scAlhafraMadransArrive(), scChampaCliffCavesObabaMournsSalamander(), scEasternAlhafraShipMayorArrives(), scFieldActorWaitForScriptEndById(), scGabombaStatueChamberDropIntoHole(), scInit(), scLohoFireCannon(), scTrialRoadShowTraps(), scVenusLighthouseRepelLeader() and scWorldMapFightBanditAndThieves().

Definition at line 87 of file field_engine_actor_commands.c.

fdActorSetMovementTypeAndWaitById

void fdActorSetMovementTypeAndWaitById(Sint32 actorId, const void *script)

Starts a movement type or supplied actor script, as fdActorSetMovementTypeById does, then waits up to 300 ticks for its script to end.

References fdActorLookup(), fdActorSetMovementType(), fdActorWaitForScriptEndStub() and Sint32.

Referenced by fdActorRunScriptAndWait(), scAnemosInnerSanctumDullahanLightRises(), scContigoReturnToNewHome(), scContigoTheReunion(), scGabombaStatueChamberGabombaNamesWitchDoctor(), scKandoreanTempleMeetPoi(), scKibomboDeadEndByTheStatue(), scKibomboGabombaSeesJewel(), scKibomboMeetPiers(), scKibomboPiersJoinsParty(), scShrineOfTheSeaGodLashRope() and scYampiDesertTravelersLookUp().

Definition at line 98 of file field_engine_actor_commands.c.

fdActorSetDestinationById

void fdActorSetDestinationById(Uint32 actorId, Sint32 x, Sint32 z)

The script command "set actor destination": the actor heads for (x, z), in pixels, keeping its current animation.

References fdActorLookup() and Sint32.

Referenced by fdActorSetDestination(), scActorJoinLeader(), scAirsRockInsideReadRevealTablet(), scAncientLemuriaHeadForTheDock(), scAncientLemuriaMeetTheLemurians(), scAquaRockMoaiStepAside(), scAttekaInletAskKradenToSetSail(), scAttekaInletKradenAsksToSetSail(), scChampaCliffCavesObabaMournsSalamander(), scEasternAlhafraShipBriggsIsCaught(), scGabombaCatacombsGabombaBestowsPower(), scGaiaRockInsidePlaceDollOnCobwebAltar(), scGaiaRockInsidePlaceDollOnEastAltar(), scGaiaRockInsidePlaceDollOnWestAltar(), scIdejimaCatchUpWithFelix(), scIdejimaWakeSheba(), scInit(), scIsletCaveSentinelAwaits(), scIzumoRoomsRecognizeTheHeroes(), scKandoreanTempleFightChestbeaters(), scKandoreanTempleFindTheHiddenPassage(), scKandoreanTempleKradenSuspectsTheWall(), scKandoreanTempleMeetPoi(), scKibomboCeremonyEnds(), scKibomboCeremonyStarts(), scKibomboPiersThanksParty(), scMadraMeetKarst(), scShrineOfTheSeaGodLashRope() and scShrineOfTheSeaGodThrowRopeAgain().

Definition at line 112 of file field_engine_actor_commands.c.

fdActorMoveToAndWaitById

void fdActorMoveToAndWaitById(Uint32 actorId, Sint32 x, Sint32 z)

The script command "move actor and wait": as fdActorSetDestinationById, then waits (at most 600 ticks) for the actor to arrive.

References fdActorLookup(), fdActorWaitForMoveStub() and Sint32.

Referenced by fdActorMoveToAndWait(), fdClimbDown(), fdClimbUp(), fdTryJumpForward(), scAirsRockInsideRideFaceVent(), scAirsRockInsideRideStatuesVent(), scAquaRockArriveFromInside(), scAquaRockArriveUpStream(), scCavernsJumpAcross(), scDehkanPlateauStepOnCrack(), scEasternAlhafraShipKnockDownTheBread(), scGabombaStatueChamberWhereIsTheOrb(), scKandoreanTempleFightChestbeaters(), scLeaderCenterInMetatile(), scShrineOfTheSeaGodBreakFirstBridge(), scShrineOfTheSeaGodBreakSecondBridge(), scYampiDesertCornerScorpion(), scYampiDesertLandAndFightKingScorpion(), scYampiDesertStirScorpion(), scYampiDesertStirScorpionAgain() and scYampiDesertTrapKingScorpion().

Definition at line 126 of file field_engine_actor_commands.c.

fdActorWalkToById

void fdActorWalkToById(Sint32 actorId, Sint32 x, Sint32 z)

The script command "walk actor to": the actor walks toward (x, z), in pixels.

References fdActorLookup(), fdActorSelectAnimationStub() and Sint32.

Referenced by fdActorWalkTo(), scAirsRockInsideOpenTabletRoomDoor(), scAirsRockInsideReadRevealTablet(), scChampaCliffCavesFightAvimander(), scChampaCliffCavesObabaMournsSalamander(), scInit(), scIzumoStopThePartyToThankThem(), scIzumoTellTheCloudBrandLegend(), scKandoreanTempleEnterTheCave() and scKibomboAkafubuOffersCrystal().

Definition at line 140 of file field_engine_actor_commands.c.

fdActorWalkToAndWaitById

void fdActorWalkToAndWaitById(Sint32 actorId, Sint32 x, Sint32 z)

The script command "walk actor to and wait": walks the actor to (x, z), in pixels, waits for it to arrive and stands it still.

References fdActorLookup(), fdActorSelectAnimationStub(), fdActorWaitForMoveStub() and Sint32.

Referenced by fdActorWalkToAndWait(), scAirsRockInsideReadRevealTablet(), scAirsRockInsideWalkToRevealTablet(), scAlhafraManorDefendTheMayor(), scAlhafraManorPointOutAirsRock(), scAlhafraPirateSeesMadrasMayor(), scAncientLemuriaCycloneRevealsRime(), scAttekaInletHammaShowsTheWings(), scAttekaInletKradenAsksToSetSail(), scAttekaInletShipwrightsStopTheParty(), scChampaCliffCavesFightAvimander(), scChampaCliffCavesHandPieceToObaba(), scChampaCliffCavesObabaAsksForBriggs(), scContigoReturnToNewHome(), scContigoTheReunion(), scDailaMeetAlex(), scDehkanPlateauCannonCracksLastPillar(), scDehkanPlateauCannonCracksPillars(), scDehkanPlateauCannonLeapsAway(), scEasternAlhafraShipBriggsIsCaught(), scGabombaStatueChamberDropIntoHole(), scGabombaStatueChamberGabombaNamesWitchDoctor(), scGabombaStatueChamberRideLiftBackUp(), scIzumoRoomsRecognizeTheHeroes(), scKandoreanTempleClimbDownTheLadder(), scKandoreanTempleClimbDownTheWell(), scKandoreanTempleFightChestbeaters(), scKandoreanTempleFindTheHiddenPassage(), scKandoreanTempleKradenSuspectsTheWall(), scKandoreanTempleTestTheStudents(), scKibomboAkafubuOffersCrystal(), scKibomboClimbDownLadder(), scKibomboDeadEndByTheStatue(), scKibomboPiersJoinsParty(), scKibomboPiersRefusesToLeave(), scKibomboPresentJewelToGabomba(), scShrineOfTheSeaGodBreakCrossroadsBridge(), scShrineOfTheSeaGodBreakFirstBridge(), scShrineOfTheSeaGodDjinniRunsNorth(), scShrineOfTheSeaGodDjinniRunsWest(), scTrialRoadShowTraps(), scVenusLighthouseRepelLeader(), scYampiDesertClimbDownLadder(), scYampiDesertStirScorpion() and scYampiDesertTrapKingScorpion().

Definition at line 155 of file field_engine_actor_commands.c.

fdActorCenterOnColumn

void fdActorCenterOnColumn(Uint32 actorId, Sint32 priority, Sint32 zOffset)

The script command "center actor and walk": walks the actor sideways to the middle of its 16-pixel column, sets its sprite priority to priority (fdActorSetSpritePriority), then sends it zOffset pixels along z.

References fdActorLookup(), fdActorSelectAnimationStub(), fdActorSetSpritePriority(), fdActorWaitForMoveStub() and Sint32.

Referenced by fdActorCenterAndWalk() and scLemurianShipOpenLowerDoor().

Definition at line 173 of file field_engine_actor_commands.c.

fdActorSetDestinationOffsetById

void fdActorSetDestinationOffsetById(Sint32 actorId, Sint32 xOffset, Sint32 zOffset)

The script command "set actor destination offset": the actor heads (xOffset, zOffset) pixels from where it stands.

References fdActorLookup() and Sint32.

Referenced by fdActorLaunchFromLeader(), fdActorSetDestinationOffset(), scAquaRockEnterSparklingPassage(), scCavernsWalkIntoPassage(), scChampaCliffCavesObabaForgesTrident(), scGabombaStatueChamberRideLiftDown(), scGaiaRockInsidePlaceDollOnWestAltar(), scIzumoDescendIntoTheRuins(), scIzumoScatterWeedsOverFirstAntidote(), scIzumoScatterWeedsOverLuckyMedal(), scIzumoScatterWeedsOverSecondAntidote() and scTrialRoadPushLog().

Definition at line 207 of file field_engine_actor_commands.c.

fdActorWalkByById

void fdActorWalkByById(Uint32 actorId, Sint32 xOffset, Sint32 zOffset)

Walks the actor (xOffset, zOffset) pixels from where it stands, through the offset script.

References ActorOffsetScript, fdActorLookup(), fdActorSelectAnimationStub(), fdActorStartScriptStub() and Sint32.

Referenced by fdActorWalkBy(), fdActorWalkByAndWaitById(), scAlhafraManorBriggsEscapes(), scChampaCliffCavesObabaMournsSalamander(), scEasternAlhafraShipBriggsIsCaught(), scEasternAlhafraShipMayorArrives(), scIzumoRoomsKushinadaAsksSusaNotToCome() and scMadraMeetKarst().

Definition at line 226 of file field_engine_actor_commands.c.

fdActorWalkByAndWaitById

void fdActorWalkByAndWaitById(Uint32 actorId, Sint32 xOffset, Sint32 zOffset)

Walks the actor (xOffset, zOffset) pixels, waits for it to arrive and stands it still.

References fdActorLookup(), fdActorSelectAnimationStub(), fdActorWaitForMoveStub(), fdActorWalkByById() and Sint32.

Referenced by fdActorWalkByAndWait(), Hop(), scAlhafraMadransArrive(), scAlhafraManorBriggsEscapes(), scAlhafraPirateSeesMadrasMayor(), scAncientLemuriaMeetTheLemurians(), scAquaRockArriveFromPassage(), scCavernsWalkEastIntoPassage(), scCavernsWalkWestIntoPassage(), scChampaCliffCavesFightAvimander(), scChampaCliffCavesHandPieceToObaba(), scChampaCliffCavesObabaAsksForBriggs(), scChampaCliffCavesObabaForgesTrident(), scChampaCliffCavesObabaMournsSalamander(), scChampaCliffCavesObabaStepsForward(), scEasternAlhafraShipBriggsIsCaught(), scIzumoEnterTheRuinsFromTheLeft(), scIzumoEnterTheRuinsFromTheRight(), scMadraGrantPassageToOsenia(), scMadraMeetKarst() and scTrialRoadShowTraps().

Definition at line 244 of file field_engine_actor_commands.c.

fdActorLaunchFromLeader

void fdActorLaunchFromLeader(Sint32 actorId, Sint32 xOffset, Sint32 zOffset, Sint32 facing)

Places an actor on the leader, a pixel nearer the back, and sends it walking (xOffset, zOffset) pixels away at speed 0.8 and acceleration 0.4, through the launch script, which ends by turning it to facing (fdActorStepAngle).

References ActorLaunchScript, fdActorLookup(), fdActorPlaceOnActor(), fdActorSelectAnimationStub(), fdActorSetDestinationOffsetById(), fdActorSetPosAndResetMotionStub(), fdActorSetSpeedParams(), fdActorStartScriptStub(), MainRoutineStateWork and Sint32.

Referenced by scDailaMeetAlex(), scFieldActorLaunchFromLeader(), scKandoreanTempleFindTheHiddenPassage(), scMadraStopPartyAfterRaid(), scSuhallaGatePointToMeetingSpot() and scWorldMapFightBanditAndThieves().

Definition at line 259 of file field_engine_actor_commands.c.

fdActorWaitForMoveById

void fdActorWaitForMoveById(Sint32 actorId)

The script command "wait for actor": waits (at most 600 ticks) for the actor to arrive and stands it still.

References fdActorLookup(), fdActorSelectAnimationStub(), fdActorWaitForMoveStub() and Sint32.

Referenced by fdClimbDown(), fdClimbUp(), scActorJoinLeader(), scAirsRockInsideReadRevealTablet(), scAlhafraMadransArrive(), scAlhafraManorBriggsEscapes(), scAncientLemuriaHeadForTheDock(), scAncientLemuriaMeetTheLemurians(), scAncientLemuriaTremorShakesOutRime(), scAquaRockEnterSparklingPassage(), scAttekaInletAskKradenToSetSail(), scAttekaInletKradenAsksToSetSail(), scCavernsWalkIntoPassage(), scChampaCliffCavesObabaMournsSalamander(), scContigoScatterWeedsOverBrambleSeed(), scEasternAlhafraShipBriggsIsCaught(), scEasternAlhafraShipKnockDownTheBread(), scEasternAlhafraShipMayorArrives(), scFieldActorWaitForMoveById(), scGabombaCatacombsGabombaBestowsPower(), scGabombaStatueChamberRideLiftDown(), scGaiaRockInsidePlaceDollOnCobwebAltar(), scGaiaRockInsidePlaceDollOnEastAltar(), scGaiaRockInsidePlaceDollOnWestAltar(), scIdejimaWakeSheba(), scInit(), scIzumoDescendIntoTheRuins(), scIzumoRoomsGiveUzumeTheDoll(), scIzumoRoomsKushinadaAsksSusaNotToCome(), scIzumoRoomsRecognizeTheHeroes(), scIzumoScatterWeedsOverFirstAntidote(), scIzumoScatterWeedsOverLuckyMedal(), scIzumoScatterWeedsOverSecondAntidote(), scIzumoStopThePartyToThankThem(), scIzumoTellTheCloudBrandLegend(), scKandoreanTempleFindTheHiddenPassage(), scKandoreanTempleKradenSuspectsTheWall(), scKandoreanTempleMeetPoi(), scKandoreanTempleReceiveLash(), scKibomboAkafubuOffersCrystal(), scKibomboCeremonyEnds(), scKibomboCeremonyStarts(), scKibomboPiersThanksParty(), scLemuriaDockMoveKraden(), scLemurianShipDeckRunToFelix(), scLemurianShipFightAquaHydra(), scLemuriaPalaceMeetKingHydros(), scLemuriaRoomsMeetLunpa(), scLemuriaRoomsPiersVisitsUncle(), scLinkLobbyEnterBattle() and 25 more.

Definition at line 282 of file field_engine_actor_commands.c.

fdActorSetHorizontalPosWithTerrain

void fdActorSetHorizontalPosWithTerrain(Uint32 actorId, FIXED x, FIXED z)

The script command "set actor position": puts the actor at (x, z), 16.16 pixels, at rest; an actor that follows the ground keeps its height above it.

References fdActorLookup(), fdActorSetPosAndResetMotionStub(), fdMapGridGetTerrainHeightStub() and Sint32.

Referenced by fdActorSetPosFX(), fdPsynergyParch(), fdScriptPickUpItem(), scAirsRockInsideReadRevealTablet(), scAquaRockArriveFromPassage(), scInit(), scIzumoRevealTheStoneCircle(), scIzumoScatterWeedsOverFirstAntidote(), scIzumoScatterWeedsOverLuckyMedal(), scIzumoScatterWeedsOverSecondAntidote(), scIzumoStopThePartyToThankThem(), scIzumoTellTheCloudBrandLegend(), scShrineOfTheSeaGodBreakFirstBridge(), scShrineOfTheSeaGodBreakSecondBridge(), scShrineOfTheSeaGodDjinniFleesSouth(), scShrineOfTheSeaGodDjinniRunsWest(), scShrineOfTheSeaGodInitCrossroads(), scShrineOfTheSeaGodInitEntrance(), scShrineOfTheSeaGodInitSideRoom() and scShrineOfTheSeaGodThrowRopeAgain().

Definition at line 295 of file field_engine_actor_commands.c.

fdActorSetHorizontalPosAndAngleWithTerrain

void fdActorSetHorizontalPosAndAngleWithTerrain(actorId, x, z, angle) Sint32 actorId; Sint32 x; Sint32 z; Sint16 angle;

As fdActorSetHorizontalPosWithTerrain, and turns the actor to angle. Written in the old style: the angle arrives as a word and is taken as a halfword.

References fdActorLookup(), fdActorSetPosAndResetMotionStub(), fdMapGridGetTerrainHeightStub() and Sint32.

Referenced by fdActorSetPosAndFacing(), scActorPlaceFacing(), scAttekaInletHammetsMessengerArrives(), scContigoTheReunion(), scDehkanPlateauCannonPoundsLeaderThrough(), scGabombaStatueChamberWhereIsTheOrb(), scInit(), scKandoreanTempleMeetPoi(), scKibomboCeremonyEnds(), scMadraMeetKarst() and scYampiDesertSetPosAndFacing().

Definition at line 320 of file field_engine_actor_commands.c.

fdActorSetPosWithTerrain

void fdActorSetPosWithTerrain(Uint32 actorId, FIXED x, FIXED y, FIXED z)

Puts the actor at (x, y, z), 16.16 pixels, at rest; an actor that follows the ground is raised by the ground height there, as fdActorSetHorizontalPosWithTerrain raises it.

References fdActorLookup(), fdActorSetPosAndResetMotionStub(), fdMapGridGetTerrainHeightStub() and Sint32.

Definition at line 349 of file field_engine_actor_commands.c.

fdActorPlaceOnActor

void fdActorPlaceOnActor(Uint32 actorId, Uint32 otherId)

Puts the first actor where the second stands, at rest, on the same ground height.

References fdActorLookup() and fdActorSetPosAndResetMotionStub().

Referenced by fdActorLaunchFromLeader(), scAirsRockInsideReadRevealTablet(), scAncientLemuriaMeetTheLemurians(), scAnemosInnerSanctumDullahanLightRises(), scAquaRockInsideReadParchTablet(), scAttekaInletKradenAsksToSetSail(), scContigoReturnToNewHome(), scContigoTheReunion(), scCrumblingPillarPlaceWithStandIn(), scGabombaCatacombsGabombaBestowsPower(), scGabombaStatueChamberGabombaNamesWitchDoctor(), scGabombaStatueFocusEnergies(), scGabombaStatueKradenNoticesTiming(), scGaiaRockInsidePlaceDollOnCobwebAltar(), scGaiaRockInsidePlaceDollOnEastAltar(), scGaiaRockInsidePlaceDollOnEntranceAltar(), scGaiaRockInsidePlaceDollOnWestAltar(), scGaiaRockInsideReadSandTablet(), scGondowanCliffsTurnBackToHelpPiers(), scIdejimaBreakAwayFromGondowan(), scIdejimaWonderWhereAlexHasGone(), scIsletsArriveAtSecretSpot(), scIsletsArriveBackAtIsland(), scJupiterLighthouseCastTheJupiterStar(), scKandoreanTemplePassTheTest(), scKibomboDeadEndByTheStatue(), scKibomboMeetPiers(), scKibomboPiersRefusesToLeave(), scLemurianShipDeckKradenGoesToFindShip(), scLemurianShipDeckReturnToShip(), scLemurianShipSetBlackCrystal(), scLemuriaSpringGivePrize(), scMadraCatacombsLightFlames(), scMagmaRockInsideReadBlazeTablet(), scMagmaRockInsideRestorePillars(), scMarsLighthouseAerieFaceDoomDragon(), scMarsLighthouseStarRoomWakeAfterBattle(), scProxMeetPuelle(), scProxSayFarewell(), scShamanVillageMeetMoapa(), scShamanVillageShebaClearsSand(), scShamanVillageShowShamansRod(), scTrialRoadGatherAtPeak(), scTrialRoadReachPeakFirst(), scWorldMapMeetEcho() and scWorldMapRefuseToRunAway().

Definition at line 371 of file field_engine_actor_commands.c.

fdActorSetAnimationById

void fdActorSetAnimationById(Uint32 actorId, Sint32 animation)

The script command "set actor animation" (an ACTOR_ANIMATION: ANIM_STAND, ANIM_WALK, ANIM_NOD, ANIM_SHAKE_HEAD and so on).

References fdActorLookup(), fdActorSelectAnimationStub() and Sint32.

Referenced by dbIncreaseItemAndLevelRunMotionTest(), dbPsynergyTest2GrindStake(), fdActorSetAnimation(), fdActorSetAnimationAndWait(), fdScriptAskYesNoWithActorAnimation(), scActorJoinLeader(), scAirsRockInsideLandInHall(), scAirsRockInsideReadRevealTablet(), scAirsRockInsideRiseOnLift(), scAlhafraFindGoldCoins(), scAlhafraGiveBreadToHungryBoy(), scAlhafraMadransArrive(), scAlhafraManorBriggsEscapes(), scAlhafraOpenDoorAndEnter(), scAncientLemuriaCycloneRevealsRime(), scAncientLemuriaHeadForTheDock(), scAncientLemuriaMeetTheLemurians(), scAnemosInnerSanctumDullahanOpenTheWay(), scAquaRockEnterSparklingPassage(), scAttekaInletAskKradenToSetSail(), scAttekaInletHammaShowsTheWings(), scAttekaInletHammetsMessengerArrives(), scAttekaInletKradenAsksToSetSail(), scAttekaInletOpenDoorAndEnter(), scAttekaInletShipwrightsStopTheParty(), scCavernsWalkIntoPassage(), scChampaCliffCavesAskIfBriggsLearned(), scChampaCliffCavesFightAvimander(), scChampaCliffCavesObabaAsksForSecondPiece(), scChampaCliffCavesObabaForgesTrident(), scChampaCliffCavesObabaMournsSalamander(), scChampaCliffCavesObabaSeesAWeapon(), scChampaCliffCavesObabaStepsForward(), scChampaCliffCavesOpenDoorAndEnter(), scContigoBabyThinks(), scContigoInitShops(), scContigoReturnToNewHome(), scContigoSetUpWingParts(), scContigoTheReunion(), scDailaEnterDoor(), scDailaMeetAlex(), scDailaRoomsTalkCaughtPracticing(), scDehkanPlateauCannonPoundsLeaderThrough(), scDehkanPlateauCrackPillar(), scDehkanPlateauInitTightropes(), scDehkanPlateauLandFromFall(), scDehkanPlateauSinkPoundedStake(), scDehkanPlateauStepOnCrack(), scEasternAlhafraShipBriggsIsCaught(), scEasternAlhafraShipKnockDownTheBread() and 79 more.

Definition at line 386 of file field_engine_actor_commands.c.

fdActorSetAnimationSpeedById

void fdActorSetAnimationSpeedById(Sint32 actorId, Sint32 steps)

Sets the animation timer steps of each of an actor's sprites.

References fdActorLookup(), fdActorSetAnimationSpeedStub() and Sint32.

Referenced by scInit(), scMagmaRockKnockLeaderOffWall() and scTundariaTowerJumpDownSlide().

Definition at line 395 of file field_engine_actor_commands.c.

fdActorWaitForAnimationChange

void fdActorWaitForAnimationChange(Uint32 actorId)

Waits, at most 90 ticks, for an actor's animation to change or for its first sprite animation's script to reach its hold command (ANIMCMD_HOLD). Only an actor drawn as a sprite (ACTOR_SPRITE_ONE) is waited for.

References fdActorLookup(), Sint32 and sySynch().

Referenced by dbIncreaseItemAndLevelRunMotionTest(), fdActorSetAnimationAndWait(), scContigoTheReunion(), scIdejimaBreakAwayFromGondowan(), scIdejimaFelixWakes(), scLemurianShipDeckSightMenardisShip(), scMadraRoomsShinAngersPiers(), scMagmaRockKnockLeaderOffWall(), scMarsLighthouseAerieFaceDoomDragon(), scMarsLighthouseAerieWatchGoldenSunRise(), scMarsLighthouseStarRoomWakeAfterBattle(), scNaribweRoomsReadFortune(), scProxMeetPuelle() and scShamanVillageShebaClearsSand().

Definition at line 406 of file field_engine_actor_commands.c.

fdActorSetAnimationAndWait

void fdActorSetAnimationAndWait(Sint32 actorId, Sint32 animation)

The script command "set actor animation and wait": plays the animation and waits for it to end.

References fdActorSetAnimationById(), fdActorWaitForAnimationChange() and Sint32.

Referenced by scAlhafraFatherLetsPartyToCave(), scAlhafraFindGoldCoins(), scAlhafraMadransArrive(), scAlhafraManorBriggsEscapes(), scAlhafraManorComplainAboutTheMayor(), scAlhafraManorDefendTheMayor(), scAlhafraManorTellOfTheEasternSea(), scAlhafranCaveChauchaAndEoleoVisit(), scAlhafraPirateSeesMadrasMayor(), scAlhafraRoomsGuestsAskForTea(), scAlhafraRoomsMeetAlex(), scAlhafraRoomsOverhearCrossboneIsleTale(), scAlhafraTalkToHungryBoy(), scAncientLemuriaMeetTheLemurians(), scApojiiIslandsFatherSeesTheStone(), scAttekaInletHammaShowsTheWings(), scAttekaInletHammetsMessengerArrives(), scChampaCliffCavesAskIfBriggsLearned(), scChampaCliffCavesFightAvimander(), scChampaCliffCavesHandPieceToObaba(), scChampaCliffCavesObabaMournsSalamander(), scChampaCliffCavesObabaSeesAWeapon(), scChampaFeizhiArrives(), scChampaMeetAlex(), scContigoBabyThinks(), scContigoReturnToNewHome(), scContigoTheReunion(), scEasternAlhafraAskIfFinished(), scEasternAlhafraAskToHelpWithMast(), scEasternAlhafraBriggsStealsShip(), scEasternAlhafraMayorFindsShipGone(), scEasternAlhafraOverhearWorkers(), scEasternAlhafraShipBriggsIsCaught(), scEasternAlhafraShipMayorArrives(), scEasternAlhafraWorkersSeeBlockGone(), scEasternAlhafraWorkersTellMayor(), scFieldActorSetAnimationAndWait(), scGabombaStatueChamberAkafubuOffersToHelp(), scGabombaStatueChamberAkafubuReachesChamber(), scGabombaStatueChamberGabombaNamesWitchDoctor(), scGabombaStatueChamberWhereIsTheOrb(), scGabombaStatueSawEnergyFlow(), scGabombaStatueSeeHowItWorks(), scGaiaRockInsideMeetSusa(), scGaiaRockInsideReadSandTablet(), scGaiaRockInsideTalkToSusa(), scGarohRoomsWakeAtInn(), scGondowanCliffsHideoutWarriorsAreFound(), scGondowanCliffsTurnBackToHelpPiers(), scIdejimaBreakAwayFromGondowan() and 103 more.

Definition at line 434 of file field_engine_actor_commands.c.

fdActorJump

void fdActorJump(Sint32 actorId, Sint32 speed, Sint32 ticks)

The script command "actor jump": throws the actor upward at speed pixels per tick with a jump sound (a higher one above 5), then waits ticks ticks.

References fdActorLookup(), fdScriptWait(), Sint32 and sySoundPlayStub().

Referenced by fdDjinnRunBattleStartHop(), fdDjinnRunJupiterJoinEffect(), fdDjinnRunMercuryJoinEffect(), fdDjinnRunVenusJoinEffect(), Hop(), scAlhafraGiveBreadToHungryBoy(), scAlhafraManorBriggsEscapes(), scAncientLemuriaCycloneRevealsRime(), scAncientLemuriaMeetTheLemurians(), scAncientLemuriaTremorShakesOutRime(), scAttekaInletCycloneUncoversGeode(), scAttekaInletShipwrightsStopTheParty(), scChampaCliffCavesFightAvimander(), scChampaCliffCavesObabaForgesTrident(), scChampaCliffCavesObabaMournsSalamander(), scContigoForceFreesDjinni(), scContigoReturnToNewHome(), scContigoTheReunion(), scDailaMeetAlex(), scDailaRoomsPracticeShout(), scDailaRoomsStartleAtTheLeader(), scDehkanPlateauCannonCracksPillars(), scDehkanPlateauCannonFleesOverCracks(), scEasternAlhafraShipBriggsIsCaught(), scEasternAlhafraShipMayorArrives(), scFieldActorJump(), scGabombaStatueChamberGabombaNamesWitchDoctor(), scGabombaStatueChamberWhereIsTheOrb(), scGondowanCliffsHideoutWarriorsAreFound(), scIdejimaCatchUpWithFelix(), scIdejimaWakeSheba(), scInit(), scIsletsTradeWithCow(), scIzumoRoomsGiveUzumeTheDoll(), scKandoreanTempleMeetPoi(), scKandoreanTempleReceiveLash(), scKandoreanTempleTestTheStudents(), scKibomboCeremonyEnds(), scKibomboCeremonyStarts(), scKibomboPiersHasForgottenParty(), scKibomboPiersTakesPartyForEnemies(), scKibomboWarriorsPanic(), scLemuriaDockAskSettingOff(), scLemurianShipJellyFlees(), scLemurianShipStepOnLift(), scLemurianShipStepOnLiftWestSide(), scLemuriaPalaceMeetKingHydros(), scLemuriaRoomsMeetLunpa(), scLemuriaRoomsPiersVisitsUncle(), scMadraStopPartyAfterRaid() and 14 more.

Definition at line 442 of file field_engine_actor_commands.c.

fdActorStartRepeatedMotion

void fdActorStartRepeatedMotion(Uint32 actorId, Sint32 count)

The script command "start repeated motion": the actor squashes and springs back count times (1 to REPEATED_MOTION_MAX), through RepeatedSquashScript.

References fdActorLookup(), fdActorStartScriptStub(), RepeatedSquashScript and Sint32.

Referenced by fdActorRunRepeatedMotion(), fdMadPlantLeapAtLeader(), scAlhafraManorBriggsEscapes(), scAlhafraPirateSeesMadrasMayor(), scAncientLemuriaMeetTheLemurians(), scAnemosInnerSanctumDullahanShadowChallenges(), scChampaCliffCavesObabaForgesTrident(), scChampaCliffCavesObabaMournsSalamander(), scDailaMeetAlex(), scEasternAlhafraShipBriggsIsCaught(), scEasternAlhafraShipMayorArrives(), scFieldActorStartRepeatedMotion(), scInit(), scIsletCaveSentinelAwaits(), scIzumoRoomsAskAfterSusa(), scIzumoRoomsGiveUzumeTheDoll(), scIzumoRoomsKushinadaAsksSusaNotToCome(), scIzumoRoomsRecognizeTheHeroes(), scIzumoTellTheCloudBrandLegend(), scLemurianShipFightAquaHydra(), scLemuriaPalaceMeetKingHydros(), scLemuriaRoomsMeetLunpa(), scLemuriaRoomsPiersVisitsUncle(), scLinkLobbyTalkToVisitor(), scShamanVillageMeetMoapa(), scShamanVillageShebaClearsSand(), scTrialRoadBeatMoapa(), scTrialRoadLoseToMoapa(), scYallamRoomsOfferToForge() and scYampiDesertCaveMeetGuardianOfFire().

Definition at line 470 of file field_engine_actor_commands.c.

fdActorRunRepeatedMotion

void fdActorRunRepeatedMotion(Uint32 actorId, Sint32 count)

The script command "run repeated motion": as fdActorStartRepeatedMotion, then waits for it to end.

References fdActorStartRepeatedMotion(), fdActorWaitForScriptEndById() and Sint32.

Referenced by fdDjinnRunBattleStartHop(), fdDjinnRunJupiterJoinEffect(), fdDjinnRunMarsJoinEffect(), fdDjinnRunMercuryJoinEffect(), scAlhafraFindGoldCoins(), scAlhafraMadransArrive(), scAlhafraManorBriggsEscapes(), scAlhafraManorComplainAboutTheMayor(), scAlhafraManorDefendTheMayor(), scAlhafraManorTellOfTheEasternSea(), scAlhafranCaveChauchaAndEoleoVisit(), scAlhafraPirateSeesMadrasMayor(), scAlhafraRoomsGuestsAskForTea(), scAlhafraRoomsMeetAlex(), scAlhafraRoomsOverhearCrossboneIsleTale(), scAlhafraTalkToHungryBoy(), scAncientLemuriaMeetTheLemurians(), scApojiiIslandsFatherSeesTheStone(), scAttekaInletHammetsMessengerArrives(), scChampaCliffCavesFightAvimander(), scChampaCliffCavesObabaForgesTrident(), scChampaCliffCavesObabaMournsSalamander(), scChampaCliffCavesObabaSeesAWeapon(), scChampaFeizhiArrives(), scChampaMeetAlex(), scContigoBabyThinks(), scContigoReturnToNewHome(), scDailaMeetAlex(), scDehkanPlateauCannonCornered(), scEasternAlhafraAskIfFinished(), scEasternAlhafraBriggsStealsShip(), scEasternAlhafraMayorFindsShipGone(), scEasternAlhafraOverhearWorkers(), scEasternAlhafraShipBriggsIsCaught(), scEasternAlhafraShipEoleoLifts(), scEasternAlhafraShipMayorArrives(), scEasternAlhafraTalkToSailor(), scEasternAlhafraWorkersTellMayor(), scGarohFollowWerewolfIntoCave(), scGarohMahaTellsTheLegend(), scGarohRoomsWakeAtInn(), scGarohWerewolfPeersFromCave(), scGarohWerewolfRunsPast(), scGarohWerewolvesRevealThemselves(), scIdejimaFelixWakes(), scIdejimaRideTheTidalWave(), scIdejimaWakeJenna(), scIdejimaWakeKraden(), scIdejimaWakeSheba(), scInit() and 59 more.

Definition at line 492 of file field_engine_actor_commands.c.

fdEffectUpdateDustPuff

void fdEffectUpdateDustPuff(ACTOR *particle)

Moves a dust puff of fdEffectSpawnDustPuff: it drifts with its x and z velocity (kept in speed and acceleration), which drag slows each tick, and rises 1/64 pixel a tick.

Referenced by fdEffectSpawnDustPuff().

Definition at line 501 of file field_engine_actor_commands.c.

fdEffectSpawnDustPuff

void fdEffectSpawnDustPuff(ACTOR *src, Sint32 colorMode)

Kicks up a dust puff (SPRITE_DUST_CLOUD) where source stands: it flies off toward the back at 0.5 to 1.4 pixels a tick and sideways at up to 1.4, with one of two animations, drawn at source's priority, in colorMode unless 0.

References DustPuffLongScript, DustPuffShortScript, fdActorCreateStub(), fdActorSelectAnimationStub(), fdActorSetSpriteColor(), fdActorStartScriptStub(), fdEffectUpdateDustPuff(), Sint32 and syRandom().

Referenced by fdActorJumpDownLedge().

Definition at line 516 of file field_engine_actor_commands.c.

fdActorJumpDownLedge

void fdActorJumpDownLedge(Sint32 actorId, Sint32 pose, Sint32 dust)

Makes an actor jump down off a ledge in front of it: it shows pose for 10 ticks, hops 12 pixels south from the middle of its 16-pixel column, turns toward FACING_SOUTH_SOUTHWEST while sinking 28 pixels with a dust puff every other tick in the colour mode dust (none when dust is -1), then jumps on to 16 pixels south of where it started and lands, waiting at most 180 ticks for it unless dust has LEDGE_JUMP_NO_LANDING_WAIT.

References fdActorFaceDirectionById(), fdActorGetById(), fdActorSelectAnimationStub(), fdActorSetSpriteFlagsStub(), fdActorWaitForMoveStub(), fdEffectSpawnDustPuff(), fdScriptNoOperation(), Sint32, sySoundPlayStub() and sySynch().

Referenced by fdRunPushMetatile(), KNOCK_BACK(), scAirsRockInsideJumpDownLedge(), scAnkohlRuinsJumpActorDownLedge(), scApojiiIslandsJumpDownLedge(), scAquaRockInsideJumpDownLedge(), scGaiaRockInsideJumpDownLedge(), scIsletsJumpDownLedge(), scTaopoSwampJumpDownLedge() and scTrialRoadJumpAcrossGap().

Definition at line 567 of file field_engine_actor_commands.c.

fdActorFaceActorById

void fdActorFaceActorById(Sint32 firstId, Sint32 secondId, Sint32 ticks)

The script command "actor face actor": turns the first actor at once to face the second, then waits the given number of ticks.

References fdActorLookup(), fdScriptWait(), Sint32 and syAtan().

Referenced by fdActorFaceActor(), fdScriptPickUpItem(), scAlhafraGiveBreadToHungryBoy(), scAlhafraManorComplainAboutTheMayor(), scAlhafraManorTellOfTheEasternSea(), scChampaCliffCavesObabaOffersHelp(), scContigoScoopForSalt(), scContigoTalkAboutTheShip(), scContigoTalkToDoubtingBoy(), scDailaMeetAlex(), scDailaRoomsStartleAtTheLeader(), scDehkanPlateauCannonCornered(), scDehkanPlateauCannonCracksLastPillar(), scDehkanPlateauCannonCracksPillars(), scDehkanPlateauCannonFleesEast(), scDehkanPlateauCannonFleesOverCracks(), scDehkanPlateauCannonLeapsAway(), scDehkanPlateauCannonPoundsLeaderThrough(), scDehkanPlateauCannonPoundsStake(), scGaiaRockInsidePlaceDollOnCobwebAltar(), scGaiaRockInsidePlaceDollOnEastAltar(), scGaiaRockInsidePlaceDollOnWestAltar(), scGaiaRockInsideTurnFaceToAltar(), scGarohRoomsTalkToPriest(), scGondowanCliffsHideoutWarriorsAreFound(), scIdejimaWakeSheba(), scInit(), scIsletsTradeWithCow(), scIzumoRoomsGiveUzumeTheDoll(), scIzumoRoomsReadUzumesMind(), scIzumoRoomsRecognizeTheHeroes(), scIzumoRoomsTalkToUzume(), scIzumoStopThePartyToThankThem(), scIzumoTellTheCloudBrandLegend(), scKandoreanTempleAskAboutPoi(), scKandoreanTempleTellOfTheMeditation(), scKibomboTalkForeignCeremony(), scKibomboTalkPathToPeace(), scMadraGrantPassageToOsenia(), scMadraMeetKarst(), scShrineOfTheSeaGodDjinniFleesEast(), scShrineOfTheSeaGodDjinniFleesSouth(), scShrineOfTheSeaGodStartleRiki(), scWorldMapMeetEcho(), scYampiDesertTalkToElder() and scYampiDesertTalkToElderAboutWay().

Definition at line 630 of file field_engine_actor_commands.c.

fdActorTurnToFaceEachOther

void fdActorTurnToFaceEachOther(Sint32 firstId, Sint32 secondId, Sint32 ticks)

The script command "actors face each other": turns two actors toward each other, then waits the given number of ticks.

References fdActorLookup(), fdActorTurnPairToFaceEachOther(), fdScriptWait() and Sint32.

Referenced by fdActorFaceEachOther(), fdTalkToActor(), scAirsRockInsideReadRevealTablet(), scContigoForceFreesDjinni(), scDailaMeetAlex(), scIdejimaWakeSheba(), scIsletCaveTremorRevealsSerac(), scIzumoRoomsGiveUzumeTheDoll(), scIzumoRoomsRecognizeTheHeroes(), scMadraMeetKarst() and scWorldMapFightBanditAndThieves().

Definition at line 647 of file field_engine_actor_commands.c.

fdActorTurnPairToFaceEachOther

void fdActorTurnPairToFaceEachOther(ACTOR *first, ACTOR *second)

Turns two actors to face each other, at most 1/16 turn a tick each, until both do (at most 60 ticks).

References Sint32, syAtan() and sySynch().

Referenced by fdActorTurnToFaceEachOther() and fdMadPlantLeapAtLeader().

Definition at line 661 of file field_engine_actor_commands.c.

fdActorReleaseById

void fdActorReleaseById(Sint32 actorId)

The script command "release actor": releases the actor and empties its slot in the field state's actor table.

References fdActorLookup(), fdActorReleaseStub() and Sint32.

Referenced by scMarsLighthouseAerieFaceDoomDragon().

Definition at line 714 of file field_engine_actor_commands.c.

fdActorConfigureSpriteColor

void fdActorConfigureSpriteColor(Sint32 actorId, Sint32 colorMode)

The script command "set actor sprite colour": gives every sprite animation of the actor the colour mode (fdActorSetSpriteColor); with SPRITE_COLOR_BLINK the actor blinks instead (fdActorUpdateBlink).

References fdActorLookup(), fdActorSetSpriteColor(), fdActorUpdateBlink() and Sint32.

Referenced by fdActorSetSpriteColorById(), scAirsRockInsideShebaLearnsReveal(), scAirsRockInsideWakeEntranceStatue(), scAirsRockInsideWakeHallStatue(), scAquaRockInsidePiersLearnsParch(), scGaiaRockInsideFelixLearnsSand(), scIsletCaveFinishTeleport() and scKandoreanTempleTestTheStudents().

Definition at line 729 of file field_engine_actor_commands.c.

void fdActorUpdateBlink(ACTOR *actor)

Per-tick update function of a blinking actor: sets its sprite animations' colour mode from ActorBlinkSpriteColors, each entry lasting two ticks.

References ActorBlinkSpriteColors, Sint32 and TickCount.

Referenced by fdActorConfigureSpriteColor().

Definition at line 748 of file field_engine_actor_commands.c.

fdActorSetSpriteColor

void fdActorSetSpriteColor(ACTOR *actor, Sint32 colorMode)

Sets the colour mode (SPR_COL_MODE) of every running sprite animation of an actor's sprite. Scripts set SPRITE_COLOR_NORMAL or SPRITE_COLOR_HIDDEN, and alternate the two to make an actor flash.

References Sint32.

Referenced by EFFECT_SPAWN, fdActorConfigureSpriteColor(), fdEffectSpawnDustPuff(), fdEffectSpawnResident(), scActorHide(), scAirsRockBlowGust(), scAirsRockInsideBlowGust(), scAirsRockInsideFlickerTarget(), scAirsRockInsidePuffVent(), scAirsRockInsideShebaLearnsReveal(), scAirsRockInsideSpawnMotes(), scAirsRockInsideSpiralSpark(), scAirsRockInsideWakeEntranceStatue(), scAirsRockInsideWakeHallStatue(), scAnemosInnerSanctumDullahanLightRises(), scAquaRockArriveFromPassage(), scAquaRockCreateActor(), scAquaRockDouseDryMoai(), scAquaRockEnterSparklingPassage(), scAquaRockInsidePiersLearnsParch(), scContigoForceFreesDjinni(), scContigoInitLuckyDice(), scContigoInitVillage(), scContigoTheReunion(), scCreateImportedActor(), scCrumblingPillarStep(), scCrumblingPillarStepWithStandIn(), scDehkanPlateauCrackPillar(), scFieldActorSetSpriteColor(), scGabombaStatueChamberGabombaNamesWitchDoctor(), scGaiaRockInsideFelixLearnsSand(), scInit(), scJupiterLighthouseBringInBeam(), scKandoreanTempleInitSteam(), scKandoreanTempleTestTheStudents(), scKandoreanTempleTouchTheHotFloor(), scKibomboAkafubuChants(), scKibomboFlashSprite(), scKibomboGabombaNotPleased(), scKibomboGabombaResponds(), scKibomboGabombaRespondsToGift(), scKibomboGabombaSeesJewel(), scKibomboInitStatueFace(), scKibomboOpenCeremonyScene(), scKibomboPresentJewelToGabomba(), scKibomboWitchDoctorFeelsPower(), scLeaderCheckCrumblingStep(), scMadraMeetKarst(), scPlaceTranslucentBlackActorFX(), scPrepareMap() and 8 more.

Definition at line 774 of file field_engine_actor_commands.c.

fdActorWatchAndStartScript

void fdActorWatchAndStartScript(Uint32 actorId, Sint32 targetId, const void *script)

Makes an actor follow the actor in targetId's ACTOR_WATCH_ACTOR_MASK bits and starts script on it. Unless targetId has ACTOR_WATCH_KEEP_MOTION it keeps FOLLOW_DISTANCE, takes the target's top speed with twice its acceleration, to keep up with it, and no collision flags, so it cannot block the target.

References fdActorLookup(), fdActorStartScriptStub() and Sint32.

Definition at line 811 of file field_engine_actor_commands.c.