diff --git a/EpicLoot/CHANGELOG.md b/EpicLoot/CHANGELOG.md index ca6b644b..c31ba182 100644 --- a/EpicLoot/CHANGELOG.md +++ b/EpicLoot/CHANGELOG.md @@ -1,3 +1,8 @@ +## Version 0.10.5 + +* Fixed magiceffects ItemUsesStaminaOnAttack, ItemUsesEitrOnAttack, ItemUsesHealthOnAttack, and ItemUsesDrawStaminaOnAttack not resolving correctly when set to true. +* Changed Warmth effect to only roll on Epic and above. + ## Version 0.10.4 * New configuration GatedFreebuildMode to control when items are unlocked when using the free build enchantment. Defaults to BossKillUnlocksCurrentBiomePieces. diff --git a/EpicLoot/EpicLoot.cs b/EpicLoot/EpicLoot.cs index 0e8bf77e..f4274b18 100644 --- a/EpicLoot/EpicLoot.cs +++ b/EpicLoot/EpicLoot.cs @@ -92,7 +92,7 @@ public class EpicLoot : BaseUnityPlugin { public const string PluginId = "randyknapp.mods.epicloot"; public const string DisplayName = "Epic Loot"; - public const string Version = "0.10.4"; + public const string Version = "0.10.5"; private readonly ConfigSync _configSync = new ConfigSync(PluginId) { DisplayName = DisplayName, CurrentVersion = Version, MinimumRequiredVersion = "0.10.0" }; diff --git a/EpicLoot/Properties/AssemblyInfo.cs b/EpicLoot/Properties/AssemblyInfo.cs index 3a1f74fd..0b08b23b 100644 --- a/EpicLoot/Properties/AssemblyInfo.cs +++ b/EpicLoot/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.10.4")] -[assembly: AssemblyFileVersion("0.10.4")] +[assembly: AssemblyVersion("0.10.5")] +[assembly: AssemblyFileVersion("0.10.5")] diff --git a/EpicLoot/config/magiceffects.json b/EpicLoot/config/magiceffects.json index 2196ef58..8db76e3a 100644 --- a/EpicLoot/config/magiceffects.json +++ b/EpicLoot/config/magiceffects.json @@ -2207,6 +2207,11 @@ "Requirements" : { "AllowedItemTypes" : [ "Shoulder" + ], + "AllowedRarities" : [ + "Epic", + "Legendary", + "Mythic" ] }, "SelectionWeight" : 1, diff --git a/EpicLoot/src/Magic/MagicItemEffectDefinition.cs b/EpicLoot/src/Magic/MagicItemEffectDefinition.cs index faa853ef..1625fbc6 100644 --- a/EpicLoot/src/Magic/MagicItemEffectDefinition.cs +++ b/EpicLoot/src/Magic/MagicItemEffectDefinition.cs @@ -325,36 +325,51 @@ public bool CheckRequirements([NotNull] ItemDrop.ItemData itemData, [NotNull] Ma return false; } - if (ItemUsesStaminaOnAttack != null && - ((ItemUsesStaminaOnAttack == itemData.m_shared.m_attack.m_attackStamina <= 0) || - (ItemUsesStaminaOnAttack == itemData.m_shared.m_secondaryAttack.m_attackStamina <= 0))) + if (ItemUsesStaminaOnAttack != null) { - return false; + bool hasStamina = itemData.m_shared.m_attack.m_attackStamina > 0 || + itemData.m_shared.m_secondaryAttack.m_attackStamina > 0; + if (ItemUsesStaminaOnAttack.Value != hasStamina) + { + return false; + } } - - if (ItemUsesEitrOnAttack != null && - ((ItemUsesEitrOnAttack == itemData.m_shared.m_attack.m_attackEitr <= 0) || - (ItemUsesEitrOnAttack == itemData.m_shared.m_attack.m_drawEitrDrain <= 0) || - (ItemUsesEitrOnAttack == itemData.m_shared.m_attack.m_reloadEitrDrain <= 0) || - (ItemUsesEitrOnAttack == itemData.m_shared.m_secondaryAttack.m_attackEitr <= 0) || - (ItemUsesEitrOnAttack == itemData.m_shared.m_secondaryAttack.m_drawEitrDrain <= 0) || - (ItemUsesEitrOnAttack == itemData.m_shared.m_secondaryAttack.m_reloadEitrDrain <= 0))) + + if (ItemUsesEitrOnAttack != null) { - return false; + bool hasEitr = itemData.m_shared.m_attack.m_attackEitr > 0 || + itemData.m_shared.m_attack.m_drawEitrDrain > 0 || + itemData.m_shared.m_attack.m_reloadEitrDrain > 0 || + itemData.m_shared.m_secondaryAttack.m_attackEitr > 0 || + itemData.m_shared.m_secondaryAttack.m_drawEitrDrain > 0 || + itemData.m_shared.m_secondaryAttack.m_reloadEitrDrain > 0; + + if (ItemUsesEitrOnAttack.Value != hasEitr) + { + return false; + } } - if (ItemUsesHealthOnAttack != null && - ((ItemUsesHealthOnAttack == itemData.m_shared.m_attack.m_attackHealth <= 0) || - (ItemUsesHealthOnAttack == itemData.m_shared.m_secondaryAttack.m_attackHealth <= 0))) + if (ItemUsesHealthOnAttack != null) { - return false; + bool usesHealth = itemData.m_shared.m_attack.m_attackHealth > 0 || + itemData.m_shared.m_secondaryAttack.m_attackHealth > 0; + + if (ItemUsesHealthOnAttack.Value != usesHealth) + { + return false; + } } - - if (ItemUsesDrawStaminaOnAttack != null && - ((ItemUsesDrawStaminaOnAttack == itemData.m_shared.m_attack.m_drawStaminaDrain <= 0) || - (ItemUsesDrawStaminaOnAttack == itemData.m_shared.m_secondaryAttack.m_drawStaminaDrain <= 0))) + + if (ItemUsesDrawStaminaOnAttack != null) { - return false; + bool drawStamina = itemData.m_shared.m_attack.m_drawStaminaDrain > 0 || + ItemUsesDrawStaminaOnAttack == itemData.m_shared.m_secondaryAttack.m_drawStaminaDrain > 0; + + if (ItemUsesDrawStaminaOnAttack.Value != drawStamina) + { + return false; + } } return true;