diff --git a/src/creatures/players/wheel/player_wheel.cpp b/src/creatures/players/wheel/player_wheel.cpp index b2fa39960e1..77a15f7cbf7 100644 --- a/src/creatures/players/wheel/player_wheel.cpp +++ b/src/creatures/players/wheel/player_wheel.cpp @@ -32,6 +32,47 @@ const static std::vector wheelGemBasicSlot1Allowed = { WheelGemBasicModifier_t::Vocation_Health_IceResistance, WheelGemBasicModifier_t::Vocation_Health_EnergyResistance, WheelGemBasicModifier_t::Vocation_Health_EarthResistance, + WheelGemBasicModifier_t::Vocation_Mana_FireResistance, + WheelGemBasicModifier_t::Vocation_Mana_EnergyResistance, + WheelGemBasicModifier_t::Vocation_Mana_Earth_Resistance, + WheelGemBasicModifier_t::Vocation_Mana_Ice_Resistance, + WheelGemBasicModifier_t::Vocation_Capacity_FireResistance, + WheelGemBasicModifier_t::Vocation_Capacity_EnergyResistance, + WheelGemBasicModifier_t::Vocation_Capacity_EarthResistance, + WheelGemBasicModifier_t::Vocation_Capacity_IceResistance, +}; + +const static std::vector wheelGemBasicSlot2Allowed = { + WheelGemBasicModifier_t::General_FireResistance, + WheelGemBasicModifier_t::General_IceResistance, + WheelGemBasicModifier_t::General_EnergyResistance, + WheelGemBasicModifier_t::General_EarthResistance, + WheelGemBasicModifier_t::General_PhysicalResistance, + WheelGemBasicModifier_t::General_HolyResistance, + WheelGemBasicModifier_t::General_HolyResistance_DeathWeakness, + WheelGemBasicModifier_t::General_DeathResistance_HolyWeakness, + WheelGemBasicModifier_t::General_FireResistance_EarthResistance, + WheelGemBasicModifier_t::General_FireResistance_IceResistance, + WheelGemBasicModifier_t::General_FireResistance_EnergyResistance, + WheelGemBasicModifier_t::General_EarthResistance_IceResistance, + WheelGemBasicModifier_t::General_EarthResistance_EnergyResistance, + WheelGemBasicModifier_t::General_IceResistance_EnergyResistance, + WheelGemBasicModifier_t::General_FireResistance_EarthWeakness, + WheelGemBasicModifier_t::General_FireResistance_IceWeakness, + WheelGemBasicModifier_t::General_FireResistance_EnergyWeakness, + WheelGemBasicModifier_t::General_EarthResistance_FireWeakness, + WheelGemBasicModifier_t::General_EarthResistance_IceWeakness, + WheelGemBasicModifier_t::General_EarthResistance_EnergyWeakness, + WheelGemBasicModifier_t::General_IceResistance_EarthWeakness, + WheelGemBasicModifier_t::General_IceResistance_FireWeakness, + WheelGemBasicModifier_t::General_IceResistance_EnergyWeakness, + WheelGemBasicModifier_t::General_EnergyResistance_EarthWeakness, + WheelGemBasicModifier_t::General_EnergyResistance_IceWeakness, + WheelGemBasicModifier_t::General_EnergyResistance_FireWeakness, + WheelGemBasicModifier_t::General_ManaDrainResistance, + WheelGemBasicModifier_t::General_LifeDrainResistance, + WheelGemBasicModifier_t::General_ManaDrainResistance_LifeDrainResistance, + WheelGemBasicModifier_t::General_MitigationMultiplier, }; // To avoid conflict in other files that might use a function with the same name @@ -835,7 +876,7 @@ void PlayerWheel::revealGem(WheelGemQuality_t quality) { gem.basicModifier2 = {}; gem.supremeModifier = {}; if (quality >= WheelGemQuality_t::Regular) { - gem.basicModifier2 = static_cast(uniform_random(0, magic_enum::enum_count() - 1)); + gem.basicModifier2 = selectBasicModifier2(gem.basicModifier1); } if (quality >= WheelGemQuality_t::Greater && !supremeModifiers.empty()) { gem.supremeModifier = supremeModifiers[uniform_random(0, supremeModifiers.size() - 1)]; @@ -3106,3 +3147,11 @@ float PlayerWheel::calculateMitigation() const { mitigation += (mitigation * (float)getMitigationMultiplier()) / 100.f; return mitigation; } + +WheelGemBasicModifier_t PlayerWheel::selectBasicModifier2(WheelGemBasicModifier_t modifier1) const { + WheelGemBasicModifier_t modifier = modifier1; + while (modifier == modifier1) { + modifier = wheelGemBasicSlot2Allowed[uniform_random(0, wheelGemBasicSlot2Allowed.size() - 1)]; + } + return modifier; +} diff --git a/src/creatures/players/wheel/player_wheel.hpp b/src/creatures/players/wheel/player_wheel.hpp index 3ede17c339d..303063beb9b 100644 --- a/src/creatures/players/wheel/player_wheel.hpp +++ b/src/creatures/players/wheel/player_wheel.hpp @@ -454,6 +454,8 @@ class PlayerWheel { } } + WheelGemBasicModifier_t selectBasicModifier2(WheelGemBasicModifier_t modifier1) const; + private: friend class Player; // Reference to the player diff --git a/src/io/io_wheel.cpp b/src/io/io_wheel.cpp index 6e7c2b02b0f..e8ad30a5d80 100644 --- a/src/io/io_wheel.cpp +++ b/src/io/io_wheel.cpp @@ -416,7 +416,7 @@ void IOWheel::slotGreen200(const std::shared_ptr &player, uint16_t point // SLOT_GREEN_TOP_150 = 2 void IOWheel::slotGreenTop150(const std::shared_ptr &player, uint16_t points, uint8_t, PlayerWheelMethodsBonusData &bonusData) const { bonusData.mitigation += MITIGATION_INCREASE * points; - if (isMaxPointAddedToSlot(player, points, WheelSlots_t::SLOT_GREEN_BOTTOM_150)) { + if (isMaxPointAddedToSlot(player, points, WheelSlots_t::SLOT_GREEN_TOP_150)) { bonusData.leech.manaLeech += MANA_LEECH_INCREASE; } } @@ -522,7 +522,7 @@ void IOWheel::slotGreenTop75(const std::shared_ptr &player, uint16_t poi } else { bonusData.stats.mana += 6 * points; } - if (isMaxPointAddedToSlot(player, points, WheelSlots_t::SLOT_GREEN_TOP_100)) { + if (isMaxPointAddedToSlot(player, points, WheelSlots_t::SLOT_GREEN_TOP_75)) { bonusData.leech.lifeLeech += HEALTH_LEECH_INCREASE; } } @@ -566,7 +566,7 @@ void IOWheel::slotRedBottom150(const std::shared_ptr &player, uint16_t p } else { bonusData.stats.health += 1 * points; } - if (isMaxPointAddedToSlot(player, points, WheelSlots_t::SLOT_RED_TOP_150)) { + if (isMaxPointAddedToSlot(player, points, WheelSlots_t::SLOT_RED_BOTTOM_150)) { bonusData.leech.manaLeech += MANA_LEECH_INCREASE; } } @@ -760,7 +760,7 @@ void IOWheel::slotBlueTop150(const std::shared_ptr &player, uint16_t poi } else { bonusData.stats.capacity += 2 * points; } - if (isMaxPointAddedToSlot(player, points, WheelSlots_t::SLOT_BLUE_BOTTOM_150)) { + if (isMaxPointAddedToSlot(player, points, WheelSlots_t::SLOT_BLUE_TOP_150)) { bonusData.leech.lifeLeech += HEALTH_LEECH_INCREASE; } } @@ -796,7 +796,7 @@ void IOWheel::slotBlueBottom75(const std::shared_ptr &player, uint16_t p // SLOT_PURPLE_BOTTOM_75 = 28 void IOWheel::slotPurpleBottom75(const std::shared_ptr &player, uint16_t points, uint8_t, PlayerWheelMethodsBonusData &bonusData) const { bonusData.mitigation += MITIGATION_INCREASE * points; - if (isMaxPointAddedToSlot(player, points, WheelSlots_t::SLOT_PURPLE_BOTTOM_100)) { + if (isMaxPointAddedToSlot(player, points, WheelSlots_t::SLOT_PURPLE_BOTTOM_75)) { bonusData.leech.manaLeech += MANA_LEECH_INCREASE; } } @@ -898,7 +898,7 @@ void IOWheel::slotPurpleBottom150(const std::shared_ptr &player, uint16_ } else { bonusData.stats.mana += 6 * points; } - if (isMaxPointAddedToSlot(player, points, WheelSlots_t::SLOT_PURPLE_TOP_150)) { + if (isMaxPointAddedToSlot(player, points, WheelSlots_t::SLOT_PURPLE_BOTTOM_150)) { bonusData.leech.lifeLeech += HEALTH_LEECH_INCREASE; } }