mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Adds the proximity monitor component. Performance improvement for turf/Entered (#14196)
* proximity monitor * Update code/__HELPERS/unsorted.dm Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> * farie review tweaks * actually I need this Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
This commit is contained in:
co-authored by
AffectedArc07
parent
ead6e898a3
commit
01da8413de
@@ -45,6 +45,42 @@
|
||||
if(prob(25))
|
||||
qdel(src)
|
||||
|
||||
/**
|
||||
* # The abstract object
|
||||
*
|
||||
* This is an object that is intended to able to be placed, but that is completely invisible.
|
||||
* The object should be immune to all forms of damage, or things that can delete it, such as the singularity, or explosions.
|
||||
*/
|
||||
/obj/effect/abstract
|
||||
name = "Abstract object"
|
||||
invisibility = INVISIBILITY_ABSTRACT
|
||||
layer = TURF_LAYER
|
||||
density = FALSE
|
||||
icon = null
|
||||
icon_state = null
|
||||
|
||||
// Most of these overrides procs below are overkill, but better safe than sorry.
|
||||
/obj/effect/abstract/swarmer_act()
|
||||
return
|
||||
|
||||
/obj/effect/abstract/bullet_act(obj/item/projectile/P)
|
||||
return
|
||||
|
||||
/obj/effect/abstract/decompile_act(obj/item/matter_decompiler/C, mob/user)
|
||||
return
|
||||
|
||||
/obj/effect/abstract/tesla_act(power)
|
||||
return
|
||||
|
||||
/obj/effect/abstract/singularity_act()
|
||||
return
|
||||
|
||||
/obj/effect/abstract/narsie_act()
|
||||
return
|
||||
|
||||
/obj/effect/abstract/ex_act(severity)
|
||||
return
|
||||
|
||||
/obj/effect/decal
|
||||
plane = FLOOR_PLANE
|
||||
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
||||
|
||||
@@ -62,6 +62,8 @@
|
||||
to_chat(user, "<span class='notice'>You attach the [A] to the valve controls and secure it.</span>")
|
||||
A.holder = src
|
||||
A.toggle_secure() //this calls update_icon(), which calls update_icon() on the holder (i.e. the bomb).
|
||||
if(istype(attached_device, /obj/item/assembly/prox_sensor))
|
||||
AddComponent(/datum/component/proximity_monitor)
|
||||
|
||||
investigate_log("[key_name(user)] attached a [A] to a transfer valve.", INVESTIGATE_BOMB)
|
||||
add_attack_logs(user, src, "attached [A] to a transfer valve", ATKLOG_FEW)
|
||||
@@ -137,6 +139,7 @@
|
||||
attached_device.forceMove(get_turf(src))
|
||||
attached_device.holder = null
|
||||
attached_device = null
|
||||
qdel(GetComponent(/datum/component/proximity_monitor))
|
||||
update_icon()
|
||||
else
|
||||
. = FALSE
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
var/armed = 0
|
||||
var/timepassed = 0
|
||||
|
||||
/obj/item/caution/proximity_sign/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/proximity_monitor)
|
||||
|
||||
/obj/item/caution/proximity_sign/attack_self(mob/user as mob)
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
@@ -40,7 +44,7 @@
|
||||
armed = 1
|
||||
timing = 0
|
||||
|
||||
/obj/item/caution/proximity_sign/HasProximity(atom/movable/AM as mob|obj)
|
||||
/obj/item/caution/proximity_sign/HasProximity(atom/movable/AM)
|
||||
if(armed)
|
||||
if(istype(AM, /mob/living/carbon) && !istype(AM, /mob/living/carbon/brain))
|
||||
var/mob/living/carbon/C = AM
|
||||
|
||||
@@ -190,6 +190,8 @@
|
||||
|
||||
user.drop_item()
|
||||
nadeassembly = A
|
||||
if(nadeassembly.has_prox_sensors())
|
||||
AddComponent(/datum/component/proximity_monitor)
|
||||
A.master = src
|
||||
A.loc = src
|
||||
assemblyattacher = user.ckey
|
||||
@@ -219,6 +221,7 @@
|
||||
nadeassembly.loc = get_turf(src)
|
||||
nadeassembly.master = null
|
||||
nadeassembly = null
|
||||
qdel(GetComponent(/datum/component/proximity_monitor))
|
||||
if(beakers.len)
|
||||
for(var/obj/O in beakers)
|
||||
O.loc = get_turf(src)
|
||||
@@ -304,6 +307,8 @@
|
||||
/obj/item/grenade/chem_grenade/proc/CreateDefaultTrigger(var/typekey)
|
||||
if(ispath(typekey,/obj/item/assembly))
|
||||
nadeassembly = new(src)
|
||||
if(nadeassembly.has_prox_sensors())
|
||||
AddComponent(/datum/component/proximity_monitor)
|
||||
nadeassembly.a_left = new /obj/item/assembly/igniter(nadeassembly)
|
||||
nadeassembly.a_left.holder = nadeassembly
|
||||
nadeassembly.a_left.secured = 1
|
||||
|
||||
@@ -280,12 +280,14 @@
|
||||
/obj/structure/alien/egg/proc/Grow()
|
||||
icon_state = "egg"
|
||||
status = GROWN
|
||||
AddComponent(/datum/component/proximity_monitor)
|
||||
|
||||
/obj/structure/alien/egg/proc/Burst(kill = TRUE) //drops and kills the hugger if any is remaining
|
||||
if(status == GROWN || status == GROWING)
|
||||
icon_state = "egg_hatched"
|
||||
flick("egg_opening", src)
|
||||
status = BURSTING
|
||||
qdel(GetComponent(/datum/component/proximity_monitor))
|
||||
spawn(15)
|
||||
status = BURST
|
||||
var/obj/item/clothing/mask/facehugger/child = GetFacehugger()
|
||||
|
||||
Reference in New Issue
Block a user