altin.c
Altin, the mining village flooded by the water the hydros statues in the mine spew.
games/tbs/src/scene/altin.c on GitHub
Altin, the mining village flooded by the water the hydros statues in the mine spew. Two scenes share this overlay:
- the village itself, where the water drops in three stages as the party drains the mine, a water beast spits water at the houses until the party drives it off, and the shopkeepers wait for their shops to dry;
- the houses and the inn, where families sheltering from the flood go home as the water recedes.
A third, empty set of tables serves any other scene number.
Functions
Scene_GetExits
const u32 *Scene_GetExits(void)
Both scenes share one exit table.
Scene_GetPlacements
const struct ScenePlacement *Scene_GetPlacements(void)
Some villagers only turn back after talking once the flood is over or their family has gone home.
Village_AskAboutFirstVisit
static void Village_AskAboutFirstVisit(void)
A villager asks whether this is the party's first visit; either way, the flood has changed Altin.
Used by gAltinVillage_Events.
Village_AskAboutHydros
static void Village_AskAboutHydros(void)
A villager asks whether the slain hydros creatures gushed water.
Used by gAltinVillage_Events.
Village_TalkToThirstyVillager
static void Village_TalkToThirstyVillager(void)
While the beasts live, this villager complains that their water cannot be drunk, and the first time the camera pans to the water beast spitting at the houses. Once the statues are gone, he asks for help rebuilding.
Used by gAltinVillage_Events.
Village_AskAboutRuins
static void Village_AskAboutRuins(void)
A villager asks whether the party really found ruins deep in the mine.
Used by gAltinVillage_Events.
Houses_AskAboutXianGirl
static void Houses_AskAboutXianGirl(void)
A guest asks whether the party is who the girl from Xian was looking for.
Used by gAltinHouses_Events.
Houses_AskAboutWayWest
static void Houses_AskAboutWayWest(void)
A guest asks whether the party seeks the way west, and points to the bottom of the mine.
Used by gAltinHouses_Events.
Houses_AskAboutMonsters
static void Houses_AskAboutMonsters(void)
The grateful villager asks whether the party defeated the monsters.
Used by gAltinHouses_Events.
Houses_AskAboutMineBeasts
static void Houses_AskAboutMineBeasts(void)
A miner asks whether the remaining beasts are deep below.
Used by gAltinHouses_Events.
Leader_FacesCounter
static s32 Leader_FacesCounter(void)
Returns whether the party leader faces north, toward a shop counter: its facing lies strictly between northwest and northeast, measured in 16 bits.
Used by Altin_TalkToArmorSeller, Altin_TalkToItemSeller, Houses_TalkToWeaponSeller.
Houses_TalkToWeaponSeller
static void Houses_TalkToWeaponSeller(void)
The weapon seller: until the water drains he cannot sell; afterwards he opens his shop when spoken to across the counter.
Used by gAltinHouses_Events.
Altin_TalkToArmorSeller
static void Altin_TalkToArmorSeller(void)
The armor seller, in either scene: outside, while his shop is under water, he laments; once it has dried after the second drop, he sells across his counter in the houses.
Used by gAltinHouses_Events, gAltinVillage_Events.
Altin_TalkToItemSeller
static void Altin_TalkToItemSeller(void)
The item seller, the same way: she reopens after the first drop.
Used by gAltinHouses_Events, gAltinVillage_Events.
Houses_TalkToInnkeeper
static void Houses_TalkToInnkeeper(void)
The innkeeper opens the inn across the counter, and otherwise talks about the flood or, once it is over, the temple west of the mine.
Used by gAltinHouses_Events.
Village_EnterDoor
static void Village_EnterDoor(void)
Walking north into one of the village's doors: everyone stops, the door opens and the party leader walks in. The mine's wide door is redrawn in two halves by hand; the others play their opening pictures.
Used by gAltinVillage_Events.
Village_WalkThroughDoorway
static void Village_WalkThroughDoorway(void)
Walking north into a doorway without a door: the leader walks out.
Used by gAltinVillage_Events.
Beast_Hop
static void Beast_Hop(union FieldObject *fieldObject)
Update callback of the hopping water beast: once a second it leaps up, falls back with a splash that shakes the screen briefly, and stands while on the ground.
Used by Beast_HopAway.
Beast_HopAway
static void Beast_HopAway(void)
The water beast hops away across the flood and dives in with a splash.
Used by Village_ScareOffBeast.
Village_CheckBlockMoved
static void Village_CheckBlockMoved(void)
After Move: remembers whether the block now stands in map column 22, the spot it is pushed to.
Used by gAltinVillage_Events.
Scene_Initialize
s32 Scene_Initialize(void)
Works out the village's water level from the mine's drain flags, then sets up whichever scene is being entered. Returns 0.
Village_ApplyWaterLevel
static void Village_ApplyWaterLevel(void)
Sets up the village: the map half showing the current water level (the cells kept in four 32 by 32 blocks), the villagers and sellers present at that level, the water beast with its spray while it remains, and the pushed block. Then redraws the map around the leader.
Used by Scene_Initialize.
Houses_PlaceSheltering
static void Houses_PlaceSheltering(void)
Sets up the houses: the families still sheltering in the inn's rooms, the weapon seller waiting there until the water drains, and the shopkeepers kept from wandering.
Used by Scene_Initialize.
Spray_Initialize
static void Spray_Initialize(struct FieldActor *spray)
Gives a new spray particle its look: standing still, drawn on sprite priority 1 and at 0.3 scale.
Used by Beast_SpawnSpray.
Spray_Drift
static void Spray_Drift(union FieldObject *fieldObject)
Update callback of a spray particle: it drifts and grows with a random wobble, then curls upward and flattens as its movement timer runs down. The separate lifetime releases it after 20 updates.
Used by Beast_SpawnSpray.
Beast_SpawnSpray
static void Beast_SpawnSpray(void)
Scheduler task while the water beast spits: every fourth frame a spray particle starts from its spout, living 20 frames.
Used by Village_ApplyWaterLevel, Village_ScareOffBeast.
Village_ScareOffBeast
static void Village_ScareOffBeast(void)
Stepping near the water beast: the camera pans to it, it stops spitting, turns to the party, cries out and hops away into the flood.
Used by gAltinVillage_Events.
Also, functions without a comment: Scene_GetEntrances, Scene_GetRegions, Scene_GetEvents.
Enumerations
AltinVillageActor
enum AltinVillageActor
The village's actors.
| Value | = | |
|---|---|---|
ACTOR_GREETING_VILLAGER | 8 | |
ACTOR_CURIOUS_VILLAGER | 9 | |
ACTOR_THIRSTY_VILLAGER | 14 | |
ACTOR_RETURNING_VILLAGER_A | 15 | Villagers who come back as the water recedes. |
ACTOR_RETURNING_VILLAGER_B | 16 | |
ACTOR_RETURNING_VILLAGER_C | 17 | |
ACTOR_WATER_BEAST | 18 | |
ACTOR_MOVABLE_BLOCK | 19 | |
ACTOR_FLOODED_ARMOR_SELLER | 20 | The armor and item sellers, waiting outside while their shops are under water. |
ACTOR_FLOODED_ITEM_SELLER | 21 | |
ACTOR_FIRST_GROUND_SPRITE | 22 | Three ground sprites drawn under the party. |
ACTOR_SECOND_GROUND_SPRITE | 23 | |
ACTOR_THIRD_GROUND_SPRITE | 24 |
AltinHouseActor
enum AltinHouseActor
The houses' actors.
| Value | = | |
|---|---|---|
ACTOR_ROOM_ONE_GUEST | 8 | The family sheltering in the inn's Room One until the first drop. |
ACTOR_ROOM_ONE_SECOND_GUEST | 9 | |
ACTOR_ROOM_TWO_GUEST | 10 | The family in Room Two, until the second drop. |
ACTOR_ROOM_TWO_SECOND_GUEST | 11 | |
ACTOR_KISSING_VILLAGER | 14 | |
ACTOR_WEAPON_SELLER | 15 | |
ACTOR_ITEM_SELLER | 16 | |
ACTOR_ARMOR_SELLER | 17 | |
ACTOR_INNKEEPER | 18 | |
ACTOR_COOK | 20 | |
ACTOR_MINE_WORKER | 21 |
Macros, without a comment: ALTIN_COOK_LAST_POT_X, ALTIN_COOK_LAST_POT_X, SCENE_ALTIN_VILLAGE, SCENE_ALTIN_HOUSES, WATER_BEAST_HOP_PERIOD, WATER_SPRAY_LIFETIME, WATER_SPRAY_START_SCALE, ALTIN_FACES_COUNTER, ALTIN_FACES_COUNTER, WATER_SPRAY_LATERAL_STEP, WATER_SPRAY_LATERAL_STEP.
Globals
gAltinHouses_CookScript
s32 gAltinHouses_CookScript[]
The cook from Xian paces between his pots, nodding over each.
Used by gAltinHouses_Placements.
gAltinVillage_MineDoorCells
u16 gAltinVillage_MineDoorCells[]
The opening pictures of the village's doors, two cells square. The mine's door (the second) is wider and redrawn by hand instead.
Used by gAltinVillage_Doors.
gAltinVillage_Doors
struct MapCellAnim gAltinVillage_Doors[]
Each door trigger's opening picture and cell, from trigger 2.
Used by Village_EnterDoor.
Also, globals without a comment: gAltinOther_Entrances, gAltinVillage_Entrances, gAltinHouses_Entrances, gAltin_Exits, gAltinOther_Placements, gAltinVillage_Placements, gAltinHouses_Placements, gAltinOther_Events, gAltinVillage_Events, gAltinHouses_Events, gAltinVillage_DoorCellsA, gAltinVillage_DoorCellsF, gAltinVillage_DoorCellsG, gAltinVillage_DoorCellsC, gAltinVillage_DoorCellsD, gAltinVillage_DoorCellsE.