Skip to Content
The Alchemy Project

src/shop/shop_sanctum.c

The sanctum's services, their donations and their sparkles. More…

Included by shop.c.

Macros

NameDescription
#defineSANCTUM_HAS_DONATION_WINDOW (LANGUAGE != LANGUAGE_ITALIAN)Italian has no donation window: mnSanctumDrawFee draws nothing without one, so while a party member is chosen no donation shows, and it is first seen in the keeper's line (MsgReviving).
#defineSANCTUM_DONATION_WINDOW_X GERMAN_OR(0, 1)The donation window's left column and width in tiles, sized to each language's text.
#defineSANCTUM_DONATION_WINDOW_WIDTH BY_LANGUAGE(23, 23, 30, 23, 25, 23)

Enumerations

NameDescription
enumSANCTUM_DONATION { DONATION_REVIVE_PER_LEVEL, DONATION_CURE_POISON, DONATION_RE … }The donations the sanctum asks, in coins: reviving and removing a curse ask so many for each of the party member's levels.

Functions

NameDescription
Sint32mnSanctumServicePrice (Sint32 unitId, Sint32 serviceKind)Returns the sanctum's donation, in coins, for serviceKind on party member unitId.
Sint32mnSanctumNeedsService (Sint32 unitId, Sint32 serviceKind)Returns 1 when a party member needs the service: down for a revive, poisoned for a cure, haunted for an exorcism, cursed for removing a curse.
Sint32mnSanctumCountMembersInNeed (void)Counts party members who need the service in shop->action.
Sint32mnSanctumGetServiceMessage (Sint32 msgId)Returns the current service's line that stands where msgId stands among the revive service's lines.
voidmnSanctumShowKeeperMessage (Sint32 msgId)Shows the keeper's line for the current service and waits for its window.
voidmnSanctumShowKeeperMessageHidingCursor (Sint32 msgId)As mnSanctumShowKeeperMessage, hiding the hand cursor while the line shows.
Sint32mnSanctumRun (Sint32 actorId)Runs a sanctum: the keeper's welcome, the service menu until B, and the farewell; actorId is the keeper, whose portrait the lines show.
Sint32mnSanctumRunPartyService (void)Runs one service: the player chooses the party member, sees the donation, confirms, pays and watches the burst.
voidmnSanctumApplyService (Sint32 unitId, Sint32 serviceKind)Gives the party member the service: full HP for a revive, the poison or the haunting lifted, or every cursed item it wears taken off.
voidmnSanctumHighlightMembers (WINDOW *window, Sint32 selected)Shows the chosen party member running in place and the others standing, four a page with its arrows, and draws at seven tenths of their size the party members who do not need the service.
voidmnSanctumDrawFee (WINDOW *window, Sint32 unitId)Shows the chosen party member's donation for the service, or that none is needed.
voidmnSanctumUpdateBurstSparkle (FIELD_PARTICLE *sparkle)Runs one sparkle of the service's burst: placed on a ring 40 pixels out and sent to a point near the centre, it flies in again each time it arrives, until the burst ends and it is freed on arrival.
voidmnSanctumUpdateBurst (void)Moves the burst's sparkles each tick and gives the party member's icon a random colour mode while the burst plays on it.
voidfdSpriteSetAnimationSpeedStub (void *object, Sint32 speed)Sets the step of each of a sprite's layers: 0 stops its animation, ANIM_STEP_NORMAL runs it at normal speed.
voidmnSanctumRunMemberIconBurst (Sint32 member)Plays the service's burst on a party member's icon: its tune, the colours tinted, and SANCTUM_BURST_SPARKLES sparkles flying in around the icon as it changes colour.

Description

The sanctum's services, their donations and their sparkles. Part of shop.c.

Macros in detail

SANCTUM_HAS_DONATION_WINDOW

#define SANCTUM_HAS_DONATION_WINDOW (LANGUAGE != LANGUAGE_ITALIAN)

Italian has no donation window: mnSanctumDrawFee draws nothing without one, so while a party member is chosen no donation shows, and it is first seen in the keeper's line (MsgReviving).

Definition at line 218 of file shop_sanctum.c.

SANCTUM_DONATION_WINDOW_X

#define SANCTUM_DONATION_WINDOW_X GERMAN_OR(0, 1)

The donation window's left column and width in tiles, sized to each language's text.

Referenced by mnSanctumRunPartyService().

Definition at line 222 of file shop_sanctum.c.

SANCTUM_DONATION_WINDOW_WIDTH

#define SANCTUM_DONATION_WINDOW_WIDTH BY_LANGUAGE(23, 23, 30, 23, 25, 23)

Referenced by mnSanctumRunPartyService().

Definition at line 223 of file shop_sanctum.c.

Enumerations in detail

SANCTUM_DONATION

enum SANCTUM_DONATION

The donations the sanctum asks, in coins: reviving and removing a curse ask so many for each of the party member's levels.

EnumeratorValueDescription
DONATION_REVIVE_PER_LEVEL20
DONATION_CURE_POISON10
DONATION_REPEL_EVIL50
DONATION_REMOVE_CURSE_PER_LEVEL10

Definition at line 5 of file shop_sanctum.c.

Functions in detail

mnSanctumServicePrice

Sint32 mnSanctumServicePrice(Sint32 unitId, Sint32 serviceKind)

Returns the sanctum's donation, in coins, for serviceKind on party member unitId.

References gmUnitGet() and Sint32.

Referenced by mnSanctumDrawFee() and mnSanctumRunPartyService().

Definition at line 15 of file shop_sanctum.c.

mnSanctumNeedsService

Sint32 mnSanctumNeedsService(Sint32 unitId, Sint32 serviceKind)

Returns 1 when a party member needs the service: down for a revive, poisoned for a cure, haunted for an exorcism, cursed for removing a curse.

References gmUnitGet() and Sint32.

Referenced by mnSanctumCountMembersInNeed(), mnSanctumDrawFee(), mnSanctumHighlightMembers() and mnSanctumRunPartyService().

Definition at line 41 of file shop_sanctum.c.

mnSanctumCountMembersInNeed

Sint32 mnSanctumCountMembersInNeed(void)

Counts party members who need the service in shop->action.

References mnSanctumNeedsService() and Sint32.

Referenced by mnSanctumRun() and mnSanctumRunPartyService().

Definition at line 57 of file shop_sanctum.c.

mnSanctumGetServiceMessage

Sint32 mnSanctumGetServiceMessage(Sint32 msgId)

Returns the current service's line that stands where msgId stands among the revive service's lines.

References Sint32.

Referenced by mnSanctumDrawFee(), mnSanctumShowKeeperMessage() and mnSanctumShowKeeperMessageHidingCursor().

Definition at line 75 of file shop_sanctum.c.

mnSanctumShowKeeperMessage

void mnSanctumShowKeeperMessage(Sint32 msgId)

Shows the keeper's line for the current service and waits for its window.

References fdSpeakerGetVoiceStub(), mnMessageAllTypedStub(), mnMessageCloseFinishedWindowsStub(), mnMessageOpenWindowStub(), mnSanctumGetServiceMessage(), Sint32 and sySynch().

Referenced by mnSanctumRun() and mnSanctumRunPartyService().

Definition at line 98 of file shop_sanctum.c.

mnSanctumShowKeeperMessageHidingCursor

void mnSanctumShowKeeperMessageHidingCursor(Sint32 msgId)

As mnSanctumShowKeeperMessage, hiding the hand cursor while the line shows.

References fdSpeakerGetVoiceStub(), mnMessageAllTypedStub(), mnMessageCloseFinishedWindowsStub(), mnMessageOpenWindowStub(), mnSanctumGetServiceMessage(), Sint32 and sySynch().

Referenced by mnSanctumRunPartyService().

Definition at line 118 of file shop_sanctum.c.

mnSanctumRun

Sint32 mnSanctumRun(Sint32 actorId)

Runs a sanctum: the keeper's welcome, the service menu until B, and the farewell; actorId is the keeper, whose portrait the lines show.

References fdActorGetByIdStub(), mnCursorSetPosImmediate(), mnPortraitCreateStub(), mnPortraitOpenWindowStub(), mnSanctumCountMembersInNeed(), mnSanctumRunPartyService(), mnSanctumShowKeeperMessage(), mnSelectSanctumServiceStub(), mnShopDrawMoney(), mnShopInitState(), mnShopReleaseState(), mnWindowCloseStub(), mnWindowCreateStub(), mnWindowSpriteCreateStub() and Sint32.

Referenced by dbPsynergyTestOpenSanctum(), dbShopTestOpenSanctum(), scAlhafraRoomsTalkToPriest(), scChampaSanctumServeAcrossTheCounter(), scContigoTalkToHealer(), scDailaRoomsTalkToHealer(), scDailaRoomsTalkToHealerOnceTaviIsRescued(), scGarohRoomsTalkToPriest(), scIsletsTalkToHealer(), scIzumoRoomsTalkToPriest(), scKibomboOpenSanctum(), scKibomboTalkForeignCeremony(), scLinkLobbyOpenSanctum(), scLohoTalkAboutCannon(), scMadraRoomsTalkToHealer(), scMikasallaRoomsTalkToApojiiHealer(), scMikasallaRoomsTalkToHealer(), scMikasallaRoomsTalkToYallamHealer(), scNaribweTalkToPilgrim(), scNaribweTalkToPilgrimOnReturn(), scProxTalkToHealer(), scShamanVillageTalkToPriest() and scYallamRoomsTalkToHealer().

Definition at line 145 of file shop_sanctum.c.

mnSanctumRunPartyService

Sint32 mnSanctumRunPartyService(void)

Runs one service: the player chooses the party member, sees the donation, confirms, pays and watches the burst. Repeats while anyone still needs it, until B.

References gmPartyAdjustCoinsStub(), MainRoutineStateWork, mnCreatePartyFiguresStub(), mnCursorPlace(), mnGridMoveCursor(), mnMessageArgumentPushStub(), mnMessageCloseFinishedWindowsStub(), mnReleasePartyFiguresStub(), mnSanctumApplyService(), mnSanctumAskYesNo(), mnSanctumCountMembersInNeed(), mnSanctumDrawFee(), mnSanctumHighlightMembers(), mnSanctumNeedsService(), mnSanctumRunMemberIconBurst(), mnSanctumServicePrice(), mnSanctumShowKeeperMessage(), mnSanctumShowKeeperMessageHidingCursor(), mnShopDrawMoney(), mnShowPartyFiguresStub(), mnWindowCloseStub(), mnWindowCreateStub(), mnWindowSpritePrepareForRedrawStub(), PerWork, Sint32, sySoundPlayStub() and sySynch().

Referenced by mnSanctumRun().

Definition at line 228 of file shop_sanctum.c.

mnSanctumApplyService

void mnSanctumApplyService(Sint32 unitId, Sint32 serviceKind)

Gives the party member the service: full HP for a revive, the poison or the haunting lifted, or every cursed item it wears taken off.

References gmItemGetDefinitionStub(), gmUnitCalculateStub(), gmUnitGet(), gmUnitRecalculateGaugesStub() and Sint32.

Referenced by mnSanctumRunPartyService().

Definition at line 379 of file shop_sanctum.c.

mnSanctumHighlightMembers

void mnSanctumHighlightMembers(WINDOW *window, Sint32 selected)

Shows the chosen party member running in place and the others standing, four a page with its arrows, and draws at seven tenths of their size the party members who do not need the service.

References fdSpriteStartAnimationStub(), mnSanctumNeedsService(), mnWindowSpriteCreateStub(), mnWindowSpritePrepareForRedrawStub() and Sint32.

Referenced by mnSanctumRunPartyService().

Definition at line 421 of file shop_sanctum.c.

mnSanctumDrawFee

void mnSanctumDrawFee(WINDOW *window, Sint32 unitId)

Shows the chosen party member's donation for the service, or that none is needed.

References mnMessageArgumentPushStub(), mnSanctumGetServiceMessage(), mnSanctumNeedsService(), mnSanctumServicePrice(), mnTextDrawMessageStub(), mnWindowSpritePrepareForRedrawStub() and Sint32.

Referenced by mnSanctumRunPartyService().

Definition at line 471 of file shop_sanctum.c.

mnSanctumUpdateBurstSparkle

void mnSanctumUpdateBurstSparkle(FIELD_PARTICLE *sparkle)

Runs one sparkle of the service's burst: placed on a ring 40 pixels out and sent to a point near the centre, it flies in again each time it arrives, until the burst ends and it is freed on arrival.

References fdParticleFreeStub(), fdParticleHasPendingTargetStub(), fdParticleSetPosStub(), result, Sint32, syRandom() and syVectorAddPolarOffset().

Referenced by mnSanctumRunMemberIconBurst().

Definition at line 496 of file shop_sanctum.c.

mnSanctumUpdateBurst

void mnSanctumUpdateBurst(void)

Moves the burst's sparkles each tick and gives the party member's icon a random colour mode while the burst plays on it. Runs as an event.

References fdParticleUpdateStub(), fdSpriteSetAnimationColorModesStub(), Sint32 and syRandom().

Referenced by mnSanctumRunMemberIconBurst().

Definition at line 537 of file shop_sanctum.c.

mnSanctumRunMemberIconBurst

void mnSanctumRunMemberIconBurst(Sint32 member)

Plays the service's burst on a party member's icon: its tune, the colours tinted, and SANCTUM_BURST_SPARKLES sparkles flying in around the icon as it changes colour.

References fdParticleFreeStub(), fdParticleInitStub(), fdParticleSetAnimationStub(), fdParticleSetCallbackStub(), fdSpriteSetAnimationColorModesStub(), fdSpriteSetAnimationSpeedStub(), mnSanctumUpdateBurst(), mnSanctumUpdateBurstSparkle(), mnShopRestoreFieldPalette(), mnShopSaveAndTintFieldPalette(), mnSoundWaitForJingle(), SanctumServiceTunes, Sint32, syCloseEvent(), syRandom(), sySetEvent(), sySoundPlayStub() and sySynch().

Referenced by mnSanctumRunPartyService().

Definition at line 556 of file shop_sanctum.c.