Skip to Content
The Alchemy Project

src/menu/menu_use.c

Using an item or Psynergy from the menu: what it does to the party, and the sound it plays. More…

Included by menu.c.

Functions

NameDescription
Sint32mnItemUse (Sint32 slot, Sint32 memberId, Sint32 targetId)Uses the item in memberId's inventory slot on targetId, or on the whole party when its ability's range is ABILITY_RANGE_ALL.
Sint32gmBattleCalculateRecoveryStub (Sint32 value, Sint32 selector, Sint32 multiplier)Returns the amount healed: power times powerMultiplier and the multiplier for the healer's element power above 100 (gmBattleCalculateRecovery).
Sint32mnAbilityApplyToTargets (Sint32 abilityId, Sint32 userId, Sint32 targetId, Sint32 plainPower)Applies the healing, curing, revival or lasting stat rise of ability abilityId, used by party member userId, to targetId, or to the whole party when its range is ABILITY_RANGE_ALL.
voidmnItemPlayUseSound (Sint32 item)Plays the sound of using item from the menu (mnAbilityPlayUseSound), after a use that changed something.
voidmnAbilityPlayUseSound (Sint32 abilityId)Plays the sound of a Psynergy or item used from the menu; unlike in battle, no animation is drawn and nothing waits.

Description

Using an item or Psynergy from the menu: what it does to the party, and the sound it plays. Part of menu.c.

Functions in detail

mnItemUse

Sint32 mnItemUse(Sint32 slot, Sint32 memberId, Sint32 targetId)

Uses the item in memberId's inventory slot on targetId, or on the whole party when its ability's range is ABILITY_RANGE_ALL. An item heals by its ability's plain power, not by its user's elemental power as Psynergy does. A consumed item leaves the inventory and Hermes' Water leaves its Empty Bottle; returns -1 when it did nothing, keeping the item.

References gmInventoryRemoveStub(), gmItemGetDefinitionStub(), gmUnitGet(), mnAbilityApplyToTargets(), mnItemMenuCollectItems() and Sint32.

Referenced by mnItemMenuUse().

Definition at line 9 of file menu_use.c.

mnAbilityApplyToTargets

Sint32 mnAbilityApplyToTargets(Sint32 abilityId, Sint32 userId, Sint32 targetId, Sint32 plainPower)

Applies the healing, curing, revival or lasting stat rise of ability abilityId, used by party member userId, to targetId, or to the whole party when its range is ABILITY_RANGE_ALL. HP healing is scaled by the user's power in the ability's element unless plainPower is set, as it is for an item. Leaves the result's message in the menu's state; returns 0, or -1 when nothing changed.

References gmAbilityGetDefinitionStub(), gmBattleCalculateRecoveryStub(), gmUnitCalculateStub(), gmUnitGet(), gmUnitRecalculateGaugesStub(), MainRoutineStateWork, mnMessageArgumentPushStub(), result and Sint32.

Referenced by mnItemUse() and mnPsynergyMenuRunSteps().

Definition at line 51 of file menu_use.c.

mnItemPlayUseSound

void mnItemPlayUseSound(Sint32 item)

Plays the sound of using item from the menu (mnAbilityPlayUseSound), after a use that changed something.

References gmItemGetDefinitionStub(), mnAbilityPlayUseSound() and Sint32.

Referenced by mnItemMenuUse().

Definition at line 374 of file menu_use.c.

mnAbilityPlayUseSound

void mnAbilityPlayUseSound(Sint32 abilityId)

Plays the sound of a Psynergy or item used from the menu; unlike in battle, no animation is drawn and nothing waits. Healing HP or PP plays SE_RECOVERY, revival MUS_RECOVERING_AFTER_COMBAT, curing poison MUS_POISON_CURED, and any other effect MUS_LUCKY.

References gmAbilityGetDefinitionStub(), mnUseSoundPlay() and Sint32.

Referenced by mnItemPlayUseSound() and mnPsynergyMenuRunSteps().

Definition at line 384 of file menu_use.c.