-
Notifications
You must be signed in to change notification settings - Fork 27
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
Features.CustomStats #130
base: dev
Are you sure you want to change the base?
Features.CustomStats #130
Conversation
/// <summary> | ||
/// Gets or sets the maximum amount of stamina the player will have. | ||
/// </summary> | ||
public float CustomMaxValue { get; set; } |
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.
public float CustomMaxValue { get; set; } | |
public float CustomMaxValue { get; set; } = -1; |
public class CustomStaminaStat : StaminaStat | ||
{ | ||
/// <inheritdoc/> | ||
public override float MaxValue => CustomMaxValue == default ? base.MaxValue : CustomMaxValue; |
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.
public override float MaxValue => CustomMaxValue == default ? base.MaxValue : CustomMaxValue; | |
public override float MaxValue => CustomMaxValue == -1 ? base.MaxValue : CustomMaxValue; |
/// <param name="writer">The writer.</param> | ||
public override void WriteValue(NetworkWriter writer) | ||
{ | ||
if (CustomMaxValue == default) |
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.
if (CustomMaxValue == default) | |
if (CustomMaxValue == -1) |
/// </summary> | ||
/// <param name="reader">The reader.</param> | ||
/// <returns>the float value sync to server.</returns> | ||
public override float ReadValue(NetworkReader reader) => CustomMaxValue == default ? base.ReadValue(reader) : CurValue * CustomMaxValue; |
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.
public override float ReadValue(NetworkReader reader) => CustomMaxValue == default ? base.ReadValue(reader) : CurValue * CustomMaxValue; | |
public override float ReadValue(NetworkReader reader) => CustomMaxValue == -1 ? base.ReadValue(reader) : CurValue * CustomMaxValue; |
Thats things i think would make it able to set to 0 instead of being forced to something like 0.0001 or into the negatives which may cause issues |
Co-authored-by: Nameless <85962933+Misfiy@users.noreply.github.com>
_valueDirty = false; | ||
} | ||
|
||
if (ShieldRegeneration == 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.
Cool be interesting to override this value
/// <summary> | ||
/// Fix for <see cref="CustomStaminaStat"/>. | ||
/// </summary> | ||
[HarmonyPatch(typeof(FpcStateProcessor), nameof(FpcStateProcessor.UpdateMovementState))] |
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 am pretty sure there a way to not having to patch this event it's also in the wrong file
Description
Describe the changes
Add Features.CustomStats
What is the current behavior? (You can also link to an open issue here)
What is the new behavior? (if this is a feature change)
Ability to set MaxStamina & MaxHumeShield
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
Other information:
Types of changes
Submission checklist
Patches (if there are any changes related to Harmony patches)
Other