MCPcopy Create free account
hub / github.com/TurningWheel/Barony / alchemyCookCombination

Method alchemyCookCombination

src/interface/interface.cpp:9085–9503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9083}
9084
9085void GenericGUIMenu::alchemyCookCombination()
9086{
9087 if ( !basePotion || !secondaryPotion )
9088 {
9089 return;
9090 }
9091
9092 const ItemType basePotionType = basePotion->type;
9093 const ItemType secondaryPotionType = secondaryPotion->type;
9094 int createCount = 1;
9095 Status status = SERVICABLE;
9096 int missingPotion1Count = 0;
9097 int missingPotion2Count = 0;
9098 ItemType result = alchemyCookResult(getPlayer(), basePotion, secondaryPotion, createCount, status, missingPotion1Count, missingPotion2Count);
9099 if ( result == POTION_EMPTY || alchemyGUI.alchemyMissingIngredientQty(nullptr) )
9100 {
9101 return;
9102 }
9103
9104 int skillLVL = 0;
9105 if ( stats[gui_player] )
9106 {
9107 skillLVL = stats[gui_player]->getModifiedProficiency(PRO_ALCHEMY) / 20; // 0 to 5;
9108 }
9109
9110
9111 if ( basePotionType == TOOL_TOWEL )
9112 {
9113 messagePlayerColor(gui_player, MESSAGE_INVENTORY, uint32ColorWhite, Language::get(6770),
9114 items[secondaryPotionType].getIdentifiedName(), items[basePotionType].getIdentifiedName());
9115 }
9116 else if ( secondaryPotionType == TOOL_TOWEL )
9117 {
9118 messagePlayerColor(gui_player, MESSAGE_INVENTORY, uint32ColorWhite, Language::get(6770),
9119 items[basePotionType].getIdentifiedName(), items[secondaryPotionType].getIdentifiedName());
9120 }
9121 else if ( GenericGUIMenu::isItemRationSeasoning(basePotionType) || itemCategory(basePotion) == POTION )
9122 {
9123 messagePlayerColor(gui_player, MESSAGE_INVENTORY, uint32ColorWhite, Language::get(3332),
9124 items[secondaryPotionType].getIdentifiedName(), items[basePotionType].getIdentifiedName());
9125 }
9126 else if ( GenericGUIMenu::isItemRationSeasoning(secondaryPotionType) || itemCategory(secondaryPotion) == POTION )
9127 {
9128 messagePlayerColor(gui_player, MESSAGE_INVENTORY, uint32ColorWhite, Language::get(3332),
9129 items[basePotionType].getIdentifiedName(), items[secondaryPotionType].getIdentifiedName());
9130 }
9131 else
9132 {
9133 messagePlayerColor(gui_player, MESSAGE_INVENTORY, uint32ColorWhite, Language::get(6769),
9134 items[basePotionType].getIdentifiedName(), items[secondaryPotionType].getIdentifiedName());
9135 }
9136
9137 if ( GenericGUIMenu::isItemRationSeasoning(basePotionType) && secondaryPotionType == FOOD_RATION )
9138 {
9139 status = std::max(status, secondaryPotion->status);
9140 }
9141 else if ( GenericGUIMenu::isItemRationSeasoning(secondaryPotionType) && basePotionType == FOOD_RATION )
9142 {

Callers 1

updateAlchemyMenuMethod · 0.80

Calls 15

alchemyCookResultFunction · 0.85
messagePlayerColorFunction · 0.85
consumeItemFunction · 0.85
itemIsEquippedFunction · 0.85
sendPacketSafeFunction · 0.85
itemPickupFunction · 0.85
playSoundEntityLocalFunction · 0.85
steamAchievementFunction · 0.85
getIdentifiedNameMethod · 0.80
randMethod · 0.80

Tested by

no test coverage detected