diff --git a/EpicLoot/EpicLoot.csproj b/EpicLoot/EpicLoot.csproj
index 08a668af7..a9c60a18f 100644
--- a/EpicLoot/EpicLoot.csproj
+++ b/EpicLoot/EpicLoot.csproj
@@ -232,6 +232,7 @@
+
diff --git a/EpicLoot/ItemDrop_Patch_MagicItemTooltip.cs b/EpicLoot/ItemDrop_Patch_MagicItemTooltip.cs
index 1cbbb3b0b..4cba418de 100644
--- a/EpicLoot/ItemDrop_Patch_MagicItemTooltip.cs
+++ b/EpicLoot/ItemDrop_Patch_MagicItemTooltip.cs
@@ -126,6 +126,9 @@ private static bool Prefix(ref string __result, ItemDrop.ItemData item, int qual
var magicParry = magicItem.HasEffect(MagicEffectType.ModifyParry);
var totalParryBonusMod = magicItem.GetTotalEffectValue(MagicEffectType.ModifyParry, 0.01f);
var magicParryColor = magicParry ? magicColor : "orange";
+ var magicParryForce = magicItem.HasEffect(MagicEffectType.ModifyParryForce);
+ var magicParryForceColor = magicParryForce ? magicColor : "orange";
+ var deflectionForce = item.GetDeflectionForce(qualityLevel);
switch (item.m_shared.m_itemType)
{
case ItemDrop.ItemData.ItemType.Consumable:
@@ -172,10 +175,12 @@ private static bool Prefix(ref string __result, ItemDrop.ItemData item, int qual
var blockPowerTooltipValue = item.GetBlockPowerTooltip(qualityLevel);
var blockPowerPercentageString = blockPowerTooltipValue.ToString("0");
text.Append($"\n$item_blockpower: {baseBlockPower1} ({blockPowerPercentageString})");
+ if (deflectionForce > 0)
+ {
+ text.Append($"\n$item_deflection: {deflectionForce}");
+ }
if (item.m_shared.m_timedBlockBonus > 1.0)
{
- text.Append($"\n$item_deflection: {item.GetDeflectionForce(qualityLevel)}");
-
var timedBlockBonus = item.m_shared.m_timedBlockBonus;
if (magicParry)
{
@@ -214,10 +219,12 @@ private static bool Prefix(ref string __result, ItemDrop.ItemData item, int qual
blockPowerTooltipValue = item.GetBlockPowerTooltip(qualityLevel);
var str5 = blockPowerTooltipValue.ToString("0");
text.Append($"\n$item_blockpower: {baseBlockPower2} ({str5})");
+ if (deflectionForce > 0)
+ {
+ text.Append($"\n$item_deflection: {deflectionForce}");
+ }
if (item.m_shared.m_timedBlockBonus > 1.0)
{
- text.Append($"\n$item_deflection: {item.GetDeflectionForce(qualityLevel)}");
-
var timedBlockBonus = item.m_shared.m_timedBlockBonus;
if (magicParry)
{
@@ -559,7 +566,7 @@ public static Tuple PreprocessTooltipStat(ItemDrop.ItemData item
break;
case "$item_deflection":
- if (magicItem.HasEffect(MagicEffectType.ModifyParry))
+ if (magicItem.HasEffect(MagicEffectType.ModifyParryForce))
{
value = $"{item.GetDeflectionForce(item.m_quality)}";
}
diff --git a/EpicLoot/MagicItemEffectDefinitions_Setup.cs b/EpicLoot/MagicItemEffectDefinitions_Setup.cs
index b4962b90e..a264499c9 100644
--- a/EpicLoot/MagicItemEffectDefinitions_Setup.cs
+++ b/EpicLoot/MagicItemEffectDefinitions_Setup.cs
@@ -17,6 +17,7 @@ public static partial class MagicEffectType
public static string RemoveSpeedPenalty = nameof(RemoveSpeedPenalty);
public static string ModifyBlockPower = nameof(ModifyBlockPower);
public static string ModifyParry = nameof(ModifyParry);
+ public static string ModifyParryForce = nameof(ModifyParryForce);
public static string ModifyArmor = nameof(ModifyArmor);
public static string ModifyBackstab = nameof(ModifyBackstab);
public static string IncreaseHealth = nameof(IncreaseHealth);
diff --git a/EpicLoot/MagicItemEffects/ModifyBlockPower.cs b/EpicLoot/MagicItemEffects/ModifyBlockPower.cs
index d602d6cc5..fca9416ee 100644
--- a/EpicLoot/MagicItemEffects/ModifyBlockPower.cs
+++ b/EpicLoot/MagicItemEffects/ModifyBlockPower.cs
@@ -16,13 +16,13 @@ public static void Postfix(ItemDrop.ItemData __instance, ref float __result)
totalBlockPowerMod += MagicEffectsHelper.GetTotalActiveMagicEffectValue(player, __instance, effect, 0.01f);
});
- __result *= 1.0f + totalBlockPowerMod;
-
if (player != null && player.m_leftItem == null && player.HasActiveMagicEffect(MagicEffectType.Duelist))
{
- __result += __instance.GetDamage().GetTotalDamage() * player.GetTotalActiveMagicEffectValue(MagicEffectType.Duelist, 0.01f);
+ totalBlockPowerMod += player.GetTotalActiveMagicEffectValue(MagicEffectType.Duelist, 0.01f);
}
+ __result *= 1.0f + totalBlockPowerMod;
+
__result = (float)Math.Round(__result, 1);
}
}
diff --git a/EpicLoot/MagicItemEffects/ModifyParry.cs b/EpicLoot/MagicItemEffects/ModifyParry.cs
index 2f0723f46..0305c3b2d 100644
--- a/EpicLoot/MagicItemEffects/ModifyParry.cs
+++ b/EpicLoot/MagicItemEffects/ModifyParry.cs
@@ -3,29 +3,6 @@
namespace EpicLoot.MagicItemEffects
{
- //public float GetDeflectionForce(int quality)
- [HarmonyPatch(typeof(ItemDrop.ItemData), nameof(ItemDrop.ItemData.GetDeflectionForce), typeof(int))]
- public static class ModifyParry_ItemData_GetDeflectionForce_Patch
- {
- public static void Postfix(ItemDrop.ItemData __instance, ref float __result)
- {
- var player = PlayerExtensions.GetPlayerWithEquippedItem(__instance);
- var totalParryMod = 0f;
- ModifyWithLowHealth.Apply(player, MagicEffectType.ModifyParry, effect =>
- {
- totalParryMod += MagicEffectsHelper.GetTotalActiveMagicEffectValueForWeapon(player, __instance, effect, 0.01f);
- });
-
- __result *= 1.0f + totalParryMod;
- if (player != null && player.m_leftItem == null && MagicEffectsHelper.HasActiveMagicEffect(player, __instance, MagicEffectType.Duelist))
- {
- __result += __instance.GetDamage().GetTotalDamage() / 2 * MagicEffectsHelper.GetTotalActiveMagicEffectValueForWeapon(player, __instance, MagicEffectType.Duelist, 0.01f);
- }
-
- __result = (float) Math.Round(__result, 1);
- }
- }
-
//public override bool BlockAttack(HitData hit, Character attacker)
[HarmonyPatch(typeof(Humanoid), nameof(Humanoid.BlockAttack))]
public static class ModifyParry_Humanoid_BlockAttack_Patch
diff --git a/EpicLoot/MagicItemEffects/ModifyParryForce.cs b/EpicLoot/MagicItemEffects/ModifyParryForce.cs
new file mode 100644
index 000000000..f0e1ab6bc
--- /dev/null
+++ b/EpicLoot/MagicItemEffects/ModifyParryForce.cs
@@ -0,0 +1,29 @@
+using System;
+using HarmonyLib;
+
+namespace EpicLoot.MagicItemEffects
+{
+ //public float GetDeflectionForce(int quality)
+ [HarmonyPatch(typeof(ItemDrop.ItemData), nameof(ItemDrop.ItemData.GetDeflectionForce), typeof(int))]
+ public static class ModifyParryForce_ItemData_GetDeflectionForce_Patch
+ {
+ public static void Postfix(ItemDrop.ItemData __instance, ref float __result)
+ {
+ var player = PlayerExtensions.GetPlayerWithEquippedItem(__instance);
+ var totalParryForceMod = 0f;
+ ModifyWithLowHealth.Apply(player, MagicEffectType.ModifyParryForce, effect =>
+ {
+ totalParryForceMod += MagicEffectsHelper.GetTotalActiveMagicEffectValueForWeapon(player, __instance, effect, 0.01f);
+ });
+
+ if (player != null && player.m_leftItem == null && MagicEffectsHelper.HasActiveMagicEffect(player, __instance, MagicEffectType.Duelist))
+ {
+ totalParryForceMod += MagicEffectsHelper.GetTotalActiveMagicEffectValueForWeapon(player, __instance, MagicEffectType.Duelist, 0.01f) / 2.0f;
+ }
+
+ __result *= 1.0f + totalParryForceMod;
+
+ __result = (float) Math.Round(__result, 1);
+ }
+ }
+}
\ No newline at end of file
diff --git a/EpicLoot/magiceffects.json b/EpicLoot/magiceffects.json
index f0d527e92..f80e8e4c0 100644
--- a/EpicLoot/magiceffects.json
+++ b/EpicLoot/magiceffects.json
@@ -322,6 +322,38 @@
"$mod_epicloot_me_modifyparry_suffix1"
]
},
+ {
+ "Type" : "ModifyParryForce",
+ "DisplayText" : "$mod_epicloot_me_modifyparryforce_display",
+ "Description" : "$mod_epicloot_me_modifyparryforce_desc",
+ "Requirements" : {
+ "AllowedItemTypes" : [
+ "Shield",
+ "TwoHandedWeapon"
+ ],
+ "ExcludedSkillTypes": [
+ "Pickaxes"
+ ],
+ "ExcludedItemNames": [
+ "$item_shield_serpentscale"
+ ],
+ "ItemHasParryPower" : true
+ },
+ "ValuesPerRarity" : {
+ "Magic" : { "MinValue" : 10, "MaxValue" : 20, "Increment" : 1 },
+ "Rare" : { "MinValue" : 10, "MaxValue" : 20, "Increment" : 1 },
+ "Epic" : { "MinValue" : 10, "MaxValue" : 20, "Increment" : 1 },
+ "Legendary" : { "MinValue" : 15, "MaxValue" : 25, "Increment" : 1 }
+ },
+ "SelectionWeight" : 1,
+ "Prefixes": [
+ "$mod_epicloot_me_modifyparryforce_prefix1",
+ "$mod_epicloot_me_modifyparryforce_prefix2"
+ ],
+ "Suffixes": [
+ "$mod_epicloot_me_modifyparryforce_suffix1"
+ ]
+ },
{
"Type" : "ModifyArmor",
"DisplayText" : "$mod_epicloot_me_modifyarmor_display",
diff --git a/EpicLoot/translations.json b/EpicLoot/translations.json
index 21d0c0611..7bbc46bc9 100644
--- a/EpicLoot/translations.json
+++ b/EpicLoot/translations.json
@@ -586,10 +586,15 @@
"mod_epicloot_me_modifyblockpower_suffix1": "Stopping",
"mod_epicloot_me_modifyblockpower_suffix2": "the Defender",
"mod_epicloot_me_modifyparry_display": "Parry +{0:0.#}%",
- "mod_epicloot_me_modifyparry_desc": "Increase the parry block armor, parry force, and parry bonus of the magic by +X%.",
+ "mod_epicloot_me_modifyparry_desc": "Increase the parry block armor and parry bonus of the magic item by +X%.",
"mod_epicloot_me_modifyparry_prefix1": "Elusive",
"mod_epicloot_me_modifyparry_prefix2": "Rebuking",
"mod_epicloot_me_modifyparry_suffix1": "Repelling",
+ "mod_epicloot_me_modifyparryforce_display": "Parry Force +{0:0.#}%",
+ "mod_epicloot_me_modifyparryforce_desc": "Increase the parry force of the magic item by +X%.",
+ "mod_epicloot_me_modifyparryforce_prefix1": "Weighty",
+ "mod_epicloot_me_modifyparryforce_prefix2": "Ponderous",
+ "mod_epicloot_me_modifyparryforce_suffix1": "Tossing",
"mod_epicloot_me_modifyarmor_display": "Armor +{0:0.#}%",
"mod_epicloot_me_modifyarmor_desc": "Increase the armor value of the magic equipment by +X%.",
"mod_epicloot_me_modifyarmor_prefix1": "Heavy",
@@ -950,7 +955,7 @@
"mod_epicloot_me_opportunist_prefix1": "Opportunist's",
"mod_epicloot_me_opportunist_suffix1": "Opportunity",
"mod_epicloot_me_duelist_display": "Duelist +{0:0.#}%",
- "mod_epicloot_me_duelist_desc": "When using the magic weapon without anything in the player's off hand, its block armor is increased by +X% of the weapon's attack power, and its parry force is increased by +X/2% of the weapon's attack power.",
+ "mod_epicloot_me_duelist_desc": "When using the magic weapon without anything in the player's off hand, its block armor is increased by +X%. Half of the effect value applied to parry force.",
"mod_epicloot_me_duelist_prefix1": "Duelist's",
"mod_epicloot_me_duelist_suffix1": "Dueling",
"mod_epicloot_me_immovable_display": "Immovable",