Refactors beams. Adds tethering. IV drips/bags are now tethered. (#29570)

* refactor

* tether

* tetherrrs

* logic fix (i hope)

* ci fix

* ok please work
This commit is contained in:
Contrabang
2025-07-09 14:49:40 +00:00
committed by GitHub
parent 6c2aa06eb3
commit 1f124ac835
15 changed files with 404 additions and 106 deletions
+4 -3
View File
@@ -54,9 +54,8 @@
current_target = target
active = TRUE
var/datum/beam/current_beam = new(user,current_target,time=6000,beam_icon_state="medbeam",btype=/obj/effect/ebeam/medical)
var/datum/beam/current_beam = user.Beam(current_target, "medbeam", time = 10 MINUTES, beam_type = /obj/effect/ebeam/medical)
beam_UID = current_beam.UID()
INVOKE_ASYNC(current_beam, TYPE_PROC_REF(/datum/beam, Start))
SSblackbox.record_feedback("tally", "gun_fired", 1, type)
@@ -87,6 +86,8 @@
/obj/item/gun/medbeam/proc/los_check(atom/movable/user, mob/target)
var/turf/user_turf = user.loc
var/datum/beam/current_beam = locateUID(beam_UID)
if(QDELETED(current_beam))
return FALSE
if(mounted)
user_turf = get_turf(user)
else if(!istype(user_turf))
@@ -104,7 +105,7 @@
qdel(dummy)
return FALSE
for(var/obj/effect/ebeam/medical/B in turf)// Don't cross the str-beams!
if(B.owner != current_beam)
if(B.owner && B.owner != current_beam && !QDELETED(B)) // only blow up if it has a CONFIRMED different owner than us. Don't want it blowing up on creation/deletion of beams.
turf.visible_message("<span class='userdanger'>The medbeams cross and EXPLODE!</span>")
explosion(B.loc,0,3,5,8, cause = "Crossed beams")
qdel(dummy)