Skip to content

Commit

Permalink
Epic Loot Version 0.10.5:
Browse files Browse the repository at this point in the history
* Fixed magiceffects ItemUsesStaminaOnAttack, ItemUsesEitrOnAttack, ItemUsesHealthOnAttack, and ItemUsesDrawStaminaOnAttack not resolving correctly when set to true.
* Changed Warmth effect to only roll on Epic and above.
  • Loading branch information
OrianaVenture committed Oct 31, 2024
1 parent 853f7b9 commit 999b0fc
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 25 deletions.
5 changes: 5 additions & 0 deletions EpicLoot/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion EpicLoot/EpicLoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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" };

Expand Down
4 changes: 2 additions & 2 deletions EpicLoot/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
5 changes: 5 additions & 0 deletions EpicLoot/config/magiceffects.json
Original file line number Diff line number Diff line change
Expand Up @@ -2207,6 +2207,11 @@
"Requirements" : {
"AllowedItemTypes" : [
"Shoulder"
],
"AllowedRarities" : [
"Epic",
"Legendary",
"Mythic"
]
},
"SelectionWeight" : 1,
Expand Down
59 changes: 37 additions & 22 deletions EpicLoot/src/Magic/MagicItemEffectDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 999b0fc

Please sign in to comment.