From d4f9d7120966ce2f05bfb2ebb09b006a1ad1718d Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Thu, 6 Apr 2017 19:03:00 -0400 Subject: [PATCH] Moves GPSes and bluespace crystals to appropriate folders --- .../objects/items/devices}/gps.dm | 318 +++++++++--------- .../objects/items/stacks}/bscrystal.dm | 168 ++++----- tgstation.dme | 4 +- 3 files changed, 245 insertions(+), 245 deletions(-) rename code/{modules/telesci => game/objects/items/devices}/gps.dm (96%) rename code/{modules/telesci => game/objects/items/stacks}/bscrystal.dm (97%) diff --git a/code/modules/telesci/gps.dm b/code/game/objects/items/devices/gps.dm similarity index 96% rename from code/modules/telesci/gps.dm rename to code/game/objects/items/devices/gps.dm index 6cbde6f4759..53874de1ce0 100644 --- a/code/modules/telesci/gps.dm +++ b/code/game/objects/items/devices/gps.dm @@ -1,159 +1,159 @@ -var/list/GPS_list = list() -/obj/item/device/gps - name = "global positioning system" - desc = "Helping lost spacemen find their way through the planets since 2016. Alt+click to toggle power." - icon = 'icons/obj/telescience.dmi' - icon_state = "gps-c" - w_class = WEIGHT_CLASS_SMALL - slot_flags = SLOT_BELT - origin_tech = "materials=2;magnets=1;bluespace=2" - var/gpstag = "COM0" - var/emped = 0 - var/turf/locked_location - var/tracking = TRUE - -/obj/item/device/gps/New() - ..() - GPS_list.Add(src) - name = "global positioning system ([gpstag])" - add_overlay("working") - -/obj/item/device/gps/Destroy() - GPS_list.Remove(src) - return ..() - -/obj/item/device/gps/emp_act(severity) - emped = TRUE - cut_overlay("working") - add_overlay("emp") - addtimer(CALLBACK(src, .proc/reboot), 300) - -/obj/item/device/gps/proc/reboot() - emped = FALSE - cut_overlay("emp") - add_overlay("working") - -/obj/item/device/gps/AltClick(mob/user) - if(!user.canUseTopic(src, be_close=TRUE)) - return //user not valid to use gps - if(emped) - to_chat(user, "It's busted!") - if(tracking) - cut_overlay("working") - to_chat(user, "[src] is no longer tracking, or visible to other GPS devices.") - tracking = FALSE - else - add_overlay("working") - to_chat(user, "[src] is now tracking, and visible to other GPS devices.") - tracking = TRUE - -/obj/item/device/gps/attack_self(mob/user) - if(!tracking) - to_chat(user, "[src] is turned off. Use alt+click to toggle it back on.") - return - - var/obj/item/device/gps/t = "" - var/gps_window_height = 110 + GPS_list.len * 20 // Variable window height, depending on how many GPS units there are to show - if(emped) - t += "ERROR" - else - t += "
Set Tag " - t += "
Tag: [gpstag]" - if(locked_location && locked_location.loc) - t += "
Bluespace coordinates saved: [locked_location.loc]" - gps_window_height += 20 - - for(var/obj/item/device/gps/G in GPS_list) - var/turf/pos = get_turf(G) - var/area/gps_area = get_area(G) - var/tracked_gpstag = G.gpstag - if(G.emped == 1) - t += "
[tracked_gpstag]: ERROR" - else if(G.tracking) - t += "
[tracked_gpstag]: [format_text(gps_area.name)] ([pos.x], [pos.y], [pos.z])" - else - continue - var/datum/browser/popup = new(user, "GPS", name, 360, min(gps_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/gps/Topic(href, href_list) - ..() - if(href_list["tag"] ) - var/a = input("Please enter desired tag.", name, gpstag) as text - a = uppertext(copytext(sanitize(a), 1, 5)) - if(in_range(src, usr)) - gpstag = a - name = "global positioning system ([gpstag])" - attack_self(usr) - -/obj/item/device/gps/science - icon_state = "gps-s" - gpstag = "SCI0" - -/obj/item/device/gps/engineering - icon_state = "gps-e" - gpstag = "ENG0" - -/obj/item/device/gps/mining - icon_state = "gps-m" - gpstag = "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." - -/obj/item/device/gps/cyborg - icon_state = "gps-b" - gpstag = "BORG0" - desc = "A mining cyborg internal positioning system. Used as a recovery beacon for damaged cyborg assets, or a collaboration tool for mining teams." - flags = NODROP - -/obj/item/device/gps/internal - icon_state = null - flags = ABSTRACT - gpstag = "Eerie Signal" - desc = "Report to a coder immediately." - invisibility = INVISIBILITY_MAXIMUM - -/obj/item/device/gps/mining/internal - icon_state = "gps-m" - gpstag = "MINER" - 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." - -/obj/item/device/gps/internal/base - gpstag = "NT_AUX" - desc = "A homing signal from Nanotrasen's mining base." - -/obj/item/device/gps/visible_debug - name = "visible GPS" - gpstag = "ADMIN" - desc = "This admin-spawn GPS unit leaves the coordinates visible \ - on any turf that it passes over, for debugging. Especially useful \ - for marking the area around the transition edges." - var/list/turf/tagged - -/obj/item/device/gps/visible_debug/New() - . = ..() - tagged = list() - SSfastprocess.processing += src - -/obj/item/device/gps/visible_debug/process() - var/turf/T = get_turf(src) - if(T) - // I assume it's faster to color,tag and OR the turf in, rather - // then checking if its there - T.color = RANDOM_COLOUR - T.maptext = "[T.x],[T.y],[T.z]" - tagged |= T - -/obj/item/device/gps/visible_debug/proc/clear() - while(tagged.len) - var/turf/T = pop(tagged) - T.color = initial(T.color) - T.maptext = initial(T.maptext) - -/obj/item/device/gps/visible_debug/Destroy() - if(tagged) - clear() - tagged = null - SSfastprocess.processing -= src - . = ..() +var/list/GPS_list = list() +/obj/item/device/gps + name = "global positioning system" + desc = "Helping lost spacemen find their way through the planets since 2016. Alt+click to toggle power." + icon = 'icons/obj/telescience.dmi' + icon_state = "gps-c" + w_class = WEIGHT_CLASS_SMALL + slot_flags = SLOT_BELT + origin_tech = "materials=2;magnets=1;bluespace=2" + var/gpstag = "COM0" + var/emped = 0 + var/turf/locked_location + var/tracking = TRUE + +/obj/item/device/gps/New() + ..() + GPS_list.Add(src) + name = "global positioning system ([gpstag])" + add_overlay("working") + +/obj/item/device/gps/Destroy() + GPS_list.Remove(src) + return ..() + +/obj/item/device/gps/emp_act(severity) + emped = TRUE + cut_overlay("working") + add_overlay("emp") + addtimer(CALLBACK(src, .proc/reboot), 300) + +/obj/item/device/gps/proc/reboot() + emped = FALSE + cut_overlay("emp") + add_overlay("working") + +/obj/item/device/gps/AltClick(mob/user) + if(!user.canUseTopic(src, be_close=TRUE)) + return //user not valid to use gps + if(emped) + to_chat(user, "It's busted!") + if(tracking) + cut_overlay("working") + to_chat(user, "[src] is no longer tracking, or visible to other GPS devices.") + tracking = FALSE + else + add_overlay("working") + to_chat(user, "[src] is now tracking, and visible to other GPS devices.") + tracking = TRUE + +/obj/item/device/gps/attack_self(mob/user) + if(!tracking) + to_chat(user, "[src] is turned off. Use alt+click to toggle it back on.") + return + + var/obj/item/device/gps/t = "" + var/gps_window_height = 110 + GPS_list.len * 20 // Variable window height, depending on how many GPS units there are to show + if(emped) + t += "ERROR" + else + t += "
Set Tag " + t += "
Tag: [gpstag]" + if(locked_location && locked_location.loc) + t += "
Bluespace coordinates saved: [locked_location.loc]" + gps_window_height += 20 + + for(var/obj/item/device/gps/G in GPS_list) + var/turf/pos = get_turf(G) + var/area/gps_area = get_area(G) + var/tracked_gpstag = G.gpstag + if(G.emped == 1) + t += "
[tracked_gpstag]: ERROR" + else if(G.tracking) + t += "
[tracked_gpstag]: [format_text(gps_area.name)] ([pos.x], [pos.y], [pos.z])" + else + continue + var/datum/browser/popup = new(user, "GPS", name, 360, min(gps_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/gps/Topic(href, href_list) + ..() + if(href_list["tag"] ) + var/a = input("Please enter desired tag.", name, gpstag) as text + a = uppertext(copytext(sanitize(a), 1, 5)) + if(in_range(src, usr)) + gpstag = a + name = "global positioning system ([gpstag])" + attack_self(usr) + +/obj/item/device/gps/science + icon_state = "gps-s" + gpstag = "SCI0" + +/obj/item/device/gps/engineering + icon_state = "gps-e" + gpstag = "ENG0" + +/obj/item/device/gps/mining + icon_state = "gps-m" + gpstag = "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." + +/obj/item/device/gps/cyborg + icon_state = "gps-b" + gpstag = "BORG0" + desc = "A mining cyborg internal positioning system. Used as a recovery beacon for damaged cyborg assets, or a collaboration tool for mining teams." + flags = NODROP + +/obj/item/device/gps/internal + icon_state = null + flags = ABSTRACT + gpstag = "Eerie Signal" + desc = "Report to a coder immediately." + invisibility = INVISIBILITY_MAXIMUM + +/obj/item/device/gps/mining/internal + icon_state = "gps-m" + gpstag = "MINER" + 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." + +/obj/item/device/gps/internal/base + gpstag = "NT_AUX" + desc = "A homing signal from Nanotrasen's mining base." + +/obj/item/device/gps/visible_debug + name = "visible GPS" + gpstag = "ADMIN" + desc = "This admin-spawn GPS unit leaves the coordinates visible \ + on any turf that it passes over, for debugging. Especially useful \ + for marking the area around the transition edges." + var/list/turf/tagged + +/obj/item/device/gps/visible_debug/New() + . = ..() + tagged = list() + SSfastprocess.processing += src + +/obj/item/device/gps/visible_debug/process() + var/turf/T = get_turf(src) + if(T) + // I assume it's faster to color,tag and OR the turf in, rather + // then checking if its there + T.color = RANDOM_COLOUR + T.maptext = "[T.x],[T.y],[T.z]" + tagged |= T + +/obj/item/device/gps/visible_debug/proc/clear() + while(tagged.len) + var/turf/T = pop(tagged) + T.color = initial(T.color) + T.maptext = initial(T.maptext) + +/obj/item/device/gps/visible_debug/Destroy() + if(tagged) + clear() + tagged = null + SSfastprocess.processing -= src + . = ..() diff --git a/code/modules/telesci/bscrystal.dm b/code/game/objects/items/stacks/bscrystal.dm similarity index 97% rename from code/modules/telesci/bscrystal.dm rename to code/game/objects/items/stacks/bscrystal.dm index 1512ea46309..a346540df40 100644 --- a/code/modules/telesci/bscrystal.dm +++ b/code/game/objects/items/stacks/bscrystal.dm @@ -1,85 +1,85 @@ -// Bluespace crystals, used in telescience and when crushed it will blink you to a random turf. - -/obj/item/weapon/ore/bluespace_crystal - name = "bluespace crystal" - desc = "A glowing bluespace crystal, not much is known about how they work. It looks very delicate." - icon = 'icons/obj/telescience.dmi' - icon_state = "bluespace_crystal" - w_class = WEIGHT_CLASS_TINY - materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT) - origin_tech = "bluespace=6;materials=3" - points = 50 - var/blink_range = 8 // The teleport range when crushed/thrown at someone. - refined_type = /obj/item/stack/sheet/bluespace_crystal - -/obj/item/weapon/ore/bluespace_crystal/refined - name = "refined bluespace crystal" - points = 0 - refined_type = null - -/obj/item/weapon/ore/bluespace_crystal/New() - ..() - pixel_x = rand(-5, 5) - pixel_y = rand(-5, 5) - -/obj/item/weapon/ore/bluespace_crystal/attack_self(mob/user) - user.visible_message("[user] crushes [src]!", "You crush [src]!") - new /obj/effect/particle_effect/sparks(loc) - playsound(src.loc, "sparks", 50, 1) - blink_mob(user) - qdel(src) - -/obj/item/weapon/ore/bluespace_crystal/proc/blink_mob(mob/living/L) - do_teleport(L, get_turf(L), blink_range, asoundin = 'sound/effects/phasein.ogg') - -/obj/item/weapon/ore/bluespace_crystal/throw_impact(atom/hit_atom) - if(!..()) // not caught in mid-air - visible_message("[src] fizzles and disappears upon impact!") - var/turf/T = get_turf(hit_atom) - new /obj/effect/particle_effect/sparks(T) - playsound(src.loc, "sparks", 50, 1) - if(isliving(hit_atom)) - blink_mob(hit_atom) - qdel(src) - -// Artifical bluespace crystal, doesn't give you much research. - -/obj/item/weapon/ore/bluespace_crystal/artificial - name = "artificial bluespace crystal" - desc = "An artificially made bluespace crystal, it looks delicate." - origin_tech = "bluespace=3;plasmatech=4" - materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT / 2) - blink_range = 4 // Not as good as the organic stuff! - points = 0 // nice try - refined_type = null - -// Polycrystals, aka stacks - -/obj/item/stack/sheet/bluespace_crystal - name = "bluespace polycrystal" - icon = 'icons/obj/telescience.dmi' - icon_state = "polycrystal" - desc = "A stable polycrystal, made of fused-together bluespace crystals. You could probably break one off." - origin_tech = "bluespace=6;materials=3" - materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT) - attack_verb = list("bluespace polybashed", "bluespace polybattered", "bluespace polybludgeoned", "bluespace polythrashed", "bluespace polysmashed") - var/crystal_type = /obj/item/weapon/ore/bluespace_crystal/refined - -/obj/item/stack/sheet/bluespace_crystal/attack_self(mob/user) // to prevent the construction menu from ever happening - to_chat(user, "You cannot crush the polycrystal in-hand, try breaking one off.") - return - -/obj/item/stack/sheet/bluespace_crystal/attack_hand(mob/user) - if (user.get_inactive_held_item() == src) - if(zero_amount()) // in this case, a sanity check - return - var/BC = new crystal_type(src) - user.put_in_hands(BC) - amount-- - if (amount == 0) - qdel(src) - to_chat(user, "You break the final crystal off.") - else to_chat(user, "You break off a crystal.") - else - ..() +// Bluespace crystals, used in telescience and when crushed it will blink you to a random turf. + +/obj/item/weapon/ore/bluespace_crystal + name = "bluespace crystal" + desc = "A glowing bluespace crystal, not much is known about how they work. It looks very delicate." + icon = 'icons/obj/telescience.dmi' + icon_state = "bluespace_crystal" + w_class = WEIGHT_CLASS_TINY + materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT) + origin_tech = "bluespace=6;materials=3" + points = 50 + var/blink_range = 8 // The teleport range when crushed/thrown at someone. + refined_type = /obj/item/stack/sheet/bluespace_crystal + +/obj/item/weapon/ore/bluespace_crystal/refined + name = "refined bluespace crystal" + points = 0 + refined_type = null + +/obj/item/weapon/ore/bluespace_crystal/New() + ..() + pixel_x = rand(-5, 5) + pixel_y = rand(-5, 5) + +/obj/item/weapon/ore/bluespace_crystal/attack_self(mob/user) + user.visible_message("[user] crushes [src]!", "You crush [src]!") + new /obj/effect/particle_effect/sparks(loc) + playsound(src.loc, "sparks", 50, 1) + blink_mob(user) + qdel(src) + +/obj/item/weapon/ore/bluespace_crystal/proc/blink_mob(mob/living/L) + do_teleport(L, get_turf(L), blink_range, asoundin = 'sound/effects/phasein.ogg') + +/obj/item/weapon/ore/bluespace_crystal/throw_impact(atom/hit_atom) + if(!..()) // not caught in mid-air + visible_message("[src] fizzles and disappears upon impact!") + var/turf/T = get_turf(hit_atom) + new /obj/effect/particle_effect/sparks(T) + playsound(src.loc, "sparks", 50, 1) + if(isliving(hit_atom)) + blink_mob(hit_atom) + qdel(src) + +// Artifical bluespace crystal, doesn't give you much research. + +/obj/item/weapon/ore/bluespace_crystal/artificial + name = "artificial bluespace crystal" + desc = "An artificially made bluespace crystal, it looks delicate." + origin_tech = "bluespace=3;plasmatech=4" + materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT / 2) + blink_range = 4 // Not as good as the organic stuff! + points = 0 // nice try + refined_type = null + +// Polycrystals, aka stacks + +/obj/item/stack/sheet/bluespace_crystal + name = "bluespace polycrystal" + icon = 'icons/obj/telescience.dmi' + icon_state = "polycrystal" + desc = "A stable polycrystal, made of fused-together bluespace crystals. You could probably break one off." + origin_tech = "bluespace=6;materials=3" + materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT) + attack_verb = list("bluespace polybashed", "bluespace polybattered", "bluespace polybludgeoned", "bluespace polythrashed", "bluespace polysmashed") + var/crystal_type = /obj/item/weapon/ore/bluespace_crystal/refined + +/obj/item/stack/sheet/bluespace_crystal/attack_self(mob/user) // to prevent the construction menu from ever happening + to_chat(user, "You cannot crush the polycrystal in-hand, try breaking one off.") + return + +/obj/item/stack/sheet/bluespace_crystal/attack_hand(mob/user) + if (user.get_inactive_held_item() == src) + if(zero_amount()) // in this case, a sanity check + return + var/BC = new crystal_type(src) + user.put_in_hands(BC) + amount-- + if (amount == 0) + qdel(src) + to_chat(user, "You break the final crystal off.") + else to_chat(user, "You break off a crystal.") + else + ..() return \ No newline at end of file diff --git a/tgstation.dme b/tgstation.dme index 0f7487af2aa..57e033edc03 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -702,6 +702,7 @@ #include "code\game\objects\items\devices\flashlight.dm" #include "code\game\objects\items\devices\forcefieldprojector.dm" #include "code\game\objects\items\devices\geiger_counter.dm" +#include "code\game\objects\items\devices\gps.dm" #include "code\game\objects\items\devices\instruments.dm" #include "code\game\objects\items\devices\laserpointer.dm" #include "code\game\objects\items\devices\lightreplacer.dm" @@ -731,6 +732,7 @@ #include "code\game\objects\items\robot\robot_items.dm" #include "code\game\objects\items\robot\robot_parts.dm" #include "code\game\objects\items\robot\robot_upgrades.dm" +#include "code\game\objects\items\stacks\bscrystal.dm" #include "code\game\objects\items\stacks\cash.dm" #include "code\game\objects\items\stacks\medical.dm" #include "code\game\objects\items\stacks\rods.dm" @@ -2035,8 +2037,6 @@ #include "code\modules\surgery\organs\helpers.dm" #include "code\modules\surgery\organs\organ_internal.dm" #include "code\modules\surgery\organs\vocal_cords.dm" -#include "code\modules\telesci\bscrystal.dm" -#include "code\modules\telesci\gps.dm" #include "code\modules\telesci\telepad.dm" #include "code\modules\telesci\telesci_computer.dm" #include "code\modules\tgui\external.dm"