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.
This commit is contained in:
Geeves
2026-08-28 22:52:27 +00:00
committed by GitHub
parent 2ab49be382
commit f39b7ec1a5
4 changed files with 13 additions and 0 deletions
+4
View File
@@ -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
+3
View File
@@ -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
+2
View File
@@ -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")
@@ -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."