From f39b7ec1a58f303e67fbc2fb8d7c72917c99b44b Mon Sep 17 00:00:00 2001 From: Geeves <22774890+Geevies@users.noreply.github.com> Date: Fri, 28 Aug 2026 22:52:27 +0000 Subject: [PATCH] Throwing Firearms (#23085) * Firearms can no longer be thrown while on harm intent, preventing accidental throws when attempting to fire. AI usage disclosure: The code for the tweaks here was created using GPT 5.6 Sol. --- code/game/atoms_movable.dm | 4 ++++ code/modules/mob/inventory.dm | 3 +++ code/modules/projectiles/gun.dm | 2 ++ html/changelogs/Geeves-throwing_firearms.yml | 4 ++++ 4 files changed, 13 insertions(+) create mode 100644 html/changelogs/Geeves-throwing_firearms.yml diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 9704d222b63..d5fd014a170 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -24,6 +24,10 @@ var/datum/thrownthing/throwing = null var/throw_speed = 2 var/throw_range = 7 + /// Whether this movable can be thrown while its holder is on harm intent. + var/can_throw_on_harm = TRUE + /// The alert shown when attempting to throw this movable on harm intent while can_throw_on_harm is FALSE. + var/throw_on_harm_alert = "can't throw this on harm intent!" var/moved_recently = 0 var/atom/movable/pulledby = null diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 7ba8cf5677f..fdd415513de 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -413,6 +413,9 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( var/atom/movable/item = src.get_active_hand() if(!item) return FALSE + if(a_intent == I_HURT && !item.can_throw_on_harm) + balloon_alert(src, item.throw_on_harm_alert) + return TRUE var/throw_range = item.throw_range var/itemsize diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 55f06406841..1527a7cde18 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -55,6 +55,8 @@ ABSTRACT_TYPE(/obj/item/gun) throwforce = 5 throw_speed = 4 throw_range = 5 + can_throw_on_harm = FALSE + throw_on_harm_alert = "can't throw firearms on harm intent!" force = 11 origin_tech = list(TECH_COMBAT = 1) attack_verb = list("struck", "hit", "bashed") diff --git a/html/changelogs/Geeves-throwing_firearms.yml b/html/changelogs/Geeves-throwing_firearms.yml new file mode 100644 index 00000000000..185fbf02df9 --- /dev/null +++ b/html/changelogs/Geeves-throwing_firearms.yml @@ -0,0 +1,4 @@ +author: Geeves +delete-after: True +changes: + - qol: "Firearms can no longer be thrown while on harm intent, preventing accidental throws when attempting to fire."