diff --git a/README.md b/README.md index 51ceb23af65..130dddb98df 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ Going to make a Pull Request? Make sure you read the [CONTRIBUTING.md](.github/CONTRIBUTING.md) first! +Want to make a test server or your own private server? Read our [GitHub Wiki!](https://github.com/VOREStation/VOREStation/wiki) + VOREStation is a fork of the Polaris code branch, itself a fork of the Baystation12 code branch, for the game Space Station 13. ![Render Nanomaps](https://github.com/VOREStation/VOREStation/workflows/Render%20Nanomaps/badge.svg) diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index 145381146fd..4b8970fd94d 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -94,6 +94,13 @@ assign_uid() id_tag = num2text(uid) +/obj/machinery/atmospherics/unary/vent_pump/proc/update_area() + initial_loc = get_area(loc) + area_uid = "\ref[initial_loc]" + assign_uid() + id_tag = num2text(uid) + + /obj/machinery/atmospherics/unary/vent_pump/Destroy() unregister_radio(src, frequency) if(initial_loc) diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm index 64a57a744e0..fe3e68130fa 100644 --- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm @@ -43,6 +43,12 @@ assign_uid() id_tag = num2text(uid) +/obj/machinery/atmospherics/unary/vent_scrubber/proc/update_area() + initial_loc = get_area(loc) + area_uid = "\ref[initial_loc]" + assign_uid() + id_tag = num2text(uid) + /obj/machinery/atmospherics/unary/vent_scrubber/Destroy() unregister_radio(src, frequency) if(initial_loc) diff --git a/code/__defines/turfs.dm b/code/__defines/turfs.dm index 1c4b228b63c..fe327cd6327 100644 --- a/code/__defines/turfs.dm +++ b/code/__defines/turfs.dm @@ -28,3 +28,12 @@ #define OUTDOORS_NO 0 // Ditto. #define OUTDOORS_AREA -1 // If a turf has this, it will defer to the area's settings on init. // Note that after init, it will be either YES or NO. + +//supposedly the fastest way to do this according to https://gist.github.com/Giacom/be635398926bb463b42a +///Returns a list of turf in a square + +#define RECT_TURFS(H_RADIUS, V_RADIUS, CENTER) \ + block( \ + locate(max(CENTER.x-(H_RADIUS),1), max(CENTER.y-(V_RADIUS),1), CENTER.z), \ + locate(min(CENTER.x+(H_RADIUS),world.maxx), min(CENTER.y+(V_RADIUS),world.maxy), CENTER.z) \ + ) \ No newline at end of file diff --git a/code/__defines/spaceman_dmm.dm b/code/__spaceman_dmm.dm similarity index 85% rename from code/__defines/spaceman_dmm.dm rename to code/__spaceman_dmm.dm index 94f17433774..51b09cd036e 100644 --- a/code/__defines/spaceman_dmm.dm +++ b/code/__spaceman_dmm.dm @@ -1,7 +1,8 @@ -// Interfaces for the SpacemanDMM linter, define'd to nothing when the linter -// is not in use. +/** +* SpacemanDMM dreamchecker extensions for suite 1.7 +* +*/ -// The SPACEMAN_DMM define is set by the linter and other tooling when it runs. #ifdef SPACEMAN_DMM #define RETURN_TYPE(X) set SpacemanDMM_return_type = X #define SHOULD_CALL_PARENT(X) set SpacemanDMM_should_call_parent = X diff --git a/code/_global_vars/lists/misc.dm b/code/_global_vars/lists/misc.dm index a16573905e0..97cc3753a1e 100644 --- a/code/_global_vars/lists/misc.dm +++ b/code/_global_vars/lists/misc.dm @@ -2,7 +2,8 @@ GLOBAL_LIST_INIT(speech_toppings, list("|" = "i", "+" = "b", "_" = "u")) GLOBAL_LIST_EMPTY(meteor_list) /// List of wire colors for each object type of that round. One for airlocks, one for vendors, etc. -GLOBAL_LIST_EMPTY(wire_color_directory) // This is an associative list with the `holder_type` as the key, and a list of colors as the value. +GLOBAL_LIST_EMPTY(wire_color_directory) // This is an associative list with the `holder_type` as the key, and a list of colors as the value. +GLOBAL_LIST_EMPTY(wire_name_directory) // This is an associative list // Reference list for disposal sort junctions. Filled up by sorting junction's New() GLOBAL_LIST_EMPTY(tagger_locations) diff --git a/code/_helpers/global_lists_vr.dm b/code/_helpers/global_lists_vr.dm index d7d180d4dfa..513154dafdb 100644 --- a/code/_helpers/global_lists_vr.dm +++ b/code/_helpers/global_lists_vr.dm @@ -43,7 +43,7 @@ var/global/list/item_vore_blacklist = list( /obj/item/weapon/gun, /obj/item/weapon/pinpointer, /obj/item/clothing/shoes/magboots, - /obj/item/blueprints, + /obj/item/areaeditor/blueprints, /obj/item/clothing/head/helmet/space, /obj/item/weapon/disk/nuclear, /obj/item/clothing/suit/storage/hooded/wintercoat/roiz) @@ -825,4 +825,96 @@ var/global/list/xenobio_rainbow_extracts = list( /obj/item/slime_extract/ruby = 3, /obj/item/slime_extract/emerald = 3, /obj/item/slime_extract/light_pink = 1, - /obj/item/slime_extract/rainbow = 1) \ No newline at end of file + /obj/item/slime_extract/rainbow = 1) + + +// AREA GENERATION AND BLUEPRINT STUFF BELOW HERE +// typecacheof(list) and list() are two completely separate things, don't break! + +// WHATEVER YOU DO, DO NOT LEAVE THE LAST THING IN THE LIST BELOW HAVE A COMMA OR EVERYTHING EVER WILL BREAK +// ENSURE THE LAST AREA OR TURF LISTED IS SIMPLY "/area/clownhideout" AND NOT "/area/clownhideout," OR YOU WILL IMMEDIATELY DIE + +// These lists are, obviously, unfinished. + +// ALLOWING BUILDING IN AN AREA: +// If you want someone to be able to build a new area in a place, add the area to the 'BUILDABLE_AREA_TYPES' and 'blacklisted_areas' +// BUILDABLE_AREA_TYPES means they can build an area there. The blacklisted_areas means they CAN NOT EXPAND that area. No making space bigger! + +// DISALLOW BUILDING/AREA MANIPULATION IN AN AREA (OR A TURF TYPE): +// Likewise, if you want someone to never ever EVER be able to do anything area generation/expansion related to an area +// Then add it to SPECIALS and area_or_turf_fail_types + +// If you want someone to +var/global/list/BUILDABLE_AREA_TYPES = list( + /area/space, + /area/mine, +// /area/surface/outside, //SC +// /area/surface/cave, //SC + /area/tether/surfacebase/outside, + /area/groundbase/unexplored/outdoors, + /area/maintenance/groundbase/level1, + /area/submap/groundbase/wilderness, + /area/groundbase/mining, + /area/offmap/aerostat/surface, + /area/tether_away/beach, + /area/tether_away/cave, +) + +var/static/list/blacklisted_areas = typecacheof(list( + /area/space, + /area/mine, +// /area/surface/outside, //SC +// /area/surface/cave, //SC + //TETHER STUFF BELOW THIS + /area/tether/surfacebase/outside, + //GROUNDBASE STUFF BELOW THIS + /area/groundbase/unexplored/outdoors, + /area/maintenance/groundbase/level1, + /area/submap/groundbase/wilderness, + /area/groundbase/mining, + /area/offmap/aerostat/surface, + /area/tether_away/beach, + /area/tether_away/cave + )) + +var/global/list/SPECIALS = list( + /turf/space, + /area/shuttle, + /area/admin, + /area/arrival, + /area/centcom, + /area/asteroid, + /area/tdome, + /area/syndicate_station, + /area/wizard_station, + /area/prison, + /area/holodeck, + /area/turbolift, + /area/tether/elevator, + /turf/unsimulated/wall/planetary, + /area/submap/virgo2, + /area/submap/event, + /area/submap/casino_event + // /area/derelict //commented out, all hail derelict-rebuilders! +) + +var/global/list/area_or_turf_fail_types = typecacheof(list( + /turf/space, + /area/shuttle, + /area/admin, + /area/arrival, + /area/centcom, + /area/asteroid, + /area/tdome, + /area/syndicate_station, + /area/wizard_station, + /area/prison, + /area/holodeck, + /turf/simulated/wall/elevator, + /area/turbolift, + /area/tether/elevator, + /turf/unsimulated/wall/planetary, + /area/submap/virgo2, + /area/submap/event, + /area/submap/casino_event + )) diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index 84844936c4f..d0a7bff2e0e 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -643,6 +643,20 @@ Turf and target are seperate in case you want to teleport some distance from a t for(var/turf/T in N) turfs += T return turfs + +//Takes: An instance of the area. +//Returns: A list of all turfs in that area. +//Side note: I don't know why this was never a thing. Did everyone just ignore the Blueprint item?! - C.L. +/proc/get_current_area_turfs(var/area/checked_area) + if(!checked_area) + return null + + var/list/turfs = new/list() + for(var/turf/counted_turfs in checked_area.contents) //Cheap. Efficient. Lovely. + turfs += counted_turfs + return turfs + + //Takes: Area type as text string or as typepath OR an instance of the area. //Returns: A list of all atoms (objs, turfs, mobs) in areas of that type of that type in the world. /proc/get_area_all_atoms(var/areatype) @@ -659,6 +673,18 @@ Turf and target are seperate in case you want to teleport some distance from a t atoms += A return atoms + +//Takes: Area as an instance of the area. +//Returns: A list of all atoms (objs, turfs, mobs) in the selected area. +/proc/get_current_area_atoms(var/area/checked_area) + if(!checked_area) + return null + + var/list/atoms = new/list() + for(var/atom/A in checked_area.contents) + atoms += A + return atoms + /datum/coords //Simple datum for storing coordinates. var/x_pos = null var/y_pos = null diff --git a/code/controllers/subsystems/ai.dm b/code/controllers/subsystems/ai.dm index 41fb3a7e29b..eb29e2fec2f 100644 --- a/code/controllers/subsystems/ai.dm +++ b/code/controllers/subsystems/ai.dm @@ -39,7 +39,7 @@ SUBSYSTEM_DEF(ai) if(!L?.loc) continue - if(process_z[get_z(L)] || !L.low_priority) //VOREStation Edit End + if((get_z(L) && process_z[get_z(L)]) || !L.low_priority) //VOREStation Edit End A.handle_strategicals() else slept_mobs++ diff --git a/code/controllers/subsystems/mobs.dm b/code/controllers/subsystems/mobs.dm index 1c804979838..c124b5573ef 100644 --- a/code/controllers/subsystems/mobs.dm +++ b/code/controllers/subsystems/mobs.dm @@ -15,7 +15,7 @@ SUBSYSTEM_DEF(mobs) var/list/currentrun = list() var/log_extensively = FALSE var/list/timelog = list() - + var/slept_mobs = 0 var/list/process_z = list() @@ -40,10 +40,10 @@ SUBSYSTEM_DEF(mobs) if(!M || QDELETED(M)) mob_list -= M continue - else if(M.low_priority && !(M.loc && process_z[get_z(M)])) + else if(M.low_priority && !(M.loc && get_z(M) && process_z[get_z(M)])) slept_mobs++ continue - + M.Life(times_fired) if (MC_TICK_CHECK) @@ -58,14 +58,14 @@ SUBSYSTEM_DEF(mobs) log_world(msg) return msg += "Lists: currentrun: [currentrun.len], mob_list: [mob_list.len]\n" - + if(!currentrun.len) msg += "!!The subsystem just finished the mob_list list, and currentrun is empty (or has never run).\n" msg += "!!The info below is the tail of mob_list instead of currentrun.\n" - + var/datum/D = currentrun.len ? currentrun[currentrun.len] : mob_list[mob_list.len] msg += "Tail entry: [describeThis(D)] (this is likely the item AFTER the problem item)\n" - + var/position = mob_list.Find(D) if(!position) msg += "Unable to find context of tail entry in mob_list list.\n" diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm index 83ebb65fa8f..9a411c60ee3 100644 --- a/code/datums/wires/wires.dm +++ b/code/datums/wires/wires.dm @@ -43,6 +43,7 @@ if(!GLOB.wire_color_directory[holder_type]) randomize() GLOB.wire_color_directory[holder_type] = colors + GLOB.wire_name_directory[holder_type] = proper_name else colors = GLOB.wire_color_directory[holder_type] diff --git a/code/game/area/areas_vr.dm b/code/game/area/areas_vr.dm index e356063e2ab..f9326745660 100644 --- a/code/game/area/areas_vr.dm +++ b/code/game/area/areas_vr.dm @@ -5,6 +5,9 @@ var/block_suit_sensors = FALSE //If mob size is limited in the area. var/turf/ceiling_type + // Size of the area in open turfs, only calculated for indoors areas. + var/areasize = 0 + /area/Entered(var/atom/movable/AM, oldLoc) . = ..() if(enter_message && isliving(AM)) @@ -29,3 +32,41 @@ var/turf/TA = GetAbove(T) if(isopenspace(TA)) TA.ChangeTurf(ceiling_type, TRUE, TRUE, TRUE) + +/** + * Setup an area (with the given name) + * + * Sets the area name, sets all status var's to false and adds the area to the sorted area list + * //NOTE: Virgo does not have a sorted area list. + */ +/area/proc/setup(a_name) + name = a_name + power_equip = FALSE + power_light = FALSE + power_environ = FALSE + always_unpowered = FALSE + update_areasize() + +/area/proc/update_areasize() + if(outdoors) + return FALSE + areasize = 0 + for(var/turf/simulated/floor/T in contents) + areasize++ + +/proc/rename_area(a, new_name) + var/area/A = get_area(a) + var/prevname = "[A.name]" + set_area_machinery(A, new_name, prevname) + A.name = new_name + A.update_areasize() + return TRUE + +/area/proc/power_check() + if(!requires_power || !apc) + power_light = 0 + power_equip = 0 + power_environ = 0 + power_change() // all machines set to current power level, also updates lighting icon + if(no_spoilers) + set_spoiler_obfuscation(TRUE) \ No newline at end of file diff --git a/code/game/gamemodes/newobjective.dm b/code/game/gamemodes/newobjective.dm index c52e51d5b53..1b3a1147a1e 100644 --- a/code/game/gamemodes/newobjective.dm +++ b/code/game/gamemodes/newobjective.dm @@ -749,7 +749,7 @@ datum blueprints - steal_target = /obj/item/blueprints + steal_target = /obj/item/areaeditor/blueprints explanation_text = "Steal the station's blueprints." weight = 20 diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 9b6b532f964..2818e3e7b4d 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -431,7 +431,7 @@ var/global/list/all_objectives = list() "a site manager's jumpsuit" = /obj/item/clothing/under/rank/captain, "a functional AI" = /obj/item/device/aicard, "a pair of magboots" = /obj/item/clothing/shoes/magboots, - "the station blueprints" = /obj/item/blueprints, + "the station blueprints" = /obj/item/areaeditor/blueprints, "a nasa voidsuit" = /obj/item/clothing/suit/space/void, "28 moles of phoron (full tank)" = /obj/item/weapon/tank, "a sample of slime extract" = /obj/item/slime_extract, diff --git a/code/game/machinery/air_alarm.dm b/code/game/machinery/air_alarm.dm index ca40f0dc530..82d6fa0f6f4 100644 --- a/code/game/machinery/air_alarm.dm +++ b/code/game/machinery/air_alarm.dm @@ -154,6 +154,12 @@ update_icon() +/obj/machinery/alarm/proc/update_area() + alarm_area = get_area(src) + area_uid = "\ref[alarm_area]" + if(name == "alarm") + name = "[alarm_area.name] Air Alarm" + /obj/machinery/alarm/Initialize() . = ..() set_frequency(frequency) @@ -540,9 +546,9 @@ var/list/list/environment_data = list() data["environment_data"] = environment_data - + DECLARE_TLV_VALUES - + var/pressure = environment.return_pressure() LOAD_TLV_VALUES(TLV["pressure"], pressure) environment_data.Add(list(list( @@ -551,7 +557,7 @@ "unit" = "kPa", "danger_level" = TEST_TLV_VALUES ))) - + var/temperature = environment.temperature LOAD_TLV_VALUES(TLV["temperature"], temperature) environment_data.Add(list(list( @@ -573,7 +579,7 @@ "unit" = "%", "danger_level" = TEST_TLV_VALUES ))) - + if(!locked || issilicon(user) || data["remoteUser"]) var/list/list/vents = list() data["vents"] = vents @@ -595,7 +601,7 @@ "extdefault"= (info["external"] == ONE_ATMOSPHERE), "intdefault"= (info["internal"] == 0), ))) - + var/list/list/scrubbers = list() data["scrubbers"] = scrubbers @@ -622,7 +628,7 @@ data["scrubbers"] = scrubbers data["mode"] = mode - + var/list/list/modes = list() data["modes"] = modes modes[++modes.len] = list("name" = "Filtering - Scrubs out contaminants", "mode" = AALARM_MODE_SCRUBBING, "selected" = mode == AALARM_MODE_SCRUBBING, "danger" = 0) @@ -682,7 +688,7 @@ else target_temperature = input_temperature + T0C return TRUE - + // Account for remote users here. // Yes, this is kinda snowflaky; however, I would argue it would be far more snowflakey // to include "custom hrefs" and all the other bullshit that nano states have just for the diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 1e1fff180ed..be37e988b86 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -150,7 +150,7 @@ Transponder Codes: