mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Additional constructable and upgradeable machines, adds soap to drones, updates teleporter
This commit is contained in:
@@ -1,19 +1,26 @@
|
||||
var/list/sps_list = list()
|
||||
/obj/item/device/sps
|
||||
name = "Space Positioning System"
|
||||
desc = "Helping lost spacemen find their way through the galaxy since 3016."
|
||||
name = "space positioning system"
|
||||
desc = "Helping lost spacemen find their way through the planets since 2016."
|
||||
icon = 'icons/obj/telescience.dmi'
|
||||
icon_state = "gps-c"
|
||||
w_class = 2.0
|
||||
flags = FPRINT
|
||||
slot_flags = SLOT_BELT
|
||||
origin_tech = "programming=2;engineering=2"
|
||||
var/gpstag = "COM0"
|
||||
origin_tech = "materials=2;magnets=3;bluespace=2"
|
||||
var/spstag = "COM0"
|
||||
var/emped = 0
|
||||
var/turf/locked_location
|
||||
|
||||
/obj/item/device/sps/New()
|
||||
name = "Space Positioning System ([gpstag])"
|
||||
..()
|
||||
sps_list.Add(src)
|
||||
name = "space positioning system ([spstag])"
|
||||
overlays += "working"
|
||||
|
||||
/obj/item/device/sps/Destroy()
|
||||
sps_list.Remove(src)
|
||||
..()
|
||||
|
||||
/obj/item/device/sps/emp_act(severity)
|
||||
emped = 1
|
||||
overlays -= "working"
|
||||
@@ -24,43 +31,54 @@
|
||||
overlays += "working"
|
||||
|
||||
/obj/item/device/sps/attack_self(mob/user as mob)
|
||||
|
||||
var/obj/item/device/sps/t = ""
|
||||
var/sps_window_height = 110 + sps_list.len * 20 // Variable window height, depending on how many sps units there are to show
|
||||
if(emped)
|
||||
t += "ERROR"
|
||||
else
|
||||
t += "<BR><A href='?src=\ref[src];tag=1'>Set Tag</A> "
|
||||
t += "<BR>Tag: [gpstag]"
|
||||
t += "<A href='?src=\ref[src];tag=1'>Set Tag</A><A href='?src=\ref[src];refresh=1'>Refresh</A>"
|
||||
t += "<BR>Tag: [spstag]"
|
||||
if(locked_location && locked_location.loc)
|
||||
t += "<BR>Bluespace coordinates saved: [locked_location.loc]"
|
||||
sps_window_height += 20
|
||||
|
||||
for(var/obj/item/device/sps/G in world)
|
||||
for(var/obj/item/device/sps/G in sps_list)
|
||||
var/turf/pos = get_turf(G)
|
||||
var/area/gps_area = get_area(G)
|
||||
var/tracked_gpstag = G.gpstag
|
||||
var/area/sps_area = get_area(G)
|
||||
var/tracked_spstag = G.spstag
|
||||
if(G.emped == 1)
|
||||
t += "<BR>[tracked_gpstag]: ERROR"
|
||||
t += "<BR>[tracked_spstag]: ERROR"
|
||||
else
|
||||
t += "<BR>[tracked_gpstag]: [format_text(gps_area.name)] ([pos.x], [pos.y], [pos.z])"
|
||||
t += "<BR>[tracked_spstag]: [format_text(sps_area.name)] ([pos.x], [pos.y], [pos.z])"
|
||||
|
||||
var/datum/browser/popup = new(user, "SPS", name, 600, 450)
|
||||
var/datum/browser/popup = new(user, "sps", name, 360, min(sps_window_height, 800))
|
||||
popup.set_content(t)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
|
||||
/obj/item/device/sps/Topic(href, href_list)
|
||||
..()
|
||||
if(href_list["tag"] )
|
||||
var/a = input("Please enter desired tag.", name, gpstag) as text
|
||||
a = copytext(sanitize(a), 1, 20)
|
||||
if(length(a) != 4)
|
||||
usr << "\blue The tag must be four letters long!"
|
||||
return
|
||||
else
|
||||
gpstag = a
|
||||
name = "Space Positioning System ([gpstag])"
|
||||
return
|
||||
var/a = input("Please enter desired tag.", name, spstag) as text
|
||||
a = uppertext(copytext(sanitize(a), 1, 5))
|
||||
if(src.loc == usr)
|
||||
spstag = a
|
||||
name = "space positioning system ([spstag])"
|
||||
attack_self(usr)
|
||||
if(href_list["refresh"] )
|
||||
if(src.loc == usr)
|
||||
attack_self(usr)
|
||||
|
||||
/obj/item/device/sps/science
|
||||
icon_state = "gps-s"
|
||||
gpstag = "SCI0"
|
||||
spstag = "SCI0"
|
||||
|
||||
/obj/item/device/sps/engineering
|
||||
icon_state = "gps-e"
|
||||
gpstag = "ENG0"
|
||||
spstag = "ENG0"
|
||||
|
||||
/obj/item/device/sps/mining
|
||||
icon_state = "gps-m"
|
||||
spstag = "MINE0"
|
||||
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
|
||||
|
||||
@@ -128,26 +128,26 @@ Frequency:
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "hand_tele"
|
||||
item_state = "electronic"
|
||||
throwforce = 5
|
||||
throwforce = 0
|
||||
w_class = 2.0
|
||||
throw_speed = 3
|
||||
throw_range = 5
|
||||
m_amt = 10000
|
||||
origin_tech = "magnets=1;bluespace=3"
|
||||
var/active_portals = 0
|
||||
|
||||
/obj/item/weapon/hand_tele/attack_self(mob/user as mob)
|
||||
var/turf/current_location = get_turf(user)//What turf is the user on?
|
||||
if(!current_location||current_location.z==2||current_location.z>=8)//If turf was not found or they're on z level 2 or >8 which does not currently exist.
|
||||
if(!current_location||current_location.z==2||current_location.z>=7)//If turf was not found or they're on z level 2 or >7 which does not currently exist.
|
||||
user << "<span class='notice'>\The [src] is malfunctioning.</span>"
|
||||
return
|
||||
var/list/L = list( )
|
||||
for(var/obj/machinery/teleport/hub/R in world)
|
||||
var/obj/machinery/computer/teleporter/com = locate(/obj/machinery/computer/teleporter, locate(R.x - 2, R.y, R.z))
|
||||
if (istype(com, /obj/machinery/computer/teleporter) && com.locked && !com.one_time_use)
|
||||
if(R.icon_state == "tele1")
|
||||
L["[com.id] (Active)"] = com.locked
|
||||
for(var/obj/machinery/computer/teleporter/com in world)
|
||||
if(com.target)
|
||||
if(com.power_station && com.power_station.teleporter_hub && com.power_station.engaged)
|
||||
L["[com.id] (Active)"] = com.target
|
||||
else
|
||||
L["[com.id] (Inactive)"] = com.locked
|
||||
L["[com.id] (Inactive)"] = com.target
|
||||
var/list/turfs = list( )
|
||||
for(var/turf/T in orange(10))
|
||||
if(T.x>world.maxx-8 || T.x<8) continue //putting them at the edge is dumb
|
||||
@@ -158,19 +158,16 @@ Frequency:
|
||||
var/t1 = input(user, "Please select a teleporter to lock in on.", "Hand Teleporter") in L
|
||||
if ((user.get_active_hand() != src || user.stat || user.restrained()))
|
||||
return
|
||||
var/count = 0 //num of portals from this teleport in world
|
||||
for(var/obj/effect/portal/PO in world)
|
||||
if(PO.creator == src) count++
|
||||
if(count >= 3)
|
||||
if(active_portals >= 3)
|
||||
user.show_message("<span class='notice'>\The [src] is recharging!</span>")
|
||||
return
|
||||
var/T = L[t1]
|
||||
for(var/mob/O in hearers(user, null))
|
||||
O.show_message("<span class='notice'>Locked In.</span>", 2)
|
||||
user.show_message("<span class='notice'>Locked In.</span>", 2)
|
||||
var/obj/effect/portal/P = new /obj/effect/portal( get_turf(src) )
|
||||
P.target = T
|
||||
P.creator = src
|
||||
try_move_adjacent(P)
|
||||
active_portals++
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user