Skip to content
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

Gun Safety PSA - Keep your gun safeties on to prevent accidental discharges! #3312

Merged
merged 18 commits into from
Sep 14, 2024

Conversation

Gristlebee
Copy link
Contributor

@Gristlebee Gristlebee commented Aug 26, 2024

About The Pull Request

Unsafetied guns have a small chance to go off and fire on their own under select conditions, which are currently:

  • Being thrown and hitting something.
  • Being on a ship when it takes off or docks. (Having it stored in a stable container eg. lockers/crates, protect it from going off)
  • Falling down while carrying a gun (Shoves, slips, etc)
  • Paralyzes while holding a gun
    • Having your gun holstered lowers the chance of it going off from falling down due to the aforementioned causes
  • Being EMPed if it's an energy weapon.

Modifies fire_casing so it works without a user.

Why It's Good For The Game

Makes guns a bit more dangerous (to yourself mainly), and reinforces the fact guns are Dangerous Weapons and you should be careful with them by adding a mechanical reason to have your safety on outside of combat and properly securing your weapons.

adds more medical gameplay due to increased injuries

Changelog

🆑
add: Unsaftied guns can go off on their own.
code: Changes ammo casing firing code so it's able to work without a user.
/:cl:

@github-actions github-actions bot added the Code change Watch something violently break. label Aug 26, 2024
@Orchidthederg
Copy link
Contributor

I thought this was already a thing! Overdue tbh. Very nice.

@Martinpachu
Copy link
Contributor

how does this interact with storage like bags and guncases?

@Gristlebee
Copy link
Contributor Author

how does this interact with storage like bags and guncases?

If it's loaded, and unsafe. It can still go off and hit someone

@Gristlebee
Copy link
Contributor Author

how does this interact with storage like bags and guncases?

If it's loaded, and unsafe. It can still go off and hit someone

hm. just checked it actually doesnt go off if it's in a storage and not on a person. Thats probably easy enough to fix

@Anticept
Copy link
Contributor

Anticept commented Aug 27, 2024

While they are dangerous weapons, guns do not readily go off even if you drop them. Usually this is because of poor care. I like the change, but if its stored like in a holster, it should be less likely to occur. Someone hitting the ground with it in their hand might accidentally hit the trigger and usually THAT is what causes negligent discharges.

@Formerxboxgamer
Copy link

This is a fun idea, though I don’t know if it makes sense for holstered lasers to go off when they’re jostled from a ship moving. Though this never really happens - ballistic weapons could plausibly be explained as going off from sudden movement if the firing pin is dislodged and hits the bullet, but lasers… I dunno. Any weapon in someone’s hand could go off when falling down, since most negligent discharges in life happen when the gun is in someone’s hand and their finger is where it’s not supposed to be.

@rye-rice
Copy link
Member

Needs a TM, amazing pr I've been wanting this for so long

var/target
if(!safety)
// someone is very unlucky and about to be shot
if(prob(seek_chance))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be VERY VERY VERY low or not exist at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

base chance has been reduced to 10%, and on throw now has been reduced to a 50% chance, as a coin flip hail mary option to throw your gun as a last resort

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still think it's too much honestly, should be pretty rare and absolutely not reliable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 and 20 sound okay for base and throw respectively?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chance to seek is just a flat 10% now, and should be seen even less with the reduced misfire chances now.

@Anticept
Copy link
Contributor

Anticept commented Aug 28, 2024

This is a fun idea, though I don’t know if it makes sense for holstered lasers to go off when they’re jostled from a ship moving. Though this never really happens - ballistic weapons could plausibly be explained as going off from sudden movement if the firing pin is dislodged and hits the bullet, but lasers… I dunno. Any weapon in someone’s hand could go off when falling down, since most negligent discharges in life happen when the gun is in someone’s hand and their finger is where it’s not supposed to be.

Firing pins are spring loaded with a pretty powerful spring and take a pretty considerable force to even unseat them... like the hammer. Not all of them, but its really uncommon. A really crappy built improvised weapon, old design, or modded one might be more prone but usually that would be more issues with the bolt carrier jamming due to the precision needed.

Modern safeties such as the drop safety mechanism aside, really the most prone are long arms.

STILL, fun PR.

chance_to_fire = GUN_NO_SAFETY_MALFUNCTION_CHANCE_MEDIUM
if(at_risk.safety == FALSE && prob(chance_to_fire))
if(at_risk.process_fire(src,src,FALSE, null, pick(BODY_ZONE_L_LEG,BODY_ZONE_R_LEG)) == TRUE)
visible_message(span_danger("\The [at_risk.name]'s trigger gets caught as [src] falls, suddenly going off into [src]'s leg! Should have had the safeties on."), span_danger("\The [at_risk.name]'s trigger gets caught on something as you fall, suddenly going off into your leg without it's safeties on!"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
visible_message(span_danger("\The [at_risk.name]'s trigger gets caught as [src] falls, suddenly going off into [src]'s leg! Should have had the safeties on."), span_danger("\The [at_risk.name]'s trigger gets caught on something as you fall, suddenly going off into your leg without it's safeties on!"))
visible_message(span_danger("\The [at_risk.name]'s trigger gets caught as [src] falls, suddenly going off into [src]'s leg!"), span_danger("\The [at_risk.name]'s trigger gets caught on something as you fall, suddenly going off into your leg!"))

i understand the thought but maybe its, like, too on the nose.

Copy link
Contributor Author

@Gristlebee Gristlebee Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is a bit on the nose, but I think it's important to have feedback why you got shot/punished so you can correct. I dont think it feels great to not know why a punishment mechanic happened.

code/__DEFINES/guns.dm Outdated Show resolved Hide resolved
code/modules/shuttle/on_move.dm Show resolved Hide resolved
code/modules/projectiles/gun.dm Outdated Show resolved Hide resolved
code/modules/shuttle/on_move.dm Outdated Show resolved Hide resolved
@Gristlebee Gristlebee marked this pull request as draft August 29, 2024 05:21
@Gristlebee
Copy link
Contributor Author

This still needs to cook some more, so Im setting this to draft

@Gristlebee Gristlebee marked this pull request as ready for review August 29, 2024 22:22
@Gristlebee
Copy link
Contributor Author

Requested changes have been implemented, the bugs that Im aware of have been ironed out. This should be good for review again unless Im stupid and missed something

@Apogee-dev
Copy link
Contributor

This is a fun idea, though I don’t know if it makes sense for holstered lasers to go off when they’re jostled from a ship moving. Though this never really happens - ballistic weapons could plausibly be explained as going off from sudden movement if the firing pin is dislodged and hits the bullet, but lasers… I dunno. Any weapon in someone’s hand could go off when falling down, since most negligent discharges in life happen when the gun is in someone’s hand and their finger is where it’s not supposed to be.

Firing pins are spring loaded with a pretty powerful spring and take a pretty considerable force to even unseat them... like the hammer. Not all of them, but its really uncommon. A really crappy built improvised weapon, old design, or modded one might be more prone but usually that would be more issues with the bolt carrier jamming due to the precision needed.

Modern safeties such as the drop safety mechanism aside, really the most prone are long arms.

STILL, fun PR.

On this note, we DO have quite a number of open bolt SMGs that would reasonably have a dramatically higher chance to misfire than other arms

@Zevotech
Copy link
Contributor

Crawling over a slippery surface (motor oil, mainly) can still cause a gun to misfire.

@Leon9621
Copy link

Crawling over a slippery surface (motor oil, mainly) can still cause a gun to misfire.

In this same vein, someone accidentally tackled a table, got stunned, and had a safety's commisioner go off into their leg.

@Gristlebee
Copy link
Contributor Author

Gristlebee commented Sep 2, 2024

Crawling over a slippery surface (motor oil, mainly) can still cause a gun to misfire.

That was one fixed, and was from earlier version of the PR.

In this same vein, someone accidentally tackled a table, got stunned, and had a safety's commisioner go off into their leg.

So with tackle code, it knocks you down (which rolls the chance for a misfire) then if you hit a table with items on it, it applies paralyze to you (which can also roll misfire). That's intended behavior, though it triggering with the safety on isnt. I wasn't able to recreate the bug though with a commisioner with the safety on and also tackling a table, so this also might be a case of a bug from the earlier version.

@fighterslam
Copy link
Contributor

image
Misfires aren't logged very well. It just shows if someone threw an item, and that they got hit by a projectile - but if this was several different players, it would be difficult and unclear to try to track this down.

@rye-rice rye-rice added this pull request to the merge queue Sep 14, 2024
Merged via the queue into shiptest-ss13:master with commit 8740dd7 Sep 14, 2024
13 of 14 checks passed
@@ -69,6 +69,11 @@
#define MANUFACTURER_PGF "the Etherbor Industries emblem"
#define MANUFACTURER_IMPORT "Lanchester Import Co."

// Misfire chances if the gun's safety is off
#define GUN_NO_SAFETY_MALFUNCTION_CHANCE_LOW 100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened here

MysticalFaceLesS pushed a commit to CeladonSS13/Shiptest that referenced this pull request Sep 22, 2024
…harges! (shiptest-ss13#3312)

<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

Unsafetied guns have a small chance to go off and fire on their own
under select conditions, which are currently:
- Being thrown and hitting something.
- Being on a ship when it takes off or docks. (Having it stored in a
stable container eg. lockers/crates, protect it from going off)
- Falling down while carrying a gun (Shoves, slips, etc)
- Paralyzes while holding a gun
- Having your gun holstered lowers the chance of it going off from
falling down due to the aforementioned causes
- Being EMPed if it's an energy weapon.

Modifies fire_casing so it works without a user.

## Why It's Good For The Game

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

Makes guns a bit more dangerous (to yourself mainly), and reinforces the
fact guns are Dangerous Weapons and you should be careful with them by
adding a mechanical reason to have your safety on outside of combat and
properly securing your weapons.

~~adds more medical gameplay due to increased injuries~~

## Changelog

:cl:
add: Unsaftied guns can go off on their own.
code: Changes ammo casing firing code so it's able to work without a
user.
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
MrCat15352 pushed a commit to MrCat15352/MrCat that referenced this pull request Dec 24, 2024
…harges! (shiptest-ss13#3312)

<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

Unsafetied guns have a small chance to go off and fire on their own
under select conditions, which are currently:
- Being thrown and hitting something.
- Being on a ship when it takes off or docks. (Having it stored in a
stable container eg. lockers/crates, protect it from going off)
- Falling down while carrying a gun (Shoves, slips, etc)
- Paralyzes while holding a gun
- Having your gun holstered lowers the chance of it going off from
falling down due to the aforementioned causes
- Being EMPed if it's an energy weapon.

Modifies fire_casing so it works without a user.

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

Makes guns a bit more dangerous (to yourself mainly), and reinforces the
fact guns are Dangerous Weapons and you should be careful with them by
adding a mechanical reason to have your safety on outside of combat and
properly securing your weapons.

~~adds more medical gameplay due to increased injuries~~

:cl:
add: Unsaftied guns can go off on their own.
code: Changes ammo casing firing code so it's able to work without a
user.
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code change Watch something violently break.
Projects
None yet
Development

Successfully merging this pull request may close these issues.