-
-
Notifications
You must be signed in to change notification settings - Fork 544
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
Changes from all commits
24a3397
bc4a3ac
5e0f621
709cb1f
b53111a
89fb7de
10cc073
e26ec12
6576cf0
bbad2a1
5562778
808f6f9
b6aafd3
870f136
5282ab3
2e8a699
01971a8
1e85e61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -726,6 +726,11 @@ | |
if(zoomed) | ||
zoom(user, user.dir) | ||
|
||
/obj/item/gun/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) | ||
. = ..() | ||
if(prob(GUN_NO_SAFETY_MALFUNCTION_CHANCE_HIGH)) | ||
discharge("hits the ground hard") | ||
|
||
/obj/item/gun/update_overlays() | ||
. = ..() | ||
if(ismob(loc) && has_safety) | ||
|
@@ -945,6 +950,49 @@ | |
flash_loc.vis_contents -= muzzle_flash | ||
muzzle_flash.applied = FALSE | ||
|
||
// for guns firing on their own without a user | ||
/obj/item/gun/proc/discharge(cause, seek_chance = 10) | ||
var/target | ||
if(!safety) | ||
// someone is very unlucky and about to be shot | ||
if(prob(seek_chance)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 5 and 20 sound okay for base and throw respectively? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
for(var/mob/living/target_mob in range(6, get_turf(src))) | ||
if(!isInSight(src, target_mob)) | ||
continue | ||
target = target_mob | ||
break | ||
if(!target) | ||
var/fire_dir = pick(GLOB.alldirs) | ||
target = get_ranged_target_turf(get_turf(src),fire_dir,6) | ||
if(!chambered || !chambered.BB) | ||
visible_message(span_danger("\The [src] [cause ? "[cause], suddenly going off" : "suddenly goes off"] without its safteies on! Luckily it wasn't live.")) | ||
playsound(src, dry_fire_sound, 30, TRUE) | ||
else | ||
visible_message(span_danger("\The [src] [cause ? "[cause], suddenly going off" : "suddenly goes off"] without its safeties on!")) | ||
unsafe_shot(target) | ||
|
||
/obj/item/gun/proc/unsafe_shot(target) | ||
if(chambered) | ||
chambered.fire_casing(target,null, null, null, suppressed, ran_zone(BODY_ZONE_CHEST, 50), 0, src,TRUE) | ||
playsound(src, fire_sound, 100, TRUE) | ||
|
||
/mob/living/proc/trip_with_gun(cause) | ||
var/mob/living/carbon/human/human_holder | ||
if(ishuman(src)) | ||
human_holder = src | ||
for(var/obj/item/gun/at_risk in get_all_contents()) | ||
var/chance_to_fire = GUN_NO_SAFETY_MALFUNCTION_CHANCE_MEDIUM | ||
var/did_fire = FALSE | ||
if(human_holder) | ||
// gun is less likely to go off in a holster | ||
if(at_risk == human_holder.s_store) | ||
chance_to_fire = GUN_NO_SAFETY_MALFUNCTION_CHANCE_LOW | ||
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) | ||
log_combat(src,src,"misfired",at_risk,"caused by [cause]") | ||
visible_message(span_danger("\The [at_risk.name]'s trigger gets caught as [src] falls, suddenly going off into [src]'s leg without its safties on!"), span_danger("\The [at_risk.name]'s trigger gets caught on something as you fall, suddenly going off into your leg without its safeties on!")) | ||
emote("scream") | ||
|
||
//I need to refactor this into an attachment | ||
/datum/action/toggle_scope_zoom | ||
name = "Toggle Scope" | ||
|
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.
What happened here