From 3690bd3d8afa6a6523abcad62dcf85c99a8e90d8 Mon Sep 17 00:00:00 2001 From: Joshua Kidder <49173900+Metekillot@users.noreply.github.com> Date: Sat, 14 Sep 2024 18:54:07 -0400 Subject: [PATCH] Add distance output to direction circuit component, resizes several shells (#86577) ## About The Pull Request The direction component outputs the direction of an entity if it's within 7 tiles of the circuit. Since it already checks the distance, I added distance as one of its outputs. Besides that, I did a pass over the generics and shells and resized many of them. Most I resized to be small or tiny, except for the airlock shell, which I set to be bulky because it's a whole ass door. The shells I didn't touch remain at 'normal' size. 1) All handheld shells set to small, compact remote set to tiny 2) all components and the generic of the circuit set to tiny 3) drone shell set to small 4) airlock shell set to bulky ## Why It's Good For The Game Returning the distance spares any would be circuiteers from having to do a labyrinthine set of calculations to determine distance themselves. Making most circuits more portable makes them more attractive for people to tote around. ## Changelog :cl: Bisar qol: The 'direction' circuit component now also returns the distance of its target. balance: Most circuit shells and the generic component and generic circuit have had their size reduced. balance: The airlock circuit shell has had its size increased. /:cl: --------- Co-authored-by: Metekillot Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> --- code/modules/wiremod/components/atom/direction.dm | 10 ++++++++-- code/modules/wiremod/core/component.dm | 1 + code/modules/wiremod/core/integrated_circuit.dm | 1 + code/modules/wiremod/shell/compact_remote.dm | 1 + code/modules/wiremod/shell/controller.dm | 1 + code/modules/wiremod/shell/keyboard.dm | 1 + code/modules/wiremod/shell/scanner.dm | 1 + code/modules/wiremod/shell/shell_items.dm | 3 +++ 8 files changed, 17 insertions(+), 2 deletions(-) diff --git a/code/modules/wiremod/components/atom/direction.dm b/code/modules/wiremod/components/atom/direction.dm index c2bbd5026c8..1b14e6505a4 100644 --- a/code/modules/wiremod/components/atom/direction.dm +++ b/code/modules/wiremod/components/atom/direction.dm @@ -13,6 +13,7 @@ /// The result from the output var/datum/port/output/output + var/datum/port/output/distance // Directions outputs var/datum/port/output/north @@ -30,9 +31,10 @@ . += create_ui_notice("Maximum Range: [max_range] tiles", "orange", "info") /obj/item/circuit_component/direction/populate_ports() - input_port = add_input_port("Organism", PORT_TYPE_ATOM) + input_port = add_input_port("Targeted Entity", PORT_TYPE_ATOM) output = add_output_port("Direction", PORT_TYPE_STRING) + distance = add_output_port("Distance", PORT_TYPE_NUMBER) north = add_output_port("North", PORT_TYPE_SIGNAL) east = add_output_port("East", PORT_TYPE_SIGNAL) @@ -45,8 +47,9 @@ if(!object) return var/turf/location = get_location() + var/measured_distance = get_dist(location, object) - if(object.z != location.z || get_dist(location, object) > max_range) + if(object.z != location.z || measured_distance > max_range) output.set_output(null) return @@ -61,3 +64,6 @@ east.set_output(COMPONENT_SIGNAL) if(direction & WEST) west.set_output(COMPONENT_SIGNAL) + + distance.set_output(measured_distance) + diff --git a/code/modules/wiremod/core/component.dm b/code/modules/wiremod/core/component.dm index 02e88e53c23..07f3a5b55a3 100644 --- a/code/modules/wiremod/core/component.dm +++ b/code/modules/wiremod/core/component.dm @@ -15,6 +15,7 @@ lefthand_file = 'icons/mob/inhands/items/devices_lefthand.dmi' righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi' custom_materials = list(/datum/material/glass = HALF_SHEET_MATERIAL_AMOUNT) + w_class = WEIGHT_CLASS_TINY /// The name of the component shown on the UI var/display_name = "Generic" diff --git a/code/modules/wiremod/core/integrated_circuit.dm b/code/modules/wiremod/core/integrated_circuit.dm index db1fd8ac588..8afc963b5a3 100644 --- a/code/modules/wiremod/core/integrated_circuit.dm +++ b/code/modules/wiremod/core/integrated_circuit.dm @@ -16,6 +16,7 @@ GLOBAL_LIST_EMPTY_TYPED(integrated_circuits, /obj/item/integrated_circuit) inhand_icon_state = "electronic" lefthand_file = 'icons/mob/inhands/items/devices_lefthand.dmi' righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi' + w_class = WEIGHT_CLASS_TINY /// The name that appears on the shell. var/display_name = "" diff --git a/code/modules/wiremod/shell/compact_remote.dm b/code/modules/wiremod/shell/compact_remote.dm index 0697a449dbe..3bf216a4c32 100644 --- a/code/modules/wiremod/shell/compact_remote.dm +++ b/code/modules/wiremod/shell/compact_remote.dm @@ -13,6 +13,7 @@ righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi' light_system = OVERLAY_LIGHT_DIRECTIONAL light_on = FALSE + w_class = WEIGHT_CLASS_TINY /obj/item/compact_remote/Initialize(mapload) . = ..() diff --git a/code/modules/wiremod/shell/controller.dm b/code/modules/wiremod/shell/controller.dm index ae0eb01b367..f68dd0c50b2 100644 --- a/code/modules/wiremod/shell/controller.dm +++ b/code/modules/wiremod/shell/controller.dm @@ -14,6 +14,7 @@ righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi' light_system = OVERLAY_LIGHT_DIRECTIONAL light_on = FALSE + w_class = WEIGHT_CLASS_SMALL /obj/item/controller/Initialize(mapload) . = ..() diff --git a/code/modules/wiremod/shell/keyboard.dm b/code/modules/wiremod/shell/keyboard.dm index 0b28959aa9c..86a57d50681 100644 --- a/code/modules/wiremod/shell/keyboard.dm +++ b/code/modules/wiremod/shell/keyboard.dm @@ -8,6 +8,7 @@ righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi' light_system = OVERLAY_LIGHT_DIRECTIONAL light_on = FALSE + w_class = WEIGHT_CLASS_SMALL /obj/item/keyboard_shell/Initialize(mapload) . = ..() diff --git a/code/modules/wiremod/shell/scanner.dm b/code/modules/wiremod/shell/scanner.dm index f32f91fa76f..29a061a535a 100644 --- a/code/modules/wiremod/shell/scanner.dm +++ b/code/modules/wiremod/shell/scanner.dm @@ -13,6 +13,7 @@ righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi' light_system = OVERLAY_LIGHT_DIRECTIONAL light_on = FALSE + w_class = WEIGHT_CLASS_SMALL /obj/item/wiremod_scanner/Initialize(mapload) . = ..() diff --git a/code/modules/wiremod/shell/shell_items.dm b/code/modules/wiremod/shell/shell_items.dm index 06929e3a04c..bad787033f9 100644 --- a/code/modules/wiremod/shell/shell_items.dm +++ b/code/modules/wiremod/shell/shell_items.dm @@ -39,6 +39,7 @@ name = "drone assembly" icon_state = "setup_medium_med-open" shell_to_spawn = /mob/living/circuit_drone + w_class = WEIGHT_CLASS_SMALL /obj/item/shell/server name = "server assembly" @@ -52,6 +53,7 @@ icon_state = "construction" shell_to_spawn = /obj/machinery/door/airlock/shell screw_delay = 10 SECONDS + w_class = WEIGHT_CLASS_BULKY /obj/item/shell/dispenser name = "circuit dispenser assembly" @@ -62,6 +64,7 @@ name = "brain-computer interface assembly" icon_state = "bci-open" shell_to_spawn = /obj/item/organ/internal/cyberimp/bci + w_class = WEIGHT_CLASS_TINY /obj/item/shell/scanner_gate name = "scanner gate assembly"