-
Notifications
You must be signed in to change notification settings - Fork 146
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
Partial Armor Ignore System #659
Conversation
Signed-off-by: sanek31 <[email protected]>
Signed-off-by: sanek31 <[email protected]>
Signed-off-by: sanek31 <[email protected]>
Why would 70% protection, with 50% piercing reduce protection to 35%? |
because 35 is is 50% of 70 |
It's too early in the morning, sorry lmaoo 😭😭😭😭😭😭 |
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.
This needs dual @VMSolidus @OldDanceJacket approval before merge
put it in wrong component. Signed-off-by: sanek31 <[email protected]>
Signed-off-by: sanek31 <[email protected]>
Signed-off-by: sanek31 <[email protected]>
Signed-off-by: sanek31 <[email protected]>
Signed-off-by: sanek31 <[email protected]>
Signed-off-by: sanek31 <[email protected]>
test fail valid it seems like? |
@@ -125,7 +125,7 @@ public DamageSpecifier(DamageGroupPrototype group, FixedPoint2 value) | |||
/// Only applies resistance to a damage type if it is dealing damage, not healing. | |||
/// This will never convert damage into healing. | |||
/// </remarks> | |||
public static DamageSpecifier ApplyModifierSet(DamageSpecifier damageSpec, DamageModifierSet modifierSet) | |||
public static DamageSpecifier ApplyModifierSet(DamageSpecifier damageSpec, DamageModifierSet modifierSet, float br = 1) |
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.
the parameter should have a meaningful name.
@@ -165,15 +165,15 @@ public static DamageSpecifier ApplyModifierSet(DamageSpecifier damageSpec, Damag | |||
/// <param name="damageSpec"></param> | |||
/// <param name="modifierSets"></param> | |||
/// <returns></returns> | |||
public static DamageSpecifier ApplyModifierSets(DamageSpecifier damageSpec, IEnumerable<DamageModifierSet> modifierSets) | |||
public static DamageSpecifier ApplyModifierSets(DamageSpecifier damageSpec, IEnumerable<DamageModifierSet> modifierSets, float br = 1) |
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 as the above - those are public methods.
if (bypassResistance != null) | ||
{ | ||
damage = DamageSpecifier.ApplyModifierSet(damage, modifierSet,(float) bypassResistance); | ||
} | ||
else | ||
{ | ||
damage = DamageSpecifier.ApplyModifierSet(damage, modifierSet); | ||
} |
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 (bypassResistance != null) | |
{ | |
damage = DamageSpecifier.ApplyModifierSet(damage, modifierSet,(float) bypassResistance); | |
} | |
else | |
{ | |
damage = DamageSpecifier.ApplyModifierSet(damage, modifierSet); | |
} | |
damage = DamageSpecifier.ApplyModifierSet(damage, modifierSet, bypassResistance?.Value ?? 1f); |
|
||
if (modifierSet.Coefficients.TryGetValue(key, out var coefficient)) | ||
newValue *= coefficient; // coefficients can heal you, e.g. cauterizing bleeding | ||
newValue *= 1-coefficient*br; // coefficients can heal you, e.g. cauterizing bleeding |
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.
This is sussy and probably will never work as intended, instead making damage heal you.
Also, test fails are completely legitimate. You have type errors in your code and something tells me this was not tested... |
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.
im not a big fan of 'armour pierce' because it ultimately means that a bullet will have a final say in whether someone takes damage. that is to say if you pitted super armour and 100% armour pierce together, armour pierce will always win regardless of how strong the armour was.
really i think we should go for new damage calculation entirely, an 'armour contest' if you will.
Messed up the code. I'm gonna rewrite it |
Signed-off-by: sanek31 <[email protected]>
Signed-off-by: sanek31 <[email protected]>
I would say... that uh, I think there needs to be an option for % based piercing and value based piercing. i.e it pierces 5 of the armour value, or something. |
Signed-off-by: sanek31 <[email protected]>
Signed-off-by: sanek31 <[email protected]>
Signed-off-by: sanek31 <[email protected]>
Signed-off-by: sanek31 <[email protected]>
Signed-off-by: sanek31 <[email protected]>
Trying to do it locally , but for some reason it's doesn't works for melee weapons. |
You can find any help you need in our Discord if that's useful to you :) |
Melee weapons work on a different system entirely from guns, and the two have almost no overlap at all. |
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 would probably suggest not taking this route for armour penetration. Generic armour penetration can be added by simply modifying DamageSpecifier to take a 'piercing' field of some kind. This field is used when applying damages and what not with an armour value coming from elsewhere. Adding the piercing value in this way allows you to do it while modifying no other functions or APIs and while automatically adding support backwards for anything that deals damage.
Doing it the way it's being done now is manually adding hardcoded logic for certain weapons, which is certainly not the way forward. This should be generic and added to the usual set of APIs
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
ok |
I'll close for now, I'll make another pull request when I'm done. |
Reopen this one |
-->
Description
-->
Adds the ability to partially pierce armour.
Example:
Armor with 70% protection, when hit by a bullet with 50% penetration and 20 damage, the final damage will be 13 (as if the protection was 35%).
-->
-->
Media
finnaly.mp4
Changelog
-->
🆑 sanek31