Skip to content

Commit

Permalink
refact(beacon): collapses bluespace beacons and beacons into a single…
Browse files Browse the repository at this point in the history
… type, minor code cleanup
  • Loading branch information
intercepti0n authored Feb 5, 2024
1 parent aa02d8c commit 2cb28e0
Show file tree
Hide file tree
Showing 25 changed files with 113 additions and 146 deletions.
4 changes: 2 additions & 2 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
#include "code\__std\stack.dm"
#include "code\__std\units.dm"
#include "code\__std\util.dm"
#include "code\_global_vars\bluespace_beacon.dm"
#include "code\_global_vars\configuration.dm"
#include "code\_global_vars\converter.dm"
#include "code\_global_vars\logging.dm"
Expand Down Expand Up @@ -775,7 +776,6 @@
#include "code\game\machinery\atmo_control.dm"
#include "code\game\machinery\autolathe.dm"
#include "code\game\machinery\autolathe_datums.dm"
#include "code\game\machinery\Beacon.dm"
#include "code\game\machinery\biogenerator.dm"
#include "code\game\machinery\bioprinter.dm"
#include "code\game\machinery\bluespacerelay.dm"
Expand Down Expand Up @@ -1093,6 +1093,7 @@
#include "code\game\objects\items\circuitboards\machinery\unary_atmos.dm"
#include "code\game\objects\items\devices\aicard.dm"
#include "code\game\objects\items\devices\binoculars.dm"
#include "code\game\objects\items\devices\bluespace_beacon.dm"
#include "code\game\objects\items\devices\cable_painter.dm"
#include "code\game\objects\items\devices\chameleonholo.dm"
#include "code\game\objects\items\devices\chameleonproj.dm"
Expand Down Expand Up @@ -1128,7 +1129,6 @@
#include "code\game\objects\items\devices\PDA\cart.dm"
#include "code\game\objects\items\devices\PDA\PDA.dm"
#include "code\game\objects\items\devices\PDA\radio.dm"
#include "code\game\objects\items\devices\radio\beacon.dm"
#include "code\game\objects\items\devices\radio\electropack.dm"
#include "code\game\objects\items\devices\radio\encryptionkey.dm"
#include "code\game\objects\items\devices\radio\headset.dm"
Expand Down
1 change: 1 addition & 0 deletions code/_global_vars/bluespace_beacon.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GLOBAL_LIST_EMPTY(bluespace_beacons)
2 changes: 1 addition & 1 deletion code/controllers/subsystems/supply.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ SUBSYSTEM_DEF(supply)
return 1
if(istype(A,/obj/machinery/nuclearbomb))
return 1
if(istype(A,/obj/item/device/radio/beacon))
if(istype(A, /obj/item/device/bluespace_beacon))
return 1

for(var/i=1, i<=A.contents.len, i++)
Expand Down
50 changes: 0 additions & 50 deletions code/game/machinery/Beacon.dm

This file was deleted.

4 changes: 2 additions & 2 deletions code/game/machinery/computer/teleporter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,11 @@

switch(mode)
if(MODE_TELEPORT)
// TO-DO: refactor beacons to use their own global list.
for(var/obj/item/device/radio/beacon/beacon in world)
for(var/obj/item/device/bluespace_beacon/beacon as anything in GLOB.bluespace_beacons)
var/turf/T = get_turf(beacon)
if(!is_suitable(T))
continue

LAZYSET(targets, avoid_assoc_duplicate_keys(T.loc.name, areaindex), beacon)
if(MODE_TARGET)
// TO-DO: refactor implants to use their own global list.
Expand Down
51 changes: 51 additions & 0 deletions code/game/objects/items/devices/bluespace_beacon.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/obj/item/device/bluespace_beacon
name = "tracking beacon"
desc = "A device that draws power from bluespace and creates a permanent bluespace anchor."

icon_state = "beacon"
item_state = "signaler"

matter = list(MATERIAL_STEEL = 20, MATERIAL_GLASS = 10)

origin_tech = list(TECH_BLUESPACE = 1)

/obj/item/device/bluespace_beacon/Initialize()
. = ..()
GLOB.bluespace_beacons += src

/obj/item/device/bluespace_beacon/Destroy()
GLOB.bluespace_beacons -= src
return ..()

/obj/item/device/bluespace_beacon/hidden
name = "stealth tracking beacon"
desc = parent_type::desc + " This one is a bit shy..."

icon = 'icons/obj/objects.dmi'
icon_state = "floor_beacon"

level = 1

anchored = TRUE
randpixel = FALSE

/obj/item/device/bluespace_beacon/hidden/attackby(obj/item/W, mob/user)
if(isWrench(W) && loc == get_turf(src))
wrench_floor_bolts(user)
return

return ..()

/obj/item/device/bluespace_beacon/hidden/Initialize()
. = ..()

if(isturf(loc))
var/turf/loc_turf = loc
hide(!loc_turf.is_plating())

/obj/item/device/bluespace_beacon/hidden/hide(hide)
if(!anchored)
return

..()
update_icon()
35 changes: 0 additions & 35 deletions code/game/objects/items/devices/radio/beacon.dm

This file was deleted.

17 changes: 9 additions & 8 deletions code/game/objects/items/devices/radio/radio.dm
Original file line number Diff line number Diff line change
Expand Up @@ -516,14 +516,15 @@
user.set_machine(src)
if (!( isScrewdriver(W) ))
return
b_stat = !( b_stat )
if(!istype(src, /obj/item/device/radio/beacon))
if (b_stat)
user.show_message("<span class='notice'>\The [src] can now be attached and modified!</span>")
else
user.show_message("<span class='notice'>\The [src] can no longer be modified or attached!</span>")
updateDialog()
return

b_stat = !b_stat
if(b_stat)
user.show_message(SPAN("notice", "\The [src] can now be attached and modified!"))
else
user.show_message(SPAN("notice", "\The [src] can no longer be modified or attached!"))

updateDialog()
return

/obj/item/device/radio/emp_act(severity)
broadcasting = 0
Expand Down
31 changes: 15 additions & 16 deletions code/game/objects/items/weapons/teleportation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,21 @@ Frequency:
if (sr)
temp += "<B>Located Beacons:</B><BR>"

for(var/obj/item/device/radio/beacon/W in GLOB.listening_objects)
if (W.frequency == frequency)
var/turf/tr = get_turf(W)
if (tr.z == sr.z && tr)
var/direct = max(abs(tr.x - sr.x), abs(tr.y - sr.y))
if (direct < 5)
direct = "very strong"
for(var/obj/item/device/bluespace_beacon/W as anything in GLOB.bluespace_beacons)
var/turf/tr = get_turf(W)
if (tr.z == sr.z && tr)
var/direct = max(abs(tr.x - sr.x), abs(tr.y - sr.y))
if (direct < 5)
direct = "very strong"
else
if (direct < 10)
direct = "strong"
else
if (direct < 10)
direct = "strong"
if (direct < 20)
direct = "weak"
else
if (direct < 20)
direct = "weak"
else
direct = "very weak"
temp += "[W.code]-[dir2text(get_dir(sr, tr))]-[direct]<BR>"
direct = "very weak"
temp += "[tr.loc.name]-[dir2text(get_dir(sr, tr))]-[direct]<BR>"

temp += "<B>Extranneous Signals:</B><BR>"
for (var/obj/item/implant/tracking/W in GLOB.listening_objects)
Expand Down Expand Up @@ -431,7 +430,7 @@ Frequency:
// Looks for all beacons located on station levels (station + tcomms for now) and adds them to refreshed (emptied) list of areas to teleport to.
/obj/item/vortex_manipulator/proc/get_beacon_locations()
beacon_locations = list()
for(var/obj/item/device/radio/beacon/R in GLOB.listening_objects)
for(var/obj/item/device/bluespace_beacon/R as anything in GLOB.bluespace_beacons)
var/area/AR = get_area(R)
if(beacon_locations.Find(AR.name)) continue
var/turf/picked = pick(get_area_turfs(AR.type))
Expand Down Expand Up @@ -570,7 +569,7 @@ Frequency:
return
if(user && user.buckled)
user.buckled.unbuckle_mob()
for(var/obj/item/device/radio/beacon/R in GLOB.listening_objects)
for(var/obj/item/device/bluespace_beacon/R as anything in GLOB.bluespace_beacons)
if(get_area(R) == thearea)
var/turf/T = get_turf(R)
phase_out(user,get_turf(user))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/spacesuits/rig/suits/station.dm
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
boot_type = /obj/item/clothing/shoes/magboots/rig/hazmat
glove_type = /obj/item/clothing/gloves/rig/hazmat

allowed = list(/obj/item/device/flashlight,/obj/item/tank,/obj/item/device/suit_cooling_unit,/obj/item/stack/flag,/obj/item/storage/excavation,/obj/item/pickaxe,/obj/item/device/healthanalyzer,/obj/item/device/measuring_tape,/obj/item/device/ano_scanner,/obj/item/device/depth_scanner,/obj/item/device/core_sampler,/obj/item/device/gps,/obj/item/pinpointer/radio,/obj/item/device/radio/beacon,/obj/item/pickaxe/archaeologist/hand,/obj/item/storage/bag/fossils)
allowed = list(/obj/item/device/flashlight,/obj/item/tank,/obj/item/device/suit_cooling_unit,/obj/item/stack/flag,/obj/item/storage/excavation,/obj/item/pickaxe,/obj/item/device/healthanalyzer,/obj/item/device/measuring_tape,/obj/item/device/ano_scanner,/obj/item/device/depth_scanner,/obj/item/device/core_sampler,/obj/item/device/gps,/obj/item/pinpointer/radio,/obj/item/device/bluespace_beacon,/obj/item/pickaxe/archaeologist/hand,/obj/item/storage/bag/fossils)

req_access = list()
req_one_access = list()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/spacesuits/void/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
desc = "A lightweight, radiation-resistant voidsuit, featuring the Expeditionary Corps emblem on its chest plate. Designed for exploring unknown planetary environments."
icon_state = "void_explorer"
armor = list(melee = 20, bullet = 10, laser = 15,energy = 45, bomb = 30, bio = 100)
allowed = list(/obj/item/device/flashlight,/obj/item/tank,/obj/item/device/suit_cooling_unit,/obj/item/stack/flag,/obj/item/device/healthanalyzer,/obj/item/device/gps,/obj/item/pinpointer/radio,/obj/item/device/radio/beacon,/obj/item/material/hatchet/machete,/obj/item/shovel)
allowed = list(/obj/item/device/flashlight,/obj/item/tank,/obj/item/device/suit_cooling_unit,/obj/item/stack/flag,/obj/item/device/healthanalyzer,/obj/item/device/gps,/obj/item/pinpointer/radio,/obj/item/device/bluespace_beacon,/obj/item/material/hatchet/machete,/obj/item/shovel)

/obj/item/clothing/suit/space/void/exploration/prepared
helmet = /obj/item/clothing/head/helmet/space/void/exploration
Expand Down
2 changes: 1 addition & 1 deletion code/modules/research/designs/protolathe/dp-bluespace.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
id = "beacon"
req_tech = list(TECH_BLUESPACE = 1)
materials = list (MATERIAL_STEEL = 20, MATERIAL_GLASS = 10)
build_path = /obj/item/device/radio/beacon
build_path = /obj/item/device/bluespace_beacon
sort_string = "VADAA"

/datum/design/item/bluespace/gps
Expand Down
2 changes: 1 addition & 1 deletion code/modules/xenoarcheaology/artifacts/replicator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
/obj/item/device/paicard,
/obj/item/device/radio,
/obj/item/device/radio/headset,
/obj/item/device/radio/beacon,
/obj/item/device/bluespace_beacon,
/obj/item/autopsy_scanner,
/obj/item/bikehorn,
/obj/item/bonesetter,
Expand Down
2 changes: 1 addition & 1 deletion code/modules/xenoarcheaology/finds/find_spawning.dm
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@
find_type = ARCHAEO_TELEBEACON

/obj/item/archaeological_find/beacon/spawn_item()
var/obj/item/device/radio/beacon/new_item = new(loc)
var/obj/item/device/bluespace_beacon/new_item = new(loc)
new_item.icon = 'icons/obj/xenoarchaeology.dmi'
new_item.icon_state = "unknown[rand(1,4)]"
new_item.desc = ""
Expand Down
2 changes: 1 addition & 1 deletion code/modules/xenoarcheaology/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
new /obj/item/device/core_sampler(src)
new /obj/item/device/gps(src)
new /obj/item/pinpointer/radio(src)
new /obj/item/device/radio/beacon(src)
new /obj/item/device/bluespace_beacon(src)
new /obj/item/clothing/glasses/hud/standard/meson(src)
new /obj/item/pickaxe(src)
new /obj/item/device/measuring_tape(src)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/xenoarcheaology/tools/equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
desc = "A specially shielded voidsuit that insulates against some exotic alien energies, as well as the more mundane dangers of excavation."
icon_state = "rig-excavation"
armor = list(melee = 30, bullet = 0, laser = 5,energy = 40, bomb = 35, bio = 100)
allowed = list(/obj/item/device/flashlight,/obj/item/tank,/obj/item/device/suit_cooling_unit,/obj/item/stack/flag,/obj/item/storage/excavation,/obj/item/pickaxe,/obj/item/device/healthanalyzer,/obj/item/device/measuring_tape,/obj/item/device/ano_scanner,/obj/item/device/depth_scanner,/obj/item/device/core_sampler,/obj/item/device/gps,/obj/item/pinpointer/radio,/obj/item/device/radio/beacon,/obj/item/pickaxe/archaeologist/hand,/obj/item/storage/bag/fossils)
allowed = list(/obj/item/device/flashlight,/obj/item/tank,/obj/item/device/suit_cooling_unit,/obj/item/stack/flag,/obj/item/storage/excavation,/obj/item/pickaxe,/obj/item/device/healthanalyzer,/obj/item/device/measuring_tape,/obj/item/device/ano_scanner,/obj/item/device/depth_scanner,/obj/item/device/core_sampler,/obj/item/device/gps,/obj/item/pinpointer/radio,/obj/item/device/bluespace_beacon,/obj/item/pickaxe/archaeologist/hand,/obj/item/storage/bag/fossils)

/obj/item/clothing/head/helmet/space/void/excavation
name = "excavation voidsuit helmet"
Expand All @@ -39,7 +39,7 @@
/obj/item/storage/box/samplebags,
/obj/item/device/core_sampler,
/obj/item/pinpointer/radio,
/obj/item/device/radio/beacon,
/obj/item/device/bluespace_beacon,
/obj/item/device/gps,
/obj/item/device/measuring_tape,
/obj/item/device/flashlight,
Expand Down
4 changes: 2 additions & 2 deletions code/modules/xenoarcheaology/tools/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@
var/turf/T = get_turf(src)
var/zlevels = GetConnectedZlevels(T.z)
var/cur_dist = world.maxx+world.maxy
for(var/obj/item/device/radio/beacon/R in world)
if((R.z in zlevels) && R.frequency == tracking_freq)
for(var/obj/item/device/bluespace_beacon/R as anything in GLOB.bluespace_beacons)
if((R.z in zlevels))
var/check_dist = get_dist(src,R)
if(check_dist < cur_dist)
cur_dist = check_dist
Expand Down
Binary file modified icons/obj/device.dmi
Binary file not shown.
Binary file modified icons/obj/radio.dmi
Binary file not shown.
4 changes: 2 additions & 2 deletions maps/derelicts/construction_site/construction_site.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"bh" = (/obj/structure/cable/blue{d1 = 2; d2 = 8; icon_state = "2-8"},/turf/simulated/floor/tiled,/area/constructionsite/teleporter)
"bi" = (/obj/machinery/atmospherics/pipe/simple/hidden/blue{icon_state = "intact"; dir = 4},/obj/machinery/door/airlock/external{frequency = 1379; icon_state = "door_locked"; id_tag = "constructionsite_inner"; locked = 1; req_access = list(10)},/turf/simulated/floor,/area/constructionsite/teleporter)
"bj" = (/obj/structure/cable/blue{d2 = 4; icon_state = "0-4"},/turf/simulated/floor/tiled,/area/constructionsite/teleporter)
"bk" = (/obj/item/device/radio/beacon,/turf/simulated/floor/tiled,/area/constructionsite/teleporter)
"bk" = (/obj/item/device/bluespace_beacon,/turf/simulated/floor/tiled,/area/constructionsite/teleporter)
"bl" = (/obj/machinery/power/smes/batteryrack{should_be_mapped = 1},/obj/structure/cable/blue{d2 = 2; icon_state = "0-2"},/obj/effect/floor_decal/industrial/outline/yellow,/turf/simulated/floor/tiled/dark,/area/constructionsite/teleporter)
"bm" = (/obj/machinery/atmospherics/pipe/manifold/hidden/blue{icon_state = "map"; dir = 4},/turf/simulated/floor/tiled,/area/constructionsite/teleporter)
"bn" = (/obj/structure/window/basic{icon_state = "window"; dir = 1},/obj/machinery/portable_atmospherics/canister/air/airlock,/obj/machinery/atmospherics/portables_connector{icon_state = "map_connector"; dir = 4},/obj/effect/floor_decal/industrial/warning/corner{icon_state = "warningcorner"; dir = 4},/turf/simulated/floor/tiled/dark,/area/constructionsite/teleporter)
Expand Down Expand Up @@ -464,4 +464,4 @@ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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