Paradise icon indicating copy to clipboard operation
Paradise copied to clipboard

Moves chainsaw buff application to afterattack()

Open Gatchapod opened this issue 2 years ago • 1 comments

What Does This PR Do

fixes #18787 Moves the actual application of the Syndicate chainsaw buff to afterattack() to prevent it from triggering on attempted surgery. This prevents exploiting it to maintain indefinite buff without harming anyone. Makes robots valid targets for buff acquisition now that it can be done without outright incapacitating them, as suggested by Qwerty who originally reworked the chainsaw. Removes some redundant code, like playing a sound effect for unwielded chainsaw, which is played anyway. Slightly unintended, but sadly unavoidable, side-effect is that attempting a surgery on a valid target using a chainsaw will knock them prone for 8 seconds. I consider this an acceptable behaviour, given the fact this PR fixes an exploit. Attempting surgery with a Syndicate chainsaw is more likely to be a user error than actual intended choice, so it could even be considered a feature.

Why It's Good For The Game

One less exploit is good.

Testing

Spawned in with a bunch of greys. Killed a standing grey using a Syndicate chainsaw on all four intents. Butchered the grey. Buckled another grey to a roller bed. Performed surgery on help intent, both wielded and unwielded. Attacked on the other three intents and successfully butchered the buckled grey on harm intent. Gave yet another grey a riot shield. Got the buff from blocked attacks. Got the buff from attacking robots, simple mobs (only if they survive a hit). Got no buff from attacking inanimate objects. Killed everything and destroyed whatever was meant to be destroyable.

Changelog

:cl: fix: Syndicate chainsaw no longer grants its buff upon attempting a surgery /:cl:

Gatchapod avatar Aug 15 '22 02:08 Gatchapod

This is currently broken and doesn't even fix the exploit. Quite the opposite, now you can run around with a surgery window and trigger the buff at will by closing the window, making the exploit stronger. It also makes unwielded chainsaw incapable of harming living mobs, but that's an easily fixable oversight. I'll think a bit more about how to approach this, but I'm close to just giving up.

Gatchapod avatar Aug 15 '22 17:08 Gatchapod