Revert "12/21 modernizations from TG live"
This commit is contained in:
@@ -1,18 +1,3 @@
|
||||
#define AREA_ERRNONE 0
|
||||
#define AREA_STATION 1
|
||||
#define AREA_SPACE 2
|
||||
#define AREA_SPECIAL 3
|
||||
|
||||
#define BORDER_ERROR 0
|
||||
#define BORDER_NONE 1
|
||||
#define BORDER_BETWEEN 2
|
||||
#define BORDER_2NDTILE 3
|
||||
#define BORDER_SPACE 4
|
||||
|
||||
#define ROOM_ERR_LOLWAT 0
|
||||
#define ROOM_ERR_SPACE 1
|
||||
#define ROOM_ERR_TOOLARGE 2
|
||||
|
||||
/obj/item/areaeditor
|
||||
name = "area modification item"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
@@ -20,6 +5,22 @@
|
||||
attack_verb = list("attacked", "bapped", "hit")
|
||||
var/fluffnotice = "Nobody's gonna read this stuff!"
|
||||
|
||||
var/const/AREA_ERRNONE = 0
|
||||
var/const/AREA_STATION = 1
|
||||
var/const/AREA_SPACE = 2
|
||||
var/const/AREA_SPECIAL = 3
|
||||
|
||||
var/const/BORDER_ERROR = 0
|
||||
var/const/BORDER_NONE = 1
|
||||
var/const/BORDER_BETWEEN = 2
|
||||
var/const/BORDER_2NDTILE = 3
|
||||
var/const/BORDER_SPACE = 4
|
||||
|
||||
var/const/ROOM_ERR_LOLWAT = 0
|
||||
var/const/ROOM_ERR_SPACE = -1
|
||||
var/const/ROOM_ERR_TOOLARGE = -2
|
||||
|
||||
|
||||
/obj/item/areaeditor/attack_self(mob/user)
|
||||
add_fingerprint(user)
|
||||
var/text = "<BODY><HTML><head><title>[src]</title></head> \
|
||||
@@ -42,9 +43,37 @@
|
||||
return
|
||||
if(href_list["create_area"])
|
||||
if(get_area_type()==AREA_SPACE)
|
||||
create_area(usr)
|
||||
create_area()
|
||||
updateUsrDialog()
|
||||
|
||||
|
||||
//One-use area creation permits.
|
||||
/obj/item/areaeditor/permit
|
||||
name = "construction permit"
|
||||
icon_state = "permit"
|
||||
desc = "This is a one-use permit that allows the user to offically declare a built room as new addition to the station."
|
||||
fluffnotice = "Nanotrasen Engineering requires all on-station construction projects to be approved by a head of staff, as detailed in Nanotrasen Company Regulation 512-C (Mid-Shift Modifications to Company Property). \
|
||||
By submitting this form, you accept any fines, fees, or personal injury/death that may occur during construction."
|
||||
w_class = 1
|
||||
|
||||
|
||||
/obj/item/areaeditor/permit/attack_self(mob/user)
|
||||
. = ..()
|
||||
var/area/A = get_area()
|
||||
if(get_area_type() == AREA_STATION)
|
||||
. += "<p>According to \the [src], you are now in <b>\"[html_encode(A.name)]\"</b>.</p>"
|
||||
var/datum/browser/popup = new(user, "blueprints", "[src]", 700, 500)
|
||||
popup.set_content(.)
|
||||
popup.open()
|
||||
onclose(usr, "blueprints")
|
||||
|
||||
|
||||
/obj/item/areaeditor/permit/create_area()
|
||||
var/success = ..()
|
||||
if(success)
|
||||
qdel(src)
|
||||
|
||||
|
||||
//Station blueprints!!!
|
||||
/obj/item/areaeditor/blueprints
|
||||
name = "station blueprints"
|
||||
@@ -52,38 +81,27 @@
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "blueprints"
|
||||
fluffnotice = "Property of Nanotrasen. For heads of staff only. Store in high-secure storage."
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
|
||||
var/list/image/showing = list()
|
||||
var/client/viewing
|
||||
var/legend = FALSE //Viewing the wire legend
|
||||
|
||||
|
||||
/obj/item/areaeditor/blueprints/Destroy()
|
||||
clear_viewer()
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/areaeditor/blueprints/attack_self(mob/user)
|
||||
. = ..()
|
||||
if(!legend)
|
||||
var/area/A = get_area()
|
||||
if(get_area_type() == AREA_STATION)
|
||||
. += "<p>According to \the [src], you are now in <b>\"[html_encode(A.name)]\"</b>.</p>"
|
||||
. += "<p>You may <a href='?src=\ref[src];edit_area=1'>make an amendment</a> to the drawing.</p>"
|
||||
. += "<p><a href='?src=\ref[src];view_legend=1'>View wire colour legend</a></p>"
|
||||
if(!viewing)
|
||||
. += "<p><a href='?src=\ref[src];view_blueprints=1'>View structural data</a></p>"
|
||||
else
|
||||
. += "<p><a href='?src=\ref[src];refresh=1'>Refresh structural data</a></p>"
|
||||
. += "<p><a href='?src=\ref[src];hide_blueprints=1'>Hide structural data</a></p>"
|
||||
var/area/A = get_area()
|
||||
if(get_area_type() == AREA_STATION)
|
||||
. += "<p>According to \the [src], you are now in <b>\"[html_encode(A.name)]\"</b>.</p>"
|
||||
. += "<p>You may <a href='?src=\ref[src];edit_area=1'>make an amendment</a> to the drawing.</p>"
|
||||
if(!viewing)
|
||||
. += "<p><a href='?src=\ref[src];view_blueprints=1'>View structural data</a></p>"
|
||||
else
|
||||
if(legend == TRUE)
|
||||
. += "<a href='?src=\ref[src];exit_legend=1'><< Back</a>"
|
||||
. += view_wire_devices(user);
|
||||
else
|
||||
//legend is a wireset
|
||||
. += "<a href='?src=\ref[src];view_legend=1'><< Back</a>"
|
||||
. += view_wire_set(user, legend)
|
||||
. += "<p><a href='?src=\ref[src];refresh=1'>Refresh structural data</a></p>"
|
||||
. += "<p><a href='?src=\ref[src];hide_blueprints=1'>Hide structural data</a></p>"
|
||||
var/datum/browser/popup = new(user, "blueprints", "[src]", 700, 500)
|
||||
popup.set_content(.)
|
||||
popup.open()
|
||||
@@ -96,12 +114,6 @@
|
||||
if(get_area_type()!=AREA_STATION)
|
||||
return
|
||||
edit_area()
|
||||
if(href_list["exit_legend"])
|
||||
legend = FALSE;
|
||||
if(href_list["view_legend"])
|
||||
legend = TRUE;
|
||||
if(href_list["view_wireset"])
|
||||
legend = href_list["view_wireset"];
|
||||
if(href_list["view_blueprints"])
|
||||
set_viewer(usr, "<span class='notice'>You flip the blueprints over to view the complex information diagram.</span>")
|
||||
if(href_list["hide_blueprints"])
|
||||
@@ -140,7 +152,6 @@
|
||||
/obj/item/areaeditor/blueprints/dropped(mob/user)
|
||||
..()
|
||||
clear_viewer()
|
||||
legend = FALSE
|
||||
|
||||
|
||||
/obj/item/areaeditor/proc/get_area()
|
||||
@@ -168,48 +179,29 @@
|
||||
return AREA_SPECIAL
|
||||
return AREA_STATION
|
||||
|
||||
/obj/item/areaeditor/blueprints/proc/view_wire_devices(mob/user)
|
||||
var/message = "<br>You examine the wire legend.<br>"
|
||||
for(var/wireset in wire_color_directory)
|
||||
message += "<br><a href='?src=\ref[src];view_wireset=[wireset]'>[wire_name_directory[wireset]]</a>"
|
||||
message += "</p>"
|
||||
return message
|
||||
|
||||
/obj/item/areaeditor/blueprints/proc/view_wire_set(mob/user, wireset)
|
||||
//for some reason you can't use wireset directly as a derefencer so this is the next best :/
|
||||
for(var/device in wire_color_directory)
|
||||
if("[device]" == wireset) //I know... don't change it...
|
||||
var/message = "<p><b>[wire_name_directory[device]]:</b>"
|
||||
for(var/Col in wire_color_directory[device])
|
||||
var/wire_name = wire_color_directory[device][Col]
|
||||
if(!findtext(wire_name, WIRE_DUD_PREFIX)) //don't show duds
|
||||
message += "<p><span style='color: [Col]'>[Col]</span>: [wire_name]</p>"
|
||||
message += "</p>"
|
||||
return message
|
||||
return ""
|
||||
|
||||
/proc/create_area(mob/living/creator)
|
||||
var/res = detect_room(get_turf(creator))
|
||||
/obj/item/areaeditor/proc/create_area()
|
||||
var/res = detect_room(get_turf(usr))
|
||||
if(!istype(res,/list))
|
||||
switch(res)
|
||||
if(ROOM_ERR_SPACE)
|
||||
creator << "<span class='warning'>The new area must be completely airtight.</span>"
|
||||
usr << "<span class='warning'>The new area must be completely airtight.</span>"
|
||||
return
|
||||
if(ROOM_ERR_TOOLARGE)
|
||||
creator << "<span class='warning'>The new area is too large.</span>"
|
||||
usr << "<span class='warning'>The new area is too large.</span>"
|
||||
return
|
||||
else
|
||||
creator << "<span class='warning'>Error! Please notify administration.</span>"
|
||||
usr << "<span class='warning'>Error! Please notify administration.</span>"
|
||||
return
|
||||
|
||||
var/list/turfs = res
|
||||
var/str = trim(stripped_input(creator,"New area name:", "Blueprint Editing", "", MAX_NAME_LEN))
|
||||
var/str = trim(stripped_input(usr,"New area name:", "Blueprint Editing", "", MAX_NAME_LEN))
|
||||
if(!str || !length(str)) //cancel
|
||||
return
|
||||
if(length(str) > 50)
|
||||
creator << "<span class='warning'>The given name is too long. The area remains undefined.</span>"
|
||||
usr << "<span class='warning'>The given name is too long. The area remains undefined.</span>"
|
||||
return
|
||||
var/area/old = get_area(get_turf(creator))
|
||||
var/area/old = get_area(get_turf(src))
|
||||
var/old_gravity = old.has_gravity
|
||||
|
||||
var/area/A
|
||||
@@ -221,21 +213,21 @@
|
||||
turfs -= key
|
||||
if(A)
|
||||
A.contents += turfs
|
||||
A.SetDynamicLighting()
|
||||
A.set_dynamic_lighting()
|
||||
else
|
||||
A = new
|
||||
A.setup(str)
|
||||
A.contents += turfs
|
||||
A.SetDynamicLighting()
|
||||
A.set_dynamic_lighting()
|
||||
A.has_gravity = old_gravity
|
||||
creator << "<span class='notice'>You have created a new area, named [str]. It is now weather proof, and constructing an APC will allow it to be powered.</span>"
|
||||
interact()
|
||||
return 1
|
||||
|
||||
|
||||
/obj/item/areaeditor/proc/edit_area()
|
||||
var/area/A = get_area()
|
||||
var/prevname = "[A.name]"
|
||||
var/str = trim(stripped_input(usr,"New area name:", "Area Creation", "", MAX_NAME_LEN))
|
||||
var/str = trim(stripped_input(usr,"New area name:", "Blueprint Editing", "", MAX_NAME_LEN))
|
||||
if(!str || !length(str) || str==prevname) //cancel
|
||||
return
|
||||
if(length(str) > 50)
|
||||
@@ -266,26 +258,33 @@
|
||||
//TODO: much much more. Unnamed airlocks, cameras, etc.
|
||||
|
||||
|
||||
/turf/proc/check_tile_is_border()
|
||||
return BORDER_NONE
|
||||
/obj/item/areaeditor/proc/check_tile_is_border(turf/T2,dir)
|
||||
if (istype(T2, /turf/open/space))
|
||||
return BORDER_SPACE //omg hull breach we all going to die here
|
||||
if (get_area_type(T2.loc)!=AREA_SPACE)
|
||||
return BORDER_BETWEEN
|
||||
if (istype(T2, /turf/closed/wall))
|
||||
return BORDER_2NDTILE
|
||||
if (!istype(T2, /turf))
|
||||
return BORDER_BETWEEN
|
||||
|
||||
/turf/open/space/check_tile_is_border()
|
||||
return BORDER_SPACE
|
||||
|
||||
/turf/closed/check_tile_is_border()
|
||||
return BORDER_2NDTILE
|
||||
|
||||
/turf/open/check_tile_is_border()
|
||||
for(var/atom/movable/AM in src)
|
||||
if(!CANATMOSPASS(AM, src))
|
||||
for (var/obj/structure/window/W in T2)
|
||||
if(turn(dir,180) == W.dir)
|
||||
return BORDER_BETWEEN
|
||||
if (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST))
|
||||
return BORDER_2NDTILE
|
||||
for(var/obj/machinery/door/window/D in T2)
|
||||
if(turn(dir,180) == D.dir)
|
||||
return BORDER_BETWEEN
|
||||
if (locate(/obj/machinery/door) in T2)
|
||||
return BORDER_2NDTILE
|
||||
if (locate(/obj/structure/falsewall) in T2)
|
||||
return BORDER_2NDTILE
|
||||
|
||||
return BORDER_NONE
|
||||
|
||||
/turf/closed/mineral/check_tile_is_border()
|
||||
return BORDER_NONE
|
||||
|
||||
/proc/detect_room(turf/first)
|
||||
/obj/item/areaeditor/proc/detect_room(turf/first)
|
||||
var/list/turf/found = new
|
||||
var/list/turf/pending = list(first)
|
||||
var/list/border = list()
|
||||
@@ -313,7 +312,7 @@
|
||||
if (!isturf(NT) || (NT in found) || (NT in pending))
|
||||
continue
|
||||
|
||||
switch(NT.check_tile_is_border())
|
||||
switch(check_tile_is_border(NT,dir))
|
||||
if(BORDER_NONE)
|
||||
pending+=NT
|
||||
if(BORDER_BETWEEN)
|
||||
@@ -334,7 +333,7 @@
|
||||
var/turf/U = get_step(F, direction)
|
||||
if((U in border) || (U in found))
|
||||
continue
|
||||
if(U.check_tile_is_border() == BORDER_2NDTILE)
|
||||
if(check_tile_is_border(U, direction) == BORDER_2NDTILE)
|
||||
found += U
|
||||
found |= F
|
||||
return found
|
||||
@@ -348,4 +347,4 @@
|
||||
desc = "A digital copy of the station blueprints stored in your memory."
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "blueprints"
|
||||
fluffnotice = "Intellectual Property of Nanotrasen. For use in engineering cyborgs only. Wipe from memory upon departure from the station."
|
||||
fluffnotice = "Intellectual Property of Nanotrasen. For use in engineering cyborgs only. Wipe from memory upon departure from the station."
|
||||
Reference in New Issue
Block a user