Skip to Content
The Alchemy Project

src/field/field_engine_script.c

Script commands: waits, received items, questions and destinations. More…

Included by field_engine.c.

Macros

NameDescription
#defineGIFT_RECEIVED_MESSAGE_MODE FIELD_MESSAGE_ZOOM
#defineYES_NO_BELOW_LAST_ROW 15The last tile row the message windows may reach with a yes-or-no question still asked below them.

Enumerations

NameDescription
enumSHORTCUT_PROBLEM { SHORTCUT_USABLE, SHORTCUT_NO_SUCH_MEMBER, SHORTCUT_MEMBER_AW … }What fdPartyCheckShortcut finds wrong with a shortcut.

Functions

NameDescription
voidfdScriptUpdateDebugSkip (void)Debug only: while debug mode is on, R makes every script wait (fdScriptWait) end at once and L restores normal waits.
voidfdScriptWait (Sint32 ticks)Waits the requested ticks through sySynch(), unless debug fast-forward (fdScriptUpdateDebugSkip) is on: the wait scripts use.
voidfdLeaderStopMoving (void)Stops the leader where it stands: no horizontal velocity, the normal walking speed (1.0) and acceleration (0.5), no destination, and the standing pose, or ANIM_LEADER_CLING while the leader is on a climbable wall.
voidfdScriptStart (void)Begins a script: closes any area name window, stops the leader, ends the lasting Psynergy if a cue is running, resets the message and timing state, and starts the debug fast-forward event with the leader as the message speaker.
voidfdScriptEnd (void)Ends a script: stops the debug fast-forward event, gives the camera back to the leader (or to the first placed actor, the ship, while MainRoutineStateWork.ownerOverride is set) and refreshes the Lure Cap's flag (gmFlagRefreshLureCap).
voidfdScriptNoOperationCallback (void)An empty function nothing calls.
voidfdScriptNoOperationHook (void)An empty hook; it does nothing in the released game.
ACTOR *fdScriptResetLeaderAndWait (Sint32 table)Rebuilds the leader's actor from its placement row (fdActorResetForLeader), waits a tick and returns the leader's actor.
voidfdScriptSpawnActorsAfterLast (Sint32 table)Spawns the actors of an actor placement table after the last actor in use.
voidfdScriptSetSceneCues (Sint32 events)Replaces the scene's cue table with scripts.
voidfdScriptAddPartyMember (Sint32 unit, Sint32 announce)Adds unit to the party.
voidfdScriptAddTwoPartyMembers (Sint32 first, Sint32 second)Adds two units to the party and announces them together ("<a> and <b> joined your party.", mnPartyShowPairJoinedMessage).
Sint32fdPartyCheckShortcut (Uint32 shortcut)Checks an L or R button shortcut, packed as the party member in bits 10 to 13 and the Psynergy in bits 0 to 9.
voidfdPartyClearUnusableShortcuts (void)Clears each button shortcut whose Psynergy can no longer be cast: zeroes MainRoutineStateWork.firstShortcut or secondShortcut.
voidfdPartyRemoveMemberRestored (Sint32 unit)Takes unit out of the party, fully restoring its HP and PP and curing its poison.
Sint32fdPartyCheckItemLimit (Sint32 item)Checks whether the party can carry one more of item; when it cannot, says so and returns -1, else 0.
Sint32fdPartyInventoryGiveItem (Sint32 item, Sint32 unused)The script command "give item": gives item to the first party member with room for it and says so; with no room, the player chooses what to drop.
Sint32fdInventoryTryAddAndReturnMember (Sint32 item, Sint32 unused, Sint32 unit)Gives item to one party member.
voidfdInventoryNoOperationCallback (void)An empty function nothing calls.
voidfdInventoryReservedNoOperation (void)An empty function nothing calls.
voidfdActorWaitForAnimationEnd (Sint32 actorId, Sint32 animation)Waits, at most 90 ticks, for an actor's animation to stop being animation: the actor has finished a one-off animation such as a nod.
Sint32fdScriptAskYesNoWithActorAnimation (Sint32 actor, Sint32 forceBottom)The script command "choose yes or no": once the message on screen has been read, asks yes or no below it, or above it when the message windows reach past YES_NO_BELOW_LAST_ROW (unless forceBottom is set).
Sint32fdYesNoAsk (Sint32 atBottom)Asks yes or no at the top of the screen, or at the bottom with atBottom set.
Sint32fdScriptPickUpItem (Sint32 actor, Sint32 item, Sint32 flag)Gives the party item from actor: with no room it shows the item, says it was found and left behind and returns -1; otherwise it adds the item, sets flag (unless -1) and returns 0.
voidfdPartyLearnAbility (Sint32 unit, Sint32 ability)Teaches unit the Psynergy ability and says so with its jingle, waiting for the player to read it.
voidfdScriptStartScreenTransition (void)The script command "open screen": starts the script's screen transition and sets transitionActive.
voidfdScriptFinishScreenTransition (void)The script command "close screen": finishes the script's screen transition and clears transitionActive.
voidfdScriptWaitTransitionTicks (void)The script command "wait for screen": waits as long as the transition runs (transitionFrame).
voidfdScriptSetDestination (Sint32 sceneId, Sint32 entrance)Makes the script leave for the given entrance of the given scene: raises the exit request EXIT_KEEP_DESTINATION and writes MainRoutineStateWork.next and entrance.
voidfdScriptSetRestartPoint (Sint32 sceneId, Sint32 entrance)Makes the script leave and records sceneId and entrance as the restart point.
voidfdScriptSetExitRequest (Uint16 exit)The script command "request exit": sets the field's exit request (EXIT_KEEP_DESTINATION leaves for MainRoutineStateWork's next and entrance).

Description

Script commands: waits, received items, questions and destinations. Part of field_engine.c.

Macros in detail

GIFT_RECEIVED_MESSAGE_MODE

#define GIFT_RECEIVED_MESSAGE_MODE FIELD_MESSAGE_ZOOM

#define GIFT_RECEIVED_MESSAGE_MODE

Referenced by fdPartyInventoryGiveItem().

Definition at lines 8 and 10 of file field_engine_script.c.

YES_NO_BELOW_LAST_ROW

#define YES_NO_BELOW_LAST_ROW 15

The last tile row the message windows may reach with a yes-or-no question still asked below them.

Referenced by fdScriptAskYesNoWithActorAnimation().

Definition at line 409 of file field_engine_script.c.

Enumerations in detail

SHORTCUT_PROBLEM

enum SHORTCUT_PROBLEM

What fdPartyCheckShortcut finds wrong with a shortcut.

EnumeratorValueDescription
SHORTCUT_USABLE0
SHORTCUT_NO_SUCH_MEMBER-1
SHORTCUT_MEMBER_AWAY-2not in the party
SHORTCUT_NOT_LEARNED-3the member does not know the Psynergy

Definition at line 165 of file field_engine_script.c.

Functions in detail

fdScriptUpdateDebugSkip

void fdScriptUpdateDebugSkip(void)

Debug only: while debug mode is on, R makes every script wait (fdScriptWait) end at once and L restores normal waits.

References DebugMode and PerWork.

Referenced by fdScriptEnd() and fdScriptStart().

Definition at line 16 of file field_engine_script.c.

fdScriptWait

void fdScriptWait(Sint32 ticks)

Waits the requested ticks through sySynch(), unless debug fast-forward (fdScriptUpdateDebugSkip) is on: the wait scripts use.

References Sint32 and sySynch().

Referenced by dbShopTestTalkToSunshine(), fdActorAppearInWhirlwind(), fdActorDescendInWhirlwind(), fdActorFaceActorById(), fdActorFaceDirectionById(), fdActorJump(), fdActorShowEmoteById(), fdActorTurnToFaceEachOther(), fdCameraWaitForArrival(), fdClimbDown(), fdClimbUp(), fdEntrancePlayArrival(), fdMadPlantLeapAtLeader(), fdScriptPickUpItem(), fdScriptShowMessageThenWait(), fdSummonTabletPlayRunes(), fdTalkToActor(), Hop(), scAirsRockBlowGust(), scAlhafraBackloggedWithCanoes(), scAlhafraFatherLetsPartyToCave(), scAlhafraFindGoldCoins(), scAlhafraGiveBreadToHungryBoy(), scAlhafraMadransArrive(), scAlhafraManorAskAboutAlhafra(), scAlhafraManorAskIfTheHeroes(), scAlhafraManorBriggsEscapes(), scAlhafraManorComplainAboutTheMayor(), scAlhafraManorDefendTheMayor(), scAlhafraManorPointOutAirsRock(), scAlhafraManorTellOfTheEasternSea(), scAlhafraMayorInAMeeting(), scAlhafraOpenDoorAndEnter(), scAlhafraPirateSeesMadrasMayor(), scAlhafraSailorToldToWork(), scAlhafraTalkToHungryBoy(), scAncientLemuriaCycloneRevealsRime(), scAncientLemuriaHeadForTheDock(), scAncientLemuriaMeetTheLemurians(), scAnemosInnerSanctumDullahanLightRises(), scAnemosInnerSanctumDullahanShadowChallenges(), scAquaRockDouseSummitWaterStone(), scAquaRockDouseWaterStone(), scAquaRockInsidePiersLearnsParch(), scAquaRockMoaiStepAside(), scAquaRockRideStreamUp(), scAttekaInletHammaShowsTheWings(), scAttekaInletHammetsMessengerArrives(), scAttekaInletOpenDoorAndEnter(), scAttekaInletShipwrightsStopTheParty() and 210 more.

Definition at line 35 of file field_engine_script.c.

fdLeaderStopMoving

void fdLeaderStopMoving(void)

Stops the leader where it stands: no horizontal velocity, the normal walking speed (1.0) and acceleration (0.5), no destination, and the standing pose, or ANIM_LEADER_CLING while the leader is on a climbable wall.

References fdActorLookup(), fdActorSelectAnimationStub(), fdPartyGetLeaderActor() and MainRoutineStateWork.

Referenced by fdCheckExitRegions(), fdEngineRun(), fdExamineMetatile(), fdLeaderStopIfPending(), fdScriptStart(), fdTalkToActor(), fdUsePsynergy(), fdWorldMapZoomOutWhileLHeld() and scMarsLighthouseTowersFallIntoHole().

Definition at line 46 of file field_engine_script.c.

fdScriptStart

void fdScriptStart(void)

Begins a script: closes any area name window, stops the leader, ends the lasting Psynergy if a cue is running, resets the message and timing state, and starts the debug fast-forward event with the leader as the message speaker.

References fdLeaderStopMoving(), fdScriptEndAllLastingPsynergy(), fdScriptUpdateDebugSkip(), MainRoutineStateWork, mnAreaNameWindowHideStub(), Sint32, syGameFlagClear() and sySetEvent().

Referenced by dbIncreaseItemAndLevelRunMotionTest(), dbIncreaseItemAndLevelShowCharacterName(), dbIncreaseItemAndLevelShowName(), fdActorAppearInWhirlwind(), fdActorDescendInWhirlwind(), fdClimbDown(), fdClimbUp(), fdDjinnJoinParty(), fdDjinnRunBattleStartHop(), fdPsynergyRetreat(), fdRunPsynergyScript(), fdScriptRunMessage(), fdScriptShowMessageAndOfferScoop(), fdTalkToActor(), fdTryJumpForward(), fdUseItem(), fdWhirlwindCarryLeader(), KNOCK_BACK(), RumbleBeforePillarSinks(), scAirsRockBlowGust(), scAirsRockEnterTheRock(), scAirsRockExamineWindStone(), scAirsRockFreezePuddle(), scAirsRockInsideBlowGust(), scAirsRockInsideCheckPsynergyStone(), scAirsRockInsideFinishPushingPillar(), scAirsRockInsideJumpDownLedge(), scAirsRockInsideLandInHall(), scAirsRockInsideMoveTurningBridgePillar(), scAirsRockInsideOpenTabletRoomDoor(), scAirsRockInsideReadRevealTablet(), scAirsRockInsideRideFaceVent(), scAirsRockInsideRideStatuesVent(), scAirsRockInsideRideWhirlwind(), scAirsRockInsideRiseOnLift(), scAirsRockInsideStepOntoStake(), scAirsRockInsideVanishStone(), scAirsRockInsideWakeEntranceStatue(), scAirsRockInsideWakeHallStatue(), scAirsRockInsideWalkToRevealTablet(), scAirsRockMoveFirstPillar(), scAirsRockMoveSecondPillar(), scAirsRockMoveThirdPillar(), scAirsRockPlacePillar(), scAirsRockRideWhirlwind(), scAirsRockWhirlwindClearsFog(), scAirsRockWhirlwindClearsWall(), scAirsRockWhirlwindOpensTheTop(), scAlhafraFindGoldCoins(), scAlhafraGiveBreadToHungryBoy() and 756 more.

Definition at line 65 of file field_engine_script.c.

fdScriptEnd

void fdScriptEnd(void)

Ends a script: stops the debug fast-forward event, gives the camera back to the leader (or to the first placed actor, the ship, while MainRoutineStateWork.ownerOverride is set) and refreshes the Lure Cap's flag (gmFlagRefreshLureCap).

References fdCameraFollowActor(), fdScriptUpdateDebugSkip(), gmFlagRefreshLureCapStub(), MainRoutineStateWork and syCloseEvent().

Referenced by dbIncreaseItemAndLevelRunMotionTest(), dbIncreaseItemAndLevelShowCharacterName(), dbIncreaseItemAndLevelShowName(), fdClimbDown(), fdClimbUp(), fdDjinnJoinParty(), fdDjinnRunBattleStartHop(), fdRunPsynergyScript(), fdScriptRunMessage(), fdScriptShowMessageAndOfferScoop(), fdTalkToActor(), fdTryJumpForward(), fdUseItem(), fdWhirlwindCarryLeader(), scAirsRockBlowGust(), scAirsRockEnterTheRock(), scAirsRockExamineWindStone(), scAirsRockFreezePuddle(), scAirsRockInsideBlowGust(), scAirsRockInsideCheckPsynergyStone(), scAirsRockInsideFinishPushingPillar(), scAirsRockInsideJumpDownLedge(), scAirsRockInsideLandInHall(), scAirsRockInsideMoveTurningBridgePillar(), scAirsRockInsideOpenTabletRoomDoor(), scAirsRockInsideReadRevealTablet(), scAirsRockInsideRideFaceVent(), scAirsRockInsideRideStatuesVent(), scAirsRockInsideRideWhirlwind(), scAirsRockInsideRiseOnLift(), scAirsRockInsideStepOntoStake(), scAirsRockInsideVanishStone(), scAirsRockInsideWakeEntranceStatue(), scAirsRockInsideWakeHallStatue(), scAirsRockInsideWalkToRevealTablet(), scAirsRockMoveFirstPillar(), scAirsRockMoveSecondPillar(), scAirsRockMoveThirdPillar(), scAirsRockPlacePillar(), scAirsRockRideWhirlwind(), scAirsRockWhirlwindClearsFog(), scAirsRockWhirlwindClearsWall(), scAirsRockWhirlwindOpensTheTop(), scAlhafraFindGoldCoins(), scAlhafraGiveBreadToHungryBoy(), scAlhafraMadransArrive(), scAlhafraManorBriggsEscapes(), scAlhafraManorComplainAboutTheMayor(), scAlhafraManorDefendTheMayor(), scAlhafraManorPointOutAirsRock() and 624 more.

Definition at line 96 of file field_engine_script.c.

fdScriptNoOperationCallback

void fdScriptNoOperationCallback(void)

An empty function nothing calls.

Definition at line 110 of file field_engine_script.c.

fdScriptNoOperationHook

void fdScriptNoOperationHook(void)

An empty hook; it does nothing in the released game. Only fdScriptResetLeaderAndWait calls it.

Referenced by fdScriptResetLeaderAndWait().

Definition at line 116 of file field_engine_script.c.

fdScriptResetLeaderAndWait

ACTOR *fdScriptResetLeaderAndWait(Sint32 table)

Rebuilds the leader's actor from its placement row (fdActorResetForLeader), waits a tick and returns the leader's actor.

References fdActorLookup(), fdActorResetForLeader(), fdPartyGetLeaderActor(), fdScriptNoOperationHook(), Sint32 and sySynch().

Definition at line 122 of file field_engine_script.c.

fdScriptSpawnActorsAfterLast

void fdScriptSpawnActorsAfterLast(Sint32 table)

Spawns the actors of an actor placement table after the last actor in use.

References fdActorFindLastActiveId(), fdScriptSpawnActorTable() and Sint32.

Definition at line 131 of file field_engine_script.c.

fdScriptSetSceneCues

void fdScriptSetSceneCues(Sint32 events)

Replaces the scene's cue table with scripts.

References Sint32.

Definition at line 137 of file field_engine_script.c.

fdScriptAddPartyMember

void fdScriptAddPartyMember(Sint32 unit, Sint32 announce)

Adds unit to the party. With announce nonzero it also shows <name> joined your party. (mnPartyShowJoinedMessage, which receives announce too).

References gmPartyAddMemberStub(), gmUnitGet(), mnPartyShowJoinedMessageStub() and Sint32.

Referenced by scFieldScriptAddPartyMember(), scIdejimaCatchUpWithFelix(), scIdejimaWakeSheba(), scKibomboPiersJoinsParty() and scKibomboPiersThanksParty().

Definition at line 144 of file field_engine_script.c.

fdScriptAddTwoPartyMembers

void fdScriptAddTwoPartyMembers(Sint32 first, Sint32 second)

Adds two units to the party and announces them together ("<a> and <b> joined your party.", mnPartyShowPairJoinedMessage).

References gmPartyAddMemberStub(), mnPartyShowPairJoinedMessageStub() and Sint32.

Definition at line 157 of file field_engine_script.c.

fdPartyCheckShortcut

Sint32 fdPartyCheckShortcut(Uint32 shortcut)

Checks an L or R button shortcut, packed as the party member in bits 10 to 13 and the Psynergy in bits 0 to 9.

References gmUnitKnowsPsynergyStub(), Sint32 and syGameFlagGet().

Referenced by fdPartyClearUnusableShortcuts().

Definition at line 175 of file field_engine_script.c.

fdPartyClearUnusableShortcuts

void fdPartyClearUnusableShortcuts(void)

Clears each button shortcut whose Psynergy can no longer be cast: zeroes MainRoutineStateWork.firstShortcut or secondShortcut.

References fdPartyCheckShortcut() and MainRoutineStateWork.

Referenced by fdPartyRemoveMemberRestored(), fdUpdateWalking() and scJupiterLighthouseIsaacAndIvanFall().

Definition at line 191 of file field_engine_script.c.

fdPartyRemoveMemberRestored

void fdPartyRemoveMemberRestored(Sint32 unit)

Takes unit out of the party, fully restoring its HP and PP and curing its poison.

References fdPartyClearUnusableShortcuts(), gmPartyCountMembersStub(), gmPartyRemoveMemberStub(), gmUnitGet(), MainRoutineStateWork and Sint32.

Referenced by scKibomboInitCeremony(), scKibomboPiersRefusesToLeave() and scMarsLighthouseAerieUrgeOnToBeacon().

Definition at line 203 of file field_engine_script.c.

fdPartyCheckItemLimit

Sint32 fdPartyCheckItemLimit(Sint32 item)

Checks whether the party can carry one more of item; when it cannot, says so and returns -1, else 0.

References gmPartyCountMembersStub(), gmPartyInventoryFindRoomStub(), mnFieldMessageShowStub(), mnMessageArgumentPushStub() and Sint32.

Referenced by fdEngineRun().

Definition at line 236 of file field_engine_script.c.

fdPartyInventoryGiveItem

Sint32 fdPartyInventoryGiveItem(Sint32 item, Sint32 unused)

The script command "give item": gives item to the first party member with room for it and says so; with no room, the player chooses what to drop.

References fdYesNoAsk(), gmInventoryCountItemStub(), gmInventoryDiscardStub(), gmInventoryGetQuantityStub(), gmItemAdjustRareItemStockStub(), gmItemGetDefinitionStub(), gmPartyInventoryAddStub(), gmUnitCalculateStub(), gmUnitGet(), gmUnitRefreshPsynergyStub(), MainRoutineStateWork, mnFieldMessageShowStub(), mnItemPickerRunToDropStub(), mnMessageArgumentPushStub(), mnMessageCloseFinishedWindowsStub(), result, Sint32 and sySoundPlayStub().

Referenced by dbShopTestGiveMuramasaAndSummon(), dbShopTestTalkToSunshinesWife(), fdEngineRun(), fdScriptPickUpItem(), gmPartyGiveItem(), scContigoInitLuckyDice(), scDehkanPlateauTakePoundCube(), scGabombaStatueChamberGabombaNamesWitchDoctor(), scMadraMeetKarst() and scYampiDesertDropScoopGem().

Definition at line 256 of file field_engine_script.c.

fdInventoryTryAddAndReturnMember

Sint32 fdInventoryTryAddAndReturnMember(Sint32 item, Sint32 unused, Sint32 unit)

Gives item to one party member. Returns unit, or -1 if its bag is full.

References gmInventoryAddItemStub() and Sint32.

Definition at line 368 of file field_engine_script.c.

fdInventoryNoOperationCallback

void fdInventoryNoOperationCallback(void)

An empty function nothing calls.

Definition at line 376 of file field_engine_script.c.

fdInventoryReservedNoOperation

void fdInventoryReservedNoOperation(void)

An empty function nothing calls.

Definition at line 381 of file field_engine_script.c.

fdActorWaitForAnimationEnd

void fdActorWaitForAnimationEnd(Sint32 actorId, Sint32 animation)

Waits, at most 90 ticks, for an actor's animation to stop being animation: the actor has finished a one-off animation such as a nod.

References fdActorLookup(), Sint32 and sySynch().

Referenced by fdScriptAskYesNoWithActorAnimation().

Definition at line 387 of file field_engine_script.c.

fdScriptAskYesNoWithActorAnimation

Sint32 fdScriptAskYesNoWithActorAnimation(Sint32 actor, Sint32 forceBottom)

The script command "choose yes or no": once the message on screen has been read, asks yes or no below it, or above it when the message windows reach past YES_NO_BELOW_LAST_ROW (unless forceBottom is set). The speaker nods (ANIM_NOD) at yes and shakes its head (ANIM_SHAKE_HEAD) at no; at the fastest message speed neither is waited for.

References fdActorSetAnimationById(), fdActorWaitForAnimationEnd(), fdFindActorPlacement(), MainRoutineStateWork, mnMessageAllTypedStub(), mnMessageCloseFinishedWindowsStub(), mnPortraitCloseWindowStub(), mnYesNoMenuRunStub(), Sint32 and sySynch().

Referenced by dbShopTestTalkToSunshine(), dbShopTestTalkToSunshinesWife(), fdScriptAskYesNoAndShowResponse(), scAlhafraAskWhetherIndraMoved(), scAlhafraBackloggedWithCanoes(), scAlhafraFatherLetsPartyToCave(), scAlhafraManorAskAboutAlhafra(), scAlhafraManorAskIfTheHeroes(), scAlhafraManorBriggsEscapes(), scAlhafraManorPointOutAirsRock(), scAlhafraManorTellOfTheEasternSea(), scAlhafraMayorInAMeeting(), scAlhafraPirateSeesMadrasMayor(), scAlhafraTalkToHungryBoy(), scAttekaInletAskKradenToSetSail(), scAttekaInletKradenAsksToSetSail(), scChampaCliffCavesAskToComeIn(), scChampaCliffCavesFightAvimander(), scChampaCliffCavesObabaAsksForBriggs(), scChampaCliffCavesObabaForgesTrident(), scChampaCliffCavesObabaMournsSalamander(), scChampaCliffCavesObabaSeesAWeapon(), scContigoOfferLuckyDice(), scContigoOfferLuckyWheels(), scContigoOfferSuperLuckyDice(), scContigoReturnToNewHome(), scContigoTheReunion(), scDailaMeetAlex(), scDailaRoomsAskGoingToMadra(), scDailaRoomsAskLookingForBoat(), scDailaRoomsTalkToHealer(), scDailaTalkBeenBefore(), scDailaTalkBoat(), scDailaTalkHip(), scDailaTalkIndraMoved(), scFieldScriptAskYesNoWithActorAnimation(), scGabombaStatueChamberAkafubuOffersToHelp(), scGabombaStatueChamberGabombaNamesWitchDoctor(), scGabombaStatueChamberWhereIsTheOrb(), scGarohRoomsAskAboutReveal(), scGarohRoomsAskWhatTheWanderersSeek(), scGarohRoomsTalkToItemShopkeeper(), scInit(), scIsletsGiveTurtle(), scIsletsTradeWithCow(), scIzumoOfferATokenOfGratitude(), scIzumoRoomsAskAboutMtMikage(), scIzumoRoomsGiveUzumeTheDoll(), scIzumoRoomsRecognizeTheHeroes(), scIzumoStopThePartyToThankThem() and 48 more.

Definition at line 416 of file field_engine_script.c.

fdYesNoAsk

Sint32 fdYesNoAsk(Sint32 atBottom)

Asks yes or no at the top of the screen, or at the bottom with atBottom set. Returns 0 for yes, 1 for no.

References mnYesNoMenuRunStub() and Sint32.

Referenced by fdPartyInventoryGiveItem(), fdUseItem(), fdUsePsynergy(), scDailaRoomsGiveItem(), scInit() and scScriptYesNoAsk().

Definition at line 471 of file field_engine_script.c.

fdScriptPickUpItem

Sint32 fdScriptPickUpItem(Sint32 actor, Sint32 item, Sint32 flag)

Gives the party item from actor: with no room it shows the item, says it was found and left behind and returns -1; otherwise it adds the item, sets flag (unless -1) and returns 0.

References fdActorFaceActorById(), fdActorGetById(), fdActorSetHorizontalPosWithTerrain(), fdItemDisplayShowItem(), fdPartyInventoryGiveItem(), fdScriptWait(), gmPartyInventoryFindRoomStub(), MainRoutineStateWork, mnFieldMessageShowStub(), mnMessageArgumentPushStub(), Sint32 and syGameFlagSet().

Referenced by dbPsynergyTestPickUpItem(), scChampaCliffCavesPickUpTrident(), scChampaTakeFeizhisGift(), scEasternAlhafraShipTakeTheBread(), scShamanVillageCaveTakeGoldenShirt() and scWorldMapPickUpGoldenBoots().

Definition at line 479 of file field_engine_script.c.

fdPartyLearnAbility

void fdPartyLearnAbility(Sint32 unit, Sint32 ability)

Teaches unit the Psynergy ability and says so with its jingle, waiting for the player to read it.

References gmUnitLearnPsynergyStub(), mnFieldMessageShowStub(), mnMessageArgumentPushStub(), Sint32 and sySoundPlayStub().

Referenced by scAirsRockInsideReadRevealTablet(), scAquaRockInsideReadParchTablet(), scGaiaRockInsideReadSandTablet() and scMagmaRockInsideReadBlazeTablet().

Definition at line 506 of file field_engine_script.c.

fdScriptStartScreenTransition

void fdScriptStartScreenTransition(void)

The script command "open screen": starts the script's screen transition and sets transitionActive.

References fdScreenTransitionStart().

Referenced by fdActorAppearInWhirlwind(), fdActorDescendInWhirlwind(), fdMapScreenShow(), scAirsRockInsideLandInHall(), scAirsRockInsideRiseOnLift(), scAlhafraManorBriggsEscapes(), scAlhafranCaveSetUpJail(), scAnemosInnerSanctumArriveOnElevatorLift(), scAnemosInnerSanctumArriveOnMimicStonesLift(), scAnkohlRuinsLandFromFall(), scApojiiIslandsFatherSeesTheStone(), scAquaRockArriveFromInside(), scAquaRockArriveFromPassage(), scAquaRockArriveUpStream(), scAquaRockInsideFallThroughWater(), scAquaRockMoaiStepAside(), scChampaCliffCavesAskIfBriggsLearned(), scChampaCliffCavesObabaMournsSalamander(), scContigoInitLuckyDice(), scContigoReportCoinChange(), scContigoTheReunion(), scCrackedTileDropIn(), scDehkanPlateauCannonDropsPoundCube(), scDehkanPlateauLandFromFall(), scEasternAlhafraBriggsStealsShip(), scEasternAlhafraMayorFindsShipGone(), scEasternAlhafraShipBriggsIsCaught(), scGabombaStatueChamberAkafubuOffersToHelp(), scGabombaStatueChamberRideLiftBackUp(), scGabombaStatueChamberWhereIsTheOrb(), scGabombaStatueFocusEnergies(), scGabombaStatueInitEyes(), scGabombaStatueLandFromFall(), scGabombaStatueSawEnergyFlow(), scGabombaStatueSeeHowItWorks(), scGabombaStatueWatchTheChargesStick(), scGaiaRockInsideRaiseDust(), scGarohInitVillage(), scGarohRoomsWakeAtInn(), scGondowanCliffsTurnBackToHelpPiers(), scIdejimaBreakAwayFromGondowan(), scIdejimaFelixWakes(), scIdejimaFindFelixAndSheba(), scIdejimaRideTheTidalWave(), scInit(), scIsletsArriveAtSecretSpot(), scIsletsArriveBackAtIsland(), scIsletsInitSeaOfTime(), scJupiterLighthouseBeaconIsLit(), scJupiterLighthouseIsaacAndIvanAreHurt() and 75 more.

Definition at line 520 of file field_engine_script.c.

fdScriptFinishScreenTransition

void fdScriptFinishScreenTransition(void)

The script command "close screen": finishes the script's screen transition and clears transitionActive.

References fdScreenTransitionFinish().

Referenced by fdMapScreenShow(), scAirsRockEnterTheRock(), scAlhafraOpenDoorAndEnter(), scAnemosInnerSanctumEnterTheRoom(), scAnemosInnerSanctumRideLiftUp(), scApojiiIslandsEnterDoor(), scAquaRockEnterSparklingPassage(), scAquaRockInsideRideFalls(), scAquaRockMoaiStepAside(), scAquaRockSinkInside(), scAttekaInletOpenDoorAndEnter(), scChampaCliffCavesAskIfBriggsLearned(), scChampaCliffCavesOpenDoorAndEnter(), scChampaOpenDoorAndEnter(), scContigoOpenSanctumDoor(), scCrackedTileFall(), scDailaEnterDoor(), scDehkanPlateauCannonPoundsLeaderThrough(), scDehkanPlateauLeaveRoom(), scDehkanPlateauStepOnCrack(), scEasternAlhafraBriggsStealsShip(), scEasternAlhafraWorkersTellMayor(), scGabombaStatueChamberDropIntoHole(), scGabombaStatueChamberGabombaNamesWitchDoctor(), scGabombaStatueChamberWhereIsTheOrb(), scGabombaStatueClimbDownEyesLadder(), scGabombaStatueClimbDownLadder(), scGabombaStatueEndRide(), scGabombaStatueHearTheOffering(), scGabombaStatueSeeHowItWorks(), scGabombaStatueWatchTheChargesStick(), scGarohOpenDoorAndEnter(), scGondowanCliffsTurnBackToHelpPiers(), scIdejimaBreakAwayFromGondowan(), scIdejimaEnterDoor(), scIdejimaFindFelixAndSheba(), scInit(), scIsletCaveOpenDoorAndEnter(), scIsletsEnterDoor(), scIsletsGiveTurtle(), scIsletsLeaveByStep(), scIsletsLonesomeGeorgeThanks(), scIsletsOpenDoorAndEnter(), scIsletsRideBackToIsland(), scIsletsSinkInSea(), scIzumoEnterDoor(), scJupiterLighthouseKarstAndAgatioRetreat(), scJupiterLighthouseWeBeatThem(), scKandoreanTempleClimbDownTheLadder(), scKandoreanTempleClimbDownTheWell() and 62 more.

Definition at line 530 of file field_engine_script.c.

fdScriptWaitTransitionTicks

void fdScriptWaitTransitionTicks(void)

The script command "wait for screen": waits as long as the transition runs (transitionFrame).

References sySynch().

Referenced by fdActorAppearInWhirlwind(), fdHeadingShow(), fdMapScreenShow(), scAirsRockEnterTheRock(), scAirsRockInsideLandInHall(), scAirsRockInsideRiseOnLift(), scAlhafraManorBriggsEscapes(), scAlhafranCaveSetUpJail(), scAlhafraOpenDoorAndEnter(), scAnemosInnerSanctumEnterTheRoom(), scAnemosInnerSanctumLightSymbol(), scAnemosInnerSanctumRideLiftUp(), scAnkohlRuinsLandFromFall(), scApojiiIslandsEnterDoor(), scApojiiIslandsFatherSeesTheStone(), scAquaRockArriveFromPassage(), scAquaRockEnterSparklingPassage(), scAquaRockMoaiStepAside(), scAttekaInletOpenDoorAndEnter(), scChampaCliffCavesAskIfBriggsLearned(), scChampaCliffCavesObabaMournsSalamander(), scChampaCliffCavesOpenDoorAndEnter(), scChampaOpenDoorAndEnter(), scContigoInitLuckyDice(), scContigoOpenSanctumDoor(), scContigoReportCoinChange(), scContigoTheReunion(), scCrackedTileDropIn(), scCrackedTileFall(), scDailaEnterDoor(), scDehkanPlateauCannonDropsPoundCube(), scDehkanPlateauCannonPoundsLeaderThrough(), scDehkanPlateauLandFromFall(), scDehkanPlateauLeaveRoom(), scDehkanPlateauStepOnCrack(), scEasternAlhafraBriggsStealsShip(), scEasternAlhafraMayorFindsShipGone(), scEasternAlhafraShipBriggsIsCaught(), scEasternAlhafraWorkersTellMayor(), scGabombaStatueChamberAkafubuOffersToHelp(), scGabombaStatueChamberDropIntoHole(), scGabombaStatueChamberGabombaNamesWitchDoctor(), scGabombaStatueChamberRideLiftBackUp(), scGabombaStatueChamberWhereIsTheOrb(), scGabombaStatueClimbDownEyesLadder(), scGabombaStatueClimbDownLadder(), scGabombaStatueFocusEnergies(), scGabombaStatueHearTheOffering(), scGabombaStatueInitEyes(), scGabombaStatueLandFromFall() and 147 more.

Definition at line 540 of file field_engine_script.c.

fdScriptSetDestination

void fdScriptSetDestination(Sint32 sceneId, Sint32 entrance)

Makes the script leave for the given entrance of the given scene: raises the exit request EXIT_KEEP_DESTINATION and writes MainRoutineStateWork.next and entrance.

References MainRoutineStateWork and Sint32.

Referenced by dbPsynergyTestArriveInRing(), dbPsynergyTestDepartInRing(), fdEngineRun(), scAlhafraManorPointOutAirsRock(), scAnemosInnerSanctumTeleportOut(), scChampaCliffCavesAskIfBriggsLearned(), scContigoTeleportOut(), scEasternAlhafraBriggsStealsShip(), scEasternAlhafraWorkersTellMayor(), scGondowanCliffsSetUpPass(), scInit(), scKibomboMountainsSendPartyBack(), scLemuriaTeleportToGirlsHouse(), scPrepareMap(), scShamanVillageCaveLoseToGladiators(), scWorldMapFightBanditAndThieves() and scWorldMapShowAirsRockFromAlhafra().

Definition at line 548 of file field_engine_script.c.

fdScriptSetRestartPoint

void fdScriptSetRestartPoint(Sint32 sceneId, Sint32 entrance)

Makes the script leave and records sceneId and entrance as the restart point.

References MainRoutineStateWork and Sint32.

Definition at line 556 of file field_engine_script.c.

fdScriptSetExitRequest

void fdScriptSetExitRequest(Uint16 exit)

The script command "request exit": sets the field's exit request (EXIT_KEEP_DESTINATION leaves for MainRoutineStateWork's next and entrance).

Referenced by scAirsRockInsideJumpDownLedge(), scAirsRockInsideOpenTabletRoomDoor(), scAirsRockInsideRideWhirlwind(), scShrineOfTheSeaGodSinkWithWater() and scShrineOfTheSeaGodUseSeaGodsTear().

Definition at line 569 of file field_engine_script.c.