diff --git a/_maps/shuttles/emergency_discoinferno.dmm b/_maps/shuttles/emergency_discoinferno.dmm index ec42f163f1..eb3a27359b 100644 --- a/_maps/shuttles/emergency_discoinferno.dmm +++ b/_maps/shuttles/emergency_discoinferno.dmm @@ -114,10 +114,7 @@ /turf/open/floor/mineral/plasma, /area/shuttle/escape) "v" = ( -/obj/machinery/disco{ - anchored = 1; - req_access = null - }, +/obj/machinery/disco/indestructible, /turf/open/floor/light/colour_cycle, /area/shuttle/escape) "w" = ( diff --git a/code/__DATASTRUCTURES/heap.dm b/code/__DATASTRUCTURES/heap.dm index 7246eff877..ce03b482e5 100644 --- a/code/__DATASTRUCTURES/heap.dm +++ b/code/__DATASTRUCTURES/heap.dm @@ -1,28 +1,28 @@ ////////////////////// -//Heap object +//datum/Heap object ////////////////////// -/Heap +/datum/Heap var/list/L var/cmp -/Heap/New(compare) +/datum/Heap/New(compare) L = new() cmp = compare -/Heap/proc/IsEmpty() +/datum/Heap/proc/IsEmpty() return !L.len //Insert and place at its position a new node in the heap -/Heap/proc/Insert(atom/A) +/datum/Heap/proc/Insert(atom/A) L.Add(A) Swim(L.len) //removes and returns the first element of the heap //(i.e the max or the min dependant on the comparison function) -/Heap/proc/Pop() +/datum/Heap/proc/Pop() if(!L.len) return 0 . = L[1] @@ -33,7 +33,7 @@ Sink(1) //Get a node up to its right position in the heap -/Heap/proc/Swim(var/index) +/datum/Heap/proc/Swim(var/index) var/parent = round(index * 0.5) while(parent > 0 && (call(cmp)(L[index],L[parent]) > 0)) @@ -42,7 +42,7 @@ parent = round(index * 0.5) //Get a node down to its right position in the heap -/Heap/proc/Sink(var/index) +/datum/Heap/proc/Sink(var/index) var/g_child = GetGreaterChild(index) while(g_child > 0 && (call(cmp)(L[index],L[g_child]) < 0)) @@ -52,7 +52,7 @@ //Returns the greater (relative to the comparison proc) of a node children //or 0 if there's no child -/Heap/proc/GetGreaterChild(var/index) +/datum/Heap/proc/GetGreaterChild(var/index) if(index * 2 > L.len) return 0 @@ -65,11 +65,11 @@ return index * 2 //Replaces a given node so it verify the heap condition -/Heap/proc/ReSort(atom/A) +/datum/Heap/proc/ReSort(atom/A) var/index = L.Find(A) Swim(index) Sink(index) -/Heap/proc/List() +/datum/Heap/proc/List() . = L.Copy() diff --git a/code/__DEFINES/maps.dm b/code/__DEFINES/maps.dm index cdd2739b3c..b7043d01ff 100644 --- a/code/__DEFINES/maps.dm +++ b/code/__DEFINES/maps.dm @@ -21,7 +21,7 @@ Last space-z level = empty #define CITY_OF_COGS "City of Cogs" #define EMPTY_AREA_1 "Empty Area 1" #define EMPTY_AREA_2 "Empty Area 2" -#define MINING "Mining Asteroid" +#define MINING_ASTEROID "Mining Asteroid" #define EMPTY_AREA_3 "Empty Area 3" #define EMPTY_AREA_4 "Empty Area 4" #define EMPTY_AREA_5 "Empty Area 5" @@ -36,11 +36,8 @@ Last space-z level = empty #define MAP_REMOVE_JOB(jobpath) /datum/job/##jobpath/map_check() { return (SSmapping.config.map_name != JOB_MODIFICATION_MAP_NAME) && ..() } //zlevel defines, can be overridden for different maps in the appropriate _maps file. -#define ZLEVEL_CENTCOM 1 #define ZLEVEL_STATION_PRIMARY 2 -#define ZLEVEL_MINING 5 #define ZLEVEL_LAVALAND 5 -#define ZLEVEL_CITYOFCOGS 6 #define ZLEVEL_EMPTY_SPACE 12 //Unless you modify it in map config should be equal to ZLEVEL_SPACEMAX #define ZLEVEL_TRANSIT 13 @@ -49,3 +46,31 @@ Last space-z level = empty #define ZLEVEL_SPACEMAX 13 #define SPACERUIN_MAP_EDGE_PAD 15 +#define ZLEVEL_SPACE_RUIN_COUNT 5 + +// traits +#define ZTRAIT_CENTCOM "CentCom" +#define ZTRAIT_STATION "Station" +#define ZTRAIT_MINING "Mining" +#define ZTRAIT_REEBE "Reebe" +#define ZTRAIT_TRANSIT "Transit" +#define ZTRAIT_AWAY "Away Mission" +#define ZTRAIT_SPACE_RUINS "Space Ruins" +#define ZTRAIT_LAVA_RUINS "Lava Ruins" +#define ZTRAIT_BOMBCAP_MULTIPLIER "Bombcap Multiplier" + +// trait definitions +#define DL_NAME "name" +#define DL_LINKAGE "linkage" +#define DL_TRAITS "traits" + +#define DECLARE_LEVEL(NAME, LINKAGE, TRAITS) list(DL_NAME = NAME, DL_LINKAGE = LINKAGE, DL_TRAITS = TRAITS) +// corresponds to basemap.dm +#define DEFAULT_MAP_TRAITS list(\ + DECLARE_LEVEL("CentCom", SELFLOOPING, list(ZTRAIT_CENTCOM = TRUE)),\ + DECLARE_LEVEL("Main Station", CROSSLINKED, list(ZTRAIT_STATION = TRUE)),\ + DECLARE_LEVEL("Empty Area 1", CROSSLINKED, list(ZTRAIT_SPACE_RUINS = TRUE)),\ + DECLARE_LEVEL("Empty Area 2", CROSSLINKED, list(ZTRAIT_SPACE_RUINS = TRUE)),\ + DECLARE_LEVEL("Lavaland", UNAFFECTED, list(ZTRAIT_MINING = TRUE, ZTRAIT_LAVA_RUINS = TRUE, ZTRAIT_BOMBCAP_MULTIPLIER = 3)),\ + DECLARE_LEVEL("Reebe", UNAFFECTED, list(ZTRAIT_REEBE = TRUE, ZTRAIT_BOMBCAP_MULTIPLIER = 0.5)),\ +) diff --git a/code/__HELPERS/AStar.dm b/code/__HELPERS/AStar.dm index 6be5fc2b16..37ca3bb082 100644 --- a/code/__HELPERS/AStar.dm +++ b/code/__HELPERS/AStar.dm @@ -25,19 +25,19 @@ Actual Adjacent procs : */ ////////////////////// -//PathNode object +//datum/PathNode object ////////////////////// //A* nodes variables -/PathNode +/datum/PathNode var/turf/source //turf associated with the PathNode - var/PathNode/prevNode //link to the parent PathNode + var/datum/PathNode/prevNode //link to the parent PathNode var/f //A* Node weight (f = g + h) var/g //A* movement cost variable var/h //A* heuristic variable var/nt //count the number of Nodes traversed -/PathNode/New(s,p,pg,ph,pnt) +/datum/PathNode/New(s,p,pg,ph,pnt) source = s prevNode = p g = pg @@ -45,7 +45,7 @@ Actual Adjacent procs : f = g + h nt = pnt -/PathNode/proc/calc_f() +/datum/PathNode/proc/calc_f() f = g + h ////////////////////// @@ -53,11 +53,11 @@ Actual Adjacent procs : ////////////////////// //the weighting function, used in the A* algorithm -/proc/PathWeightCompare(PathNode/a, PathNode/b) +/proc/PathWeightCompare(datum/PathNode/a, datum/PathNode/b) return a.f - b.f //reversed so that the Heap is a MinHeap rather than a MaxHeap -/proc/HeapPathWeightCompare(PathNode/a, PathNode/b) +/proc/HeapPathWeightCompare(datum/PathNode/a, datum/PathNode/b) return b.f - a.f //wrapper that returns an empty list if A* failed to find a path @@ -81,13 +81,13 @@ Actual Adjacent procs : return 0 maxnodedepth = maxnodes //no need to consider path longer than maxnodes - var/Heap/open = new /Heap(/proc/HeapPathWeightCompare) //the open list + var/datum/Heap/open = new /datum/Heap(/proc/HeapPathWeightCompare) //the open list var/list/closed = new() //the closed list var/list/path = null //the returned path, if any - var/PathNode/cur //current processed turf + var/datum/PathNode/cur //current processed turf //initialization - open.Insert(new /PathNode(start,null,0,call(start,dist)(end),0)) + open.Insert(new /datum/PathNode(start,null,0,call(start,dist)(end),0)) //then run the main loop while(!open.IsEmpty() && !path) @@ -123,10 +123,10 @@ Actual Adjacent procs : var/newg = cur.g + call(cur.source,dist)(T) - var/PathNode/P = pnodelist[T] + var/datum/PathNode/P = pnodelist[T] if(!P) //is not already in open list, so add it - var/PathNode/newnode = new /PathNode(T,cur,newg,call(T,dist)(end),cur.nt+1) + var/datum/PathNode/newnode = new /datum/PathNode(T,cur,newg,call(T,dist)(end),cur.nt+1) open.Insert(newnode) pnodelist[T] = newnode else //is already in open list, check if it's a better way from the current turf diff --git a/code/__HELPERS/level_traits.dm b/code/__HELPERS/level_traits.dm index e2a74cf8e0..4d20c9b513 100644 --- a/code/__HELPERS/level_traits.dm +++ b/code/__HELPERS/level_traits.dm @@ -1,17 +1,17 @@ // Helpers for checking whether a z-level conforms to a specific requirement // Basic levels -#define is_centcom_level(z) ((z) == ZLEVEL_CENTCOM) +#define is_centcom_level(z) SSmapping.level_trait(z, ZTRAIT_CENTCOM) -#define is_station_level(z) ((z) in GLOB.station_z_levels) +#define is_station_level(z) SSmapping.level_trait(z, ZTRAIT_STATION) -#define is_mining_level(z) ((z) == ZLEVEL_MINING) +#define is_mining_level(z) SSmapping.level_trait(z, ZTRAIT_MINING) -#define is_reebe(z) ((z) == ZLEVEL_CITYOFCOGS) +#define is_reebe(z) SSmapping.level_trait(z, ZTRAIT_REEBE) -#define is_transit_level(z) ((z) == ZLEVEL_TRANSIT) +#define is_transit_level(z) SSmapping.level_trait(z, ZTRAIT_TRANSIT) -#define is_away_level(z) ((z) > ZLEVEL_SPACEMAX) +#define is_away_level(z) SSmapping.level_trait(z, ZTRAIT_AWAY) // If true, the singularity cannot strip away asteroid turf on this Z #define is_planet_level(z) (GLOB.z_is_planet["z"]) diff --git a/code/_globalvars/lists/mapping.dm b/code/_globalvars/lists/mapping.dm index 51af2b3525..0d8965d10a 100644 --- a/code/_globalvars/lists/mapping.dm +++ b/code/_globalvars/lists/mapping.dm @@ -1,14 +1,7 @@ -#define Z_NORTH 1 -#define Z_EAST 2 -#define Z_SOUTH 3 -#define Z_WEST 4 - GLOBAL_LIST_INIT(cardinals, list(NORTH, SOUTH, EAST, WEST)) GLOBAL_LIST_INIT(alldirs, list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)) GLOBAL_LIST_INIT(diagonals, list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)) -GLOBAL_LIST_INIT(station_z_levels, list(ZLEVEL_STATION_PRIMARY)) - GLOBAL_LIST(global_map) //list/global_map = list(list(1,5),list(4,3))//an array of map Z levels. //Resulting sector map looks like diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index d13d340b03..8046dab41e 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -22,6 +22,9 @@ SUBSYSTEM_DEF(mapping) var/loading_ruins = FALSE + // Z-manager stuff + var/list/z_list + /datum/controller/subsystem/mapping/PreInit() if(!config) #ifdef FORCE_MAP @@ -39,28 +42,34 @@ SUBSYSTEM_DEF(mapping) repopulate_sorted_areas() process_teleport_locs() //Sets up the wizard teleport locations preloadTemplates() + + // Create space levels + for(var/I in 1 to ZLEVEL_SPACE_RUIN_COUNT) + add_new_zlevel("Empty Area [2 + I]", CROSSLINKED, list(ZTRAIT_SPACE_RUINS = TRUE)) + add_new_zlevel("Empty Area [3 + ZLEVEL_SPACE_RUIN_COUNT]", CROSSLINKED, list()) // no ruins + add_new_zlevel("Transit", UNAFFECTED, list(ZTRAIT_TRANSIT = TRUE)) + // Pick a random away mission. createRandomZlevel() - // Generate mining. + if (z_list.len < world.maxz) + add_new_zlevel("Away Mission", UNAFFECTED, list(ZTRAIT_AWAY = TRUE)) + + // Generate mining ruins loading_ruins = TRUE - var/mining_type = config.minetype - if (mining_type == "lavaland") - seedRuins(list(ZLEVEL_LAVALAND), CONFIG_GET(number/lavaland_budget), /area/lavaland/surface/outdoors/unexplored, lava_ruins_templates) - spawn_rivers() + var/list/lava_ruins = levels_by_trait(ZTRAIT_LAVA_RUINS) + if (lava_ruins.len) + seedRuins(lava_ruins, CONFIG_GET(number/lavaland_budget), /area/lavaland/surface/outdoors/unexplored, lava_ruins_templates) + for (var/lava_z in lava_ruins) + spawn_rivers(lava_z) - // deep space ruins - var/space_zlevels = list() - for(var/i in ZLEVEL_SPACEMIN to ZLEVEL_SPACEMAX) - switch(i) - if(ZLEVEL_MINING, ZLEVEL_LAVALAND, ZLEVEL_EMPTY_SPACE, ZLEVEL_TRANSIT, ZLEVEL_CITYOFCOGS) - continue - else - space_zlevels += i - - seedRuins(space_zlevels, CONFIG_GET(number/space_budget), /area/space, space_ruins_templates) + // Generate deep space ruins + var/list/space_ruins = levels_by_trait(ZTRAIT_SPACE_RUINS) + if (space_ruins.len) + seedRuins(space_ruins, CONFIG_GET(number/space_budget), /area/space, space_ruins_templates) loading_ruins = FALSE + repopulate_sorted_areas() - // Set up Z-level transistions. + // Set up Z-level transitions. setup_map_transitions() generate_station_area_list() ..() @@ -98,6 +107,8 @@ SUBSYSTEM_DEF(mapping) config = SSmapping.config next_map_config = SSmapping.next_map_config + z_list = SSmapping.z_list + /datum/controller/subsystem/mapping/proc/TryLoadZ(filename, errorList, forceLevel, last) var/static/dmm_suite/loader if(!loader) @@ -107,11 +118,6 @@ SUBSYSTEM_DEF(mapping) if(last) QDEL_NULL(loader) -/datum/controller/subsystem/mapping/proc/CreateSpace(MaxZLevel) - while(world.maxz < MaxZLevel) - ++world.maxz - CHECK_TICK - #define INIT_ANNOUNCE(X) to_chat(world, "[X]"); log_world(X) /datum/controller/subsystem/mapping/proc/loadWorld() //if any of these fail, something has gone horribly, HORRIBLY, wrong @@ -121,6 +127,7 @@ SUBSYSTEM_DEF(mapping) INIT_ANNOUNCE("Loading [config.map_name]...") TryLoadZ(config.GetFullMapPath(), FailedZs, ZLEVEL_STATION_PRIMARY) + InitializeDefaultZLevels() INIT_ANNOUNCE("Loaded station in [(REALTIMEOFDAY - start_time)/10]s!") if(SSdbcore.Connect()) var/datum/DBQuery/query_round_map_name = SSdbcore.NewQuery("UPDATE [format_table_name("round")] SET map_name = '[config.map_name]' WHERE id = [GLOB.round_id]") @@ -129,8 +136,6 @@ SUBSYSTEM_DEF(mapping) if(config.minetype != "lavaland") INIT_ANNOUNCE("WARNING: A map without lavaland set as its minetype was loaded! This is being ignored! Update the maploader code!") - CreateSpace(ZLEVEL_SPACEMAX) - if(LAZYLEN(FailedZs)) //but seriously, unless the server's filesystem is messed up this will never happen var/msg = "RED ALERT! The following map files failed to load: [FailedZs[1]]" if(FailedZs.len > 1) diff --git a/code/controllers/subsystem/minimap.dm b/code/controllers/subsystem/minimap.dm index 4bead36bb1..fa9821b85b 100644 --- a/code/controllers/subsystem/minimap.dm +++ b/code/controllers/subsystem/minimap.dm @@ -5,9 +5,10 @@ SUBSYSTEM_DEF(minimap) var/const/MINIMAP_SIZE = 2048 var/const/TILE_SIZE = 8 - var/list/z_levels = list(ZLEVEL_STATION_PRIMARY) + var/list/z_levels /datum/controller/subsystem/minimap/Initialize(timeofday) + z_levels = SSmapping.levels_by_trait(ZTRAIT_STATION) var/hash = md5(SSmapping.config.GetFullMapPath()) if(CONFIG_GET(flag/generate_minimaps)) if(hash == trim(file2text(hash_path()))) diff --git a/code/controllers/subsystem/squeak.dm b/code/controllers/subsystem/squeak.dm index 022b659d8a..861bb0d8d5 100644 --- a/code/controllers/subsystem/squeak.dm +++ b/code/controllers/subsystem/squeak.dm @@ -34,7 +34,7 @@ SUBSYSTEM_DEF(squeak) /datum/controller/subsystem/squeak/proc/find_exposed_wires() exposed_wires.Cut() var/list/all_turfs - for (var/z in GLOB.station_z_levels) + for (var/z in SSmapping.levels_by_trait(ZTRAIT_STATION)) all_turfs += block(locate(1,1,z), locate(world.maxx,world.maxy,z)) for(var/turf/open/floor/plating/T in all_turfs) if(is_blocked_turf(T)) diff --git a/code/datums/explosion.dm b/code/datums/explosion.dm index 9b5cd18774..0616d0e4c6 100644 --- a/code/datums/explosion.dm +++ b/code/datums/explosion.dm @@ -1,6 +1,4 @@ #define EXPLOSION_THROW_SPEED 4 -#define CITYOFCOGS_CAP_MULTIPLIER 0.5 -#define MINING_CAP_MULTIPLIER 3 GLOBAL_LIST_EMPTY(explosions) //Against my better judgement, I will return the explosion datum @@ -54,17 +52,14 @@ GLOBAL_LIST_EMPTY(explosions) var/orig_dev_range = devastation_range var/orig_heavy_range = heavy_impact_range var/orig_light_range = light_impact_range - + var/orig_max_distance = max(devastation_range, heavy_impact_range, light_impact_range, flash_range, flame_range) - + //Zlevel specific bomb cap multiplier - var/cap_multiplier = 1 - switch(epicenter.z) - if(ZLEVEL_CITYOFCOGS) - cap_multiplier = CITYOFCOGS_CAP_MULTIPLIER - if(ZLEVEL_MINING) - cap_multiplier = MINING_CAP_MULTIPLIER - + var/cap_multiplier = SSmapping.level_trait(epicenter.z, ZTRAIT_BOMBCAP_MULTIPLIER) + if (isnull(cap_multiplier)) + cap_multiplier = 1 + if(!ignorecap) devastation_range = min(GLOB.MAX_EX_DEVESTATION_RANGE * cap_multiplier, devastation_range) heavy_impact_range = min(GLOB.MAX_EX_HEAVY_RANGE * cap_multiplier, heavy_impact_range) @@ -91,11 +86,11 @@ GLOBAL_LIST_EMPTY(explosions) if(adminlog) message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range], [flame_range]) in area: [epi_area] [ADMIN_COORDJMP(epicenter)]") log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range], [flame_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z])") - + var/x0 = epicenter.x var/y0 = epicenter.y var/z0 = epicenter.z - + SSblackbox.record_feedback("associative", "explosion", 1, list("dev" = devastation_range, "heavy" = heavy_impact_range, "light" = light_impact_range, "flash" = flash_range, "flame" = flame_range, "orig_dev" = orig_dev_range, "orig_heavy" = orig_heavy_range, "orig_light" = orig_light_range, "x" = x0, "y" = y0, "z" = z0, "area" = epi_area.type)) // Play sounds; we want sounds to be different depending on distance so we will manually do it ourselves. @@ -199,7 +194,7 @@ GLOBAL_LIST_EMPTY(explosions) //------- EX_ACT AND TURF FIRES ------- if(T == epicenter) // Ensures explosives detonating from bags trigger other explosives in that bag - var/list/items = list() + var/list/items = list() for(var/I in T) var/atom/A = I items += A.GetAllContents() @@ -418,6 +413,3 @@ GLOBAL_LIST_EMPTY(explosions) // 10 explosion power is a (1, 3, 6) explosion. // 5 explosion power is a (0, 1, 3) explosion. // 1 explosion power is a (0, 0, 1) explosion. - -#undef CITYOFCOGS_CAP_MULTIPLIER -#undef MINING_CAP_MULTIPLIER diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm index c030bd4c2a..f90d6eed32 100644 --- a/code/datums/helper_datums/teleport.dm +++ b/code/datums/helper_datums/teleport.dm @@ -166,9 +166,12 @@ // Safe location finder -/proc/find_safe_turf(zlevel = ZLEVEL_STATION_PRIMARY, list/zlevels, extended_safety_checks = FALSE) +/proc/find_safe_turf(zlevel, list/zlevels, extended_safety_checks = FALSE) if(!zlevels) - zlevels = list(zlevel) + if (zlevel) + zlevels = list(zlevel) + else + zlevels = SSmapping.levels_by_trait(ZTRAIT_STATION) var/cycles = 1000 for(var/cycle in 1 to cycles) // DRUNK DIALLING WOOOOOOOOO diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 4e46aeca65..cc58c9445d 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -1174,7 +1174,7 @@ if(devilinfo) devilinfo.ascendable = FALSE message_admins("[key_name_admin(usr)] has made [current] unable to ascend as a devil.") - log_admin("[key_name_admin(usr)] has made [current] unable to ascend as a devil.") + log_admin("[key_name(usr)] has made [current] unable to ascend as a devil.") return if(!ishuman(current) && !iscyborg(current)) to_chat(usr, "This only works on humans and cyborgs!") @@ -1186,7 +1186,7 @@ if(devilinfo) devilinfo.ascendable = TRUE message_admins("[key_name_admin(usr)] has made [current] able to ascend as a devil.") - log_admin("[key_name_admin(usr)] has made [current] able to ascend as a devil.") + log_admin("[key_name(usr)] has made [current] able to ascend as a devil.") return if(!ishuman(current) && !iscyborg(current)) to_chat(usr, "This only works on humans and cyborgs!") diff --git a/code/datums/position_point_vector.dm b/code/datums/position_point_vector.dm index 2a98d57efd..6fae092c9d 100644 --- a/code/datums/position_point_vector.dm +++ b/code/datums/position_point_vector.dm @@ -1,239 +1,239 @@ -//Designed for things that need precision trajectories like projectiles. -//Don't use this for anything that you don't absolutely have to use this with (like projectiles!) because it isn't worth using a datum unless you need accuracy down to decimal places in pixels. - -#define RETURN_PRECISE_POSITION(A) new /datum/position(A) -#define RETURN_PRECISE_POINT(A) new /datum/point(A) - -/datum/position //For positions with map x/y/z and pixel x/y so you don't have to return lists. Could use addition/subtraction in the future I guess. - var/x = 0 - var/y = 0 - var/z = 0 - var/pixel_x = 0 - var/pixel_y = 0 - -/datum/position/proc/valid() - return x && y && z && !isnull(pixel_x) && !isnull(pixel_y) - -/datum/position/New(_x = 0, _y = 0, _z = 0, _pixel_x = 0, _pixel_y = 0) //first argument can also be a /datum/point. - if(istype(_x, /datum/point)) - var/datum/point/P = _x - var/turf/T = P.return_turf() - _x = T.x - _y = T.y - _z = T.z - _pixel_x = P.return_px() - _pixel_y = P.return_py() - else if(isatom(_x)) - var/atom/A = _x - _x = A.x - _y = A.y - _z = A.z - _pixel_x = A.pixel_x - _pixel_y = A.pixel_y - x = _x - y = _y - z = _z - pixel_x = _pixel_x - pixel_y = _pixel_y - -/datum/position/proc/return_turf() - return locate(x, y, z) - -/datum/position/proc/return_px() - return pixel_x - -/datum/position/proc/return_py() - return pixel_y - -/datum/position/proc/return_point() - return new /datum/point(src) - -/proc/point_midpoint_points(datum/point/a, datum/point/b) //Obviously will not support multiZ calculations! Same for the two below. - var/datum/point/P = new - P.x = round(a.x + (b.x - a.x) / 2, 1) - P.y = round(a.y + (b.y - a.y) / 2, 1) - P.z = a.z - return P - -/proc/pixel_length_between_points(datum/point/a, datum/point/b) - return sqrt(((b.x - a.x) ** 2) + ((b.y - a.y) ** 2)) - -/proc/angle_between_points(datum/point/a, datum/point/b) - return ATAN2((b.y - a.y), (b.x - a.x)) - -/datum/point //A precise point on the map in absolute pixel locations based on world.icon_size. Pixels are FROM THE EDGE OF THE MAP! - var/x = 0 - var/y = 0 - var/z = 0 - -/datum/point/proc/valid() - return x && y && z - -/datum/point/proc/copy_to(datum/point/p = new) - p.x = x - p.y = y - p.z = z - return p - -/datum/point/New(_x, _y, _z, _pixel_x = 0, _pixel_y = 0) //first argument can also be a /datum/position or /atom. - if(istype(_x, /datum/position)) - var/datum/position/P = _x - _x = P.x - _y = P.y - _z = P.z - _pixel_x = P.pixel_x - _pixel_y = P.pixel_y - else if(istype(_x, /atom)) - var/atom/A = _x - _x = A.x - _y = A.y - _z = A.z - _pixel_x = A.pixel_x - _pixel_y = A.pixel_y - initialize_location(_x, _y, _z, _pixel_x, _pixel_y) - -/datum/point/proc/initialize_location(tile_x, tile_y, tile_z, p_x = 0, p_y = 0) - if(!isnull(tile_x)) - x = ((tile_x - 1) * world.icon_size) + world.icon_size / 2 + p_x - if(!isnull(tile_y)) - y = ((tile_y - 1) * world.icon_size) + world.icon_size / 2+ p_y - if(!isnull(tile_z)) - z = tile_z - -/datum/point/proc/return_turf() - return locate(CEILING(x / world.icon_size, 1), CEILING(y / world.icon_size, 1), z) - -/datum/point/proc/return_coordinates() //[turf_x, turf_y, z] - return list(CEILING(x / world.icon_size, 1), CEILING(y / world.icon_size, 1), z) - -/datum/point/proc/return_position() - return new /datum/position(src) - -/datum/point/proc/return_px() - return MODULUS(x, world.icon_size) - 16 - -/datum/point/proc/return_py() - return MODULUS(y, world.icon_size) - 16 - -/datum/point/proc/mapcheck() - . = FALSE - var/maxx = world.icon_size * world.maxx - var/maxy = world.icon_size * world.maxy - var/move_zx = 0 - var/move_zy = 0 - if(x < 0) - x += maxx - move_zx -= 1 - if(y < 0) - y += maxy - move_zy -= 1 - if(x > maxx) - x -= maxx - move_zx += 1 - if(y > maxy) - y -= maxy - move_zy += 1 - var/datum/space_level/S = GLOB.z_levels_list["[z]"] - if(move_zx != 0) - var/datum/space_level/L = S.neigbours["[move_zx < 0? WEST : EAST]"] - z = L.z_value - . = TRUE - if(move_zy != 0) - var/datum/space_level/L = S.neigbours["[move_zy < 0? SOUTH : NORTH]"] - z = L.z_value - . = TRUE - -/datum/point/vector - var/speed = 32 //pixels per iteration - var/iteration = 0 - var/angle = 0 - var/mpx = 0 //calculated x/y movement amounts to prevent having to do trig every step. - var/mpy = 0 - var/starting_x = 0 //just like before, pixels from EDGE of map! This is set in initialize_location(). - var/starting_y = 0 - var/starting_z = 0 - -/datum/point/vector/New(_x, _y, _z, _pixel_x = 0, _pixel_y = 0, _angle, _speed) - ..() - initialize_trajectory(_speed, _angle) - -/datum/point/vector/initialize_location(tile_x, tile_y, tile_z, p_x = 0, p_y = 0) - . = ..() - starting_x = x - starting_y = y - starting_z = z - -/datum/point/vector/copy_to(datum/point/vector/v = new) - ..(v) - v.speed = speed - v.iteration = iteration - v.angle = angle - v.mpx = mpx - v.mpy = mpy - v.starting_x = starting_x - v.starting_y = starting_y - v.starting_z = starting_z - return v - -/datum/point/vector/proc/initialize_trajectory(pixel_speed, new_angle) - if(!isnull(pixel_speed)) - speed = pixel_speed - set_angle(new_angle) - -/datum/point/vector/proc/set_angle(new_angle) //calculations use "byond angle" where north is 0 instead of 90, and south is 180 instead of 270. - if(isnull(angle)) - return - angle = new_angle - update_offsets() - -/datum/point/vector/proc/update_offsets() - mpx = sin(angle) * speed - mpy = cos(angle) * speed - -/datum/point/vector/proc/set_speed(new_speed) - if(isnull(new_speed) || speed == new_speed) - return - speed = new_speed - update_offsets() - -/datum/point/vector/proc/increment(multiplier = 1) - iteration++ - x += mpx * 1 - y += mpy * 1 - if(mapcheck()) - on_z_change() - -/datum/point/vector/proc/return_vector_after_increments(amount = 7, multiplier = 1, force_simulate = FALSE) - var/datum/point/vector/v = copy_to() - if(force_simulate) - for(var/i in 1 to amount) - v.increment(multiplier) - else - v.increment(multiplier * amount) - return v - -/datum/point/vector/proc/on_z_change() - return - -/datum/point/vector/processed //pixel_speed is per decisecond. - var/last_process = 0 - var/last_move = 0 - var/paused = FALSE - -/datum/point/vector/processed/Destroy() - STOP_PROCESSING(SSprojectiles, src) - -/datum/point/vector/processed/proc/start() - last_process = world.time - last_move = world.time - START_PROCESSING(SSprojectiles, src) - -/datum/point/vector/processed/process() - if(paused) - last_move += world.time - last_process - last_process = world.time - return - var/needed_time = world.time - last_move - last_process = world.time - last_move = world.time - increment(needed_time) +//Designed for things that need precision trajectories like projectiles. +//Don't use this for anything that you don't absolutely have to use this with (like projectiles!) because it isn't worth using a datum unless you need accuracy down to decimal places in pixels. + +#define RETURN_PRECISE_POSITION(A) new /datum/position(A) +#define RETURN_PRECISE_POINT(A) new /datum/point(A) + +/datum/position //For positions with map x/y/z and pixel x/y so you don't have to return lists. Could use addition/subtraction in the future I guess. + var/x = 0 + var/y = 0 + var/z = 0 + var/pixel_x = 0 + var/pixel_y = 0 + +/datum/position/proc/valid() + return x && y && z && !isnull(pixel_x) && !isnull(pixel_y) + +/datum/position/New(_x = 0, _y = 0, _z = 0, _pixel_x = 0, _pixel_y = 0) //first argument can also be a /datum/point. + if(istype(_x, /datum/point)) + var/datum/point/P = _x + var/turf/T = P.return_turf() + _x = T.x + _y = T.y + _z = T.z + _pixel_x = P.return_px() + _pixel_y = P.return_py() + else if(isatom(_x)) + var/atom/A = _x + _x = A.x + _y = A.y + _z = A.z + _pixel_x = A.pixel_x + _pixel_y = A.pixel_y + x = _x + y = _y + z = _z + pixel_x = _pixel_x + pixel_y = _pixel_y + +/datum/position/proc/return_turf() + return locate(x, y, z) + +/datum/position/proc/return_px() + return pixel_x + +/datum/position/proc/return_py() + return pixel_y + +/datum/position/proc/return_point() + return new /datum/point(src) + +/proc/point_midpoint_points(datum/point/a, datum/point/b) //Obviously will not support multiZ calculations! Same for the two below. + var/datum/point/P = new + P.x = round(a.x + (b.x - a.x) / 2, 1) + P.y = round(a.y + (b.y - a.y) / 2, 1) + P.z = a.z + return P + +/proc/pixel_length_between_points(datum/point/a, datum/point/b) + return sqrt(((b.x - a.x) ** 2) + ((b.y - a.y) ** 2)) + +/proc/angle_between_points(datum/point/a, datum/point/b) + return ATAN2((b.y - a.y), (b.x - a.x)) + +/datum/point //A precise point on the map in absolute pixel locations based on world.icon_size. Pixels are FROM THE EDGE OF THE MAP! + var/x = 0 + var/y = 0 + var/z = 0 + +/datum/point/proc/valid() + return x && y && z + +/datum/point/proc/copy_to(datum/point/p = new) + p.x = x + p.y = y + p.z = z + return p + +/datum/point/New(_x, _y, _z, _pixel_x = 0, _pixel_y = 0) //first argument can also be a /datum/position or /atom. + if(istype(_x, /datum/position)) + var/datum/position/P = _x + _x = P.x + _y = P.y + _z = P.z + _pixel_x = P.pixel_x + _pixel_y = P.pixel_y + else if(istype(_x, /atom)) + var/atom/A = _x + _x = A.x + _y = A.y + _z = A.z + _pixel_x = A.pixel_x + _pixel_y = A.pixel_y + initialize_location(_x, _y, _z, _pixel_x, _pixel_y) + +/datum/point/proc/initialize_location(tile_x, tile_y, tile_z, p_x = 0, p_y = 0) + if(!isnull(tile_x)) + x = ((tile_x - 1) * world.icon_size) + world.icon_size / 2 + p_x + if(!isnull(tile_y)) + y = ((tile_y - 1) * world.icon_size) + world.icon_size / 2+ p_y + if(!isnull(tile_z)) + z = tile_z + +/datum/point/proc/return_turf() + return locate(CEILING(x / world.icon_size, 1), CEILING(y / world.icon_size, 1), z) + +/datum/point/proc/return_coordinates() //[turf_x, turf_y, z] + return list(CEILING(x / world.icon_size, 1), CEILING(y / world.icon_size, 1), z) + +/datum/point/proc/return_position() + return new /datum/position(src) + +/datum/point/proc/return_px() + return MODULUS(x, world.icon_size) - 16 + +/datum/point/proc/return_py() + return MODULUS(y, world.icon_size) - 16 + +/datum/point/proc/mapcheck() + . = FALSE + var/maxx = world.icon_size * world.maxx + var/maxy = world.icon_size * world.maxy + var/move_zx = 0 + var/move_zy = 0 + if(x < 0) + x += maxx + move_zx -= 1 + if(y < 0) + y += maxy + move_zy -= 1 + if(x > maxx) + x -= maxx + move_zx += 1 + if(y > maxy) + y -= maxy + move_zy += 1 + var/datum/space_level/S = SSmapping.get_level(z) + if(move_zx != 0) + var/datum/space_level/L = S.neigbours["[move_zx < 0? WEST : EAST]"] + z = L.z_value + . = TRUE + if(move_zy != 0) + var/datum/space_level/L = S.neigbours["[move_zy < 0? SOUTH : NORTH]"] + z = L.z_value + . = TRUE + +/datum/point/vector + var/speed = 32 //pixels per iteration + var/iteration = 0 + var/angle = 0 + var/mpx = 0 //calculated x/y movement amounts to prevent having to do trig every step. + var/mpy = 0 + var/starting_x = 0 //just like before, pixels from EDGE of map! This is set in initialize_location(). + var/starting_y = 0 + var/starting_z = 0 + +/datum/point/vector/New(_x, _y, _z, _pixel_x = 0, _pixel_y = 0, _angle, _speed) + ..() + initialize_trajectory(_speed, _angle) + +/datum/point/vector/initialize_location(tile_x, tile_y, tile_z, p_x = 0, p_y = 0) + . = ..() + starting_x = x + starting_y = y + starting_z = z + +/datum/point/vector/copy_to(datum/point/vector/v = new) + ..(v) + v.speed = speed + v.iteration = iteration + v.angle = angle + v.mpx = mpx + v.mpy = mpy + v.starting_x = starting_x + v.starting_y = starting_y + v.starting_z = starting_z + return v + +/datum/point/vector/proc/initialize_trajectory(pixel_speed, new_angle) + if(!isnull(pixel_speed)) + speed = pixel_speed + set_angle(new_angle) + +/datum/point/vector/proc/set_angle(new_angle) //calculations use "byond angle" where north is 0 instead of 90, and south is 180 instead of 270. + if(isnull(angle)) + return + angle = new_angle + update_offsets() + +/datum/point/vector/proc/update_offsets() + mpx = sin(angle) * speed + mpy = cos(angle) * speed + +/datum/point/vector/proc/set_speed(new_speed) + if(isnull(new_speed) || speed == new_speed) + return + speed = new_speed + update_offsets() + +/datum/point/vector/proc/increment(multiplier = 1) + iteration++ + x += mpx * 1 + y += mpy * 1 + if(mapcheck()) + on_z_change() + +/datum/point/vector/proc/return_vector_after_increments(amount = 7, multiplier = 1, force_simulate = FALSE) + var/datum/point/vector/v = copy_to() + if(force_simulate) + for(var/i in 1 to amount) + v.increment(multiplier) + else + v.increment(multiplier * amount) + return v + +/datum/point/vector/proc/on_z_change() + return + +/datum/point/vector/processed //pixel_speed is per decisecond. + var/last_process = 0 + var/last_move = 0 + var/paused = FALSE + +/datum/point/vector/processed/Destroy() + STOP_PROCESSING(SSprojectiles, src) + +/datum/point/vector/processed/proc/start() + last_process = world.time + last_move = world.time + START_PROCESSING(SSprojectiles, src) + +/datum/point/vector/processed/process() + if(paused) + last_move += world.time - last_process + last_process = world.time + return + var/needed_time = world.time - last_move + last_process = world.time + last_move = world.time + increment(needed_time) diff --git a/code/game/gamemodes/blob/blob_report.dm b/code/game/gamemodes/blob/blob_report.dm index 6585da0ba4..4385b732c3 100644 --- a/code/game/gamemodes/blob/blob_report.dm +++ b/code/game/gamemodes/blob/blob_report.dm @@ -8,7 +8,7 @@ var/mach = 0 /datum/station_state/proc/count() - for(var/Z in GLOB.station_z_levels) + for(var/Z in SSmapping.levels_by_trait(ZTRAIT_STATION)) for(var/turf/T in block(locate(1,1,Z), locate(world.maxx,world.maxy,Z))) // don't count shuttles since they may have just left if(istype(T.loc, /area/shuttle)) diff --git a/code/game/gamemodes/cit_objectives.dm b/code/game/gamemodes/cit_objectives.dm index faa376571c..fbcfc675e3 100644 --- a/code/game/gamemodes/cit_objectives.dm +++ b/code/game/gamemodes/cit_objectives.dm @@ -98,9 +98,9 @@ for(var/mob/living/carbon/C in GLOB.mob_list) var/mob/living/simple_animal/borer/D = C.has_brain_worms() var/turf/location = get_turf(C) - if(location.z == ZLEVEL_CENTCOM && D && D.stat != DEAD) + if(is_centcom_level(location.z) && D && D.stat != DEAD) total_borer_hosts++ if(target_amount <= total_borer_hosts) return TRUE else - return FALSE \ No newline at end of file + return FALSE diff --git a/code/game/gamemodes/clock_cult/clock_effects/clock_sigils.dm b/code/game/gamemodes/clock_cult/clock_effects/clock_sigils.dm index e60b72073f..2ce9bf31d4 100644 --- a/code/game/gamemodes/clock_cult/clock_effects/clock_sigils.dm +++ b/code/game/gamemodes/clock_cult/clock_effects/clock_sigils.dm @@ -140,6 +140,9 @@ hierophant_message("With the conversion of a new servant the Ark's power grows. Application scriptures are now available.") if(add_servant_of_ratvar(L)) L.log_message("Conversion was done with a [sigil_name].", INDIVIDUAL_ATTACK_LOG) + if(iscarbon(L)) + var/mob/living/carbon/M = L + M.uncuff() L.Knockdown(50) //Completely defenseless for five seconds - mainly to give them time to read over the information they've just been presented with if(iscarbon(L)) var/mob/living/carbon/C = L diff --git a/code/game/gamemodes/clock_cult/clock_structures/ark_of_the_clockwork_justicar.dm b/code/game/gamemodes/clock_cult/clock_structures/ark_of_the_clockwork_justicar.dm index 36a74ec62b..15dd038cf6 100644 --- a/code/game/gamemodes/clock_cult/clock_structures/ark_of_the_clockwork_justicar.dm +++ b/code/game/gamemodes/clock_cult/clock_structures/ark_of_the_clockwork_justicar.dm @@ -146,12 +146,15 @@ countdown = null for(var/mob/L in GLOB.player_list) if(L.z == z) - L.forceMove(get_turf(pick(GLOB.generic_event_spawns))) + var/atom/movable/target = L + if(isobj(L.loc)) + target = L.loc + target.forceMove(get_turf(pick(GLOB.generic_event_spawns))) L.overlay_fullscreen("flash", /obj/screen/fullscreen/flash/static) - L.clear_fullscreen("flash", 30) - if(isliving(L)) - var/mob/living/LI = L - LI.Stun(50) + L.clear_fullscreen("flash", 30) + if(isliving(L)) + var/mob/living/LI = L + LI.Stun(50) for(var/obj/effect/clockwork/city_of_cogs_rift/R in GLOB.all_clockwork_objects) qdel(R) if(GLOB.ark_of_the_clockwork_justiciar == src) diff --git a/code/game/gamemodes/clock_cult/clock_structures/traps/brass_skewer.dm b/code/game/gamemodes/clock_cult/clock_structures/traps/brass_skewer.dm index c91cf594e8..ea56aaa833 100644 --- a/code/game/gamemodes/clock_cult/clock_structures/traps/brass_skewer.dm +++ b/code/game/gamemodes/clock_cult/clock_structures/traps/brass_skewer.dm @@ -102,8 +102,8 @@ return wiggle_wiggle = FALSE else - user.visible_message("You start tenderly lifting [user] off of [src]...", \ - "You start tenderly lifting [user] off of [src]...") + user.visible_message("[user] starts tenderly lifting [skewee] off of [src]...", \ + "You start tenderly lifting [skewee] off of [src]...") if(!do_after(user, 60, target = skewee)) skewee.visible_message("[skewee] painfully slides back down [src].") skewee.emote("moan") diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm index 9e0c965271..13ab7a8bb1 100644 --- a/code/game/gamemodes/meteor/meteors.dm +++ b/code/game/gamemodes/meteor/meteors.dm @@ -31,7 +31,7 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event var/max_i = 10//number of tries to spawn meteor. while(!isspaceturf(pickedstart)) var/startSide = pick(GLOB.cardinals) - var/startZ = pick(GLOB.station_z_levels) + var/startZ = pick(SSmapping.levels_by_trait(ZTRAIT_STATION)) pickedstart = spaceDebrisStartLoc(startSide, startZ) pickedgoal = spaceDebrisFinishLoc(startSide, startZ) max_i-- @@ -40,7 +40,6 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event var/Me = pickweight(meteortypes) var/obj/effect/meteor/M = new Me(pickedstart, pickedgoal) M.dest = pickedgoal - M.z_original = M.z /proc/spaceDebrisStartLoc(startSide, Z) var/starty @@ -95,7 +94,7 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event pass_flags = PASSTABLE var/heavy = 0 var/meteorsound = 'sound/effects/meteorimpact.ogg' - var/z_original = ZLEVEL_STATION_PRIMARY + var/z_original var/threat = 0 // used for determining which meteors are most interesting var/lifetime = DEFAULT_METEOR_LIFETIME var/timerid = null @@ -126,6 +125,7 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event /obj/effect/meteor/Initialize(mapload, target) . = ..() + z_original = z GLOB.meteor_list += src SSaugury.register_doom(src, threat) SpinAnimation() diff --git a/code/game/machinery/computer/apc_control.dm b/code/game/machinery/computer/apc_control.dm index e9390a3cf5..7bd6cf46e0 100644 --- a/code/game/machinery/computer/apc_control.dm +++ b/code/game/machinery/computer/apc_control.dm @@ -138,7 +138,7 @@ APC.interact(usr, GLOB.not_incapacitated_state) playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) message_admins("[key_name_admin(usr)] remotely accessed [APC] from [src] at [get_area(src)].") - log_game("[key_name_admin(usr)] remotely accessed [APC] from [src] at [get_area(src)].") + log_game("[key_name(usr)] remotely accessed [APC] from [src] at [get_area(src)].") if(APC.locked) APC.say("Remote access detected. Interface unlocked.") playsound(APC, 'sound/machines/boltsup.ogg', 25, 0) @@ -196,7 +196,7 @@ if(emagged) return user.visible_message("You emag [src], disabling precise logging and allowing you to clear logs.") - log_game("[key_name_admin(user)] emagged [src] at [get_area(src)], disabling operator tracking.") + log_game("[key_name(user)] emagged [src] at [get_area(src)], disabling operator tracking.") playsound(src, "sparks", 50, 1) emagged = TRUE diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index 7c790f63de..f007050560 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -17,7 +17,7 @@ /obj/machinery/computer/camera_advanced/Initialize() . = ..() if(station_lock_override) - z_lock = GLOB.station_z_levels.Copy() + z_lock = SSmapping.levels_by_trait(ZTRAIT_STATION) /obj/machinery/computer/camera_advanced/syndie icon_keyboard = "syndie_key" diff --git a/code/game/machinery/dance_machine.dm b/code/game/machinery/dance_machine.dm index 79ec733303..62d203464c 100644 --- a/code/game/machinery/dance_machine.dm +++ b/code/game/machinery/dance_machine.dm @@ -1,4 +1,4 @@ -// DISCO DANCE MACHINE - For engineering power optimization incentive nurturing test system (POINTS) +// DISCO DANCE MACHINE - For admin, engineering and shuttle memes/abuse. /obj/machinery/disco name = "radiant dance machine mark IV" @@ -23,6 +23,14 @@ ) var/datum/track/selection = null +/obj/machinery/disco/indestructible + name = "radiant dance machine mark V" + desc = "Now redesigned with data gathered from the extensive disco and plasma research." + req_access = null + anchored = TRUE + resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF + flags_1 = NODECONSTRUCT_1 + /datum/track var/song_name = "generic" var/song_path = null @@ -59,7 +67,7 @@ return ..() /obj/machinery/disco/attackby(obj/item/O, mob/user, params) - if(!active) + if(!active && !(flags_1 & NODECONSTRUCT_1)) if(istype(O, /obj/item/wrench)) if(!anchored && !isinspace()) to_chat(user,"You secure [src] to the floor.") diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index cb83a1adbc..4e899aa324 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -56,7 +56,7 @@ GLOB.bombers += "[key_name(user)] attached a [item] to a transfer valve." message_admins("[key_name_admin(user)] attached a [item] to a transfer valve.") - log_game("[key_name_admin(user)] attached a [item] to a transfer valve.") + log_game("[key_name(user)] attached a [item] to a transfer valve.") attacher = user return diff --git a/code/game/objects/items/implants/implantchair.dm b/code/game/objects/items/implants/implantchair.dm index 7dd14bda88..448b32e2d5 100644 --- a/code/game/objects/items/implants/implantchair.dm +++ b/code/game/objects/items/implants/implantchair.dm @@ -185,11 +185,11 @@ return 0 objective = stripped_input(usr,"What order do you want to imprint on [C]?","Enter the order","",120) message_admins("[key_name_admin(user)] set brainwash machine objective to '[objective]'.") - log_game("[key_name_admin(user)] set brainwash machine objective to '[objective]'.") + log_game("[key_name(user)] set brainwash machine objective to '[objective]'.") var/datum/objective/custom_objective = new/datum/objective(objective) custom_objective.owner = C.mind C.mind.objectives += custom_objective C.mind.announce_objectives() message_admins("[key_name_admin(user)] brainwashed [key_name_admin(C)] with objective '[objective]'.") - log_game("[key_name_admin(user)] brainwashed [key_name_admin(C)] with objective '[objective]'.") + log_game("[key_name(user)] brainwashed [key_name(C)] with objective '[objective]'.") return 1 diff --git a/code/game/objects/items/tanks/watertank.dm b/code/game/objects/items/tanks/watertank.dm index f1cc7c7c25..dc0540307e 100644 --- a/code/game/objects/items/tanks/watertank.dm +++ b/code/game/objects/items/tanks/watertank.dm @@ -290,7 +290,7 @@ resin_cooldown = TRUE R.remove_any(100) var/obj/effect/resin_container/A = new (get_turf(src)) - log_game("[key_name_admin(user)] used Resin Launcher at [get_area(user)] [COORD(user)].") + log_game("[key_name(user)] used Resin Launcher at [get_area(user)] [COORD(user)].") playsound(src,'sound/items/syringeproj.ogg',40,1) for(var/a=0, a<5, a++) step_towards(A, target) diff --git a/code/game/turfs/simulated/minerals.dm b/code/game/turfs/simulated/minerals.dm index c737848749..47ec9d032b 100644 --- a/code/game/turfs/simulated/minerals.dm +++ b/code/game/turfs/simulated/minerals.dm @@ -414,7 +414,7 @@ message_admins("An explosion has triggered a gibtonite deposit reaction at [A.name] [ADMIN_JMP(bombturf)].") if(!triggered_by_explosion) - log_game("[key_name(user)] has triggered a gibtonite deposit reaction at [A.name] [ADMIN_JMP(bombturf)].") + log_game("[key_name(user)] has triggered a gibtonite deposit reaction at [A.name] [COORD(bombturf)].") else log_game("An explosion has triggered a gibtonite deposit reaction at [A.name] [COORD(bombturf)]") diff --git a/code/game/turfs/simulated/river.dm b/code/game/turfs/simulated/river.dm index a5753edcd1..79846791d3 100644 --- a/code/game/turfs/simulated/river.dm +++ b/code/game/turfs/simulated/river.dm @@ -4,7 +4,7 @@ #define RANDOM_LOWER_X 50 #define RANDOM_LOWER_Y 50 -/proc/spawn_rivers(target_z = ZLEVEL_LAVALAND, nodes = 4, turf_type = /turf/open/lava/smooth/lava_land_surface, whitelist_area = /area/lavaland/surface/outdoors, min_x = RANDOM_LOWER_X, min_y = RANDOM_LOWER_Y, max_x = RANDOM_UPPER_X, max_y = RANDOM_UPPER_Y) +/proc/spawn_rivers(target_z, nodes = 4, turf_type = /turf/open/lava/smooth/lava_land_surface, whitelist_area = /area/lavaland/surface/outdoors, min_x = RANDOM_LOWER_X, min_y = RANDOM_LOWER_Y, max_x = RANDOM_UPPER_X, max_y = RANDOM_UPPER_Y) var/list/river_nodes = list() var/num_spawned = 0 while(num_spawned < nodes) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 79d9838ea2..27fdf2f95f 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -20,7 +20,7 @@ return if(!isobserver(usr)) - log_game("[key_name_admin(usr)] checked the player panel while in game.") + log_game("[key_name(usr)] checked the player panel while in game.") if(!M) to_chat(usr, "You seem to be selecting a mob that doesn't exist anymore.") diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index bd104f86ab..0cf917d840 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1242,7 +1242,7 @@ to_chat(usr, "Failed to apply ban.") return ban_unban_log_save("[key_name(usr)] has permabanned [key_name(M)]. - Reason: [reason] - This is a permanent ban.") - log_admin_private("[key_name(usr)] has banned [key_name_admin(M)].\nReason: [reason]\nThis is a permanent ban.") + log_admin_private("[key_name(usr)] has banned [key_name(M)].\nReason: [reason]\nThis is a permanent ban.") var/msg = "[key_name_admin(usr)] has banned [key_name_admin(M)].\nReason: [reason]\nThis is a permanent ban." message_admins(msg) var/datum/admin_help/AH = M.client ? M.client.current_ticket : null diff --git a/code/modules/admin/verbs/atmosdebug.dm b/code/modules/admin/verbs/atmosdebug.dm index 8c564551ba..1f14934065 100644 --- a/code/modules/admin/verbs/atmosdebug.dm +++ b/code/modules/admin/verbs/atmosdebug.dm @@ -9,17 +9,17 @@ //all plumbing - yes, some things might get stated twice, doesn't matter. for (var/obj/machinery/atmospherics/plumbing in GLOB.machines) if (plumbing.nodealert) - to_chat(usr, "Unconnected [plumbing.name] located at [plumbing.x],[plumbing.y],[plumbing.z] ([get_area(plumbing.loc)])") + to_chat(usr, "Unconnected [plumbing.name] located at [ADMIN_COORDJMP(plumbing)] ([get_area(plumbing.loc)])") //Manifolds for (var/obj/machinery/atmospherics/pipe/manifold/pipe in GLOB.machines) if (!pipe.nodes[1] || !pipe.nodes[2] || !pipe.nodes[3]) - to_chat(usr, "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])") + to_chat(usr, "Unconnected [pipe.name] located at [ADMIN_COORDJMP(pipe)] ([get_area(pipe.loc)])") //Pipes for (var/obj/machinery/atmospherics/pipe/simple/pipe in GLOB.machines) if (!pipe.nodes[1] || !pipe.nodes[2]) - to_chat(usr, "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])") + to_chat(usr, "Unconnected [pipe.name] located at [ADMIN_COORDJMP(pipe)] ([get_area(pipe.loc)])") /client/proc/powerdebug() set category = "Mapping" @@ -33,9 +33,9 @@ if (!PN.nodes || !PN.nodes.len) if(PN.cables && (PN.cables.len > 1)) var/obj/structure/cable/C = PN.cables[1] - to_chat(usr, "Powernet with no nodes! (number [PN.number]) - example cable at [C.x], [C.y], [C.z] in area [get_area(C.loc)]") + to_chat(usr, "Powernet with no nodes! (number [PN.number]) - example cable at [ADMIN_COORDJMP(C)] in area [get_area(C.loc)]") if (!PN.cables || (PN.cables.len < 10)) if(PN.cables && (PN.cables.len > 1)) var/obj/structure/cable/C = PN.cables[1] - to_chat(usr, "Powernet with fewer than 10 cables! (number [PN.number]) - example cable at [C.x], [C.y], [C.z] in area [get_area(C.loc)]") \ No newline at end of file + to_chat(usr, "Powernet with fewer than 10 cables! (number [PN.number]) - example cable at [ADMIN_COORDJMP(C)] in area [get_area(C.loc)]") diff --git a/code/modules/admin/verbs/manipulate_organs.dm b/code/modules/admin/verbs/manipulate_organs.dm index 3ff0ff75ac..e82a99815e 100644 --- a/code/modules/admin/verbs/manipulate_organs.dm +++ b/code/modules/admin/verbs/manipulate_organs.dm @@ -14,6 +14,8 @@ organ = organs[organ] organ = new organ organ.Insert(C) + log_admin("[key_name(usr)] has added organ [organ.type] to [key_name(C)]") + message_admins("[key_name_admin(usr)] has added organ [organ.type] to [key_name(C)]") if("add implant") for(var/path in subtypesof(/obj/item/implant)) @@ -24,6 +26,8 @@ organ = organs[organ] organ = new organ organ.implant(C) + log_admin("[key_name(usr)] has added implant [organ.type] to [key_name(C)]") + message_admins("[key_name_admin(usr)] has added implant [organ.type] to [key_name(C)]") if("drop organ/implant", "remove organ/implant") for(var/X in C.internal_organs) @@ -41,6 +45,9 @@ var/obj/item/organ/O var/obj/item/implant/I + log_admin("[key_name(usr)] has removed [organ.type] from [key_name(C)]") + message_admins("[key_name_admin(usr)] has removed [organ.type] from [key_name(C)]") + if(isorgan(organ)) O = organ O.Remove(C) diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index ce50378f4d..539d3987f8 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -45,7 +45,8 @@ GLOBAL_LIST_INIT(admin_verbs_debug_mapping, list( /client/proc/start_line_profiling, /client/proc/stop_line_profiling, /client/proc/show_line_profiling, - /client/proc/create_mapping_job_icons + /client/proc/create_mapping_job_icons, + /client/proc/debug_z_levels, )) /obj/effect/debugging/mapfix_marker @@ -96,28 +97,28 @@ GLOBAL_LIST_INIT(admin_verbs_debug_mapping, list( for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) CL += C - var/output = {"CAMERA ANNOMALITIES REPORT
| [part.Join(" | ")] |