Skip to Content
The Alchemy Project

src/shop/shop_forge.c

The forge: its recipes, the materials the party holds and the roll for the result. More…

Included by shop.c.

Functions

NameDescription
const FORGE_RECIPE *mnForgeFindRecipe (Sint32 itemId)The forge's recipe for an item, or NULL when it has none; the table ends at an item of -1.
Sint32mnForgeGetItemCondition (Sint32 itemId)Returns what the forge makes of an item, counted from MsgItemCondition: 0 for an item it has no recipe for, then FORGE_CONDITION plus one.
Sint32mnForgeRollResult (Sint32 itemId)Rolls what the forge makes of a material: one of its recipe's results, each as likely as its weight; 0 for an item with no recipe.
BoolmnForgeUnitHasMaterial (Sint32 unitId)Returns 1 when the party member carries anything the forge takes.
BoolmnForgePartyHasMaterial (void)Returns 1 when anyone in the party carries anything the forge takes.
voidmnForgeSetItem (Sint32 itemId)Records the item the forge is making, for the smith to hand over later.
Sint32mnForgeGetItem (void)Returns the item the forge is making.

Description

The forge: its recipes, the materials the party holds and the roll for the result. Part of shop.c.

Functions in detail

mnForgeFindRecipe

const FORGE_RECIPE *mnForgeFindRecipe(Sint32 itemId)

The forge's recipe for an item, or NULL when it has none; the table ends at an item of -1.

References ForgeRecipes and Sint32.

Referenced by mnForgeGetItemCondition() and mnForgeRollResult().

Definition at line 6 of file shop_forge.c.

mnForgeGetItemCondition

Sint32 mnForgeGetItemCondition(Sint32 itemId)

Returns what the forge makes of an item, counted from MsgItemCondition: 0 for an item it has no recipe for, then FORGE_CONDITION plus one.

References mnForgeFindRecipe() and Sint32.

Referenced by mnForgeOfferItem(), mnForgeUnitHasMaterial() and mnShopSelectSell().

Definition at line 21 of file shop_forge.c.

mnForgeRollResult

Sint32 mnForgeRollResult(Sint32 itemId)

Rolls what the forge makes of a material: one of its recipe's results, each as likely as its weight; 0 for an item with no recipe.

References mnForgeFindRecipe(), result and Sint32.

Referenced by mnForgeOfferItem().

Definition at line 32 of file shop_forge.c.

mnForgeUnitHasMaterial

Bool mnForgeUnitHasMaterial(Sint32 unitId)

Returns 1 when the party member carries anything the forge takes.

References gmUnitGet(), mnForgeGetItemCondition() and Sint32.

Referenced by mnForgePartyHasMaterial().

Definition at line 58 of file shop_forge.c.

mnForgePartyHasMaterial

Bool mnForgePartyHasMaterial(void)

Returns 1 when anyone in the party carries anything the forge takes.

References gmPartyListMembersStub(), mnForgeUnitHasMaterial() and Sint32.

Definition at line 76 of file shop_forge.c.

mnForgeSetItem

void mnForgeSetItem(Sint32 itemId)

Records the item the forge is making, for the smith to hand over later.

References MainRoutineStateWork and Sint32.

Referenced by dbShopTestTalkToSunshinesWife(), mnForgeOfferItem() and scYallamRoomsTalkToSunshinesWife().

Definition at line 92 of file shop_forge.c.

mnForgeGetItem

Sint32 mnForgeGetItem(void)

Returns the item the forge is making.

References MainRoutineStateWork and Sint32.

Referenced by dbShopTestTalkToSunshine(), dbShopTestTalkToSunshinesWife(), scYallamRoomsTalkToSunshine() and scYallamRoomsTalkToSunshinesWife().

Definition at line 98 of file shop_forge.c.