mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 23:23:28 +01:00
Updates the proximity monitor component (#15836)
* prox component update * mochi review * bug fix, makes proximity sensors always active * GC fixes and removes an unused proc * Disposal fixes from TM * fixes runtimes when objects created in nullspace runtimes, fixes portable flasher * a fresh perspective * lewcc review * adds comment about direct loc setting over forceMove
This commit is contained in:
@@ -12,10 +12,6 @@
|
||||
var/obj/item/tank/bombtank = null //the second part of the bomb is a plasma tank
|
||||
origin_tech = "materials=1;engineering=1"
|
||||
|
||||
/obj/item/onetankbomb/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/proximity_monitor)
|
||||
|
||||
/obj/item/onetankbomb/examine(mob/user)
|
||||
. = ..()
|
||||
. += bombtank.examine(user)
|
||||
@@ -41,10 +37,10 @@
|
||||
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You disassemble [src].</span>")
|
||||
bombassembly.loc = user.loc
|
||||
bombassembly.forceMove(user.loc)
|
||||
bombassembly.master = null
|
||||
bombassembly = null
|
||||
bombtank.loc = user.loc
|
||||
bombtank.forceMove(user.loc)
|
||||
bombtank.master = null
|
||||
bombtank = null
|
||||
qdel(src)
|
||||
@@ -119,11 +115,11 @@
|
||||
|
||||
R.bombassembly = S //Tell the bomb about its assembly part
|
||||
S.master = R //Tell the assembly about its new owner
|
||||
S.loc = R //Move the assembly out of the fucking way
|
||||
S.forceMove(R) //Move the assembly out of the fucking way
|
||||
|
||||
R.bombtank = src //Same for tank
|
||||
master = R
|
||||
loc = R
|
||||
forceMove(R)
|
||||
R.update_icon()
|
||||
return
|
||||
|
||||
|
||||
@@ -50,8 +50,6 @@
|
||||
A2.holder = src
|
||||
a_left = A1
|
||||
a_right = A2
|
||||
if(has_prox_sensors())
|
||||
AddComponent(/datum/component/proximity_monitor)
|
||||
name = "[A1.name]-[A2.name] assembly"
|
||||
update_icon()
|
||||
return TRUE
|
||||
@@ -183,10 +181,10 @@
|
||||
return FALSE
|
||||
if(a_left)
|
||||
a_left.holder = null
|
||||
a_left.loc = T
|
||||
a_left.forceMove(T)
|
||||
if(a_right)
|
||||
a_right.holder = null
|
||||
a_right.loc = T
|
||||
a_right.forceMove(T)
|
||||
qdel(src)
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
/obj/item/assembly/prox_sensor/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/proximity_monitor)
|
||||
AddComponent(/datum/component/proximity_monitor, _always_active = TRUE)
|
||||
|
||||
/obj/item/assembly/prox_sensor/describe()
|
||||
if(timing)
|
||||
|
||||
@@ -146,7 +146,6 @@
|
||||
trigger.forceMove(src)
|
||||
trigger.master = src
|
||||
trigger.holder = src
|
||||
AddComponent(/datum/component/proximity_monitor)
|
||||
to_chat(user, "<span class='notice'>You attach [W] to [src].</span>")
|
||||
return TRUE
|
||||
else if(istype(W, /obj/item/assembly))
|
||||
@@ -166,7 +165,6 @@
|
||||
trigger.master = null
|
||||
trigger.holder = null
|
||||
trigger = null
|
||||
qdel(GetComponent(/datum/component/proximity_monitor))
|
||||
|
||||
/obj/item/clothing/mask/muzzle/safety/shock/proc/can_shock(obj/item/clothing/C)
|
||||
if(istype(C))
|
||||
@@ -188,10 +186,6 @@
|
||||
M.Jitter(20)
|
||||
return
|
||||
|
||||
/obj/item/clothing/mask/muzzle/safety/shock/HasProximity(atom/movable/AM)
|
||||
if(trigger)
|
||||
trigger.HasProximity(AM)
|
||||
|
||||
|
||||
/obj/item/clothing/mask/muzzle/safety/shock/hear_talk(mob/living/M as mob, list/message_pieces)
|
||||
if(trigger)
|
||||
|
||||
@@ -170,7 +170,6 @@
|
||||
to_chat(usr, "<span class='notice'>You detach [assembly] from [src]</span>")
|
||||
usr.put_in_hands(assembly)
|
||||
assembly = null
|
||||
qdel(GetComponent(/datum/component/proximity_monitor))
|
||||
update_icon()
|
||||
else
|
||||
to_chat(usr, "<span class='notice'>There is no assembly to remove.</span>")
|
||||
@@ -187,8 +186,6 @@
|
||||
assembly = W
|
||||
user.drop_item()
|
||||
W.forceMove(src)
|
||||
if(assembly.has_prox_sensors())
|
||||
AddComponent(/datum/component/proximity_monitor)
|
||||
overlays += "assembly"
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -153,7 +153,6 @@
|
||||
usr.visible_message("<span class='notice'>[usr] detaches [rig] from [src].</span>", "<span class='notice'>You detach [rig] from [src].</span>")
|
||||
rig.forceMove(get_turf(usr))
|
||||
rig = null
|
||||
qdel(GetComponent(/datum/component/proximity_monitor))
|
||||
lastrigger = null
|
||||
overlays.Cut()
|
||||
|
||||
@@ -176,8 +175,6 @@
|
||||
rig = H
|
||||
user.drop_item()
|
||||
H.forceMove(src)
|
||||
if(rig.has_prox_sensors())
|
||||
AddComponent(/datum/component/proximity_monitor)
|
||||
var/icon/test = getFlatIcon(H)
|
||||
test.Shift(NORTH, 1)
|
||||
test.Shift(EAST, 6)
|
||||
|
||||
@@ -804,6 +804,8 @@
|
||||
for(var/atom/movable/AM in H)
|
||||
AM.forceMove(T)
|
||||
AM.pipe_eject(direction)
|
||||
SEND_SIGNAL(AM, COMSIG_MOVABLE_EXIT_DISPOSALS)
|
||||
|
||||
spawn(1)
|
||||
if(AM)
|
||||
AM.throw_at(target, 100, 1)
|
||||
@@ -819,6 +821,8 @@
|
||||
|
||||
AM.forceMove(T)
|
||||
AM.pipe_eject(0)
|
||||
SEND_SIGNAL(AM, COMSIG_MOVABLE_EXIT_DISPOSALS)
|
||||
|
||||
spawn(1)
|
||||
if(AM)
|
||||
AM.throw_at(target, 5, 1)
|
||||
|
||||
Reference in New Issue
Block a user