Skip to content

Commit

Permalink
Lifesteal and manasteal
Browse files Browse the repository at this point in the history
  • Loading branch information
cydyn committed Mar 30, 2024
1 parent 054bd3c commit 0baa30f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
20 changes: 18 additions & 2 deletions Intersect.Client/Interface/Game/Character/CharacterWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,15 @@ public void UpdateExtraBuffs(Guid itemId)
break;
case ItemEffect.Lifesteal:
LifeStealAmount += effect.Percentage;
mLifeSteal?.SetText(Strings.Character.Lifesteal.ToString(LifeStealAmount));
// Checks if LifeStealAmount is less than 0, if so, sets the text to "0"
if (LifeStealAmount < 0)
{
mLifeSteal?.SetText(Strings.Character.Lifesteal.ToString($"0 ({LifeStealAmount})"));
}
else
{
mLifeSteal?.SetText(Strings.Character.Lifesteal.ToString(LifeStealAmount));
}

break;
case ItemEffect.Tenacity:
Expand All @@ -483,7 +491,15 @@ public void UpdateExtraBuffs(Guid itemId)
break;
case ItemEffect.Manasteal:
ManaStealAmount += effect.Percentage;
mManaSteal?.SetText(Strings.Character.Manasteal.ToString(ManaStealAmount));
// Checks if ManaStealAmount is less than 0, if so, sets the text to "0"
if (ManaStealAmount < 0)
{
mManaSteal?.SetText(Strings.Character.Manasteal.ToString(0));
}
else
{
mManaSteal?.SetText(Strings.Character.Manasteal.ToString($"0 ({ManaStealAmount})"));
}

break;
}
Expand Down
3 changes: 2 additions & 1 deletion Intersect.Server.Core/Entities/Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2067,7 +2067,8 @@ public void Attack(
var thisPlayer = this as Player;

//Check for lifesteal/manasteal
if (this is Player && !(enemy is Resource))
if (baseDamage > 0 && this != enemy)
if (this is Player && !(enemy is Resource))
{
var lifestealRate = thisPlayer.GetEquipmentBonusEffect(ItemEffect.Lifesteal) / 100f;
if (lifestealRate < 0)
Expand Down

0 comments on commit 0baa30f

Please sign in to comment.