-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Cleanup ExecutionSystem #24382
Cleanup ExecutionSystem #24382
Conversation
… ActiveExecution Component. Transferred the Execution system into shared. Heavily re-wrote the system in order to reduce duplication, and remove gun code from the system. The melee weapon modifier which was dependant on swing rate was removed. The ActiveExecutionComponent was created in order to apply the damage modifier to the shot from a gun execution. It is added just before the gun fires and removed after an attempt is made.
Currently the gun system does not have a way to alter hitscan damage like it does with projectiles.
This reverts commit a46da64.
Everything about the shot goes through the gun system now. The Damage multiplier is only applied when a projectile impacts the target so people that get in the way don't get hit with 9 times damage for no reason. In order to make suicides work I needed to create fake EntityCoordinates because the gun system and the projectile system do not play well with a projectile that has the same start and end position.
The OnAmmoShotEvent is only raised on the server.
Resources/Prototypes/Entities/Objects/Weapons/Guns/Rifles/rifles.yml
Outdated
Show resolved
Hide resolved
Addressed reviews on overriding messages. Now I actually mark doafters as handled. Return normal cooldown to some meleeweapons I forgot on the previous commit.
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 still seems to double suicide a fair bit so we have 2 systems to maintain doing identical things.
Remove duplication
I'll check tomorrow if it can even be integrated into the SuicideSystem. |
Remove evil null coercion that I was sure I removed a while ago
Gonna suss this one out over the weekend sorry on the delay. |
All good thanks. If you know how I could get around the hack of having to create fake entity coordinated to use the gun system for shooting yourself that'd be amazing. |
The collision layer check doesn't work and I don't have time to fix it.
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
# Conflicts: # Content.Shared/Projectiles/SharedProjectileSystem.cs
This reverts commit bcbe2ec.
* Creat Execution Component and add to sharp items * Kill Server ExecutionSystem. Create ExecutionSystem in shared. Create ActiveExecution Component. Transferred the Execution system into shared. Heavily re-wrote the system in order to reduce duplication, and remove gun code from the system. The melee weapon modifier which was dependant on swing rate was removed. The ActiveExecutionComponent was created in order to apply the damage modifier to the shot from a gun execution. It is added just before the gun fires and removed after an attempt is made. * Fix bugs The execution completed text will now only show up if the gun fires. The client also no longer crashes because I forgot to network the component. * Remove clumsy text * Make BaseSword abstract * Add ExecutionComponent to every weapon * Fix bug * Remove execution comp from battery weapons Currently the gun system does not have a way to alter hitscan damage like it does with projectiles. * Cleanup * Revert "Remove clumsy text" This reverts commit a46da64. * Actually fix the ExecutionSystem Everything about the shot goes through the gun system now. The Damage multiplier is only applied when a projectile impacts the target so people that get in the way don't get hit with 9 times damage for no reason. In order to make suicides work I needed to create fake EntityCoordinates because the gun system and the projectile system do not play well with a projectile that has the same start and end position. * Make launchers able to execute * Fix prediction bug The OnAmmoShotEvent is only raised on the server. * Readd ability for clowns to accidentally shoot themselves while executing * Cleanup * Reset melee cooldown to initial value * Address reviews fix bug Addressed reviews on overriding messages. Now I actually mark doafters as handled. Return normal cooldown to some meleeweapons I forgot on the previous commit. * Address Reviews Remove duplication * Exorcise codebase Remove evil null coercion that I was sure I removed a while ago * Address reviews again * Remove melee weapon attack logic and rely on the system. Remove gun and melee checks. * Make system functional again and cleanup * Remove code I forgot to remove * Cleanup * stalled * Selectively revert gun penetration The collision layer check doesn't work and I don't have time to fix it. * Fixes --------- Co-authored-by: metalgearsloth <[email protected]>
Resolves #24180
About the PR
This prs cleans up the ExecutionSystem.
Additionally it has the following differences functionally from the current one:
Why / Balance
On the no extra damage modifier, I do not think that melee weapons should get a doafter modifier considering in an execution they will do 9 times damage. This can be altered back to its original condition if needed.
Technical details
The system was moved to Shared and as much as possible is now predicted.
Some functions were generalized or removed to reduce duplication.
All gun code is gone. It now just listen to some events made by the gun system.
All melee code gone. It now just listens to an event made by the melee system.
The ExecutionComponent is now added to all weapons that can execute. Using it you can modify values for the doafter, damage modifier, and the many different messages that may be shown on executions.
Swords got a base type as to not put the component on every single sword individually.
The ActiveExecutionComponent is added to guns just before they fire and removed right after in order to display the correct messages if the gun fires and to adjust the projectile if the person is shooting themselves so it can collide with them. Similar use for melee weapons.
The ExecutionProjectileComponent is added to projectiles as they fire. This is later used to make sure that people in the way of an execution don't get 9 times damage as well as to make sure that a clumsy clown shooting their foot doesn't either.
Note on strange thing: In order for me to get shooting yourself to work properly, I create fake coordinates that are slightly offset from the person. This is because otherwise we would be trying to shoot a projectile to its own positions which doesn't work.
Media
Breaking changes
Changelog
no cl no fun.