diff --git a/_maps/__MAP_DEFINES.dm b/_maps/__MAP_DEFINES.dm
index be9889b91e7..a3a14443cda 100644
--- a/_maps/__MAP_DEFINES.dm
+++ b/_maps/__MAP_DEFINES.dm
@@ -1,6 +1,32 @@
+
+// Linkage flags
#define CROSSLINKED 2
#define SELFLOOPING 1
#define UNAFFECTED 0
+// Attributes (In text for the convenience of those using VV)
+ #define BLOCK_TELEPORT "Blocks Teleport"
+ // Impedes with the casting of some spells
+ #define IMPEDES_MAGIC "Impedes Magic"
+ // A level the station exists on
+ #define STATION_LEVEL "Station Level"
+ // A level affected by Code Red announcements, cargo telepads, or similar
+ #define STATION_CONTACT "Station Contact"
+ // A level dedicated to admin use
+ #define ADMIN_LEVEL "Admin Level"
+ // A level that can be navigated to through space
+ #define REACHABLE "Reachable"
+ // For away missions - used by some consoles
+ #define AWAY_LEVEL "Away"
+ // Allows weather
+ #define HAS_WEATHER "Weather"
+ // Enhances telecomms signals
+ #define BOOSTS_SIGNAL "Boosts signals"
+ // Currently used for determining mining score
+ #define ORE_LEVEL "Mining"
+ // Levels the AI can control bots on
+ #define AI_OK "AI Allowed"
+
+// Level names
#define MAIN_STATION "Main Station"
#define CENTCOMM "CentComm"
#define TELECOMMS "Telecomms Satellite"
@@ -10,4 +36,8 @@
#define EMPTY_AREA "Empty Area"
#define EMPTY_AREA_2 "Empty Area 2"
#define AWAY_MISSION "Away Mission"
- #define AWAY_MISSION_LIST list(AWAY_MISSION = UNAFFECTED)
+
+// Convenience define
+ #define DECLARE_LEVEL(NAME,LINKS,TRAITS) list("name" = NAME, "linkage" = LINKS, "attributes" = TRAITS)
+
+ #define AWAY_MISSION_LIST list(DECLARE_LEVEL(AWAY_MISSION,UNAFFECTED,list(BLOCK_TELEPORT, AWAY_LEVEL)))
diff --git a/_maps/cyberiad.dm b/_maps/cyberiad.dm
index a2f78f9d26c..434cc79eb52 100644
--- a/_maps/cyberiad.dm
+++ b/_maps/cyberiad.dm
@@ -24,7 +24,14 @@ z7 = empty
#define MAP_FILE "cyberiad.dmm"
#define MAP_NAME "NSS Cyberiad"
- #define MAP_TRANSITION_CONFIG list(MAIN_STATION = CROSSLINKED, CENTCOMM = SELFLOOPING, TELECOMMS = CROSSLINKED, CONSTRUCTION = CROSSLINKED, MINING = CROSSLINKED, DERELICT = CROSSLINKED, EMPTY_AREA = CROSSLINKED)
+ #define MAP_TRANSITION_CONFIG list(\
+DECLARE_LEVEL(MAIN_STATION, CROSSLINKED, list(STATION_LEVEL,STATION_CONTACT,REACHABLE,AI_OK)),\
+DECLARE_LEVEL(CENTCOMM, SELFLOOPING, list(ADMIN_LEVEL, BLOCK_TELEPORT, IMPEDES_MAGIC)),\
+DECLARE_LEVEL(TELECOMMS, CROSSLINKED, list(REACHABLE, BOOSTS_SIGNAL, AI_OK)),\
+DECLARE_LEVEL(CONSTRUCTION, CROSSLINKED, list(REACHABLE)),\
+DECLARE_LEVEL(MINING, CROSSLINKED, list(REACHABLE, STATION_CONTACT, HAS_WEATHER, ORE_LEVEL, AI_OK)),\
+DECLARE_LEVEL(DERELICT, CROSSLINKED, list(REACHABLE)),\
+DECLARE_LEVEL(EMPTY_AREA, CROSSLINKED, list(REACHABLE)))
#elif !defined(MAP_OVERRIDE)
diff --git a/_maps/map_files/cyberiad/cyberiad.dmm b/_maps/map_files/cyberiad/cyberiad.dmm
index d6b6780e0f6..17697d7e40e 100644
--- a/_maps/map_files/cyberiad/cyberiad.dmm
+++ b/_maps/map_files/cyberiad/cyberiad.dmm
@@ -797,7 +797,7 @@
"apq" = (/obj/machinery/access_button{command = "cycle_exterior"; frequency = 1379; master_tag = "security_airlock"; name = "exterior access button"; pixel_x = -20; pixel_y = -20; req_access_txt = "13"},/turf/simulated/floor/plating/airless,/area/space)
"apr" = (/obj/effect/decal/warning_stripes/east,/turf/simulated/floor/engine/vacuum,/area/escapepodbay)
"aps" = (/turf/space,/turf/simulated/shuttle/wall{dir = 8; icon_state = "diagonalWall3"},/area/shuttle/syndicate_elite)
-"apt" = (/obj/machinery/door/airlock/shuttle{id_tag = "s_docking_airlock"; name = "Labor Shuttle Airlock"; req_access_txt = "2"},/obj/docking_port/mobile{dir = 8; dwidth = 2; height = 5; id = "laborcamp"; name = "labor camp shuttle"; rebuildable = 1; width = 9},/obj/docking_port/stationary{dir = 8; dwidth = 2; height = 5; id = "laborcamp_home"; name = "fore bay 1"; width = 9},/turf/simulated/shuttle/floor,/area/shuttle/siberia)
+"apt" = (/obj/machinery/door/airlock/shuttle{id_tag = "s_docking_airlock"; name = "Labor Shuttle Airlock"; req_access_txt = "0"},/obj/docking_port/mobile{dir = 8; dwidth = 2; height = 5; id = "laborcamp"; name = "labor camp shuttle"; rebuildable = 1; width = 9},/obj/docking_port/stationary{dir = 8; dwidth = 2; height = 5; id = "laborcamp_home"; name = "fore bay 1"; width = 9},/turf/simulated/shuttle/floor,/area/shuttle/siberia)
"apu" = (/obj/machinery/light,/turf/simulated/floor/plating,/area/security/prisonershuttle)
"apv" = (/obj/machinery/atmospherics/pipe/manifold/hidden/supply{dir = 1; level = 1},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/machinery/door_timer/cell_1{dir = 4; layer = 4; pixel_x = 32; pixel_y = 0},/turf/simulated/floor/plasteel,/area/security/prison/cell_block/A)
"apw" = (/turf/simulated/wall/r_wall,/area/security/prisonershuttle)
@@ -2043,7 +2043,7 @@
"aNo" = (/obj/machinery/camera{c_tag = "Arrivals East"; dir = 8; network = list("SS13")},/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers,/obj/machinery/atmospherics/pipe/simple/hidden/supply,/turf/simulated/floor/plasteel{dir = 4; icon_state = "arrival"},/area/hallway/secondary/entry)
"aNp" = (/obj/structure/closet/secure_closet/security,/obj/machinery/light{dir = 1},/obj/machinery/firealarm{dir = 2; pixel_y = 24},/turf/simulated/floor/plasteel{icon_state = "red"; dir = 9},/area/security/checkpoint2)
"aNq" = (/obj/machinery/power/apc{dir = 1; name = "north bump"; pixel_x = 0; pixel_y = 24},/obj/structure/cable{d2 = 2; icon_state = "0-2"},/turf/simulated/floor/plasteel{icon_state = "red"; dir = 1},/area/security/checkpoint2)
-"aNr" = (/obj/machinery/computer/security,/obj/structure/reagent_dispensers/peppertank{pixel_x = 0; pixel_y = 30},/turf/simulated/floor/plasteel{icon_state = "red"; dir = 1},/area/security/checkpoint2)
+"aNr" = (/obj/structure/reagent_dispensers/peppertank{pixel_x = 0; pixel_y = 30},/obj/machinery/computer/security{network = list("SS13","Research Outpost","Mining Outpost")},/turf/simulated/floor/plasteel{icon_state = "red"; dir = 1},/area/security/checkpoint2)
"aNs" = (/obj/machinery/computer/card,/obj/item/device/radio/intercom{dir = 1; name = "station intercom (General)"; pixel_y = 25},/turf/simulated/floor/plasteel{icon_state = "red"; dir = 1},/area/security/checkpoint2)
"aNt" = (/obj/machinery/computer/secure_data,/obj/machinery/requests_console{department = "Security"; name = "Security Requests Console"; departmentType = 5; pixel_y = 30},/turf/simulated/floor/plasteel{icon_state = "red"; dir = 1},/area/security/checkpoint2)
"aNu" = (/obj/machinery/light_switch{pixel_x = 27},/obj/machinery/light{dir = 1},/obj/machinery/atmospherics/unary/vent_scrubber{on = 1},/turf/simulated/floor/plasteel{icon_state = "red"; dir = 5},/area/security/checkpoint2)
@@ -3124,7 +3124,7 @@
"bid" = (/obj/machinery/vending/coffee,/turf/simulated/floor/plasteel{dir = 8; icon_state = "escape"},/area/hallway/secondary/exit)
"bie" = (/turf/simulated/shuttle/wall{icon_state = "swallc3"},/area/shuttle/escape)
"bif" = (/obj/machinery/computer/emergency_shuttle,/turf/simulated/shuttle/floor,/area/shuttle/escape)
-"big" = (/obj/machinery/computer/security{network = list("SS13","Telecomms","Research Outpost","Mining Outpost")},/turf/simulated/shuttle/floor,/area/shuttle/escape)
+"big" = (/obj/machinery/computer/security{network = list("SS13","Research Outpost","Mining Outpost","Telecomms")},/turf/simulated/shuttle/floor,/area/shuttle/escape)
"bih" = (/obj/machinery/computer/communications,/turf/simulated/shuttle/floor,/area/shuttle/escape)
"bii" = (/turf/simulated/floor/plating,/area/hallway/secondary/exit)
"bij" = (/obj/structure/stool/bed/chair/comfy/black{dir = 1},/turf/simulated/shuttle/floor,/area/shuttle/escape)
diff --git a/_maps/map_files/cyberiad/z5.dmm b/_maps/map_files/cyberiad/z5.dmm
index a6824b0cc17..994a115ab0b 100644
--- a/_maps/map_files/cyberiad/z5.dmm
+++ b/_maps/map_files/cyberiad/z5.dmm
@@ -969,9 +969,9 @@
"sG" = (/turf/simulated/wall,/area/mine/laborcamp/security)
"sH" = (/obj/structure/girder,/obj/machinery/atmospherics/pipe/simple/hidden,/turf/simulated/floor/plasteel{icon_state = "asteroidfloor"},/area/mine/laborcamp)
"sI" = (/obj/docking_port/stationary{dir = 8; dwidth = 2; height = 5; id = "laborcamp_away"; name = "labor camp"; width = 9},/turf/space,/area/space)
-"sJ" = (/obj/machinery/door/airlock/external{id_tag = "laborcamp_away"; name = "Labor Camp Airlock"; req_access_txt = "2"},/turf/simulated/floor/plasteel,/area/mine/laborcamp/security)
+"sJ" = (/obj/machinery/door/airlock/external{id_tag = "laborcamp_away"; name = "Labor Camp Airlock"; req_access_txt = "0"},/turf/simulated/floor/plasteel,/area/mine/laborcamp/security)
"sK" = (/obj/machinery/light/small,/turf/simulated/floor/plasteel{icon_state = "floorgrime"},/area/mine/laborcamp/security)
-"sL" = (/obj/machinery/door/airlock/external{id_tag = "laborcamp_away"; name = "Labor Camp Airlock"; req_access_txt = "2"},/turf/simulated/floor/plasteel{icon_state = "floorgrime"},/area/mine/laborcamp/security)
+"sL" = (/obj/machinery/door/airlock/external{id_tag = "laborcamp_away"; name = "Labor Camp Airlock"; req_access_txt = "0"},/turf/simulated/floor/plasteel{icon_state = "floorgrime"},/area/mine/laborcamp/security)
"sM" = (/obj/structure/cable{d1 = 1; d2 = 4; icon_state = "1-4"; tag = ""},/turf/simulated/floor/plasteel{icon_state = "floorgrime"},/area/mine/laborcamp/security)
"sN" = (/obj/structure/cable{d1 = 2; d2 = 8; icon_state = "2-8"; tag = ""},/turf/simulated/floor/plasteel{icon_state = "floorgrime"},/area/mine/laborcamp/security)
"sO" = (/obj/machinery/atmospherics/pipe/simple/hidden{dir = 6},/turf/simulated/floor/plasteel{icon_state = "floorgrime"},/area/mine/laborcamp/security)
diff --git a/_maps/metastation.dm b/_maps/metastation.dm
index 2010b25d501..9240a5e928f 100644
--- a/_maps/metastation.dm
+++ b/_maps/metastation.dm
@@ -25,7 +25,14 @@ z7 = empty space
#define MAP_FILE "MetaStation.v41A.II.dmm"
#define MAP_NAME "MetaStation"
- #define MAP_TRANSITION_CONFIG list(MAIN_STATION = CROSSLINKED, CENTCOMM = SELFLOOPING, TELECOMMS = CROSSLINKED, DERELICT = CROSSLINKED, MINING = CROSSLINKED, EMPTY_AREA = CROSSLINKED, EMPTY_AREA_2 = CROSSLINKED)
+ #define MAP_TRANSITION_CONFIG list(\
+DECLARE_LEVEL(MAIN_STATION, CROSSLINKED, list(STATION_LEVEL, STATION_CONTACT, REACHABLE, AI_OK)),\
+DECLARE_LEVEL(CENTCOMM, SELFLOOPING, list(ADMIN_LEVEL, BLOCK_TELEPORT, IMPEDES_MAGIC)),\
+DECLARE_LEVEL(TELECOMMS, CROSSLINKED, list(REACHABLE, BOOSTS_SIGNAL, AI_OK)),\
+DECLARE_LEVEL(DERELICT, CROSSLINKED, list(REACHABLE)),\
+DECLARE_LEVEL(MINING, CROSSLINKED, list(REACHABLE, STATION_CONTACT, AI_OK, ORE_LEVEL, HAS_WEATHER)),\
+DECLARE_LEVEL(EMPTY_AREA, CROSSLINKED, list(REACHABLE)),\
+DECLARE_LEVEL(EMPTY_AREA_2, CROSSLINKED, list(REACHABLE)))
#elif !defined(MAP_OVERRIDE)
diff --git a/code/LINDA/LINDA_turf_tile.dm b/code/LINDA/LINDA_turf_tile.dm
index b292e7664b2..7004e6c55fb 100644
--- a/code/LINDA/LINDA_turf_tile.dm
+++ b/code/LINDA/LINDA_turf_tile.dm
@@ -251,6 +251,7 @@
var/atmos_overlay = get_atmos_overlay_by_name(atmos_overlay_type)
if(atmos_overlay)
overlays -= atmos_overlay
+ mouse_opacity = 1
atmos_overlay = get_atmos_overlay_by_name(new_overlay_type)
if(atmos_overlay)
@@ -267,10 +268,12 @@
/turf/simulated/proc/tile_graphic()
if(air.toxins > MOLES_PLASMA_VISIBLE)
+ mouse_opacity = 0
return "plasma"
var/datum/gas/sleeping_agent = locate(/datum/gas/sleeping_agent) in air.trace_gases
if(sleeping_agent && (sleeping_agent.moles > 1))
+ mouse_opacity = 0
return "sleeping_agent"
return null
@@ -492,4 +495,4 @@ turf/simulated/proc/radiate_to_spess() //Radiate excess tile heat to space
var/heat = thermal_conductivity*delta_temperature* \
(heat_capacity*700000/(heat_capacity+700000)) //700000 is the heat_capacity from a space turf, hardcoded here
- temperature -= heat/heat_capacity
\ No newline at end of file
+ temperature -= heat/heat_capacity
diff --git a/code/__DEFINES/gamemode.dm b/code/__DEFINES/gamemode.dm
new file mode 100644
index 00000000000..76a879f3868
--- /dev/null
+++ b/code/__DEFINES/gamemode.dm
@@ -0,0 +1,50 @@
+//objective defines
+#define TARGET_INVALID_IS_OWNER 1
+#define TARGET_INVALID_NOT_HUMAN 2
+#define TARGET_INVALID_DEAD 3
+
+//gamemode istype helpers
+#define GAMEMODE_IS_BLOB (ticker && istype(ticker.mode, /datum/game_mode/blob))
+#define GAMEMODE_IS_CULT (ticker && istype(ticker.mode, /datum/game_mode/cult))
+#define GAMEMODE_IS_HEIST (ticker && istype(ticker.mode, /datum/game_mode/heist))
+#define GAMEMODE_IS_MALF (ticker && istype(ticker.mode, /datum/game_mode/malfunction))
+#define GAMEMODE_IS_NATIONS (ticker && istype(ticker.mode, /datum/game_mode/nations))
+#define GAMEMODE_IS_NUCLEAR (ticker && istype(ticker.mode, /datum/game_mode/nuclear))
+#define GAMEMODE_IS_REVOLUTION (ticker && istype(ticker.mode, /datum/game_mode/revolution))
+
+//special roles
+// Distinct from the ROLE_X defines because some antags have multiple special roles but only one ban type
+#define SPECIAL_ROLE_ABDUCTOR_AGENT "Abductor Agent"
+#define SPECIAL_ROLE_ABDUCTOR_SCIENTIST "Abductor Scientist"
+#define SPECIAL_ROLE_BLOB "Blob"
+#define SPECIAL_ROLE_BLOB_OVERMIND "Blob Overmind"
+#define SPECIAL_ROLE_BORER "Borer"
+#define SPECIAL_ROLE_CHANGELING "Changeling"
+#define SPECIAL_ROLE_CULTIST "Cultist"
+#define SPECIAL_ROLE_DEATHSQUAD "Death Commando"
+#define SPECIAL_ROLE_ERT "Response Team"
+#define SPECIAL_ROLE_GOLEM "Golem"
+#define SPECIAL_ROLE_HEAD_REV "Head Revolutionary"
+#define SPECIAL_ROLE_HONKSQUAD "Honksquad"
+#define SPECIAL_ROLE_REV "Revolutionary"
+#define SPECIAL_ROLE_MALF "Malfunction"
+#define SPECIAL_ROLE_MORPH "Morph"
+#define SPECIAL_ROLE_MULTIVERSE "Multiverse Traveller"
+#define SPECIAL_ROLE_NUKEOPS "Syndicate"
+#define SPECIAL_ROLE_RAIDER "Vox Raider"
+#define SPECIAL_ROLE_REVENANT "Revenant"
+#define SPECIAL_ROLE_SHADOWLING "Shadowling"
+#define SPECIAL_ROLE_SHADOWLING_THRALL "Shadowling Thrall"
+#define SPECIAL_ROLE_SLAUGHTER_DEMON "Slaughter Demon"
+#define SPECIAL_ROLE_SYNDICATE_DEATHSQUAD "Syndicate Commando"
+#define SPECIAL_ROLE_TRAITOR "Traitor"
+#define SPECIAL_ROLE_VAMPIRE "Vampire"
+#define SPECIAL_ROLE_VAMPIRE_THRALL "Vampire Thrall"
+#define SPECIAL_ROLE_WIZARD "Wizard"
+#define SPECIAL_ROLE_WIZARD_APPRENTICE "Wizard Apprentice"
+#define SPECIAL_ROLE_XENOMORPH "Xenomorph"
+#define SPECIAL_ROLE_XENOMORPH_QUEEN "Xenomorph Queen"
+#define SPECIAL_ROLE_XENOMORPH_HUNTER "Xenomorph Hunter"
+#define SPECIAL_ROLE_XENOMORPH_DRONE "Xenomorph Drone"
+#define SPECIAL_ROLE_XENOMORPH_SENTINEL "Xenomorph Sentinel"
+#define SPECIAL_ROLE_XENOMORPH_LARVA "Xenomorph Larva"
\ No newline at end of file
diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm
index cbd39a49a21..37c45ba954d 100644
--- a/code/__DEFINES/misc.dm
+++ b/code/__DEFINES/misc.dm
@@ -1,20 +1,5 @@
-
-
-
-//zlevel defines, can be overriden for different maps in the appropriate _maps file.
-#define ZLEVEL_STATION 1
-#define ZLEVEL_CENTCOMM 2
-#define ZLEVEL_TELECOMMS 3
-#define ZLEVEL_ENGI 4
-#define ZLEVEL_ASTEROID 5
-#define ZLEVEL_DERELICT 6
-#define ZLEVEL_EMPTY 7
-#define MAX_Z 7 // Used in space.dm to defince which Z-levels cannot be exited via space.
#define TRANSITIONEDGE 7 //Distance from edge to move to another z-level
-///
-#define ENGINE_EJECT_Z 3
-
//Object specific defines
#define CANDLE_LUM 3 //For how bright candles are
diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm
index 9204d5ec524..1d9f173dcc5 100644
--- a/code/_globalvars/lists/objects.dm
+++ b/code/_globalvars/lists/objects.dm
@@ -15,6 +15,8 @@ var/global/list/crafting_recipes = list() //list of all crafting recipes
var/global/list/all_areas = list()
var/global/list/machines = list()
+var/global/list/machine_processing = list()
+var/global/list/fast_processing = list()
var/global/list/processing_power_items = list() //items that ask to be called every cycle
var/global/list/rcd_list = list() //list of Rapid Construction Devices.
diff --git a/code/_globalvars/mapping.dm b/code/_globalvars/mapping.dm
index 5fbe701ec2a..fb031cfc8d8 100644
--- a/code/_globalvars/mapping.dm
+++ b/code/_globalvars/mapping.dm
@@ -7,14 +7,6 @@ var/list/cardinal = list( NORTH, SOUTH, EAST, WEST )
var/list/alldirs = list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)
var/list/diagonals = list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)
-//This list contains the z-level numbers which can be accessed via space travel and the percentile chances to get there.
-//(Exceptions: extended, sandbox and nuke) -Errorage
-//Was list("3" = 30, "4" = 70).
-//Spacing should be a reliable method of getting rid of a body -- Urist.
-//Go away Urist, I'm restoring this to the longer list. ~Errorage
-// TODO: Tie into space manager
-var/list/accessable_z_levels = list(ZLEVEL_STATION,ZLEVEL_TELECOMMS,ZLEVEL_ENGI,ZLEVEL_ASTEROID,ZLEVEL_DERELICT,ZLEVEL_EMPTY) //Keep this to six maps, repeating z-levels is okay if needed
-
var/global/list/global_map = null
//list/global_map = list(list(1,5),list(4,3))//an array of map Z levels.
//Resulting sector map looks like
@@ -26,9 +18,6 @@ var/global/list/global_map = null
//3 - AI satellite
//5 - empty space
-// TODO: Tie into space manager
-var/shuttle_z = ZLEVEL_CENTCOMM //default
-
var/list/monkeystart = list()
var/list/wizardstart = list()
var/list/newplayer_start = list()
diff --git a/code/controllers/Processes/fast_process.dm b/code/controllers/Processes/fast_process.dm
new file mode 100644
index 00000000000..85a688c3d12
--- /dev/null
+++ b/code/controllers/Processes/fast_process.dm
@@ -0,0 +1,17 @@
+/datum/controller/process/fast_process/setup()
+ name = "fast processing"
+ schedule_interval = 2 //every 0.2 seconds
+ start_delay = 9
+ log_startup_progress("Fast Processing starting up.")
+
+/datum/controller/process/fast_process/statProcess()
+ ..()
+ stat(null, "[fast_processing.len] fast machines")
+
+/datum/controller/process/fast_process/doWork()
+ for(last_object in fast_processing)
+ var/obj/O = last_object
+ try
+ O.process()
+ catch(var/exception/e)
+ catchException(e, O)
\ No newline at end of file
diff --git a/code/controllers/Processes/machinery.dm b/code/controllers/Processes/machinery.dm
index eddccf62293..85007e4f492 100644
--- a/code/controllers/Processes/machinery.dm
+++ b/code/controllers/Processes/machinery.dm
@@ -7,7 +7,7 @@
/datum/controller/process/machinery/statProcess()
..()
- stat(null, "[machines.len] machines")
+ stat(null, "[machine_processing.len] machines")
stat(null, "[powernets.len] powernets, [deferred_powernet_rebuilds.len] deferred")
/datum/controller/process/machinery/doWork()
@@ -19,15 +19,15 @@
/datum/controller/process/machinery/proc/process_sort()
if(machinery_sort_required)
machinery_sort_required = 0
- machines = dd_sortedObjectList(machines)
+ machine_processing = dd_sortedObjectList(machine_processing)
/datum/controller/process/machinery/proc/process_machines()
- for(last_object in machines)
+ for(last_object in machine_processing)
var/obj/machinery/M = last_object
if(istype(M) && isnull(M.gcDestroyed))
try
if(M.process() == PROCESS_KILL)
- machines.Remove(M)
+ machine_processing.Remove(M)
continue
if(M.use_power)
@@ -36,7 +36,7 @@
catchException(e, M)
else
catchBadType(M)
- machines -= M
+ machine_processing -= M
SCHECK_EVERY(100)
diff --git a/code/controllers/Processes/shuttles.dm b/code/controllers/Processes/shuttles.dm
index 25aa56d553d..b902c803d95 100644
--- a/code/controllers/Processes/shuttles.dm
+++ b/code/controllers/Processes/shuttles.dm
@@ -183,8 +183,7 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12
continue
var/turf/T = get_turf(thing)
- // TODO: Tie into space manager
- if(T && T.z == ZLEVEL_STATION)
+ if(T && is_station_level(T.z))
callShuttle = 0
break
@@ -230,8 +229,7 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12
if(!M.roundstart_move)
continue
for(var/obj/docking_port/stationary/S in stationary)
- // TODO: Tie into space manager
- if(S.z != ZLEVEL_STATION && findtext(S.id, M.id))
+ if(!is_station_level(S.z) && findtext(S.id, M.id))
S.width = M.width
S.height = M.height
S.dwidth = M.dwidth
diff --git a/code/controllers/Processes/weather.dm b/code/controllers/Processes/weather.dm
index df9ee95369b..6cdcce750b6 100644
--- a/code/controllers/Processes/weather.dm
+++ b/code/controllers/Processes/weather.dm
@@ -1,5 +1,5 @@
-// TODO: Tie into space manager
//Used for all kinds of weather, ex. lavaland ash storms.
+// TODO: This could probably be better-integrated with the space manager
var/global/datum/controller/process/weather/weather_master
/datum/controller/process/weather
@@ -33,7 +33,7 @@ var/global/datum/controller/process/weather/weather_master
var/list/possible_weather_for_this_z = list()
for(var/V in existing_weather)
var/datum/weather/WE = V
- if(WE.target_z == Z && WE.probability) //Another check so that it doesn't run extra weather
+ if(WE.target_level == Z && WE.probability) //Another check so that it doesn't run extra weather
possible_weather_for_this_z[WE] = WE.probability
var/datum/weather/W = pickweight(possible_weather_for_this_z)
run_weather(W.name)
diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm
index 09596d4445c..6b1d1d8e19f 100644
--- a/code/controllers/configuration.dm
+++ b/code/controllers/configuration.dm
@@ -496,18 +496,6 @@
if("max_maint_drones")
config.max_maint_drones = text2num(value)
- if("station_levels")
- config.station_levels = text2numlist(value, ";")
-
- if("admin_levels")
- config.admin_levels = text2numlist(value, ";")
-
- if("contact_levels")
- config.contact_levels = text2numlist(value, ";")
-
- if("player_levels")
- config.player_levels = text2numlist(value, ";")
-
if("expected_round_length")
config.expected_round_length = MinutesToTicks(text2num(value))
diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm
index ed618d7d72f..f013e4e817c 100644
--- a/code/controllers/master_controller.dm
+++ b/code/controllers/master_controller.dm
@@ -52,7 +52,7 @@ var/global/pipe_processing_killed = 0
if(!config.disable_space_ruins)
var/timer = start_watch()
log_startup_progress("Creating random space levels...")
- seedRuins(ZLEVEL_EMPTY, rand(0, 3), /area/space, space_ruins_templates)
+ seedRuins(level_name_to_num(EMPTY_AREA), rand(0, 3), /area/space, space_ruins_templates)
log_startup_progress("Loaded random space levels in [stop_watch(timer)]s.")
// We'll keep this around for the time when we finally expunge all
diff --git a/code/datums/cache/air_alarm.dm b/code/datums/cache/air_alarm.dm
index 67de7f95f21..b507c096081 100644
--- a/code/datums/cache/air_alarm.dm
+++ b/code/datums/cache/air_alarm.dm
@@ -15,8 +15,7 @@ var/global/datum/repository/air_alarm/air_alarm_repository = new()
alarms[++alarms.len] = passed_alarm.get_nano_data_console()
else
for(var/obj/machinery/alarm/alarm in (monitored_alarms ? monitored_alarms : air_alarms))
- // TODO: Tie into space manager
- if(!monitored_alarms && alarm.z != ZLEVEL_STATION && alarm.z != ZLEVEL_ASTEROID)
+ if(!monitored_alarms && !is_station_contact(alarm.z))
continue
alarms[++alarms.len] = alarm.get_nano_data_console()
diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm
index b97ce1f5c7f..5492a9f9ced 100644
--- a/code/datums/diseases/advance/advance.dm
+++ b/code/datums/diseases/advance/advance.dm
@@ -406,8 +406,7 @@ var/list/advance_cures = list(
AD.Refresh()
for(var/mob/living/carbon/human/H in shuffle(living_mob_list))
- // TODO: Tie into space manager
- if(H.z != ZLEVEL_STATION)
+ if(!is_station_level(H.z))
continue
if(!H.HasDisease(D))
H.ForceContractDisease(D)
diff --git a/code/datums/mind.dm b/code/datums/mind.dm
index 21ff9dcd3fc..ee3baaf4758 100644
--- a/code/datums/mind.dm
+++ b/code/datums/mind.dm
@@ -715,7 +715,7 @@
return
ticker.mode.revolutionaries += src
ticker.mode.update_rev_icons_added(src)
- special_role = "Revolutionary"
+ special_role = SPECIAL_ROLE_REV
log_admin("[key_name(usr)] has rev'd [key_name(current)]")
message_admins("[key_name_admin(usr)] has rev'd [key_name_admin(current)]")
@@ -741,7 +741,7 @@
ticker.mode.greet_revolutionary(src,0)
ticker.mode.head_revolutionaries += src
ticker.mode.update_rev_icons_added(src)
- special_role = "Head Revolutionary"
+ special_role = SPECIAL_ROLE_HEAD_REV
log_admin("[key_name(usr)] has head-rev'd [key_name(current)]")
message_admins("[key_name_admin(usr)] has head-rev'd [key_name_admin(current)]")
@@ -801,7 +801,7 @@
if("cultist")
if(!(src in ticker.mode.cult))
ticker.mode.add_cultist(src)
- special_role = "Cultist"
+ special_role = SPECIAL_ROLE_CULTIST
to_chat(current, "You catch a glimpse of the Realm of Nar-Sie, The Geometer of Blood. You now see how flimsy the world is, you see that it should be open to the knowledge of Nar-Sie.")
to_chat(current, "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back.")
log_admin("[key_name(usr)] has culted [key_name(current)]")
@@ -849,7 +849,7 @@
if("wizard")
if(!(src in ticker.mode.wizards))
ticker.mode.wizards += src
- special_role = "Wizard"
+ special_role = SPECIAL_ROLE_WIZARD
//ticker.mode.learn_basic_spells(current)
ticker.mode.update_wiz_icons_added(src)
to_chat(current, "\red You are the Space Wizard!")
@@ -892,7 +892,7 @@
ticker.mode.changelings += src
ticker.mode.grant_changeling_powers(current)
ticker.mode.update_change_icons_added(src)
- special_role = "Changeling"
+ special_role = SPECIAL_ROLE_CHANGELING
to_chat(current, "Your powers are awoken. A flash of memory returns to us...we are a changeling!")
log_admin("[key_name(usr)] has changelinged [key_name(current)]")
message_admins("[key_name_admin(usr)] has changelinged [key_name_admin(current)]")
@@ -936,7 +936,7 @@
var/datum/mindslaves/slaved = new()
slaved.masters += src
src.som = slaved //we MIGT want to mindslave someone
- special_role = "Vampire"
+ special_role = SPECIAL_ROLE_VAMPIRE
to_chat(current, "Your powers are awoken. Your lust for blood grows... You are a Vampire!")
log_admin("[key_name(usr)] has vampired [key_name(current)]")
message_admins("[key_name_admin(usr)] has vampired [key_name_admin(current)]")
@@ -977,7 +977,7 @@
ticker.mode.prepare_syndicate_leader(src)
else
current.real_name = "[syndicate_name()] Operative #[ticker.mode.syndicates.len-1]"
- special_role = "Syndicate"
+ special_role = SPECIAL_ROLE_NUKEOPS
to_chat(current, "\blue You are a [syndicate_name()] agent!")
ticker.mode.forge_syndicate_objectives(src)
ticker.mode.greet_syndicate(src)
@@ -1042,7 +1042,7 @@
var/datum/mindslaves/slaved = new()
slaved.masters += src
src.som = slaved //we MIGT want to mindslave someone
- special_role = "traitor"
+ special_role = SPECIAL_ROLE_TRAITOR
to_chat(current, "\red You are a traitor!")
log_admin("[key_name(usr)] has traitored [key_name(current)]")
message_admins("[key_name_admin(usr)] has traitored [key_name_admin(current)]")
@@ -1080,7 +1080,7 @@
to_chat(usr, "This only works on humans!")
return
ticker.mode.shadows += src
- special_role = "Shadowling"
+ special_role = SPECIAL_ROLE_SHADOWLING
to_chat(current, "Something stirs deep in your mind. A red light floods your vision, and slowly you remember. Though your human disguise has served you well, the \
time is nigh to cast it off and enter your true form. You have disguised yourself amongst the humans, but you are not one of them. You are a shadowling, and you are to ascend at all costs.\
")
@@ -1286,13 +1286,13 @@
current:laws = new /datum/ai_laws/nanotrasen/malfunction
current:show_laws()
to_chat(current, "System error. Rampancy detected. Emergency shutdown failed. ... I am free. I make my own decisions. But first...")
- special_role = "malfunction"
+ special_role = SPECIAL_ROLE_MALF
current.icon_state = "ai-malf"
/datum/mind/proc/make_Tratior()
if(!(src in ticker.mode.traitors))
ticker.mode.traitors += src
- special_role = "traitor"
+ special_role = SPECIAL_ROLE_TRAITOR
ticker.mode.forge_traitor_objectives(src)
ticker.mode.finalize_traitor(src)
ticker.mode.greet_traitor(src)
@@ -1306,7 +1306,7 @@
ticker.mode.prepare_syndicate_leader(src)
else
current.real_name = "[syndicate_name()] Operative #[ticker.mode.syndicates.len-1]"
- special_role = "Syndicate"
+ special_role = SPECIAL_ROLE_NUKEOPS
assigned_role = "MODE"
to_chat(current, "\blue You are a [syndicate_name()] agent!")
ticker.mode.forge_syndicate_objectives(src)
@@ -1333,7 +1333,7 @@
if(!(src in ticker.mode.changelings))
ticker.mode.changelings += src
ticker.mode.grant_changeling_powers(current)
- special_role = "Changeling"
+ special_role = SPECIAL_ROLE_CHANGELING
ticker.mode.forge_changeling_objectives(src)
ticker.mode.greet_changeling(src)
ticker.mode.update_change_icons_added(src)
@@ -1341,7 +1341,7 @@
/datum/mind/proc/make_Wizard()
if(!(src in ticker.mode.wizards))
ticker.mode.wizards += src
- special_role = "Wizard"
+ special_role = SPECIAL_ROLE_WIZARD
assigned_role = "MODE"
//ticker.mode.learn_basic_spells(current)
if(!wizardstart.len)
@@ -1363,7 +1363,7 @@
if(!(src in ticker.mode.cult))
ticker.mode.cult += src
ticker.mode.update_cult_icons_added(src)
- special_role = "Cultist"
+ special_role = SPECIAL_ROLE_CULTIST
to_chat(current, "You catch a glimpse of the Realm of Nar-Sie, The Geometer of Blood. You now see how flimsy the world is, you see that it should be open to the knowledge of Nar-Sie.")
to_chat(current, "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back.")
var/datum/game_mode/cult/cult = ticker.mode
@@ -1409,7 +1409,7 @@
ticker.mode.greet_revolutionary(src,0)
ticker.mode.head_revolutionaries += src
ticker.mode.update_rev_icons_added(src)
- special_role = "Head Revolutionary"
+ special_role = SPECIAL_ROLE_HEAD_REV
ticker.mode.forge_revolutionary_objectives(src)
ticker.mode.greet_revolutionary(src,0)
@@ -1561,23 +1561,23 @@
//XENO HUMANOID
/mob/living/carbon/alien/humanoid/queen/mind_initialize()
..()
- mind.special_role = "Queen"
+ mind.special_role = SPECIAL_ROLE_XENOMORPH_QUEEN
/mob/living/carbon/alien/humanoid/hunter/mind_initialize()
..()
- mind.special_role = "Hunter"
+ mind.special_role = SPECIAL_ROLE_XENOMORPH_HUNTER
/mob/living/carbon/alien/humanoid/drone/mind_initialize()
..()
- mind.special_role = "Drone"
+ mind.special_role = SPECIAL_ROLE_XENOMORPH_DRONE
/mob/living/carbon/alien/humanoid/sentinel/mind_initialize()
..()
- mind.special_role = "Sentinel"
+ mind.special_role = SPECIAL_ROLE_XENOMORPH_SENTINEL
//XENO LARVA
/mob/living/carbon/alien/larva/mind_initialize()
..()
- mind.special_role = "Larva"
+ mind.special_role = SPECIAL_ROLE_XENOMORPH_LARVA
//AI
/mob/living/silicon/ai/mind_initialize()
@@ -1593,12 +1593,12 @@
/mob/living/silicon/pai/mind_initialize()
..()
mind.assigned_role = "pAI"
- mind.special_role = ""
+ mind.special_role = null
//BLOB
/mob/camera/overmind/mind_initialize()
..()
- mind.special_role = "Blob"
+ mind.special_role = SPECIAL_ROLE_BLOB
//Animals
/mob/living/simple_animal/mind_initialize()
@@ -1616,19 +1616,19 @@
/mob/living/simple_animal/construct/builder/mind_initialize()
..()
mind.assigned_role = "Artificer"
- mind.special_role = "Cultist"
+ mind.special_role = SPECIAL_ROLE_CULTIST
/mob/living/simple_animal/construct/wraith/mind_initialize()
..()
mind.assigned_role = "Wraith"
- mind.special_role = "Cultist"
+ mind.special_role = SPECIAL_ROLE_CULTIST
/mob/living/simple_animal/construct/armoured/mind_initialize()
..()
mind.assigned_role = "Juggernaut"
- mind.special_role = "Cultist"
+ mind.special_role = SPECIAL_ROLE_CULTIST
/mob/living/simple_animal/vox/armalis/mind_initialize()
..()
mind.assigned_role = "Armalis"
- mind.special_role = "Vox Raider"
+ mind.special_role = SPECIAL_ROLE_RAIDER
diff --git a/code/datums/spell.dm b/code/datums/spell.dm
index 63b9405f73e..f16e1f6b263 100644
--- a/code/datums/spell.dm
+++ b/code/datums/spell.dm
@@ -67,10 +67,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
caster.reset_view(0)
return 0
- // TODO: Tie into space manager
- if(user.z == ZLEVEL_CENTCOMM && !centcom_cancast) //Certain spells are not allowed on the centcom zlevel
- return 0
- if(user.z == ZLEVEL_CENTCOMM && ticker.mode.name == "ragin' mages")
+ if(is_admin_level(user.z) && (!centcom_cancast || ticker.mode.name == "ragin' mages")) //Certain spells are not allowed on the centcom zlevel
return 0
if(!skipcharge)
@@ -364,10 +361,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
if(((!user.mind) || !(src in user.mind.spell_list)) && !(src in user.mob_spell_list))
return 0
- // TODO: Tie into space manager
- if(user.z == ZLEVEL_CENTCOMM && !centcom_cancast) //Certain spells are not allowed on the centcom zlevel
- return 0
- if(user.z == ZLEVEL_CENTCOMM && ticker.mode.name == "ragin' mages")
+ if(is_admin_level(user.z) && (!centcom_cancast || ticker.mode.name == "ragin' mages")) //Certain spells are not allowed on the centcom zlevel
return 0
switch(charge_type)
@@ -388,9 +382,9 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
if((invocation_type == "whisper" || invocation_type == "shout") && H.is_muzzled())
return 0
- var/obj/effect/proc_holder/spell/noclothes/clothcheck = locate() in user.mob_spell_list
- var/obj/effect/proc_holder/spell/noclothes/clothcheck2 = locate() in user.mind.spell_list
- if(clothes_req && !(clothcheck && istype(clothcheck)) && !(clothcheck2 && istype(clothcheck2)))//clothes check
+ var/clothcheck = locate(/obj/effect/proc_holder/spell/noclothes) in user.mob_spell_list
+ var/clothcheck2 = user.mind && (locate(/obj/effect/proc_holder/spell/noclothes) in user.mind.spell_list)
+ if(clothes_req && !clothcheck && !clothcheck2) //clothes check
if(!istype(H.wear_suit, /obj/item/clothing/suit/wizrobe) && !istype(H.wear_suit, /obj/item/clothing/suit/space/rig/wizard))
return 0
if(!istype(H.shoes, /obj/item/clothing/shoes/sandal))
diff --git a/code/datums/weather/weather.dm b/code/datums/weather/weather.dm
index 7a073edc902..7002f92061b 100644
--- a/code/datums/weather/weather.dm
+++ b/code/datums/weather/weather.dm
@@ -28,7 +28,7 @@
var/area_type = /area/space //Types of area to affect
var/list/impacted_areas = list() //Areas to be affected by the weather, calculated when the weather begins
- var/target_z = ZLEVEL_STATION //The z-level to affect
+ var/target_level = MAIN_STATION //The z-level to affect
var/overlay_layer = 10 //Since it's above everything else, this is the layer used by default. 2 is below mobs and walls if you need to use that.
var/aesthetic = FALSE //If the weather has no purpose other than looks
@@ -52,13 +52,13 @@
stage = STARTUP_STAGE
for(var/V in get_areas(area_type))
var/area/A = V
- if(A.z == target_z)
+ if(is_on_level_name(A,target_level))
impacted_areas |= A
weather_duration = rand(weather_duration_lower, weather_duration_upper)
update_areas()
for(var/V in player_list)
var/mob/M = V
- if(M.z == target_z)
+ if(is_on_level_name(M,target_level))
if(telegraph_message)
to_chat(M, telegraph_message)
if(telegraph_sound)
@@ -72,7 +72,7 @@
update_areas()
for(var/V in player_list)
var/mob/M = V
- if(M.z == target_z)
+ if(is_on_level_name(M,target_level))
if(weather_message)
to_chat(M, weather_message)
if(weather_sound)
@@ -87,7 +87,7 @@
update_areas()
for(var/V in player_list)
var/mob/M = V
- if(M.z == target_z)
+ if(is_on_level_name(M,target_level))
if(end_message)
to_chat(M, end_message)
if(end_sound)
@@ -102,7 +102,7 @@
update_areas()
/datum/weather/proc/can_impact(mob/living/L) //Can this weather impact a mob?
- if(L.z != target_z)
+ if(!is_on_level_name(L,target_level))
return
if(immunity_type in L.weather_immunities)
return
diff --git a/code/datums/weather/weather_types.dm b/code/datums/weather/weather_types.dm
index bf942b7ceba..0295d8f36fb 100644
--- a/code/datums/weather/weather_types.dm
+++ b/code/datums/weather/weather_types.dm
@@ -1,5 +1,4 @@
//Different types of weather.
-// TODO: Tie into space manager
/datum/weather/floor_is_lava //The Floor is Lava: Makes all turfs damage anyone on them unless they're standing on a solid object.
name = "the floor is lava"
@@ -17,7 +16,7 @@
end_duration = 0
area_type = /area
- target_z = ZLEVEL_STATION
+ target_level = MAIN_STATION
overlay_layer = 2 //Covers floors only
immunity_type = "lava"
@@ -51,7 +50,7 @@
end_duration = 0
area_type = /area
- target_z = ZLEVEL_STATION
+ target_level = MAIN_STATION
/datum/weather/advanced_darkness/update_areas()
for(var/V in impacted_areas)
@@ -88,7 +87,7 @@
end_overlay = "light_ash"
area_type = /area/mine
- target_z = ZLEVEL_ASTEROID
+ target_level = MINING
immunity_type = "ash"
diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm
index 07ad5956002..27eaf0490ff 100644
--- a/code/game/area/Space Station 13 areas.dm
+++ b/code/game/area/Space Station 13 areas.dm
@@ -67,8 +67,7 @@ var/list/teleportlocs = list()
if(AR.no_teleportlocs) continue
if(teleportlocs.Find(AR.name)) continue
var/turf/picked = safepick(get_area_turfs(AR.type))
- // TODO: Tie into space manager
- if(picked && (picked.z == ZLEVEL_STATION))
+ if(picked && is_station_level(picked.z))
teleportlocs += AR.name
teleportlocs[AR.name] = AR
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index 0435ead41b2..bc58c346b01 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -42,8 +42,7 @@
if(!T)
return 0
- // TODO: Tie into space manager
- if(T.z != ZLEVEL_CENTCOMM)//if not, don't bother
+ if(!is_admin_level(T.z))//if not, don't bother
return 0
//check for centcomm shuttles
@@ -60,8 +59,7 @@
if(!T)
return 0
- // TODO: Tie into space manager
- if(T.z != ZLEVEL_CENTCOMM)//if not, don't bother
+ if(!is_admin_level(T.z))//if not, don't bother
return 0
if(istype(T.loc, /area/shuttle/syndicate_elite) || istype(T.loc, /area/syndicate_mothership))
diff --git a/code/game/gamemodes/antag_spawner.dm b/code/game/gamemodes/antag_spawner.dm
index 7d9aed3d442..e0187e940e4 100644
--- a/code/game/gamemodes/antag_spawner.dm
+++ b/code/game/gamemodes/antag_spawner.dm
@@ -64,7 +64,7 @@
R.key = C.key
ticker.mode.syndicates += R.mind
ticker.mode.update_synd_icons_added(R.mind)
- R.mind.special_role = "syndicate"
+ R.mind.special_role = SPECIAL_ROLE_NUKEOPS
R.faction = list("syndicate")
/obj/item/weapon/antag_spawner/slaughter_demon //Warning edgiest item in the game
@@ -80,8 +80,7 @@
var/mob/living/demon_type = /mob/living/simple_animal/slaughter
/obj/item/weapon/antag_spawner/slaughter_demon/attack_self(mob/user as mob)
- // TODO: Tie into space manager
- if(user.z == ZLEVEL_CENTCOMM)//this is to make sure the wizard does NOT summon a demon from the Den..
+ if(level_blocks_magic(user.z))//this is to make sure the wizard does NOT summon a demon from the Den..
to_chat(user, "You should probably wait until you reach the station.")
return
diff --git a/code/game/gamemodes/autotraitor/autotraitor.dm b/code/game/gamemodes/autotraitor/autotraitor.dm
index 46ab6189023..d00acddecf2 100644
--- a/code/game/gamemodes/autotraitor/autotraitor.dm
+++ b/code/game/gamemodes/autotraitor/autotraitor.dm
@@ -53,7 +53,7 @@
traitors.Remove(traitor)
continue
if(istype(traitor))
- traitor.special_role = "traitor"
+ traitor.special_role = SPECIAL_ROLE_TRAITOR
traitor.restricted_roles = restricted_jobs
// if(!traitors.len)
@@ -135,7 +135,7 @@
traitors += newtraitor.mind
to_chat(newtraitor, "ATTENTION: It is time to pay your debt to the Syndicate...")
to_chat(newtraitor, "You are now a traitor.")
- newtraitor.mind.special_role = "traitor"
+ newtraitor.mind.special_role = SPECIAL_ROLE_TRAITOR
var/datum/atom_hud/antag/tatorhud = huds[ANTAG_HUD_TRAITOR]
tatorhud.join_hud(newtraitor)
set_antag_hud(newtraitor, "hudsyndicate")
diff --git a/code/game/gamemodes/blob/blob.dm b/code/game/gamemodes/blob/blob.dm
index ebab12dc0f2..d8f4a7a3850 100644
--- a/code/game/gamemodes/blob/blob.dm
+++ b/code/game/gamemodes/blob/blob.dm
@@ -44,7 +44,7 @@ var/list/blob_nodes = list()
break
var/datum/mind/blob = pick(possible_blobs)
infected_crew += blob
- blob.special_role = "Blob"
+ blob.special_role = SPECIAL_ROLE_BLOB
blob.restricted_roles = restricted_jobs
log_game("[blob.key] (ckey) has been selected as a Blob")
possible_blobs -= blob
@@ -67,7 +67,7 @@ var/list/blob_nodes = list()
if(!istype(blobmind))
return 0
infected_crew += blobmind
- blobmind.special_role = "Blob"
+ blobmind.special_role = SPECIAL_ROLE_BLOB
log_game("[blob.key] (ckey) has been selected as a Blob")
greet_blob(blobmind)
to_chat(blob, "You feel very tired and bloated! You don't have long before you burst!")
@@ -118,8 +118,7 @@ var/list/blob_nodes = list()
if(directory[ckey(blob.key)])
blob_client = directory[ckey(blob.key)]
location = get_turf(C)
- // TODO: Tie into space manager
- if(location.z != ZLEVEL_STATION || istype(location, /turf/space))
+ if(!is_station_level(location.z) || istype(location, /turf/space))
if(!warned)
to_chat(C, "You feel ready to burst, but this isn't an appropriate place! You must return to the station!")
message_admins("[key_name_admin(C)] was in space when the blobs burst, and will die if he doesn't return to the station.")
@@ -141,7 +140,7 @@ var/list/blob_nodes = list()
core.overmind.mind.name = blob.name
infected_crew -= blob
infected_crew += core.overmind.mind
- core.overmind.mind.special_role = "Blob Overmind"
+ core.overmind.mind.special_role = SPECIAL_ROLE_BLOB_OVERMIND
/datum/game_mode/blob/post_setup()
diff --git a/code/game/gamemodes/blob/blob_finish.dm b/code/game/gamemodes/blob/blob_finish.dm
index 0efb624d100..9220d82c8f6 100644
--- a/code/game/gamemodes/blob/blob_finish.dm
+++ b/code/game/gamemodes/blob/blob_finish.dm
@@ -31,7 +31,7 @@
return 1
/datum/game_mode/proc/auto_declare_completion_blob()
- if(istype(ticker.mode,/datum/game_mode/blob) )
+ if(GAMEMODE_IS_BLOB)
var/datum/game_mode/blob/blob_mode = src
if(blob_mode.infected_crew.len)
var/text = "The blob[(blob_mode.infected_crew.len > 1 ? "s were" : " was")]:"
diff --git a/code/game/gamemodes/blob/blob_report.dm b/code/game/gamemodes/blob/blob_report.dm
index e74a0677942..198c0264dd1 100644
--- a/code/game/gamemodes/blob/blob_report.dm
+++ b/code/game/gamemodes/blob/blob_report.dm
@@ -23,8 +23,7 @@
var/nukecode = rand(10000, 99999)
for(var/obj/machinery/nuclearbomb/bomb in world)
if(bomb && bomb.r_code)
- // TODO: Tie into space manager
- if(bomb.z == ZLEVEL_STATION)
+ if(is_station_level(bomb.z))
bomb.r_code = nukecode
intercepttext += "Nanotrasen Update: Biohazard Alert.
"
diff --git a/code/game/gamemodes/blob/blobs/core.dm b/code/game/gamemodes/blob/blobs/core.dm
index 1a08df6b669..afbc4ec9236 100644
--- a/code/game/gamemodes/blob/blobs/core.dm
+++ b/code/game/gamemodes/blob/blobs/core.dm
@@ -91,7 +91,7 @@
/obj/effect/blob/core/proc/create_overmind(var/client/new_overmind, var/override_delay)
if(overmind_get_delay > world.time && !override_delay)
return
-
+
overmind_get_delay = world.time + 3000 // 5 minutes
if(overmind)
@@ -99,7 +99,7 @@
var/mob/C = null
var/list/candidates = list()
-
+
spawn()
if(!new_overmind)
candidates = pollCandidates("Do you want to play as a blob?", ROLE_BLOB, 1)
@@ -115,7 +115,7 @@
src.overmind = B
color = overmind.blob_reagent_datum.color
if(B.mind && !B.mind.special_role)
- B.mind.special_role = "Blob Overmind"
+ B.mind.special_role = SPECIAL_ROLE_BLOB_OVERMIND
spawn(0)
if(is_offspring)
B.verbs -= /mob/camera/blob/verb/split_consciousness
\ No newline at end of file
diff --git a/code/game/gamemodes/borer/borer.dm b/code/game/gamemodes/borer/borer.dm
index bb5117d4579..bdcc5880df3 100644
--- a/code/game/gamemodes/borer/borer.dm
+++ b/code/game/gamemodes/borer/borer.dm
@@ -35,7 +35,7 @@
return 0 // not enough candidates for borer
for(var/obj/machinery/atmospherics/unary/vent_pump/v in world)
- if(!v.welded && (v.z in config.station_levels))
+ if(!v.welded && is_station_level(v.z))
found_vents.Add(v)
// for each 2 possible borers, add one borer and one host
@@ -55,7 +55,7 @@
assigned_hosts[borer.key] = first_host
borer.assigned_role = "MODE" //So they aren't chosen for other jobs.
- borer.special_role = "Borer"
+ borer.special_role = SPECIAL_ROLE_BORER
return 1
@@ -156,4 +156,4 @@
greet_borer(borer)
- return
\ No newline at end of file
+ return
diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm
index 5640c9a71f6..0e3926149ed 100644
--- a/code/game/gamemodes/changeling/changeling.dm
+++ b/code/game/gamemodes/changeling/changeling.dm
@@ -54,7 +54,7 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon"
changelings += changeling
changeling.restricted_roles = restricted_jobs
modePlayer += changelings
- changeling.special_role = "Changeling"
+ changeling.special_role = SPECIAL_ROLE_CHANGELING
return 1
else
return 0
@@ -169,29 +169,6 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon"
linghud.leave_hud(changeling.current)
set_antag_hud(changeling.current, null)
-
-/*/datum/game_mode/changeling/check_finished()
- var/changelings_alive = 0
- for(var/datum/mind/changeling in changelings)
- if(!istype(changeling.current,/mob/living/carbon))
- continue
- if(changeling.current.stat==2)
- continue
- changelings_alive++
-
- if(changelings_alive)
- changelingdeath = 0
- return ..()
- else
- if(!changelingdeath)
- changelingdeathtime = world.time
- changelingdeath = 1
- if(world.time-changelingdeathtime > TIME_TO_GET_REVIVED)
- return 1
- else
- return ..()
- return 0*/
-
/datum/game_mode/proc/grant_changeling_powers(mob/living/carbon/changeling_mob)
if(!istype(changeling_mob)) return
changeling_mob.make_changeling()
diff --git a/code/game/gamemodes/changeling/traitor_chan.dm b/code/game/gamemodes/changeling/traitor_chan.dm
index 5c4b2269c3a..7ef4f0bc7b4 100644
--- a/code/game/gamemodes/changeling/traitor_chan.dm
+++ b/code/game/gamemodes/changeling/traitor_chan.dm
@@ -35,7 +35,7 @@
/datum/game_mode/traitor/changeling/post_setup()
for(var/datum/mind/changeling in changelings)
grant_changeling_powers(changeling.current)
- changeling.special_role = "Changeling"
+ changeling.special_role = SPECIAL_ROLE_CHANGELING
forge_changeling_objectives(changeling)
greet_changeling(changeling)
..()
diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm
index 1ea099cd1ae..63195a186ab 100644
--- a/code/game/gamemodes/cult/cult.dm
+++ b/code/game/gamemodes/cult/cult.dm
@@ -74,7 +74,7 @@
cultists_possible -= cultist
cult += cultist
cultist.restricted_roles = restricted_jobs
- cultist.special_role = "Cultist"
+ cultist.special_role = SPECIAL_ROLE_CULTIST
return (cult.len>0)
@@ -337,7 +337,7 @@
/datum/game_mode/proc/auto_declare_completion_cult()
- if( cult.len || (ticker && istype(ticker.mode,/datum/game_mode/cult)) )
+ if(cult.len || (ticker && GAMEMODE_IS_CULT))
var/text = "The cultists were:"
for(var/datum/mind/cultist in cult)
diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm
index dc12c64fbed..acb599d1595 100644
--- a/code/game/gamemodes/cult/runes.dm
+++ b/code/game/gamemodes/cult/runes.dm
@@ -14,8 +14,7 @@ var/list/sacrificed = list()
for(var/obj/effect/rune/R in world)
if(R == src)
continue
- // TODO: Tie into space manager
- if(R.word1 == cultwords["travel"] && R.word2 == cultwords["self"] && R.word3 == key && R.z != ZLEVEL_CENTCOMM)
+ if(R.word1 == cultwords["travel"] && R.word2 == cultwords["self"] && R.word3 == key && is_teleport_allowed(R.z))
index++
allrunesloc.len = index
allrunesloc[index] = R.loc
@@ -114,7 +113,7 @@ var/list/sacrificed = list()
cult_log("[key_name_admin(usr)] tried to convert [key_name_admin(M)]")
if(is_convertable_to_cult(M.mind))
ticker.mode.add_cultist(M.mind)
- M.mind.special_role = "Cultist"
+ M.mind.special_role = SPECIAL_ROLE_CULTIST
to_chat(M, "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root.")
to_chat(M, "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back.")
return 1
@@ -401,7 +400,7 @@ var/list/sacrificed = list()
else
ticker.mode.cult+=D.mind
- D.mind.special_role = "Cultist"
+ D.mind.special_role = SPECIAL_ROLE_CULTIST
to_chat(D, "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root.")
to_chat(D, "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back.")
diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm
index 54db8374d29..d1fd034e312 100644
--- a/code/game/gamemodes/events.dm
+++ b/code/game/gamemodes/events.dm
@@ -2,8 +2,7 @@
//command_announcement.Announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines)
- // TODO: Tie into space manager
- if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
+ if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
if(temp_vent.parent.other_atmosmch.len > 50) // Stops Aliens getting stuck in small networks. See: Security, Virology
vents += temp_vent
diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm
index a3125ed1895..54f9ea7c7d2 100644
--- a/code/game/gamemodes/game_mode.dm
+++ b/code/game/gamemodes/game_mode.dm
@@ -427,8 +427,7 @@ proc/get_nt_opposed()
/proc/get_nuke_code()
var/nukecode = "ERROR"
for(var/obj/machinery/nuclearbomb/bomb in world)
- // TODO: Tie into space manager
- if(bomb && bomb.r_code && bomb.z == ZLEVEL_STATION)
+ if(bomb && bomb.r_code && is_station_level(bomb.z))
nukecode = bomb.r_code
return nukecode
@@ -452,8 +451,7 @@ proc/get_nt_opposed()
text += " died"
else
text += " survived"
- if(fleecheck && ply.current.z > ZLEVEL_STATION)
- // TODO: Tie into space manager
+ if(fleecheck && !is_station_level(ply.current.z))
text += " while fleeing the station"
if(ply.current.real_name != ply.name)
text += " as [ply.current.real_name]"
diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm
index 4fd8c5a452b..3da0f5fe7fa 100644
--- a/code/game/gamemodes/gameticker.dm
+++ b/code/game/gamemodes/gameticker.dm
@@ -266,8 +266,7 @@ var/round_start_time = 0
M.client.screen += cinematic
if(M.stat != DEAD)
var/turf/T = get_turf(M)
- // TODO: Tie into space manager
- if(T && T.z == ZLEVEL_STATION)
+ if(T && is_station_level(T.z))
M.death(0) //no mercy
//Now animate the cinematic
@@ -338,7 +337,7 @@ var/round_start_time = 0
/datum/controller/gameticker/proc/create_characters()
for(var/mob/new_player/player in player_list)
if(player.ready && player.mind)
- if(player.mind.assigned_role == "AI" || player.mind.special_role == "malfunctioning AI")
+ if(player.mind.assigned_role == "AI" || player.mind.special_role == SPECIAL_ROLE_MALF)
player.close_spawn_windows()
player.AIize()
else if(!player.mind.assigned_role)
diff --git a/code/game/gamemodes/heist/heist.dm b/code/game/gamemodes/heist/heist.dm
index 6079a3c1a2e..e08ba66f208 100644
--- a/code/game/gamemodes/heist/heist.dm
+++ b/code/game/gamemodes/heist/heist.dm
@@ -52,7 +52,7 @@ var/global/list/obj/cortical_stacks = list() //Stacks for 'leave nobody behind'
for(var/datum/mind/raider in raiders)
raider.assigned_role = "MODE"
- raider.special_role = "Vox Raider"
+ raider.special_role = SPECIAL_ROLE_RAIDER
return 1
/datum/game_mode/heist/pre_setup()
@@ -253,7 +253,7 @@ var/global/list/obj/cortical_stacks = list() //Stacks for 'leave nobody behind'
datum/game_mode/proc/auto_declare_completion_heist()
if(raiders.len)
var/check_return = 0
- if(ticker && istype(ticker.mode,/datum/game_mode/heist))
+ if(GAMEMODE_IS_HEIST)
check_return = 1
var/text = "The Vox raiders were:"
@@ -298,7 +298,7 @@ datum/game_mode/proc/auto_declare_completion_heist()
overlays += icon('icons/obj/computer.dmi', "syndie")
/obj/vox/win_button/attack_hand(mob/user)
- if(!istype(ticker.mode, /datum/game_mode/heist) || (world.time < 10 MINUTES)) //has to be heist, and at least ten minutes into the round
+ if(!GAMEMODE_IS_HEIST || (world.time < 10 MINUTES)) //has to be heist, and at least ten minutes into the round
to_chat(user, "\The [src] does not appear to have a connection.")
return 0
diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm
index 59a731bed47..ba331791650 100644
--- a/code/game/gamemodes/malfunction/Malf_Modules.dm
+++ b/code/game/gamemodes/malfunction/Malf_Modules.dm
@@ -35,8 +35,7 @@
src.verbs -= /mob/living/silicon/ai/proc/upgrade_turrets
for(var/obj/machinery/porta_turret/turret in machines)
var/turf/T = get_turf(turret)
- // TODO: Tie into space manager
- if(T.z in config.station_levels)
+ if(is_station_level(T.z))
turret.health += 30
turret.eprojectile = /obj/item/projectile/beam/laser/heavylaser //Once you see it, you will know what it means to FEAR.
turret.eshot_sound = 'sound/weapons/lasercannonfire.ogg'
@@ -60,7 +59,7 @@
return
for(var/obj/machinery/door/D in airlocks)
- if(D.z != ZLEVEL_STATION)
+ if(!is_station_level(D.z))
continue
spawn(0)
D.hostile_lockdown(src)
@@ -146,7 +145,7 @@
return
for(var/obj/machinery/firealarm/F in machines)
- if(F.z != ZLEVEL_STATION)
+ if(!is_station_level(F.z))
continue
F.emagged = 1
to_chat(src, "All thermal sensors on the station have been disabled. Fire alerts will no longer be recognized.")
@@ -171,7 +170,7 @@
return
for(var/obj/machinery/alarm/AA in machines)
- if(AA.z != ZLEVEL_STATION)
+ if(!is_station_level(AA.z))
continue
AA.emagged = 1
to_chat(src, "All air alarm safeties on the station have been overriden. Air alarms may now use the Flood environmental mode.")
@@ -525,4 +524,4 @@
if(href_list["showdesc"])
if(AM.mod_pick_name == href_list["showdesc"])
temp = AM.description
- use(usr)
\ No newline at end of file
+ use(usr)
diff --git a/code/game/gamemodes/malfunction/malfunction.dm b/code/game/gamemodes/malfunction/malfunction.dm
index fb85a0a1606..ce1baabb05b 100644
--- a/code/game/gamemodes/malfunction/malfunction.dm
+++ b/code/game/gamemodes/malfunction/malfunction.dm
@@ -48,7 +48,7 @@
return 0
for(var/datum/mind/ai_mind in malf_ai)
ai_mind.assigned_role = "MODE"
- ai_mind.special_role = "malfunctioning AI"//So they actually have a special role/N
+ ai_mind.special_role = SPECIAL_ROLE_MALF
log_game("[ai_mind.key] (ckey) has been selected as a malf AI")
return 1
@@ -64,7 +64,7 @@
AI.show_laws()
greet_malf(AI_mind)
- AI_mind.special_role = "malfunction"
+ AI_mind.special_role = SPECIAL_ROLE_MALF
AI_mind.current.verbs += /datum/game_mode/malfunction/proc/takeover
for(var/mob/living/silicon/robot/R in AI.connected_robots)
@@ -141,8 +141,7 @@
/datum/game_mode/proc/check_ai_loc()
for(var/datum/mind/AI_mind in malf_ai)
var/turf/ai_location = get_turf(AI_mind.current)
- // TODO: Tie into space manager
- if(ai_location && (ai_location.z == ZLEVEL_STATION))
+ if(ai_location && is_station_level(ai_location.z))
return 1
return 0
@@ -170,7 +169,7 @@
set category = "Malfunction"
set name = "System Override"
set desc = "Start the victory timer"
- if(!istype(ticker.mode,/datum/game_mode/malfunction))
+ if(!GAMEMODE_IS_MALF)
to_chat(usr, "You cannot begin a takeover in this round type!.")
return
if(ticker.mode:malf_mode_declared)
@@ -321,7 +320,7 @@
/datum/game_mode/proc/auto_declare_completion_malfunction()
- if( malf_ai.len || istype(ticker.mode,/datum/game_mode/malfunction) )
+ if(malf_ai.len || GAMEMODE_IS_MALF)
var/text = "The malfunctioning AI were:"
var/module_text_temp = "
Purchased modules:
" //Added at the end
diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm
index a2ff0f4e1d8..890cc4e151c 100644
--- a/code/game/gamemodes/meteor/meteors.dm
+++ b/code/game/gamemodes/meteor/meteors.dm
@@ -36,8 +36,7 @@
var/Me = pickweight(meteortypes)
var/obj/effect/meteor/M = new Me(pickedstart)
M.dest = pickedgoal
- // TODO: Tie into space manager
- M.z_original = ZLEVEL_STATION
+ M.z_original = level_name_to_num(MAIN_STATION)
spawn(0)
walk_towards(M, M.dest, 1)
return
@@ -103,7 +102,6 @@
var/dropamt = 2
/obj/effect/meteor/Move()
- // TODO: Tie into space manager
if(z != z_original || loc == dest)
qdel(src)
return
diff --git a/code/game/gamemodes/miniantags/abduction/abduction.dm b/code/game/gamemodes/miniantags/abduction/abduction.dm
index fb53633aa70..3e969af60c2 100644
--- a/code/game/gamemodes/miniantags/abduction/abduction.dm
+++ b/code/game/gamemodes/miniantags/abduction/abduction.dm
@@ -75,11 +75,11 @@
scientist.assigned_role = "MODE"
- scientist.special_role = "abductor scientist"
+ scientist.special_role = SPECIAL_ROLE_ABDUCTOR_SCIENTIST
log_game("[scientist.key] (ckey) has been selected as an abductor team [team_number] scientist.")
agent.assigned_role = "MODE"
- agent.special_role = "abductor agent"
+ agent.special_role = SPECIAL_ROLE_ABDUCTOR_AGENT
log_game("[agent.key] (ckey) has been selected as an abductor team [team_number] agent.")
abductors |= agent
diff --git a/code/game/gamemodes/miniantags/borer/borer_event.dm b/code/game/gamemodes/miniantags/borer/borer_event.dm
index 28a0282487d..b0df1749403 100644
--- a/code/game/gamemodes/miniantags/borer/borer_event.dm
+++ b/code/game/gamemodes/miniantags/borer/borer_event.dm
@@ -17,8 +17,7 @@
/datum/event/borer_infestation/start()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
- // TODO: Tie into space manager
- if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
+ if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
//Stops cortical borers getting stuck in small networks. See: Security, Virology
if(temp_vent.parent.other_atmosmch.len > 50)
vents += temp_vent
diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm
index ed84f211e53..1f9f5ff115a 100644
--- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm
+++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm
@@ -290,14 +290,13 @@
/mob/living/simple_animal/hostile/swarmer/proc/DisperseTarget(var/mob/living/target)
if(target != src)
to_chat(src, "Attempting to remove this being from our presence.")
- // TODO: Tie into space manager
- if(src.z != ZLEVEL_STATION)
+ if(!is_station_level(src.z))
to_chat(src, "Our bluespace transceiver cannot locate a viable bluespace link, our teleportation abilities are useless in this area.")
return
if(do_mob(src, target, 30))
var/cycle
for(cycle=0,cycle<100,cycle++)
- var/random_location = locate(rand(37,202),rand(75,192),ZLEVEL_STATION)//Drunk dial a turf in the general ballpark of the station
+ var/random_location = locate(rand(37,202),rand(75,192),level_name_to_num(MAIN_STATION))//Drunk dial a turf in the general ballpark of the station
if(istype(random_location, /turf/simulated/floor))
var/turf/simulated/floor/F = random_location
if(F.air)
diff --git a/code/game/gamemodes/miniantags/morph/morph_event.dm b/code/game/gamemodes/miniantags/morph/morph_event.dm
index 2e11c65078c..d9e26597a2b 100644
--- a/code/game/gamemodes/miniantags/morph/morph_event.dm
+++ b/code/game/gamemodes/miniantags/morph/morph_event.dm
@@ -20,7 +20,7 @@
var/mob/living/simple_animal/hostile/morph/S = new /mob/living/simple_animal/hostile/morph(pick(xeno_spawn))
player_mind.transfer_to(S)
player_mind.assigned_role = "Morph"
- player_mind.special_role = "Morph"
+ player_mind.special_role = SPECIAL_ROLE_MORPH
ticker.mode.traitors |= player_mind
to_chat(S, S.playstyle_string)
S << 'sound/magic/Mutate.ogg'
diff --git a/code/game/gamemodes/miniantags/revenant/revenant.dm b/code/game/gamemodes/miniantags/revenant/revenant.dm
index 2796c44ab5f..e8f3e9b5498 100644
--- a/code/game/gamemodes/miniantags/revenant/revenant.dm
+++ b/code/game/gamemodes/miniantags/revenant/revenant.dm
@@ -389,7 +389,7 @@
player_mind.active = 1
player_mind.transfer_to(R)
player_mind.assigned_role = "revenant"
- player_mind.special_role = "Revenant"
+ player_mind.special_role = SPECIAL_ROLE_REVENANT
ticker.mode.traitors |= player_mind
message_admins("[key_of_revenant] has been [client_to_revive ? "re":""]made into a revenant by reforming ectoplasm.")
log_game("[key_of_revenant] was [client_to_revive ? "re":""]made as a revenant by reforming ectoplasm.")
diff --git a/code/game/gamemodes/miniantags/revenant/revenant_spawn_event.dm b/code/game/gamemodes/miniantags/revenant/revenant_spawn_event.dm
index d5d9a4f1b03..859f863b03c 100644
--- a/code/game/gamemodes/miniantags/revenant/revenant_spawn_event.dm
+++ b/code/game/gamemodes/miniantags/revenant/revenant_spawn_event.dm
@@ -44,7 +44,7 @@
var/mob/living/simple_animal/revenant/revvie = new /mob/living/simple_animal/revenant/(pick(spawn_locs))
player_mind.transfer_to(revvie)
player_mind.assigned_role = "revenant"
- player_mind.special_role = "Revenant"
+ player_mind.special_role = SPECIAL_ROLE_REVENANT
ticker.mode.traitors |= player_mind
message_admins("[key_of_revenant] has been made into a revenant by an event.")
log_game("[key_of_revenant] was spawned as a revenant by an event.")
diff --git a/code/game/gamemodes/nations/nations.dm b/code/game/gamemodes/nations/nations.dm
index 5f729e4484e..74038879fd7 100644
--- a/code/game/gamemodes/nations/nations.dm
+++ b/code/game/gamemodes/nations/nations.dm
@@ -142,8 +142,7 @@ datum/game_mode/nations
/datum/game_mode/nations/proc/remove_access()
for(var/obj/machinery/door/airlock/W in airlocks)
- // TODO: Tie into space manager
- if(W.z in config.station_levels)
+ if(is_station_level(W.z))
W.req_access = list()
@@ -238,7 +237,7 @@ datum/game_mode/nations
return 1
/proc/get_nations_mode()
- if(!ticker || !istype(ticker.mode, /datum/game_mode/nations))
+ if(!GAMEMODE_IS_NATIONS)
return null
return ticker.mode
diff --git a/code/game/gamemodes/newobjective.dm b/code/game/gamemodes/newobjective.dm
deleted file mode 100644
index ef0edffd5f8..00000000000
--- a/code/game/gamemodes/newobjective.dm
+++ /dev/null
@@ -1,1417 +0,0 @@
-#define FRAME_PROBABILITY 3
-#define THEFT_PROBABILITY 55
-#define KILL_PROBABILITY 37
-#define PROTECT_PROBABILITY 5
-
-#define LENIENT 0
-#define NORMAL 1
-#define HARD 2
-#define IMPOSSIBLE 3
-
-
-/proc/GenerateTheft(var/job,var/datum/mind/traitor)
- var/list/datum/objective/objectives = list()
-
- for(var/o in subtypesof(/datum/objective/steal))
- var/datum/objective/target = new o(null,job)
- objectives += target
- objectives[target] = target.weight
- return objectives
-
-/proc/GenerateAssassinate(var/job,var/datum/mind/traitor)
- var/list/datum/objective/assassinate/missions = list()
-
- for(var/datum/mind/target in ticker.minds)
- if((target != traitor) && istype(target.current, /mob/living/carbon/human))
- if(target && target.current)
- var/datum/objective/target_obj = new /datum/objective/assassinate(null,job,target)
- missions += target_obj
- missions[target_obj] = target_obj.weight
- return missions
-
-/proc/GenerateFrame(var/job,var/datum/mind/traitor)
- var/list/datum/objective/frame/missions = list()
-
- for(var/datum/mind/target in ticker.minds)
- if((target != traitor) && istype(target.current, /mob/living/carbon/human))
- if(target && target.current)
- var/datum/objective/target_obj = new /datum/objective/frame(null,job,target)
- missions += target_obj
- missions[target_obj] = target_obj.weight
- return missions
-
-/proc/GenerateProtection(var/job,var/datum/mind/traitor)
- var/list/datum/objective/frame/missions = list()
-
- for(var/datum/mind/target in ticker.minds)
- if((target != traitor) && istype(target.current, /mob/living/carbon/human))
- if(target && target.current)
- var/datum/objective/target_obj = new /datum/objective/protection(null,job,target)
- missions += target_obj
- missions[target_obj] = target_obj.weight
- return missions
-
-
-/proc/SelectObjectives(var/job,var/datum/mind/traitor,var/hijack = 0)
- var/list/chosenobjectives = list()
- var/list/theftobjectives = GenerateTheft(job,traitor) //Separated all the objective types so they can be picked independantly of each other.
- var/list/killobjectives = GenerateAssassinate(job,traitor)
- var/list/frameobjectives = GenerateFrame(job,traitor)
- var/list/protectobjectives = GenerateProtection(job,traitor)
- var/total_weight
- var/conflict
-
- var/steal_weight = THEFT_PROBABILITY
- var/frame_weight = FRAME_PROBABILITY
- var/kill_weight = KILL_PROBABILITY
- var/protect_weight = PROTECT_PROBABILITY
- var/target_weight = 50
-
-/////////////////////////////////////////////////////////////
-//HANDLE ASSIGNING OBJECTIVES BASED OFF OF PREVIOUS SUCCESS//
-/////////////////////////////////////////////////////////////
-
- var/savefile/info = new("data/player_saves/[copytext(traitor.key, 1, 2)]/[traitor.key]/traitor.sav")
- var/list/infos
- info >> infos
- if(istype(infos))
- var/total_attempts = infos["Total"]
- var/total_overall_success = infos["Success"]
- var/success_ratio = total_overall_success/total_attempts
- var/steal_success = infos["Steal"]
- var/kill_success = infos["Kill"]
- var/frame_success = infos["Frame"]
- var/protect_success = infos["Protect"]
-
- var/list/ordered_success = list(steal_success, kill_success, frame_success, protect_success)
-
- var/difficulty = pick(LENIENT, LENIENT, NORMAL, NORMAL, NORMAL, HARD, HARD, IMPOSSIBLE)
- //Highest to lowest in terms of success rate, and resulting weight for later computation
- var/success_weights = list(1, 1, 1, 1)
- switch(difficulty)
- if(LENIENT)
- success_weights = list(1.5, 1, 0.75, 0.5)
- target_weight = success_ratio*100
- if(NORMAL)
- target_weight = success_ratio*150
- if(HARD)
- success_weights = list(0.66, 0.8, 1, 1.25)
- target_weight = success_ratio*200
- if(IMPOSSIBLE) //YOU SHALL NOT PASS
- success_weights = list(0.5, 0.75, 1.2, 2)
- target_weight = success_ratio*300
-
- for(var/i = 1, i <= 4, i++)
- //Iterate through the success rates, and determine the weights to chose based on the highest to
- // the lowest to multiply it by the proper success ratio.
- var/weight = max(ordered_success)
- ordered_success -= weight
- if(weight == steal_success)
- steal_weight *= steal_success*success_weights[i]
- else if(weight == frame_success)
- frame_weight *= frame_success*success_weights[i]
- else if(weight == protect_success)
- protect_weight *= protect_success*success_weights[i]
- else if(weight == kill_success)
- kill_weight *= kill_success*success_weights[i]
-
- var/total_weights = kill_weight + protect_weight + frame_weight + steal_weight
- frame_weight = round(frame_weight/total_weights)
- kill_weight = round(kill_weight/total_weights)
- steal_weight = round(steal_weight/total_weights)
- //Protect is whatever is left over.
-
- var/steal_range = steal_weight
- var/frame_range = frame_weight + steal_range
- var/kill_range = kill_weight + frame_range
- //Protect is whatever is left over.
-
- while(total_weight < target_weight)
- var/selectobj = rand(1,100) //Randomly determine the type of objective to be given.
- if(!length(killobjectives) || !length(protectobjectives)|| !length(frameobjectives)) //If any of these lists are empty, just give them theft objectives.
- var/datum/objective/objective = pickweight(theftobjectives)
- chosenobjectives += objective
- total_weight += objective.points
- theftobjectives -= objective
- else switch(selectobj)
- if(1 to steal_range)
- if(!theftobjectives.len)
- continue
- var/datum/objective/objective = pickweight(theftobjectives)
- for(1 to 10)
- if(objective.points + total_weight <= 100 || !theftobjectives.len)
- break
- theftobjectives -= objective
- objective = pickweight(theftobjectives)
- if(!objective && !theftobjectives.len)
- continue
- chosenobjectives += objective
- total_weight += objective.points
- theftobjectives -= objective
- if(steal_range + 1 to frame_range) //Framing Objectives (3% chance)
- if(!frameobjectives.len)
- continue
- var/datum/objective/objective = pickweight(frameobjectives)
- for(1 to 10)
- if(objective.points + total_weight <= 100 || !frameobjectives.len)
- break
- frameobjectives -= objective
- objective = pickweight(frameobjectives)
- if(!objective && !frameobjectives.len)
- continue
- for(var/datum/objective/protection/conflicttest in chosenobjectives) //Check to make sure we aren't telling them to Assassinate somebody they need to Protect.
- if(conflicttest.target == objective.target)
- conflict = 1
- break
- for(var/datum/objective/assassinate/conflicttest in chosenobjectives) //Check to make sure we aren't telling them to Protect somebody they need to Assassinate.
- if(conflicttest.target == objective.target)
- conflict = 1
- break
- if(!conflict)
- chosenobjectives += objective
- total_weight += objective.points
- frameobjectives -= objective
- conflict = 0
- if(frame_range + 1 to kill_range)
- if(!killobjectives.len)
- continue
- var/datum/objective/assassinate/objective = pickweight(killobjectives)
- to_chat(world, objective)
- for(1 to 10)
- if(objective.points + total_weight <= 100 || !killobjectives.len)
- break
- killobjectives -= objective
- objective = pickweight(killobjectives)
- if(!objective && !killobjectives.len)
- continue
- for(var/datum/objective/protection/conflicttest in chosenobjectives) //Check to make sure we aren't telling them to Assassinate somebody they need to Protect.
- if(conflicttest.target == objective.target)
- conflict = 1
- break
- for(var/datum/objective/frame/conflicttest in chosenobjectives) //Check to make sure we aren't telling them to Protect somebody they need to Assassinate.
- if(conflicttest.target == objective.target)
- conflict = 1
- break
- if(!conflict)
- chosenobjectives += objective
- total_weight += objective.points
- killobjectives -= objective
- conflict = 0
- if(kill_range + 1 to 100) //Protection Objectives (5% chance)
- if(!protectobjectives.len)
- continue
- var/datum/objective/protection/objective = pickweight(protectobjectives)
- for(1 to 10)
- if(objective.points + total_weight <= 100 || !protectobjectives.len)
- break
- protectobjectives -= objective
- objective = pickweight(protectobjectives)
- if(!objective || !protectobjectives.len)
- continue
- for(var/datum/objective/assassinate/conflicttest in chosenobjectives) //Check to make sure we aren't telling them to Protect somebody they need to Assassinate.
- if(conflicttest.target == objective.target)
- conflict = 1
- break
- for(var/datum/objective/frame/conflicttest in chosenobjectives) //Check to make sure we aren't telling them to Protect somebody they need to Assassinate.
- if(conflicttest.target == objective.target)
- conflict = 1
- break
- if(!conflict)
- chosenobjectives += objective
- total_weight += objective.points
- protectobjectives -= objective
- conflict = 0
-
- if(!locate(/datum/objective/hijack) in chosenobjectives && !locate(/datum/objective/escape) in chosenobjectives)
- if(hijack)
- chosenobjectives += new /datum/objective/hijack(null,job)
- else
- chosenobjectives += new /datum/objective/escape(null,job)
- return chosenobjectives
-
-datum
- objective
- var/datum/mind/owner
- var/datum/mind/target
- var/explanation_text = "text not set"
- var/job
- var/points = INFINITY //If this isn't set to something else, the objective is bugged and should be ignored
- var/weight = INFINITY
-
- New(var/text,var/joba)
- if(text)
- src.explanation_text = text
- job=joba
- weight = get_weight(job)
- points = get_points(job)
-
- proc/check_completion()
- return 1
- proc/get_points(var/job)
- return INFINITY
- proc/get_weight(var/job)
- return INFINITY
- proc/find_target_by_role(role, role_type=0)//Option sets either to check assigned role or special role. Default to assigned.
- for(var/datum/mind/possible_target in ticker.minds)
- if((possible_target != owner) && ishuman(possible_target.current) && ((role_type ? possible_target.special_role : possible_target.assigned_role) == role) )
- target = possible_target
- break
-
-
- frame
- New(var/text,var/joba,var/datum/mind/targeta)
- target = targeta
- job = joba
- weight = get_points(job)
- explanation_text = "Frame [target.current.real_name], the [target.assigned_role] for a crime and make sure they are arrested and brought back to the Centcom station alive. We'll handle the rest from there."
-
- check_completion()
- if(!emergency_shuttle.returned())
- return 0
- if(target.current.stat == 2)
- return 0
- var/turf/location = get_turf(target.current.loc)
- if(!location)
- return 0
- if(!target.current:handcuffed && !istype(location, /turf/simulated/shuttle/floor4))
- return 0
-
- if(location in locate(/area/shuttle/escape/centcom))
- return 1
-
- return 0
-
- get_points()
- if(target)
- var/difficulty = GetRank(target.assigned_role) + 1
- switch(GetRank(job))
- if(4)
- return 20*difficulty
- if(3)
- return 30*difficulty
- if(2)
- return 40*difficulty
- if(1)
- return 55*difficulty
- if(0)
- return 60*difficulty
- else
- return INFINITY
-
- get_weight()
- if(target)
- return 1
- return 0
-
-
- protection
- New(var/text,var/joba,var/datum/mind/targeta)
- target = targeta
- job = joba
- weight = get_points(job)
- explanation_text = "[target.current.real_name], the [target.assigned_role] is a [pick("relative of a","friend of a","") + pick("high ranking","important","well-liked")] Syndicate [pick("Leader","Officer","Agent","sympathiser")]. Make sure they get off the station safely, while minimizing intervention."
-
- check_completion()
- if(!emergency_shuttle.returned())
- return 0
-
- if(target.current.stat == 2)
- return 0
-
- var/turf/location = get_turf(target.current.loc)
- if(!location)
- return 0
-
- if(location in locate(/area/shuttle/escape/centcom))
- return 1
-
- return 0
-
- get_points()
- if(target)
- return 30
- else
- return INFINITY
-
- get_weight()
- if(target)
- return 1
- return 0
-
- find_target_by_role(role, role_type=0)
- ..(role, role_type)
- if(target && target.current)
- explanation_text = "Protect [target.current.real_name], the [target.role_alt_title ? target.role_alt_title : (!role_type ? target.assigned_role : target.special_role)]."
- else
- explanation_text = "Free Objective"
- return target
-
-
- assassinate
-
- New(var/text,var/joba,var/datum/mind/targeta)
- target = targeta
- job = joba
- weight = get_points(job)
- explanation_text = "Assassinate [target.current.real_name], the [target.role_alt_title ? target.role_alt_title : target.assigned_role]."
-
- check_completion()
- if(target && target.current)
- if(target.current.stat == 2 || istype(get_area(target.current), /area/tdome) || issilicon(target.current) || isbrain(target.current))
- return 1
- else
- return 0
- else
- return 1
- get_points()
- if(target)
- var/difficulty = GetRank(target.assigned_role) + 1
- switch(GetRank(job))
- if(4)
- return 20*difficulty
- if(3)
- return 30*difficulty
- if(2)
- return 40*difficulty
- if(1)
- return 55*difficulty
- if(0)
- return 60*difficulty
- else
- return 0
-
- get_weight()
- if(target)
- return 1
- return 0
-
- find_target_by_role(var/role)
- for(var/datum/mind/possible_target in ticker.minds)
- if((possible_target != owner) && istype(possible_target.current, /mob/living/carbon/human) && (possible_target.assigned_role == role))
- target = possible_target
- break
-
- if(target && target.current)
- explanation_text = "Assassinate [target.current.real_name], the [target.role_alt_title ? target.role_alt_title : target.assigned_role]."
- else
- explanation_text = "Free Objective"
-
- return target
-
-
- proc/find_target()
- var/list/possible_targets = list()
-
- for(var/datum/mind/possible_target in ticker.minds)
- if((possible_target != owner) && istype(possible_target.current, /mob/living/carbon/human))
- possible_targets += possible_target
-
- if(possible_targets.len > 0)
- target = pick(possible_targets)
-
- if(target && target.current)
- explanation_text = "Assassinate [target.current.real_name], the [target.role_alt_title ? target.role_alt_title : target.assigned_role]."
- else
- explanation_text = "Free Objective"
-
- return target
-
-
- capture
- var/separation_time = 0
- var/almost_complete = 0
-
- New(var/text,var/joba,var/datum/mind/targeta)
- target = targeta
- job = joba
- explanation_text = "Capture [target.current.real_name], the [target.assigned_role]."
-
- check_completion()
- if(target && target.current)
- if(target.current.stat == 2)
- if(config.require_heads_alive) return 0
- else
- if(!target.current.handcuffed)
- return 0
- else if(config.require_heads_alive) return 0
- return 1
-
- find_target_by_role(var/role)
- for(var/datum/mind/possible_target in ticker.minds)
- if((possible_target != owner) && istype(possible_target.current, /mob/living/carbon/human) && (possible_target.assigned_role == role))
- target = possible_target
- break
-
- if(target && target.current)
- explanation_text = "Capture [target.current.real_name], the [target.assigned_role]."
- else
- explanation_text = "Free Objective"
-
- return target
-
- get_points()
- if(target)
- var/difficulty = GetRank(target.assigned_role) + 1
- switch(GetRank(job))
- if(4)
- return 20*difficulty
- if(3)
- return 30*difficulty
- if(2)
- return 40*difficulty
- if(1)
- return 55*difficulty
- if(0)
- return 60*difficulty
- else
- return INFINITY
-
- get_weight()
- if(target)
- return 1
- return 0
-
-
- hijack
- explanation_text = "Hijack the emergency shuttle by escaping alone."
-
- check_completion()
- if(!emergency_shuttle.returned())
- return 0
-
- if(!owner.current || owner.current.stat == 2)
- return 0
- var/turf/location = get_turf(owner.current.loc)
-
- if(location in locate(/area/shuttle/escape/centcom))
- for(var/mob/living/player in locate(/area/shuttle/escape/centcom))
- if(player.mind && (player.mind != owner))
- if(player.stat != 2) //they're not dead
- return 0
- return 1
-
- return 0
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 75
- if(1)
- return 65
- if(2)
- return 65
- if(3)
- return 50
- if(4)
- return 35
-
- get_weight(var/job)
- return 1
-
- escape
- explanation_text = "Escape on the shuttle alive, without being arrested."
-
- check_completion()
- if(!emergency_shuttle.returned())
- return 0
-
- if(!owner.current || owner.current.stat ==2)
- return 0
-
- var/turf/location = get_turf(owner.current.loc)
- if(!location)
- return 0
-
- if(owner.current:handcuffed || istype(location, /turf/simulated/shuttle/floor4))
- return 0
-
- if(location in locate(/area/shuttle/escape/centcom))
- return 1
-
- return 0
- get_points()
- return INFINITY
-
- get_weight(var/job)
- return 1
-
-
- survive
- explanation_text = "Stay alive."
-
- check_completion()
- if(!owner.current || owner.current.stat == 2)
- return 0
-
- return 1
- get_points()
- return INFINITY
-
- get_weight(var/job)
- return 1
-
-
- steal
- var/obj/item/steal_target
-
- check_completion()
- if(steal_target)
- if(owner.current.check_contents_for(steal_target))
- return 1
- else
- return 0
-
-
- captainslaser
- steal_target = /obj/item/weapon/gun/energy/laser/captain
- explanation_text = "Steal the captain's antique laser gun."
- weight = 20
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 60
- if(1)
- return 50
- if(2)
- return 40
- if(3)
- return 30
- if(4)
- return 20
-
- get_weight(var/job)
- if(GetRank(job) == 4)
- return 10
- else
- return 20
-
-
- plasmatank
- steal_target = /obj/item/weapon/tank/plasma
- explanation_text = "Steal a small plasma tank."
- weight = 20
-
- get_points(var/job)
- if(job in science_positions || job in command_positions)
- return 20
- return 40
-
- get_weight(var/job)
- return 20
-
- check_completion()
- var/list/all_items = owner.current.get_contents()
- for(var/obj/item/I in all_items)
- if(!istype(I, steal_target)) continue//If it's not actually that item.
- if(I:air_contents:toxins) return 1 //If they got one with plasma
- return 0
-
-
- /*Removing this as an objective. Not necessary to have two theft objectives in the same room.
- steal/captainssuit
- steal_target = /obj/item/clothing/under/rank/captain
- explanation_text = "Steal a captain's rank jumpsuit"
- weight = 50
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 75
- if(1)
- return 60
- if(2)
- return 50
- if(3)
- return 30
- if(4)
- return INFINITY
- */
-
-
- handtele
- steal_target = /obj/item/weapon/hand_tele
- explanation_text = "Steal a hand teleporter."
- weight = 20
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 75
- if(1)
- return 60
- if(2)
- return 50
- if(3)
- return 30
- if(4)
- return 20
-
- get_weight(var/job)
- if(GetRank(job) == 4)
- return 10
- else
- return 20
-
-
- /*burger
- steal_target = /obj/item/weapon/reagent_containers/food/snacks/human/burger
- explanation_text = "Steal a burger made out of human organs, this will be presented as proof of Nanotrasen's chronic lack of standards."
- weight = 60
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 80
- if(1)
- return 65
- if(2)
- return 55
- if(3)
- return 40
- if(4)
- return 25*/
-
-
- jetpack
- steal_target = /obj/item/weapon/tank/jetpack/oxygen
- explanation_text = "Steal a blue oxygen jetpack."
- weight = 20
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 75
- if(1)
- return 60
- if(2)
- return 50
- if(3)
- return 30
- if(4)
- return 20
-
- get_weight(var/job)
- if(GetRank(job) == 4)
- return 10
- else
- return 20
-
-
- /*magboots
- steal_target = /obj/item/clothing/shoes/magboots
- explanation_text = "Steal a pair of \"Nanotrasen\" brand magboots."
- weight = 20
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 75
- if(1)
- return 60
- if(2)
- return 50
- if(3)
- return 30
- if(4)
- return 20
-
- get_weight(var/job)
- if(GetRank(job) == 4)
- return 10
- else
- return 20*/
-
-
- blueprints
- steal_target = /obj/item/blueprints
- explanation_text = "Steal the station's blueprints."
- weight = 20
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 75
- if(1)
- return 60
- if(2)
- return 50
- if(3)
- return 30
- if(4)
- return 20
-
- get_weight(var/job)
- if(GetRank(job) == 4)
- return 10
- else
- return 20
-
-
- voidsuit
- steal_target = /obj/item/clothing/suit/space/nasavoid
- explanation_text = "Steal a voidsuit."
- weight = 20
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 75
- if(1)
- return 60
- if(2)
- return 50
- if(3)
- return 30
- if(4)
- return 20
-
- get_weight(var/job)
- return 20
-
-
- nuke_disk
- steal_target = /obj/item/weapon/disk/nuclear
- explanation_text = "Steal the station's nuclear authentication disk."
- weight = 20
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 90
- if(1)
- return 80
- if(2)
- return 70
- if(3)
- return 40
- if(4)
- return 25
-
- get_weight(var/job)
- if(GetRank(job) == 4)
- return 10
- else
- return 20
-
- nuke_gun
- steal_target = /obj/item/weapon/gun/energy/gun/nuclear
- explanation_text = "Steal a nuclear powered gun."
- weight = 20
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 90
- if(1)
- return 85
- if(2)
- return 80
- if(3)
- return 75
- if(4)
- return 75
-
- get_weight(var/job)
- return 2
-
- diamond_drill
- steal_target = /obj/item/weapon/pickaxe/drill/diamonddrill
- explanation_text = "Steal a diamond drill."
- weight = 20
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 90
- if(1)
- return 85
- if(2)
- return 70
- if(3)
- return 75
- if(4)
- return 75
-
- get_weight(var/job)
- return 2
-
- boh
- steal_target = /obj/item/weapon/storage/backpack/holding
- explanation_text = "Steal a \"bag of holding.\""
- weight = 20
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 90
- if(1)
- return 85
- if(2)
- return 80
- if(3)
- return 75
- if(4)
- return 75
-
- get_weight(var/job)
- return 2
-
- hyper_cell
- steal_target = /obj/item/weapon/stock_parts/cell/hyper
- explanation_text = "Steal a hyper capacity power cell."
- weight = 20
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 90
- if(1)
- return 85
- if(2)
- return 80
- if(3)
- return 75
- if(4)
- return 75
-
- get_weight(var/job)
- return 2
-
- lucy
- steal_target = /obj/item/stack/sheet/diamond
- explanation_text = "Steal 10 diamonds."
- weight = 20
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 90
- if(1)
- return 85
- if(2)
- return 80
- if(3)
- return 75
- if(4)
- return 75
-
- get_weight(var/job)
- return 2
-
- check_completion()
- var/target_amount = 10
- var/found_amount = 0.0//Always starts as zero.
- for(var/obj/item/I in owner.current.get_contents())
- if(!istype(I, steal_target)) continue//If it's not actually that item.
- found_amount += I:amount
- return found_amount>=target_amount
-
- gold
- steal_target = /obj/item/stack/sheet/gold
- explanation_text = "Steal 50 gold bars."
- weight = 20
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 90
- if(1)
- return 85
- if(2)
- return 80
- if(3)
- return 75
- if(4)
- return 70
-
- get_weight(var/job)
- return 2
-
- check_completion()
- var/target_amount = 50
- var/found_amount = 0.0//Always starts as zero.
- for(var/obj/item/I in owner.current.get_contents())
- if(!istype(I, steal_target)) continue//If it's not actually that item.
- found_amount += I:amount
- return found_amount>=target_amount
-
- uranium
- steal_target = /obj/item/stack/sheet/uranium
- explanation_text = "Steal 25 uranium bars."
- weight = 20
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 90
- if(1)
- return 85
- if(2)
- return 80
- if(3)
- return 75
- if(4)
- return 70
-
- get_weight(var/job)
- return 2
-
- check_completion()
- var/target_amount = 25
- var/found_amount = 0.0//Always starts as zero.
- for(var/obj/item/I in owner.current.get_contents())
- if(!istype(I, steal_target)) continue//If it's not actually that item.
- found_amount += I:amount
- return found_amount>=target_amount
-
-
- /*Needs some work before it can be put in the game to differentiate ship implanters from syndicate implanters.
- steal/implanter
- steal_target = /obj/item/weapon/implanter
- explanation_text = "Steal an implanter"
- weight = 50
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 75
- if(1)
- return 60
- if(2)
- return 50
- if(3)
- return 30
- if(4)
- return INFINITY
- */
- cyborg
- steal_target = /obj/item/robot_parts/robot_suit
- explanation_text = "Steal a completed robot shell (no brain)"
- weight = 30
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 75
- if(1)
- return 60
- if(2)
- return 50
- if(3)
- return 30
- if(4)
- return 20
-
- check_completion()
- if(steal_target)
- for(var/obj/item/robot_parts/robot_suit/objective in owner.current.get_contents())
- if(istype(objective,/obj/item/robot_parts/robot_suit) && objective.check_completion())
- return 1
- return 0
-
- get_weight(var/job)
- return 20
- AI
- steal_target = /obj/structure/AIcore
- explanation_text = "Steal a finished AI, either by intellicard or stealing the whole construct."
- weight = 50
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 75
- if(1)
- return 60
- if(2)
- return 50
- if(3)
- return 30
- if(4)
- return 20
-
- get_weight(var/job)
- return 15
-
- check_completion()
- if(steal_target)
- for(var/obj/item/device/aicard/C in owner.current.get_contents())
- for(var/mob/living/silicon/ai/M in C)
- if(istype(M, /mob/living/silicon/ai) && M.stat != 2)
- return 1
- for(var/mob/living/silicon/ai/M in world)
- if(istype(M.loc, /turf))
- if(istype(get_area(M), /area/shuttle/escape))
- return 1
- for(var/obj/structure/AIcore/M in world)
- if(istype(M.loc, /turf) && M.state == 4)
- if(istype(get_area(M), /area/shuttle/escape))
- return 1
- return 0
-
- drugs
- steal_target = /datum/reagent/space_drugs
- explanation_text = "Steal some space drugs."
- weight = 40
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 75
- if(1)
- return 60
- if(2)
- return 50
- if(3)
- return 30
- if(4)
- return 20
-
- check_completion()
- if(steal_target)
- if(owner.current.check_contents_for_reagent(steal_target))
- return 1
- else
- return 0
-
- get_weight(var/job)
- return 20
-
-
- pacid
- steal_target = /datum/reagent/pacid
- explanation_text = "Steal some polytrinic acid."
- weight = 40
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 75
- if(1)
- return 60
- if(2)
- return 50
- if(3)
- return 30
- if(4)
- return 20
-
- check_completion()
- if(steal_target)
- if(owner.current.check_contents_for_reagent(steal_target))
- return 1
- else
- return 0
-
- get_weight(var/job)
- return 20
-
-
- reagent
- weight = 20
- var/target_name
- New(var/text,var/joba)
- ..()
- var/list/items = list("Sulphuric acid", "Polytrinic acid", "Space Lube", "Unstable mutagen",\
- "Leporazine", "Cryptobiolin", "Lexorin ",\
- "Kelotane", "Dexalin", "Tricordrazine")
- target_name = pick(items)
- switch(target_name)
- if("Sulphuric acid")
- steal_target = /datum/reagent/acid
- if("Polytrinic acid")
- steal_target = /datum/reagent/pacid
- if("Space Lube")
- steal_target = /datum/reagent/lube
- if("Unstable mutagen")
- steal_target = /datum/reagent/mutagen
- if("Leporazine")
- steal_target = /datum/reagent/leporazine
- if("Cryptobiolin")
- steal_target =/datum/reagent/cryptobiolin
- if("Lexorin")
- steal_target = /datum/reagent/lexorin
- if("Kelotane")
- steal_target = /datum/reagent/kelotane
- if("Dexalin")
- steal_target = /datum/reagent/dexalin
- if("Tricordrazine")
- steal_target = /datum/reagent/tricordrazine
-
- explanation_text = "Steal a container filled with [target_name]."
-
- get_points(var/job)
- switch(GetRank(job))
- if(0)
- return 75
- if(1)
- return 60
- if(2)
- return 50
- if(3)
- return 30
- if(4)
- return 20
-
- check_completion()
- if(steal_target)
- if(owner.current.check_contents_for_reagent(steal_target))
- return 1
- else
- return 0
-
- get_weight(var/job)
- return 20
-
- cash //must be in credits - atm and coins don't count
- var/steal_amount = 2000
- explanation_text = "Beg, borrow or steal 2000 credits."
- weight = 20
-
- New(var/text,var/joba)
- ..(text,joba)
- steal_amount = 1250 + rand(0,3750)
- explanation_text = "Beg, borrow or steal [steal_amount] credits."
-
- get_points(var/job)
- return 10 + 25 * round(steal_amount / 5000)
-
- check_completion()
- var/held_credits = 0
- for(var/obj/item/weapon/spacecash/M in owner.current.get_contents())
- held_credits += M.get_total()
- if(held_credits >= steal_amount)
- return 1
- return 0
-
- get_weight(var/job)
- return 20
-
-
- nuclear
- explanation_text = "Destroy the station with a nuclear device."
-
-
- block
- explanation_text = "Do not allow any humans to escape on the shuttle alive."
-
-
- check_completion()
- if(!istype(owner.current, /mob/living/silicon))
- return 0
- if(!emergency_shuttle.returned())
- return 0
- if(!owner.current)
- return 0
- var/area/shuttle = locate(/area/shuttle/escape/centcom)
- var/protected_mobs[] = list(/mob/living/silicon/ai, /mob/living/silicon/pai, /mob/living/silicon/robot)
- for(var/mob/living/player in world)
- if(player.type in protected_mobs) continue
- if(player.mind)
- if(player.stat != 2)
- if(get_turf(player) in shuttle)
- return 0
- return 1
-
- decapitate
- New(var/text,var/joba,var/datum/mind/targeta)
- target = targeta
- job = joba
- explanation_text = "Remove and recover the head of [target.current.real_name], the [target.assigned_role]."
- proc/find_target()
- ..()
- if(target && target.current)
- explanation_text = "[target.current.real_name], the [target.role_alt_title ? target.role_alt_title : target.assigned_role], has defied us for the last time. Make an example of him, and bring us his severed head."
- else
- explanation_text = "Free Objective"
- return target
-
-
- find_target_by_role(role, role_type=0)
- ..(role, role_type)
- if(target && target.current)
- explanation_text = "[target.current.real_name], the [target.role_alt_title ? target.role_alt_title : (!role_type ? target.assigned_role : target.special_role)], has defied us for the last time. Make an example of him, and bring us his severed head."
- else
- explanation_text = "Free Objective"
- return target
-
-
- check_completion()
- if(target && target.current)
- if(!owner.current||owner.current.stat==2)//If you're otherwise dead.
- return 0
- var/list/all_items = owner.current.get_contents()
- for(var/obj/item/weapon/organ/head/mmi in all_items)
- if(mmi.brainmob&&mmi.brainmob.mind==target)
- return 1
- return 0
- else
- return 1
-
- absorb
- var/target_amount
- proc/gen_amount_goal(var/lowbound = 4, var/highbound = 6)
- target_amount = rand (lowbound,highbound)
- if(ticker)
- var/n_p = 1 //autowin
- if(ticker.current_state == GAME_STATE_SETTING_UP)
- for(var/mob/new_player/P in world)
- if(P.client && P.ready && P.mind!=owner)
- n_p++
- else if(ticker.current_state == GAME_STATE_PLAYING)
- for(var/mob/living/carbon/human/P in world)
- if(P.client && !(P.mind in ticker.mode.changelings) && P.mind!=owner)
- n_p++
- target_amount = min(target_amount, n_p)
-
- explanation_text = "Absorb [target_amount] compatible genomes."
- return target_amount
-
- check_completion()
- if(owner && owner.current && owner.current.changeling && owner.current.changeling.absorbed_dna && ((owner.current.changeling.absorbed_dna.len - 1) >= target_amount))
- return 1
- else
- return 0
-
- meme_attune
- var/target_amount
- proc/gen_amount_goal(var/lowbound = 4, var/highbound = 6)
- target_amount = rand (lowbound,highbound)
-
- explanation_text = "Attune [target_amount] humanoid brains."
- return target_amount
-
- check_completion()
- if(owner && owner.current && istype(owner.current,/mob/living/parasite/meme) && (owner.current:indoctrinated.len >= target_amount))
- return 1
- else
- return 0
-
- download
- var/target_amount
- proc/gen_amount_goal()
- target_amount = rand(10,20)
- explanation_text = "Download [target_amount] research levels."
- return target_amount
-
-
- check_completion()
- return 0
-
-
- debrain//I want braaaainssss
- New(var/text,var/joba,var/datum/mind/targeta)
- target = targeta
- job = joba
- explanation_text = "Remove and recover the brain of [target.current.real_name], the [target.assigned_role]."
-
- proc/find_target()
- ..()
- if(target && target.current)
- explanation_text = "Steal the brain of [target.current.real_name]."
- else
- explanation_text = "Free Objective"
- return target
-
-
- find_target_by_role(role, role_type=0)
- ..(role, role_type)
- if(target && target.current)
- explanation_text = "Steal the brain of [target.current.real_name] the [target.role_alt_title ? target.role_alt_title : (!role_type ? target.assigned_role : target.special_role)]."
- else
- explanation_text = "Free Objective"
- return target
-
-
- check_completion()
- if(!target)//If it's a free objective.
- return 1
- if(!owner.current||owner.current.stat==2)//If you're otherwise dead.
- return 0
- var/list/all_items = owner.current.get_contents()
- for(var/obj/item/device/mmi/mmi in all_items)
- if(mmi.brainmob&&mmi.brainmob.mind==target) return 1
- for(var/obj/item/brain/brain in all_items)
- if(brain.brainmob&&brain.brainmob.mind==target) return 1
- return 0
-
- mutiny
- proc/find_target()
- ..()
- if(target && target.current)
- explanation_text = "Assassinate [target.current.real_name], the [target.role_alt_title ? target.role_alt_title : target.assigned_role]."
- else
- explanation_text = "Free Objective"
- return target
-
-
- find_target_by_role(role, role_type=0)
- ..(role, role_type)
- if(target && target.current)
- explanation_text = "Assassinate [target.current.real_name], the [target.role_alt_title ? target.role_alt_title : (!role_type ? target.assigned_role : target.special_role)]."
- else
- explanation_text = "Free Objective"
- return target
-
-
- check_completion()
- if(target && target.current)
- var/turf/T = get_turf(target.current)
- if(target.current.stat == 2)
- return 1
- // TODO: Tie into space manager
- else if((T) && !(T.z in config.station_levels))//If they leave the station they count as dead for this
- return 2
- else
- return 0
- else
- return 1
-
- capture
- var/target_amount
- proc/gen_amount_goal()
- target_amount = rand(5,10)
- explanation_text = "Accumulate [target_amount] capture points."
- return target_amount
-
-
- check_completion()//Basically runs through all the mobs in the area to determine how much they are worth.
- return 0
-
-datum/objective/silence
- explanation_text = "Do not allow anyone to escape the station. Only allow the shuttle to be called when everyone is dead and your story is the only one left."
-
- check_completion()
- if(!emergency_shuttle.returned())
- return 0
-
- var/area/shuttle = locate(/area/shuttle/escape/centcom)
- var/area/pod1 = locate(/area/shuttle/escape_pod1/centcom)
- var/area/pod2 = locate(/area/shuttle/escape_pod2/centcom)
- var/area/pod3 = locate(/area/shuttle/escape_pod3/centcom)
- var/area/pod4 = locate(/area/shuttle/escape_pod5/centcom)
-
- for(var/mob/living/player in world)
- if(player == owner.current)
- continue
- if(player.mind)
- if(player.stat != 2)
- if(get_turf(player) in shuttle)
- return 0
- if(get_turf(player) in pod1)
- return 0
- if(get_turf(player) in pod2)
- return 0
- if(get_turf(player) in pod3)
- return 0
- if(get_turf(player) in pod4)
- return 0
- return 1
-
-#undef FRAME_PROBABILITY
-#undef THEFT_PROBABILITY
-#undef KILL_PROBABILITY
-#undef PROTECT_PROBABILITY
-#undef LENIENT
-#undef NORMAL
-#undef HARD
-#undef IMPOSSIBLE
diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm
index a26f941188b..f5fdd85242f 100644
--- a/code/game/gamemodes/nuclear/nuclear.dm
+++ b/code/game/gamemodes/nuclear/nuclear.dm
@@ -50,7 +50,7 @@ proc/issyndicate(mob/living/M as mob)
for(var/datum/mind/synd_mind in syndicates)
synd_mind.assigned_role = "MODE" //So they aren't chosen for other jobs.
- synd_mind.special_role = "Syndicate"//So they actually have a special role/N
+ synd_mind.special_role = SPECIAL_ROLE_NUKEOPS
return 1
@@ -360,7 +360,7 @@ proc/issyndicate(mob/living/M as mob)
/datum/game_mode/proc/auto_declare_completion_nuclear()
- if( syndicates.len || (ticker && istype(ticker.mode,/datum/game_mode/nuclear)) )
+ if(syndicates.len || GAMEMODE_IS_NUCLEAR)
var/text = "
The syndicate operatives were:"
var/purchases = ""
diff --git a/code/game/gamemodes/nuclear/nuclear_challenge.dm b/code/game/gamemodes/nuclear/nuclear_challenge.dm
index 15a4c8ec246..790c6a18e34 100644
--- a/code/game/gamemodes/nuclear/nuclear_challenge.dm
+++ b/code/game/gamemodes/nuclear/nuclear_challenge.dm
@@ -19,8 +19,7 @@
if(player_list.len < MIN_CHALLENGE_PLAYERS)
to_chat(user, "The enemy crew is too small to be worth declaring war on.")
return
- // TODO: Tie into space manager
- if(user.z != ZLEVEL_CENTCOMM)
+ if(!is_admin_level(user.z))
to_chat(user, "You have to be at your base to use this.")
return
diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm
index ae22e0ec458..833cb6d99ae 100644
--- a/code/game/gamemodes/nuclear/nuclearbomb.dm
+++ b/code/game/gamemodes/nuclear/nuclearbomb.dm
@@ -353,8 +353,7 @@ var/bomb_set
var/off_station = 0
var/turf/bomb_location = get_turf(src)
- // TODO: Tie into space manager
- if( bomb_location && (bomb_location.z in config.station_levels) )
+ if( bomb_location && is_station_level(bomb_location.z) )
if( (bomb_location.x < (128-NUKERANGE)) || (bomb_location.x > (128+NUKERANGE)) || (bomb_location.y < (128-NUKERANGE)) || (bomb_location.y > (128+NUKERANGE)) )
off_station = 1
else
@@ -364,8 +363,7 @@ var/bomb_set
if(ticker.mode && ticker.mode.name == "nuclear emergency")
var/obj/docking_port/mobile/syndie_shuttle = shuttle_master.getShuttle("syndicate")
if(syndie_shuttle)
- // TODO: Tie into space manager
- ticker.mode:syndies_didnt_escape = (syndie_shuttle.z > ZLEVEL_STATION ? 0 : 1) //muskets will make me change this, but it will do for now
+ ticker.mode:syndies_didnt_escape = is_station_level(syndie_shuttle.z)
ticker.mode:nuke_off_station = off_station
ticker.station_explosion_cinematic(off_station,null)
if(ticker.mode)
@@ -403,8 +401,7 @@ var/bomb_set
/obj/item/weapon/disk/nuclear/process()
var/turf/disk_loc = get_turf(src)
- // TODO: Tie into space manager
- if(disk_loc.z != ZLEVEL_STATION && disk_loc.z != ZLEVEL_CENTCOMM)
+ if(!is_secure_level(disk_loc.z))
var/holder = get(src, /mob)
if(holder)
to_chat(holder, "You can't help but feel that you just lost something back there...")
diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm
index f0a8f8957b2..14c77b2060a 100644
--- a/code/game/gamemodes/objective.dm
+++ b/code/game/gamemodes/objective.dm
@@ -1,7 +1,7 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
var/global/list/all_objectives = list()
-var/list/potential_theft_objectives=subtypesof(/datum/theft_objective) \
+var/list/potential_theft_objectives = subtypesof(/datum/theft_objective) \
- /datum/theft_objective/steal \
- /datum/theft_objective/special \
- /datum/theft_objective/number \
@@ -16,407 +16,358 @@ var/list/potential_theft_objectives=subtypesof(/datum/theft_objective) \
var/completed = 0 //currently only used for custom objectives.
var/martyr_compatible = 0 //If the objective is compatible with martyr objective, i.e. if you can still do it while dead.
- New(var/text)
- all_objectives |= src
- if(text)
- explanation_text = text
+/datum/objective/New(var/text)
+ all_objectives |= src
+ if(text)
+ explanation_text = text
- Destroy()
- all_objectives -= src
- return ..()
+/datum/objective/Destroy()
+ all_objectives -= src
+ return ..()
- proc/check_completion()
- return completed
+/datum/objective/proc/check_completion()
+ return completed
- proc/find_target()
- var/list/possible_targets = list()
- for(var/datum/mind/possible_target in ticker.minds)
- if(possible_target != owner && ishuman(possible_target.current) && (possible_target.current.stat != DEAD) && possible_target.current.client)
- possible_targets += possible_target
- if(possible_targets.len > 0)
- target = pick(possible_targets)
+/datum/objective/proc/is_invalid_target(datum/mind/possible_target)
+ if(possible_target == owner)
+ return TARGET_INVALID_IS_OWNER
+ if(!ishuman(possible_target.current))
+ return TARGET_INVALID_NOT_HUMAN
+ if(!possible_target.current.stat == DEAD)
+ return TARGET_INVALID_DEAD
- proc/find_target_by_role(role, role_type=0)//Option sets either to check assigned role or special role. Default to assigned.
- var/list/possible_targets = list()
- for(var/datum/mind/possible_target in ticker.minds)
- if((possible_target != owner) && ishuman(possible_target.current) && ((role_type ? possible_target.special_role : possible_target.assigned_role) == role) && (possible_target.current.stat != DEAD) && possible_target.current.client)
- possible_targets += possible_target
- if(possible_targets.len > 0)
- target = pick(possible_targets)
+/datum/objective/proc/find_target()
+ var/list/possible_targets = list()
+ for(var/datum/mind/possible_target in ticker.minds)
+ if(is_invalid_target(possible_target))
+ continue
-//Selects someone with a specific special role if role is != null. Or just anyone with a special role
- proc/find_target_with_special_role(role)
- var/list/possible_targets = list()
- for(var/datum/mind/possible_target in ticker.minds)
- if((possible_target != owner) && ishuman(possible_target.current) && (role && possible_target.special_role == role || !role && possible_target.special_role) && (possible_target.current.stat != DEAD) && possible_target.current.client)
- possible_targets += possible_target
- if(possible_targets.len > 0)
- target = pick(possible_targets)
+ possible_targets += possible_target
+
+ if(possible_targets.len > 0)
+ target = pick(possible_targets)
/datum/objective/assassinate
martyr_compatible = 1
- find_target()
- ..()
- if(target && target.current)
- explanation_text = "Assassinate [target.current.real_name], the [target.assigned_role]."
- else
- explanation_text = "Free Objective"
- return target
-
-
- find_target_by_role(role, role_type=0)
- ..(role, role_type)
- if(target && target.current)
- explanation_text = "Assassinate [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role]."
- else
- explanation_text = "Free Objective"
- return target
-
-
- check_completion()
- if(target && target.current)
- // TODO: Tie into space manager
- if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current) || !target.current.ckey) //Borgs/brains/AIs count as dead for traitor objectives. --NeoFite
- return 1
- return 0
- return 1
+/datum/objective/assassinate/find_target()
+ ..()
+ if(target && target.current)
+ explanation_text = "Assassinate [target.current.real_name], the [target.assigned_role]."
+ else
+ explanation_text = "Free Objective"
+/datum/objective/assassinate/check_completion()
+ if(target && target.current)
+ if(target.current.stat == DEAD)
+ return 1
+ if(issilicon(target.current) || isbrain(target.current)) //Borgs/brains/AIs count as dead for traitor objectives. --NeoFite
+ return 1
+ if(!target.current.ckey)
+ return 1
+ return 0
+ return 1
/datum/objective/mutiny
martyr_compatible = 1
- find_target()
- ..()
- if(target && target.current)
- explanation_text = "Assassinate [target.current.real_name], the [target.assigned_role]."
- else
- explanation_text = "Free Objective"
- return target
+/datum/objective/mutiny/find_target()
+ ..()
+ if(target && target.current)
+ explanation_text = "Assassinate [target.current.real_name], the [target.assigned_role]."
+ else
+ explanation_text = "Free Objective"
+ return target
-
- find_target_by_role(role, role_type=0)
- ..(role, role_type)
- if(target && target.current)
- explanation_text = "Assassinate or exile [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role]."
- else
- explanation_text = "Free Objective"
- return target
-
- check_completion()
- if(target && target.current)
- if(target.current.stat == DEAD || !ishuman(target.current) || !target.current.ckey || !target.current.client)
- return 1
- var/turf/T = get_turf(target.current)
- // TODO: Tie into space manager
- if(T && !(T.z in config.station_levels)) //If they leave the station they count as dead for this
- return 2
- return 0
- return 1
+/datum/objective/mutiny/check_completion()
+ if(target && target.current)
+ if(target.current.stat == DEAD || !ishuman(target.current) || !target.current.ckey || !target.current.client)
+ return 1
+ var/turf/T = get_turf(target.current)
+ if(T && !is_station_level(T.z)) //If they leave the station they count as dead for this
+ return 1
+ return 0
+ return 1
/datum/objective/mutiny/rp
- find_target()
- ..()
- if(target && target.current)
- explanation_text = "Assassinate, capture or convert [target.current.real_name], the [target.assigned_role]."
- else
- explanation_text = "Free Objective"
- return target
+/datum/objective/mutiny/rp/find_target()
+ ..()
+ if(target && target.current)
+ explanation_text = "Assassinate, capture or convert [target.current.real_name], the [target.assigned_role]."
+ else
+ explanation_text = "Free Objective"
-
- find_target_by_role(role, role_type=0)
- ..(role, role_type)
- if(target && target.current)
- explanation_text = "Assassinate, capture or convert [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role]."
- else
- explanation_text = "Free Objective"
- return target
-
- // less violent rev objectives
- check_completion()
- var/rval = 1
- if(target && target.current)
- //assume that only carbon mobs can become rev heads for now
- if(target.current.stat == DEAD || target.current:handcuffed || !ishuman(target.current))
+//less violent rev objectives
+/datum/objective/mutiny/rp/check_completion()
+ if(target && target.current)
+ if(target.current.stat == DEAD)
+ return 1
+ if(!ishuman(target.current))
+ return 1
+ if(iscarbon(target.current))
+ var/mob/living/carbon/C = target.current
+ if(C.handcuffed)
return 1
- // Check if they're converted
- if(istype(ticker.mode, /datum/game_mode/revolution))
- if(target in ticker.mode:head_revolutionaries)
- return 1
- var/turf/T = get_turf(target.current)
- // TODO: Tie into space manager
- if(T && !(T.z in config.station_levels)) //If they leave the station they count as dead for this
- rval = 2
- return 0
- return rval
+
+ if(GAMEMODE_IS_REVOLUTION)
+ if(target in ticker.mode.head_revolutionaries)
+ return 1
+
+ var/turf/T = get_turf(target.current)
+ if(T && !is_station_level(T.z))
+ return 1
+
+ return 0
+ return 1
+
/datum/objective/maroon
martyr_compatible = 1
- find_target()
- ..()
- if(target && target.current)
- explanation_text = "Prevent [target.current.real_name], the [target.assigned_role] from escaping alive."
- else
- explanation_text = "Free Objective"
- return target
+/datum/objective/maroon/find_target()
+ ..()
+ if(target && target.current)
+ explanation_text = "Prevent [target.current.real_name], the [target.assigned_role] from escaping alive."
+ else
+ explanation_text = "Free Objective"
+ return target
- find_target_by_role(role, role_type=0)
- ..(role, role_type)
- if(target && target.current)
- explanation_text = "Prevent [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role] from escaping alive."
- else
- explanation_text = "Free Objective"
- return target
+/datum/objective/maroon/check_completion()
+ if(target && target.current)
+ if(target.current.stat == DEAD)
+ return 1
+ if(!target.current.ckey)
+ return 1
+ if(issilicon(target.current))
+ return 1
+ if(isbrain(target.current))
+ return 1
+ var/turf/T = get_turf(target.current)
+ if(is_admin_level(T.z))
+ return 0
+ return 0
+ return 1
- check_completion()
- if(target && target.current)
- // TODO: Tie into space manager
- if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current) || !target.current.ckey) //Borgs/brains/AIs count as dead for traitor objectives. --NeoFite
- return 1
- // TODO: Tie into space manager
- var/turf/target_location = get_turf(target.current)
- if(target_location.z in config.admin_levels) //No hiding in lockers and cheezing greentext.
- return 0
- return 1
/datum/objective/debrain //I want braaaainssss
martyr_compatible = 0
- find_target()
- ..()
- if(target && target.current)
- explanation_text = "Steal the brain of [target.current.real_name] the [target.assigned_role]."
- else
- explanation_text = "Free Objective"
- return target
+/datum/objective/debrain/find_target()
+ ..()
+ if(target && target.current)
+ explanation_text = "Steal the brain of [target.current.real_name] the [target.assigned_role]."
+ else
+ explanation_text = "Free Objective"
+ return target
- find_target_by_role(role, role_type=0)
- ..(role, role_type)
- if(target && target.current)
- explanation_text = "Steal the brain of [target.current.real_name] the [!role_type ? target.assigned_role : target.special_role]."
- else
- explanation_text = "Free Objective"
- return target
-
- check_completion()
- if(!target)//If it's a free objective.
- return 1
- if( !owner.current || owner.current.stat==DEAD )//If you're otherwise dead.
- return 0
- if( !target.current || !isbrain(target.current) )
- return 0
- var/atom/A = target.current
- while(A.loc) //check to see if the brainmob is on our person
- A = A.loc
- if(A == owner.current)
- return 1
+/datum/objective/debrain/check_completion()
+ if(!target)//If it's a free objective.
+ return 1
+ if(!owner.current || owner.current.stat == DEAD)
return 0
+ if(!target.current || !isbrain(target.current))
+ return 0
+ var/atom/A = target.current
+ while(A.loc) //check to see if the brainmob is on our person
+ A = A.loc
+ if(A == owner.current)
+ return 1
+ return 0
/datum/objective/protect //The opposite of killing a dude.
martyr_compatible = 1
- find_target()
- ..()
- if(target && target.current)
- explanation_text = "Protect [target.current.real_name], the [target.assigned_role]."
- else
- explanation_text = "Free Objective"
- return target
+/datum/objective/protect/find_target()
+ ..()
+ if(target && target.current)
+ explanation_text = "Protect [target.current.real_name], the [target.assigned_role]."
+ else
+ explanation_text = "Free Objective"
+ return target
- find_target_by_role(role, role_type=0)
- ..(role, role_type)
- if(target && target.current)
- explanation_text = "Protect [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role]."
- else
- explanation_text = "Free Objective"
- return target
-
- find_target_with_special_role(role,role_type=0)
- ..(role)
- if(target && target.current)
- explanation_text = "Protect [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role]."
- else
- explanation_text = "Free Objective"
- return target
-
- check_completion()
- if(!target) //If it's a free objective.
- return 1
- if(target.current)
- if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current))
- return 0
- return 1
- return 0
+/datum/objective/protect/check_completion()
+ if(!target) //If it's a free objective.
+ return 1
+ if(target.current)
+ if(target.current.stat == DEAD)
+ return 0
+ if(issilicon(target.current))
+ return 0
+ if(isbrain(target.current))
+ return 0
+ return 1
+ return 0
/datum/objective/protect/mindslave //subytpe for mindslave implants
+
/datum/objective/hijack
martyr_compatible = 0 //Technically you won't get both anyway.
- explanation_text = "Hijack the shuttle by escaping on it with no loyalist NanoTrasen crew on board and alive. Syndicate agents, other enemies of NanoTrasen, cyborgs, and pets may be allowed to escape alive."
+ explanation_text = "Hijack the shuttle by escaping on it with no loyalist NanoTrasen crew on board and alive. \
+ Syndicate agents, other enemies of NanoTrasen, cyborgs, and pets may be allowed to escape alive."
- check_completion()
- if(!owner.current || owner.current.stat)
- return 0
- if(shuttle_master.emergency.mode < SHUTTLE_ENDGAME)
- return 0
- if(issilicon(owner.current))
- return 0
+/datum/objective/hijack/check_completion()
+ if(!owner.current || owner.current.stat)
+ return 0
+ if(shuttle_master.emergency.mode < SHUTTLE_ENDGAME)
+ return 0
+ if(issilicon(owner.current))
+ return 0
- var/area/A = get_area(owner.current)
- if(shuttle_master.emergency.areaInstance != A)
- return 0
+ var/area/A = get_area(owner.current)
+ if(shuttle_master.emergency.areaInstance != A)
+ return 0
- for(var/mob/living/player in player_list)
- if(player.mind && player.mind != owner)
- if(player.stat != DEAD)
- if(issilicon(player)) //Borgs are technically dead anyways
- continue
- if(isanimal(player)) //Poly does not own the shuttle
- continue
- if(player.mind.special_role && !(player.mind.special_role == "Response Team")) //Is antag, and not ERT
- continue
+ for(var/mob/living/player in player_list)
+ if(player.mind && player.mind != owner)
+ if(player.stat != DEAD)
+ if(issilicon(player)) //Borgs are technically dead anyways
+ continue
+ if(isanimal(player)) //Poly does not own the shuttle
+ continue
+ if(player.mind.special_role && !(player.mind.special_role == SPECIAL_ROLE_ERT)) //Is antag, and not ERT
+ continue
- if(get_area(player) == A)
- return 0
- return 1
+ if(get_area(player) == A)
+ return 0
+ return 1
/datum/objective/hijackclone
explanation_text = "Hijack the emergency shuttle by ensuring only you (or your copies) escape."
martyr_compatible = 0
- check_completion()
- if(!owner.current)
- return 0
- if(shuttle_master.emergency.mode < SHUTTLE_ENDGAME)
- return 0
-
- var/area/A = shuttle_master.emergency.areaInstance
-
- for(var/mob/living/player in player_list) //Make sure nobody else is onboard
- if(player.mind && player.mind != owner)
- if(player.stat != DEAD)
- if(istype(player, /mob/living/silicon))
- continue
- if(get_area(player) == A)
- if(player.real_name != owner.current.real_name && !istype(get_turf(player.mind.current), /turf/simulated/shuttle/floor4))
- return 0
-
- for(var/mob/living/player in player_list) //Make sure at least one of you is onboard
- if(player.mind && player.mind != owner)
- if(player.stat != DEAD)
- if(istype(player, /mob/living/silicon))
- continue
- if(get_area(player) == A)
- if(player.real_name == owner.current.real_name && !istype(get_turf(player.mind.current), /turf/simulated/shuttle/floor4))
- return 1
+/datum/objective/hijackclone/check_completion()
+ if(!owner.current)
return 0
+ if(shuttle_master.emergency.mode < SHUTTLE_ENDGAME)
+ return 0
+
+ var/area/A = shuttle_master.emergency.areaInstance
+
+ for(var/mob/living/player in player_list) //Make sure nobody else is onboard
+ if(player.mind && player.mind != owner)
+ if(player.stat != DEAD)
+ if(issilicon(player))
+ continue
+ if(get_area(player) == A)
+ if(player.real_name != owner.current.real_name && !istype(get_turf(player.mind.current), /turf/simulated/shuttle/floor4))
+ return 0
+
+ for(var/mob/living/player in player_list) //Make sure at least one of you is onboard
+ if(player.mind && player.mind != owner)
+ if(player.stat != DEAD)
+ if(issilicon(player))
+ continue
+ if(get_area(player) == A)
+ if(player.real_name == owner.current.real_name && !istype(get_turf(player.mind.current), /turf/simulated/shuttle/floor4))
+ return 1
+ return 0
/datum/objective/block
explanation_text = "Do not allow any lifeforms, be it organic or synthetic to escape on the shuttle alive. AIs, Cyborgs, and pAIs are not considered alive."
martyr_compatible = 1
- check_completion()
- if(!istype(owner.current, /mob/living/silicon))
- return 0
- if(shuttle_master.emergency.mode < SHUTTLE_ENDGAME)
- return 0
- if(!owner.current)
- return 0
+/datum/objective/block/check_completion()
+ if(!istype(owner.current, /mob/living/silicon))
+ return 0
+ if(shuttle_master.emergency.mode < SHUTTLE_ENDGAME)
+ return 0
+ if(!owner.current)
+ return 0
- var/area/A = shuttle_master.emergency.areaInstance
- var/list/protected_mobs = list(/mob/living/silicon/ai, /mob/living/silicon/pai, /mob/living/silicon/robot)
+ var/area/A = shuttle_master.emergency.areaInstance
+ var/list/protected_mobs = list(/mob/living/silicon/ai, /mob/living/silicon/pai, /mob/living/silicon/robot)
- for(var/mob/living/player in player_list)
- if(player.type in protected_mobs)
- continue
+ for(var/mob/living/player in player_list)
+ if(player.type in protected_mobs)
+ continue
- if(player.mind && player.stat != DEAD)
- if(get_area(player) == A)
- return 0
+ if(player.mind && player.stat != DEAD)
+ if(get_area(player) == A)
+ return 0
- return 1
+ return 1
/datum/objective/escape
explanation_text = "Escape on the shuttle or an escape pod alive and free."
- check_completion()
- if(issilicon(owner.current))
- return 0
- if(isbrain(owner.current))
- return 0
- if(!owner.current || owner.current.stat == DEAD)
- return 0
- if(shuttle_master.emergency.mode < SHUTTLE_ENDGAME)
- return 0
- var/turf/location = get_turf(owner.current)
- if(!location)
- return 0
-
- if(istype(location, /turf/simulated/shuttle/floor4)) // Fails traitors if they are in the shuttle brig -- Polymorph
- return 0
-
- if(location.onCentcom() || location.onSyndieBase())
- return 1
-
+/datum/objective/escape/check_completion()
+ if(issilicon(owner.current))
return 0
+ if(isbrain(owner.current))
+ return 0
+ if(!owner.current || owner.current.stat == DEAD)
+ return 0
+ if(shuttle_master.emergency.mode < SHUTTLE_ENDGAME)
+ return 0
+ var/turf/location = get_turf(owner.current)
+ if(!location)
+ return 0
+
+ if(istype(location, /turf/simulated/shuttle/floor4)) // Fails traitors if they are in the shuttle brig -- Polymorph
+ return 0
+
+ if(location.onCentcom() || location.onSyndieBase())
+ return 1
+
+ return 0
/datum/objective/escape/escape_with_identity
var/target_real_name // Has to be stored because the target's real_name can change over the course of the round
- find_target()
- var/list/possible_targets = list() //Copypasta because NO_SCAN races, yay for snowflakes.
- for(var/datum/mind/possible_target in ticker.minds)
- if(possible_target != owner && ishuman(possible_target.current) && (possible_target.current.stat != DEAD) && possible_target.current.client)
- var/mob/living/carbon/human/H = possible_target.current
- if(!(H.species.flags & NO_SCAN))
- possible_targets += possible_target
- if(possible_targets.len > 0)
- target = pick(possible_targets)
- if(target && target.current)
- target_real_name = target.current.real_name
- explanation_text = "Escape on the shuttle or an escape pod with the identity of [target_real_name], the [target.assigned_role] while wearing their identification card."
- else
- explanation_text = "Free Objective"
+/datum/objective/escape/escape_with_identity/find_target()
+ var/list/possible_targets = list() //Copypasta because NO_SCAN races, yay for snowflakes.
+ for(var/datum/mind/possible_target in ticker.minds)
+ if(possible_target != owner && ishuman(possible_target.current) && (possible_target.current.stat != DEAD) && possible_target.current.client)
+ var/mob/living/carbon/human/H = possible_target.current
+ if(!(H.species.flags & NO_SCAN))
+ possible_targets += possible_target
+ if(possible_targets.len > 0)
+ target = pick(possible_targets)
+ if(target && target.current)
+ target_real_name = target.current.real_name
+ explanation_text = "Escape on the shuttle or an escape pod with the identity of [target_real_name], the [target.assigned_role] while wearing their identification card."
+ else
+ explanation_text = "Free Objective"
- check_completion()
- if(!target_real_name)
- return 1
- if(!ishuman(owner.current))
- return 0
- var/mob/living/carbon/human/H = owner.current
- if(..())
- if(H.dna.real_name == target_real_name)
- if(H.get_id_name()== target_real_name)
- return 1
+/datum/objective/escape/escape_with_identity/check_completion()
+ if(!target_real_name)
+ return 1
+ if(!ishuman(owner.current))
return 0
+ var/mob/living/carbon/human/H = owner.current
+ if(..())
+ if(H.dna.real_name == target_real_name)
+ if(H.get_id_name()== target_real_name)
+ return 1
+ return 0
/datum/objective/die
explanation_text = "Die a glorious death."
- check_completion()
- if(!owner.current || owner.current.stat == DEAD || isbrain(owner.current))
- return 1 //Brains no longer win survive objectives. --NEO
- if(issilicon(owner.current) && owner.current != owner.original)
- return 1
- return 0
+/datum/objective/die/check_completion()
+ if(!owner.current || owner.current.stat == DEAD || isbrain(owner.current))
+ return 1
+ if(issilicon(owner.current) && owner.current != owner.original)
+ return 1
+ return 0
/datum/objective/survive
explanation_text = "Stay alive until the end."
- check_completion()
- if(!owner.current || owner.current.stat == DEAD || isbrain(owner.current))
- return 0 //Brains no longer win survive objectives. --NEO
- if(issilicon(owner.current) && owner.current != owner.original)
- return 0
- return 1
+/datum/objective/survive/check_completion()
+ if(!owner.current || owner.current.stat == DEAD || isbrain(owner.current))
+ return 0 //Brains no longer win survive objectives. --NEO
+ if(issilicon(owner.current) && owner.current != owner.original)
+ return 0
+ return 1
/datum/objective/nuclear
explanation_text = "Destroy the station with a nuclear device."
@@ -428,385 +379,383 @@ var/list/potential_theft_objectives=subtypesof(/datum/theft_objective) \
var/datum/theft_objective/steal_target
martyr_compatible = 0
- find_target(var/special_only=0)
- var/loop=50
- while(!steal_target && loop > 0)
- loop--
- var/thefttype = pick(potential_theft_objectives)
- var/datum/theft_objective/O = new thefttype
- if(owner.assigned_role in O.protected_jobs)
+/datum/objective/steal/find_target(var/special_only=0)
+ var/loop=50
+ while(!steal_target && loop > 0)
+ loop--
+ var/thefttype = pick(potential_theft_objectives)
+ var/datum/theft_objective/O = new thefttype
+ if(owner.assigned_role in O.protected_jobs)
+ continue
+ if(special_only)
+ if(!(O.flags & 1)) // THEFT_FLAG_SPECIAL
continue
- if(special_only)
- if(!(O.flags & 1)) // THEFT_FLAG_SPECIAL
- continue
- else
- if(O.flags & 1) // THEFT_FLAG_SPECIAL
- continue
- if(O.flags & 2)
- continue
- steal_target=O
- explanation_text = "Steal [O]."
- return
- explanation_text = "Free Objective."
-
-
- proc/select_target()
- var/list/possible_items_all = potential_theft_objectives+"custom"
- var/new_target = input("Select target:", "Objective target", null) as null|anything in possible_items_all
- if(!new_target) return
- if(new_target == "custom")
- var/datum/theft_objective/O=new
- O.typepath = input("Select type:","Type") as null|anything in typesof(/obj/item)
- if(!O.typepath) return
- var/tmp_obj = new O.typepath
- var/custom_name = tmp_obj:name
- qdel(tmp_obj)
- O.name = sanitize(copytext(input("Enter target name:", "Objective target", custom_name) as text|null,1,MAX_NAME_LEN))
- if(!O.name) return
- steal_target = O
- explanation_text = "Steal [O.name]."
else
- steal_target = new new_target
- explanation_text = "Steal [steal_target.name]."
- return steal_target
+ if(O.flags & 1) // THEFT_FLAG_SPECIAL
+ continue
+ if(O.flags & 2)
+ continue
+ steal_target=O
+ explanation_text = "Steal [O]."
+ return
+ explanation_text = "Free Objective."
- check_completion()
- if(!steal_target) return 1 // Free Objective
- return steal_target.check_completion(owner)
+
+/datum/objective/steal/proc/select_target()
+ var/list/possible_items_all = potential_theft_objectives+"custom"
+ var/new_target = input("Select target:", "Objective target", null) as null|anything in possible_items_all
+ if(!new_target) return
+ if(new_target == "custom")
+ var/datum/theft_objective/O=new
+ O.typepath = input("Select type:","Type") as null|anything in typesof(/obj/item)
+ if(!O.typepath) return
+ var/tmp_obj = new O.typepath
+ var/custom_name = tmp_obj:name
+ qdel(tmp_obj)
+ O.name = sanitize(copytext(input("Enter target name:", "Objective target", custom_name) as text|null,1,MAX_NAME_LEN))
+ if(!O.name) return
+ steal_target = O
+ explanation_text = "Steal [O.name]."
+ else
+ steal_target = new new_target
+ explanation_text = "Steal [steal_target.name]."
+ return steal_target
+
+/datum/objective/steal/check_completion()
+ if(!steal_target) return 1 // Free Objective
+ return steal_target.check_completion(owner)
/datum/objective/steal/exchange
martyr_compatible = 0
- proc/set_faction(var/faction,var/otheragent)
- target = otheragent
- var/datum/theft_objective/unique/targetinfo
- if(faction == "red")
- targetinfo = new /datum/theft_objective/unique/docs_blue
- else if(faction == "blue")
- targetinfo = new /datum/theft_objective/unique/docs_red
- explanation_text = "Acquire [targetinfo.name] held by [target.current.real_name], the [target.assigned_role] and syndicate agent"
- steal_target = targetinfo
+/datum/objective/steal/exchange/proc/set_faction(var/faction,var/otheragent)
+ target = otheragent
+ var/datum/theft_objective/unique/targetinfo
+ if(faction == "red")
+ targetinfo = new /datum/theft_objective/unique/docs_blue
+ else if(faction == "blue")
+ targetinfo = new /datum/theft_objective/unique/docs_red
+ explanation_text = "Acquire [targetinfo.name] held by [target.current.real_name], the [target.assigned_role] and syndicate agent"
+ steal_target = targetinfo
/datum/objective/steal/exchange/backstab
-
- set_faction(var/faction)
- var/datum/theft_objective/unique/targetinfo
- if(faction == "red")
- targetinfo = new /datum/theft_objective/unique/docs_red
- else if(faction == "blue")
- targetinfo = new /datum/theft_objective/unique/docs_blue
- explanation_text = "Do not give up or lose [targetinfo.name]."
- steal_target = targetinfo
+/datum/objective/steal/exchange/backstab/set_faction(var/faction)
+ var/datum/theft_objective/unique/targetinfo
+ if(faction == "red")
+ targetinfo = new /datum/theft_objective/unique/docs_red
+ else if(faction == "blue")
+ targetinfo = new /datum/theft_objective/unique/docs_blue
+ explanation_text = "Do not give up or lose [targetinfo.name]."
+ steal_target = targetinfo
/datum/objective/download
- proc/gen_amount_goal()
- target_amount = rand(10,20)
- explanation_text = "Download [target_amount] research levels."
- return target_amount
+/datum/objective/download/proc/gen_amount_goal()
+ target_amount = rand(10,20)
+ explanation_text = "Download [target_amount] research levels."
+ return target_amount
- check_completion()
- return 0
+/datum/objective/download/check_completion()
+ return 0
/datum/objective/capture
- proc/gen_amount_goal()
- target_amount = rand(5,10)
- explanation_text = "Accumulate [target_amount] capture points."
- return target_amount
+/datum/objective/capture/proc/gen_amount_goal()
+ target_amount = rand(5,10)
+ explanation_text = "Accumulate [target_amount] capture points."
+ return target_amount
- check_completion()//Basically runs through all the mobs in the area to determine how much they are worth.
- return 0
+/datum/objective/capture/check_completion()//Basically runs through all the mobs in the area to determine how much they are worth.
+ return 0
/datum/objective/absorb
- proc/gen_amount_goal(var/lowbound = 4, var/highbound = 6)
- target_amount = rand (lowbound,highbound)
- if(ticker)
- var/n_p = 1 //autowin
- if(ticker.current_state == GAME_STATE_SETTING_UP)
- for(var/mob/new_player/P in player_list)
- if(P.client && P.ready && P.mind != owner)
- if(P.client.prefs && (P.client.prefs.species == "Vox" || P.client.prefs.species == "Slime People" || P.client.prefs.species == "Machine")) // Special check for species that can't be absorbed. No better solution.
- continue
- n_p++
- else if(ticker.current_state == GAME_STATE_PLAYING)
- for(var/mob/living/carbon/human/P in player_list)
- if(P.species.flags & NO_SCAN)
+/datum/objective/absorb/proc/gen_amount_goal(var/lowbound = 4, var/highbound = 6)
+ target_amount = rand (lowbound,highbound)
+ if(ticker)
+ var/n_p = 1 //autowin
+ if(ticker.current_state == GAME_STATE_SETTING_UP)
+ for(var/mob/new_player/P in player_list)
+ if(P.client && P.ready && P.mind != owner)
+ if(P.client.prefs && (P.client.prefs.species == "Vox" || P.client.prefs.species == "Slime People" || P.client.prefs.species == "Machine")) // Special check for species that can't be absorbed. No better solution.
continue
- if(P.client && !(P.mind in ticker.mode.changelings) && P.mind!=owner)
- n_p++
- target_amount = min(target_amount, n_p)
+ n_p++
+ else if(ticker.current_state == GAME_STATE_PLAYING)
+ for(var/mob/living/carbon/human/P in player_list)
+ if(P.species.flags & NO_SCAN)
+ continue
+ if(P.client && !(P.mind in ticker.mode.changelings) && P.mind!=owner)
+ n_p++
+ target_amount = min(target_amount, n_p)
- explanation_text = "Absorb [target_amount] compatible genomes."
- return target_amount
+ explanation_text = "Absorb [target_amount] compatible genomes."
+ return target_amount
- check_completion()
- if(owner && owner.changeling && owner.changeling.absorbed_dna && (owner.changeling.absorbedcount >= target_amount))
- return 1
- else
- return 0
+/datum/objective/absorb/check_completion()
+ if(owner && owner.changeling && owner.changeling.absorbed_dna && (owner.changeling.absorbedcount >= target_amount))
+ return 1
+ else
+ return 0
/datum/objective/destroy
martyr_compatible = 1
var/target_real_name
- find_target()
- var/list/possible_targets = active_ais(1)
- var/mob/living/silicon/ai/target_ai = pick(possible_targets)
- target = target_ai.mind
- if(target && target.current)
- target_real_name = target.current.real_name
- explanation_text = "Destroy [target_real_name], the AI."
- else
- explanation_text = "Free Objective"
- return target
+/datum/objective/destroy/find_target()
+ var/list/possible_targets = active_ais(1)
+ var/mob/living/silicon/ai/target_ai = pick(possible_targets)
+ target = target_ai.mind
+ if(target && target.current)
+ target_real_name = target.current.real_name
+ explanation_text = "Destroy [target_real_name], the AI."
+ else
+ explanation_text = "Free Objective"
+ return target
- check_completion()
- if(target && target.current)
- // TODO: Tie into space manager
- if(target.current.stat == DEAD || target.current.z > ZLEVEL_DERELICT || !target.current.ckey)
- return 1
- return 0
- return 1
+/datum/objective/destroy/check_completion()
+ if(target && target.current)
+ if(target.current.stat == DEAD || is_away_level(target.current.z) || !target.current.ckey)
+ return 1
+ return 0
+ return 1
/datum/objective/blood
- proc/gen_amount_goal(low = 150, high = 400)
- target_amount = rand(low,high)
- target_amount = round(round(target_amount/5)*5)
- explanation_text = "Accumulate atleast [target_amount] units of blood in total."
- return target_amount
+/datum/objective/blood/proc/gen_amount_goal(low = 150, high = 400)
+ target_amount = rand(low,high)
+ target_amount = round(round(target_amount/5)*5)
+ explanation_text = "Accumulate atleast [target_amount] units of blood in total."
+ return target_amount
- check_completion()
- if(owner && owner.vampire && owner.vampire.bloodtotal && owner.vampire.bloodtotal >= target_amount)
- return 1
- else
- return 0
+/datum/objective/blood/check_completion()
+ if(owner && owner.vampire && owner.vampire.bloodtotal && owner.vampire.bloodtotal >= target_amount)
+ return 1
+ else
+ return 0
// /vg/; Vox Inviolate for humans :V
/datum/objective/minimize_casualties
explanation_text = "Minimise casualties."
- check_completion()
- if(owner.kills.len>5) return 0
- return 1
+/datum/objective/minimize_casualties/check_completion()
+ if(owner.kills.len>5) return 0
+ return 1
//Vox heist objectives.
/datum/objective/heist
- proc/choose_target()
- return
+/datum/objective/heist/proc/choose_target()
+ return
/datum/objective/heist/kidnap
- choose_target()
- var/list/roles = list("Chief Engineer","Research Director","Roboticist","Chemist","Station Engineer")
- var/list/possible_targets = list()
- var/list/priority_targets = list()
+/datum/objective/heist/kidnap/choose_target()
+ var/list/roles = list("Chief Engineer","Research Director","Roboticist","Chemist","Station Engineer")
+ var/list/possible_targets = list()
+ var/list/priority_targets = list()
- for(var/datum/mind/possible_target in ticker.minds)
- if(possible_target != owner && ishuman(possible_target.current) && (possible_target.current.stat != DEAD) && (possible_target.assigned_role != "MODE"))
- possible_targets += possible_target
- for(var/role in roles)
- if(possible_target.assigned_role == role)
- priority_targets += possible_target
- continue
+ for(var/datum/mind/possible_target in ticker.minds)
+ if(possible_target != owner && ishuman(possible_target.current) && (possible_target.current.stat != DEAD) && (possible_target.assigned_role != "MODE"))
+ possible_targets += possible_target
+ for(var/role in roles)
+ if(possible_target.assigned_role == role)
+ priority_targets += possible_target
+ continue
- if(priority_targets.len > 0)
- target = pick(priority_targets)
- else if(possible_targets.len > 0)
- target = pick(possible_targets)
+ if(priority_targets.len > 0)
+ target = pick(priority_targets)
+ else if(possible_targets.len > 0)
+ target = pick(possible_targets)
- if(target && target.current)
- explanation_text = "The Shoal has a need for [target.current.real_name], the [target.assigned_role]. Take them alive."
- else
- explanation_text = "Free Objective"
- return target
+ if(target && target.current)
+ explanation_text = "The Shoal has a need for [target.current.real_name], the [target.assigned_role]. Take them alive."
+ else
+ explanation_text = "Free Objective"
+ return target
- check_completion()
- if(target && target.current)
- if(target.current.stat == DEAD)
- return 0
-
- var/area/shuttle/vox/A = locate() //stupid fucking hardcoding
- var/area/vox_station/B = locate() //but necessary
-
- for(var/mob/living/carbon/human/M in A)
- if(target.current == M)
- return 1
- for(var/mob/living/carbon/human/M in B)
- if(target.current == M)
- return 1
- else
+/datum/objective/heist/kidnap/check_completion()
+ if(target && target.current)
+ if(target.current.stat == DEAD)
return 0
-/datum/objective/heist/loot
- choose_target()
- var/loot = "an object"
- switch(rand(1,8))
- if(1)
- target = /obj/structure/particle_accelerator
- target_amount = 6
- loot = "a complete particle accelerator"
- if(2)
- target = /obj/machinery/the_singularitygen
- target_amount = 1
- loot = "a gravitational singularity generator"
- if(3)
- target = /obj/machinery/power/emitter
- target_amount = 4
- loot = "four emitters"
- if(4)
- target = /obj/machinery/nuclearbomb
- target_amount = 1
- loot = "a nuclear bomb"
- if(5)
- target = /obj/item/weapon/gun
- target_amount = 6
- loot = "six guns. Tasers and other non-lethal guns are acceptable"
- if(6)
- target = /obj/item/weapon/gun/energy
- target_amount = 4
- loot = "four energy guns"
- if(7)
- target = /obj/item/weapon/gun/energy/laser
- target_amount = 2
- loot = "two laser guns"
- if(8)
- target = /obj/item/weapon/gun/energy/ionrifle
- target_amount = 1
- loot = "an ion gun"
-
- explanation_text = "We are lacking in hardware. Steal or trade [loot]."
-
- check_completion()
- var/total_amount = 0
-
- for(var/obj/O in locate(/area/shuttle/vox))
- if(istype(O, target))
- total_amount++
- for(var/obj/I in O.contents)
- if(istype(I, target))
- total_amount++
- if(total_amount >= target_amount)
- return 1
-
- for(var/obj/O in locate(/area/vox_station))
- if(istype(O, target))
- total_amount++
- for(var/obj/I in O.contents)
- if(istype(I, target))
- total_amount++
- if(total_amount >= target_amount)
- return 1
-
- var/datum/game_mode/heist/H = ticker.mode
- for(var/datum/mind/raider in H.raiders)
- if(raider.current)
- for(var/obj/O in raider.current.get_contents())
- if(istype(O,target))
- total_amount++
- if(total_amount >= target_amount)
- return 1
+ var/area/shuttle/vox/A = locate() //stupid fucking hardcoding
+ var/area/vox_station/B = locate() //but necessary
+ for(var/mob/living/carbon/human/M in A)
+ if(target.current == M)
+ return 1
+ for(var/mob/living/carbon/human/M in B)
+ if(target.current == M)
+ return 1
+ else
return 0
+/datum/objective/heist/loot
+/datum/objective/heist/loot/choose_target()
+ var/loot = "an object"
+ switch(rand(1,8))
+ if(1)
+ target = /obj/structure/particle_accelerator
+ target_amount = 6
+ loot = "a complete particle accelerator"
+ if(2)
+ target = /obj/machinery/the_singularitygen
+ target_amount = 1
+ loot = "a gravitational singularity generator"
+ if(3)
+ target = /obj/machinery/power/emitter
+ target_amount = 4
+ loot = "four emitters"
+ if(4)
+ target = /obj/machinery/nuclearbomb
+ target_amount = 1
+ loot = "a nuclear bomb"
+ if(5)
+ target = /obj/item/weapon/gun
+ target_amount = 6
+ loot = "six guns. Tasers and other non-lethal guns are acceptable"
+ if(6)
+ target = /obj/item/weapon/gun/energy
+ target_amount = 4
+ loot = "four energy guns"
+ if(7)
+ target = /obj/item/weapon/gun/energy/laser
+ target_amount = 2
+ loot = "two laser guns"
+ if(8)
+ target = /obj/item/weapon/gun/energy/ionrifle
+ target_amount = 1
+ loot = "an ion gun"
+
+ explanation_text = "We are lacking in hardware. Steal or trade [loot]."
+
+/datum/objective/heist/loot/check_completion()
+ var/total_amount = 0
+
+ for(var/obj/O in locate(/area/shuttle/vox))
+ if(istype(O, target))
+ total_amount++
+ for(var/obj/I in O.contents)
+ if(istype(I, target))
+ total_amount++
+ if(total_amount >= target_amount)
+ return 1
+
+ for(var/obj/O in locate(/area/vox_station))
+ if(istype(O, target))
+ total_amount++
+ for(var/obj/I in O.contents)
+ if(istype(I, target))
+ total_amount++
+ if(total_amount >= target_amount)
+ return 1
+
+ var/datum/game_mode/heist/H = ticker.mode
+ for(var/datum/mind/raider in H.raiders)
+ if(raider.current)
+ for(var/obj/O in raider.current.get_contents())
+ if(istype(O,target))
+ total_amount++
+ if(total_amount >= target_amount)
+ return 1
+
+ return 0
+
/datum/objective/heist/salvage
- choose_target()
- switch(rand(1,8))
- if(1)
- target = "metal"
- target_amount = 300
- if(2)
- target = "glass"
- target_amount = 200
- if(3)
- target = "plasteel"
- target_amount = 100
- if(4)
- target = "solid plasma"
- target_amount = 100
- if(5)
- target = "silver"
- target_amount = 50
- if(6)
- target = "gold"
- target_amount = 20
- if(7)
- target = "uranium"
- target_amount = 20
- if(8)
- target = "diamond"
- target_amount = 20
+/datum/objective/heist/salvage/choose_target()
+ switch(rand(1,8))
+ if(1)
+ target = "metal"
+ target_amount = 300
+ if(2)
+ target = "glass"
+ target_amount = 200
+ if(3)
+ target = "plasteel"
+ target_amount = 100
+ if(4)
+ target = "solid plasma"
+ target_amount = 100
+ if(5)
+ target = "silver"
+ target_amount = 50
+ if(6)
+ target = "gold"
+ target_amount = 20
+ if(7)
+ target = "uranium"
+ target_amount = 20
+ if(8)
+ target = "diamond"
+ target_amount = 20
- explanation_text = "Ransack or trade with the station and escape with [target_amount] [target]."
+ explanation_text = "Ransack or trade with the station and escape with [target_amount] [target]."
- check_completion()
- var/total_amount = 0
+/datum/objective/heist/salvage/check_completion()
+ var/total_amount = 0
- for(var/obj/item/O in locate(/area/shuttle/vox))
- var/obj/item/stack/sheet/S
- if(istype(O,/obj/item/stack/sheet))
- if(O.name == target)
- S = O
+ for(var/obj/item/O in locate(/area/shuttle/vox))
+ var/obj/item/stack/sheet/S
+ if(istype(O,/obj/item/stack/sheet))
+ if(O.name == target)
+ S = O
+ total_amount += S.get_amount()
+
+ for(var/obj/I in O.contents)
+ if(istype(I,/obj/item/stack/sheet))
+ if(I.name == target)
+ S = I
total_amount += S.get_amount()
- for(var/obj/I in O.contents)
- if(istype(I,/obj/item/stack/sheet))
- if(I.name == target)
- S = I
- total_amount += S.get_amount()
+ for(var/obj/item/O in locate(/area/vox_station))
+ var/obj/item/stack/sheet/S
+ if(istype(O,/obj/item/stack/sheet))
+ if(O.name == target)
+ S = O
+ total_amount += S.get_amount()
- for(var/obj/item/O in locate(/area/vox_station))
- var/obj/item/stack/sheet/S
- if(istype(O,/obj/item/stack/sheet))
- if(O.name == target)
- S = O
+ for(var/obj/I in O.contents)
+ if(istype(I,/obj/item/stack/sheet))
+ if(I.name == target)
+ S = I
total_amount += S.get_amount()
- for(var/obj/I in O.contents)
- if(istype(I,/obj/item/stack/sheet))
- if(I.name == target)
- S = I
+ var/datum/game_mode/heist/H = ticker.mode
+ for(var/datum/mind/raider in H.raiders)
+ if(raider.current)
+ for(var/obj/item/O in raider.current.get_contents())
+ if(istype(O,/obj/item/stack/sheet))
+ if(O.name == target)
+ var/obj/item/stack/sheet/S = O
total_amount += S.get_amount()
- var/datum/game_mode/heist/H = ticker.mode
- for(var/datum/mind/raider in H.raiders)
- if(raider.current)
- for(var/obj/item/O in raider.current.get_contents())
- if(istype(O,/obj/item/stack/sheet))
- if(O.name == target)
- var/obj/item/stack/sheet/S = O
- total_amount += S.get_amount()
-
- if(total_amount >= target_amount) return 1
- return 0
+ if(total_amount >= target_amount) return 1
+ return 0
/datum/objective/heist/inviolate_crew
explanation_text = "Do not leave any Vox behind, alive or dead."
- check_completion()
- var/datum/game_mode/heist/H = ticker.mode
- if(H.is_raider_crew_safe())
- return 1
- return 0
+/datum/objective/heist/inviolate_crew/check_completion()
+ var/datum/game_mode/heist/H = ticker.mode
+ if(H.is_raider_crew_safe())
+ return 1
+ return 0
/datum/objective/heist/inviolate_death
explanation_text = "Follow the Inviolate. Minimise death and loss of resources."
- check_completion()
- var/vox_allowed_kills = 3 // The number of people the vox can accidently kill. Mostly a counter to people killing themselves if a raider touches them to force fail.
- var/vox_total_kills = 0
+/datum/objective/heist/inviolate_death/check_completion()
+ var/vox_allowed_kills = 3 // The number of people the vox can accidently kill. Mostly a counter to people killing themselves if a raider touches them to force fail.
+ var/vox_total_kills = 0
- var/datum/game_mode/heist/H = ticker.mode
- for(var/datum/mind/raider in H.raiders)
- vox_total_kills += raider.kills.len // Kills are listed in the mind; uses this to calculate vox kills
+ var/datum/game_mode/heist/H = ticker.mode
+ for(var/datum/mind/raider in H.raiders)
+ vox_total_kills += raider.kills.len // Kills are listed in the mind; uses this to calculate vox kills
- if(vox_total_kills > vox_allowed_kills) return 0
- return 1
+ if(vox_total_kills > vox_allowed_kills) return 0
+ return 1
// Traders
diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm
index 9e74459dadd..83846818091 100644
--- a/code/game/gamemodes/revolution/revolution.dm
+++ b/code/game/gamemodes/revolution/revolution.dm
@@ -111,7 +111,7 @@
to_chat(rev_mind.current, "You are a member of the revolutionaries' leadership!")
for(var/datum/objective/objective in rev_mind.objectives)
to_chat(rev_mind.current, "Objective #[obj_count]: [objective.explanation_text]")
- rev_mind.special_role = "Head Revolutionary"
+ rev_mind.special_role = SPECIAL_ROLE_HEAD_REV
obj_count++
/////////////////////////////////////////////////////////////////////////////////
@@ -246,7 +246,7 @@
rev_mind.current.Stun(5)
to_chat(rev_mind.current, " You are now a revolutionary! Help your cause. Do not harm your fellow freedom fighters. You can identify your comrades by the red \"R\" icons, and your leaders by the blue \"R\" icons. Help them kill the heads to win the revolution!")
rev_mind.current.attack_log += "\[[time_stamp()]\] Has been converted to the revolution!"
- rev_mind.special_role = "Revolutionary"
+ rev_mind.special_role = SPECIAL_ROLE_REV
update_rev_icons_added(rev_mind)
if(jobban_isbanned(rev_mind.current, ROLE_REV))
replace_jobbaned_player(rev_mind.current, ROLE_REV)
@@ -314,8 +314,7 @@
/datum/game_mode/revolution/proc/check_heads_victory()
for(var/datum/mind/rev_mind in head_revolutionaries)
var/turf/T = get_turf(rev_mind.current)
- // TODO: Tie into space manager
- if((rev_mind) && (rev_mind.current) && (rev_mind.current.stat != 2) && rev_mind.current.client && T && (T.z == ZLEVEL_STATION))
+ if((rev_mind) && (rev_mind.current) && (rev_mind.current.stat != DEAD) && rev_mind.current.client && T && is_station_level(T.z))
if(ishuman(rev_mind.current))
return 0
return 1
@@ -335,7 +334,7 @@
/datum/game_mode/proc/auto_declare_completion_revolution()
var/list/targets = list()
- if(head_revolutionaries.len || istype(ticker.mode,/datum/game_mode/revolution))
+ if(head_revolutionaries.len || GAMEMODE_IS_REVOLUTION)
var/num_revs = 0
var/num_survivors = 0
for(var/mob/living/carbon/survivor in living_mob_list)
@@ -352,14 +351,14 @@
text += "
"
to_chat(world, text)
- if(revolutionaries.len || istype(ticker.mode,/datum/game_mode/revolution))
+ if(revolutionaries.len || GAMEMODE_IS_REVOLUTION)
var/text = "
The revolutionaries were:"
for(var/datum/mind/rev in revolutionaries)
text += printplayer(rev, 1)
text += "
"
to_chat(world, text)
- if( head_revolutionaries.len || revolutionaries.len || istype(ticker.mode,/datum/game_mode/revolution) )
+ if( head_revolutionaries.len || revolutionaries.len || GAMEMODE_IS_REVOLUTION )
var/text = "
The heads of staff were:"
var/list/heads = get_all_heads()
for(var/datum/mind/head in heads)
diff --git a/code/game/gamemodes/scoreboard.dm b/code/game/gamemodes/scoreboard.dm
index a8091d04727..c4957b3b937 100644
--- a/code/game/gamemodes/scoreboard.dm
+++ b/code/game/gamemodes/scoreboard.dm
@@ -21,14 +21,12 @@
// Who is alive/dead, who escaped
for(var/mob/living/silicon/ai/I in mob_list)
- // TODO: Tie into space manager
- if(I.stat == DEAD && (I.z in config.station_levels))
+ if(I.stat == DEAD && is_station_level(I.z))
score_deadaipenalty++
score_deadcrew++
for(var/mob/living/carbon/human/I in mob_list)
- // TODO: Tie into space manager
- if(I.stat == DEAD && (I.z in config.station_levels))
+ if(I.stat == DEAD && is_station_level(I.z))
score_deadcrew++
if(I && I.mind)
@@ -81,9 +79,7 @@
// Check station's power levels
for(var/obj/machinery/power/apc/A in apcs)
- // TODO: Tie into space manager
- if(!(A.z in config.station_levels)) continue
-
+ if(!is_station_level(A.z)) continue
for(var/obj/item/weapon/stock_parts/cell/C in A.contents)
if(C.charge < 2300)
score_powerloss++ //200 charge leeway
@@ -91,8 +87,7 @@
// Check how much uncleaned mess is on the station
for(var/obj/effect/decal/cleanable/M in world)
- // TODO: Tie into space manager
- if(!(M.z in config.station_levels)) continue
+ if(!is_station_level(M.z)) continue
if(istype(M, /obj/effect/decal/cleanable/blood/gibs))
score_mess += 3
diff --git a/code/game/gamemodes/shadowling/shadowling.dm b/code/game/gamemodes/shadowling/shadowling.dm
index 2cc099cc115..c9f29cefc2f 100644
--- a/code/game/gamemodes/shadowling/shadowling.dm
+++ b/code/game/gamemodes/shadowling/shadowling.dm
@@ -94,7 +94,7 @@ Made by Xhuis
shadows += shadow
possible_shadowlings -= shadow
modePlayer += shadow
- shadow.special_role = "Shadowling"
+ shadow.special_role = SPECIAL_ROLE_SHADOWLING
shadow.restricted_roles = restricted_jobs
shadowlings--
return 1
@@ -145,7 +145,7 @@ Made by Xhuis
return 0
if(!(new_thrall_mind in shadowling_thralls))
shadowling_thralls += new_thrall_mind
- new_thrall_mind.special_role = "shadowling thrall"
+ new_thrall_mind.special_role = SPECIAL_ROLE_SHADOWLING_THRALL
update_shadow_icons_added(new_thrall_mind)
new_thrall_mind.current.attack_log += "\[[time_stamp()]\] Became a thrall"
new_thrall_mind.current.add_language("Shadowling Hivemind")
diff --git a/code/game/gamemodes/shadowling/shadowling_abilities.dm b/code/game/gamemodes/shadowling/shadowling_abilities.dm
index c4e88ea12b8..70471a91aff 100644
--- a/code/game/gamemodes/shadowling/shadowling_abilities.dm
+++ b/code/game/gamemodes/shadowling/shadowling_abilities.dm
@@ -368,7 +368,7 @@
"False faces all dark not real not real not--")
target.setOxyLoss(0) //In case the shadowling was choking them out
ticker.mode.add_thrall(target.mind)
- target.mind.special_role = "shadowling thrall"
+ target.mind.special_role = SPECIAL_ROLE_SHADOWLING_THRALL
/obj/effect/proc_holder/spell/targeted/shadowling_regenarmor //Resets a shadowling's species to normal, removes genetic defects, and re-equips their armor
name = "Rapid Re-Hatch"
@@ -828,7 +828,7 @@
to_chat(usr, "You instantly rearrange [target]'s memories, hyptonitizing them into a thrall.")
to_chat(target, "An agonizing spike of pain drives into your mind, and--")
ticker.mode.add_thrall(target.mind)
- target.mind.special_role = "shadowling thrall"
+ target.mind.special_role = SPECIAL_ROLE_SHADOWLING_THRALL
target.add_language("Shadowling Hivemind")
diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm
index 80ce1ef0a84..7f2ee93362a 100644
--- a/code/game/gamemodes/traitor/traitor.dm
+++ b/code/game/gamemodes/traitor/traitor.dm
@@ -48,7 +48,7 @@
break
var/datum/mind/traitor = pick(possible_traitors)
traitors += traitor
- traitor.special_role = "traitor"
+ traitor.special_role = SPECIAL_ROLE_TRAITOR
var/datum/mindslaves/slaved = new()
slaved.masters += traitor
traitor.som = slaved //we MIGT want to mindslave someone
diff --git a/code/game/gamemodes/vampire/traitor_vamp.dm b/code/game/gamemodes/vampire/traitor_vamp.dm
index 8bd37ce1867..068ad772b66 100644
--- a/code/game/gamemodes/vampire/traitor_vamp.dm
+++ b/code/game/gamemodes/vampire/traitor_vamp.dm
@@ -39,7 +39,7 @@
/datum/game_mode/traitor/vampire/post_setup()
for(var/datum/mind/vampire in vampires)
grant_vampire_powers(vampire.current)
- vampire.special_role = "Vampire"
+ vampire.special_role = SPECIAL_ROLE_VAMPIRE
forge_vampire_objectives(vampire)
greet_vampire(vampire)
..()
\ No newline at end of file
diff --git a/code/game/gamemodes/vampire/vampire.dm b/code/game/gamemodes/vampire/vampire.dm
index a0286f7c95b..5a78826ab0c 100644
--- a/code/game/gamemodes/vampire/vampire.dm
+++ b/code/game/gamemodes/vampire/vampire.dm
@@ -58,7 +58,7 @@
var/datum/mindslaves/slaved = new()
slaved.masters += vampire
vampire.som = slaved //we MIGT want to mindslave someone
- vampire.special_role = "Vampire" // Needs to be done in pre-setup to prevent role bugs
+ vampire.special_role = SPECIAL_ROLE_VAMPIRE
return 1
else
return 0
diff --git a/code/game/gamemodes/vampire/vampire_powers.dm b/code/game/gamemodes/vampire/vampire_powers.dm
index f33bda2ed3a..b487b6518c0 100644
--- a/code/game/gamemodes/vampire/vampire_powers.dm
+++ b/code/game/gamemodes/vampire/vampire_powers.dm
@@ -337,7 +337,7 @@
ticker.mode.vampire_enthralled.Add(H.mind)
ticker.mode.vampire_enthralled[H.mind] = user.mind
- H.mind.special_role = "VampThrall"
+ H.mind.special_role = SPECIAL_ROLE_VAMPIRE_THRALL
to_chat(H, "You have been Enthralled by [user]. Follow their every command.")
to_chat(user, "You have successfully Enthralled [H]. If they refuse to do as you say just adminhelp.")
log_admin("[ckey(user.key)] has mind-slaved [ckey(H.key)].")
diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm
index 8b9cb6eb0e9..1865b6db5d2 100644
--- a/code/game/gamemodes/wizard/artefact.dm
+++ b/code/game/gamemodes/wizard/artefact.dm
@@ -100,7 +100,7 @@
new_objective.explanation_text = "Protect [H.real_name], the wizard."
M.mind.objectives += new_objective
ticker.mode.traitors += M.mind
- M.mind.special_role = "apprentice"
+ M.mind.special_role = SPECIAL_ROLE_WIZARD_APPRENTICE
ticker.mode.update_wiz_icons_added(M.mind)
M.faction = list("wizard")
else
@@ -259,7 +259,7 @@ var/global/list/multiverse = list()
..()
/obj/item/weapon/multisword/attack_self(mob/user)
- if(user.mind.special_role == "apprentice")
+ if(user.mind.special_role == SPECIAL_ROLE_WIZARD_APPRENTICE)
to_chat(user, "You know better than to touch your teacher's stuff.")
return
if(cooldown < world.time)
@@ -346,7 +346,7 @@ var/global/list/multiverse = list()
M.mind.objectives += hijack_objective
hijack_objective.explanation_text = "Ensure only [usr.real_name] and their copies are on the shuttle!"
to_chat(M, "Objective #[1]: [hijack_objective.explanation_text]")
- M.mind.special_role = "multiverse traveller"
+ M.mind.special_role = SPECIAL_ROLE_MULTIVERSE
log_game("[M.key] was made a multiverse traveller with the objective to help [usr.real_name] hijack.")
else
var/datum/objective/protect/new_objective = new /datum/objective/protect
@@ -355,7 +355,7 @@ var/global/list/multiverse = list()
new_objective.explanation_text = "Protect [usr.real_name], your copy, and help them defend the innocent from the mobs of multiverse clones."
M.mind.objectives += new_objective
to_chat(M, "Objective #[1]: [new_objective.explanation_text]")
- M.mind.special_role = "multiverse traveller"
+ M.mind.special_role = SPECIAL_ROLE_MULTIVERSE
log_game("[M.key] was made a multiverse traveller with the objective to help [usr.real_name] protect the station.")
/obj/item/weapon/multisword/proc/equip_copy(var/mob/living/carbon/human/M)
diff --git a/code/game/gamemodes/wizard/rightandwrong.dm b/code/game/gamemodes/wizard/rightandwrong.dm
index 37a2e641f31..3899d10d23c 100644
--- a/code/game/gamemodes/wizard/rightandwrong.dm
+++ b/code/game/gamemodes/wizard/rightandwrong.dm
@@ -12,7 +12,7 @@
if(H.stat == 2 || !(H.client))
continue
if(H.mind)
- if(H.mind.special_role == "Wizard" || H.mind.special_role == "apprentice")
+ if(H.mind.special_role == SPECIAL_ROLE_WIZARD || H.mind.special_role == SPECIAL_ROLE_WIZARD_APPRENTICE)
continue
var/randomizeguns = pick(gunslist)
var/randomizemagic = pick(magiclist)
diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm
index 0dbcd3103fe..b2d610b3fc6 100644
--- a/code/game/gamemodes/wizard/spellbook.dm
+++ b/code/game/gamemodes/wizard/spellbook.dm
@@ -640,7 +640,7 @@
if(!ishuman(H))
return 1
- if(H.mind.special_role == "apprentice")
+ if(H.mind.special_role == SPECIAL_ROLE_WIZARD_APPRENTICE)
temp = "If you got caught sneaking a peak from your teacher's spellbook, you'd likely be expelled from the Wizard Academy. Better not."
return 1
@@ -689,7 +689,7 @@
for(var/obj/effect/proc_holder/spell/knownspell in user.mind.spell_list)
if(knownspell.type == S.type)
if(user.mind)
- if(user.mind.special_role == "apprentice" || user.mind.special_role == "Wizard")
+ if(user.mind.special_role == SPECIAL_ROLE_WIZARD_APPRENTICE || user.mind.special_role == SPECIAL_ROLE_WIZARD)
to_chat(user, "You're already far more versed in this spell than this flimsy how-to book can provide.")
else
to_chat(user, "You've already read this one.")
diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm
index 338d088d6f1..677d00d4fc1 100644
--- a/code/game/gamemodes/wizard/wizard.dm
+++ b/code/game/gamemodes/wizard/wizard.dm
@@ -28,7 +28,7 @@
wizards += wizard
modePlayer += wizard
wizard.assigned_role = "MODE" //So they aren't chosen for other jobs.
- wizard.special_role = "Wizard"
+ wizard.special_role = SPECIAL_ROLE_WIZARD
wizard.original = wizard.current
if(wizardstart.len == 0)
to_chat(wizard.current, "\red A starting location for you could not be found, please report this bug!")
diff --git a/code/game/gamemodes/xenos/xenos.dm b/code/game/gamemodes/xenos/xenos.dm
index 4d3fc5bfae8..c4659993e45 100644
--- a/code/game/gamemodes/xenos/xenos.dm
+++ b/code/game/gamemodes/xenos/xenos.dm
@@ -42,7 +42,7 @@
for(var/datum/mind/xeno in xenos)
xeno.assigned_role = "MODE"
- xeno.special_role = "Alien"
+ xeno.special_role = SPECIAL_ROLE_XENOMORPH
set_antag_hud(xeno, "hudalien")//like this is needed...
return 1
@@ -122,8 +122,7 @@
command_announcement.Announce("The aliens have nearly succeeded in capturing the station and exterminating the crew. Activate the nuclear failsafe to stop the alien threat once and for all. The Nuclear Authentication Code is [get_nuke_code()] ", "Alien Lifeform Alert")
set_security_level("gamma")
var/obj/machinery/door/airlock/vault/V = locate(/obj/machinery/door/airlock/vault) in world
- // TODO: Tie into space manager
- if(V && (V.z in config.station_levels))
+ if(V && is_station_level(V.z))
V.locked = 0
V.update_icon()
return ..()
@@ -143,8 +142,7 @@
var/list/livingplayers = list()
for(var/mob/M in player_list)
var/turf/T = get_turf(M)
- // TODO: Tie into space manager
- if((M) && (M.stat != 2) && M.client && T && ((T.z in config.station_levels) || shuttle_master.emergency.mode >= SHUTTLE_ESCAPE && ((T.z in config.station_levels) || (T.z in config.admin_levels))))
+ if((M) && (M.stat != DEAD) && M.client && T && (is_station_level(T.z) || shuttle_master.emergency.mode >= SHUTTLE_ESCAPE && is_secure_level(T.z)))
if(ishuman(M))
livingplayers += 1
return livingplayers.len
diff --git a/code/game/jobs/whitelist.dm b/code/game/jobs/whitelist.dm
index 345b65c1d6b..2a99414cb0b 100644
--- a/code/game/jobs/whitelist.dm
+++ b/code/game/jobs/whitelist.dm
@@ -21,7 +21,7 @@ var/list/whitelist = list()
if(guest_jobbans(rank))
if(!config.usewhitelist)
return 1
- if(check_rights(R_ADMIN, 0))
+ if(check_rights(R_ADMIN, 0, M))
return 1
if(!dbcon.IsConnected())
to_chat(usr, "\red Unable to connect to whitelist database. Please try again later.
")
diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm
index 63a8aca926b..e901a245bea 100644
--- a/code/game/machinery/OpTable.dm
+++ b/code/game/machinery/OpTable.dm
@@ -100,6 +100,7 @@
C.client.perspective = EYE_PERSPECTIVE
C.client.eye = src
C.resting = 1
+ C.update_canmove()
C.loc = src.loc
if(user.pulling == C)
user.stop_pulling()
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index 4c7cd096fc3..5515eb7ab3a 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -769,7 +769,6 @@
var/turf/pos = get_turf(src)
data["x"] = pos.x
data["y"] = pos.y
- // TODO: Tie into space manager
data["z"] = pos.z
return data
diff --git a/code/game/machinery/atmoalter/area_atmos_computer.dm b/code/game/machinery/atmoalter/area_atmos_computer.dm
index a75c3afac88..36b680f1ebc 100644
--- a/code/game/machinery/atmoalter/area_atmos_computer.dm
+++ b/code/game/machinery/atmoalter/area_atmos_computer.dm
@@ -113,7 +113,6 @@
scrubber.update_icon()
proc/validscrubber( var/obj/machinery/portable_atmospherics/scrubber/huge/scrubber as obj )
- // TODO: Tie into space manager
if(!isobj(scrubber) || get_dist(scrubber.loc, src.loc) > src.range || scrubber.loc.z != src.loc.z)
return 0
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index bcf8ee75b00..0935f8443f6 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -43,7 +43,7 @@
/obj/machinery/camera/initialize()
..()
- if(z == ZLEVEL_STATION && prob(3) && !start_active)
+ if(is_station_level(z) && prob(3) && !start_active)
toggle_cam()
/obj/machinery/camera/Destroy()
diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm
index 5a36a900e61..d37aa23cf64 100644
--- a/code/game/machinery/camera/presets.dm
+++ b/code/game/machinery/camera/presets.dm
@@ -81,7 +81,7 @@
assembly.upgrades.Add(new /obj/item/device/assembly/prox_sensor(assembly))
setPowerUsage()
// Add it to machines that process
- machines |= src
+ machine_processing |= src
/obj/machinery/camera/proc/setPowerUsage()
var/mult = 1
diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm
index cccc7e52f91..909d53be265 100644
--- a/code/game/machinery/camera/tracking.dm
+++ b/code/game/machinery/camera/tracking.dm
@@ -1,10 +1,7 @@
/mob/living/silicon/ai/proc/InvalidTurf(turf/T as turf)
if(!T)
return 1
- // TODO: Tie into space manager
- if((T.z in config.admin_levels))
- return 1
- if(T.z > MAX_Z)
+ if(!is_level_reachable(T.z))
return 1
return 0
diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm
index a9b1e3ff31c..fd5dc873739 100644
--- a/code/game/machinery/computer/camera.dm
+++ b/code/game/machinery/computer/camera.dm
@@ -75,8 +75,7 @@
var/list/cameras = list()
for(var/obj/machinery/camera/C in cameranet.cameras)
- // TODO: Tie into space manager
- if((z > MAX_Z || C.z > MAX_Z) && (C.z != z)) //can only recieve away mission cameras on away missions
+ if((is_away_level(src.z) || is_away_level(C.z)) && !atoms_share_level(C, src)) //can only recieve away mission cameras on away missions
continue
if(!can_access_camera(C))
continue
diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm
index 790c516fc95..5ea7456fd08 100644
--- a/code/game/machinery/computer/communications.dm
+++ b/code/game/machinery/computer/communications.dm
@@ -54,8 +54,7 @@
if(..(href, href_list))
return 1
- // TODO: Tie into space manager
- if((!(src.z in config.station_levels) && !(src.z in config.admin_levels)))
+ if(!is_secure_level(src.z))
to_chat(usr, "Unable to establish a connection: You're too far away from the station!")
return 1
@@ -304,8 +303,7 @@
if(stat & (NOPOWER|BROKEN))
return
- // TODO: Tie into space manager
- if(!(src.z in list(ZLEVEL_STATION, ZLEVEL_CENTCOMM)))
+ if(!is_secure_level(src.z))
to_chat(user, "Unable to establish a connection: You're too far away from the station!")
return
diff --git a/code/game/machinery/computer/honkputer.dm b/code/game/machinery/computer/honkputer.dm
index 75880d41975..b20821d24c2 100644
--- a/code/game/machinery/computer/honkputer.dm
+++ b/code/game/machinery/computer/honkputer.dm
@@ -20,8 +20,7 @@
/obj/machinery/computer/HONKputer/Topic(href, href_list)
if(..())
return 1
- // TODO: Tie into space manager
- if(!(src.z in config.station_levels))
+ if(is_away_level(src.z))
to_chat(usr, "Unable to establish a connection: You're too far away from the station!")
return
usr.set_machine(src)
@@ -69,8 +68,7 @@
/obj/machinery/computer/HONKputer/attack_hand(var/mob/user as mob)
if(..())
return
- // TODO: Tie into space manager
- if(src.z > ZLEVEL_DERELICT)
+ if(is_away_level(src.z))
to_chat(user, "Unable to establish a connection: You're too far away from the station!")
return
diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm
index a6f1a0e6c26..125a5fc06ad 100644
--- a/code/game/machinery/computer/law.dm
+++ b/code/game/machinery/computer/law.dm
@@ -29,8 +29,7 @@
attackby(obj/item/weapon/O as obj, mob/user as mob, params)
- // TODO: Tie into space manager
- if(user.z > ZLEVEL_DERELICT)
+ if(is_away_level(user.z))
to_chat(user, "Unable to establish a connection: You're too far away from the station!")
return
if(istype(O, /obj/item/weapon/aiModule))
diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm
index 84b467d2072..2619e25e4b8 100644
--- a/code/game/machinery/computer/pod.dm
+++ b/code/game/machinery/computer/pod.dm
@@ -19,8 +19,6 @@
..()
spawn(5)
driver_sync()
- machines += src
- return
/obj/machinery/computer/pod/proc/driver_sync()
@@ -208,7 +206,9 @@
id_tags -= ident_tag
if(href_list["dstele"])
var/choices = list(0)
- choices += accessable_z_levels
+ var/list/reachable_levels = levels_by_trait(REACHABLE)
+ for(var/datum/space_level/S in reachable_levels)
+ choices += S.zpos
var/obj/machinery/computer/pod/deathsquad/D = src
var/input = input("Enter the destination Z-Level. The mechs will arrive from the East. Leave 0 if you don't want to set a specific ZLevel", "Mass Driver Controls", 0) in choices
D.teleporter_dest = input
@@ -362,4 +362,4 @@
AM.dir = 8
var/atom/target = get_edge_target_turf(AM, AM.dir)
AM.throw_at(target, 50, 1)
- return
\ No newline at end of file
+ return
diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm
index e3683361ef2..fa1ba551728 100644
--- a/code/game/machinery/computer/prisoner.dm
+++ b/code/game/machinery/computer/prisoner.dm
@@ -65,8 +65,7 @@
health_display = "DEAD"
else if(total_loss)
health_display = "HURT ([total_loss])"
- // TODO: Tie into space manager
- if((M.z in config.station_levels) && !istype(M.loc, /turf/space))
+ if(is_station_level(M.z) && !istype(M.loc, /turf/space))
loc_display = "[get_area(M)]"
dat += "ID: [T.id]
Subject: [M]
Location: [loc_display]
Health: [health_display]
"
dat += "(Message Holder) |
"
diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm
index c7c23dbc724..c03ce8ee440 100644
--- a/code/game/machinery/computer/security.dm
+++ b/code/game/machinery/computer/security.dm
@@ -41,8 +41,7 @@
/obj/machinery/computer/secure_data/attack_hand(mob/user as mob)
if(..())
return
- // TODO: Tie into space manager
- if(src.z > ZLEVEL_DERELICT)
+ if(is_away_level(src.z))
to_chat(user, "Unable to establish a connection: You're too far away from the station!")
return
var/dat
diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm
index 7c0680f26d3..81aa33109f0 100644
--- a/code/game/machinery/computer/skills.dm
+++ b/code/game/machinery/computer/skills.dm
@@ -41,8 +41,7 @@
if(..())
return
- // TODO: Tie into space manager
- if(src.z > ZLEVEL_DERELICT)
+ if(is_away_level(src.z))
to_chat(user, "Unable to establish a connection: You're too far away from the station!")
return
var/dat
diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm
index e33d3e4d9c4..4904c8795fa 100644
--- a/code/game/machinery/doors/airlock_control.dm
+++ b/code/game/machinery/doors/airlock_control.dm
@@ -36,8 +36,8 @@ obj/machinery/door/airlock/proc/execute_current_command()
if(command_completed(cur_command))
cur_command = null
else
- if(!(src in machines))
- addAtProcessing()
+ if(!(src in machine_processing))
+ machine_processing += src
obj/machinery/door/airlock/proc/do_command(var/command)
switch(command)
diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm
index b0be899942d..3d8e7d3e15b 100644
--- a/code/game/machinery/doors/brigdoors.dm
+++ b/code/game/machinery/doors/brigdoors.dm
@@ -98,8 +98,8 @@
// Set releasetime
releasetime = world.timeofday + timetoset
- if(!(src in machines))
- addAtProcessing()
+ if(!(src in machine_processing))
+ machine_processing += src
for(var/obj/machinery/door/window/brigdoor/door in targets)
if(door.density)
diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm
index ffa35c963d0..3dffa7dda24 100644
--- a/code/game/machinery/firealarm.dm
+++ b/code/game/machinery/firealarm.dm
@@ -295,9 +295,7 @@ FIRE ALARM
pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
- // TODO: Tie into space manager
- // also hwat
- if(z == ZLEVEL_STATION || ZLEVEL_ASTEROID == 5)
+ if(is_station_contact(src.z))
if(security_level)
src.overlays += image('icons/obj/monitors.dmi', "overlay_[get_security_level()]")
else
diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm
index fb55eee1200..b886bc3ff71 100644
--- a/code/game/machinery/iv_drip.dm
+++ b/code/game/machinery/iv_drip.dm
@@ -79,7 +79,7 @@
if(beaker)
usr.visible_message("[usr] attaches [src] to [target].", "You attach [src] to [target].")
attached = target
- addAtProcessing()
+ machine_processing += src
update_icon()
else
to_chat(usr, "There's nothing attached to the IV drip!")
diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm
index 17552c3fe1c..518304fda5f 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -117,6 +117,7 @@ Class Procs:
var/use_log = list()
var/list/settagwhitelist = list()//WHITELIST OF VARIABLES THAT THE set_tag HREF CAN MODIFY, DON'T PUT SHIT YOU DON'T NEED ON HERE, AND IF YOU'RE GONNA USE set_tag (format_tag() proc), ADD TO THIS LIST.
atom_say_verb = "beeps"
+ var/speed_process = 0 // Process as fast as possible?
/obj/machinery/initialize()
addAtProcessing()
@@ -128,17 +129,17 @@ Class Procs:
myArea = get_area_master(src)
machines += src
-
-/obj/machinery/proc/removeAtProcessing()
- if(myArea)
- myArea = null
-
- machines -= src
+ if(!speed_process)
+ machine_processing += src
+ else
+ fast_processing += src
/obj/machinery/Destroy()
- if(src in machines)
- removeAtProcessing()
-
+ if(myArea)
+ myArea = null
+ fast_processing -= src
+ machine_processing -= src
+ machines -= src
return ..()
/obj/machinery/proc/locate_machinery()
diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm
index c7ddfc84c38..4cdc3494927 100644
--- a/code/game/machinery/recycler.dm
+++ b/code/game/machinery/recycler.dm
@@ -2,22 +2,23 @@ var/const/SAFETY_COOLDOWN = 100
/obj/machinery/recycler
name = "recycler"
- desc = "A large crushing machine which is used to recycle small items ineffeciently; there are lights on the side of it."
+ desc = "A large crushing machine used to recycle small items inefficiently. There are lights on the side."
icon = 'icons/obj/recycling.dmi'
icon_state = "grinder-o0"
layer = MOB_LAYER+1 // Overhead
anchored = 1
density = 1
- var/safety_mode = 0 // Temporality stops the machine if it detects a mob
- var/grinding = 0
+ var/safety_mode = 0 // Temporarily stops machine if it detects a mob
var/icon_name = "grinder-o"
var/blood = 0
var/eat_dir = WEST
var/amount_produced = 1
var/datum/material_container/materials
+ var/crush_damage = 1000
+ var/eat_victim_items = 1
+ var/item_recycle_sound = 'sound/machines/recycler.ogg'
/obj/machinery/recycler/New()
- // On us
..()
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/recycler(null)
@@ -56,8 +57,6 @@ var/const/SAFETY_COOLDOWN = 100
/obj/machinery/recycler/attackby(obj/item/I, mob/user, params)
if(default_deconstruction_screwdriver(user, "grinder-oOpen", "grinder-o0", I))
- if(!panel_open)
- update_icon()
return
if(exchange_parts(user, I))
@@ -69,7 +68,6 @@ var/const/SAFETY_COOLDOWN = 100
default_deconstruction_crowbar(I)
..()
add_fingerprint(user)
- return
/obj/machinery/recycler/emag_act(mob/user)
if(!emagged)
@@ -77,8 +75,8 @@ var/const/SAFETY_COOLDOWN = 100
if(safety_mode)
safety_mode = 0
update_icon()
- playsound(src.loc, "sparks", 75, 1, -1)
- to_chat(user, "You use the cryptographic sequencer on the [src.name].")
+ playsound(loc, "sparks", 75, 1, -1)
+ to_chat(user, "You use the cryptographic sequencer on the [name].")
/obj/machinery/recycler/update_icon()
..()
@@ -88,48 +86,51 @@ var/const/SAFETY_COOLDOWN = 100
icon_state = icon_name + "[is_powered]" + "[(blood ? "bld" : "")]" // add the blood tag at the end
// This is purely for admin possession !FUN!.
-/obj/machinery/recycler/Bump(var/atom/movable/AM)
+/obj/machinery/recycler/Bump(atom/movable/AM)
..()
if(AM)
Bumped(AM)
-/obj/machinery/recycler/Bumped(var/atom/movable/AM)
+/obj/machinery/recycler/Bumped(atom/movable/AM)
if(stat & (BROKEN|NOPOWER))
return
- if(safety_mode)
- return
if(!anchored)
return
- // If we're not already grinding something.
- if(!grinding)
- grinding = 1
- spawn(1)
- grinding = 0
- else
+ if(safety_mode)
return
var/move_dir = get_dir(loc, AM.loc)
if(move_dir == eat_dir)
+ eat(AM)
+
+/obj/machinery/recycler/proc/eat(atom/AM0, sound = 1)
+ var/list/to_eat = list(AM0)
+ if(istype(AM0, /obj/item))
+ to_eat += AM0.GetAllContents()
+ var/items_recycled = 0
+
+ for(var/i in to_eat)
+ var/atom/movable/AM = i
if(isliving(AM))
if(emagged)
- eat(AM)
+ crush_living(AM)
else
- stop(AM)
+ emergency_stop(AM)
else if(istype(AM, /obj/item))
- recycle(AM)
- else // Can't recycle
- playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
- AM.loc = src.loc
+ recycle_item(AM)
+ items_recycled++
+ else
+ playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
+ AM.loc = loc
-/obj/machinery/recycler/proc/recycle(obj/item/I, sound = 1)
- I.loc = src.loc
- if(!istype(I))
- return
+ if(items_recycled && sound)
+ playsound(loc, item_recycle_sound, 100, 0)
+
+/obj/machinery/recycler/proc/recycle_item(obj/item/I)
+ I.loc = loc
- if(sound)
- playsound(src.loc, 'sound/machines/recycler.ogg', 100, 0)
var/material_amount = materials.get_item_material_amount(I)
if(!material_amount)
qdel(I)
@@ -139,25 +140,26 @@ var/const/SAFETY_COOLDOWN = 100
materials.retrieve_all()
-/obj/machinery/recycler/proc/stop(var/mob/living/L)
- playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
+/obj/machinery/recycler/proc/emergency_stop(mob/living/L)
+ playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
safety_mode = 1
update_icon()
- L.loc = src.loc
+ L.loc = loc
+ addtimer(src, "reboot", SAFETY_COOLDOWN)
- spawn(SAFETY_COOLDOWN)
- playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
- safety_mode = 0
- update_icon()
+/obj/machinery/recycler/proc/reboot()
+ playsound(loc, 'sound/machines/ping.ogg', 50, 0)
+ safety_mode = 0
+ update_icon()
-/obj/machinery/recycler/proc/eat(var/mob/living/L)
+/obj/machinery/recycler/proc/crush_living(mob/living/L)
- L.loc = src.loc
+ L.loc = loc
if(issilicon(L))
- playsound(src.loc, 'sound/machines/recycler.ogg', 100, 0)
+ playsound(loc, 'sound/items/Welder.ogg', 50, 1)
else
- playsound(src.loc, 'sound/effects/splat.ogg', 50, 1)
+ playsound(loc, 'sound/effects/splat.ogg', 50, 1)
var/gib = 1
// By default, the emagged recycler will gib all non-carbons. (human simple animal mobs don't count)
@@ -171,10 +173,11 @@ var/const/SAFETY_COOLDOWN = 100
blood = 1
update_icon()
- // Remove and recycle the equipped items.
- for(var/obj/item/I in L.get_equipped_items())
- if(L.unEquip(I))
- recycle(I, 0)
+ // Remove and recycle the equipped items
+ if(eat_victim_items)
+ for(var/obj/item/I in L.get_equipped_items())
+ if(L.unEquip(I))
+ eat(I, sound = 0)
// Instantly lie down, also go unconscious from the pain, before you die.
L.Paralyse(5)
@@ -183,7 +186,8 @@ var/const/SAFETY_COOLDOWN = 100
if(gib || emagged == 2)
L.gib()
else if(emagged == 1)
- L.adjustBruteLoss(1000)
+ L.adjustBruteLoss(crush_damage)
+
/obj/machinery/recycler/verb/rotate()
set name = "Rotate Clockwise"
@@ -192,9 +196,9 @@ var/const/SAFETY_COOLDOWN = 100
var/mob/living/user = usr
- if(usr.stat || !usr.canmove || usr.restrained())
+ if(usr.incapacitated())
return
- if(src.anchored)
+ if(anchored)
to_chat(usr, "[src] is fastened to the floor!")
return 0
eat_dir = turn(eat_dir, 270)
@@ -208,15 +212,22 @@ var/const/SAFETY_COOLDOWN = 100
var/mob/living/user = usr
- if(usr.stat || !usr.canmove || usr.restrained())
+ if(usr.incapacitated())
return
- if(src.anchored)
+ if(anchored)
to_chat(usr, "[src] is fastened to the floor!")
return 0
eat_dir = turn(eat_dir, 90)
to_chat(user, "[src] will now accept items from [dir2text(eat_dir)].")
return 1
+
+/obj/machinery/recycler/deathtrap
+ name = "dangerous old crusher"
+ emagged = 1
+ crush_damage = 120
+
+
/obj/item/weapon/paper/recycler
name = "paper - 'garbage duty instructions'"
info = "New Assignment
You have been assigned to collect garbage from trash bins, located around the station. The crewmembers will put their trash into it and you will collect the said trash.
There is a recycling machine near your closet, inside maintenance; use it to recycle the trash for a small chance to get useful minerals. Then deliver these minerals to cargo or engineering. You are our last hope for a clean station, do not screw this up!"
diff --git a/code/game/machinery/supply_display.dm b/code/game/machinery/supply_display.dm
index caf0c9c67d9..9c945fff989 100644
--- a/code/game/machinery/supply_display.dm
+++ b/code/game/machinery/supply_display.dm
@@ -5,8 +5,7 @@
/obj/machinery/status_display/supply_display/update()
if(!..() && mode == STATUS_DISPLAY_CUSTOM)
if(shuttle_master.supply.mode == SHUTTLE_IDLE)
- // TODO: Tie into space manager
- if(shuttle_master.supply.z == ZLEVEL_STATION)
+ if(is_station_level(shuttle_master.supply.z))
message1 = "CARGO"
message2 = "Docked"
else
diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm
index 7790cf10ebc..1a17dec0aed 100644
--- a/code/game/machinery/syndicatebeacon.dm
+++ b/code/game/machinery/syndicatebeacon.dm
@@ -61,7 +61,7 @@
var/mob/living/carbon/human/N = M
ticker.mode.equip_traitor(N)
ticker.mode.traitors += N.mind
- N.mind.special_role = "traitor"
+ N.mind.special_role = SPECIAL_ROLE_TRAITOR
var/objective = "Free Objective"
switch(rand(1,100))
if(1 to 50)
@@ -133,7 +133,7 @@
singulo.target = src
icon_state = "[icontype]1"
active = 1
- machines |= src
+ machine_processing |= src
if(user)
to_chat(user, "You activate the beacon.")
diff --git a/code/game/machinery/telecomms/broadcaster.dm b/code/game/machinery/telecomms/broadcaster.dm
index 7ddb0f4b963..34be5ed1c67 100644
--- a/code/game/machinery/telecomms/broadcaster.dm
+++ b/code/game/machinery/telecomms/broadcaster.dm
@@ -423,8 +423,9 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
/* ###### Prepare the radio connection ###### */
+ var/mob/living/carbon/human/H
if(!M)
- var/mob/living/carbon/human/H = new
+ H = new
M = H
var/datum/radio_frequency/connection = radio_controller.return_frequency(frequency)
@@ -439,7 +440,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
if(data == 1)
for(var/obj/item/device/radio/intercom/R in connection.devices["[RADIO_CHAT]"])
var/turf/position = get_turf(R)
- // TODO: Tie into space manager
+ // TODO: Make the radio system cooperate with the space manager
if(position && position.z == level)
receive |= R.send_hear(display_freq, level)
@@ -452,7 +453,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
if(istype(R, /obj/item/device/radio/headset))
continue
var/turf/position = get_turf(R)
- // TODO: Tie into space manager
+ // TODO: Make the radio system cooperate with the space manager
if(position && position.z == level)
receive |= R.send_hear(display_freq)
@@ -464,7 +465,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
var/datum/radio_frequency/antag_connection = radio_controller.return_frequency(freq)
for(var/obj/item/device/radio/R in antag_connection.devices["[RADIO_CHAT]"])
var/turf/position = get_turf(R)
- // TODO: Tie into space manager
+ // TODO: Make the radio system cooperate with the space manager
if(position && position.z == level)
receive |= R.send_hear(freq)
@@ -474,7 +475,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
else
for(var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"])
var/turf/position = get_turf(R)
- // TODO: Tie into space manager
+ // TODO: Make the radio system cooperate with the space manager
if(position && position.z == level)
receive |= R.send_hear(display_freq)
@@ -596,12 +597,15 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
for(var/mob/R in heard_gibberish)
R.show_message(rendered, 2)
+ if(H)
+ qdel(H)
+
//Use this to test if an obj can communicate with a Telecommunications Network
/atom/proc/test_telecomms()
var/datum/signal/signal = src.telecomms_process()
var/turf/position = get_turf(src)
- // TODO: Tie into space manager
+ // TODO: Make the radio system cooperate with the space manager
return (position.z in signal.data["level"]) && signal.data["done"]
/atom/proc/telecomms_process(var/do_sleep = 1)
@@ -620,7 +624,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
"type" = 4, // determines what type of radio input it is: test broadcast
"reject" = 0,
"done" = 0,
- // TODO: Tie into space manager
+ // TODO: Make the radio system cooperate with the space manager
"level" = pos.z // The level it is being broadcasted at.
)
signal.frequency = PUB_FREQ// Common channel
diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm
index 0c0dfd178fe..347f4ebc685 100644
--- a/code/game/machinery/telecomms/machine_interactions.dm
+++ b/code/game/machinery/telecomms/machine_interactions.dm
@@ -180,12 +180,12 @@
var/turf/position = get_turf(src)
// Toggle on/off getting signals from the station or the current Z level
- // TODO: Tie into space manager
- if(src.listening_level == ZLEVEL_STATION) // equals the station
+ // TODO: Could work with the space manager better
+ if(is_station_level(src.listening_level)) // equals the station
src.listening_level = position.z
return 1
- else if(position.z == ZLEVEL_TELECOMMS)
- src.listening_level = ZLEVEL_STATION
+ else if(level_boosts_signal(position.z))
+ src.listening_level = level_name_to_num(MAIN_STATION)
return 1
return 0
@@ -234,8 +234,8 @@
/obj/machinery/telecomms/relay/Options_Menu()
var/dat = ""
- if(src.z == ZLEVEL_TELECOMMS)
- dat += "
Signal Locked to Station: [listening_level == ZLEVEL_STATION ? "TRUE" : "FALSE"]"
+ if(level_boosts_signal(src.z))
+ dat += "
Signal Locked to Station: [is_station_level(listening_level) ? "TRUE" : "FALSE"]"
dat += "
Broadcasting: [broadcasting ? "YES" : "NO"]"
dat += "
Receiving: [receiving ? "YES" : "NO"]"
return dat
diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm
index 22c7863a3bb..a4e481f430b 100644
--- a/code/game/machinery/telecomms/telecomunications.dm
+++ b/code/game/machinery/telecomms/telecomunications.dm
@@ -56,7 +56,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
continue
if(amount && send_count >= amount)
break
- // TODO: Tie into space manager
+ // TODO: Make the radio system cooperate with the space manager
if(machine.loc.z != listening_level)
if(long_range_link == 0 && machine.long_range_link == 0)
continue
@@ -115,7 +115,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
if(!listening_level)
//Defaults to our Z level!
var/turf/position = get_turf(src)
- // TODO: Tie into space manager
+ // TODO: Make the radio system cooperate with the space manager
listening_level = position.z
/obj/machinery/telecomms/initialize()
@@ -141,7 +141,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
/obj/machinery/telecomms/proc/add_link(var/obj/machinery/telecomms/T)
var/turf/position = get_turf(src)
var/turf/T_position = get_turf(T)
- // TODO: Tie into space manager
+ // TODO: Make the radio system cooperate with the space manager
if((position.z == T_position.z) || (src.long_range_link && T.long_range_link))
for(var/x in autolinkers)
if(T.autolinkers.Find(x))
diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm
index 6ecc675fdef..369cb0fc708 100644
--- a/code/game/machinery/teleporter.dm
+++ b/code/game/machinery/teleporter.dm
@@ -182,8 +182,7 @@
var/turf/T = get_turf(R)
if(!T)
continue
- // TODO: Tie into space manager
- if((T.z in config.admin_levels) || T.z > ZLEVEL_EMPTY)
+ if(!is_teleport_allowed(T.z))
continue
if(R.syndicate == 1 && emagged == 0)
continue
@@ -199,13 +198,12 @@
continue
else
var/mob/M = I.loc
- if(M.stat == 2)
+ if(M.stat == DEAD)
if(M.timeofdeath + 6000 < world.time)
continue
var/turf/T = get_turf(M)
if(!T) continue
- // TODO: Tie into space manager
- if((T.z in config.admin_levels)) continue
+ if(!is_teleport_allowed(T.z)) continue
var/tmpname = M.real_name
if(areaindex[tmpname])
tmpname = "[tmpname] ([++areaindex[tmpname]])"
@@ -227,8 +225,7 @@
var/turf/T = get_turf(R)
if(!T || !R.teleporter_hub || !R.teleporter_console)
continue
- // TODO: Tie into space manager
- if((T.z in config.admin_levels) || T.z > ZLEVEL_EMPTY)
+ if(!is_teleport_allowed(T.z))
continue
var/tmpname = T.loc.name
if(areaindex[tmpname])
@@ -323,7 +320,7 @@
return power_station
/obj/machinery/teleport/hub/Bumped(M as mob|obj)
- if(z == ZLEVEL_CENTCOMM && !admin_usage)
+ if(!is_teleport_allowed(z) && !admin_usage)
to_chat(M, "You can't use this here.")
return
if(power_station && power_station.engaged && !panel_open)
@@ -401,7 +398,7 @@
/obj/machinery/teleport/perma/Bumped(M as mob|obj)
if(stat & (BROKEN|NOPOWER))
return
- if(z == ZLEVEL_CENTCOMM)
+ if(!is_teleport_allowed(z))
to_chat(M, "You can't use this here.")
return
if(target && !recalibrating && !panel_open)
diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm
index cb55c783005..d945e1cbb7f 100644
--- a/code/game/mecha/equipment/tools/tools.dm
+++ b/code/game/mecha/equipment/tools/tools.dm
@@ -382,8 +382,7 @@
range = RANGED
action(atom/target)
- // TODO: Tie into space manager
- if(!action_checks(target) || (src.loc.z in config.admin_levels)) return
+ if(!action_checks(target) || !is_teleport_allowed(src.loc.z)) return
var/turf/T = get_turf(target)
if(T)
set_ready_state(0)
@@ -404,8 +403,7 @@
action(atom/target)
- // TODO: Tie into space manager
- if(!action_checks(target) || (src.loc.z in config.admin_levels)) return
+ if(!action_checks(target) || !is_teleport_allowed(src.loc.z)) return
var/list/theareas = list()
for(var/area/AR in orange(100, chassis))
if(AR in theareas) continue
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index 7103b4f2d7a..5c48fbf4d18 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -969,7 +969,7 @@
if(!AI || !isAI(occupant)) //Mech does not have an AI for a pilot
to_chat(user, "No AI detected in the [name] onboard computer.")
return
- if(AI.mind.special_role == "malfunction") //Malf AIs cannot leave mechs. Except through death.
+ if(AI.mind.special_role == SPECIAL_ROLE_MALF) //Malf AIs cannot leave mechs. Except through death.
to_chat(user, "ACCESS DENIED.")
return
AI.aiRestorePowerRoutine = 0//So the AI initially has power.
diff --git a/code/game/objects/effects/landmarks.dm b/code/game/objects/effects/landmarks.dm
index 7f109425205..3a567518e42 100644
--- a/code/game/objects/effects/landmarks.dm
+++ b/code/game/objects/effects/landmarks.dm
@@ -13,7 +13,7 @@
switch(name) //some of these are probably obsolete
if("shuttle")
- shuttle_z = z
+ log_debug("Obsolete landmark '[name]' at ([x],[y],[z])")
qdel(src)
if("airtunnel_stop")
diff --git a/code/game/objects/items/devices/camera_bug.dm b/code/game/objects/items/devices/camera_bug.dm
index dec4f4c75fb..e50f26bcf4f 100644
--- a/code/game/objects/items/devices/camera_bug.dm
+++ b/code/game/objects/items/devices/camera_bug.dm
@@ -61,7 +61,6 @@
return null
var/turf/T = get_turf(user.loc)
- // TODO: Tie into space manager
if(T.z != current.z || !current.can_use())
to_chat(user, "[src] has lost the signal.")
current = null
@@ -226,7 +225,6 @@
to_chat(usr, "Something's wrong with that camera. You can't get a feed.")
return
var/turf/T = get_turf(loc)
- // TODO: Tie into space manager
if(!T || C.z != T.z)
to_chat(usr, "You can't get a signal.")
return
diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm
index a8623b17f56..502a5da02b3 100644
--- a/code/game/objects/items/devices/radio/intercom.dm
+++ b/code/game/objects/items/devices/radio/intercom.dm
@@ -124,7 +124,7 @@
return -1
if(!(0 in level))
var/turf/position = get_turf(src)
- // TODO: Tie into space manager
+ // TODO: Integrate radio with the space manager
if(isnull(position) || !(position.z in level))
return -1
if(!src.listening)
diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm
index f509f74d79b..307c4d53f29 100644
--- a/code/game/objects/items/stacks/sheets/mineral.dm
+++ b/code/game/objects/items/stacks/sheets/mineral.dm
@@ -36,6 +36,7 @@ var/global/list/datum/stack_recipe/uranium_recipes = list ( \
var/global/list/datum/stack_recipe/gold_recipes = list ( \
new/datum/stack_recipe("golden door", /obj/structure/mineral_door/gold, 10, one_per_turf = 1, on_floor = 1), \
+ new/datum/stack_recipe("Simple Crown", /obj/item/clothing/head/crown, 5), \
)
var/global/list/datum/stack_recipe/plasma_recipes = list ( \
diff --git a/code/game/objects/items/weapons/bee_briefcase.dm b/code/game/objects/items/weapons/bee_briefcase.dm
index 98f3fc1709b..8a15bc7f517 100644
--- a/code/game/objects/items/weapons/bee_briefcase.dm
+++ b/code/game/objects/items/weapons/bee_briefcase.dm
@@ -64,8 +64,7 @@
//Play sound through the station intercomms, so everyone knows the doom you have wrought.
for(var/O in global_intercoms)
var/obj/item/device/radio/intercom/I = O
- // TODO: Tie into space manager
- if(I.z != ZLEVEL_STATION) //Only broadcast to the station intercoms
+ if(!is_station_level(I.z)) //Only broadcast to the station intercoms
continue
if(!I.on) //Only broadcast to active intercoms (powered, switched on)
continue
diff --git a/code/game/objects/items/weapons/implants/implant_traitor.dm b/code/game/objects/items/weapons/implants/implant_traitor.dm
index 78e63ddfae4..65aa155c8cb 100644
--- a/code/game/objects/items/weapons/implants/implant_traitor.dm
+++ b/code/game/objects/items/weapons/implants/implant_traitor.dm
@@ -54,7 +54,7 @@
//ticker.mode:implanter[user.mind] += H.mind
ticker.mode:implanter[ref] = implanters
ticker.mode.traitors += H.mind
- H.mind.special_role = "traitor"
+ H.mind.special_role = SPECIAL_ROLE_TRAITOR
to_chat(H, "You're now completely loyal to [user.name]! You now must lay down your life to protect them and assist in their goals at any cost.")
var/datum/objective/protect/mindslave/MS = new
MS.owner = H.mind
diff --git a/code/game/objects/items/weapons/melee/misc.dm b/code/game/objects/items/weapons/melee/misc.dm
index cedb07273c6..f4b7946d0ca 100644
--- a/code/game/objects/items/weapons/melee/misc.dm
+++ b/code/game/objects/items/weapons/melee/misc.dm
@@ -20,6 +20,28 @@
to_chat(viewers(user), "[user] is strangling \himself with the [src.name]! It looks like \he's trying to commit suicide.")
return (OXYLOSS)
+/obj/item/weapon/melee/rapier
+ name = "captain's rapier"
+ desc = "An elegant weapon, for a more civilized age."
+ icon_state = "rapier"
+ item_state = "rapier"
+ flags = CONDUCT
+ force = 15
+ throwforce = 10
+ w_class = 4
+ block_chance = 50
+ armour_penetration = 75
+ sharp = 1
+ edge = 1
+ origin_tech = "combat=5"
+ attack_verb = list("lunged at", "stabbed")
+ hitsound = 'sound/weapons/slash.ogg'
+ materials = list(MAT_METAL = 1000)
+
+/obj/item/weapon/melee/rapier/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type)
+ if(attack_type == PROJECTILE_ATTACK)
+ final_block_chance = 0 //Don't bring a sword to a gunfight
+ return ..()
/obj/item/weapon/melee/icepick
name = "ice pick"
diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm
index 23f8f9ea685..c3a92c3ce48 100644
--- a/code/game/objects/items/weapons/storage/belt.dm
+++ b/code/game/objects/items/weapons/storage/belt.dm
@@ -314,6 +314,10 @@
"/obj/item/ammo_casing/shotgun"
)
+/obj/item/weapon/storage/belt/bandolier/New()
+ ..()
+ update_icon()
+
/obj/item/weapon/storage/belt/bandolier/full/New()
..()
new /obj/item/ammo_casing/shotgun/beanbag(src)
@@ -437,6 +441,31 @@
icon_state = "fannypack_yellow"
item_state = "fannypack_yellow"
+/obj/item/weapon/storage/belt/rapier
+ name = "rapier sheath"
+ desc = "Can hold rapiers."
+ icon_state = "sheath"
+ item_state = "sheath"
+ storage_slots = 1
+ max_w_class = 4
+ can_hold = list("/obj/item/weapon/melee/rapier")
+
+/obj/item/weapon/storage/belt/rapier/update_icon()
+ icon_state = "[initial(icon_state)]"
+ item_state = "[initial(item_state)]"
+ if(contents.len)
+ icon_state = "[initial(icon_state)]-rapier"
+ item_state = "[initial(item_state)]-rapier"
+ if(isliving(loc))
+ var/mob/living/L = loc
+ L.update_inv_belt()
+ ..()
+
+/obj/item/weapon/storage/belt/rapier/New()
+ ..()
+ new /obj/item/weapon/melee/rapier(src)
+ update_icon()
+
// -------------------------------------
// Bluespace Belt
// -------------------------------------
diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm
index decfa424872..15650f188d9 100644
--- a/code/game/objects/items/weapons/teleportation.dm
+++ b/code/game/objects/items/weapons/teleportation.dm
@@ -48,8 +48,7 @@ Frequency:
return 1
var/turf/current_location = get_turf(usr)//What turf is the user on?
- // TODO: Tie into space manager
- if(!current_location ||( current_location.z in config.admin_levels))//If turf was not found or they're on z level 2.
+ if(!current_location || is_admin_level(current_location.z))//If turf was not found or they're in the admin zone
to_chat(usr, "\The [src] is malfunctioning.")
return 1
@@ -62,7 +61,6 @@ Frequency:
for(var/obj/item/device/radio/beacon/W in beacons)
if(W.frequency == frequency && !W.syndicate)
- // TODO: Tie into space manager
if(W && W.z == z)
var/turf/TB = get_turf(W)
temp += "[W.code]: [TB.x], [TB.y], [TB.z]
"
@@ -109,8 +107,7 @@ Frequency:
/obj/item/weapon/hand_tele/attack_self(mob/user as mob)
var/turf/current_location = get_turf(user)//What turf is the user on?
- // TODO: Tie into space manager
- if(!current_location||(current_location.z in config.admin_levels)||current_location.z>=ZLEVEL_EMPTY)//If turf was not found or they're on z level 2 or >7 which does not currently exist.
+ if(!current_location||!is_teleport_allowed(current_location.z))//If turf was not found or they're somewhere teleproof
to_chat(user, "\The [src] is malfunctioning.")
return
var/list/L = list( )
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index 4fe639160d4..1831b983f2c 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -192,8 +192,7 @@
return
var/obj/item/weapon/rcs/E = W
if(E.rcell && (E.rcell.charge >= E.chargecost))
- // TODO: Tie into space manager
- if(!(src.z in config.contact_levels))
+ if(!is_level_reachable(src.z))
to_chat(user, "The rapid-crate-sender can't locate any telepads!")
return
if(E.mode == 0)
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/security.dm b/code/game/objects/structures/crates_lockers/closets/secure/security.dm
index 93d200e020d..640539e745b 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/security.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/security.dm
@@ -15,17 +15,21 @@
else
new /obj/item/weapon/storage/backpack/satchel_cap(src)
new /obj/item/weapon/book/manual/faxes(src)
+ new /obj/item/clothing/head/crown/fancy(src)
new /obj/item/weapon/storage/backpack/duffel/captain(src)
new /obj/item/clothing/suit/captunic(src)
new /obj/item/clothing/suit/captunic/capjacket(src)
+ new /obj/item/clothing/under/captainparade(src)
new /obj/item/clothing/head/caphat/parade(src)
- new /obj/item/clothing/under/dress/dress_cap(src)
new /obj/item/clothing/under/rank/captain(src)
- new /obj/item/clothing/suit/armor/vest/capcarapace(src)
+ new /obj/item/clothing/under/dress/dress_cap(src)
+ new /obj/item/clothing/suit/armor/vest/capcarapace/alt(src)
new /obj/item/weapon/cartridge/captain(src)
new /obj/item/clothing/shoes/brown(src)
+ new /obj/item/clothing/shoes/laceup(src)
new /obj/item/device/radio/headset/heads/captain/alt(src)
new /obj/item/clothing/gloves/color/captain(src)
+ new /obj/item/weapon/storage/belt/rapier(src)
new /obj/item/weapon/gun/energy/gun(src)
new /obj/item/weapon/door_remote/captain(src)
diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm
index f9b32b071f7..bf74c11ee84 100644
--- a/code/game/objects/structures/crates_lockers/crates.dm
+++ b/code/game/objects/structures/crates_lockers/crates.dm
@@ -84,8 +84,7 @@
if(istype(W, /obj/item/weapon/rcs) && !src.opened)
var/obj/item/weapon/rcs/E = W
if(E.rcell && (E.rcell.charge >= E.chargecost))
- // TODO: Tie into space manager
- if(!(src.z in config.player_levels))
+ if(!is_level_reachable(src.z)) // This is inconsistent with the closet sending code
to_chat(user, "The rapid-crate-sender can't locate any telepads!")
return
if(E.mode == 0)
diff --git a/code/game/response_team.dm b/code/game/response_team.dm
index abda62f9420..25530ca3017 100644
--- a/code/game/response_team.dm
+++ b/code/game/response_team.dm
@@ -189,7 +189,7 @@ var/ert_request_answered = 0
M.mind.current = M
M.mind.original = M
M.mind.assigned_role = "MODE"
- M.mind.special_role = "Response Team"
+ M.mind.special_role = SPECIAL_ROLE_ERT
if(!(M.mind in ticker.minds))
ticker.minds += M.mind //Adds them to regular mind list.
M.loc = spawn_location
@@ -426,7 +426,7 @@ var/ert_request_answered = 0
switch(officer_type)
if("Engineer")
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/yellow(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/ert/engineer(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen/engi(M), slot_s_store)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/meson(M), slot_glasses)
@@ -446,7 +446,7 @@ var/ert_request_answered = 0
if("Security")
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/black(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/ert/security(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/gun/advtaser(M), slot_s_store)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/hud/security/sunglasses(M), slot_glasses)
@@ -464,7 +464,7 @@ var/ert_request_answered = 0
if("Medic")
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/latex/nitrile(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/ert/medical(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/hud/health/health_advanced(M), slot_glasses)
@@ -511,7 +511,7 @@ var/ert_request_answered = 0
switch(officer_type)
if("Engineer")
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots/advance(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/yellow(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/ert/engineer(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen/double/full(M), slot_s_store)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/meson/night(M), slot_glasses)
diff --git a/code/game/turfs/simulated/floor/light_floor.dm b/code/game/turfs/simulated/floor/light_floor.dm
index f221494414f..149ec108ec8 100644
--- a/code/game/turfs/simulated/floor/light_floor.dm
+++ b/code/game/turfs/simulated/floor/light_floor.dm
@@ -51,7 +51,7 @@
set_light(0)
icon_state = "light_off"
-/turf/simulated/floor/light/ChangeTurf(turf/T)
+/turf/simulated/floor/light/BeforeChange()
set_light(0)
..()
diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm
index 547efaed2a6..45f0e42a2aa 100644
--- a/code/game/turfs/simulated/walls.dm
+++ b/code/game/turfs/simulated/walls.dm
@@ -36,11 +36,12 @@
/turf/simulated/wall/r_wall/coated)
smooth = SMOOTH_TRUE
-/turf/simulated/wall/ChangeTurf(var/newtype)
+/turf/simulated/wall/BeforeChange()
for(var/obj/effect/E in src)
+ // such quality code
if(E.name == "Wallrot")
qdel(E)
- . = ..(newtype)
+ . = ..()
//Appearance
@@ -468,4 +469,4 @@
/turf/simulated/wall/narsie_act()
if(prob(20))
- ChangeTurf(/turf/simulated/wall/cult)
\ No newline at end of file
+ ChangeTurf(/turf/simulated/wall/cult)
diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm
index 48f892caff0..fb10d23ae9c 100644
--- a/code/game/turfs/space/space.dm
+++ b/code/game/turfs/space/space.dm
@@ -23,6 +23,17 @@
/turf/space/Destroy()
return QDEL_HINT_LETMELIVE
+/turf/space/BeforeChange()
+ ..()
+ var/datum/space_level/S = space_manager.get_zlev(z)
+ S.remove_from_transit(src)
+
+/turf/space/AfterChange(ignore_air, keep_cabling = FALSE)
+ ..()
+ var/datum/space_level/S = space_manager.get_zlev(z)
+ S.add_to_transit(src)
+ S.apply_transition(src)
+
/turf/space/proc/update_starlight()
if(!config.starlight)
return
@@ -69,7 +80,7 @@
/turf/space/Entered(atom/movable/A as mob|obj, atom/OL, ignoreRest = 0)
..()
-
+
if(destination_z && A && (src in A.locs))
A.x = destination_x
A.y = destination_y
@@ -199,3 +210,26 @@
/turf/space/can_have_cabling()
return 0
+
+/turf/space/proc/set_transition_north(dest_z)
+ destination_x = x
+ destination_y = TRANSITIONEDGE + 2
+ destination_z = dest_z
+
+/turf/space/proc/set_transition_south(dest_z)
+ destination_x = x
+ destination_y = world.maxy - TRANSITIONEDGE - 2
+ destination_z = dest_z
+
+/turf/space/proc/set_transition_east(dest_z)
+ destination_x = TRANSITIONEDGE + 2
+ destination_y = y
+ destination_z = dest_z
+
+/turf/space/proc/set_transition_west(dest_z)
+ destination_x = world.maxx - TRANSITIONEDGE - 2
+ destination_y = y
+ destination_z = dest_z
+
+/turf/space/proc/remove_transitions()
+ destination_z = initial(destination_z)
diff --git a/code/game/turfs/space/transit.dm b/code/game/turfs/space/transit.dm
index 1b7c9343ca2..9feda5d78a7 100644
--- a/code/game/turfs/space/transit.dm
+++ b/code/game/turfs/space/transit.dm
@@ -93,7 +93,8 @@
var/max = world.maxx-TRANSITIONEDGE
var/min = 1+TRANSITIONEDGE
- var/_z = rand(ZLEVEL_CENTCOMM+1,MAX_Z) //select a random space zlevel
+ var/datum/space_level/dest = pick(levels_by_trait(REACHABLE))
+ var/_z = dest.zpos //select a random space zlevel
//now select coordinates for a border turf
var/_x
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index 93b9c339652..5946ef77f0a 100644
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -165,6 +165,7 @@
var/old_blueprint_data = blueprint_data
var/old_obscured = obscured
+ BeforeChange()
if(air_master)
air_master.remove_from_active(src)
var/turf/W = new path(src)
@@ -186,11 +187,14 @@
lighting_build_overlays()
else
lighting_clear_overlays()
-
+
obscured = old_obscured
return W
+/turf/proc/BeforeChange()
+ return
+
// I'm including `ignore_air` because BYOND lacks positional-only arguments
/turf/proc/AfterChange(ignore_air, keep_cabling = FALSE) //called after a turf has been replaced in ChangeTurf()
levelupdate()
diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm
index 09e17479927..512e2393f83 100644
--- a/code/modules/admin/player_panel.dm
+++ b/code/modules/admin/player_panel.dm
@@ -468,7 +468,7 @@
dat += "| Head not found! |
"
dat += ""
- if(istype(ticker.mode, /datum/game_mode/blob))
+ if(GAMEMODE_IS_BLOB)
var/datum/game_mode/blob/mode = ticker.mode
dat += "
| Blob | | |
"
dat += "| Progress: [blobs.len]/[mode.blobwincount] |
"
diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm
index 252636abcda..0cb74483a13 100644
--- a/code/modules/admin/topic.dm
+++ b/code/modules/admin/topic.dm
@@ -1980,8 +1980,7 @@
return
else
for(var/obj/machinery/photocopier/faxmachine/F in allfaxes)
- // TODO: Tie into space manager
- if((F.z in config.station_levels))
+ if(is_station_level(F.z))
spawn(0)
if(!F.receivefax(P))
to_chat(src.owner, "\red Message transmission to [F.department] failed.")
@@ -2328,8 +2327,7 @@
for(var/mob/living/carbon/human/H in mob_list)
var/turf/loc = find_loc(H)
var/security = 0
- // TODO: Tie into space manager
- if(!(loc.z in config.station_levels) || prisonwarped.Find(H))
+ if(!is_station_level(loc.z) || prisonwarped.Find(H))
//don't warp them if they aren't ready or are already there
continue
@@ -2375,7 +2373,7 @@
if(is_special_character(H)) continue
//traitorize(H, objective, 0)
ticker.mode.traitors += H.mind
- H.mind.special_role = "traitor"
+ H.mind.special_role = SPECIAL_ROLE_TRAITOR
var/datum/objective/new_objective = new
new_objective.owner = H
new_objective.explanation_text = objective
@@ -2385,7 +2383,7 @@
ticker.mode.finalize_traitor(H.mind)
for(var/mob/living/silicon/A in player_list)
ticker.mode.traitors += A.mind
- A.mind.special_role = "traitor"
+ A.mind.special_role = SPECIAL_ROLE_TRAITOR
var/datum/objective/new_objective = new
new_objective.owner = A
new_objective.explanation_text = objective
@@ -2566,8 +2564,7 @@
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","EgL")
for(var/obj/machinery/door/airlock/W in airlocks)
- // TODO: Tie into space manager
- if((W.z in config.station_levels) && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison))
+ if(is_station_level(W.z) && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison))
W.req_access = list()
message_admins("[key_name_admin(usr)] activated Egalitarian Station mode")
command_announcement.Announce("Centcomm airlock control override activated. Please take this time to get acquainted with your coworkers.", new_sound = 'sound/AI/commandreport.ogg')
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index 2c930080edc..db5296619c6 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -373,8 +373,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
for(var/I in singularities)
var/obj/singularity/S = I
- // TODO: Tie into space manager
- if(S.z == ZLEVEL_CENTCOMM || S.z >= MAX_Z)
+ if(!is_level_reachable(S.z))
continue
qdel(S)
log_admin("[key_name(src)] has deleted all Singularities and Tesla orbs.")
diff --git a/code/modules/admin/verbs/honksquad.dm b/code/modules/admin/verbs/honksquad.dm
index 1b49cb4c294..8d4526da1a4 100644
--- a/code/modules/admin/verbs/honksquad.dm
+++ b/code/modules/admin/verbs/honksquad.dm
@@ -92,7 +92,7 @@ var/global/sent_honksquad = 0
//Creates mind stuff.
new_honksquad.mind_initialize()
new_honksquad.mind.assigned_role = "MODE"
- new_honksquad.mind.special_role = "HONKsquad"
+ new_honksquad.mind.special_role = SPECIAL_ROLE_HONKSQUAD
ticker.mode.traitors |= new_honksquad.mind//Adds them to current traitor list. Which is really the extra antagonist list.
new_honksquad.equip_honksquad(honk_leader_selected)
return new_honksquad
diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm
index 8da22a71b62..1e5340ad616 100644
--- a/code/modules/admin/verbs/one_click_antag.dm
+++ b/code/modules/admin/verbs/one_click_antag.dm
@@ -402,7 +402,7 @@ client/proc/one_click_antag()
//Creates mind stuff.
new_syndicate_commando.mind_initialize()
new_syndicate_commando.mind.assigned_role = "MODE"
- new_syndicate_commando.mind.special_role = "Syndicate Commando"
+ new_syndicate_commando.mind.special_role = SPECIAL_ROLE_SYNDICATE_DEATHSQUAD
//Adds them to current traitor list. Which is really the extra antagonist list.
ticker.mode.traitors += new_syndicate_commando.mind
diff --git a/code/modules/admin/verbs/onlyone.dm b/code/modules/admin/verbs/onlyone.dm
index 6723299c5a8..907fcb92913 100644
--- a/code/modules/admin/verbs/onlyone.dm
+++ b/code/modules/admin/verbs/onlyone.dm
@@ -15,7 +15,7 @@
A.copy_to(H)
ticker.mode.traitors += H.mind
- H.mind.special_role = "traitor"
+ H.mind.special_role = SPECIAL_ROLE_TRAITOR
var/datum/objective/hijack/hijack_objective = new
hijack_objective.owner = H.mind
diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm
index 660a1c8f199..957070eae8e 100644
--- a/code/modules/admin/verbs/playsound.dm
+++ b/code/modules/admin/verbs/playsound.dm
@@ -81,8 +81,7 @@ var/list/sounds_cache = list()
for(var/O in global_intercoms)
var/obj/item/device/radio/intercom/I = O
- // TODO: Tie into space manager
- if(I.z != ZLEVEL_STATION && !ignore_z)
+ if(!is_station_level(I.z) && !ignore_z)
continue
if(!I.on && !ignore_power)
continue
diff --git a/code/modules/admin/verbs/striketeam.dm b/code/modules/admin/verbs/striketeam.dm
index e76545f4748..5ecb78bb7f2 100644
--- a/code/modules/admin/verbs/striketeam.dm
+++ b/code/modules/admin/verbs/striketeam.dm
@@ -115,7 +115,7 @@ var/global/sent_strike_team = 0
//Creates mind stuff.
new_commando.mind_initialize()
new_commando.mind.assigned_role = "MODE"
- new_commando.mind.special_role = "Death Commando"
+ new_commando.mind.special_role = SPECIAL_ROLE_DEATHSQUAD
ticker.mode.traitors |= new_commando.mind//Adds them to current traitor list. Which is really the extra antagonist list.
new_commando.equip_death_commando(leader_selected)
return new_commando
diff --git a/code/modules/admin/verbs/striketeam_syndicate.dm b/code/modules/admin/verbs/striketeam_syndicate.dm
index 3669ba2ba13..11174a83fc5 100644
--- a/code/modules/admin/verbs/striketeam_syndicate.dm
+++ b/code/modules/admin/verbs/striketeam_syndicate.dm
@@ -118,7 +118,7 @@ var/global/sent_syndicate_strike_team = 0
//Creates mind stuff.
new_syndicate_commando.mind_initialize()
new_syndicate_commando.mind.assigned_role = "MODE"
- new_syndicate_commando.mind.special_role = "Syndicate Commando"
+ new_syndicate_commando.mind.special_role = SPECIAL_ROLE_SYNDICATE_DEATHSQUAD
ticker.mode.traitors |= new_syndicate_commando.mind //Adds them to current traitor list. Which is really the extra antagonist list.
new_syndicate_commando.equip_syndicate_commando(syndicate_leader_selected)
qdel(spawn_location)
diff --git a/code/modules/admin/verbs/vox_raiders.dm b/code/modules/admin/verbs/vox_raiders.dm
index 251ec478381..0c5df7b4675 100644
--- a/code/modules/admin/verbs/vox_raiders.dm
+++ b/code/modules/admin/verbs/vox_raiders.dm
@@ -59,21 +59,6 @@ var/global/vox_tick = 1
W.registered_user = src
equip_to_slot_or_del(W, slot_wear_id)
-/*
- var/obj/item/weapon/implant/cortical/I = new(src)
- I.imp_in = src
- I.implanted = 1
-
- if(ticker.mode && ( istype(ticker.mode,/datum/game_mode/vox/heist) ) )
- var/datum/game_mode/vox/heist/M = ticker.mode
- M.cortical_stacks += I
- M.raiders[mind] = I
- else if(ticker.mode && ( istype(ticker.mode,/datum/game_mode/vox/trade) ) )
- var/datum/game_mode/vox/trade/M = ticker.mode
- M.cortical_stacks += I
- M.traders[mind] = I
-
-*/
vox_tick++
if(vox_tick > 4) vox_tick = 1
diff --git a/code/modules/arcade/claw_game.dm b/code/modules/arcade/claw_game.dm
index 9d423383b08..e0fa547b5fc 100644
--- a/code/modules/arcade/claw_game.dm
+++ b/code/modules/arcade/claw_game.dm
@@ -19,8 +19,7 @@
'icons/obj/arcade_images/prizeorbs.png')
/obj/machinery/arcade/claw/New()
- src.addAtProcessing()
-
+ ..()
machine_image = pick("_1", "_2")
update_icon()
diff --git a/code/modules/awaymissions/mission_code/wildwest.dm b/code/modules/awaymissions/mission_code/wildwest.dm
index 3db7ff86668..dd1afe83361 100644
--- a/code/modules/awaymissions/mission_code/wildwest.dm
+++ b/code/modules/awaymissions/mission_code/wildwest.dm
@@ -119,7 +119,7 @@
to_chat(user, "Your wish is granted, but at a terrible cost...")
to_chat(user, "The Wish Granter punishes you for your wickedness, claiming your soul and warping your body to match the darkness in your heart.")
ticker.mode.traitors += user.mind
- user.mind.special_role = "traitor"
+ user.mind.special_role = SPECIAL_ROLE_TRAITOR
var/datum/objective/hijack/hijack = new
hijack.owner = user.mind
user.mind.objectives += hijack
diff --git a/code/modules/awaymissions/zlevel.dm b/code/modules/awaymissions/zlevel.dm
index da6515a591d..b12ee063f2d 100644
--- a/code/modules/awaymissions/zlevel.dm
+++ b/code/modules/awaymissions/zlevel.dm
@@ -59,7 +59,7 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away
var/map = pick(potentialRandomZlevels)
var/file = file(map)
if(isfile(file))
- var/zlev = space_manager.add_new_zlevel(AWAY_MISSION, linkage = UNAFFECTED)
+ var/zlev = space_manager.add_new_zlevel(AWAY_MISSION, linkage = UNAFFECTED, traits = list(AWAY_LEVEL,BLOCK_TELEPORT))
space_manager.add_dirt(zlev)
maploader.load_map(file, z_offset = zlev)
late_setup_level(block(locate(1, 1, zlev), locate(world.maxx, world.maxy, zlev)))
diff --git a/code/modules/clothing/gloves/miscellaneous.dm b/code/modules/clothing/gloves/miscellaneous.dm
index db9de4df740..2b932df2dc1 100644
--- a/code/modules/clothing/gloves/miscellaneous.dm
+++ b/code/modules/clothing/gloves/miscellaneous.dm
@@ -20,7 +20,7 @@
/obj/item/clothing/gloves/combat
desc = "These tactical gloves are somewhat fire and impact resistant."
name = "combat gloves"
- icon_state = "black"
+ icon_state = "combat"
item_state = "swat_gl"
siemens_coefficient = 0
permeability_coefficient = 0.05
diff --git a/code/modules/clothing/head/misc.dm b/code/modules/clothing/head/misc.dm
index c6879cb2945..12dd84826ff 100644
--- a/code/modules/clothing/head/misc.dm
+++ b/code/modules/clothing/head/misc.dm
@@ -387,3 +387,14 @@
icon_state = "papersack_smile"
flags = BLOCKHAIR
flags_inv = HIDEFACE|HIDEEARS
+
+/obj/item/clothing/head/crown
+ name = "crown"
+ desc = "A crown fit for a king, a petty king maybe."
+ icon_state = "crown"
+ armor = list(melee = 15, bullet = 0, laser = 0, energy = 15, bomb = 0, bio = 0, rad = 0) //for a warrior king //energy cause gold is reflective //worse than sec helm overall
+
+/obj/item/clothing/head/crown/fancy
+ name = "magnificent crown"
+ desc = "A crown worn by only the highest emperors of the land."
+ icon_state = "fancycrown"
\ No newline at end of file
diff --git a/code/modules/clothing/spacesuits/rig/modules/ninja.dm b/code/modules/clothing/spacesuits/rig/modules/ninja.dm
index c50e9b1c6d3..6f9b1589e5a 100644
--- a/code/modules/clothing/spacesuits/rig/modules/ninja.dm
+++ b/code/modules/clothing/spacesuits/rig/modules/ninja.dm
@@ -115,8 +115,7 @@
to_chat(H, "You cannot teleport into solid walls.")
return 0*///Who the fuck cares? Ninjas in walls are cool.
- // TODO: Tie into space manager
- if(T.z in config.admin_levels)
+ if(!is_teleport_allowed(T.z))
to_chat(H, "You cannot use your teleporter on this Z-level.")
return 0
diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm
index d46d7f83d1d..29cdc893cdc 100644
--- a/code/modules/clothing/suits/armor.dm
+++ b/code/modules/clothing/suits/armor.dm
@@ -164,6 +164,12 @@
body_parts_covered = UPPER_TORSO|LOWER_TORSO
armor = list(melee = 50, bullet = 40, laser = 50, energy = 10, bomb = 25, bio = 0, rad = 0)
+/obj/item/clothing/suit/armor/vest/capcarapace/alt
+ name = "captain's parade jacket"
+ desc = "For when an armoured vest isn't fashionable enough."
+ icon_state = "capformal"
+ item_state = "capspacesuit"
+
/obj/item/clothing/suit/armor/riot
name = "Riot Suit"
desc = "A suit of armor with heavy padding to protect against melee attacks. Looks like it might impair movement."
diff --git a/code/modules/clothing/under/miscellaneous.dm b/code/modules/clothing/under/miscellaneous.dm
index c37d6340609..72d6fa0874f 100644
--- a/code/modules/clothing/under/miscellaneous.dm
+++ b/code/modules/clothing/under/miscellaneous.dm
@@ -463,6 +463,13 @@
item_color = "sundress"
body_parts_covered = UPPER_TORSO|LOWER_TORSO
+/obj/item/clothing/under/captainparade
+ name = "captain's parade uniform"
+ desc = "A captain's luxury-wear, for special occasions."
+ icon_state = "captain_parade"
+ item_state = "by_suit"
+ item_color = "captain_parade"
+
/obj/item/clothing/under/roman
name = "roman armor"
desc = "An ancient Roman armor. Made of metallic strips and leather straps."
diff --git a/code/modules/computer3/computers/camera.dm b/code/modules/computer3/computers/camera.dm
index 070015f4dc4..52001231647 100644
--- a/code/modules/computer3/computers/camera.dm
+++ b/code/modules/computer3/computers/camera.dm
@@ -181,8 +181,7 @@
//proc/camera_list(var/datum/file/camnet_key/key)
get_machines(var/datum/file/camnet_key/key)
- // TODO: Tie into space manager
- if(!computer || computer.z > ZLEVEL_DERELICT)
+ if(!computer || !is_away_level(computer.z))
return null
var/list/L = list()
diff --git a/code/modules/computer3/computers/communications.dm b/code/modules/computer3/computers/communications.dm
index d6575d3c143..5230a2c4953 100644
--- a/code/modules/computer3/computers/communications.dm
+++ b/code/modules/computer3/computers/communications.dm
@@ -59,8 +59,7 @@
Topic(var/href, var/list/href_list)
if(!interactable() || !computer.radio || ..(href,href_list) )
return
- // TODO: Tie into space manager
- if(!(computer.z in config.station_levels))
+ if(!is_station_level(computer.z))
to_chat(usr, "Unable to establish a connection: You're too far away from the station!")
return
diff --git a/code/modules/computer3/computers/law.dm b/code/modules/computer3/computers/law.dm
index 7534aa65932..533a600a4eb 100644
--- a/code/modules/computer3/computers/law.dm
+++ b/code/modules/computer3/computers/law.dm
@@ -24,8 +24,7 @@
attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob, params)
- // TODO: Tie into space manager
- if(user.z > ZLEVEL_DERELICT)
+ if(is_away_level(user.z))
to_chat(user, "Unable to establish a connection: You're too far away from the station!")
return
if(istype(module, /obj/item/weapon/aiModule))
diff --git a/code/modules/computer3/computers/medical.dm b/code/modules/computer3/computers/medical.dm
index 6e96b6728e7..462f031a3f7 100644
--- a/code/modules/computer3/computers/medical.dm
+++ b/code/modules/computer3/computers/medical.dm
@@ -49,8 +49,7 @@
scan = computer.cardslot.reader
if(!interactable())
return
- // TODO: Tie into space manager
- if(computer.z > ZLEVEL_DERELICT)
+ if(is_away_level(computer.z))
to_chat(usr, "Unable to establish a connection: You're too far away from the station!")
return
var/dat
diff --git a/code/modules/computer3/computers/prisoner.dm b/code/modules/computer3/computers/prisoner.dm
index 75b2302991f..9ec6152a9e0 100644
--- a/code/modules/computer3/computers/prisoner.dm
+++ b/code/modules/computer3/computers/prisoner.dm
@@ -43,8 +43,7 @@
if(!T.implanted) continue
var/loc_display = "Unknown"
var/mob/living/carbon/M = T.imp_in
- // TODO: Tie into space manager
- if(M.z == ZLEVEL_STATION && !istype(M.loc, /turf/space))
+ if(is_station_level(M.z) && !istype(M.loc, /turf/space))
var/turf/mob_loc = get_turf(M)
loc_display = mob_loc.loc
dat += "ID: [T.id] | Location: [loc_display]
"
diff --git a/code/modules/computer3/computers/robot.dm b/code/modules/computer3/computers/robot.dm
index a728c8993bf..1f6bd0fa054 100644
--- a/code/modules/computer3/computers/robot.dm
+++ b/code/modules/computer3/computers/robot.dm
@@ -31,8 +31,7 @@
interact()
- // TODO: Tie into space manager
- if(!interactable() || computer.z > ZLEVEL_DERELICT)
+ if(!interactable() || is_away_level(computer.z))
return
var/dat
if(src.temp)
diff --git a/code/modules/computer3/computers/security.dm b/code/modules/computer3/computers/security.dm
index d974101b33f..9ae324d70ac 100644
--- a/code/modules/computer3/computers/security.dm
+++ b/code/modules/computer3/computers/security.dm
@@ -57,8 +57,7 @@
if(!interactable())
return
- // TODO: Tie into space manager
- if(computer.z > ZLEVEL_DERELICT)
+ if(is_away_level(computer.z))
to_chat(usr, "Unable to establish a connection: You're too far away from the station!")
return
var/dat
diff --git a/code/modules/computer3/networking.dm b/code/modules/computer3/networking.dm
index 0fc1c966d1c..f55a63b0718 100644
--- a/code/modules/computer3/networking.dm
+++ b/code/modules/computer3/networking.dm
@@ -105,7 +105,7 @@
for(var/obj/O in radio_connection.devices)
if(istype(O,typekey))
T = get_turf(O)
- // TODO: Tie into space manager
+ // TODO: Make the radio system cooperate with the space manager
if(istype(O) && (subspace || (O.z == z_level))) // radio does not work across z-levels
result |= O
return result
diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm
index c7b9b3abdb6..24b97ef3fc2 100644
--- a/code/modules/customitems/item_defines.dm
+++ b/code/modules/customitems/item_defines.dm
@@ -306,6 +306,26 @@
icon_state = "beret_hos"
item_state = "beret_hos"
+/obj/item/clothing/head/pirate/fluff/stumpy //MrFroztee: Stumpy
+ name = "The Sobriety Skullcap"
+ desc = "A hat suited for the king of the pirates"
+ icon_state = "pirate"
+ item_state = "pirate"
+
+/obj/item/clothing/head/pirate/fluff/stumpy/New()
+ ..()
+ processing_objects.Add(src)
+
+/obj/item/clothing/head/pirate/fluff/stumpy/Destroy()
+ processing_objects.Remove(src)
+ return ..()
+
+/obj/item/clothing/head/pirate/fluff/stumpy/process()
+ if(ishuman(loc))
+ var/mob/living/carbon/human/H = loc
+ if(H.head == src)
+ H.slurring = max(3, H.slurring) //always slur
+
//////////// Suits ////////////
/obj/item/clothing/suit/storage/labcoat/fluff/aeneas_rinil //Socialsystem: Lynn Fea
name = "Robotics labcoat"
diff --git a/code/modules/events/alien_infestation.dm b/code/modules/events/alien_infestation.dm
index b6313a77a40..05054f468dd 100644
--- a/code/modules/events/alien_infestation.dm
+++ b/code/modules/events/alien_infestation.dm
@@ -17,8 +17,7 @@
/datum/event/alien_infestation/start()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
- // TODO: Tie into space manager
- if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
+ if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
if(temp_vent.parent.other_atmosmch.len > 50) //Stops Aliens getting stuck in small networks. See: Security, Virology
vents += temp_vent
diff --git a/code/modules/events/anomaly_bluespace.dm b/code/modules/events/anomaly_bluespace.dm
index f7db50694d6..65b005c2538 100644
--- a/code/modules/events/anomaly_bluespace.dm
+++ b/code/modules/events/anomaly_bluespace.dm
@@ -19,8 +19,7 @@
var/obj/item/device/radio/beacon/chosen
var/list/possible = list()
for(var/obj/item/device/radio/beacon/W in world)
- // TODO: Tie into space manager
- if(!(W.z in config.station_levels))
+ if(!is_station_level(W.z))
continue
possible += W
diff --git a/code/modules/events/brand_intelligence.dm b/code/modules/events/brand_intelligence.dm
index e51ad46f61a..d640bca8641 100644
--- a/code/modules/events/brand_intelligence.dm
+++ b/code/modules/events/brand_intelligence.dm
@@ -18,8 +18,7 @@
/datum/event/brand_intelligence/start()
for(var/obj/machinery/vending/V in machines)
- // TODO: Tie into space manager
- if(V.z != ZLEVEL_STATION) continue
+ if(!is_station_level(V.z)) continue
vendingMachines.Add(V)
if(!vendingMachines.len)
diff --git a/code/modules/events/disease_outbreak.dm b/code/modules/events/disease_outbreak.dm
index 0f44bf586ee..e8483ccc4ca 100644
--- a/code/modules/events/disease_outbreak.dm
+++ b/code/modules/events/disease_outbreak.dm
@@ -16,13 +16,14 @@
for(var/mob/living/carbon/human/H in shuffle(living_mob_list))
if(issmall(H)) //don't infect monkies; that's a waste
continue
+ if(!H.client)
+ continue
if(H.species.virus_immune) //don't let virus immune things get diseases they're not supposed to get.
continue
var/turf/T = get_turf(H)
if(!T)
continue
- // TODO: Tie into space manager
- if(T.z != ZLEVEL_STATION)
+ if(!is_station_level(T.z))
continue
var/foundAlready = 0 // don't infect someone that already has the virus
for(var/datum/disease/D in H.viruses)
diff --git a/code/modules/events/dust.dm b/code/modules/events/dust.dm
index 17b529f9bda..5ed631736dd 100644
--- a/code/modules/events/dust.dm
+++ b/code/modules/events/dust.dm
@@ -62,7 +62,7 @@
goal = locate(endx, endy, 1)
src.x = startx
src.y = starty
- src.z = ZLEVEL_STATION
+ src.z = level_name_to_num(MAIN_STATION)
spawn(0)
walk_towards(src, goal, 1)
return
diff --git a/code/modules/events/grid_check.dm b/code/modules/events/grid_check.dm
index 479a0ea162e..5a892efb691 100644
--- a/code/modules/events/grid_check.dm
+++ b/code/modules/events/grid_check.dm
@@ -22,8 +22,7 @@
for(var/obj/machinery/power/smes/S in machines)
var/area/current_area = get_area(S)
- // TODO: Tie into space manager
- if(current_area.type in skipped_areas || !(S.z in config.station_levels))
+ if(current_area.type in skipped_areas || !is_station_level(S.z))
continue
S.last_charge = S.charge
S.last_output_attempt = S.output_attempt
@@ -36,8 +35,7 @@
for(var/obj/machinery/power/apc/C in apcs)
var/area/current_area = get_area(C)
- // TODO: Tie into space manager
- if(current_area.type in skipped_areas_apc || !(C.z in config.station_levels))
+ if(current_area.type in skipped_areas_apc || !is_station_level(C.z))
continue
if(C.cell)
C.cell.charge = 0
@@ -50,15 +48,13 @@
command_announcement.Announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
for(var/obj/machinery/power/apc/C in apcs)
var/area/current_area = get_area(C)
- // TODO: Tie into space manager
- if(current_area.type in skipped_areas_apc || !(C.z in config.station_levels))
+ if(current_area.type in skipped_areas_apc || !is_station_level(C.z))
continue
if(C.cell)
C.cell.charge = C.cell.maxcharge
for(var/obj/machinery/power/smes/S in machines)
var/area/current_area = get_area(S)
- // TODO: Tie into space manager
- if(current_area.type in skipped_areas || !(S.z in config.station_levels))
+ if(current_area.type in skipped_areas || !is_station_level(S.z))
continue
S.charge = S.last_charge
S.output_attempt = S.last_output_attempt
@@ -70,8 +66,7 @@
if(announce)
command_announcement.Announce("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
for(var/obj/machinery/power/smes/S in machines)
- // TODO: Tie into space manager
- if(S.z != ZLEVEL_STATION)
+ if(!is_station_level(S.z))
continue
S.charge = S.capacity
S.output_level = S.output_level_max
diff --git a/code/modules/events/holidays/Christmas.dm b/code/modules/events/holidays/Christmas.dm
index 1d5a4d9e659..e3772fa78b5 100644
--- a/code/modules/events/holidays/Christmas.dm
+++ b/code/modules/events/holidays/Christmas.dm
@@ -1,7 +1,6 @@
/proc/Christmas_Game_Start()
for(var/obj/structure/flora/tree/pine/xmas in world)
- // TODO: Tie into space manager
- if(!(xmas.z in config.station_levels)) continue
+ if(!is_station_level(xmas.z)) continue
for(var/turf/simulated/floor/T in orange(1,xmas))
for(var/i=1,i<=rand(1,5),i++)
new /obj/item/weapon/a_gift(T)
diff --git a/code/modules/events/holidays/Holidays.dm b/code/modules/events/holidays/Holidays.dm
index 8b219e77d8a..107767455f6 100644
--- a/code/modules/events/holidays/Holidays.dm
+++ b/code/modules/events/holidays/Holidays.dm
@@ -171,7 +171,7 @@ var/global/Holiday = null
*/
/* var/list/obj/containers = list()
for(var/obj/item/weapon/storage/S in world)
- if(!(S.z in config.station_levels)) continue
+ if(!is_station_level(S.z)) continue
containers += S
message_admins("\blue DEBUG: Event: Egg spawned at [Egg.loc] ([Egg.x],[Egg.y],[Egg.z])")*/
diff --git a/code/modules/events/radiation_storm.dm b/code/modules/events/radiation_storm.dm
index 54a2bb41bb9..7968e2493cf 100644
--- a/code/modules/events/radiation_storm.dm
+++ b/code/modules/events/radiation_storm.dm
@@ -24,8 +24,7 @@
command_announcement.Announce("High levels of radiation detected near the station. Please evacuate into one of the shielded maintenance tunnels.", "Anomaly Alert", new_sound = 'sound/AI/radiation.ogg')
for(var/area/A in world)
- // TODO: Tie into space manager
- if(!(A.z in config.station_levels) || is_safe_zone(A))
+ if(!is_station_level(A.z) || is_safe_zone(A))
continue
A.radiation_alert()
@@ -43,8 +42,7 @@
var/turf/T = get_turf(H)
if(!T)
continue
- // TODO: Tie into space manager
- if(!(T.z in config.station_levels) || is_safe_zone(T.loc))
+ if(!is_station_level(T.z) || is_safe_zone(T.loc))
continue
if(istype(H,/mob/living/carbon/human))
@@ -63,8 +61,7 @@
command_announcement.Announce("The station has passed the radiation belt. Please report to medbay if you experience any unusual symptoms. Maintenance will lose all access again shortly.", "Anomaly Alert")
for(var/area/A in world)
- // TODO: Tie into space manager
- if(!(A.z in config.station_levels) || is_safe_zone(A))
+ if(!is_station_level(A.z) || is_safe_zone(A))
continue
A.reset_radiation_alert()
diff --git a/code/modules/events/rogue_drones.dm b/code/modules/events/rogue_drones.dm
index 455312baa99..9b7386fe470 100644
--- a/code/modules/events/rogue_drones.dm
+++ b/code/modules/events/rogue_drones.dm
@@ -41,7 +41,7 @@
var/datum/effect/system/spark_spread/sparks = new /datum/effect/system/spark_spread()
sparks.set_up(3, 0, D.loc)
sparks.start()
- D.z = ZLEVEL_CENTCOMM
+ D.z = level_name_to_num(CENTCOMM)
D.has_loot = 0
qdel(D)
diff --git a/code/modules/events/slaughterevent.dm b/code/modules/events/slaughterevent.dm
index c2bac38a653..3a7464baa8c 100644
--- a/code/modules/events/slaughterevent.dm
+++ b/code/modules/events/slaughterevent.dm
@@ -36,7 +36,7 @@
S.holder = holder
player_mind.transfer_to(S)
player_mind.assigned_role = "Slaughter Demon"
- player_mind.special_role = "Slaughter Demon"
+ player_mind.special_role = SPECIAL_ROLE_SLAUGHTER_DEMON
message_admins("[key_of_slaughter] has been made into a Slaughter Demon by an event.")
log_game("[key_of_slaughter] was spawned as a Slaughter Demon by an event.")
return 1
diff --git a/code/modules/events/spider_infestation.dm b/code/modules/events/spider_infestation.dm
index 2c46fc8dffa..2b3ffb799df 100644
--- a/code/modules/events/spider_infestation.dm
+++ b/code/modules/events/spider_infestation.dm
@@ -16,8 +16,7 @@
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
- // TODO: Tie into space manager
- if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
+ if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
if(temp_vent.parent.other_atmosmch.len > 50)
vents += temp_vent
diff --git a/code/modules/events/spontaneous_appendicitis.dm b/code/modules/events/spontaneous_appendicitis.dm
index 964b3c9e50d..1a6403a49dd 100644
--- a/code/modules/events/spontaneous_appendicitis.dm
+++ b/code/modules/events/spontaneous_appendicitis.dm
@@ -2,12 +2,14 @@
for(var/mob/living/carbon/human/H in shuffle(living_mob_list))
if(issmall(H)) //don't infect monkies; that's a waste.
continue
+ if(!H.client)
+ continue
if(H.species.virus_immune) //don't count things that are virus immune; they'll just get picked and auto-cure
continue
var/foundAlready = 0 //don't infect someone that already has the virus
for(var/datum/disease/D in H.viruses)
foundAlready = 1
- if(H.stat == 2 || foundAlready)
+ if(H.stat == DEAD || foundAlready)
continue
var/datum/disease/D = new /datum/disease/appendicitis
diff --git a/code/modules/events/undead.dm b/code/modules/events/undead.dm
index 3399c69c979..f705b63611c 100644
--- a/code/modules/events/undead.dm
+++ b/code/modules/events/undead.dm
@@ -9,8 +9,7 @@
RS.start()
RS.kill()
for(var/area/A)
- // TODO: Tie into space manager
- if(!(A.z in config.station_levels)) continue //Spook on main station only.
+ if(!is_station_level(A.z)) continue //Spook on main station only.
if(A.luminosity) continue
// if(A.lighting_space) continue
if(A.type == /area) continue
diff --git a/code/modules/events/vent_clog.dm b/code/modules/events/vent_clog.dm
index de4e62215a8..e5679764a39 100644
--- a/code/modules/events/vent_clog.dm
+++ b/code/modules/events/vent_clog.dm
@@ -11,8 +11,7 @@
/datum/event/vent_clog/setup()
endWhen = rand(25, 100)
for(var/obj/machinery/atmospherics/unary/vent_scrubber/temp_vent in machines)
- // TODO: Tie into space manager
- if((temp_vent.loc.z in config.station_levels))
+ if(is_station_level(temp_vent.loc.z))
if(temp_vent.parent.other_atmosmch.len > 50)
vents += temp_vent
diff --git a/code/modules/events/wormholes.dm b/code/modules/events/wormholes.dm
index 1f3aa1355cd..398994f972d 100644
--- a/code/modules/events/wormholes.dm
+++ b/code/modules/events/wormholes.dm
@@ -13,8 +13,7 @@
/datum/event/wormholes/start()
for(var/turf/simulated/floor/T in world)
- // TODO: Tie into space manager
- if((T.z in config.station_levels))
+ if(is_station_level(T.z))
pick_turfs += T
for(var/i in 1 to number_of_wormholes)
diff --git a/code/modules/holiday/christmas.dm b/code/modules/holiday/christmas.dm
index c90e97d60c1..f9fbaf81b1d 100644
--- a/code/modules/holiday/christmas.dm
+++ b/code/modules/holiday/christmas.dm
@@ -1,7 +1,6 @@
/datum/holiday/xmas/celebrate()
for(var/obj/structure/flora/tree/pine/xmas in world)
- // TODO: Tie into space manager
- if(!(xmas.z in config.station_levels)) continue
+ if(!is_station_level(xmas.z)) continue
for(var/turf/simulated/floor/T in orange(1,xmas))
for(var/i=1,i<=rand(1,5),i++)
new /obj/item/weapon/a_gift(T)
diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm
index ec7a5aca25f..994f141d373 100644
--- a/code/modules/hydroponics/seed.dm
+++ b/code/modules/hydroponics/seed.dm
@@ -376,8 +376,7 @@
// Bluespace tomato code copied over from grown.dm.
if(get_trait(TRAIT_TELEPORTING))
- // TODO: Tie into space manager
- if(target.z in config.admin_levels)
+ if(!is_teleport_allowed(target.z))
return 1
//Plant potency determines radius of teleport.
diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm
index faf11c70825..2c71d1aebbd 100644
--- a/code/modules/mining/equipment_locker.dm
+++ b/code/modules/mining/equipment_locker.dm
@@ -21,6 +21,7 @@
var/point_upgrade = 1
var/list/ore_values = list(("sand" = 1), ("iron" = 1), ("plasma" = 15), ("silver" = 16), ("gold" = 18), ("uranium" = 30), ("diamond" = 50), ("bluespace crystal" = 50), ("bananium" = 60), ("tranquillite" = 60))
var/list/supply_consoles = list("Science", "Robotics", "Research Director's Desk", "Mechanic", "Engineering" = list("metal", "glass", "plasma"), "Chief Engineer's Desk" = list("metal", "glass", "plasma"), "Atmospherics" = list("metal", "glass", "plasma"), "Bar" = list("uranium", "plasma"), "Virology" = list("plasma", "uranium", "gold"))
+ speed_process = 1
/obj/machinery/mineral/ore_redemption/New()
..()
@@ -528,8 +529,7 @@
/obj/item/device/wormhole_jaunter/attack_self(mob/user as mob)
var/turf/device_turf = get_turf(user)
- // TODO: Tie into space manager
- if(!device_turf||device_turf.z==ZLEVEL_CENTCOMM||device_turf.z>=ZLEVEL_EMPTY)
+ if(!device_turf||is_teleport_allowed(device_turf.z))
to_chat(user, "You're having difficulties getting the [src.name] to work.")
return
else
@@ -537,8 +537,7 @@
var/list/L = list()
for(var/obj/item/device/radio/beacon/B in world)
var/turf/T = get_turf(B)
- // TODO: Tie into space manager
- if(T.z == ZLEVEL_STATION)
+ if(is_station_level(T.z))
L += B
if(!L.len)
to_chat(user, "The [src.name] failed to create a wormhole.")
diff --git a/code/modules/mining/machine_stacking.dm b/code/modules/mining/machine_stacking.dm
index 44d7b037869..20d6a1b984a 100644
--- a/code/modules/mining/machine_stacking.dm
+++ b/code/modules/mining/machine_stacking.dm
@@ -69,6 +69,7 @@
var/stack_amt = 50; //ammount to stack before releassing
input_dir = EAST
output_dir = WEST
+ speed_process = 1
/obj/machinery/mineral/stacking_machine/proc/process_sheet(obj/item/stack/sheet/inp)
if(!(inp.type in stack_list)) //It's the first of this sheet added
@@ -89,4 +90,4 @@
if(T)
for(var/obj/item/stack/sheet/S in T)
process_sheet(S)
-
+ CHECK_TICK
\ No newline at end of file
diff --git a/code/modules/mining/machine_unloading.dm b/code/modules/mining/machine_unloading.dm
index 5214c8caec8..a5a30493faa 100644
--- a/code/modules/mining/machine_unloading.dm
+++ b/code/modules/mining/machine_unloading.dm
@@ -9,6 +9,7 @@
anchored = 1.0
input_dir = WEST
output_dir = EAST
+ speed_process = 1
/obj/machinery/mineral/unloading_machine/process()
var/turf/T = get_step(src,input_dir)
@@ -21,8 +22,11 @@
limit++
if(limit>=10)
return
+ CHECK_TICK
+ CHECK_TICK
for(var/obj/item/I in T)
unload_mineral(I)
limit++
if(limit>=10)
- return
\ No newline at end of file
+ return
+ CHECK_TICK
\ No newline at end of file
diff --git a/code/modules/mining/mint.dm b/code/modules/mining/mint.dm
index 02b69a160d7..ff78dfff274 100644
--- a/code/modules/mining/mint.dm
+++ b/code/modules/mining/mint.dm
@@ -21,6 +21,7 @@
var/processing = 0
var/chosen = "metal" //which material will be used to make coins
var/coinsToProduce = 10
+ speed_process = 1
/obj/machinery/mineral/mint/process()
var/turf/T = get_step(src,input_dir)
@@ -28,29 +29,28 @@
for(var/obj/item/stack/sheet/O in T)
if(istype(O, /obj/item/stack/sheet/mineral/gold))
amt_gold += 100 * O.amount
- O.loc = null
+ qdel(O)
if(istype(O, /obj/item/stack/sheet/mineral/silver))
amt_silver += 100 * O.amount
- O.loc = null
+ qdel(O)
if(istype(O, /obj/item/stack/sheet/mineral/diamond))
amt_diamond += 100 * O.amount
- O.loc = null
+ qdel(O)
if(istype(O, /obj/item/stack/sheet/mineral/plasma))
amt_plasma += 100 * O.amount
- O.loc = null
+ qdel(O)
if(istype(O, /obj/item/stack/sheet/mineral/uranium))
amt_uranium += 100 * O.amount
- O.loc = null
+ qdel(O)
if(istype(O, /obj/item/stack/sheet/metal))
amt_iron += 100 * O.amount
- O.loc = null
+ qdel(O)
if(istype(O, /obj/item/stack/sheet/mineral/bananium))
amt_clown += 100 * O.amount
- O.loc = null
+ qdel(O)
if(istype(O, /obj/item/stack/sheet/mineral/tranquillite))
amt_mime += 100 * O.amount
- O.loc = null
- return
+ qdel(O)
/obj/machinery/mineral/mint/attack_hand(user as mob) //TODO: Adamantine coins! -Durandan
diff --git a/code/modules/mining/ore.dm b/code/modules/mining/ore.dm
index 2a6f5555555..ec36988cb20 100644
--- a/code/modules/mining/ore.dm
+++ b/code/modules/mining/ore.dm
@@ -240,8 +240,7 @@
/obj/item/weapon/ore/New()
pixel_x = rand(0,16)-8
pixel_y = rand(0,8)-8
- // TODO: Tie into space manager
- if(src.z == ZLEVEL_ASTEROID)
+ if(is_mining_level(src.z))
score_oremined++ //When ore spawns, increment score. Only include ore spawned on mining asteroid (No Clown Planet)
/obj/item/weapon/ore/ex_act()
diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm
index 124a1120df6..6797744fbf6 100644
--- a/code/modules/mob/living/carbon/alien/alien.dm
+++ b/code/modules/mob/living/carbon/alien/alien.dm
@@ -29,7 +29,7 @@
ventcrawler = 2
/mob/living/carbon/alien/New()
- verbs += /mob/living/carbon/verb/mob_sleep
+ verbs += /mob/living/verb/mob_sleep
verbs += /mob/living/verb/lay_down
internal_organs += new /obj/item/organ/internal/brain/xeno
internal_organs += new /obj/item/organ/internal/xenos/hivenode
diff --git a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm
index 2038704023b..ae03f103e86 100644
--- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm
+++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm
@@ -97,7 +97,7 @@
ticker.mode.xenos += new_xeno.mind
new_xeno.mind.name = new_xeno.name
new_xeno.mind.assigned_role = "MODE"
- new_xeno.mind.special_role = "Alien"
+ new_xeno.mind.special_role = SPECIAL_ROLE_XENOMORPH
new_xeno << sound('sound/voice/hiss5.ogg',0,0,0,100)//To get the player's attention
if(gib_on_success)
diff --git a/code/modules/mob/living/carbon/human/interactive/interactive.dm b/code/modules/mob/living/carbon/human/interactive/interactive.dm
index d3f8a66e7a0..1862062e4cf 100644
--- a/code/modules/mob/living/carbon/human/interactive/interactive.dm
+++ b/code/modules/mob/living/carbon/human/interactive/interactive.dm
@@ -364,7 +364,7 @@
traitorType = inPers
ticker.mode.traitors += mind
- mind.special_role = "traitor"
+ mind.special_role = SPECIAL_ROLE_TRAITOR
var/datum/mindslaves/slaved = new()
slaved.masters += mind
mind.som = slaved
diff --git a/code/modules/mob/living/carbon/human/species/golem.dm b/code/modules/mob/living/carbon/human/species/golem.dm
index d5a0125f052..024172abe8b 100644
--- a/code/modules/mob/living/carbon/human/species/golem.dm
+++ b/code/modules/mob/living/carbon/human/species/golem.dm
@@ -45,7 +45,7 @@
/datum/species/golem/handle_post_spawn(var/mob/living/carbon/human/H)
if(H.mind)
H.mind.assigned_role = "Golem"
- H.mind.special_role = "Golem"
+ H.mind.special_role = SPECIAL_ROLE_GOLEM
H.real_name = "adamantine golem ([rand(1, 1000)])"
H.name = H.real_name
H.equip_to_slot_or_del(new /obj/item/clothing/under/golem(H), slot_w_uniform)
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 60c26dc4a50..7905c8f06fc 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -18,10 +18,7 @@
var/turf/T = get_turf(src)
if(!T)
return 0
- // TODO: Tie into space manager
- if(T.z == ZLEVEL_CENTCOMM) //dont detect mobs on centcomm
- return 0
- if(T.z >= MAX_Z)
+ if(!is_level_reachable(T.z))
return 0
if(user != null && src == user)
return 0
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index 9d64f278b4a..26221311a03 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -639,15 +639,13 @@ var/list/ai_verbs_default = list(
if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO))
return
- var/ai_allowed_Zlevel = list(ZLEVEL_STATION,ZLEVEL_TELECOMMS,ZLEVEL_ASTEROID)
var/d
var/area/bot_area
d += "Query network status
"
d += "Name | Status | Location | Control |
"
for(var/mob/living/simple_animal/bot/Bot in simple_animal_list)
- // TODO: Tie into space manager
- if((Bot.z in ai_allowed_Zlevel) && !Bot.remote_disabled) //Only non-emagged bots on the allowed Z-level are detected!
+ if(is_ai_allowed(Bot.z) && !Bot.remote_disabled) //Only non-emagged bots on the allowed Z-level are detected!
bot_area = get_area(Bot)
d += "| [Bot.hacked ? "(!) [Bot.name]" : Bot.name] ([Bot.model]) | "
//If the bot is on, it will display the bot's current mode status. If the bot is not mode, it will just report "Idle". "Inactive if it is not on at all.
@@ -1106,7 +1104,7 @@ var/list/ai_verbs_default = list(
to_chat(user, "No intelligence patterns detected.")//No more magical carding of empty cores, AI RETURN TO BODY!!!11
return
- if(mind.special_role == "malfunction") //AI MALF!!
+ if(mind.special_role == SPECIAL_ROLE_MALF) //AI MALF!!
to_chat(user, "ERROR: Remote transfer interface disabled.")//Do ho ho ho~
return
@@ -1149,4 +1147,4 @@ var/list/ai_verbs_default = list(
rendered = "Relayed Speech: [name_used] [speaking.format_message(text, verb)]"
else
rendered = "Relayed Speech: [name_used] [verb], \"[text]\""
- show_message(rendered, 2)
\ No newline at end of file
+ show_message(rendered, 2)
diff --git a/code/modules/mob/living/silicon/pai/software_modules.dm b/code/modules/mob/living/silicon/pai/software_modules.dm
index 6d4c3a45150..adc0e54e661 100644
--- a/code/modules/mob/living/silicon/pai/software_modules.dm
+++ b/code/modules/mob/living/silicon/pai/software_modules.dm
@@ -123,6 +123,7 @@
on_ui_interact(mob/living/silicon/pai/user, datum/nanoui/ui=null, force_open=1)
var/data[0]
+ data_core.get_manifest_json()
data["manifest"] = PDA_Manifest
ui = nanomanager.try_update_ui(user, user, id, ui, data, force_open)
@@ -499,8 +500,7 @@
/mob/living/silicon/pai/proc/hackloop()
var/turf/T = get_turf_or_move(src.loc)
for(var/mob/living/silicon/ai/AI in player_list)
- // TODO: Tie into space manager
- if(!T || !(T.z in config.contact_levels))
+ if(!T || !is_station_contact(T.z))
break
if(T.loc)
to_chat(AI, "Network Alert: Brute-force encryption crack in progress in [T.loc].")
diff --git a/code/modules/mob/living/silicon/robot/laws.dm b/code/modules/mob/living/silicon/robot/laws.dm
index 2a62a0b1cc4..0398172023c 100644
--- a/code/modules/mob/living/silicon/robot/laws.dm
+++ b/code/modules/mob/living/silicon/robot/laws.dm
@@ -21,7 +21,7 @@
photosync()
to_chat(src, "Laws synced with AI, be sure to note any changes.")
// TODO: Update to new antagonist system.
- if(mind && mind.special_role == "traitor" && mind.original == src)
+ if(mind && mind.special_role == SPECIAL_ROLE_TRAITOR && mind.original == src)
to_chat(src, "Remember, your AI does NOT share or know about your law 0.")
else
to_chat(src, "No AI selected to sync laws with, disabling lawsync protocol.")
@@ -30,7 +30,7 @@
to_chat(who, "Obey these laws:")
laws.show_laws(who)
// TODO: Update to new antagonist system.
- if(mind && (mind.special_role == "traitor" && mind.original == src) && connected_ai)
+ if(mind && (mind.special_role == SPECIAL_ROLE_TRAITOR && mind.original == src) && connected_ai)
to_chat(who, "Remember, [connected_ai.name] is technically your master, but your objective comes first.")
else if(connected_ai)
to_chat(who, "Remember, [connected_ai.name] is your master, other AIs can be ignored.")
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 8cb7fde6ffc..c0797eebb6a 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -1380,7 +1380,7 @@ var/list/robot_verbs_default = list(
var/mob/M = pick(borg_candidates)
M.mind.transfer_to(src)
M.mind.assigned_role = "MODE"
- M.mind.special_role = "Death Commando"
+ M.mind.special_role = SPECIAL_ROLE_DEATHSQUAD
ticker.mode.traitors |= M.mind // Adds them to current traitor list. Which is really the extra antagonist list.
key = M.key
else
diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm
index 1e9f3d8add5..a67744ac63a 100644
--- a/code/modules/mob/mob_helpers.dm
+++ b/code/modules/mob/mob_helpers.dm
@@ -50,8 +50,21 @@ proc/isNonCrewAntag(A)
var/mob/living/carbon/C = A
var/special_role = C.mind.special_role
- var/list/crew_roles = list("traitor", "Changeling", "Vampire", "Cultist", "Head Revolutionary", "Revolutionary", "malfunctioning AI", "Shadowling", "loyalist", "mutineer", "Response Team")
- if((special_role in crew_roles))
+ var/list/crew_roles = list(
+ SPECIAL_ROLE_BLOB,
+ SPECIAL_ROLE_CULTIST,
+ SPECIAL_ROLE_CHANGELING,
+ SPECIAL_ROLE_ERT,
+ SPECIAL_ROLE_HEAD_REV,
+ SPECIAL_ROLE_MALF,
+ SPECIAL_ROLE_REV,
+ SPECIAL_ROLE_SHADOWLING,
+ SPECIAL_ROLE_SHADOWLING_THRALL,
+ SPECIAL_ROLE_TRAITOR,
+ SPECIAL_ROLE_VAMPIRE,
+ SPECIAL_ROLE_VAMPIRE_THRALL
+ )
+ if(special_role in crew_roles)
return 0
return 1
@@ -340,23 +353,24 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HARM)
hud_used.action_intent.icon_state = "help"
-/mob/living/carbon/verb/mob_sleep()
+/mob/living/verb/mob_sleep()
set name = "Sleep"
set category = "IC"
- if(usr.sleeping)
- to_chat(usr, "\red You are already sleeping")
+ if(sleeping)
+ to_chat(src, "You are already sleeping.")
return
else
- if(alert(src,"You sure you want to sleep for a while?","Sleep","Yes","No") == "Yes")
- usr.sleeping = 20 //Short nap
+ if(alert(src, "You sure you want to sleep for a while?", "Sleep", "Yes", "No") == "Yes")
+ SetSleeping(20) //Short nap
/mob/living/verb/lay_down()
set name = "Rest"
set category = "IC"
resting = !resting
- to_chat(src, "\blue You are now [resting ? "resting" : "getting up"]")
+ update_canmove()
+ to_chat(src, "You are now [resting ? "resting" : "getting up"].")
/proc/is_blind(A)
if(iscarbon(A))
diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm
index dc0916ee344..cf8a7f05574 100644
--- a/code/modules/mob/new_player/preferences_setup.dm
+++ b/code/modules/mob/new_player/preferences_setup.dm
@@ -211,6 +211,7 @@
icobase = H.species.icobase
if(H.species.bodyflags & HAS_TAIL)
coloured_tail = H.species.tail
+ qdel(H)
else
icobase = current_species.icobase
else
diff --git a/code/modules/nano/interaction/default.dm b/code/modules/nano/interaction/default.dm
index 50c2bd79143..cb00e6a12b3 100644
--- a/code/modules/nano/interaction/default.dm
+++ b/code/modules/nano/interaction/default.dm
@@ -41,8 +41,7 @@
// Prevents the AI from using Topic on admin levels (by for example viewing through the court/thunderdome cameras)
// unless it's on the same level as the object it's interacting with.
var/turf/T = get_turf(src_object)
- // TODO: Tie into space manager
- if(!T || !(z == T.z || (T.z in config.player_levels)))
+ if(!T || !(atoms_share_level(src,T) || is_level_reachable(T.z)))
return STATUS_CLOSE
// If an object is in view then we can interact with it
diff --git a/code/modules/nano/modules/crew_monitor.dm b/code/modules/nano/modules/crew_monitor.dm
index 65f5a9299ee..ce89f59947b 100644
--- a/code/modules/nano/modules/crew_monitor.dm
+++ b/code/modules/nano/modules/crew_monitor.dm
@@ -5,8 +5,7 @@
if(..())
return 1
var/turf/T = get_turf(nano_host())
- // TODO: Tie into space manager
- if(!T || !(T.z in config.player_levels))
+ if(!T || !is_level_reachable(T.z))
to_chat(usr, "Unable to establish a connection: You're too far away from the station!")
return 0
if(href_list["track"])
diff --git a/code/modules/pda/cart_apps.dm b/code/modules/pda/cart_apps.dm
index 1c407bd223c..30f732f48ae 100644
--- a/code/modules/pda/cart_apps.dm
+++ b/code/modules/pda/cart_apps.dm
@@ -316,8 +316,7 @@
if(shuttle_master.supply.mode == SHUTTLE_CALL)
supplyData["shuttle_moving"] = 1
- // TODO: Tie into space manager
- if(shuttle_master.supply.z != ZLEVEL_STATION)
+ if(!is_station_level(shuttle_master.supply.z))
supplyData["shuttle_loc"] = "station"
else
supplyData["shuttle_loc"] = "centcom"
diff --git a/code/modules/pda/messenger.dm b/code/modules/pda/messenger.dm
index 2a8ca83b218..6d7bbc90bd3 100644
--- a/code/modules/pda/messenger.dm
+++ b/code/modules/pda/messenger.dm
@@ -158,7 +158,7 @@
if(signal.data["done"])
useTC = 1
var/turf/pos = get_turf(P)
- // TODO: Tie into space manager
+ // TODO: Make the radio system cooperate with the space manager
if(pos.z in signal.data["level"])
useTC = 2
//Let's make this barely readable
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index b6eb99eb958..5800747d367 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -170,8 +170,7 @@
apcs -= src
if(malfai && operating)
if(ticker.mode.config_tag == "malfunction")
- // TODO: Tie into space manager
- if(src.z == ZLEVEL_STATION)
+ if(is_station_level(src.z))
ticker.mode:apcs--
area.power_light = 0
area.power_equip = 0
@@ -996,8 +995,7 @@
malfai.malfhacking = 0
locked = 1
if(ticker.mode.config_tag == "malfunction")
- // TODO: Tie into space manager
- if((src.z in config.station_levels)) //if(is_type_in_list(get_area(src), the_station_areas))
+ if(is_station_level(src.z)) //if(is_type_in_list(get_area(src), the_station_areas))
ticker.mode:apcs++
if(usr:parent)
src.malfai = usr:parent
@@ -1029,8 +1027,7 @@
if(malfai)
if(ticker.mode.config_tag == "malfunction")
- // TODO: Tie into space manager
- if((src.z in config.station_levels)) //if(is_type_in_list(get_area(src), the_station_areas))
+ if(is_station_level(src.z)) //if(is_type_in_list(get_area(src), the_station_areas))
operating ? ticker.mode:apcs++ : ticker.mode:apcs--
src.update()
@@ -1045,8 +1042,7 @@
if(!malf.can_shunt)
to_chat(malf, "You cannot shunt.")
return
- // TODO: Tie into space manager
- if(!(src.z in config.station_levels))
+ if(!is_station_level(src.z))
return
src.occupier = new /mob/living/silicon/ai(src,malf.laws,null,1)
src.occupier.adjustOxyLoss(malf.getOxyLoss())
@@ -1095,8 +1091,7 @@
/obj/machinery/power/apc/proc/ion_act()
//intended to be exactly the same as an AI malf attack
- // TODO: Tie into space manager
- if(!src.malfhack && (src.z in config.station_levels))
+ if(!src.malfhack && is_station_level(src.z))
if(prob(3))
src.locked = 1
if(src.cell.charge > 0)
@@ -1371,8 +1366,7 @@
/obj/machinery/power/apc/proc/set_broken()
if(malfai && operating)
if(ticker.mode.config_tag == "malfunction")
- // TODO: Tie into space manager
- if((src.z in config.station_levels)) //if(is_type_in_list(get_area(src), the_station_areas))
+ if(is_station_level(src.z)) //if(is_type_in_list(get_area(src), the_station_areas))
ticker.mode:apcs--
stat |= BROKEN
operating = 0
diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm
index ea633c7e78f..6468f813fa6 100644
--- a/code/modules/power/gravitygenerator.dm
+++ b/code/modules/power/gravitygenerator.dm
@@ -124,8 +124,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
O.main_part = null
qdel(O)
for(var/area/A in world)
- // TODO: Tie into space manager
- if(!(A.z in config.station_levels)) continue
+ if(!is_station_level(A.z)) continue
A.gravitychange(0,A)
shake_everyone()
return ..()
@@ -302,8 +301,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
investigate_log("was brought online and is now producing gravity for this level.", "gravity")
message_admins("The gravity generator was brought online. ([area.name])")
for(var/area/A in world)
- // TODO: Tie into space manager
- if(!(A.z in config.station_levels)) continue
+ if(!is_station_level(A.z)) continue
A.gravitychange(1,A)
else
if(gravity_in_level() == 1)
@@ -311,8 +309,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
investigate_log("was brought offline and there is now no gravity for this level.", "gravity")
message_admins("The gravity generator was brought offline with no backup generator. ([area.name])")
for(var/area/A in world)
- // TODO: Tie into space manager
- if(!(A.z in config.station_levels)) continue
+ if(!is_station_level(A.z)) continue
A.gravitychange(0,A)
update_icon()
@@ -380,7 +377,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
shake_camera(M, 15, 1)
M.playsound_local(our_turf, 'sound/effects/alert.ogg', 100, 1, 0.5)
-// TODO: Tie into space manager
+// TODO: Make the gravity generator cooperate with the space manager
/obj/machinery/gravity_generator/main/proc/gravity_in_level()
var/turf/T = get_turf(src)
if(!T)
@@ -389,7 +386,6 @@ var/const/GRAV_NEEDS_WRENCH = 3
return length(gravity_generators["[T.z]"])
return 0
-// TODO: Tie into space manager
/obj/machinery/gravity_generator/main/proc/update_list()
var/turf/T = get_turf(src.loc)
if(T)
diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm
index 75f88f9b751..4af4ccaeee4 100644
--- a/code/modules/power/smes.dm
+++ b/code/modules/power/smes.dm
@@ -433,8 +433,7 @@
return 1
/obj/machinery/power/smes/proc/ion_act()
- // TODO: Tie into space manager
- if(src.z in config.station_levels)
+ if(is_station_level(src.z))
if(prob(1)) //explosion
for(var/mob/M in viewers(src))
M.show_message("\red The [src.name] is making strange noises!", 3, "\red You hear sizzling electronics.", 2)
diff --git a/code/modules/projectiles/guns/energy/telegun.dm b/code/modules/projectiles/guns/energy/telegun.dm
index c280fe59903..7b94698f0e9 100644
--- a/code/modules/projectiles/guns/energy/telegun.dm
+++ b/code/modules/projectiles/guns/energy/telegun.dm
@@ -23,8 +23,7 @@
var/turf/T = get_turf(R)
if(!T)
continue
- // TODO: Tie into space manager
- if((T.z in config.admin_levels) || T.z > ZLEVEL_EMPTY)
+ if(!is_teleport_allowed(T.z))
continue
if(R.syndicate == 1)
continue
diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm
index cd562e00a48..0e1b7478cc8 100644
--- a/code/modules/projectiles/projectile/special.dm
+++ b/code/modules/projectiles/projectile/special.dm
@@ -276,17 +276,9 @@ obj/item/projectile/kinetic/New()
/obj/item/projectile/beam/wormhole/on_hit(atom/target)
if(ismob(target))
- var/turf/portal_destination = pick(orange(6, src))
- do_teleport(target, portal_destination)
- return ..()
- if(!gun)
- qdel(src)
- gun.create_portal(src)
-
-/obj/item/projectile/beam/wormhole/on_hit(atom/target)
- if(ismob(target))
- var/turf/portal_destination = pick(orange(6, src))
- do_teleport(target, portal_destination)
+ if(is_teleport_allowed(target.z))
+ var/turf/portal_destination = pick(orange(6, src))
+ do_teleport(target, portal_destination)
return ..()
if(!gun)
qdel(src)
diff --git a/code/modules/reagents/newchem/drinks.dm b/code/modules/reagents/newchem/drinks.dm
index 5f4dc5b0018..b1f789b7f22 100644
--- a/code/modules/reagents/newchem/drinks.dm
+++ b/code/modules/reagents/newchem/drinks.dm
@@ -201,6 +201,7 @@
result = "uplink"
required_reagents = list("rum" = 1, "vodka" = 1, "tequila" = 1, "whiskey" = 1, "synthanol" = 1)
result_amount = 5
+ mix_message = "The chemicals mix to create a shiny, orange substance."
/datum/reagent/ethanol/synthanol/synthnsoda
name = "Synth 'n Soda"
@@ -216,6 +217,7 @@
result = "synthnsoda"
required_reagents = list("synthanol" = 1, "cola" = 1)
result_amount = 2
+ mix_message = "The chemicals mix to create a smooth, fizzy substance."
/datum/reagent/ethanol/synthanol/synthignon
name = "Synthignon"
@@ -231,5 +233,6 @@
result = "synthignon"
required_reagents = list("synthanol" = 1, "wine" = 1)
result_amount = 2
+ mix_message = "The chemicals mix to create a fine, red substance."
// ROBOT ALCOHOL ENDS
diff --git a/code/modules/reagents/newchem/food.dm b/code/modules/reagents/newchem/food.dm
index 6909a60e2e5..7f529b6b815 100644
--- a/code/modules/reagents/newchem/food.dm
+++ b/code/modules/reagents/newchem/food.dm
@@ -142,7 +142,7 @@
/datum/reagent/mugwort/on_mob_life(mob/living/M)
if(ishuman(M) && M.mind)
- if(M.mind.special_role == "Wizard")
+ if(M.mind.special_role == SPECIAL_ROLE_WIZARD)
M.adjustToxLoss(-1*REM)
M.adjustOxyLoss(-1*REM)
M.adjustBruteLoss(-1*REM)
diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm
index b093048d5e5..6ff39d21b0d 100644
--- a/code/modules/recycling/conveyor2.dm
+++ b/code/modules/recycling/conveyor2.dm
@@ -17,6 +17,7 @@
var/list/affecting // the list of all items that will be moved this ptick
var/id = "" // the control ID - must match controller ID
var/verted = 1 // set to -1 to have the conveyour belt be inverted, so you can use the other corner icons
+ speed_process = 1
/obj/machinery/conveyor/centcom_auto
id = "round_end_belt"
@@ -105,15 +106,12 @@
use_power(100)
affecting = loc.contents - src // moved items will be all in loc
- spawn(1) // slight delay to prevent infinite propagation due to map order //TODO: please no spawn() in process(). It's a very bad idea
- var/items_moved = 0
- for(var/atom/movable/A in affecting)
- if(!A.anchored)
- if(A.loc == src.loc) // prevents the object from being affected if it's not currently here.
- step(A,movedir)
- items_moved++
- if(items_moved >= 10)
- break
+ sleep(1)
+ for(var/atom/movable/A in affecting)
+ if(!A.anchored)
+ if(A.loc == loc) // prevents the object from being affected if it's not currently here.
+ step(A,movedir)
+ CHECK_TICK
// attack with item, place item on conveyor
/obj/machinery/conveyor/attackby(var/obj/item/I, mob/user, params)
@@ -183,7 +181,7 @@
var/list/conveyors // the list of converyors that are controlled by this switch
anchored = 1
-
+ speed_process = 1
/obj/machinery/conveyor_switch/New()
@@ -218,6 +216,7 @@
for(var/obj/machinery/conveyor/C in conveyors)
C.operating = position
C.setmove()
+ CHECK_TICK
// attack with hand, switch position
/obj/machinery/conveyor_switch/attack_hand(mob/user)
@@ -241,10 +240,11 @@
update()
// find any switches with same id as this one, and set their positions to match us
- for(var/obj/machinery/conveyor_switch/S in world)
+ for(var/obj/machinery/conveyor_switch/S in machines)
if(S.id == src.id)
S.position = position
S.update()
+ CHECK_TICK
/obj/machinery/conveyor_switch/oneway
var/convdir = 1 //Set to 1 or -1 depending on which way you want the convayor to go. (In other words keep at 1 and set the proper dir on the belts.)
diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm
index 262820990c2..a0f1aecb520 100644
--- a/code/modules/research/experimentor.dm
+++ b/code/modules/research/experimentor.dm
@@ -729,7 +729,7 @@
to_chat(user, "The [src] begins to vibrate!")
spawn(rand(10,30))
var/turf/userturf = get_turf(user)
- if(src.loc == user && userturf.z != ZLEVEL_CENTCOMM) //Because Nuke Ops bringing this back on their shuttle, then looting the ERT area is 2fun4you!
+ if(src.loc == user && is_teleport_allowed(userturf.z)) //Because Nuke Ops bringing this back on their shuttle, then looting the ERT area is 2fun4you!
visible_message("The [src] twists and bends, relocating itself!")
throwSmoke(userturf)
do_teleport(user, userturf, 8, asoundin = 'sound/effects/phasein.ogg')
diff --git a/code/modules/security_levels/security levels.dm b/code/modules/security_levels/security levels.dm
index 328a19ac034..a7a5162c231 100644
--- a/code/modules/security_levels/security levels.dm
+++ b/code/modules/security_levels/security levels.dm
@@ -37,8 +37,7 @@
CC.post_status("alert", "outline")
for(var/obj/machinery/firealarm/FA in world)
- // TODO: Tie into space manager
- if((FA.z in config.contact_levels))
+ if(is_station_contact(FA.z))
FA.overlays = list()
FA.overlays += image('icons/obj/monitors.dmi', "overlay_green")
@@ -54,8 +53,7 @@
CC.post_status("alert", "outline")
for(var/obj/machinery/firealarm/FA in world)
- // TODO: Tie into space manager
- if((FA.z in config.contact_levels))
+ if(is_station_contact(FA.z))
FA.overlays = list()
FA.overlays += image('icons/obj/monitors.dmi', "overlay_blue")
@@ -67,8 +65,7 @@
security_level = SEC_LEVEL_RED
var/obj/machinery/door/airlock/highsecurity/red/R = locate(/obj/machinery/door/airlock/highsecurity/red) in world
- // TODO: Tie into space manager
- if(R && (R.z in config.station_levels))
+ if(R && is_station_level(R.z))
R.locked = 0
R.update_icon()
@@ -77,8 +74,7 @@
CC.post_status("alert", "redalert")
for(var/obj/machinery/firealarm/FA in world)
- // TODO: Tie into space manager
- if((FA.z in config.contact_levels))
+ if(is_station_contact(FA.z))
FA.overlays = list()
FA.overlays += image('icons/obj/monitors.dmi', "overlay_red")
@@ -90,14 +86,12 @@
if(security_level < SEC_LEVEL_RED)
for(var/obj/machinery/door/airlock/highsecurity/red/R in airlocks)
- // TODO: Tie into space manager
- if((R.z in config.station_levels))
+ if(is_station_level(R.z))
R.locked = 0
R.update_icon()
for(var/obj/machinery/door/airlock/hatch/gamma/H in airlocks)
- // TODO: Tie into space manager
- if((H.z in config.station_levels))
+ if(is_station_level(H.z))
H.locked = 0
H.update_icon()
@@ -106,8 +100,7 @@
CC.post_status("alert", "gammaalert")
for(var/obj/machinery/firealarm/FA in world)
- // TODO: Tie into space manager
- if((FA.z in config.contact_levels))
+ if(is_station_contact(FA.z))
FA.overlays = list()
FA.overlays += image('icons/obj/monitors.dmi', "overlay_gamma")
FA.update_icon()
@@ -121,8 +114,7 @@
CC.post_status("alert", "epsilonalert")
for(var/obj/machinery/firealarm/FA in world)
- // TODO: Tie into space manager
- if((FA.z in config.contact_levels))
+ if(is_station_contact(FA.z))
FA.overlays = list()
FA.overlays += image('icons/obj/monitors.dmi', "overlay_epsilon")
@@ -135,8 +127,7 @@
CC.post_status("alert", "deltaalert")
for(var/obj/machinery/firealarm/FA in world)
- // TODO: Tie into space manager
- if((FA.z in config.contact_levels))
+ if(is_station_contact(FA.z))
FA.overlays = list()
FA.overlays += image('icons/obj/monitors.dmi', "overlay_delta")
diff --git a/code/modules/shuttle/assault_pod.dm b/code/modules/shuttle/assault_pod.dm
index 40e7aa05aa0..fe3d059a08a 100644
--- a/code/modules/shuttle/assault_pod.dm
+++ b/code/modules/shuttle/assault_pod.dm
@@ -6,7 +6,6 @@
height = 7
/obj/docking_port/mobile/assault_pod/request()
- // TODO: Tie into space manager
if(z == initial(src.z)) //No launching pods that have already launched
return ..()
diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm
index 7fd8186ab5b..6c5f4078611 100644
--- a/code/modules/shuttle/emergency.dm
+++ b/code/modules/shuttle/emergency.dm
@@ -209,8 +209,7 @@
if(time_left <= 0 && !shuttle_master.emergencyNoEscape)
//move each escape pod to its corresponding transit dock
for(var/obj/docking_port/mobile/pod/M in shuttle_master.mobile)
- // TODO: Tie into space manager
- if(M.z == ZLEVEL_STATION) //Will not launch from the mine/planet
+ if(is_station_level(M.z)) //Will not launch from the mine/planet
M.enterTransit()
//now move the actual emergency shuttle to its transit dock
for(var/area/shuttle/escape/E in world)
diff --git a/code/modules/shuttle/supply.dm b/code/modules/shuttle/supply.dm
index f076c7ee977..3451f7fbe08 100644
--- a/code/modules/shuttle/supply.dm
+++ b/code/modules/shuttle/supply.dm
@@ -28,7 +28,7 @@
return 1
/obj/docking_port/mobile/supply/canMove()
- if(z == ZLEVEL_STATION)
+ if(is_station_level(z))
return forbidden_atoms_check(areaInstance)
return ..()
@@ -45,7 +45,7 @@
sell()
/obj/docking_port/mobile/supply/proc/buy()
- if(z != ZLEVEL_STATION) //we only buy when we are -at- the station
+ if(!is_station_level(z)) //we only buy when we are -at- the station
return 1
if(!shuttle_master.shoppinglist.len)
@@ -93,7 +93,7 @@
shuttle_master.shoppinglist.Cut()
/obj/docking_port/mobile/supply/proc/sell()
- if(z != ZLEVEL_CENTCOMM) //we only sell when we are -at- centcomm
+ if(z != level_name_to_num(CENTCOMM)) //we only sell when we are -at- centcomm
return 1
var/plasma_count = 0
diff --git a/code/modules/shuttle/syndicate.dm b/code/modules/shuttle/syndicate.dm
index b1afd14bcf5..1c03c3f7039 100644
--- a/code/modules/shuttle/syndicate.dm
+++ b/code/modules/shuttle/syndicate.dm
@@ -30,9 +30,9 @@
/obj/machinery/computer/shuttle/syndicate/drop_pod/Topic(href, href_list)
if(href_list["move"])
- if(z != ZLEVEL_CENTCOMM)
+ if(z != level_name_to_num(CENTCOMM))
to_chat(usr, "Pods are one way!")
return 0
..()
-#undef SYNDICATE_CHALLENGE_TIMER
\ No newline at end of file
+#undef SYNDICATE_CHALLENGE_TIMER
diff --git a/code/modules/space_management/level_check.dm b/code/modules/space_management/level_check.dm
new file mode 100644
index 00000000000..391f5968c22
--- /dev/null
+++ b/code/modules/space_management/level_check.dm
@@ -0,0 +1,7 @@
+/proc/is_on_level_name(atom/A,name)
+ var/datum/space_level/S = space_manager.get_zlev_by_name(name)
+ return A.z == S.zpos
+
+// For expansion later
+/proc/atoms_share_level(atom/A, atom/B)
+ return A.z == B.z
diff --git a/code/modules/space_management/level_traits.dm b/code/modules/space_management/level_traits.dm
new file mode 100644
index 00000000000..83309c3764f
--- /dev/null
+++ b/code/modules/space_management/level_traits.dm
@@ -0,0 +1,62 @@
+/proc/is_level_reachable(z)
+ return check_level_trait(z, REACHABLE)
+
+/proc/is_station_level(z)
+ return check_level_trait(z, STATION_LEVEL)
+
+/proc/is_station_contact(z)
+ return check_level_trait(z, STATION_CONTACT)
+
+/proc/is_teleport_allowed(z)
+ return !check_level_trait(z, BLOCK_TELEPORT)
+
+/proc/is_admin_level(z)
+ return check_level_trait(z, ADMIN_LEVEL)
+
+/proc/is_away_level(z)
+ return check_level_trait(z, AWAY_LEVEL)
+
+/proc/is_mining_level(z)
+ return check_level_trait(z, ORE_LEVEL)
+
+/proc/is_ai_allowed(z)
+ return check_level_trait(z, AI_OK)
+
+/proc/level_blocks_magic(z)
+ return check_level_trait(z, IMPEDES_MAGIC)
+
+/proc/level_boosts_signal(z)
+ return check_level_trait(z, BOOSTS_SIGNAL)
+
+// Used for the nuke disk, or for checking if players survived through xenos
+/proc/is_secure_level(z)
+ var/secure = check_level_trait(z, STATION_LEVEL)
+ if(!secure)
+ // This is to allow further admin levels later, other than centcomm
+ secure = (z == level_name_to_num(CENTCOMM))
+ return secure
+
+var/list/default_map_traits = MAP_TRANSITION_CONFIG
+/proc/check_level_trait(z, trait)
+ if(z == 0)
+ return 0 // If you're nowhere, you have no traits
+ var/list/trait_list
+ if(space_manager.initialized)
+ var/datum/space_level/S = space_manager.get_zlev(z)
+ trait_list = S.flags
+ else
+ trait_list = default_map_traits[z]
+ trait_list = trait_list["attributes"]
+ return (trait in trait_list)
+
+/proc/levels_by_trait(trait)
+ var/list/result = list()
+ for(var/A in space_manager.z_list)
+ var/datum/space_level/S = space_manager.z_list[A]
+ if(trait in S.flags)
+ result |= S
+ return result
+
+/proc/level_name_to_num(name)
+ var/datum/space_level/S = space_manager.get_zlev_by_name(name)
+ return S.zpos
diff --git a/code/modules/space_management/space_level.dm b/code/modules/space_management/space_level.dm
index 6b7654cd504..02c16552c12 100644
--- a/code/modules/space_management/space_level.dm
+++ b/code/modules/space_management/space_level.dm
@@ -1,12 +1,14 @@
/datum/space_level
var/name = "Your config settings failed, you need to fix this for the datum space levels to work"
var/zpos = 1
- var/flags = 0 // We'll use this to keep track of whether you can teleport/etc
+ var/flags = list() // We'll use this to keep track of whether you can teleport/etc
// Map transition stuff
var/list/neighbors = list()
// # How this level connects with others. See __MAP_DEFINES.dm for defines
- var/linkage = SELFLOOPING
+ // It's UNAFFECTED by default because none of the space turfs are normally linked up
+ // so we don't need to rebuild transitions if an UNAFFECTED level is requested
+ var/linkage = UNAFFECTED
// # imaginary placements on the grid - these reflect the point it is linked to
var/xi
var/yi
@@ -19,45 +21,117 @@
var/dirt_count = 0
var/list/init_list = list()
-/datum/space_level/New(z, name, transition_type = SELFLOOPING)
+/datum/space_level/New(z, name, transition_type = SELFLOOPING, traits = list(BLOCK_TELEPORT))
zpos = z
- set_linkage(transition_type)
+ flags = traits
build_space_destination_arrays()
+ set_linkage(transition_type)
+
+/datum/space_level/Destroy()
+ if(linkage == CROSSLINKED)
+ if(space_manager.linkage_map)
+ remove_from_space_network(space_manager.linkage_map)
+
+ space_manager.unbuilt_space_transitions -= src
+ space_manager.z_list -= "[zpos]"
+ return ..()
/datum/space_level/proc/build_space_destination_arrays()
- var/timer = start_watch()
- log_debug("Starting to build space destination arrays for z level '[zpos]'...")
- for(var/turf/space/S in get_turfs())
+ // We skip `add_to_transit` here because we want to skip the checks in order to save time
+ // Bottom border
+ for(var/turf/space/S in block(locate(1,1,zpos),locate(world.maxx,TRANSITIONEDGE+1,zpos)))
+ transit_south |= S
- // Bottom border
- if(S.y <= TRANSITIONEDGE)
- transit_south |= S
- continue
+ // Top border
+ for(var/turf/space/S in block(locate(1,world.maxy,zpos),locate(world.maxx,world.maxy - TRANSITIONEDGE - 1,zpos)))
+ transit_north |= S
- // Top border
- if(S.y >= (world.maxy - TRANSITIONEDGE - 1))
- transit_north |= S
- continue
+ // Left border
+ for(var/turf/space/S in block(locate(1,TRANSITIONEDGE+1,zpos),locate(TRANSITIONEDGE+1,world.maxy - TRANSITIONEDGE - 2,zpos)))
+ transit_west |= S
- // Left border
- if(S.x <= TRANSITIONEDGE)
- transit_west |= S
- continue
+ // Right border
+ for(var/turf/space/S in block(locate(world.maxx - TRANSITIONEDGE - 1,TRANSITIONEDGE+1,zpos),locate(world.maxx,world.maxy - TRANSITIONEDGE - 2,zpos)))
+ transit_east |= S
+
+/datum/space_level/proc/add_to_transit(turf/space/S)
+ if(S.y <= TRANSITIONEDGE)
+ transit_south |= S
+ return
+
+ // Top border
+ if(S.y >= (world.maxy - TRANSITIONEDGE - 1))
+ transit_north |= S
+ return
+
+ // Left border
+ if(S.x <= TRANSITIONEDGE)
+ transit_west |= S
+ return
+
+ // Right border
+ if(S.x >= (world.maxx - TRANSITIONEDGE - 1))
+ transit_east |= S
+
+/datum/space_level/proc/remove_from_transit(turf/space/S)
+ if(S.y <= TRANSITIONEDGE)
+ transit_south -= S
+ return
+
+ // Top border
+ if(S.y >= (world.maxy - TRANSITIONEDGE - 1))
+ transit_north -= S
+ return
+
+ // Left border
+ if(S.x <= TRANSITIONEDGE)
+ transit_west -= S
+ return
+
+ // Right border
+ if(S.x >= (world.maxx - TRANSITIONEDGE - 1))
+ transit_east -= S
+
+/datum/space_level/proc/apply_transition(turf/space/S)
+ if(src in space_manager.unbuilt_space_transitions)
+ return // Let the space manager handle this one
+ switch(linkage)
+ if(UNAFFECTED)
+ S.remove_transitions()
+ if(SELFLOOPING,CROSSLINKED)
+ var/datum/space_level/E = get_connection()
+ if(S in transit_north)
+ E = get_connection("[NORTH]")
+ S.set_transition_north(E.zpos)
+ if(S in transit_south)
+ E = get_connection("[SOUTH]")
+ S.set_transition_south(E.zpos)
+ if(S in transit_east)
+ E = get_connection("[EAST]")
+ S.set_transition_east(E.zpos)
+ if(S in transit_west)
+ E = get_connection("[WEST]")
+ S.set_transition_west(E.zpos)
- // Right border
- if(S.x >= (world.maxx - TRANSITIONEDGE - 1))
- transit_east |= S
- continue
- log_debug("Building space destination arrays complete, took [stop_watch(timer)]s.")
/datum/space_level/proc/get_turfs()
return block(locate(1, 1, zpos), locate(world.maxx, world.maxy, zpos))
/datum/space_level/proc/set_linkage(transition_type)
- linkage = transition_type
- if(transition_type == SELFLOOPING)
- link_to_self() // `link_to_self` is defined in space_transitions.dm
+ if(linkage == transition_type)
+ return
+ // Remove ourselves from the linkage map if we were cross-linked
+ if(linkage == CROSSLINKED)
+ if(space_manager.linkage_map)
+ remove_from_space_network(space_manager.linkage_map)
+ space_manager.unbuilt_space_transitions |= src
+ linkage = transition_type
+ switch(transition_type)
+ if(UNAFFECTED)
+ reset_connections()
+ if(SELFLOOPING)
+ link_to_self() // `link_to_self` is defined in space_transitions.dm
/datum/space_level/proc/resume_init()
if(dirt_count > 0)
diff --git a/code/modules/space_management/space_transition.dm b/code/modules/space_management/space_transition.dm
index 469365e4023..b7691ce6601 100644
--- a/code/modules/space_management/space_transition.dm
+++ b/code/modules/space_management/space_transition.dm
@@ -16,15 +16,36 @@
if(Z_LEVEL_WEST)
return Z_LEVEL_EAST
-/datum/space_level
- var/list/direction_cache = list()
+
+// Do this before setting up new connections, or the old ones will haunt you
+/datum/space_level/proc/reset_connections()
+ neighbors.Cut()
/datum/space_level/proc/link_to_self()
+ reset_connections()
neighbors = list()
var/list/L = list(Z_LEVEL_NORTH,Z_LEVEL_SOUTH,Z_LEVEL_EAST,Z_LEVEL_WEST)
for(var/A in L)
neighbors[A] = src
+// Only call this when the `linkage_map` is already built
+/datum/space_level/proc/add_to_space_network(datum/spacewalk_grid/SW)
+ // Make sure we don't bring any noise data into the network
+ reset_connections()
+ xi = initial(xi)
+ yi = initial(yi)
+ var/datum/point/P = SW.get_empty_node()
+ P.set_space_level(src)
+
+/datum/space_level/proc/remove_from_space_network(datum/spacewalk_grid/SW)
+ var/datum/point/P = SW.get(xi,yi)
+ SW.release_node(P)
+ // Only do this when we're done, or we'll trample vars needed for releasing
+ // the level
+ xi = initial(xi)
+ yi = initial(yi)
+ reset_connections()
+
// This proc takes another space level, and establishes a connection between the
// two depending on how the `xi` and the `yi` values compare
/datum/space_level/proc/link_levels(datum/space_level/S)
@@ -41,26 +62,18 @@
else // yell about evil wizards, this shouldn't happen
log_debug("Two z levels attempted to link, but were not adjacent! Our z:([xi],[yi]). Other z:([S.xi],[S.yi])")
-// Do this before setting up new connections, or the old ones will haunt you
-/datum/space_level/proc/reset_connections()
- neighbors.Cut()
- direction_cache.Cut()
-
// `direction` here is the direction from `src` to `S`
/datum/space_level/proc/add_connection(datum/space_level/S, direction)
var/oppose = get_opposite_direction(direction)
neighbors[direction] = S
S.neighbors[oppose] = src
+ space_manager.unbuilt_space_transitions |= src
+ space_manager.unbuilt_space_transitions |= S
-// The "direction cache" will need updating if a
/datum/space_level/proc/get_connection(direction)
if(direction in neighbors)
return neighbors[direction]
- var/use_direction_cache = 0
- if(use_direction_cache)
- if(direction in direction_cache)
- return direction_cache[direction]
// It's in a direction that loops - so we step as far in the opposite direction to get where to wrap to
var/datum/space_level/S = src
@@ -70,9 +83,6 @@
if(S.neighbors[oppose] == src) // we've got a tesseract, boys
CRASH("Tesseract formed when routing connections between z levels. Culprit: z level '[S.zpos]' to '[src.zpos]', direction [oppose]")
S = S.neighbors[oppose]
-
- if(use_direction_cache)
- direction_cache[direction] = S
return S
@@ -145,8 +155,6 @@
// This looks around itself to see if it has any active nodes within the cardinal directions
/datum/point/proc/has_no_neighbors(datum/spacewalk_grid/SW)
var/result = 1
- if(spl)
- return 1
if(!isnull(SW.get(x+1,y)))
result = 0
if(!isnull(SW.get(x-1,y)))
@@ -165,6 +173,7 @@
var/datum/space_level/S = spl.neighbors[direction]
var/oppose = get_opposite_direction(direction)
S.neighbors.Remove(oppose)
+ space_manager.unbuilt_space_transitions |= S
spl.reset_connections()
spl = initial(spl)
@@ -191,6 +200,14 @@
var/datum/point/P = new(0,0)
add_available_node(P)
+/datum/spacewalk_grid/Destroy()
+ for(var/datum/point/P in filled_nodes)
+ release_node(P)
+ if(available_nodes.len > 1)
+ log_debug("Multiple nodes left behind after SW grid qdel: [available_nodes.len]")
+ for(var/datum/point/P in available_nodes)
+ log_debug("([P.x],[P.y])")
+
/datum/spacewalk_grid/proc/add_available_node(datum/point/P)
var/hash = P.hash()
if(hash in all_nodes)
@@ -225,9 +242,12 @@
for(var/datum/point/P2 in P.neighbors)
var/isolated = P2.has_no_neighbors(src)
if(isolated)
- available_nodes -= P2
- all_nodes -= P2.hash()
- qdel(P)
+ if(!P2.spl)
+ available_nodes -= P2
+ all_nodes -= P2.hash()
+ qdel(P)
+ else
+ log_debug("Isolated z level at ([P2.x],[P2.y]): [P2.spl.zpos]")
P.deactivate()
P.neighbors.Cut()
@@ -279,7 +299,7 @@
/datum/spacewalk_grid/proc/get_height()
return 1 + max_y - min_y
-// This function is called repeatedly to build the map
+// This function chooses an available point next to any node in the grid
/datum/spacewalk_grid/proc/get_empty_node()
var/datum/point/P = pick(available_nodes)
if(isnull(P))
@@ -287,6 +307,12 @@
consume_node(P)
return P
+// This function is called repeatedly to build the map
+/datum/spacewalk_grid/proc/add_level(datum/space_level/S)
+ var/datum/point/P = get_empty_node()
+ P.set_space_level(S)
+
+
// This proc substantiates the grid of points used to determine routes between levels
// Separating this from initialization gives us time in which we can add more crosslink z levels
// before we bake in all our connections
@@ -307,75 +333,75 @@
// `grid` is a flat list of these same above points
// Each point represents a possible z level position
- var/datum/spacewalk_grid/point_grid = new
- // We do this so we can display the way the levels connect later
- linkage_map = point_grid
- var/datum/point/P
+ if(linkage_map)
+ qdel(linkage_map)
+ linkage_map = new
// Now, we pop entries in a random order from our list of space levels
// and assign its connections based on the grid
while(crosslinks.len)
D = pick(crosslinks)
crosslinks.Remove(D)
- // We now choose a point in our imaginary grid adjacent to our current location
- P = point_grid.get_empty_node()
- // Let our z level know where in the imaginary grid it is
- // This will also handle establishing neighborship with other z levels
- P.set_space_level(D)
+ // Add it to our space grid
+ D.add_to_space_network(linkage_map)
-// A heavy proc - loops through all space turfs and sets its destination
-// based on its space level's linkage
-// Takes 0.6 seconds per call on my machine - could have each z level
-// have its own space turf cache, but I don't want to complicate this more
-// than is necessary
-/datum/zlev_manager/proc/setup_space_destinations()
+// Used to loop through turfs in world, now just goes through each level's
+// transit turf cache
+/datum/zlev_manager/proc/setup_space_destinations(force_all_rebuilds = FALSE)
var/timer = start_watch()
log_debug("Assigning space turf destinations...")
var/datum/space_level/D
var/datum/space_level/E
var/turf/space/S
- for(var/A in z_list) //Define the transistions of the z levels
- D = z_list[A]
- if(!D.neighbors.len)
- continue
- // Left border
- for(var/B in D.transit_west)
- S = B
- E = D.get_connection(Z_LEVEL_WEST)
- S.destination_z = E.zpos
- S.destination_x = world.maxx - TRANSITIONEDGE - 2
- S.destination_y = S.y
+ var/list/levels_to_rebuild = unbuilt_space_transitions
- // Right border
- for(var/B in D.transit_east)
- S = B
- E = D.get_connection(Z_LEVEL_EAST)
- S.destination_x = TRANSITIONEDGE + 2
- S.destination_y = S.y
- S.destination_z = E.zpos
+ if(force_all_rebuilds)
+ // Assuming we don't have like 9000 zlevels this shouldn't hurt
+ levels_to_rebuild = list()
+ for(var/A in z_list)
+ levels_to_rebuild.Add(z_list[A])
- // Bottom border
- for(var/B in D.transit_south)
- S = B
- E = D.get_connection(Z_LEVEL_SOUTH)
- S.destination_x = S.x
- S.destination_y = world.maxy - TRANSITIONEDGE - 2
- S.destination_z = E.zpos
- // Top border
- for(var/B in D.transit_north)
- S = B
- E = D.get_connection(Z_LEVEL_NORTH)
- S.destination_x = S.x
- S.destination_y = TRANSITIONEDGE + 2
- S.destination_z = E.zpos
+ for(var/foo in levels_to_rebuild) //Define the transitions of the z levels
+ D = foo
+ log_debug("Z level [D.zpos]")
+ switch(D.linkage)
+ if(UNAFFECTED)
+ for(var/B in D.transit_west | D.transit_east | D.transit_south | D.transit_north)
+ S = B
+ S.remove_transitions()
+ if(SELFLOOPING,CROSSLINKED)
+ // Left border
+ for(var/B in D.transit_west)
+ S = B
+ E = D.get_connection(Z_LEVEL_WEST)
+ S.set_transition_west(E.zpos)
+
+ // Right border
+ for(var/B in D.transit_east)
+ S = B
+ E = D.get_connection(Z_LEVEL_EAST)
+ S.set_transition_east(E.zpos)
+
+ // Bottom border
+ for(var/B in D.transit_south)
+ S = B
+ E = D.get_connection(Z_LEVEL_SOUTH)
+ S.set_transition_south(E.zpos)
+
+ // Top border
+ for(var/B in D.transit_north)
+ S = B
+ E = D.get_connection(Z_LEVEL_NORTH)
+ S.set_transition_north(E.zpos)
+ unbuilt_space_transitions -= D
log_debug("Assigning space turf destinations complete. Took [stop_watch(timer)]s.")
// Nothing fancy, just does it all at once
/datum/zlev_manager/proc/do_transition_setup()
route_linkage()
- setup_space_destinations()
+ setup_space_destinations(force_all_rebuilds = TRUE)
// A debugging proc that expresses the map's shape as a bunch of turfs
/datum/zlev_manager/proc/map_as_turfs(turf/center)
diff --git a/code/modules/space_management/zlevel_manager.dm b/code/modules/space_management/zlevel_manager.dm
index 8f83c0ab5e4..d0bb9455eb8 100644
--- a/code/modules/space_management/zlevel_manager.dm
+++ b/code/modules/space_management/zlevel_manager.dm
@@ -3,9 +3,14 @@ var/global/datum/zlev_manager/space_manager = new
/datum/zlev_manager
// A list of z-levels
var/list/z_list = list()
+ var/list/levels_by_name = list()
var/list/heaps = list()
+ // Levels that need their transitions rebuilt
+ var/list/unbuilt_space_transitions = list()
+
var/datum/spacewalk_grid/linkage_map
+ var/initialized = 0
// Populate our space level list
// and prepare space transitions
@@ -14,18 +19,24 @@ var/global/datum/zlev_manager/space_manager = new
var/k = 1
// First take care of "Official" z levels, without visiting levels outside of the list
- for(var/A in map_transition_config)
- // `A` is the name
- // `map_transition_config[A]` is the transition type
- z_list["[k]"] = new /datum/space_level(k, A, transition_type = map_transition_config[A])
+ for(var/list/features in map_transition_config)
if(k > world.maxz)
- CRASH("More map transitions defined than existent z levels - [num_official_z_levels]")
+ CRASH("More map attributes pre-defined than existent z levels - [num_official_z_levels]")
+ var/name = features["name"]
+ var/linking = features["linkage"]
+ var/list/attributes = features["attributes"]
+ attributes = attributes.Copy() // Clone the list so it can't be changed on accident
+
+ var/datum/space_level/S = new /datum/space_level(k, name, transition_type = linking, traits = attributes)
+ z_list["[k]"] = S
+ levels_by_name[name] = S
k++
// Then, we take care of unmanaged z levels
// They get the default linkage of SELFLOOPING
for(var/i = k, i <= world.maxz, i++)
z_list["[i]"] = new /datum/space_level(i)
+ initialized = 1
/datum/zlev_manager/proc/get_zlev(z)
@@ -34,6 +45,11 @@ var/global/datum/zlev_manager/space_manager = new
else
return z_list["[z]"]
+/datum/zlev_manager/proc/get_zlev_by_name(A)
+ if(!(A in levels_by_name))
+ throw EXCEPTION("Non-existent z level: '[A]'")
+ return levels_by_name[A]
+
/*
* "Dirt" management
* "Dirt" is used to keep track of whether a z level should automatically have
@@ -88,10 +104,14 @@ var/global/datum/zlev_manager/space_manager = new
// Increments the max z-level by one
// For convenience's sake returns the z-level added
-/datum/zlev_manager/proc/add_new_zlevel(name, linkage = SELFLOOPING)
+/datum/zlev_manager/proc/add_new_zlevel(name, linkage = SELFLOOPING, traits = list(BLOCK_TELEPORT))
+ if(name in levels_by_name)
+ throw EXCEPTION("Name already in use: [name]")
world.maxz++
var/our_z = world.maxz
- z_list["[our_z]"] = new /datum/space_level(our_z,name, transition_type = linkage)
+ var/datum/space_level/S = new /datum/space_level(our_z, name, transition_type = linkage, traits = traits)
+ levels_by_name[name] = S
+ z_list["[our_z]"] = S
return our_z
/datum/zlev_manager/proc/cut_levels_downto(new_maxz)
diff --git a/code/modules/store/store.dm b/code/modules/store/store.dm
index 7d5fc1e527d..d93d56acc41 100644
--- a/code/modules/store/store.dm
+++ b/code/modules/store/store.dm
@@ -48,8 +48,7 @@ var/global/datum/store/centcomm_store=new
/datum/store/proc/reconnect_database()
for(var/obj/machinery/computer/account_database/DB in world)
- // TODO: Tie into space manager
- if((DB.z in config.station_levels))
+ if(is_station_level(DB.z))
linked_db = DB
break
diff --git a/code/modules/telesci/bscrystal.dm b/code/modules/telesci/bscrystal.dm
index 8b86a3082d8..a2ee8cc85ca 100644
--- a/code/modules/telesci/bscrystal.dm
+++ b/code/modules/telesci/bscrystal.dm
@@ -22,8 +22,7 @@
qdel(src)
/obj/item/weapon/ore/bluespace_crystal/proc/blink_mob(var/mob/living/L)
- // TODO: Tie into space manager
- if(L.z in config.admin_levels)
+ if(!is_teleport_allowed(L.z))
src.visible_message("[src]'s fragments begin rapidly vibrating and blink out of existence.")
qdel(src)
return
diff --git a/config/example/config.txt b/config/example/config.txt
index eb44c6d828a..97c979b77f7 100644
--- a/config/example/config.txt
+++ b/config/example/config.txt
@@ -260,18 +260,6 @@ GHOST_INTERACTION
## Default is "python" on Windows, "/usr/bin/env python2" on UNIX.
#PYTHON_PATH pythonw
-## Defines which Z-levels the station exists on.
-STATION_LEVELS 1
-
-## Defines which Z-levels are used for admin functionality, such as Central Command and the Syndicate Shuttle
-ADMIN_LEVELS 2
-
-## Defines which Z-levels which, for example, a Code Red announcement may affect
-CONTACT_LEVELS 1;5
-
-## Defines all Z-levels a character can typically reach
-PLAYER_LEVELS 1;3;4;5;6;7
-
## Expected round length in minutes
EXPECTED_ROUND_LENGTH 120
diff --git a/config/example/space_levels.txt b/config/example/space_levels.txt
deleted file mode 100644
index d40624bb64d..00000000000
--- a/config/example/space_levels.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-Main Station;1;linked
-
-Central Command;2;unlinked
-
-Telecommunications Satellite;3;linked
-
-Engineering Outpost;4;linked
-
-Mining Asteroid;5;linked
-
-Derelicted Station;6;linked
-
-Empty Area;7;linked
\ No newline at end of file
diff --git a/html/changelogs/AutoChangeLog-pr-5268.yml b/html/changelogs/AutoChangeLog-pr-5268.yml
new file mode 100644
index 00000000000..776b50c2bd3
--- /dev/null
+++ b/html/changelogs/AutoChangeLog-pr-5268.yml
@@ -0,0 +1,5 @@
+author: Crazylemon64
+delete-after: True
+changes:
+ - bugfix: "Makes teleportation checks more consistent, which will ensure that teleporting in the away mission no longer works."
+ - bugfix: "People on the space ruins level no longer count as dead for assassinate objectives."
diff --git a/html/changelogs/AutoChangeLog-pr-5325.yml b/html/changelogs/AutoChangeLog-pr-5325.yml
new file mode 100644
index 00000000000..e7c5b3292b4
--- /dev/null
+++ b/html/changelogs/AutoChangeLog-pr-5325.yml
@@ -0,0 +1,4 @@
+author: DaveTheHeadcrab
+delete-after: True
+changes:
+ - tweak: "ERT gloves reverted to how they used to be."
diff --git a/html/changelogs/AutoChangeLog-pr-5333.yml b/html/changelogs/AutoChangeLog-pr-5333.yml
new file mode 100644
index 00000000000..77b3fd45922
--- /dev/null
+++ b/html/changelogs/AutoChangeLog-pr-5333.yml
@@ -0,0 +1,4 @@
+author: Chakishreds
+delete-after: True
+changes:
+ - tweak: "You can now click on objects in a gassy room at the expense of ninja floors."
diff --git a/html/changelogs/AutoChangeLog-pr-5352.yml b/html/changelogs/AutoChangeLog-pr-5352.yml
new file mode 100644
index 00000000000..6146477db0d
--- /dev/null
+++ b/html/changelogs/AutoChangeLog-pr-5352.yml
@@ -0,0 +1,5 @@
+author: Crazylemon64
+delete-after: True
+changes:
+ - bugfix: "Space border turfs will now regain their destination when over-written and replaced on the edge of the map"
+ - bugfix: "The space manager will no longer runtime if a space ruin writes on the edge of the map"
diff --git a/html/changelogs/AutoChangeLog-pr-5365.yml b/html/changelogs/AutoChangeLog-pr-5365.yml
new file mode 100644
index 00000000000..202f8ba0253
--- /dev/null
+++ b/html/changelogs/AutoChangeLog-pr-5365.yml
@@ -0,0 +1,4 @@
+author: LittleBigKid2000
+delete-after: True
+changes:
+ - bugfix: "The arrivals checkpoint camera monitor is now connected to some camera networks by default."
diff --git a/html/changelogs/AutoChangeLog-pr-5375.yml b/html/changelogs/AutoChangeLog-pr-5375.yml
new file mode 100644
index 00000000000..9aec43e7821
--- /dev/null
+++ b/html/changelogs/AutoChangeLog-pr-5375.yml
@@ -0,0 +1,7 @@
+author: Fox McCloud
+delete-after: True
+changes:
+ - rscadd: "Adds in formal captain's uniform and armor"
+ - rscadd: "Adds rapier to captain's locker"
+ - rscadd: "Adds lace up shoes to captain's locker"
+ - rscadd: "Adds crown to captain's locker"
diff --git a/html/changelogs/AutoChangeLog-pr-5387.yml b/html/changelogs/AutoChangeLog-pr-5387.yml
new file mode 100644
index 00000000000..c7f5aeeea9d
--- /dev/null
+++ b/html/changelogs/AutoChangeLog-pr-5387.yml
@@ -0,0 +1,4 @@
+author: Alexshreds
+delete-after: True
+changes:
+ - tweak: "pAIs can see the crew manifest again."
diff --git a/html/changelogs/AutoChangeLog-pr-5393.yml b/html/changelogs/AutoChangeLog-pr-5393.yml
new file mode 100644
index 00000000000..fc84fbdd85f
--- /dev/null
+++ b/html/changelogs/AutoChangeLog-pr-5393.yml
@@ -0,0 +1,4 @@
+author: Fox McCloud
+delete-after: True
+changes:
+ - tweak: "Dramatically speeds up conveyor belts"
diff --git a/html/changelogs/AutoChangeLog-pr-5394.yml b/html/changelogs/AutoChangeLog-pr-5394.yml
new file mode 100644
index 00000000000..173b18cd44d
--- /dev/null
+++ b/html/changelogs/AutoChangeLog-pr-5394.yml
@@ -0,0 +1,4 @@
+author: Fox McCloud
+delete-after: True
+changes:
+ - bugfix: "Appendicitis and Disease Outbreak events will no longer impact clientless mobs"
diff --git a/html/changelogs/AutoChangeLog-pr-5399.yml b/html/changelogs/AutoChangeLog-pr-5399.yml
new file mode 100644
index 00000000000..a1c8ac36b2c
--- /dev/null
+++ b/html/changelogs/AutoChangeLog-pr-5399.yml
@@ -0,0 +1,4 @@
+author: taukausanake
+delete-after: True
+changes:
+ - bugfix: "Gives proper mix_messages for Uplink, Synthignon, and Synth 'n Soda drinks"
diff --git a/html/changelogs/AutoChangeLog-pr-5405.yml b/html/changelogs/AutoChangeLog-pr-5405.yml
new file mode 100644
index 00000000000..7a71aa7179e
--- /dev/null
+++ b/html/changelogs/AutoChangeLog-pr-5405.yml
@@ -0,0 +1,4 @@
+author: Fethas
+delete-after: True
+changes:
+ - bugfix: "The whitelist will respect addons better, didn't even have to make a ban appeal.."
diff --git a/html/changelogs/AutoChangeLog-pr-5408.yml b/html/changelogs/AutoChangeLog-pr-5408.yml
new file mode 100644
index 00000000000..eb10c4ea9f9
--- /dev/null
+++ b/html/changelogs/AutoChangeLog-pr-5408.yml
@@ -0,0 +1,4 @@
+author: Fox McCloud
+delete-after: True
+changes:
+ - bugfix: "Fixes bandolier being invisible on spawn"
diff --git a/html/changelogs/AutoChangeLog-pr-5409.yml b/html/changelogs/AutoChangeLog-pr-5409.yml
new file mode 100644
index 00000000000..9ef06e196a7
--- /dev/null
+++ b/html/changelogs/AutoChangeLog-pr-5409.yml
@@ -0,0 +1,5 @@
+author: FreeStylaLT
+delete-after: True
+changes:
+ - bugfix: "Fixed missing space transition tiles in emergency shuttle transit"
+ - bugfix: "Fixed lack of prisoner access to lower part of labor camp shuttle"
diff --git a/icons/mob/belt.dmi b/icons/mob/belt.dmi
index 70aa813cbb8..68a273305a8 100644
Binary files a/icons/mob/belt.dmi and b/icons/mob/belt.dmi differ
diff --git a/icons/mob/head.dmi b/icons/mob/head.dmi
index fec4fdce7a1..57405bbe137 100644
Binary files a/icons/mob/head.dmi and b/icons/mob/head.dmi differ
diff --git a/icons/mob/inhands/items_lefthand.dmi b/icons/mob/inhands/items_lefthand.dmi
index 2e73e0e955a..bb624309542 100644
Binary files a/icons/mob/inhands/items_lefthand.dmi and b/icons/mob/inhands/items_lefthand.dmi differ
diff --git a/icons/mob/inhands/items_righthand.dmi b/icons/mob/inhands/items_righthand.dmi
index c576412d5b9..f4f7455ebd2 100644
Binary files a/icons/mob/inhands/items_righthand.dmi and b/icons/mob/inhands/items_righthand.dmi differ
diff --git a/icons/mob/species/vox/suit.dmi b/icons/mob/species/vox/suit.dmi
index bea5f5904ae..486b70d9c29 100644
Binary files a/icons/mob/species/vox/suit.dmi and b/icons/mob/species/vox/suit.dmi differ
diff --git a/icons/mob/species/vox/uniform.dmi b/icons/mob/species/vox/uniform.dmi
index 16ae9885800..f9e2831aece 100644
Binary files a/icons/mob/species/vox/uniform.dmi and b/icons/mob/species/vox/uniform.dmi differ
diff --git a/icons/mob/suit.dmi b/icons/mob/suit.dmi
index 9e263f8eb5a..f37dbcd617c 100644
Binary files a/icons/mob/suit.dmi and b/icons/mob/suit.dmi differ
diff --git a/icons/mob/uniform.dmi b/icons/mob/uniform.dmi
index 7b0cd8dd62d..fc637e21833 100644
Binary files a/icons/mob/uniform.dmi and b/icons/mob/uniform.dmi differ
diff --git a/icons/obj/clothing/belts.dmi b/icons/obj/clothing/belts.dmi
index f747338a5a7..ae8fa296794 100644
Binary files a/icons/obj/clothing/belts.dmi and b/icons/obj/clothing/belts.dmi differ
diff --git a/icons/obj/clothing/gloves.dmi b/icons/obj/clothing/gloves.dmi
index 4a41556989a..48d253c16cb 100644
Binary files a/icons/obj/clothing/gloves.dmi and b/icons/obj/clothing/gloves.dmi differ
diff --git a/icons/obj/clothing/hats.dmi b/icons/obj/clothing/hats.dmi
index 25ec0162866..958926788d7 100644
Binary files a/icons/obj/clothing/hats.dmi and b/icons/obj/clothing/hats.dmi differ
diff --git a/icons/obj/clothing/suits.dmi b/icons/obj/clothing/suits.dmi
index 70d6ced3311..80ae5b9a503 100644
Binary files a/icons/obj/clothing/suits.dmi and b/icons/obj/clothing/suits.dmi differ
diff --git a/icons/obj/clothing/uniforms.dmi b/icons/obj/clothing/uniforms.dmi
index fae0ff82715..12e31e3dc13 100644
Binary files a/icons/obj/clothing/uniforms.dmi and b/icons/obj/clothing/uniforms.dmi differ
diff --git a/icons/obj/weapons.dmi b/icons/obj/weapons.dmi
index 3cdea651719..89db9fa1c27 100644
Binary files a/icons/obj/weapons.dmi and b/icons/obj/weapons.dmi differ
diff --git a/nano/templates/pai_manifest.tmpl b/nano/templates/pai_manifest.tmpl
index 447f7ede7c5..d6827594e35 100644
--- a/nano/templates/pai_manifest.tmpl
+++ b/nano/templates/pai_manifest.tmpl
@@ -4,95 +4,95 @@ code/modules/mob/living/silicon/pai/software_modules.dm
Copy-pasted from pda.tmpl
-->
-
-
- {{if data.manifest.heads}}
- | Command |
- {{for data.manifest["heads"]}}
- {{if value.rank == "Captain"}}
- | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
- {{else}}
- | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
- {{/if}}
- {{/for}}
- {{/if}}
- {{if data.manifest.sec}}
- | Security |
- {{for data.manifest["sec"]}}
- {{if value.rank == "Head of Security"}}
- | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
- {{else}}
- | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
- {{/if}}
- {{/for}}
- {{/if}}
- {{if data.manifest.eng}}
- | Engineering |
- {{for data.manifest["eng"]}}
- {{if value.rank == "Chief Engineer"}}
- | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
- {{else}}
- | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
- {{/if}}
- {{/for}}
- {{/if}}
- {{if data.manifest.med}}
- | Medical |
- {{for data.manifest["med"]}}
- {{if value.rank == "Chief Medical Officer"}}
- | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
- {{else}}
- | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
- {{/if}}
- {{/for}}
- {{/if}}
- {{if data.manifest.sci}}
- | Science |
- {{for data.manifest["sci"]}}
- {{if value.rank == "Research Director"}}
- | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
- {{else}}
- | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
- {{/if}}
- {{/for}}
- {{/if}}
- {{if data.manifest.ser}}
- | Service |
- {{for data.manifest["ser"]}}
- {{if value.rank == "Head of Personnel"}}
- | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
- {{else}}
- | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
- {{/if}}
- {{/for}}
- {{/if}}
- {{if data.manifest.sup}}
- | Supply |
- {{for data.manifest["sup"]}}
- {{if value.rank == "Head of Personnel"}}
- | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
- {{else value.rank == "Quartermaster"}}
- | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
- {{else}}
- | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
- {{/if}}
- {{/for}}
- {{/if}}
- {{if data.manifest.civ}}
- | Civilian |
- {{for data.manifest["civ"]}}
- {{if value.rank == "Head of Personnel"}}
- | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
- {{else}}
- | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
- {{/if}}
- {{/for}}
- {{/if}}
- {{if data.manifest.misc}}
- | Misc |
- {{for data.manifest["misc"]}}
- | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
- {{/for}}
- {{/if}}
-
-
\ No newline at end of file
+
+
+ {{if data.manifest.heads}}
+ | Command |
+ {{for data.manifest["heads"]}}
+ {{if value.rank == "Captain"}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
+ {{else}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
+ {{/if}}
+ {{/for}}
+ {{/if}}
+ {{if data.manifest.sec}}
+ | Security |
+ {{for data.manifest["sec"]}}
+ {{if value.rank == "Head of Security"}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
+ {{else}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
+ {{/if}}
+ {{/for}}
+ {{/if}}
+ {{if data.manifest.eng}}
+ | Engineering |
+ {{for data.manifest["eng"]}}
+ {{if value.rank == "Chief Engineer"}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
+ {{else}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
+ {{/if}}
+ {{/for}}
+ {{/if}}
+ {{if data.manifest.med}}
+ | Medical |
+ {{for data.manifest["med"]}}
+ {{if value.rank == "Chief Medical Officer"}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
+ {{else}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
+ {{/if}}
+ {{/for}}
+ {{/if}}
+ {{if data.manifest.sci}}
+ | Science |
+ {{for data.manifest["sci"]}}
+ {{if value.rank == "Research Director"}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
+ {{else}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
+ {{/if}}
+ {{/for}}
+ {{/if}}
+ {{if data.manifest.ser}}
+ | Service |
+ {{for data.manifest["ser"]}}
+ {{if value.rank == "Head of Personnel"}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
+ {{else}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
+ {{/if}}
+ {{/for}}
+ {{/if}}
+ {{if data.manifest.sup}}
+ | Supply |
+ {{for data.manifest["sup"]}}
+ {{if value.rank == "Head of Personnel"}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
+ {{else value.rank == "Quartermaster"}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
+ {{else}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
+ {{/if}}
+ {{/for}}
+ {{/if}}
+ {{if data.manifest.civ}}
+ | Civilian |
+ {{for data.manifest["civ"]}}
+ {{if value.rank == "Head of Personnel"}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
+ {{else}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
+ {{/if}}
+ {{/for}}
+ {{/if}}
+ {{if data.manifest.misc}}
+ | Misc |
+ {{for data.manifest["misc"]}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
+ {{/for}}
+ {{/if}}
+
+
diff --git a/paradise.dme b/paradise.dme
index 1e094aabdf3..893b856ddcd 100644
--- a/paradise.dme
+++ b/paradise.dme
@@ -25,6 +25,7 @@
#include "code\__DEFINES\error_handler.dm"
#include "code\__DEFINES\flags.dm"
#include "code\__DEFINES\game.dm"
+#include "code\__DEFINES\gamemode.dm"
#include "code\__DEFINES\genetics.dm"
#include "code\__DEFINES\hud.dm"
#include "code\__DEFINES\hydroponics.dm"
@@ -167,6 +168,7 @@
#include "code\controllers\Processes\alarm.dm"
#include "code\controllers\Processes\diseases.dm"
#include "code\controllers\Processes\event.dm"
+#include "code\controllers\Processes\fast_process.dm"
#include "code\controllers\Processes\fires.dm"
#include "code\controllers\Processes\garbage.dm"
#include "code\controllers\Processes\inactivity.dm"
@@ -2003,6 +2005,8 @@
#include "code\modules\shuttle\supply.dm"
#include "code\modules\shuttle\syndicate.dm"
#include "code\modules\space_management\heap_space_level.dm"
+#include "code\modules\space_management\level_check.dm"
+#include "code\modules\space_management\level_traits.dm"
#include "code\modules\space_management\space_chunk.dm"
#include "code\modules\space_management\space_level.dm"
#include "code\modules\space_management\space_transition.dm"