-
Notifications
You must be signed in to change notification settings - Fork 452
NyanoCombat Part 4: MeleeSystem Refactor Part 2, Electric Boogaloo #934
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
Merged
VMSolidus
merged 10 commits into
Simple-Station:master
from
VMSolidus:Nyanocombat-Part-4-Melee-Refactor-2-Electric-Boogaloo
Sep 20, 2024
Merged
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e613571
Someone is going to have a stroke reading this
VMSolidus 3170c83
I forgot datafields
VMSolidus a6735e4
Make ContestArgs so that other systems can use this
VMSolidus 7453c26
Even Less hardcode this
VMSolidus 1c02192
Clear all defaults for the constructor
VMSolidus c3cbae3
Default ContestArgs for Melee
VMSolidus 74408dc
Making the EveryContest return more compact
VMSolidus 854b7c9
Update ContestsSystem.Utilities.cs
VMSolidus 8501d68
Remove unused _config
VMSolidus 6c01eaf
Merge branch 'master' into Nyanocombat-Part-4-Melee-Refactor-2-Electr…
VMSolidus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.Utility.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| using Content.Shared.CCVar; | ||
|
|
||
| namespace Content.Shared.Weapons.Melee; | ||
|
|
||
| public abstract partial class SharedMeleeWeaponSystem : EntitySystem | ||
| { | ||
| /// <summary> | ||
| /// Constructor for feeding options from a given MeleeWeaponComponent into the ContestsSystem. | ||
| /// Just multiply by this and give it a user EntityUid and a MeleeWeapon component. That's all you need to know. | ||
| /// </summary> | ||
| public float MeleeContestInteractions(EntityUid user, MeleeWeaponComponent component) | ||
| { | ||
| if (!_config.GetCVar(CCVars.DoContestsSystem)) | ||
| return 1; | ||
|
|
||
| return 1 | ||
| * (component.DoMassInteraction ? ((!component.MassDisadvantage | ||
| ? _contests.MassContest(user, component.MassBypassClamp, component.MassRangeModifier) | ||
| : 1 / _contests.MassContest(user, component.MassBypassClamp, component.MassRangeModifier)) | ||
| + component.MassOffset) | ||
| : 1) | ||
| * (component.DoStaminaInteraction ? ((!component.StaminaDisadvantage | ||
| ? _contests.StaminaContest(user, component.StaminaBypassClamp, component.StaminaRangeModifier) | ||
| : 1 / _contests.StaminaContest(user, component.StaminaBypassClamp, component.StaminaRangeModifier)) | ||
| + component.StaminaOffset) | ||
| : 1) | ||
| * (component.DoHealthInteraction ? ((!component.HealthDisadvantage | ||
| ? _contests.HealthContest(user, component.HealthBypassClamp, component.HealthRangeModifier) | ||
| : 1 / _contests.HealthContest(user, component.HealthBypassClamp, component.HealthRangeModifier)) | ||
| + component.HealthOffset) | ||
| : 1) | ||
| * (component.DoMindInteraction ? ((!component.MindDisadvantage | ||
| ? _contests.MindContest(user, component.MindBypassClamp, component.MindRangeModifier) | ||
| : 1 / _contests.MindContest(user, component.MindBypassClamp, component.MindRangeModifier)) | ||
| + component.MindOffset) | ||
| : 1) | ||
| * (component.DoMoodInteraction ? ((!component.MoodDisadvantage | ||
| ? _contests.MoodContest(user, component.MoodBypassClamp, component.MoodRangeModifier) | ||
| : 1 / _contests.MoodContest(user, component.MoodBypassClamp, component.MoodRangeModifier)) | ||
| + component.MoodOffset) | ||
| : 1) | ||
| * (component.DoEveryInteraction ? (!component.EveryDisadvantage | ||
| ? _contests.EveryContest(user, | ||
| component.MassBypassClamp, | ||
| component.StaminaBypassClamp, | ||
| component.HealthBypassClamp, | ||
| component.MindBypassClamp, | ||
| component.MoodBypassClamp, | ||
| component.MassRangeModifier, | ||
| component.StaminaRangeModifier, | ||
| component.HealthRangeModifier, | ||
| component.MindRangeModifier, | ||
| component.MoodRangeModifier, | ||
| component.EveryMassWeight, | ||
| component.EveryStaminaWeight, | ||
| component.EveryHealthWeight, | ||
| component.EveryMindWeight, | ||
| component.EveryMoodWeight, | ||
| component.EveryInteractionSumOrMultiply) | ||
| : 1 / _contests.EveryContest(user, | ||
| component.MassBypassClamp, | ||
| component.StaminaBypassClamp, | ||
| component.HealthBypassClamp, | ||
| component.MindBypassClamp, | ||
| component.MoodBypassClamp, | ||
| component.MassRangeModifier, | ||
| component.StaminaRangeModifier, | ||
| component.HealthRangeModifier, | ||
| component.MindRangeModifier, | ||
| component.MoodRangeModifier, | ||
| component.EveryMassWeight, | ||
| component.EveryStaminaWeight, | ||
| component.EveryHealthWeight, | ||
| component.EveryMindWeight, | ||
| component.EveryMoodWeight, | ||
| component.EveryInteractionSumOrMultiply)) | ||
| : 1); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why is this added if not used, just asking.
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.
Probably a leftover from when the Contest Constructor lived in a Partial of SharedMeleeWeaponSystem.