mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 16:47:13 +01:00
Made admin circuits more abstract, they no longer end up in the contents of the shell. (#62630)
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
This commit is contained in:
co-authored by
Watermelon914
parent
d6a897d05c
commit
bb8bcd2473
@@ -63,7 +63,7 @@
|
||||
reason_failed.set_output("Object marked is not an ID! Using no ID instead.")
|
||||
|
||||
// Get both the current turf and the destination's turf
|
||||
var/turf/current_turf = get_turf(src)
|
||||
var/turf/current_turf = get_location()
|
||||
var/turf/destination = locate(target_X, target_Y, current_turf?.z)
|
||||
|
||||
// We're already here! No need to do anything.
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
var/atom/object = input_port.value
|
||||
if(!object)
|
||||
return
|
||||
var/turf/location = get_turf(src)
|
||||
var/turf/location = get_location()
|
||||
|
||||
if(object.z != location.z || get_dist(location, object) > max_range)
|
||||
output.set_output(null)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
/obj/item/circuit_component/gps/input_received(datum/port/input/port)
|
||||
|
||||
var/turf/location = get_turf(src)
|
||||
var/turf/location = get_location()
|
||||
|
||||
x_pos.set_output(location?.x)
|
||||
y_pos.set_output(location?.y)
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
/obj/item/circuit_component/health/input_received(datum/port/input/port)
|
||||
|
||||
var/mob/living/organism = input_port.value
|
||||
var/turf/current_turf = get_turf(src)
|
||||
var/turf/current_turf = get_location()
|
||||
if(!istype(organism) || get_dist(current_turf, organism) > max_range || current_turf.z != organism.z)
|
||||
brute.set_output(null)
|
||||
burn.set_output(null)
|
||||
|
||||
@@ -27,6 +27,17 @@
|
||||
trigger_port = add_output_port("Triggered", PORT_TYPE_SIGNAL)
|
||||
become_hearing_sensitive(ROUNDSTART_TRAIT)
|
||||
|
||||
/obj/item/circuit_component/hear/register_shell(atom/movable/shell)
|
||||
if(parent.loc != shell)
|
||||
shell.become_hearing_sensitive(CIRCUIT_HEAR_TRAIT)
|
||||
RegisterSignal(shell, COMSIG_MOVABLE_HEAR, .proc/on_shell_hear)
|
||||
|
||||
/obj/item/circuit_component/hear/unregister_shell(atom/movable/shell)
|
||||
REMOVE_TRAIT(shell, TRAIT_HEARING_SENSITIVE, CIRCUIT_HEAR_TRAIT)
|
||||
|
||||
/obj/item/circuit_component/hear/proc/on_shell_hear(datum/source, list/arguments)
|
||||
return Hear(arglist(arguments))
|
||||
|
||||
/obj/item/circuit_component/hear/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, list/message_mods)
|
||||
if(speaker == parent?.shell)
|
||||
return
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
var/atom/target_entity = target.value
|
||||
|
||||
if(is_in_sight(target_entity, get_turf(src)) && IN_GIVEN_RANGE(get_turf(src), target_entity, max_range))
|
||||
if(is_in_sight(target_entity, get_location()) && IN_GIVEN_RANGE(get_location(), target_entity, max_range))
|
||||
var/turf/location = get_turf(target_entity)
|
||||
|
||||
x_pos.set_output(location?.x)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
/obj/item/circuit_component/pressuresensor/input_received(datum/port/input/port)
|
||||
//Get current turf
|
||||
var/turf/location = get_turf(src)
|
||||
var/turf/location = get_location()
|
||||
if(!location)
|
||||
result.set_output(null)
|
||||
return
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
/obj/item/circuit_component/tempsensor/input_received(datum/port/input/port)
|
||||
//Get current turf
|
||||
var/turf/location = get_turf(src)
|
||||
var/turf/location = get_location()
|
||||
if(!location)
|
||||
result.set_output(null)
|
||||
return
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
var/value = input_port.value
|
||||
if(isatom(value))
|
||||
var/turf/location = get_turf(src)
|
||||
var/turf/location = get_location()
|
||||
var/turf/target_location = get_turf(value)
|
||||
if(target_location.z != location.z || get_dist(location, target_location) > max_range)
|
||||
output.set_output(PORT_TYPE_ATOM)
|
||||
|
||||
Reference in New Issue
Block a user