diff --git a/src/Engine/Engine.cpp b/src/Engine/Engine.cpp index 126539164606..729657c5dc3a 100644 --- a/src/Engine/Engine.cpp +++ b/src/Engine/Engine.cpp @@ -1003,7 +1003,7 @@ void Engine::_461103_load_level_sub() { pActors[i].monsterInfo.uID <= MONSTER_PEASANT_GOBLIN_MALE_3_3) v17 = 1; // v1 = 0; - v4 = (std::to_underlying(pActors[i].monsterInfo.uID) - 1) % 3; // TODO(captainurist): what is this std::to_underlying doing? + v4 = (std::to_underlying(pActors[i].monsterInfo.uID) - 1) % 3; // TODO(captainurist): encapsulate monster tier calculation. if (2 == v4) { if (pActors[i].npcId && pActors[i].npcId < 5000) continue; } else { diff --git a/src/GUI/GUIEnums.h b/src/GUI/GUIEnums.h index 75699601a863..00d8827e4266 100644 --- a/src/GUI/GUIEnums.h +++ b/src/GUI/GUIEnums.h @@ -381,6 +381,6 @@ enum class ShopScreen { SHOP_SCREEN_SELL = 3, SHOP_SCREEN_IDENTIFY = 4, SHOP_SCREEN_REPAIR = 5, - SHOP_SCREEN_SELL_FOR_CHEAP = 6, // Sell for half the price, doesn't seem to be used in the game. MM6 remnant? + SHOP_SCREEN_SELL_FOR_CHEAP = 6, // Sell for half the price, was used in MM6 general store, not used in MM7. }; using enum ShopScreen; diff --git a/src/GUI/UI/Houses/Shops.cpp b/src/GUI/UI/Houses/Shops.cpp index 87c4f94607b8..eff424cc21c5 100644 --- a/src/GUI/UI/Houses/Shops.cpp +++ b/src/GUI/UI/Houses/Shops.cpp @@ -39,7 +39,7 @@ struct ITEM_VARIATION { std::array item_class; }; -static constexpr IndexedArray weaponShopVariationStandart = {{ +static constexpr IndexedArray weaponShopVariationStandard = {{ {HOUSE_WEAPON_SHOP_EMERALD_ISLAND, { ITEM_TREASURE_LEVEL_1, { RANDOM_ITEM_SWORD, RANDOM_ITEM_BOW, RANDOM_ITEM_WEAPON, RANDOM_ITEM_WEAPON } }}, {HOUSE_WEAPON_SHOP_HARMONDALE, { ITEM_TREASURE_LEVEL_1, { RANDOM_ITEM_SWORD, RANDOM_ITEM_DAGGER, RANDOM_ITEM_MACE, RANDOM_ITEM_WEAPON } }}, {HOUSE_WEAPON_SHOP_ERATHIA, { ITEM_TREASURE_LEVEL_2, { RANDOM_ITEM_SWORD, RANDOM_ITEM_DAGGER, RANDOM_ITEM_AXE, RANDOM_ITEM_WEAPON } }}, @@ -73,7 +73,7 @@ static constexpr IndexedArray armorShopTopRowVariationStandart = {{ +static constexpr IndexedArray armorShopTopRowVariationStandard = {{ {HOUSE_ARMOR_SHOP_EMERALD_ISLAND, { ITEM_TREASURE_LEVEL_1, { RANDOM_ITEM_HELMET, RANDOM_ITEM_HELMET, RANDOM_ITEM_GAUNTLETS, RANDOM_ITEM_GAUNTLETS } }}, {HOUSE_ARMOR_SHOP_HARMONDALE, { ITEM_TREASURE_LEVEL_1, { RANDOM_ITEM_HELMET, RANDOM_ITEM_HELMET, RANDOM_ITEM_GAUNTLETS, RANDOM_ITEM_GAUNTLETS } }}, {HOUSE_ARMOR_SHOP_ERATHIA, { ITEM_TREASURE_LEVEL_2, { RANDOM_ITEM_HELMET, RANDOM_ITEM_HELMET, RANDOM_ITEM_GAUNTLETS, RANDOM_ITEM_GAUNTLETS } }}, @@ -90,7 +90,7 @@ static constexpr IndexedArray armorShopBottomRowVariationStandart = {{ +static constexpr IndexedArray armorShopBottomRowVariationStandard = {{ {HOUSE_ARMOR_SHOP_EMERALD_ISLAND, { ITEM_TREASURE_LEVEL_1, { RANDOM_ITEM_LEATHER_ARMOR, RANDOM_ITEM_LEATHER_ARMOR, RANDOM_ITEM_LEATHER_ARMOR, RANDOM_ITEM_SHIELD } }}, {HOUSE_ARMOR_SHOP_HARMONDALE, { ITEM_TREASURE_LEVEL_1, { RANDOM_ITEM_LEATHER_ARMOR, RANDOM_ITEM_LEATHER_ARMOR, RANDOM_ITEM_LEATHER_ARMOR, RANDOM_ITEM_SHIELD } }}, {HOUSE_ARMOR_SHOP_ERATHIA, { ITEM_TREASURE_LEVEL_2, { RANDOM_ITEM_LEATHER_ARMOR, RANDOM_ITEM_LEATHER_ARMOR, RANDOM_ITEM_LEATHER_ARMOR, RANDOM_ITEM_PLATE_ARMOR } }}, @@ -141,7 +141,7 @@ static constexpr IndexedArray magicShopVariationStandart = {{ +static constexpr IndexedArray magicShopVariationStandard = {{ {HOUSE_MAGIC_SHOP_EMERALD_ISLAND, ITEM_TREASURE_LEVEL_1}, {HOUSE_MAGIC_SHOP_HARMONDALE, ITEM_TREASURE_LEVEL_1}, {HOUSE_MAGIC_SHOP_ERATHIA, ITEM_TREASURE_LEVEL_2}, @@ -173,7 +173,7 @@ static constexpr IndexedArray alchemyShopVariationStandart = {{ +static constexpr IndexedArray alchemyShopVariationStandard = {{ {HOUSE_ALCHEMY_SHOP_EMERALD_ISLAND, ITEM_TREASURE_LEVEL_1}, {HOUSE_ALCHEMY_SHOP_HARMONDALE, ITEM_TREASURE_LEVEL_1}, {HOUSE_ALCHEMY_SHOP_ERATHIA, ITEM_TREASURE_LEVEL_2}, @@ -634,7 +634,7 @@ void GUIWindow_MagicAlchemyShop::shopWaresDialogue(bool isSpecial) { void GUIWindow_WeaponShop::generateShopItems(bool isSpecial) { std::array &itemArray = isSpecial ? pParty->specialItemsInShops[houseId()] : pParty->standartItemsInShops[houseId()]; - const ITEM_VARIATION variation = isSpecial ? weaponShopVariationSpecial[houseId()] : weaponShopVariationStandart[houseId()]; + const ITEM_VARIATION variation = isSpecial ? weaponShopVariationSpecial[houseId()] : weaponShopVariationStandard[houseId()]; for (int i = 0; i < itemAmountInShop[buildingType()]; i++) { RandomItemType itemClass = variation.item_class[grng->random(4)]; @@ -647,8 +647,8 @@ void GUIWindow_WeaponShop::generateShopItems(bool isSpecial) { void GUIWindow_ArmorShop::generateShopItems(bool isSpecial) { std::array &itemArray = isSpecial ? pParty->specialItemsInShops[houseId()] : pParty->standartItemsInShops[houseId()]; - const ITEM_VARIATION variationTop = isSpecial ? armorShopTopRowVariationSpecial[houseId()] : armorShopTopRowVariationStandart[houseId()]; - const ITEM_VARIATION variationBottom = isSpecial ? armorShopBottomRowVariationSpecial[houseId()] : armorShopBottomRowVariationStandart[houseId()]; + const ITEM_VARIATION variationTop = isSpecial ? armorShopTopRowVariationSpecial[houseId()] : armorShopTopRowVariationStandard[houseId()]; + const ITEM_VARIATION variationBottom = isSpecial ? armorShopBottomRowVariationSpecial[houseId()] : armorShopBottomRowVariationStandard[houseId()]; for (int i = 0; i < itemAmountInShop[buildingType()]; i++) { RandomItemType itemClass; @@ -670,7 +670,7 @@ void GUIWindow_ArmorShop::generateShopItems(bool isSpecial) { void GUIWindow_MagicShop::generateShopItems(bool isSpecial) { std::array &itemArray = isSpecial ? pParty->specialItemsInShops[houseId()] : pParty->standartItemsInShops[houseId()]; - ItemTreasureLevel treasureLvl = isSpecial ? magicShopVariationSpecial[houseId()] : magicShopVariationStandart[houseId()]; + ItemTreasureLevel treasureLvl = isSpecial ? magicShopVariationSpecial[houseId()] : magicShopVariationStandard[houseId()]; for (int i = 0; i < itemAmountInShop[buildingType()]; i++) { pItemTable->generateItem(treasureLvl, RANDOM_ITEM_MICS, &itemArray[i]); @@ -682,7 +682,7 @@ void GUIWindow_MagicShop::generateShopItems(bool isSpecial) { void GUIWindow_AlchemyShop::generateShopItems(bool isSpecial) { std::array &itemArray = isSpecial ? pParty->specialItemsInShops[houseId()] : pParty->standartItemsInShops[houseId()]; - ItemTreasureLevel treasureLvl = isSpecial ? alchemyShopVariationSpecial[houseId()] : alchemyShopVariationStandart[houseId()]; + ItemTreasureLevel treasureLvl = isSpecial ? alchemyShopVariationSpecial[houseId()] : alchemyShopVariationStandard[houseId()]; RandomItemType bottomRowItemClass = isSpecial ? RANDOM_ITEM_POTION : RANDOM_ITEM_REAGENT; for (int i = 0; i < itemAmountInShop[buildingType()]; i++) { @@ -706,7 +706,7 @@ std::vector GUIWindow_WeaponShop::listShopLearnableSkills() { std::vector itemClasses; std::vector skillsOptions; - addUniqueItemClasses(weaponShopVariationStandart[houseId()], itemClasses); + addUniqueItemClasses(weaponShopVariationStandard[houseId()], itemClasses); addUniqueItemClasses(weaponShopVariationSpecial[houseId()], itemClasses); for (RandomItemType itemClass : itemClasses) { @@ -723,8 +723,8 @@ std::vector GUIWindow_ArmorShop::listShopLearnableSkills() { std::vector itemClasses; std::vector skillsOptions; - addUniqueItemClasses(armorShopTopRowVariationStandart[houseId()], itemClasses); - addUniqueItemClasses(armorShopBottomRowVariationStandart[houseId()], itemClasses); + addUniqueItemClasses(armorShopTopRowVariationStandard[houseId()], itemClasses); + addUniqueItemClasses(armorShopBottomRowVariationStandard[houseId()], itemClasses); addUniqueItemClasses(armorShopTopRowVariationSpecial[houseId()], itemClasses); addUniqueItemClasses(armorShopBottomRowVariationSpecial[houseId()], itemClasses);