-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhancement: negative bonus effects #2200
base: main
Are you sure you want to change the base?
Conversation
@@ -2084,6 +2084,10 @@ public virtual void TryAttack(Entity target) | |||
if (this is Player && !(enemy is Resource)) | |||
{ | |||
var lifestealRate = thisPlayer.GetEquipmentBonusEffect(ItemEffect.Lifesteal) / 100f; | |||
if (lifestealRate < 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this if, regardless of the value being negative, it will not pass the next check on the line 2094
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why he shouldn't pass the next inspection? After all, this is just an exception which, if there is a minus value, sets it to 0, i.e. the default basic amount. This change must be made, otherwise lifesteal will not work properly, as I have already explained. unless I don't understand what you mean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will explain this further. If we didn't have this "if", then if we had -30% lifesteal and used a healing spell whose formula had e.g. -10 to heal by 10, then there would be an error in the code. because lifestealrate -30% * basedamage -10, gives a positive result, which causes additional treatment.
@@ -2099,6 +2103,10 @@ public virtual void TryAttack(Entity target) | |||
} | |||
|
|||
var manastealRate = (thisPlayer.GetEquipmentBonusEffect(ItemEffect.Manasteal) / 100f); | |||
if (manastealRate < 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this if, regardless of the value being negative, it will not pass the next check on the line 2113
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same situation here. After all, it's just an exception that checks whether the lifestealrate or manastealrate is minus. if so, change it to 0, i.e. the default value. So it should not interfere with the next check regarding +0msg
Okay, I know what weylon means. I will make sure that the treatment works properly and lifesteal takes the user's life with a negative value. |
Two changes are introduced. This means that if we do not deal damage and if we deal damage to ourselves, e.g. a trap that uses a self spell that deals damage, then neither lifesteal nor manasteal works. Moreover, I added options in the characterwindow so that if lifesteal or manasteal had a negative value, it does not show them, it only shows 0. I don't know how to do it via the server.
|
How about adding that life theft would show negative values in charcterwindows as 0 (lifestealrate). thanks to which we have both 0 and a negative value, thanks to which we know how much we currently have |
Added the ability to set negative bonus effect values.
Negative CDR increases spell cooldown.
Negative Tenacity increases the duration of effect, e.g. stun, but does not cause the damage to be duplicated over time.
A negative exp and luck bonus results in lower chances of drops and lower exp for the player.
Lifesteal and manasteal are negative, it works like 0, but if other equipment adds lifesteal or manasteal, it is known that the minus value takes it into account. PS: Works as 0 because healing spells have minus values, which causes a minus lifesteal to double the healing
The characterwindow has also been changed so that negative values can be shown