src/scene/altin.c
Altin, the mining village north of the Alpine Crossing, in two scenes that share this overlay and the area name Altin: the village outdoors (SceneIdAltin), and its inn, shops and houses (SceneIdCottageRoomsD), a rooms map each in its own camera box. More…
#include "ability_ids.h"#include "flags.h"#include "item_ids.h"#include "battle/battle.h"#include "debug/debug.h"#include "field/field_effect.h"#include "graphics/graphics.h"#include "game/system_call.h"#include "text/msg_ids.h"
Macros
| Name | Description | |
|---|---|---|
#define | ALTIN_COOK_LAST_POT_X WHEN(ALTIN_COOK_LAST_POT_FURTHER_WEST, 380, 384) | The x of the easternmost pot the cook from Xian walks to and nods over, 4 pixels further west in the French, Spanish and Italian editions. |
#define | MAP_ALTIN_VILLAGE (SCENE_ALTIN) | The overlay's two scenes: the village, and its inn, shops and houses. |
#define | MAP_ALTIN_HOUSES (SCENE_COTTAGE_ROOMS_D) | |
#define | WATER_BEAST_HOP_PERIOD 60 | The ticks from one of the water beast's hops to the next. |
#define | STONE_STATUE_MOVED_COLUMN 22 | The map column the stone statue stands in once moved, at (360, 168). |
#define | SPEW_LIFETIME 20 | The ticks a drop of the water beast's spray lives. |
#define | SPEW_START_SCALE (toFIXED(3) / 10) | A drop of spray starts at three tenths of its sprite's size. |
#define | ALTIN_FACES_COUNTER (facing) FACING_IS_NORTH(facing) | |
#define | SPEW_LATERAL_STEP (timer, wobble) ((timer) * 4096 + (wobble) * 32768) |
Enumerations
| Name | Description | |
|---|---|---|
enum | ALTIN_VILLAGE_ACTOR_ID { ACTOR_GREETING_STRONGMAN, ACTOR_CURIOUS_STRONGMAN, ACTOR_WOM … } | The village's actors, numbering the rows of AltinActorPlacements. |
enum | ALTIN_HOUSE_ACTOR_ID { ACTOR_ROOM_ONE_GUEST, ACTOR_ROOM_ONE_SECOND_GUEST, ACTOR_ROO … } | The houses' actors, numbering the rows of CottageRoomsDActorPlacements, named as the village's are. |
enum | anonymous enum { FLAG_ALTIN_WATER_DROPPED_ONCE, FLAG_ALTIN_WATER_DROPPED_TWIC … } | The village's water level, set on entry from the mine's drain flags. |
enum | anonymous enum { SHOP_ALTIN_WEAPONS, SHOP_ALTIN_ARMOR, SHOP_ALTIN_ITEMS } | Altin's shops, by their numbers in the shop table. |
enum | anonymous enum { INN_ID_ALTIN } | Altin's inn, as mnInnCheckIn numbers the inns. |
enum | ALTIN_METATILE_BEHAVIOR { METATILE_BEHAVIOR_ALTIN_EAST_ROAD, METATILE_BEHAVIOR_ALTIN_I … } | The metatile behaviors Altin's cues answer. |
enum | COTTAGE_ROOMS_D_METATILE_BEHAVIOR { METATILE_BEHAVIOR_COTTAGE_ROOMS_D_NUT_BARREL, METATILE_BEHAV … } | The metatile behaviors of the rooms' barrels, bed, pots and bookcase. |
enum | anonymous enum { DOOR_SANCTUM, DOOR_ARMOR_SHOP } | The doors of the village, by their index in AltinDoors. |
Functions
| Name | Description | |
|---|---|---|
static void | scAltinApplyWaterLevel (void) | Sets up the village at its water level: that stage's picture and metatiles, the villagers who are home, and the water beast while it is still there. |
static void | scCottageRoomsDPlaceSheltering (void) | Sets up the rooms: until the first drop the Room One family shelter in the inn, until the second the Room Two family, and until the village is drained the weapon merchant waits there too. |
static void | scAltinBeastSpewWater (void) | Event while the water beast spews ("We can't drink the water the monsters spew!"): every fourth tick a drop of water starts from its spout, living SPEW_LIFETIME ticks. |
const SCENE_ENTRANCE * | scGetEntrances (void) | The six rooms share one entrance table. |
const SCENE_EXIT_REGION * | scGetExitRegions (void) | The scene has no exit regions: its regions entry returns none. |
const Uint32 * | scGetExits (void) | Both scenes share one exit table. |
const ACTOR_PLACE * | scGetActorPlacements (void) | Some villagers only turn back after talking once the flood is over or their family has gone home. |
const CUE * | scGetCues (void) | The first water beast's cave changes its cues once the first drain has lowered its water: the beast is gone and its two puddles can be frozen. |
static void | scAltinAskAboutFirstVisit (void) | The bald strong man by the east entrance asks whether this is the party's first visit to Altin, and tells how the flood has changed it. |
static void | scAltinAskAboutHydros (void) | Once the hydros statues are beaten, the strong man near the east entrance asks whether water gushed out of them when the party slew them. |
static void | scAltinTalkToThirstyOldWoman (void) | The old woman on the west ledge complains that nobody can drink the water the monsters spew. |
static void | scAltinAskAboutRuins (void) | Once the hydros statues are beaten, the old man who wanders the middle of the village, back home since the water drained, asks whether the party really found ancient ruins at the bottom of the mine. |
static void | scCottageRoomsDAskAboutXianGirl (void) | Once the hydros statues are beaten, the woman of the Room One family, back in their house on the east side, asks whether the party are the young warriors a girl from Xian was asking about. |
static void | scCottageRoomsDAskAboutWayWest (void) | After the second drop, until the hydros statues are beaten, the old man of the Room Two family, back in their house in the cliff, asks whether the party is finding a way west through the mountains, and says a passage should lead west at the bottom of the mine. |
static void | scCottageRoomsDAskAboutMonsters (void) | Once the hydros statues are beaten, the little girl in the house by the rails asks whether the party defeated the monsters, and thanks Isaac with a kiss either way. |
static void | scCottageRoomsDAskAboutMineBeasts (void) | Once the hydros statues are beaten, the man still staying upstairs in the inn asks whether the few beasts left in the mine are deep down. |
static Bool | scAltinLeaderFacesCounter (void) | Returns whether Isaac faces north, across a counter. |
static void | scCottageRoomsDTalkToWeaponMerchant (void) | Until the village is drained, the weapon merchant waits in the inn and only asks whether the party wants weapons. |
static void | scAltinTalkToArmorMerchant (void) | Until the second drop, the armor merchant waits on the west ledge beside his flooded shop, saying his store is submerged. |
static void | scAltinTalkToItemMerchant (void) | Until the first drop, the item merchant waits on the ledge east of the Sanctum, afraid her goods are soaked. |
static void | scCottageRoomsDTalkToInnkeeper (void) | The innkeeper lets the party stay when spoken to across his counter. |
static void | scAltinEnterDoor (void) | Walking north into one of the village's doors opens it, and Isaac walks in as the screen fades: the inn's under its sign (metatile (10, 13)), the Sanctum's wide double door, which slides open (metatiles (20, 12) and (21, 12)), the item shop's in the east cliff (metatile (28, 13)), the armor shop's (metatile (11, 25)), the weapon shop's (metatile (10, 27)), and the three houses': on the east side (metatile (26, 21)), in the cliff north-west of the armor shop (metatile (8, 19)), and by the rails at the south (metatile (17, 25)). |
static void | scAltinWalkIntoMine (void) | Walking north into one of the three doorways down into the mine plays the exit sound, and Isaac walks into the dark: the rail tunnel in the north cliff (metatile (16, 13)), the doorway in the middle of the village where the rails run south (metatile (20, 16)), or the one in the west cliff by the water beast (metatile (1, 28)). |
static void | scAltinBeastHop (ACTOR *actor) | The water beast's update function as it flees: it leaps every WATER_BEAST_HOP_PERIOD ticks with SE_JUMP, and lands with a splash that shakes the screen for a few ticks. |
static void | scAltinBeastHopAway (void) | The water beast hops along the shore into the mine doorway in the west cliff (metatile (1, 28)) and is gone with a splash. |
static void | scAltinCheckStatueMoved (void) | Move on the stone statue on the top ledge shifts it one metatile east (to metatile (22, 10)), uncovering the passage into the mine behind it. |
Sint32 | scInit (void) | Sets up the scene being entered, at the village's water level. |
static void | scAltinInitSpew (ACTOR *drop) | Gives a new drop of spray its look: drawn in front, its red and blue swapped, and small. |
static void | scAltinDriftSpew (ACTOR *drop) | A drop of spray's update function, through its SPEW_LIFETIME ticks: it drifts east, slowing as it goes, with a random wobble, and moves two pixels a tick down the screen as it grows; in its last ticks it spreads flat and rises a little as it splashes. |
static void | scAltinScareOffBeast (void) | Walking down the west ledge to the ground above the water beast (metatile (4, 26)) startles it: the camera goes to it, it stops spitting water, cries out, and hops away into the mine doorway beside it with a splash, for good. |
Variables
| Name | Description | |
|---|---|---|
extern SCENE_ENTRANCE | AltinNoEntrances [] | |
extern SCENE_ENTRANCE | AltinEntrances [] | |
extern SCENE_ENTRANCE | CottageRoomsDEntrances [] | |
extern Uint32 | AltinExits [] | |
extern ACTOR_PLACE | AltinNoActorPlacements [] | |
extern ACTOR_PLACE | AltinActorPlacements [] | |
extern ACTOR_PLACE | CottageRoomsDActorPlacements [] | |
extern CUE | AltinNoCues [] | |
extern CUE | AltinCues [] | |
extern CUE | CottageRoomsDCues [] | |
extern MAP_EDIT | AltinDoors [] | Each door's opening pictures and the metatile they are drawn at, in the order of the doors' metatile behaviors from the inn's. |
Sint32 | CottageRoomsDCookScript [] | The cook from Xian paces between his pots, nodding over each. |
Uint16 | AltinSanctumDoorMetatiles [] | The opening pictures of the village's doors, two metatiles square. |
Uint16 | AltinInnDoorMetatiles [] | |
Uint16 | AltinItemShopDoorMetatiles [] | |
Uint16 | AltinArmorShopDoorMetatiles [] | |
Uint16 | AltinEastHouseDoorMetatiles [] | |
Uint16 | AltinCliffHouseAndWeaponShopDoorMetatiles [] | |
Uint16 | AltinSouthHouseDoorMetatiles [] |
Description
Altin, the mining village north of the Alpine Crossing, in two scenes that
share this overlay and the area name Altin: the village outdoors
(SceneIdAltin), and its inn, shops and houses (SceneIdCottageRoomsD), a rooms
map each in its own camera box. The getters pick each scene's tables by
MainRoutineStateWork.next, and both share one exit table. A third, empty set
of tables serves any other scene.
When the party comes in from the World Map on the east, the village is under
water. Since the day the gems fell from the sky, water beasts have flooded
it, and one still spits water at the houses from the village's west edge.
Walking up to it (scAltinScareOffBeast) makes it stop, cry out and hop away
into the mine for good. Its spray and sound start in scAltinApplyWaterLevel,
and it is drawn with its green and blue swapped (SPRITE_COLOR_RBG).
The water goes down as the party beats the beasts in the mine below, which
the area names call Altin Peak (altin_peak.c). Each beaten beast opens a
drain (FLAG_ALTIN_MINE_FIRST_DRAIN to _THIRD_DRAIN), and the village shows
three stages: the water dropped once, twice, or drained (the second and third
drains both). scInit turns the drains into three scene temp flags, and
scAltinApplyWaterLevel copies that stage's picture of the village, with its
metatiles, over the map and leaves out whoever would be standing in the
water.
As the water drops, three villagers come home one by one, the two families sheltering in the inn's Room One and Room Two go home, and the shops open again: the item shop after the first drop, the armor shop after the second, and the weapon shop, whose owner waits in the inn, once the village is drained. Until then the armor and item merchants wait outside above the flood.
Every villager has two sets of lines and thoughts, before and after
FLAG_HYDROS_STATUES_DEFEATED, when the party has beaten the hydros statues at
the bottom of the mine. The row that needs the flag clear comes first in each
table, so the first row that matches picks the time.
Walking into a door (scAltinEnterDoor) leads into the inn, under its sign on
the north-west ledge; the Sanctum, by the wide double door in the cliff below
the stone statue; the item shop, by its small door in the east cliff; the
armor shop, the house with a round red sign; the weapon shop, by the door
with a sword sign at the south; or one of three family houses. Three doorways
lead down into the mine (scAltinWalkIntoMine): the rail tunnel in the north
cliff, the doorway in the middle of the village where the rails run south,
and one in the west cliff by the water beast. The stone statue on the top
ledge stands in front of a fourth way in, until Move shifts it aside
(scAltinCheckStatueMoved). Coming back out of the Sanctum, the area name is
not shown again.
In the inn a cook from Xian paces between his pots (CottageRoomsDCookScript).
Macros in detail
ALTIN_COOK_LAST_POT_X
#define ALTIN_COOK_LAST_POT_X WHEN(ALTIN_COOK_LAST_POT_FURTHER_WEST, 380, 384)
The x of the easternmost pot the cook from Xian walks to and nods over, 4 pixels further west in the French, Spanish and Italian editions.
Referenced by CottageRoomsDCookScript.
Definition at line 74 of file altin.c.
MAP_ALTIN_VILLAGE
#define MAP_ALTIN_VILLAGE (SCENE_ALTIN)
The overlay's two scenes: the village, and its inn, shops and houses.
Referenced by scGetActorPlacements(), scGetCues(), scGetEntrances() and scInit().
Definition at line 77 of file altin.c.
MAP_ALTIN_HOUSES
#define MAP_ALTIN_HOUSES (SCENE_COTTAGE_ROOMS_D)
Referenced by scGetActorPlacements(), scGetCues(), scGetEntrances() and scInit().
Definition at line 78 of file altin.c.
WATER_BEAST_HOP_PERIOD
#define WATER_BEAST_HOP_PERIOD 60
The ticks from one of the water beast's hops to the next.
Referenced by scAltinBeastHop() and scAltinPeakUpdateBeastHops().
Definition at line 325 of file altin.c.
STONE_STATUE_MOVED_COLUMN
#define STONE_STATUE_MOVED_COLUMN 22
The map column the stone statue stands in once moved, at (360, 168).
Referenced by scAltinCheckStatueMoved().
Definition at line 327 of file altin.c.
SPEW_LIFETIME
#define SPEW_LIFETIME 20
The ticks a drop of the water beast's spray lives.
Referenced by scAltinBeastSpewWater().
Definition at line 329 of file altin.c.
SPEW_START_SCALE
#define SPEW_START_SCALE (toFIXED(3) / 10)
A drop of spray starts at three tenths of its sprite's size.
Referenced by scAltinInitSpew().
Definition at line 331 of file altin.c.
ALTIN_FACES_COUNTER
#define ALTIN_FACES_COUNTER(facing) FACING_IS_NORTH(facing)
#define ALTIN_FACES_COUNTER(facing)
Referenced by scAltinLeaderFacesCounter() and scCottageRoomsDTalkToInnkeeper().
Definition at lines 336 and 338 of file altin.c.
SPEW_LATERAL_STEP
#define SPEW_LATERAL_STEP(timer, wobble) ((timer) * 4096 + (wobble) * 32768)
#define SPEW_LATERAL_STEP(timer, wobble)
Referenced by scAltinDriftSpew().
Definition at lines 348 and 350 of file altin.c.
Enumerations in detail
ALTIN_VILLAGE_ACTOR_ID
enum ALTIN_VILLAGE_ACTOR_ID
The village's actors, numbering the rows of AltinActorPlacements.
The people without a script of their own are named by their sprite and by what they say before the hydros statues are beaten.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_GREETING_STRONGMAN | ACTOR_FIRST_PLACED | A bald, bare-chested strong man (SPRITE_BALD_MUSCULAR_MAN). His script is scAltinAskAboutFirstVisit. |
ACTOR_CURIOUS_STRONGMAN | A stocky strong man flexing his arms (SPRITE_STRONGMAN). His script is scAltinAskAboutHydros. | |
ACTOR_WOMAN_COATED_HOUSE | A woman with fair hair in a white apron (SPRITE_WOMAN_WITH_FAIR_HAIR). | |
ACTOR_MAN_SUBMERGED_MINE | A burly grey-haired man (SPRITE_BURLY_MAN_WITH_GREY_HAIR), who wanders. | |
ACTOR_OLD_MAN_DESTROY_MONSTERS | A bent old man with a cane (SPRITE_OLD_MAN_WITH_CANE). | |
ACTOR_WOMAN_WATER_LUCK | A woman in a green dress (SPRITE_WOMAN_IN_GREEN_DRESS). | |
ACTOR_THIRSTY_OLD_WOMAN | An old woman with white hair (SPRITE_OLD_WOMAN). Her script is scAltinTalkToThirstyOldWoman. | |
ACTOR_MAN_WATERS_SUBSIDED | Three villagers come back as the water recedes, one with each drop (scAltinApplyWaterLevel). They are this man with brown hair (SPRITE_YOUNG_MAN_WITH_BROWN_HAIR), then a strong man and an old man. | |
ACTOR_STRONGMAN_GUARDIAN_STATUES | A bald, bare-chested strong man (SPRITE_BALD_MUSCULAR_MAN). | |
ACTOR_OLD_MAN_ROCK_FLUSHED_OUT | A bent old man with a cane (SPRITE_OLD_MAN_WITH_CANE), who wanders. | |
ACTOR_WATER_BEAST | The beast spewing water at the houses until FLAG_ALTIN_WATER_BEAST_LEFT. | |
ACTOR_STONE_STATUE | The stone statue on the top ledge, in front of the passage into the mine that Move uncovers (scAltinCheckStatueMoved). | |
ACTOR_FLOODED_ARMOR_MERCHANT | The armor merchant on the west ledge | |
ACTOR_FLOODED_ITEM_MERCHANT | and the item merchant on the ledge east of the Sanctum, waiting while their shops are under water. | |
ACTOR_FIRST_CRATE | Three crates placed with SPRITE_CRATE. scAltinApplyWaterLevel hides them (SPRITE_COLOR_HIDDEN) but leaves them solid, as placed actors are. They are invisible blocks. One is at the top of the ladder on the east cliff, and two are on the rails below the doorway into the mine. | |
ACTOR_SECOND_CRATE | ||
ACTOR_THIRD_CRATE |
Definition at line 84 of file altin.c.
ALTIN_HOUSE_ACTOR_ID
enum ALTIN_HOUSE_ACTOR_ID
The houses' actors, numbering the rows of CottageRoomsDActorPlacements, named
as the village's are.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_ROOM_ONE_GUEST | ACTOR_FIRST_PLACED | The family sheltering in the inn's Room One until the first drop. They are this man with brown hair (SPRITE_YOUNG_MAN_WITH_BROWN_HAIR) and a woman with fair hair. |
ACTOR_ROOM_ONE_SECOND_GUEST | A woman with fair hair in a white apron (SPRITE_WOMAN_WITH_FAIR_HAIR). | |
ACTOR_ROOM_TWO_GUEST | The family in Room Two, until the second drop. They are this bent old man with a cane (SPRITE_OLD_MAN_WITH_CANE) and an old woman. | |
ACTOR_ROOM_TWO_SECOND_GUEST | An old woman with white hair (SPRITE_OLD_WOMAN). | |
ACTOR_MAN_BACK_IN_HIS_HOMETOWN | A man with brown hair (SPRITE_YOUNG_MAN_WITH_BROWN_HAIR). He and ACTOR_WOMAN_NO_PLACE_LIKE_HOME are the kissing girl's "Mom and Pop", who have been acting weird since the ruins were found. His thoughts won't give up a spot at the end of the mine's easternmost passage, and hers say "My husband's sense for finding treasure has never failed." | |
ACTOR_WOMAN_NO_PLACE_LIKE_HOME | A woman with fair hair in a white apron (SPRITE_WOMAN_WITH_FAIR_HAIR). | |
ACTOR_KISSING_GIRL | A little girl with orange pigtails (SPRITE_GIRL_WITH_PIGTAILS). Her script is scCottageRoomsDAskAboutMonsters. | |
ACTOR_WEAPON_MERCHANT | ||
ACTOR_ITEM_MERCHANT | ||
ACTOR_ARMOR_MERCHANT | ||
ACTOR_INNKEEPER | Opens the inn (scCottageRoomsDTalkToInnkeeper). | |
ACTOR_WOMAN_FORMER_GLORY | A woman with red-brown hair in a white apron | |
ACTOR_COOK | (SPRITE_WOMAN_IN_PINK_APRON). | |
ACTOR_MAN_WAITING_TO_GO_HOME | A man with brown hair (SPRITE_YOUNG_MAN_WITH_BROWN_HAIR) in the inn, telling of its guests going home as the water drops. |
Definition at line 139 of file altin.c.
anonymous enum
enum { FLAG_ALTIN_WATER_DROPPED_ONCE, FLAG_ALTIN_WATER_DROPPED_TWICE, FLAG_ALTIN_WATER_DRAINED }
The village's water level, set on entry from the mine's drain flags.
| Enumerator | Value | Description |
|---|---|---|
FLAG_ALTIN_WATER_DROPPED_ONCE | FLAG_SCENE_TEMP(0x40) | |
FLAG_ALTIN_WATER_DROPPED_TWICE | FLAG_SCENE_TEMP(0x41) | |
FLAG_ALTIN_WATER_DRAINED | FLAG_SCENE_TEMP(0x42) |
Definition at line 183 of file altin.c.
anonymous enum
enum { SHOP_ALTIN_WEAPONS, SHOP_ALTIN_ARMOR, SHOP_ALTIN_ITEMS }
Altin's shops, by their numbers in the shop table.
| Enumerator | Value | Description |
|---|---|---|
SHOP_ALTIN_WEAPONS | 19 | |
SHOP_ALTIN_ARMOR | 20 | |
SHOP_ALTIN_ITEMS | 21 |
Definition at line 191 of file altin.c.
anonymous enum
enum { INN_ID_ALTIN }
Altin's inn, as mnInnCheckIn numbers the inns.
| Enumerator | Value | Description |
|---|---|---|
INN_ID_ALTIN | 6 |
Definition at line 199 of file altin.c.
ALTIN_METATILE_BEHAVIOR
enum ALTIN_METATILE_BEHAVIOR
The metatile behaviors Altin's cues answer. A door's or doorway's is the exit it leaves by.
| Enumerator | Value | Description |
|---|---|---|
METATILE_BEHAVIOR_ALTIN_EAST_ROAD | ALTIN_WORLD_MAP | The road out to |
METATILE_BEHAVIOR_ALTIN_INN_DOOR | ALTIN_COTTAGE_ROOMS_D_INN | the World Map at the east edge. The inn's door, under its sign on the north-west ledge. |
METATILE_BEHAVIOR_ALTIN_SANCTUM_DOOR | ALTIN_SANCTUM | The Sanctum's |
METATILE_BEHAVIOR_ALTIN_EAST_HOUSE_DOOR | ALTIN_COTTAGE_ROOMS_D_EAST_HOUSE | wide double door, in the cliff below the stone statue. The door of the house on the |
METATILE_BEHAVIOR_ALTIN_CLIFF_HOUSE_DOOR | ALTIN_COTTAGE_ROOMS_D_CLIFF_HOUSE | east side, the Room One family's home. The door in the cliff |
METATILE_BEHAVIOR_ALTIN_SOUTH_HOUSE_DOOR | ALTIN_COTTAGE_ROOMS_D_SOUTH_HOUSE | north-west of the armor shop, the Room Two family's home. The door of the house by the |
METATILE_BEHAVIOR_ALTIN_ITEM_SHOP_DOOR | ALTIN_COTTAGE_ROOMS_D_ITEM_SHOP | rails at the south, the kissing girl's home. The |
METATILE_BEHAVIOR_ALTIN_ARMOR_SHOP_DOOR | ALTIN_COTTAGE_ROOMS_D_ARMOR_SHOP | item shop's small door in the east cliff. The door of the armor shop, |
METATILE_BEHAVIOR_ALTIN_WEAPON_SHOP_DOOR | ALTIN_COTTAGE_ROOMS_D_WEAPON_SHOP | the house with a round red sign. The weapon shop's door with a |
METATILE_BEHAVIOR_ALTIN_WEST_MINE_DOORWAY | ALTIN_ALTIN_PEAK_FIRST_WATER_BEAST | sword sign, at the south. The doorway into the mine in |
METATILE_BEHAVIOR_ALTIN_RAIL_TUNNEL | ALTIN_ALTIN_PEAK_SOUTH_ENTRANCE | the west cliff, by the water beast. The |
METATILE_BEHAVIOR_ALTIN_MIDDLE_MINE_DOORWAY | ALTIN_ALTIN_PEAK_JUNCTION | rail tunnel into the mine in the north cliff. The |
METATILE_BEHAVIOR_ALTIN_PASSAGE_BEHIND_STATUE | ALTIN_ALTIN_PEAK_SPRITZ | doorway into the mine in the middle of the village, where the rails run south. The passage behind the stone statue. |
METATILE_BEHAVIOR_ALTIN_NEAR_BEAST | 20 | The ground beside the water beast, on the west edge. |
METATILE_BEHAVIOR_ALTIN_FIRST_DOOR | METATILE_BEHAVIOR_ALTIN_INN_DOOR | The doors are numbered in a row from the inn's. |
Definition at line 206 of file altin.c.
COTTAGE_ROOMS_D_METATILE_BEHAVIOR
enum COTTAGE_ROOMS_D_METATILE_BEHAVIOR
The metatile behaviors of the rooms' barrels, bed, pots and bookcase.
| Enumerator | Value | Description |
|---|---|---|
METATILE_BEHAVIOR_COTTAGE_ROOMS_D_NUT_BARREL | 100 | A barrel in the Room One family's house. |
METATILE_BEHAVIOR_COTTAGE_ROOMS_D_COINS_BARREL | 101 | A barrel in the weapon shop. |
METATILE_BEHAVIOR_COTTAGE_ROOMS_D_SLEEP_BOMB_BED | 102 | A bed upstairs in the inn. |
METATILE_BEHAVIOR_COTTAGE_ROOMS_D_RUSTED_POTS | 200 | The rusted pots in the Room Two family's house. |
METATILE_BEHAVIOR_COTTAGE_ROOMS_D_ROAST_BEEF | 201 | The cook's roast beef in the inn. |
METATILE_BEHAVIOR_COTTAGE_ROOMS_D_SHRIMP | 202 | The cook's shrimp in the inn. |
METATILE_BEHAVIOR_COTTAGE_ROOMS_D_BOOKCASE | 203 | The bookcase in the inn. |
Definition at line 292 of file altin.c.
anonymous enum
enum { DOOR_SANCTUM, DOOR_ARMOR_SHOP }
The doors of the village, by their index in AltinDoors.
| Enumerator | Value | Description |
|---|---|---|
DOOR_SANCTUM | METATILE_BEHAVIOR_ALTIN_SANCTUM_DOOR - METATILE_BEHAVIOR_ALTIN_FIRST_DOOR | The Sanctum's door, which leads to SANCTUM_FROM_ALTIN. |
DOOR_ARMOR_SHOP | METATILE_BEHAVIOR_ALTIN_ARMOR_SHOP_DOOR - METATILE_BEHAVIOR_ALTIN_FIRST_DOOR | The armor shop's door, where Isaac is only lined up with the doorway before the screen fades, not walked into it. |
Definition at line 312 of file altin.c.
Functions in detail
scAltinApplyWaterLevel
static void scAltinApplyWaterLevel(void)
Sets up the village at its water level: that stage's picture and metatiles, the villagers who are home, and the water beast while it is still there.
References fdActorGet(), fdActorReleaseById(), fdActorSetAnimation(), fdActorSetSpriteColorById(), fdActorSetSpriteFlags(), fdActorSetSpritePriority(), fdCameraMoveToFX(), fdMapGridCenterOnFollowedPoint(), fdMapGridCopyMetatileAttributes(), fdMapGridCopyMetatilesTo(), fdQueueMusic(), fdScriptEnd(), fdScriptStart(), gmFlagClear(), gmFlagGet(), MainRoutineStateWork, scAltinBeastSpewWater(), sySetTickEvent() and sySynch().
Referenced by scInit().
Definition at lines 354 and 975 of file altin.c.
scCottageRoomsDPlaceSheltering
static void scCottageRoomsDPlaceSheltering(void)
Sets up the rooms: until the first drop the Room One family shelter in the inn, until the second the Room Two family, and until the village is drained the weapon merchant waits there too.
References fdActorGet() and gmFlagGet().
Referenced by scInit().
Definition at lines 355 and 1067 of file altin.c.
scAltinBeastSpewWater
static void scAltinBeastSpewWater(void)
Event while the water beast spews ("We can't drink the water the monsters
spew!"): every fourth tick a drop of water starts from its spout, living
SPEW_LIFETIME ticks.
References fdActorSelectAnimation(), scAltinDriftSpew(), scAltinInitSpew(), scFieldActorCreate() and TickCount.
Referenced by scAltinApplyWaterLevel() and scAltinScareOffBeast().
Definition at lines 356 and 1154 of file altin.c.
scGetEntrances
const SCENE_ENTRANCE *scGetEntrances(void)
References AltinEntrances, AltinNoEntrances, CottageRoomsDEntrances and MainRoutineStateWork.
Definition at line 358 of file altin.c.
scGetExitRegions
const SCENE_EXIT_REGION *scGetExitRegions(void)
Definition at line 373 of file altin.c.
scGetExits
const Uint32 *scGetExits(void)
Both scenes share one exit table.
References AltinExits.
Definition at line 379 of file altin.c.
scGetActorPlacements
const ACTOR_PLACE *scGetActorPlacements(void)
Some villagers only turn back after talking once the flood is over or their family has gone home.
References AltinActorPlacements, AltinNoActorPlacements, CottageRoomsDActorPlacements, fdAssignViewFlags(), gmFlagGet(), MainRoutineStateWork and Sint32.
Definition at line 386 of file altin.c.
scGetCues
const CUE *scGetCues(void)
References AltinCues, AltinNoCues, CottageRoomsDCues and MainRoutineStateWork.
Definition at line 417 of file altin.c.
scAltinAskAboutFirstVisit
static void scAltinAskAboutFirstVisit(void)
The bald strong man by the east entrance asks whether this is the party's first visit to Altin, and tells how the flood has changed it. Once the hydros statues are beaten he only thanks them.
References fdScriptAskYesNo(), fdScriptAskYesNoWithActorAnimation(), fdScriptEnd(), fdScriptOpenMessage(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptSkipMessages() and fdScriptStart().
Referenced by AltinCues.
Definition at line 435 of file altin.c.
scAltinAskAboutHydros
static void scAltinAskAboutHydros(void)
Once the hydros statues are beaten, the strong man near the east entrance asks whether water gushed out of them when the party slew them.
References fdScriptAskYesNo(), fdScriptEnd(), fdScriptSetMessageId() and fdScriptStart().
Referenced by AltinCues.
Definition at line 462 of file altin.c.
scAltinTalkToThirstyOldWoman
static void scAltinTalkToThirstyOldWoman(void)
The old woman on the west ledge complains that nobody can drink the water the monsters spew. While the water beast is still there, the camera pans south to it spitting water and back before she shakes her head. Once the hydros statues are beaten, she asks instead whether the party defeated the water beasts.
References fdActorFaceDirection(), fdActorGet(), fdActorSetAnimation(), fdActorSetAnimationAndWait(), fdCameraGetActor(), fdCameraMoveToFX(), fdCameraWaitForArrival(), fdScriptAskYesNo(), fdScriptEnd(), fdScriptSetMessageId(), fdScriptShowMessageThenWait(), fdScriptStart(), fdScriptWait() and gmFlagGet().
Referenced by AltinCues.
Definition at line 478 of file altin.c.
scAltinAskAboutRuins
static void scAltinAskAboutRuins(void)
Once the hydros statues are beaten, the old man who wanders the middle of the village, back home since the water drained, asks whether the party really found ancient ruins at the bottom of the mine.
References fdScriptAskYesNo(), fdScriptEnd(), fdScriptSetMessageId() and fdScriptStart().
Referenced by AltinCues.
Definition at line 529 of file altin.c.
scCottageRoomsDAskAboutXianGirl
static void scCottageRoomsDAskAboutXianGirl(void)
Once the hydros statues are beaten, the woman of the Room One family, back in their house on the east side, asks whether the party are the young warriors a girl from Xian was asking about.
References fdScriptAskYesNo(), fdScriptEnd(), fdScriptSetMessageId() and fdScriptStart().
Referenced by CottageRoomsDCues.
Definition at line 543 of file altin.c.
scCottageRoomsDAskAboutWayWest
static void scCottageRoomsDAskAboutWayWest(void)
After the second drop, until the hydros statues are beaten, the old man of the Room Two family, back in their house in the cliff, asks whether the party is finding a way west through the mountains, and says a passage should lead west at the bottom of the mine.
References fdScriptAskYesNo(), fdScriptEnd(), fdScriptSetMessageId() and fdScriptStart().
Referenced by CottageRoomsDCues.
Definition at line 558 of file altin.c.
scCottageRoomsDAskAboutMonsters
static void scCottageRoomsDAskAboutMonsters(void)
Once the hydros statues are beaten, the little girl in the house by the rails asks whether the party defeated the monsters, and thanks Isaac with a kiss either way.
References fdScriptAskYesNo(), fdScriptEnd(), fdScriptSetMessageId() and fdScriptStart().
Referenced by CottageRoomsDCues.
Definition at line 572 of file altin.c.
scCottageRoomsDAskAboutMineBeasts
static void scCottageRoomsDAskAboutMineBeasts(void)
Once the hydros statues are beaten, the man still staying upstairs in the inn asks whether the few beasts left in the mine are deep down.
References fdScriptAskYesNo(), fdScriptEnd(), fdScriptSetMessageId() and fdScriptStart().
Referenced by CottageRoomsDCues.
Definition at line 585 of file altin.c.
scAltinLeaderFacesCounter
static Bool scAltinLeaderFacesCounter(void)
Returns whether Isaac faces north, across a counter.
References fdActorGet().
Referenced by scAltinTalkToArmorMerchant(), scAltinTalkToItemMerchant() and scCottageRoomsDTalkToWeaponMerchant().
Definition at line 597 of file altin.c.
scCottageRoomsDTalkToWeaponMerchant
static void scCottageRoomsDTalkToWeaponMerchant(void)
Until the village is drained, the weapon merchant waits in the inn and only asks whether the party wants weapons. Then he is back in the weapon shop by the sword sign and sells when spoken to across his counter; from the side he is glad to open up shop again, or, once the hydros statues are beaten, tells the party to find the passage west in the mine.
References fdScriptAskYesNo(), fdScriptEnd(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart(), gmFlagGet(), mnShopRun() and scAltinLeaderFacesCounter().
Referenced by CottageRoomsDCues.
Definition at line 613 of file altin.c.
scAltinTalkToArmorMerchant
static void scAltinTalkToArmorMerchant(void)
Until the second drop, the armor merchant waits on the west ledge beside his flooded shop, saying his store is submerged. After it he sells from the counter in the armor shop, the house with the round red sign, when spoken to across it; from the side he is glad to sell armor again, or, once the hydros statues are beaten, asks if the party isn't impressed by his selection.
References fdScriptEnd(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart(), gmFlagGet(), mnShopRun() and scAltinLeaderFacesCounter().
Referenced by AltinCues and CottageRoomsDCues.
Definition at line 649 of file altin.c.
scAltinTalkToItemMerchant
static void scAltinTalkToItemMerchant(void)
Until the first drop, the item merchant waits on the ledge east of the Sanctum, afraid her goods are soaked. After it she sells from the counter in the item shop, behind the small door in the east cliff, when spoken to across it; from the side she says none of her goods were damaged, or, once the hydros statues are beaten, that the girl from Xian bought a lot.
References fdScriptEnd(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart(), gmFlagGet(), mnShopRun() and scAltinLeaderFacesCounter().
Referenced by AltinCues and CottageRoomsDCues.
Definition at line 682 of file altin.c.
scCottageRoomsDTalkToInnkeeper
static void scCottageRoomsDTalkToInnkeeper(void)
The innkeeper lets the party stay when spoken to across his counter. From the side he says they got a little damp but are doing okay, or, once the hydros statues are beaten, points them to a small temple west of the mine.
References fdActorGet(), fdScriptAskYesNo(), fdScriptEnd(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart(), gmFlagGet() and mnInnCheckIn().
Referenced by CottageRoomsDCues.
Definition at line 713 of file altin.c.
scAltinEnterDoor
static void scAltinEnterDoor(void)
Walking north into one of the village's doors opens it, and Isaac walks in as the screen fades: the inn's under its sign (metatile (10, 13)), the Sanctum's wide double door, which slides open (metatiles (20, 12) and (21, 12)), the item shop's in the east cliff (metatile (28, 13)), the armor shop's (metatile (11, 25)), the weapon shop's (metatile (10, 27)), and the three houses': on the east side (metatile (26, 21)), in the cliff north-west of the armor shop (metatile (8, 19)), and by the rails at the south (metatile (17, 25)).
References AltinDoors, fdActorCenterAndWalk(), fdActorGet(), fdActorSetAnimation(), fdActorSetDestinationOffset(), fdActorSetSpritePriority(), fdMapGridAnimateMetatiles(), fdMapGridCopyMetatilesTo(), fdScriptEnd(), fdScriptFinishScreenTransition(), fdScriptStart(), fdScriptWait(), fdScriptWaitTransitionTicks(), Sint32, state, syImportScriptSetExitRequest() and sySoundPlay().
Referenced by AltinCues.
Definition at line 748 of file altin.c.
scAltinWalkIntoMine
static void scAltinWalkIntoMine(void)
Walking north into one of the three doorways down into the mine plays the exit sound, and Isaac walks into the dark: the rail tunnel in the north cliff (metatile (16, 13)), the doorway in the middle of the village where the rails run south (metatile (20, 16)), or the one in the west cliff by the water beast (metatile (1, 28)).
References fdActorCenterAndWalk(), fdActorGet(), fdScriptEnd(), fdScriptFinishScreenTransition(), fdScriptStart(), fdScriptWaitTransitionTicks(), state, syImportScriptSetExitRequest() and sySoundPlay().
Referenced by AltinCues.
Definition at line 833 of file altin.c.
scAltinBeastHop
static void scAltinBeastHop(ACTOR *actor)
The water beast's update function as it flees: it leaps every
WATER_BEAST_HOP_PERIOD ticks with SE_JUMP, and lands with a splash that
shakes the screen for a few ticks.
References fdActorSelectAnimation() and sySoundPlay().
Referenced by scAltinBeastHopAway().
Definition at line 851 of file altin.c.
scAltinBeastHopAway
static void scAltinBeastHopAway(void)
The water beast hops along the shore into the mine doorway in the west cliff (metatile (1, 28)) and is gone with a splash.
References fdActorGet(), fdActorMoveToAndWait(), fdActorReleaseById(), fdActorSetAnimation(), fdScriptWait(), scAltinBeastHop() and sySoundPlay().
Referenced by scAltinScareOffBeast().
Definition at line 898 of file altin.c.
scAltinCheckStatueMoved
static void scAltinCheckStatueMoved(void)
Move on the stone statue on the top ledge shifts it one metatile east (to
metatile (22, 10)), uncovering the passage into the mine behind it. The game
remembers whether it now stands there (FLAG_ALTIN_STATUE_MOVED), so it is
still moved when the party comes back.
References fdActorGet(), gmFlagClear() and gmFlagSet().
Referenced by AltinCues.
Definition at line 923 of file altin.c.
scInit
Sint32 scInit(void)
Sets up the scene being entered, at the village's water level. It works out the water level from the mine's drain flags first. Returns 0.
References gmFlagGet(), gmFlagSet(), MainRoutineStateWork, scAltinApplyWaterLevel(), scCottageRoomsDPlaceSheltering() and Sint32.
Definition at line 939 of file altin.c.
scAltinInitSpew
static void scAltinInitSpew(ACTOR *drop)
Gives a new drop of spray its look: drawn in front, its red and blue swapped, and small.
References fdActorSetSpriteColor() and fdActorSetSpriteFlags().
Referenced by scAltinBeastSpewWater().
Definition at line 1107 of file altin.c.
scAltinDriftSpew
static void scAltinDriftSpew(ACTOR *drop)
A drop of spray's update function, through its SPEW_LIFETIME ticks: it drifts
east, slowing as it goes, with a random wobble, and moves two pixels a tick
down the screen as it grows; in its last ticks it spreads flat and rises a
little as it splashes. It flashes white the more often the nearer its end,
and is released.
References fdActorRelease(), fdActorSetSpriteColor() and Sint32.
Referenced by scAltinBeastSpewWater().
Definition at line 1122 of file altin.c.
scAltinScareOffBeast
static void scAltinScareOffBeast(void)
Walking down the west ledge to the ground above the water beast (metatile (4, 26)) startles it: the camera goes to it, it stops spitting water, cries out, and hops away into the mine doorway beside it with a splash, for good. The old woman on the ledge shakes her head.
References fdActorFaceActor(), fdActorFaceDirection(), fdActorRunRepeatedMotion(), fdActorSetAnimation(), fdActorSetAnimationAndWait(), fdCameraFollowActor(), fdCameraWaitForArrival(), fdQueueMusic(), fdScriptEnd(), fdScriptStart(), fdScriptWait(), gmFlagSet(), scAltinBeastHopAway(), scAltinBeastSpewWater(), syCloseEvent() and sySoundPlay().
Referenced by AltinCues.
Definition at line 1177 of file altin.c.
Variables in detail
AltinNoEntrances
extern SCENE_ENTRANCE AltinNoEntrances[]
SCENE_ENTRANCE AltinNoEntrances[]
Referenced by scGetEntrances().
Definition at lines 60 and 1240 of file altin.c.
AltinEntrances
extern SCENE_ENTRANCE AltinEntrances[]
SCENE_ENTRANCE AltinEntrances[]
Referenced by scGetEntrances().
Definition at lines 61 and 1245 of file altin.c.
CottageRoomsDEntrances
extern SCENE_ENTRANCE CottageRoomsDEntrances[]
SCENE_ENTRANCE CottageRoomsDEntrances[]
Referenced by scGetEntrances().
Definition at lines 62 and 1367 of file altin.c.
AltinExits
extern Uint32 AltinExits[]
Uint32 AltinExits[]
Referenced by scGetExits().
Definition at lines 63 and 1435 of file altin.c.
AltinNoActorPlacements
extern ACTOR_PLACE AltinNoActorPlacements[]
ACTOR_PLACE AltinNoActorPlacements[]
Referenced by scGetActorPlacements().
Definition at lines 64 and 1499 of file altin.c.
AltinActorPlacements
extern ACTOR_PLACE AltinActorPlacements[]
ACTOR_PLACE AltinActorPlacements[]
Referenced by scGetActorPlacements().
Definition at lines 65 and 1503 of file altin.c.
CottageRoomsDActorPlacements
extern ACTOR_PLACE CottageRoomsDActorPlacements[]
ACTOR_PLACE CottageRoomsDActorPlacements[]
References CottageRoomsDCookScript and Sint32.
Referenced by scGetActorPlacements().
Definition at lines 66 and 1661 of file altin.c.
AltinNoCues
extern CUE AltinNoCues[]
CUE AltinNoCues[]
Referenced by scGetCues().
Definition at lines 67 and 1693 of file altin.c.
AltinCues
extern CUE AltinCues[]
CUE AltinCues[]
References scAltinAskAboutFirstVisit(), scAltinAskAboutHydros(), scAltinAskAboutRuins(), scAltinCheckStatueMoved(), scAltinEnterDoor(), scAltinScareOffBeast(), scAltinTalkToArmorMerchant(), scAltinTalkToItemMerchant(), scAltinTalkToThirstyOldWoman() and scAltinWalkIntoMine().
Referenced by scGetCues().
Definition at lines 68 and 1697 of file altin.c.
CottageRoomsDCues
extern CUE CottageRoomsDCues[]
CUE CottageRoomsDCues[]
References scAltinTalkToArmorMerchant(), scAltinTalkToItemMerchant(), scCottageRoomsDAskAboutMineBeasts(), scCottageRoomsDAskAboutMonsters(), scCottageRoomsDAskAboutWayWest(), scCottageRoomsDAskAboutXianGirl(), scCottageRoomsDTalkToInnkeeper() and scCottageRoomsDTalkToWeaponMerchant().
Referenced by scGetCues().
Definition at lines 69 and 1813 of file altin.c.
AltinDoors
extern MAP_EDIT AltinDoors[]
MAP_EDIT AltinDoors[]
Each door's opening pictures and the metatile they are drawn at, in the order of the doors' metatile behaviors from the inn's. The doors are drawn on map layer 1, whose metatiles begin at the map's column 32: the inn's (41, 5) is that layer's (9, 5), on the inn's door just above the ground metatile (10, 13) Isaac walks into.
References AltinArmorShopDoorMetatiles, AltinCliffHouseAndWeaponShopDoorMetatiles, AltinEastHouseDoorMetatiles, AltinInnDoorMetatiles, AltinItemShopDoorMetatiles, AltinSanctumDoorMetatiles and AltinSouthHouseDoorMetatiles.
Referenced by scAltinEnterDoor().
Definition at lines 70 and 2015 of file altin.c.
CottageRoomsDCookScript
Sint32 CottageRoomsDCookScript[]
The cook from Xian paces between his pots, nodding over each.
References Sint32.
Referenced by CottageRoomsDActorPlacements.
Definition at line 1206 of file altin.c.
AltinSanctumDoorMetatiles
Uint16 AltinSanctumDoorMetatiles[]
The opening pictures of the village's doors, two metatiles square. The
Sanctum's door (the second) is wider, and scAltinEnterDoor redraws it by hand
instead.
Referenced by AltinDoors.
Definition at line 1972 of file altin.c.
AltinInnDoorMetatiles
Uint16 AltinInnDoorMetatiles[]
Referenced by AltinDoors.
Definition at line 1979 of file altin.c.
AltinItemShopDoorMetatiles
Uint16 AltinItemShopDoorMetatiles[]
Referenced by AltinDoors.
Definition at line 1984 of file altin.c.
AltinArmorShopDoorMetatiles
Uint16 AltinArmorShopDoorMetatiles[]
Referenced by AltinDoors.
Definition at line 1989 of file altin.c.
AltinEastHouseDoorMetatiles
Uint16 AltinEastHouseDoorMetatiles[]
Referenced by AltinDoors.
Definition at line 1994 of file altin.c.
AltinCliffHouseAndWeaponShopDoorMetatiles
Uint16 AltinCliffHouseAndWeaponShopDoorMetatiles[]
Referenced by AltinDoors.
Definition at line 1999 of file altin.c.
AltinSouthHouseDoorMetatiles
Uint16 AltinSouthHouseDoorMetatiles[]
Referenced by AltinDoors.
Definition at line 2004 of file altin.c.