Skip to Content
The Alchemy Project

src/field/script_commands_requests.c

Battles and destinations a script requests, and the queued sound. More…

Included by script_commands.c.

Macros

NameDescription
#defineDJINN_ACTOR_MASK 0xffThe low bits of fdRequestDjinnBattle's actorAndHop: the Djinni's actor.

Functions

NameDescription
voidfdRequestBattleFromEncounterTable (Sint32 zone, Sint32 slot)Sets up a battle with the formation in slot of encounter table zone.
voidfdRequestDjinnBattle (Sint32 actorAndHop, Sint32 djinni)Sets up the battle with Djinni number djinni.
voidfdScriptSetAfterBattleDestination (Sint32 sceneId, Sint32 entrance)Sets the after-battle destination (MainRoutineStateWork.afterBattleScene and afterBattleEntrance), where the party goes once the coming battle is won.
voidfdScriptSetDefeatDestination (Sint32 sceneId, Sint32 entrance)Sets where the party wakes up after losing a battle (MainRoutineStateWork.defeatScene and defeatEntrance).
voidfdScriptLeaveFor (Uint16 sceneId, Uint16 entrance)Sends the party to an entrance of another scene: the field engine leaves on its next pass (EXIT_KEEP_DESTINATION).
voidfdQueueMusic (Sint32 soundId)Changes the scene's music to soundId and remembers it for fdPlayQueuedMusic; -1 fades the music out and remembers none.
voidfdPlayQueuedMusic (void)Plays the sound fdQueueMusic remembered, if any.

Description

Battles and destinations a script requests, and the queued sound. Part of script_commands.c.

Macros in detail

DJINN_ACTOR_MASK

#define DJINN_ACTOR_MASK 0xff

The low bits of fdRequestDjinnBattle's actorAndHop: the Djinni's actor.

Referenced by fdRequestDjinnBattle().

Definition at line 25 of file script_commands_requests.c.

Functions in detail

fdRequestBattleFromEncounterTable

void fdRequestBattleFromEncounterTable(Sint32 zone, Sint32 slot)

Sets up a battle with the formation in slot of encounter table zone.

References fdActorLookup(), fdEncounterGetFormationAtSlot(), fdEncounterResolveWorldMapZoneAndBackdrop(), fdEncounterSelectBattleMusic(), MainRoutineStateWork, Sint32 and state.

Referenced by scAltinPeakFightFirstWaterBeast(), scAltinPeakFightSecondWaterBeast(), scAltinPeakFightThirdWaterBeast(), scAltinPeakStartHydrosBattle(), scBattleArenaEnterBattle(), scColossoReachArena(), scCrossboneIsleFightDeadbeard(), scCrossboneIsleOpenEastDoor(), scLamakanDesertFallIntoPit(), scLamakanDesertFightManticore(), scLogRoomsAFightThievesAgain(), scLogRoomsAFreeVillagerAndFightThieves(), scLunpaFortressFightCellKeyRoomGuard(), scLunpaFortressFightDonpasDoorGuard(), scLunpaFortressFightMiddleHallGuard(), scLunpaFortressFightThreeGuards(), scLunpaFortressFindHammet(), scMercuryLighthouseAerieConfrontSaturos(), scMercuryLighthouseEntranceFightLizardMan(), scMogallForestFirstAreaApeAttacks(), scMogallForestKillerApeAttacks(), scMogallForestThirdAreaApeAttacks(), scShipRoomsFightRowingDeckMonsters(), scSuhallaDesertDouseStorm(), scTolbiShipDeckJumpIntoKrakenBattle(), scTreeRoomsFightTret(), scValeKradensCottageFightFirstMonster(), scValeKradensCottageFightSecondMonster(), scValePlazaFightTravelers(), scValePrologueFightFourthMonster(), scValePrologueFightThirdMonster(), scVenusLighthouseAerieCombineSaturosAndMenardi(), scVenusLighthouseAerieConfrontSaturosAndMenardi(), scWorldMapDouseMapStorm() and scWorldMapExplainSettingDjinn().

Definition at line 7 of file script_commands_requests.c.

fdRequestDjinnBattle

void fdRequestDjinnBattle(Sint32 actorAndHop, Sint32 djinni)

Sets up the battle with Djinni number djinni. The low 8 bits of actorAndHop are the Djinni's actor, which hops first unless DJINN_NO_HOP is set.

References fdActorLookup(), fdDjinnRunBattleStartHop(), fdEncounterGetDjinnFormation(), fdEncounterResolveWorldMapZoneAndBackdrop(), fdEncounterSelectBattleMusic(), MainRoutineStateWork, Sint32 and state.

Referenced by scAltinPeakTalkToDjinni(), scAltmillerCaveStartDjinnBattle(), scBabiLighthouseStartDjinnBattle(), scFuchinFallsCaveFightZephyr(), scGomaCavePillarFightForge(), scMercuryLighthouseStartDjinnBattle(), scMogallForestStartDjinnBattle(), scSuhallaDesertFightFlash(), scSuhallaGateFightDew(), scTretTreeBranchTalkToBreeze(), scWorldMapMeetCorona(), scWorldMapMeetHail() and scWorldMapMeetVine().

Definition at line 29 of file script_commands_requests.c.

fdScriptSetAfterBattleDestination

void fdScriptSetAfterBattleDestination(Sint32 sceneId, Sint32 entrance)

Sets the after-battle destination (MainRoutineStateWork.afterBattleScene and afterBattleEntrance), where the party goes once the coming battle is won.

References MainRoutineStateWork and Sint32.

Referenced by scAltinPeakFightFirstWaterBeast(), scAltinPeakFightSecondWaterBeast(), scAltinPeakFightThirdWaterBeast(), scAltinPeakStartHydrosBattle(), scBattleArenaEnterBattle(), scColossoReachArena(), scCrossboneIsleFightDeadbeard(), scCrossboneIsleOpenEastDoor(), scLamakanDesertFightManticore(), scLogRoomsAFightThievesAgain(), scLogRoomsAFreeVillagerAndFightThieves(), scLunpaFortressFightThreeGuards(), scLunpaFortressFindHammet(), scMercuryLighthouseAerieConfrontSaturos(), scMercuryLighthouseEntranceFightLizardMan(), scMogallForestKillerApeAttacks(), scShipRoomsFightRowingDeckMonsters(), scStuccoRoomsCOfferLuckyDice(), scStuccoRoomsCOfferLuckyWheels(), scTolbiShipDeckJumpIntoKrakenBattle(), scTreeRoomsFightTret(), scValePlazaFightTravelers(), scVenusLighthouseAerieCombineSaturosAndMenardi() and scVenusLighthouseAerieConfrontSaturosAndMenardi().

Definition at line 63 of file script_commands_requests.c.

fdScriptSetDefeatDestination

void fdScriptSetDefeatDestination(Sint32 sceneId, Sint32 entrance)

Sets where the party wakes up after losing a battle (MainRoutineStateWork.defeatScene and defeatEntrance).

References MainRoutineStateWork and Sint32.

Referenced by scBattleArenaEnterBattle(), scColossoReachArena(), scLogRoomsAFightThievesAgain(), scLogRoomsAFreeVillagerAndFightThieves(), scValePlazaFightTravelers(), scVenusLighthouseAerieCombineSaturosAndMenardi() and scVenusLighthouseAerieConfrontSaturosAndMenardi().

Definition at line 71 of file script_commands_requests.c.

fdScriptLeaveFor

void fdScriptLeaveFor(Uint16 sceneId, Uint16 entrance)

Sends the party to an entrance of another scene: the field engine leaves on its next pass (EXIT_KEEP_DESTINATION).

References MainRoutineStateWork and state.

Referenced by scStuccoRoomsCOfferLuckyDice() and scStuccoRoomsCOfferLuckyWheels().

Definition at line 79 of file script_commands_requests.c.

fdQueueMusic

void fdQueueMusic(Sint32 soundId)

Changes the scene's music to soundId and remembers it for fdPlayQueuedMusic; -1 fades the music out and remembers none.

References Sint32 and sySoundPlayStub().

Referenced by fdWeatherStartRain(), scAltinApplyWaterLevel(), scAltinPeakStartSpittingFX(), scAltinScareOffBeast(), scInit(), scKalayPrepareTunnelPassage(), scKalayPrepareTunnelTreasureRoom(), scKalayUpdateTunnelStatues(), scSolSanctumEntranceRestoreInteriorState(), scSolSanctumLunaSolRoomsArriveAfterWiseOnesRescue(), scSuhallaDesertSetUpFirstMapStorms(), scSuhallaDesertSetUpSecondMapStorms(), scVenusLighthouseMoveFirstFloorSandFall(), scVenusLighthousePourEastSandSlide() and scVenusLighthousePourWestSandSlide().

Definition at line 89 of file script_commands_requests.c.

fdPlayQueuedMusic

void fdPlayQueuedMusic(void)

Plays the sound fdQueueMusic remembered, if any.

References sySoundPlayStub().

Referenced by fdActorJumpDownLedge(), fdExamineMetatile(), fdPsynergyEnd(), scAltinPeakFlipPoolRoomSwitch(), scAltinPeakFlipSecondWaterBeastRoomSwitch(), scAltinPeakFlipSpritzRoomSwitch(), scAltinPeakFlipThirdWaterBeastRoomSwitch(), scAltinPeakRideCart(), scFuchinTempleMonkLetsPartyIntoGrotto(), scGomaCaveEntranceIvanJoins(), scGomaCaveEntrancePushWestPillar(), scKalayPushTunnelStatue(), scLamaTempleRunHamasFarewell(), scMercuryLighthouseArriveWithSparks(), scMercuryLighthousePlyOpensWaterfallPassage(), scPushedActorAdvancePair(), scPushedActorRoll(), scValePrologueBumpIntoShovingMan(), scValePrologueDoraGoesForHelp(), scValePrologueDoraSendsIsaacToThePlaza(), scValePrologueFirstRockFalls(), scValePrologueFourthRockFalls(), scValePrologueSecondRockFalls(), scValePrologueShowBoulderSweepingDownriver(), scValePrologueThirdRockFalls(), scValePrologueWatchAttemptToSaveFelix(), scValePrologueWatchBoulderFall(), scVenusLighthouseArriveThroughSparkPassage(), scVenusLighthouseLandWithRadialDust(), scVenusLighthousePushPillarAhead(), scXianStrikeTrainingTreeWithForce(), scXianTalkToKungFuStudent() and scXianTalkToWaterCarrier().

Definition at line 101 of file script_commands_requests.c.