Alchemy

imil.c

Imil, in two maps: the town and its interiors.

games/tbs/src/scene/imil.c on GitHub

Imil, in two maps: the town and its interiors. The townspeople are sick until the epidemic is cured (flag 0x881); Mia heals the old man, and the cold villager waits for her.

Functions

Imil_UpdateShiver

static s32 Imil_UpdateShiver(struct ScriptInterpreter *interpreter)

A sick person shivers: a quick squash, then a pause, longer for the old man.

Used by gImil_ShiverScript.

Line 97

Imil_GetEntrances

const struct SceneEntrance *Imil_GetEntrances(void)

Imil is two maps: the town and its interiors.

Line 129

Imil_GetPlacements

const struct ScenePlacement *Imil_GetPlacements(void)

Once the epidemic is cured (flag 0x881), the townspeople are well again and the old man is up and about.

Line 142

Imil_StartIceSlide

static void Imil_StartIceSlide(void)

Stepping onto the ice starts a slide.

Used by gImil_TownEvents.

Line 166

Imil_GetEvents

const struct SceneEvent *Imil_GetEvents(void)

The town's or the interiors' conversations and Psynergy targets.

Line 169

Imil_TalkToColdVillager

static void Imil_TalkToColdVillager(void)

The cold villager sneezes and shivers, waiting for Mia; once she travels with the party (flag 3), he says that even her healing can't help them all.

Used by gImil_TownEvents.

Line 178

Imil_ReadColdVillagerMind

static void Imil_ReadColdVillagerMind(void)

Mind Read on the cold villager: Mia should be here by now, or, once she has joined the party, he can't understand why she left.

Used by gImil_TownEvents.

Line 195

Imil_GreetVisitor

static void Imil_GreetVisitor(void)

A villager turns to the leader and asks whether he is new in Imil.

Used by gImil_TownEvents.

Line 207

Imil_TalkToCountingChild

static void Imil_TalkToCountingChild(void)

The counting child stops, turns to the leader and goes back to counting.

Used by gImil_TownEvents.

Line 217

Imil_TalkToOldMan

static void Imil_TalkToOldMan(void)

The old man moans for help until the old woman hurries to fetch Mia; after Mia's healing he feels much better, and once the town is cured he asks whether the party really thought he would die.

Used by Imil_TalkToOldManInBed, gImil_InteriorEvents.

Line 252

Imil_AskAboutWeapons

static void Imil_AskAboutWeapons(void)

Once the epidemic is cured, the weapon merchant asks whether the party wants weapons.

Used by gImil_InteriorEvents.

Line 308

Imil_AskAboutRestaurantMenu

static void Imil_AskAboutRestaurantMenu(void)

Once the epidemic is cured, the restaurant owner offers the menu.

Used by gImil_InteriorEvents.

Line 316

Imil_TalkToSecondApprentice

static void Imil_TalkToSecondApprentice(void)

Mia's second apprentice asks whether the party has visited the old couple, where Mia went; once Mia has joined, she says everyone counts on her.

Used by gImil_InteriorEvents.

Line 325

Imil_ReadSecondApprenticeMind

static void Imil_ReadSecondApprenticeMind(void)

Mind Read on the second apprentice: Mia had a bad feeling, or, once she has joined, they must help her.

Used by gImil_InteriorEvents.

Line 341

Imil_TalkToOldWoman

static void Imil_TalkToOldWoman(void)

Once the epidemic is cured, the old woman asks what happened at the lighthouse.

Used by gImil_InteriorEvents.

Line 354

Imil_ReadOldWomanMind

static void Imil_ReadOldWomanMind(void)

Mind Read on the old woman: about Mia's clan, her husband's exaggerating, or Mia running all over town.

Used by gImil_InteriorEvents.

Line 364

Imil_TalkToOldManInBed

static void Imil_TalkToOldManInBed(void)

After Mia's visit, speaking across the bed reaches the old man.

Used by gImil_InteriorEvents.

Line 378

Imil_ReadCountingChildMind

static void Imil_ReadCountingChildMind(void)

Mind Read on the counting child: admiration for Mia.

Used by gImil_InteriorEvents.

Line 381

Imil_ReadApprenticeMind

static void Imil_ReadApprenticeMind(void)

Mind Read on Mia's apprentice: she will do her best, or, once Mia has joined, she feels grown up.

Used by gImil_InteriorEvents.

Line 390

Imil_OpenDoorAndExit

static void Imil_OpenDoorAndExit(void)

Walking north into a door, everyone stops, the door opens and the leader walks in; door 6 has its own sound and a slower walk.

Used by gImil_TownEvents.

Line 403

Imil_TalkToWeaponMerchant

static void Imil_TalkToWeaponMerchant(void)

Across the counter, the leader facing north, the weapon shop opens once the town is cured; before, the sick merchant says the shop is closed.

Used by gImil_InteriorEvents.

Line 447

Imil_TalkToArmorMerchant

static void Imil_TalkToArmorMerchant(void)

Across the counter, the leader facing north, the armor shop opens once the town is cured; before, the merchant is too sick for business.

Used by gImil_InteriorEvents.

Line 482

Imil_TalkToItemMerchant

static void Imil_TalkToItemMerchant(void)

The item shop: once the town is cured the mother sells again; before, her child minds the counter while she is sick, or talks of the lumberjack father.

Used by gImil_InteriorEvents.

Line 518

Imil_TalkToInnkeeper

static void Imil_TalkToInnkeeper(void)

Across the counter, the leader facing north, the inn opens; otherwise the innkeeper talks of the two groups of travellers, or of the party's leaving.

Used by gImil_InteriorEvents.

Line 555

Imil_TalkToApprentice

static void Imil_TalkToApprentice(void)

Across the counter, the leader facing north, Mia's apprentice offers the sanctum, the first time saying she can act as healer; otherwise she talks of Mia.

Used by gImil_InteriorEvents.

Line 579

Imil_Initialize

s32 Imil_Initialize(void)

The town gets its rising effects, map layers and snowman, and the first arrival walks in; each interior restores its people for the town's state.

Line 611

Imil_MeetMiaAtOldCouplesHouse

static void Imil_MeetMiaAtOldCouplesHouse(void)

After hearing where Mia went, the party finds her at the old couple's house. She heals the old man with Ply when the Mercury Lighthouse flashes; Mia runs out and the party follows her.

Used by Imil_Initialize.

Line 736

Imil_UpdateCountdownArc

UNUSED static void Imil_UpdateCountdownArc(struct FieldActor *actor)

Moves an unused effect around its stored origin until its timer expires.

Line 907

Imil_SwayAndSpark

UNUSED static void Imil_SwayAndSpark(struct FieldActor *actor)

Sways an unused actor and occasionally emits a rising spark.

Line 933

Imil_OldManBobsAndSpeaks

static void Imil_OldManBobsAndSpeaks(void)

The old man bobs and speaks as the healing reaches him.

Used by Imil_MiaCastsPlyOnOldMan.

Line 962

Imil_InitializeRisingEffect

static void Imil_InitializeRisingEffect(struct FieldActor *work)

Resets a rising effect's motion, sprite priority, and initial scale.

Used by Imil_StartRisingEffect.

Line 981

Imil_UpdateRisingEffect

static void Imil_UpdateRisingEffect(union FieldObject *object)

Moves and enlarges an ambient effect, then releases it when its timer expires.

Used by Imil_StartRisingEffect.

Line 1000

Imil_StartRisingEffect

static inline void Imil_StartRisingEffect(union FieldObject *object)

Initializes a newly created ambient effect for its one-second rise.

Used by Imil_SpawnAmbientEffects.

Line 1012

Imil_SpawnAmbientEffects

static void Imil_SpawnAmbientEffects(void)

Effects rise at five places in the town, staggered over each second.

Used by Imil_Initialize.

Line 1022

Imil_UpdateMapLayerByLeaderPosition

static void Imil_UpdateMapLayerByLeaderPosition(void)

The leader walks on map layer 0 near the middle of town and on layer 1 elsewhere.

Used by Imil_Initialize.

Line 1058

Imil_MoveSnowmanToChimney

static void Imil_MoveSnowmanToChimney(void)

Moved onto the chimney, the snowman stays there and blocks its cell.

Used by Imil_Initialize, gImil_TownEvents.

Line 1100

Imil_LeaveNorth

static void Imil_LeaveNorth(void)

Walking into the north path, the leader faces north and leaves the town.

Used by gImil_TownEvents.

Line 1125

Imil_ShowFirstArrival

static void Imil_ShowFirstArrival(void)

Arriving for the first time, the leader walks into town.

Used by Imil_Initialize.

Line 1138

Imil_MiaSaysFarewellToApprentices

static void Imil_MiaSaysFarewellToApprentices(void)

Once the town is cured, Mia says farewell to her two apprentices in the sanctum before leaving with the party.

Used by Imil_Initialize.

Line 1148

Imil_TurnSlidingActor

static void Imil_TurnSlidingActor(union FieldObject *object)

While sliding, the leader turns toward the held direction.

Used by Imil_RunIceSlide.

Line 1302

Imil_RunIceSlide

static void Imil_RunIceSlide(void)

The leader slides along the ice until something stops him.

Used by Imil_StartIceSlide.

Line 1338

Also, functions without a comment: Imil_GetRegions, Imil_GetExits, Imil_MiaCastsPlyOnOldMan.

Enumerations

ImilActor

enum ImilActor

Imil's two maps share actor numbers; each is named on the map it is proved.

Value=
ACTOR_COLD_VILLAGER8shivering and sneezing in the snow
ACTOR_GREETER9
ACTOR_COUNTING_CHILD10
ACTOR_SNOWMAN11
ACTOR_OLD_WOMAN8the old couple's house
ACTOR_OLD_MAN9
ACTOR_WEAPON_MERCHANT12
ACTOR_ARMOR_MERCHANT13
ACTOR_ITEM_SHOP_CHILD14minds the shop while the mother is sick
ACTOR_ITEM_MERCHANT15
ACTOR_INNKEEPER16
ACTOR_RESTAURANT_OWNER18
ACTOR_APPRENTICE19Mia's apprentices, the first in the sanctum
ACTOR_SECOND_APPRENTICE20

Line 50

ImilTownFlag

enum ImilTownFlag

The town's own flags, kept while the party is there.

Value=
FLAG_IMIL_MAP_LAYER_0FLAG_SCENE_TEMP_00Which map layer the leader walks on, from where he stands.
FLAG_IMIL_MAP_LAYER_1FLAG_SCENE_TEMP_01
FLAG_IMIL_SNOWMAN_ON_CHIMNEYFLAG_SCENE_TEMP_03

Line 70

Macros, without a comment: IMIL_OPEN_SHOP, IMIL_OPEN_SHOP.

Globals

gImil_ArcOrigin

extern s32 gImil_ArcOrigin[]

The position (x, y, z) the unused arc and sway effects move around.

Used by Imil_SwayAndSpark, Imil_UpdateCountdownArc.

Line 94

gImil_DoorCellPoints

s16 gImil_DoorCellPoints[][2]

Cell position (x, y) for each exit.

Used by Imil_OpenDoorAndExit.

Line 1805

Also, globals without a comment: gImil_KeyHeadings, gImil_SwayHeadings, gImil_ColdVillagerScript, gImil_ShiverScript, gImil_CaretakerHurryScript, gImil_LeaderStepAsideScript, gImil_BobScript, gImil_SparkScript, gImil_MiaCheckRoomScript, gImil_MiaRunOutScript, gImil_FaceTargetScript, gImil_FollowMiaOutScript, gImil_TownEntrances, gImil_InteriorEntrances, gImil_Exits, gImil_TownPlacements, gImil_TownPlacementsCured, gImil_InteriorPlacements, gImil_TownEvents, gImil_InteriorEvents, gImil_DoorCellSteps5, gImil_DoorCellSteps4, gImil_DoorCellSteps1, gImil_DoorCellSteps0, gImil_DoorCellSteps2, gImil_DoorCellSteps3, gImil_DoorCellSteps, gImil_CellStepsA, gImil_CellStepsB, gImil_ArcOrigin.

On this page