Alchemy
Loading...
Searching...
No Matches

mccoy_palace.c File Reference

Lord McCoy's palace in Bilibin. More...

Go to the source code of this file.

Data Structures

struct  PalacePlacementTalkFacingView
 The talkFacing bytes of placement rows 6 to 9: actors 14 to 17. More...

Enumerations

enum  {
  ACTOR_KOLIMA_ASKER = 10 , ACTOR_STARTLED_RESIDENT = 14 , ACTOR_PARTY_ADMIRER = 15 , ACTOR_KOLIMA_WATCHER = 16 ,
  ACTOR_REWARD_KEEPER = 17 , ACTOR_LORD_MCCOY = 18 , ACTOR_ESCORT = 19 , ACTOR_BARRICADE_KEY = 20 ,
  ACTOR_VIAL_CHEST = 21 , ACTOR_POTION_CHEST = 22 , ACTOR_PSY_CRYSTAL_CHEST = 23 , ACTOR_WATER_OF_LIFE_CHEST = 24
}
 The palace's people and the reward room's chests. More...

Functions

static void McCoyPalace_ClaimReward (s32 chestActorId, s32 itemId, s32 chestFlag)
 The chest opens and gives its item; with no room for it, the chest closes again and the reward is still to choose.
static void Event_AudienceWithMcCoy (void)
 The first audience: the escort announces the party and McCoy asks them to lift Kolima's curse.
static void Event_EscortHintsAtBarricade (void)
 At the front door after the audience: McCoy's escort is sorry the party was rejected, asks them not to go to Kolima and lets slip that the barricade may not need a key.
static void Event_McCoyRewardsParty (void)
 Brought in after lifting Kolima's curse: McCoy thanks the party and sends them to choose a reward.
static void Event_PresentRewardChests (void)
 In the reward room: the escort shows the four chests and the keeper explains that only one may be chosen.
const struct SceneEntrance * Scene_GetEntrances (void)
const struct SceneRegion * Scene_GetRegions (void)
const u32 * Scene_GetExits (void)
 Both scenes share one exit table.
const struct ScenePlacement * Scene_GetPlacements (void)
 The palace's people.
const struct SceneEvent * Scene_GetEvents (void)
 What the party can talk to and search in the palace.
static void Event_AskAboutGoingToKolima (void)
 Asks about going to Kolima. "Oh, are you willing to go to Kolima Forest?".
static void Event_TalkToStartledResident (void)
 The resident in a nightgown screams, then turns to the party. "AAAAH!!!".
static void Event_TalkToAdmirer (void)
 The admirer praises the party the first time, then warns of the holy tree.
static void Event_TalkToKolimaWatcher (void)
 The watcher saw the party go to Kolima.
static void Event_TalkToRewardKeeper (void)
 The keeper of McCoy's treasures: while the party chooses, only one item; after, the reward was the greatest; before, Bilibin's great treasures go to whoever ends the curse.
static void Event_ReadAdmirersThoughts (void)
 Mind Read on the admirer shows two thoughts.
static void Event_ReadRewardKeepersThoughts (void)
static void Event_WalkThroughDoor (void)
 Walking through one of the palace's doors: it opens with a sound, the leader walks through and the next room loads.
static void McCoyPalace_ShowChestEmpty (void)
 The chest is empty. "Isaac checked the chest... but it was empty.".
static void McCoyPalace_ShowChestLocked (void)
 The chest is locked. "The treasure chest is locked.".
static void McCoyPalace_ShowUnavailableChest (s32 chestFlag)
 Searching a reward chest after the reward: the chosen one is empty, the others locked.
static void Event_SearchVialChest (void)
 Searching the first reward chest: a Vial, while no reward is taken.
static void Event_SearchPotionChest (void)
 Searching the second reward chest: a Potion, while no reward is taken.
static void Event_SearchPsyCrystalChest (void)
 Searching the third reward chest: a Psy Crystal, while no reward is taken.
static void Event_SearchWaterOfLifeChest (void)
 Searching the fourth reward chest: a Water of Life, while no reward is taken.
static void Event_EscortAsksPartyToChoose (void)
 Leaving the reward room without a reward: the escort walks the leader back.
static void Event_EscortSeesPartyOff (void)
 Leaving the reward room with a reward: the escort leaves.
static __inline__ void McCoyPalace_PositionRewardChests (void)
 The four reward chests stand in a row.
static __inline__ void McCoyPalace_OpenRewardChestRow (void)
 The cells before the chest row can be walked on.
s32 Scene_Initialize (void)
 Sets the palace up: McCoy's first audience, the escort at the door after it, the reward audience once Kolima's curse is lifted, or the reward chests where the party left them.
static __inline__ void McCoyPalace_PrepareCompanionApproach (void)
 Garet, Ivan and Mia get ready to walk up to McCoy.
static void McCoyPalace_FaceCompanionsForDiscussion (void)
 Garet, Ivan and Mia turn to talk among themselves.
static void McCoyPalace_FaceCompanionsForAudience (void)
 Garet, Ivan and Mia face McCoy again.

Variables

s32 gPalace_FacingActions []
s32 gPalace_PacingActions []
struct SceneEntrance gMcCoyPalaceEntrances []
u32 gMcCoyPalaceExits []
struct ScenePlacement gMcCoyPalacePlacementsOther []
struct ScenePlacement gMcCoyPalacePlacements []
struct SceneEvent gMcCoyPalaceEventsOther []
struct SceneEvent gMcCoyPalaceEvents []

Detailed Description

Lord McCoy's palace in Bilibin.

At the first audience McCoy asks the party to lift the curse on Kolima, then turns them away as too young; once the curse is lifted, his guards bring them back and he rewards them with one of four treasures.

Scene flags: FLAG_SCENE_TEMP_00, the escort has opened the front door; FLAG_SCENE_TEMP_02, the party is choosing its reward; FLAG_SCENE_TEMP_10 to _13, the chest it chose. The flags from 0x300 are reused from place to place: 0x302 and 0x303, the admirer has spoken or been read once; 0x321, McCoy has turned the party away; 0x322, the reward is still to choose; 0x333, the reward visit is over. McCoy speaks as SPEAKER_PORTRAIT_RIGHT | ACTOR_LORD_MCCOY, a speaker bit field_event.h does not name yet.

Definition in file mccoy_palace.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

The palace's people and the reward room's chests.

Enumerator
ACTOR_KOLIMA_ASKER 
ACTOR_STARTLED_RESIDENT 
ACTOR_PARTY_ADMIRER 
ACTOR_KOLIMA_WATCHER 
ACTOR_REWARD_KEEPER 
ACTOR_LORD_MCCOY 
ACTOR_ESCORT 
ACTOR_BARRICADE_KEY 
ACTOR_VIAL_CHEST 
ACTOR_POTION_CHEST 
ACTOR_PSY_CRYSTAL_CHEST 
ACTOR_WATER_OF_LIFE_CHEST 

Definition at line 47 of file mccoy_palace.c.

Function Documentation

◆ McCoyPalace_ClaimReward()

void McCoyPalace_ClaimReward ( s32 chestActorId,
s32 itemId,
s32 chestFlag )
static

The chest opens and gives its item; with no room for it, the chest closes again and the reward is still to choose.

Definition at line 332 of file mccoy_palace.c.

Referenced by Event_SearchPotionChest(), Event_SearchPsyCrystalChest(), Event_SearchVialChest(), Event_SearchWaterOfLifeChest(), and McCoyPalace_ClaimReward().

◆ Event_AudienceWithMcCoy()

void Event_AudienceWithMcCoy ( void )
static

The first audience: the escort announces the party and McCoy asks them to lift Kolima's curse.

Refusing, he calls them too young and they leave; coming back, they may change their minds. Accepting, McCoy gives the key to the barricades, Garet bristles at being called children, and McCoy takes the key back.

Definition at line 506 of file mccoy_palace.c.

Referenced by Event_AudienceWithMcCoy(), and Scene_Initialize().

◆ Event_EscortHintsAtBarricade()

void Event_EscortHintsAtBarricade ( void )
static

At the front door after the audience: McCoy's escort is sorry the party was rejected, asks them not to go to Kolima and lets slip that the barricade may not need a key.

Definition at line 948 of file mccoy_palace.c.

Referenced by Event_EscortHintsAtBarricade(), and Scene_Initialize().

◆ Event_McCoyRewardsParty()

void Event_McCoyRewardsParty ( void )
static

Brought in after lifting Kolima's curse: McCoy thanks the party and sends them to choose a reward.

Definition at line 1013 of file mccoy_palace.c.

Referenced by Event_McCoyRewardsParty(), and Scene_Initialize().

◆ Event_PresentRewardChests()

void Event_PresentRewardChests ( void )
static

In the reward room: the escort shows the four chests and the keeper explains that only one may be chosen.

Definition at line 1287 of file mccoy_palace.c.

Referenced by Event_PresentRewardChests(), and Scene_Initialize().

◆ Scene_GetEntrances()

const struct SceneEntrance * Scene_GetEntrances ( void )

Definition at line 84 of file mccoy_palace.c.

◆ Scene_GetRegions()

const struct SceneRegion * Scene_GetRegions ( void )

Definition at line 88 of file mccoy_palace.c.

◆ Scene_GetExits()

const u32 * Scene_GetExits ( void )

Both scenes share one exit table.

Definition at line 90 of file mccoy_palace.c.

◆ Scene_GetPlacements()

const struct ScenePlacement * Scene_GetPlacements ( void )

The palace's people.

Once the reward is taken, the startled resident, the admirer, the Kolima watcher and the reward keeper turn differently when talked to.

Definition at line 95 of file mccoy_palace.c.

◆ Scene_GetEvents()

const struct SceneEvent * Scene_GetEvents ( void )

What the party can talk to and search in the palace.

Definition at line 121 of file mccoy_palace.c.

◆ Event_AskAboutGoingToKolima()

void Event_AskAboutGoingToKolima ( void )
static

Asks about going to Kolima. "Oh, are you willing to go to Kolima Forest?".

Definition at line 129 of file mccoy_palace.c.

Referenced by Event_AskAboutGoingToKolima().

◆ Event_TalkToStartledResident()

void Event_TalkToStartledResident ( void )
static

The resident in a nightgown screams, then turns to the party. "AAAAH!!!".

Definition at line 137 of file mccoy_palace.c.

◆ Event_TalkToAdmirer()

void Event_TalkToAdmirer ( void )
static

The admirer praises the party the first time, then warns of the holy tree.

"You are a fine warrior." After, "It's very reckless for such young warriors to face the holy tree..."

Definition at line 155 of file mccoy_palace.c.

Referenced by Event_TalkToAdmirer().

◆ Event_TalkToKolimaWatcher()

void Event_TalkToKolimaWatcher ( void )
static

The watcher saw the party go to Kolima.

"I was watching from here. After all that fuss, you still went to Kolima?"

Definition at line 168 of file mccoy_palace.c.

Referenced by Event_TalkToKolimaWatcher().

◆ Event_TalkToRewardKeeper()

void Event_TalkToRewardKeeper ( void )
static

The keeper of McCoy's treasures: while the party chooses, only one item; after, the reward was the greatest; before, Bilibin's great treasures go to whoever ends the curse.

Definition at line 178 of file mccoy_palace.c.

Referenced by Event_TalkToRewardKeeper().

◆ Event_ReadAdmirersThoughts()

void Event_ReadAdmirersThoughts ( void )
static

Mind Read on the admirer shows two thoughts.

"Sometimes, we need children to remind us of our own responsibilities." Then "You looked very courageous walking toward Kolima."

Definition at line 199 of file mccoy_palace.c.

Referenced by Event_ReadAdmirersThoughts().

◆ Event_ReadRewardKeepersThoughts()

void Event_ReadRewardKeepersThoughts ( void )
static

Definition at line 210 of file mccoy_palace.c.

Referenced by Event_ReadRewardKeepersThoughts().

◆ Event_WalkThroughDoor()

void Event_WalkThroughDoor ( void )
static

Walking through one of the palace's doors: it opens with a sound, the leader walks through and the next room loads.

The front door makes no sound once the escort has opened it.

Definition at line 231 of file mccoy_palace.c.

Referenced by Event_WalkThroughDoor().

◆ McCoyPalace_ShowChestEmpty()

void McCoyPalace_ShowChestEmpty ( void )
static

The chest is empty. "Isaac checked the chest... but it was empty.".

Definition at line 266 of file mccoy_palace.c.

Referenced by McCoyPalace_ShowChestEmpty(), and McCoyPalace_ShowUnavailableChest().

◆ McCoyPalace_ShowChestLocked()

void McCoyPalace_ShowChestLocked ( void )
static

The chest is locked. "The treasure chest is locked.".

Definition at line 273 of file mccoy_palace.c.

Referenced by McCoyPalace_ShowChestLocked(), and McCoyPalace_ShowUnavailableChest().

◆ McCoyPalace_ShowUnavailableChest()

void McCoyPalace_ShowUnavailableChest ( s32 chestFlag)
static

Searching a reward chest after the reward: the chosen one is empty, the others locked.

Definition at line 281 of file mccoy_palace.c.

Referenced by Event_SearchPotionChest(), Event_SearchPsyCrystalChest(), Event_SearchVialChest(), Event_SearchWaterOfLifeChest(), and McCoyPalace_ShowUnavailableChest().

◆ Event_SearchVialChest()

void Event_SearchVialChest ( void )
static

Searching the first reward chest: a Vial, while no reward is taken.

Definition at line 290 of file mccoy_palace.c.

Referenced by Event_SearchVialChest().

◆ Event_SearchPotionChest()

void Event_SearchPotionChest ( void )
static

Searching the second reward chest: a Potion, while no reward is taken.

Definition at line 299 of file mccoy_palace.c.

Referenced by Event_SearchPotionChest().

◆ Event_SearchPsyCrystalChest()

void Event_SearchPsyCrystalChest ( void )
static

Searching the third reward chest: a Psy Crystal, while no reward is taken.

Definition at line 310 of file mccoy_palace.c.

Referenced by Event_SearchPsyCrystalChest().

◆ Event_SearchWaterOfLifeChest()

void Event_SearchWaterOfLifeChest ( void )
static

Searching the fourth reward chest: a Water of Life, while no reward is taken.

Definition at line 321 of file mccoy_palace.c.

Referenced by Event_SearchWaterOfLifeChest().

◆ Event_EscortAsksPartyToChoose()

void Event_EscortAsksPartyToChoose ( void )
static

Leaving the reward room without a reward: the escort walks the leader back.

"Please take your reward before your depart!"

Definition at line 358 of file mccoy_palace.c.

Referenced by Event_EscortAsksPartyToChoose().

◆ Event_EscortSeesPartyOff()

void Event_EscortSeesPartyOff ( void )
static

Leaving the reward room with a reward: the escort leaves.

"You are always welcome in the palace of Lord McCoy."

Definition at line 378 of file mccoy_palace.c.

Referenced by Event_EscortSeesPartyOff().

◆ McCoyPalace_PositionRewardChests()

__inline__ void McCoyPalace_PositionRewardChests ( void )
static

The four reward chests stand in a row.

Definition at line 404 of file mccoy_palace.c.

Referenced by Event_PresentRewardChests(), McCoyPalace_PositionRewardChests(), and Scene_Initialize().

◆ McCoyPalace_OpenRewardChestRow()

__inline__ void McCoyPalace_OpenRewardChestRow ( void )
static

The cells before the chest row can be walked on.

Definition at line 412 of file mccoy_palace.c.

Referenced by Event_PresentRewardChests(), McCoyPalace_OpenRewardChestRow(), and Scene_Initialize().

◆ Scene_Initialize()

s32 Scene_Initialize ( void )

Sets the palace up: McCoy's first audience, the escort at the door after it, the reward audience once Kolima's curse is lifted, or the reward chests where the party left them.

Sets up whichever scene is being entered and runs its arrival events.

Definition at line 420 of file mccoy_palace.c.

◆ McCoyPalace_PrepareCompanionApproach()

__inline__ void McCoyPalace_PrepareCompanionApproach ( void )
static

Garet, Ivan and Mia get ready to walk up to McCoy.

Definition at line 492 of file mccoy_palace.c.

Referenced by Event_AudienceWithMcCoy(), Event_McCoyRewardsParty(), and McCoyPalace_PrepareCompanionApproach().

◆ McCoyPalace_FaceCompanionsForDiscussion()

void McCoyPalace_FaceCompanionsForDiscussion ( void )
static

Garet, Ivan and Mia turn to talk among themselves.

Definition at line 998 of file mccoy_palace.c.

Referenced by Event_McCoyRewardsParty(), and McCoyPalace_FaceCompanionsForDiscussion().

◆ McCoyPalace_FaceCompanionsForAudience()

void McCoyPalace_FaceCompanionsForAudience ( void )
static

Garet, Ivan and Mia face McCoy again.

Definition at line 1005 of file mccoy_palace.c.

Referenced by Event_McCoyRewardsParty(), and McCoyPalace_FaceCompanionsForAudience().

Variable Documentation

◆ gPalace_FacingActions

s32 gPalace_FacingActions[]
Initial value:
= {
SC_CALL(Scene_TurnTowardTarget),
}
#define SC_LOOP(n, to)
Repeat up to n times.
Definition objcmd.h:28
#define SC_FOREVER
Definition objcmd.h:14
#define SC_TOP
Script start.
Definition objcmd.h:13
#define SC_CALL(fn)
Definition objcmd.h:50

Definition at line 1342 of file mccoy_palace.c.

Referenced by Event_AudienceWithMcCoy(), and Event_McCoyRewardsParty().

◆ gPalace_PacingActions

s32 gPalace_PacingActions[]
Initial value:
= {
SC_ARG(2),
SC_MOVE(PIXELS(842), 0, PIXELS(696)),
SC_MOVE(PIXELS(842), 0, PIXELS(636)),
SC_MOVE(PIXELS(876), 0, PIXELS(634)),
SC_ARG(1),
SC_WAIT(1),
}
@ FACING_STEP
Definition field_scene.h:36
@ FACING_SOUTHEAST
Definition field_scene.h:27
#define PIXELS(value)
#define SC_SET(w, v)
Write a work value.
Definition objcmd.h:37
#define SC_SYNC
Wait for arrival.
Definition objcmd.h:17
#define SC_ARG(v)
Definition objcmd.h:44
#define SC_MOVE(x, y, z)
Move toward the target.
Definition objcmd.h:19
#define SC_WAIT(n)
Wait n frames.
Definition objcmd.h:16
#define SC_END
Return to the main script.
Definition objcmd.h:32
@ SW_FACING
Definition objcmd.h:57

Definition at line 1347 of file mccoy_palace.c.

Referenced by Event_McCoyRewardsParty().

◆ gMcCoyPalaceEntrances

struct SceneEntrance gMcCoyPalaceEntrances[]

Definition at line 1361 of file mccoy_palace.c.

Referenced by Scene_GetEntrances().

◆ gMcCoyPalaceExits

u32 gMcCoyPalaceExits[]
Initial value:
= {
SCENE_EXITS(33), SCENE_EXIT(1, 34, 2), SCENE_EXIT(2, 33, 14),
SCENE_EXIT(3, 33, 17), SCENE_EXIT(4, 33, 10), SCENE_EXIT(5, 33, 11),
SCENE_EXIT(6, 33, 28), SCENE_EXIT(7, 33, 22), SCENE_EXIT(8, 33, 20),
SCENE_EXIT(9, 33, 29), SCENE_EXIT(10, 33, 4), SCENE_EXIT(11, 33, 5),
SCENE_EXIT(12, 33, 18), SCENE_EXIT(13, 33, 19), SCENE_EXIT(14, 33, 2),
SCENE_EXIT(15, 33, 26), SCENE_EXIT(16, 33, 27), SCENE_EXIT(17, 33, 3),
SCENE_EXIT(18, 33, 12), SCENE_EXIT(19, 33, 13), SCENE_EXIT(20, 33, 8),
SCENE_EXIT(21, 33, 25), SCENE_EXIT(22, 33, 7), SCENE_EXIT(23, 33, 24),
SCENE_EXIT(24, 33, 23), SCENE_EXIT(25, 33, 21), SCENE_EXIT(26, 33, 15),
SCENE_EXIT(27, 33, 16), SCENE_EXIT(28, 33, 6), SCENE_EXIT(29, 33, 9),
}
#define SCENE_EXITS(scene)
Definition field_scene.h:72
#define SCENE_EXIT(exit, scene, entrance)
Definition field_scene.h:73
#define SCENE_EXITS_END
Definition field_scene.h:77

Definition at line 1396 of file mccoy_palace.c.

Referenced by Scene_GetExits().

◆ gMcCoyPalacePlacementsOther

struct ScenePlacement gMcCoyPalacePlacementsOther[]
Initial value:
= {
}
@ SCENE_TABLE_END
Definition field_scene.h:43

Definition at line 1410 of file mccoy_palace.c.

Referenced by Scene_GetPlacements().

◆ gMcCoyPalacePlacements

struct ScenePlacement gMcCoyPalacePlacements[]

Definition at line 1415 of file mccoy_palace.c.

Referenced by Scene_GetPlacements().

◆ gMcCoyPalaceEventsOther

struct SceneEvent gMcCoyPalaceEventsOther[]
Initial value:
= {
}
#define SCENE_EVENTS_END

Definition at line 1479 of file mccoy_palace.c.

Referenced by Scene_GetEvents().

◆ gMcCoyPalaceEvents

struct SceneEvent gMcCoyPalaceEvents[]

Definition at line 1483 of file mccoy_palace.c.

Referenced by Scene_GetEvents().