Beacons are no longer radios (#36070)
* Refactors beacons * Updates maps * Done * aaddddasddsafsdf
This commit is contained in:
committed by
CitadelStationBot
parent
4d0b7133c8
commit
72e3ffa562
@@ -0,0 +1,44 @@
|
||||
/obj/item/device/beacon
|
||||
name = "\improper tracking beacon"
|
||||
desc = "A beacon used by a teleporter."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "beacon"
|
||||
item_state = "beacon"
|
||||
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
|
||||
var/enabled = TRUE
|
||||
var/renamed = FALSE
|
||||
|
||||
/obj/item/device/beacon/Initialize()
|
||||
. = ..()
|
||||
if (enabled)
|
||||
GLOB.teleportbeacons += src
|
||||
else
|
||||
icon_state = "beacon-off"
|
||||
|
||||
/obj/item/device/beacon/Destroy()
|
||||
GLOB.teleportbeacons.Remove(src)
|
||||
return ..()
|
||||
|
||||
/obj/item/device/beacon/attack_self(mob/user)
|
||||
enabled = !enabled
|
||||
if (enabled)
|
||||
icon_state = "beacon"
|
||||
GLOB.teleportbeacons += src
|
||||
else
|
||||
icon_state = "beacon-off"
|
||||
GLOB.teleportbeacons.Remove(src)
|
||||
to_chat(user, "<span class='notice'>You [enabled ? "enable" : "disable"] the beacon.</span>")
|
||||
return
|
||||
|
||||
/obj/item/device/beacon/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/pen)) // needed for things that use custom names like the locator
|
||||
var/new_name = stripped_input(user, "What would you like the name to be?")
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
if(new_name)
|
||||
name = new_name
|
||||
renamed = TRUE
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
@@ -1,32 +0,0 @@
|
||||
/obj/item/device/radio/beacon
|
||||
name = "tracking beacon"
|
||||
desc = "A beacon used by a teleporter."
|
||||
icon_state = "beacon"
|
||||
item_state = "beacon"
|
||||
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
|
||||
var/code = "electronic"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/device/radio/beacon/Initialize()
|
||||
. = ..()
|
||||
GLOB.teleportbeacons += src
|
||||
|
||||
/obj/item/device/radio/beacon/Destroy()
|
||||
GLOB.teleportbeacons.Remove(src)
|
||||
return ..()
|
||||
|
||||
/obj/item/device/radio/beacon/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, list/spans, message_mode)
|
||||
return
|
||||
|
||||
/obj/item/device/radio/beacon/verb/alter_signal(t as text)
|
||||
set name = "Alter Beacon's Signal"
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
if ((usr.canmove && !( usr.restrained() )))
|
||||
src.code = t
|
||||
if (!( src.code ))
|
||||
src.code = "beacon"
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
@@ -17,9 +17,6 @@
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "locator"
|
||||
var/temp = null
|
||||
var/frequency = FREQ_LOCATOR_IMPLANT
|
||||
var/broadcasting = null
|
||||
var/listening = 1
|
||||
flags_1 = CONDUCT_1
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
item_state = "electronic"
|
||||
@@ -32,17 +29,11 @@
|
||||
/obj/item/locator/attack_self(mob/user)
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
if (src.temp)
|
||||
dat = "[src.temp]<BR><BR><A href='byond://?src=[REF(src)];temp=1'>Clear</A>"
|
||||
if (temp)
|
||||
dat = "[temp]<BR><BR><A href='byond://?src=[REF(src)];temp=1'>Clear</A>"
|
||||
else
|
||||
dat = {"
|
||||
<B>Persistent Signal Locator</B><HR>
|
||||
Frequency:
|
||||
<A href='byond://?src=[REF(src)];freq=-10'>-</A>
|
||||
<A href='byond://?src=[REF(src)];freq=-2'>-</A> [format_frequency(src.frequency)]
|
||||
<A href='byond://?src=[REF(src)];freq=2'>+</A>
|
||||
<A href='byond://?src=[REF(src)];freq=10'>+</A><BR>
|
||||
|
||||
<A href='?src=[REF(src)];refresh=1'>Refresh</A>"}
|
||||
user << browse(dat, "window=radio")
|
||||
onclose(user, "radio")
|
||||
@@ -59,30 +50,30 @@ Frequency:
|
||||
if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)))
|
||||
usr.set_machine(src)
|
||||
if (href_list["refresh"])
|
||||
src.temp = "<B>Persistent Signal Locator</B><HR>"
|
||||
temp = "<B>Persistent Signal Locator</B><HR>"
|
||||
var/turf/sr = get_turf(src)
|
||||
|
||||
if (sr)
|
||||
src.temp += "<B>Located Beacons:</B><BR>"
|
||||
|
||||
for(var/obj/item/device/radio/beacon/W in GLOB.teleportbeacons)
|
||||
if (W.frequency == src.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"
|
||||
temp += "<B>Beacon Signals:</B><BR>"
|
||||
for(var/obj/item/device/beacon/W in GLOB.teleportbeacons)
|
||||
if (!W.renamed)
|
||||
continue
|
||||
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"
|
||||
src.temp += "[W.code]-[dir2text(get_dir(sr, tr))]-[direct]<BR>"
|
||||
direct = "very weak"
|
||||
temp += "[W.name]-[dir2text(get_dir(sr, tr))]-[direct]<BR>"
|
||||
|
||||
src.temp += "<B>Extranneous Signals:</B><BR>"
|
||||
temp += "<B>Implant Signals:</B><BR>"
|
||||
for (var/obj/item/implant/tracking/W in GLOB.tracked_implants)
|
||||
if (!W.imp_in || !isliving(W.loc))
|
||||
continue
|
||||
@@ -103,18 +94,14 @@ Frequency:
|
||||
direct = "strong"
|
||||
else
|
||||
direct = "weak"
|
||||
src.temp += "[W.imp_in.name]-[dir2text(get_dir(sr, tr))]-[direct]<BR>"
|
||||
temp += "[W.imp_in.name]-[dir2text(get_dir(sr, tr))]-[direct]<BR>"
|
||||
|
||||
src.temp += "<B>You are at \[[sr.x],[sr.y],[sr.z]\]</B> in orbital coordinates.<BR><BR><A href='byond://?src=[REF(src)];refresh=1'>Refresh</A><BR>"
|
||||
temp += "<B>You are at \[[sr.x],[sr.y],[sr.z]\]</B> in orbital coordinates.<BR><BR><A href='byond://?src=[REF(src)];refresh=1'>Refresh</A><BR>"
|
||||
else
|
||||
src.temp += "<B><FONT color='red'>Processing Error:</FONT></B> Unable to locate orbital position.<BR>"
|
||||
temp += "<B><FONT color='red'>Processing Error:</FONT></B> Unable to locate orbital position.<BR>"
|
||||
else
|
||||
if (href_list["freq"])
|
||||
src.frequency += text2num(href_list["freq"])
|
||||
src.frequency = sanitize_frequency(src.frequency)
|
||||
else
|
||||
if (href_list["temp"])
|
||||
src.temp = null
|
||||
if (href_list["temp"])
|
||||
temp = null
|
||||
if (ismob(src.loc))
|
||||
attack_self(src.loc)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user