src/shop/shop_sanctum.c
A Sanctum: its healer's services, their donations, and the burst of sparkles as one is given. More…
Included by shop.c.
Macros
| Name | Description | |
|---|---|---|
#define | SANCTUM_BURST_COLOR_MODES (SPRITE_COLOR_GREY + 1) | The colour modes a burst picks from at random for its sparkles and the party member's icon: SPRITE_COLOR_NORMAL, the channel swaps and SPRITE_COLOR_GREY. |
Enumerations
| Name | Description | |
|---|---|---|
enum | SANCTUM_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
| Name | Description | |
|---|---|---|
Sint32 | mnSanctumServicePrice (Sint32 unitId, Sint32 serviceKind) | Returns the Sanctum's fee, in coins, for serviceKind on party member unitId. |
Sint32 | mnSanctumNeedsService (Sint32 unitId, Sint32 serviceKind) | Returns 1 when a party member needs the service: down for Revive, poisoned for Cure Poison, haunted for Repel Evil, cursed for Remove Curse. |
Sint32 | mnSanctumCountMembersInNeed (void) | Counts party members who need the service in shop->action. |
Sint32 | mnSanctumGetServiceMessage (Sint32 msgId) | Returns the current service's line that stands where msgId stands among the revive service's lines. |
void | mnSanctumShowKeeperMessage (Sint32 msgId) | Shows the healer's line and waits until it is typed out. |
void | mnSanctumShowKeeperMessageHidingCursor (Sint32 msgId) | As mnSanctumShowKeeperMessage, hiding the hand cursor while the line shows. |
Sint32 | mnSanctumRun (Sint32 keeperId) | Runs a Sanctum: the healer's welcome, the service menu until B, and the farewell; keeperId is the healer's actor, whose portrait the lines show. |
Sint32 | mnSanctumRunPartyService (void) | Lets the player pick a party member for the service, asks for the donation, then applies it with its burst; offers another while any still need it. |
void | mnSanctumApplyService (Sint32 unitId, Sint32 serviceKind) | Applies a Sanctum service to a party member: full HP for a revive, poison or the haunting cleared, or every cursed item taken off. |
void | mnSanctumHighlightMembers (WINDOW *window, Sint32 selected) | Shows the chosen party member running in place, and those who do not need the service drawn smaller. |
void | mnSanctumDrawFee (WINDOW *window, Sint32 unitId) | Draws the party member's fee for the current service, or that they need no treatment. |
void | mnSanctumUpdateBurstSparkle (FIELD_PARTICLE *effect) | Steps one sparkle of the Sanctum's burst, which flies in from a ring around the icon, again and again until the burst ends. |
void | mnSanctumUpdateBurst (void) | Steps the burst's sparkles, and while the tune plays flickers the party member's icon through random colours, a new one each tick. |
void | mnSanctumRunMemberIconBurst (Sint32 member) | Plays the service's burst on a party member's icon: its tune, the field greyed, and SANCTUM_BURST_SPARKLES sparkles flying in at the icon as it flickers through colours, then the recovery sound. |
Description
A Sanctum: its healer's services, their donations, and the burst of sparkles
as one is given. Part of shop.c.
Macros in detail
SANCTUM_BURST_COLOR_MODES
#define SANCTUM_BURST_COLOR_MODES (SPRITE_COLOR_GREY + 1)
The colour modes a burst picks from at random for its sparkles and the party
member's icon: SPRITE_COLOR_NORMAL, the channel swaps and SPRITE_COLOR_GREY.
Referenced by mnSanctumRunMemberIconBurst() and mnSanctumUpdateBurst().
Definition at line 8 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.
| Enumerator | Value | Description |
|---|---|---|
DONATION_REVIVE_PER_LEVEL | 20 | |
DONATION_CURE_POISON | 10 | |
DONATION_REPEL_EVIL | 50 | |
DONATION_REMOVE_CURSE_PER_LEVEL | 10 |
Definition at line 12 of file shop_sanctum.c.
Functions in detail
mnSanctumServicePrice
Sint32 mnSanctumServicePrice(Sint32 unitId, Sint32 serviceKind)
Returns the Sanctum's fee, in coins, for serviceKind on party member
unitId.
References gmUnitGetStub() and Sint32.
Referenced by mnSanctumDrawFee() and mnSanctumRunPartyService().
Definition at line 22 of file shop_sanctum.c.
mnSanctumNeedsService
Sint32 mnSanctumNeedsService(Sint32 unitId, Sint32 serviceKind)
Returns 1 when a party member needs the service: down for Revive, poisoned for Cure Poison, haunted for Repel Evil, cursed for Remove Curse.
References gmUnitGetStub() and Sint32.
Referenced by mnSanctumCountMembersInNeed(), mnSanctumDrawFee(), mnSanctumHighlightMembers() and mnSanctumRunPartyService().
Definition at line 48 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 64 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 82 of file shop_sanctum.c.
mnSanctumShowKeeperMessage
void mnSanctumShowKeeperMessage(Sint32 msgId)
Shows the healer's line and waits until it is typed out. A service's line is given as Revive's, and the chosen service says its own; the Sanctum's other lines are shown while shop->action is Revive.
References fdSpeakerGetVoiceStub(), mnMessageAllTypedStub(), mnMessageCloseFinishedWindowsStub(), mnMessageOpenWindowStub(), mnSanctumGetServiceMessage(), Sint32 and sySynch().
Referenced by mnSanctumRun() and mnSanctumRunPartyService().
Definition at line 104 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 124 of file shop_sanctum.c.
mnSanctumRun
Sint32 mnSanctumRun(Sint32 keeperId)
Runs a Sanctum: the healer's welcome, the service menu until B, and the farewell; keeperId is the healer's actor, whose portrait the lines show.
References fdActorGetByIdStub(), mnCursorSetPosImmediate(), mnPortraitCreateStub(), mnPortraitOpenWindowStub(), mnSanctumCountMembersInNeed(), mnSanctumRunPartyService(), mnSanctumShowKeeperMessage(), mnSelectSanctumServiceStub(), mnShopDrawMoney(), mnShopInitState(), mnShopReleaseState(), mnWindowCloseStub(), mnWindowCreateStub(), mnWindowSpriteCreateStub() and Sint32.
Referenced by dbMenuTestOpenSanctum(), scBattleArenaOpenSanctum(), scFuchinTempleTalkToHealer(), scImilTalkToJustin(), scKolimaTalkToHealer(), scLamaTempleTalkToHealer(), scRockRoomsTalkToHealer(), scRockRoomsTalkToTravelingHealer(), scSanctumTalkAboutAltinMonsters(), scSanctumTalkAboutCurse(), scSanctumTalkAboutJourneyFromXian(), scSanctumTalkToHealer(), scSanctumTalkToVaultHealer(), scShipRoomsTalkToHealer(), scStuccoRoomsATalkToHealer(), scStuccoRoomsBTalkToHealer(), scTimberRoomsATalkToHealer() and scTimberRoomsBCTalkToHealer().
Definition at line 146 of file shop_sanctum.c.
mnSanctumRunPartyService
Sint32 mnSanctumRunPartyService(void)
Lets the player pick a party member for the service, asks for the donation, then applies it with its burst; offers another while any still need it.
References gmPartyAdjustCoinsStub(), MainRoutineStateWork, mnCreatePartyFiguresStub(), mnCursorPlace(), mnMessageArgumentPushStub(), mnMessageCloseFinishedWindowsStub(), mnReleasePartyFiguresStub(), mnSanctumApplyService(), mnSanctumAskYesNo(), mnSanctumCountMembersInNeed(), mnSanctumDrawFee(), mnSanctumHighlightMembers(), mnSanctumNeedsService(), mnSanctumRunMemberIconBurst(), mnSanctumServicePrice(), mnSanctumShowKeeperMessage(), mnSanctumShowKeeperMessageHidingCursor(), mnShopDrawMoney(), mnWindowCloseStub(), mnWindowCreateStub(), PerPush, PerRepeat, Sint32, sySoundPlayStub() and sySynch().
Referenced by mnSanctumRun().
Definition at line 229 of file shop_sanctum.c.
mnSanctumApplyService
void mnSanctumApplyService(Sint32 unitId, Sint32 serviceKind)
Applies a Sanctum service to a party member: full HP for a revive, poison or the haunting cleared, or every cursed item taken off.
References gmItemGetDefinitionStub(), gmUnitCalculateStub(), gmUnitGetStub(), gmUnitRecalculateGaugesStub() and Sint32.
Referenced by mnSanctumRunPartyService().
Definition at line 376 of file shop_sanctum.c.
mnSanctumHighlightMembers
void mnSanctumHighlightMembers(WINDOW *window, Sint32 selected)
Shows the chosen party member running in place, and those who do not need the service drawn smaller.
References fdSpriteStartAnimationStub(), mnSanctumNeedsService() and Sint32.
Referenced by mnSanctumRunPartyService().
Definition at line 417 of file shop_sanctum.c.
mnSanctumDrawFee
void mnSanctumDrawFee(WINDOW *window, Sint32 unitId)
Draws the party member's fee for the current service, or that they need no treatment.
References mnMessageArgumentPushStub(), mnSanctumGetServiceMessage(), mnSanctumNeedsService(), mnSanctumServicePrice(), mnTextDrawMessageStub(), mnWindowSpritePrepareForRedrawStub() and Sint32.
Referenced by mnSanctumRunPartyService().
Definition at line 444 of file shop_sanctum.c.
mnSanctumUpdateBurstSparkle
void mnSanctumUpdateBurstSparkle(FIELD_PARTICLE *effect)
Steps one sparkle of the Sanctum's burst, which flies in from a ring around the icon, again and again until the burst ends.
References fdParticleFreeStub(), fdParticleHasPendingTargetStub(), fdParticleSetPosStub(), Sint32, state, syRandom() and syVectorAddPolarOffset().
Referenced by mnSanctumRunMemberIconBurst().
Definition at line 472 of file shop_sanctum.c.
mnSanctumUpdateBurst
void mnSanctumUpdateBurst(void)
Steps the burst's sparkles, and while the tune plays flickers the party member's icon through random colours, a new one each tick.
References fdParticleUpdateStub(), fdSpriteSetAnimationColorModesStub() and Sint32.
Referenced by mnSanctumRunMemberIconBurst().
Definition at line 513 of file shop_sanctum.c.
mnSanctumRunMemberIconBurst
void mnSanctumRunMemberIconBurst(Sint32 member)
Plays the service's burst on a party member's icon: its tune, the field
greyed, and SANCTUM_BURST_SPARKLES sparkles flying in at the icon as it
flickers through colours, then the recovery sound.
References fdParticleFreeStub(), fdParticleInitStub(), fdParticleSetAnimationStub(), fdParticleSetCallbackStub(), fdSpriteSetAnimationColorModesStub(), fdSpriteSetAnimationSpeedStub(), mnSanctumUpdateBurst(), mnSanctumUpdateBurstSparkle(), mnShopRestoreFieldPalette(), mnShopSaveAndTintFieldPalette(), mnSoundWaitForJingle(), SanctumServiceTunes, Sint32, syCloseEvent(), sySetEvent(), sySoundPlayStub() and sySynch().
Referenced by mnSanctumRunPartyService().
Definition at line 531 of file shop_sanctum.c.