lamakan_desert.c
Lamakan Desert, four maps of sand between Altin and the world map east.
games/tbs/src/scene/lamakan_desert.c on GitHub
Lamakan Desert, four maps of sand between Altin and the world map east.
Walking fills a heat gauge (gGameState.hazardSteps of hazardLimit), drawn as a bar at the top of the screen; each quarter it fills makes a party member complain, and a full gauge leaves the leader collapsed at the nearest recovery point. Reveal uncovers the hidden pits, the shimmering heat haze hides them again, and a pit drags the leader into a battle.
Functions
TalkToSmog
static void TalkToSmog(void)
Smog, Jupiter Djinni 3, joins the party.
Used by gLamakanDesertEvents.
LamakanDesert_GetEntrances
const struct SceneEntrance *LamakanDesert_GetEntrances(void)
Where the party can enter each of the four maps.
LamakanDesert_GetExits
const u32 *LamakanDesert_GetExits(void)
All four desert maps share the packed exit table.
LamakanDesert_GetPlacements
const struct ScenePlacement *LamakanDesert_GetPlacements(void)
The pits and the monster of each map. Arriving at the third map's entrance 5, the way back from the monster's battle, marks it beaten.
LeaveForTheWorldMap
static void LeaveForTheWorldMap(void)
Trigger 9: back out to the world map.
Used by gLamakanDesertEvents.
LamakanDesert_GetEvents
const struct SceneEvent *LamakanDesert_GetEvents(void)
The desert's triggers, the same on every map.
FightSandMonster
static void FightSandMonster(void)
Talking to the sand monster: its battle, returning to the third map's entrance 5.
Used by gLamakanDesertEvents.
ComplainAboutHeat
static void ComplainAboutHeat(s32 mark)
Raised trigger 1, 2 or 3 as the heat gauge passes a quarter, a half and three quarters: Garet, Ivan or Mia, picked at random (three tries for one who has not spoken yet), complains about the heat.
Used by gLamakanDesertEvents.
HeatGauge_RaiseQuarterTriggers
static void HeatGauge_RaiseQuarterTriggers(void)
Every frame: raises triggers 1 to 3 as the gauge passes each quarter, and clears each mark and the complaints when the gauge drops back below it. Nothing is raised while Reveal is showing the pits.
Used by LamakanDesert_Initialize.
DistanceInPixels
static s32 DistanceInPixels(s32 *firstPosition, s32 *secondPosition)
The distance in whole pixels between two x, z positions.
Used by CollapseFromHeat.
CollapseFromHeat
static void CollapseFromHeat(void)
Trigger 20, raised when the heat gauge fills: the leader drops at the nearest recovery point of the map, lies collapsed while the gauge drains 5 steps a frame, then gets up.
Used by gLamakanDesertEvents.
HeatGauge_CountStep
static void HeatGauge_CountStep(void)
Walking on sand (triggers 21 and 100 to 107): each moving frame adds a step of heat and kicks up dust, faster on the run.
Used by MeetSandMonster, SlideDownDune, gLamakanDesertEvents.
FallIntoPit
static void FallIntoPit(void)
Trigger 22, stepping near a hidden pit: the leader looks at the nearest pit, is pulled backwards into it and a battle begins.
Used by gLamakanDesertEvents.
SlideDownDune
static void SlideDownDune(void)
Trigger 30, on a slope of sand: the sand carries the leader south 1.5 pixels a frame, and at a ledge the leader hops down 8 pixels.
Used by gLamakanDesertEvents.
MeetSandMonster
static void MeetSandMonster(void)
Trigger 40 on the third map, until the monster is beaten: the leader stops and backs away as the monster rises out of the sand.
Used by gLamakanDesertEvents.
LamakanDesert_Initialize
s32 LamakanDesert_Initialize(s32 a0, s32 a1)
Entering the desert: the heat gauge (600 steps) starts on the first three maps, the patches Reveal uncovers are saved to the spare cells at 64, 126 or 64, 124, and the secrets are hidden.
SandMonster_Return
static UNUSED void SandMonster_Return(void)
The monster sinks back to its spot; nothing calls this.
HeatGauge_Draw
static void HeatGauge_Draw(void)
Every frame: draws the heat gauge. It sits 8 pixels lower while held, slides away while flag 0x104 is set, its bar shrinks as the heat grows, and its colors turn redder (flickering greener past 60 of 120).
Used by HeatGauge_Start.
HeatGauge_Start
void HeatGauge_Start(void)
Loads the gauge's tiles, claims VRAM for them and starts drawing it.
Used by LamakanDesert_Initialize.
HeatGauge_SetHeld
static void HeatGauge_SetHeld(u16 value)
While held (1), the gauge stays on screen.
Used by CollapseFromHeat, MeetSandMonster.
Also, functions without a comment: Leader_SpraySand, LamakanDesert_GetRegions, Reveal_HideSecrets, Reveal_ShowSecrets.
Structures
SafePoint
struct SafePoint
A recovery point: where a collapsed leader comes to.
| Field | Declared as | |
|---|---|---|
x | s32 x | |
z | s32 z |
Used by CollapseFromHeat.
Macros, without a comment: NULL.
Globals
gLamakanDesertRecoveryPoints1
const s32 gLamakanDesertRecoveryPoints1[]
Each map's recovery points, as x, z pairs.
Used by CollapseFromHeat.
gHeatGaugeLevel
s16 gHeatGaugeLevel
The gauge: how full it is (0 to 120), how far it has slid onto the screen, and a flash as it fills.
Used by HeatGauge_Draw.
Also, globals without a comment: gEffectScript0, gEffectScript1, gEffectScript2, gLamakanDesertRecoveryPoints2, gLamakanDesertRecoveryPointsOther, gEffectScripts, gLamakanDesertEntrancesOther, gLamakanDesertEntrances1, gLamakanDesertEntrances2, gLamakanDesertEntrances3, gLamakanDesertEntrances4, gLamakanDesertExits, gLamakanDesertPlacementsOther, gLamakanDesertPlacements1, gLamakanDesertPlacements2, gLamakanDesertPlacements3, gLamakanDesertEvents, gHeatGaugeSlide, gHeatGaugeFlash.