diff --git a/SpacemanDMM.toml b/SpacemanDMM.toml index 500be06fa6..771e48d2ef 100644 --- a/SpacemanDMM.toml +++ b/SpacemanDMM.toml @@ -3,3 +3,6 @@ macro_redefined = "off" macro_undefined_no_definition = "off" as_local_var = "off" tmp_no_effect = "off" + +[langserver] +dreamchecker = true diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 6bd32c762c..39e9e44da2 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -146,7 +146,7 @@ Pipelines + Other Objects -> Pipe network /obj/machinery/atmospherics/proc/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network) // Used when two pipe_networks are combining -/obj/machinery/atmospherics/proc/return_network_air(datum/network/reference) +/obj/machinery/atmospherics/proc/return_network_air(datum/pipe_network/reference) // Return a list of gas_mixture(s) in the object // associated with reference pipe_network for use in rebuilding the networks gases list // Is permitted to return null diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm index e960d36fa7..8d30c946ca 100644 --- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm +++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm @@ -145,7 +145,7 @@ radio_controller.remove_object(src, frequency) frequency = new_frequency if(frequency) - radio_connection = radio_controller.add_object(src, frequency, filter = RADIO_ATMOSIA) + radio_connection = radio_controller.add_object(src, frequency, radio_filter = RADIO_ATMOSIA) /obj/machinery/atmospherics/binary/passive_gate/proc/broadcast_status() if(!radio_connection) @@ -165,7 +165,7 @@ "sigtype" = "status" ) - radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) + radio_connection.post_signal(src, signal, radio_filter = RADIO_ATMOSIA) return 1 diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 54e034dc92..05922103ff 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -121,7 +121,7 @@ Thus, the two variables affect pump operation are set in New(): radio_controller.remove_object(src, frequency) frequency = new_frequency if(frequency) - radio_connection = radio_controller.add_object(src, frequency, filter = RADIO_ATMOSIA) + radio_connection = radio_controller.add_object(src, frequency, radio_filter = RADIO_ATMOSIA) /obj/machinery/atmospherics/binary/pump/proc/broadcast_status() if(!radio_connection) @@ -139,7 +139,7 @@ Thus, the two variables affect pump operation are set in New(): "sigtype" = "status" ) - radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) + radio_connection.post_signal(src, signal, radio_filter = RADIO_ATMOSIA) return 1 diff --git a/code/ATMOSPHERICS/components/shutoff.dm b/code/ATMOSPHERICS/components/shutoff.dm index d7d8076214..7517cbd7ef 100644 --- a/code/ATMOSPHERICS/components/shutoff.dm +++ b/code/ATMOSPHERICS/components/shutoff.dm @@ -66,7 +66,7 @@ GLOBAL_LIST_EMPTY(shutoff_valves) // Breadth-first search for any leaking pipes that we can directly see /obj/machinery/atmospherics/valve/shutoff/proc/find_leaks() - var/obj/machinery/atmospherics/list/search = list() + var/list/obj/machinery/atmospherics/search = list() // We're the leak! if(!node1 || !node2) diff --git a/code/ATMOSPHERICS/components/tvalve.dm b/code/ATMOSPHERICS/components/tvalve.dm index c0d796d45b..7deca38847 100644 --- a/code/ATMOSPHERICS/components/tvalve.dm +++ b/code/ATMOSPHERICS/components/tvalve.dm @@ -232,7 +232,7 @@ return 1 -/obj/machinery/atmospherics/tvalve/return_network_air(datum/network/reference) +/obj/machinery/atmospherics/tvalve/return_network_air(datum/pipe_network/reference) return null /obj/machinery/atmospherics/tvalve/disconnect(obj/machinery/atmospherics/reference) diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm index 3ded7b7388..c890938100 100644 --- a/code/ATMOSPHERICS/components/valve.dm +++ b/code/ATMOSPHERICS/components/valve.dm @@ -201,7 +201,7 @@ return 1 -/obj/machinery/atmospherics/valve/return_network_air(datum/network/reference) +/obj/machinery/atmospherics/valve/return_network_air(datum/pipe_network/reference) return null /obj/machinery/atmospherics/valve/disconnect(obj/machinery/atmospherics/reference) diff --git a/code/ATMOSPHERICS/mainspipe.dm b/code/ATMOSPHERICS/mainspipe.dm index ac2b3193c9..e7a0d09477 100644 --- a/code/ATMOSPHERICS/mainspipe.dm +++ b/code/ATMOSPHERICS/mainspipe.dm @@ -74,7 +74,6 @@ obj/machinery/atmospherics/mains_pipe update_icon() proc/burst() - ..() for(var/obj/machinery/atmospherics/pipe/mains_component/pipe in contents) burst() diff --git a/code/__defines/spaceman_dmm.dm b/code/__defines/spaceman_dmm.dm new file mode 100644 index 0000000000..94f1743377 --- /dev/null +++ b/code/__defines/spaceman_dmm.dm @@ -0,0 +1,31 @@ +// Interfaces for the SpacemanDMM linter, define'd to nothing when the linter +// is not in use. + +// The SPACEMAN_DMM define is set by the linter and other tooling when it runs. +#ifdef SPACEMAN_DMM + #define RETURN_TYPE(X) set SpacemanDMM_return_type = X + #define SHOULD_CALL_PARENT(X) set SpacemanDMM_should_call_parent = X + #define UNLINT(X) SpacemanDMM_unlint(X) + #define SHOULD_NOT_OVERRIDE(X) set SpacemanDMM_should_not_override = X + #define SHOULD_NOT_SLEEP(X) set SpacemanDMM_should_not_sleep = X + #define SHOULD_BE_PURE(X) set SpacemanDMM_should_be_pure = X + #define PRIVATE_PROC(X) set SpacemanDMM_private_proc = X + #define PROTECTED_PROC(X) set SpacemanDMM_protected_proc = X + #define CAN_BE_REDEFINED(X) set SpacemanDMM_can_be_redefined = X + #define VAR_FINAL var/SpacemanDMM_final + #define VAR_PRIVATE var/SpacemanDMM_private + #define VAR_PROTECTED var/SpacemanDMM_protected +#else + #define RETURN_TYPE(X) + #define SHOULD_CALL_PARENT(X) + #define UNLINT(X) X + #define SHOULD_NOT_OVERRIDE(X) + #define SHOULD_NOT_SLEEP(X) + #define SHOULD_BE_PURE(X) + #define PRIVATE_PROC(X) + #define PROTECTED_PROC(X) + #define CAN_BE_REDEFINED(X) + #define VAR_FINAL var + #define VAR_PRIVATE var + #define VAR_PROTECTED var +#endif diff --git a/code/__defines/subsystems.dm b/code/__defines/subsystems.dm index 326ae19397..831155c1d7 100644 --- a/code/__defines/subsystems.dm +++ b/code/__defines/subsystems.dm @@ -112,7 +112,7 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G // Macro defining the actual code applying our overlays lists to the BYOND overlays list. (I guess a macro for speed) // TODO - I don't really like the location of this macro define. Consider it. ~Leshana #define COMPILE_OVERLAYS(A)\ - if (TRUE) {\ + do {\ var/list/oo = A.our_overlays;\ var/list/po = A.priority_overlays;\ if(LAZYLEN(po)){\ @@ -130,4 +130,4 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G A.overlays.Cut();\ }\ A.flags &= ~OVERLAY_QUEUED;\ - } + } while (FALSE) diff --git a/code/_global_vars/lists/species.dm b/code/_global_vars/lists/species.dm index 5b467f573f..f35568b07a 100644 --- a/code/_global_vars/lists/species.dm +++ b/code/_global_vars/lists/species.dm @@ -1,6 +1,6 @@ //Languages/species/whitelist. -GLOBAL_LIST_INIT(all_species, list()) -GLOBAL_LIST_INIT(all_languages, list()) +GLOBAL_LIST_EMPTY_TYPED(all_species, /datum/species) +GLOBAL_LIST_EMPTY_TYPED(all_languages, /datum/language) GLOBAL_LIST_INIT(language_name_conflicts, list()) GLOBAL_LIST_INIT(language_keys, list()) // Table of say codes for all languages GLOBAL_LIST_INIT(language_key_conflicts, list()) diff --git a/code/_helpers/events.dm b/code/_helpers/events.dm index 2d15bb3aa9..5f2e605512 100644 --- a/code/_helpers/events.dm +++ b/code/_helpers/events.dm @@ -10,7 +10,7 @@ // Otherwise add it and all subtypes that exist on the map to our grand list for(var/areapath in typesof(parentpath)) var/area/A = locate(areapath) // Check if it actually exists - if(istype(A) && A.z in using_map.player_levels) + if(istype(A) && (A.z in using_map.player_levels)) grand_list_of_areas += A return grand_list_of_areas diff --git a/code/_helpers/game.dm b/code/_helpers/game.dm index 3af60de770..29622f25c6 100644 --- a/code/_helpers/game.dm +++ b/code/_helpers/game.dm @@ -27,6 +27,7 @@ return max_z /proc/get_area(atom/A) + RETURN_TYPE(/area) if(isarea(A)) return A var/turf/T = get_turf(A) diff --git a/code/_helpers/logging.dm b/code/_helpers/logging.dm index 56f2882957..7656880a91 100644 --- a/code/_helpers/logging.dm +++ b/code/_helpers/logging.dm @@ -189,6 +189,7 @@ /proc/log_ghostsay(text, mob/speaker) if (config.log_say) WRITE_LOG(diary, "DEADCHAT: [speaker.simple_info_line()]: [html_decode(text)]") +<<<<<<< HEAD //CHOMPEdit Begin if(speaker.client) if(!SSdbcore.IsConnected()) @@ -205,6 +206,17 @@ //speaker.dialogue_log += "([time_stamp()]) ([speaker]/[speaker.client]) DEADSAY: - [text]" //GLOB.round_text_log += "([time_stamp()]) ([src]/[speaker.client]) DEADSAY: - [text]" //CHOMPEdit End +||||||| parent of da4837903c... Merge pull request #10433 from VOREStation/upstream-merge-8085 + + speaker.dialogue_log += "([time_stamp()]) ([speaker]/[speaker.client]) DEADSAY: - [text]" + GLOB.round_text_log += "([time_stamp()]) ([src]/[speaker.client]) DEADSAY: - [text]" + +======= + + speaker.dialogue_log += "([time_stamp()]) ([speaker]/[speaker.client]) DEADSAY: - [text]" + GLOB.round_text_log += "([time_stamp()]) ([speaker]/[speaker.client]) DEADSAY: - [text]" + +>>>>>>> da4837903c... Merge pull request #10433 from VOREStation/upstream-merge-8085 /proc/log_ghostemote(text, mob/speaker) if (config.log_emote) diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index b006d63581..1c831efa3d 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -19,11 +19,9 @@ if (!( istext(HTMLstring) )) CRASH("Given non-text argument!") - return else if (length(HTMLstring) != 7) CRASH("Given non-HTML argument!") - return var/textr = copytext(HTMLstring, 2, 4) var/textg = copytext(HTMLstring, 4, 6) var/textb = copytext(HTMLstring, 6, 8) @@ -40,7 +38,6 @@ if (length(textb) < 2) textr = text("0[]", textb) return text("#[][][]", textr, textg, textb) - return //Returns the middle-most value /proc/dd_range(var/low, var/high, var/num) @@ -1130,8 +1127,6 @@ proc/is_hot(obj/item/W as obj) else return 0 - return 0 - //Whether or not the given item counts as sharp in terms of dealing damage /proc/is_sharp(obj/O as obj) if(!O) diff --git a/code/_macros.dm b/code/_macros.dm index 33bdf30ceb..18a8ddf825 100644 --- a/code/_macros.dm +++ b/code/_macros.dm @@ -11,7 +11,8 @@ #define RANDOM_BLOOD_TYPE pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+") // #define to_chat(target, message) target << message Not anymore! -#define to_chat to_chat_filename=__FILE__;to_chat_line=__LINE__;to_chat_src=src;__to_chat +//#define to_chat to_chat_filename=__FILE__;to_chat_line=__LINE__;to_chat_src=src;__to_chat +#define to_chat __to_chat #define to_world(message) to_chat(world, message) #define to_world_log(message) world.log << message // TODO - Baystation has this log to crazy places. For now lets just world.log, but maybe look into it later. diff --git a/code/controllers/subsystems/chat.dm b/code/controllers/subsystems/chat.dm index 3fda63b5aa..553c30d128 100644 --- a/code/controllers/subsystems/chat.dm +++ b/code/controllers/subsystems/chat.dm @@ -5,7 +5,7 @@ SUBSYSTEM_DEF(chat) priority = FIRE_PRIORITY_CHAT init_order = INIT_ORDER_CHAT - var/list/msg_queue = list() + var/list/list/msg_queue = list() //List of lists /datum/controller/subsystem/chat/Initialize(timeofday) init_vchat() diff --git a/code/controllers/subsystems/events.dm b/code/controllers/subsystems/events.dm index 226c09f492..5b613775e4 100644 --- a/code/controllers/subsystems/events.dm +++ b/code/controllers/subsystems/events.dm @@ -38,7 +38,7 @@ SUBSYSTEM_DEF(events) return for(var/i = EVENT_LEVEL_MUNDANE to EVENT_LEVEL_MAJOR) - var/list/datum/event_container/EC = event_containers[i] + var/datum/event_container/EC = event_containers[i] EC.process() /datum/controller/subsystem/events/stat_entry() diff --git a/code/controllers/subsystems/persistence.dm b/code/controllers/subsystems/persistence.dm index 1667aa8320..792bf63893 100644 --- a/code/controllers/subsystems/persistence.dm +++ b/code/controllers/subsystems/persistence.dm @@ -32,6 +32,10 @@ SUBSYSTEM_DEF(persistence) if(!A || (A.flags & AREA_FLAG_IS_NOT_PERSISTENT)) return +// if((!T.z in GLOB.using_map.station_levels) || !initialized) + if(!(T.z in using_map.station_levels)) + return + if(!(T.z in using_map.persist_levels)) return @@ -57,4 +61,4 @@ SUBSYSTEM_DEF(persistence) dat += "" var/datum/browser/popup = new(user, "admin_persistence", "Persistence Data") popup.set_content(jointext(dat, null)) - popup.open() \ No newline at end of file + popup.open() diff --git a/code/controllers/subsystems/planets.dm b/code/controllers/subsystems/planets.dm index 4cf7222186..d1c2de2410 100644 --- a/code/controllers/subsystems/planets.dm +++ b/code/controllers/subsystems/planets.dm @@ -33,7 +33,7 @@ SUBSYSTEM_DEF(planets) z_to_planet[Z] = NP // DO NOT CALL THIS DIRECTLY UNLESS IT'S IN INITIALIZE, -// USE turf/simulated/proc/make_indoors() and\ +// USE turf/simulated/proc/make_indoors() and // tyrf/simulated/proc/make_outdoors() /datum/controller/subsystem/planets/proc/addTurf(var/turf/T) if(z_to_planet.len >= T.z && z_to_planet[T.z]) diff --git a/code/controllers/subsystems/ticker.dm b/code/controllers/subsystems/ticker.dm index 447fb6c773..813b106138 100644 --- a/code/controllers/subsystems/ticker.dm +++ b/code/controllers/subsystems/ticker.dm @@ -314,7 +314,7 @@ var/global/datum/controller/subsystem/ticker/ticker switch(M.z) if(0) //inside a crate or something var/turf/T = get_turf(M) - if(T && T.z in using_map.station_levels) //we don't use M.death(0) because it calls a for(/mob) loop and + if(T && (T.z in using_map.station_levels)) //we don't use M.death(0) because it calls a for(/mob) loop and M.health = 0 M.set_stat(DEAD) if(1) //on a z-level 1 turf. diff --git a/code/controllers/subsystems/timer.dm b/code/controllers/subsystems/timer.dm index 64a347336a..9c41a0a4ba 100644 --- a/code/controllers/subsystems/timer.dm +++ b/code/controllers/subsystems/timer.dm @@ -159,8 +159,7 @@ SUBSYSTEM_DEF(timer) if (timer.timeToRun < head_offset) bucket_resolution = null //force bucket recreation - CRASH("[i] Invalid timer state: Timer in long run queue with a time to run less then head_offset. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]") - + crash_with("[i] Invalid timer state: Timer in long run queue with a time to run less then head_offset. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]") if (timer.callBack && !timer.spent) timer.callBack.InvokeAsync() spent += timer @@ -171,7 +170,7 @@ SUBSYSTEM_DEF(timer) if (timer.timeToRun < head_offset + TICKS2DS(practical_offset-1)) bucket_resolution = null //force bucket recreation - CRASH("[i] Invalid timer state: Timer in long run queue that would require a backtrack to transfer to short run queue. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]") + crash_with("[i] Invalid timer state: Timer in long run queue that would require a backtrack to transfer to short run queue. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]") if (timer.callBack && !timer.spent) timer.callBack.InvokeAsync() spent += timer diff --git a/code/controllers/subsystems/transcore_vr.dm b/code/controllers/subsystems/transcore_vr.dm index ddfb679932..bd8786ed0c 100644 --- a/code/controllers/subsystems/transcore_vr.dm +++ b/code/controllers/subsystems/transcore_vr.dm @@ -22,10 +22,10 @@ SUBSYSTEM_DEF(transcore) var/cost_backups = 0 var/cost_implants = 0 - var/datum/transhuman/mind_record/list/backed_up = list() // All known mind records, indexed by MR.mindname/mind.name - var/datum/transhuman/mind_record/list/has_left = list() // Why do we even have this? - var/datum/transhuman/body_record/list/body_scans = list() // All known body records, indexed by BR.mydna.name - var/obj/item/weapon/implant/backup/list/implants = list() // All OPERATING implants that are being ticked + var/list/datum/transhuman/mind_record/backed_up = list() // All known mind records, indexed by MR.mindname/mind.name + var/list/datum/transhuman/mind_record/has_left = list() // Why do we even have this? + var/list/datum/transhuman/body_record/body_scans = list() // All known body records, indexed by BR.mydna.name + var/list/obj/item/weapon/implant/backup/implants = list() // All OPERATING implants that are being ticked var/list/current_run = list() @@ -115,14 +115,14 @@ SUBSYSTEM_DEF(transcore) /datum/controller/subsystem/transcore/Recover() if (istype(SStranscore.body_scans)) - for(var/N in SStranscore.body_scans[N]) - if(N) body_scans[N] = SStranscore.body_scans[N] + for(var/N in SStranscore.body_scans) + if(N && SStranscore.body_scans[N]) body_scans[N] = SStranscore.body_scans[N] if(SStranscore.core_dumped) core_dumped = TRUE can_fire = FALSE else if (istype(SStranscore.backed_up)) - for(var/N in SStranscore.backed_up[N]) - if(N) backed_up[N] = SStranscore.backed_up[N] + for(var/N in SStranscore.backed_up) + if(N && SStranscore.backed_up[N]) backed_up[N] = SStranscore.backed_up[N] /datum/controller/subsystem/transcore/proc/m_backup(var/datum/mind/mind, var/obj/item/device/nif/nif, var/one_time = FALSE) ASSERT(mind) diff --git a/code/controllers/subsystems/xenoarch.dm b/code/controllers/subsystems/xenoarch.dm index 2e22213ee6..9851c69278 100644 --- a/code/controllers/subsystems/xenoarch.dm +++ b/code/controllers/subsystems/xenoarch.dm @@ -31,7 +31,7 @@ SUBSYSTEM_DEF(xenoarch) /datum/controller/subsystem/xenoarch/proc/SetupXenoarch() for(var/turf/simulated/mineral/M in world) - if(!M.density || M.z in using_map.xenoarch_exempt_levels) + if(!M.density || (M.z in using_map.xenoarch_exempt_levels)) continue if(isnull(M.geologic_data)) diff --git a/code/datums/beam.dm b/code/datums/beam.dm index fc4e696702..7b5b385932 100644 --- a/code/datums/beam.dm +++ b/code/datums/beam.dm @@ -194,7 +194,7 @@ -/atom/proc/Beam(atom/BeamTarget,icon_state="b_beam",icon='icons/effects/beam.dmi',time=50, maxdistance=10,beam_type=/obj/effect/ebeam,beam_sleep_time=3,beam_color = null) +/atom/proc/Beam(atom/BeamTarget, icon_state="b_beam", icon='icons/effects/beam.dmi', time=50, maxdistance=10, beam_type=/obj/effect/ebeam, beam_sleep_time=3, beam_color = null) var/datum/beam/newbeam = new(src,BeamTarget,icon,icon_state,time,maxdistance,beam_type,beam_sleep_time,beam_color) spawn(0) newbeam.Start() diff --git a/code/datums/category.dm b/code/datums/category.dm index 3bc9640b79..45b2df5996 100644 --- a/code/datums/category.dm +++ b/code/datums/category.dm @@ -67,7 +67,7 @@ datum/category_group/dd_SortValue() *****************/ /datum/category_item var/name = "" - var/list/datum/category_group/category // The group this item belongs to + var/datum/category_group/category // The group this item belongs to /datum/category_item/New(var/datum/category_group/cg) ..() diff --git a/code/datums/components/_component.dm b/code/datums/components/_component.dm index 4ada8af23b..1cb9e0b1c4 100644 --- a/code/datums/components/_component.dm +++ b/code/datums/components/_component.dm @@ -333,7 +333,7 @@ * * datum/component/c_type The typepath of the component you want to get a reference to */ /datum/proc/GetComponent(datum/component/c_type) - // RETURN_TYPE(c_type) + RETURN_TYPE(c_type) if(initial(c_type.dupe_mode) == COMPONENT_DUPE_ALLOWED || initial(c_type.dupe_mode) == COMPONENT_DUPE_SELECTIVE) stack_trace("GetComponent was called to get a component of which multiple copies could be on an object. This can easily break and should be changed. Type: \[[c_type]\]") var/list/dc = datum_components @@ -353,7 +353,7 @@ * * datum/component/c_type The typepath of the component you want to get a reference to */ /datum/proc/GetExactComponent(datum/component/c_type) - // RETURN_TYPE(c_type) + RETURN_TYPE(c_type) if(initial(c_type.dupe_mode) == COMPONENT_DUPE_ALLOWED || initial(c_type.dupe_mode) == COMPONENT_DUPE_SELECTIVE) stack_trace("GetComponent was called to get a component of which multiple copies could be on an object. This can easily break and should be changed. Type: \[[c_type]\]") var/list/dc = datum_components diff --git a/code/datums/components/crafting/crafting.dm b/code/datums/components/crafting/crafting.dm index 9f39990afd..e823199af3 100644 --- a/code/datums/components/crafting/crafting.dm +++ b/code/datums/components/crafting/crafting.dm @@ -357,7 +357,7 @@ container.close_all() qdel(DL) -/datum/component/personal_crafting/proc/component_ui_interact(atom/movable/screen/craft/image, location, control, params, user) +/datum/component/personal_crafting/proc/component_ui_interact(/obj/screen/craft/image, location, control, params, user) // SIGNAL_HANDLER if(user == parent) diff --git a/code/datums/datum.dm b/code/datums/datum.dm index 450e1f5e4d..d457be5196 100644 --- a/code/datums/datum.dm +++ b/code/datums/datum.dm @@ -8,7 +8,7 @@ var/list/active_timers //for SStimer var/list/datum_components //for /datum/components var/list/comp_lookup - var/list/signal_procs + var/list/list/signal_procs // List of lists var/signal_enabled = FALSE var/weakref/weakref // Holder of weakref instance pointing to this datum var/datum_flags = NONE diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index cfd9107898..7b09c83308 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -72,7 +72,7 @@ if(!usr || !result || result == "---Components---" || result == "---Elements---") return if(QDELETED(src)) - to_chat(usr, "That thing doesn't exist anymore!", confidential = TRUE) + to_chat(usr, "That thing doesn't exist anymore!") return var/list/lst = usr.client.get_callproc_args() if(!lst) diff --git a/code/datums/elements/_element.dm b/code/datums/elements/_element.dm index caf02b65b9..46a295f90b 100644 --- a/code/datums/elements/_element.dm +++ b/code/datums/elements/_element.dm @@ -18,7 +18,7 @@ /// Activates the functionality defined by the element on the given target datum /datum/element/proc/Attach(datum/target) - // SHOULD_CALL_PARENT(1) + SHOULD_CALL_PARENT(1) if(type == /datum/element) return ELEMENT_INCOMPATIBLE SEND_SIGNAL(target, COMSIG_ELEMENT_ATTACH, src) @@ -28,7 +28,7 @@ /// Deactivates the functionality defines by the element on the given datum /datum/element/proc/Detach(datum/source, force) SEND_SIGNAL(source, COMSIG_ELEMENT_DETACH, src) - // SHOULD_CALL_PARENT(1) + SHOULD_CALL_PARENT(1) UnregisterSignal(source, COMSIG_PARENT_QDELETING) /datum/element/Destroy(force) diff --git a/code/datums/looping_sounds/sequence.dm b/code/datums/looping_sounds/sequence.dm index 9399619555..650b3c8d5a 100644 --- a/code/datums/looping_sounds/sequence.dm +++ b/code/datums/looping_sounds/sequence.dm @@ -157,7 +157,6 @@ if(!(letter in morse_alphabet)) CRASH("Encountered invalid character in morse sequence \"[letter]\".") - return // So I heard you like sequences... // Play a sequence of sounds while inside the current iteration of the outer sequence. diff --git a/code/datums/mind.dm b/code/datums/mind.dm index c889751475..de91fd48ab 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -239,8 +239,8 @@ var/mob/def_target = null var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain) - if (objective&&(objective.type in objective_list) && objective:target) - def_target = objective:target.current + if (objective&&(objective.type in objective_list) && objective.target) + def_target = objective.target.current var/new_target = input("Select target:", "Objective target", def_target) as null|anything in possible_targets if (!new_target) return diff --git a/code/datums/repositories/decls.dm b/code/datums/repositories/decls.dm index 5217481ad9..c46c8b41bf 100644 --- a/code/datums/repositories/decls.dm +++ b/code/datums/repositories/decls.dm @@ -61,11 +61,11 @@ var/repository/decls/decls_repository = new() fetched_decl_subtypes[decl_prototype] = . /decl/proc/Initialize() - //SHOULD_CALL_PARENT(TRUE) - //SHOULD_NOT_SLEEP(TRUE) + SHOULD_CALL_PARENT(TRUE) + SHOULD_NOT_SLEEP(TRUE) return /decl/Destroy() - //SHOULD_CALL_PARENT(FALSE) + SHOULD_CALL_PARENT(FALSE) crash_with("Prevented attempt to delete a decl instance: [log_info_line(src)]") return QDEL_HINT_LETMELIVE // Prevents decl destruction diff --git a/code/defines/procs/AStar.dm b/code/defines/procs/AStar.dm index 1aef60bf05..3ce268d375 100644 --- a/code/defines/procs/AStar.dm +++ b/code/defines/procs/AStar.dm @@ -39,7 +39,7 @@ length to avoid portals or something i guess?? Not that they're counted right no PriorityQueue var/list/queue - var/proc/comparison_function + var/comparison_function New(compare) queue = list() @@ -123,7 +123,7 @@ PathNode proc/PathWeightCompare(PathNode/a, PathNode/b) return a.estimated_cost - b.estimated_cost -proc/AStar(var/start, var/end, var/proc/adjacent, var/proc/dist, var/max_nodes, var/max_node_depth = 30, var/min_target_dist = 0, var/min_node_dist, var/id, var/datum/exclude) +proc/AStar(var/start, var/end, var/adjacent, var/dist, var/max_nodes, var/max_node_depth = 30, var/min_target_dist = 0, var/min_node_dist, var/id, var/datum/exclude) var/PriorityQueue/open = new /PriorityQueue(/proc/PathWeightCompare) var/list/closed = list() var/list/path diff --git a/code/game/antagonist/alien/borer.dm b/code/game/antagonist/alien/borer.dm index 34b79271f7..2673774d1c 100644 --- a/code/game/antagonist/alien/borer.dm +++ b/code/game/antagonist/alien/borer.dm @@ -68,7 +68,7 @@ var/datum/antagonist/borer/borers /datum/antagonist/borer/proc/get_vents() var/list/vents = list() for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines) - if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in using_map.station_levels) + if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in using_map.station_levels)) if(temp_vent.network.normal_members.len > 50) vents += temp_vent return vents \ No newline at end of file diff --git a/code/game/antagonist/alien/xenomorph.dm b/code/game/antagonist/alien/xenomorph.dm index fa64c879d4..a365259975 100644 --- a/code/game/antagonist/alien/xenomorph.dm +++ b/code/game/antagonist/alien/xenomorph.dm @@ -32,7 +32,7 @@ var/datum/antagonist/xenos/xenomorphs /datum/antagonist/xenos/proc/get_vents() var/list/vents = list() for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines) - if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in using_map.station_levels) + if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in using_map.station_levels)) if(temp_vent.network.normal_members.len > 50) vents += temp_vent return vents diff --git a/code/game/antagonist/antagonist.dm b/code/game/antagonist/antagonist.dm index e00a4a99df..8778cef2cc 100644 --- a/code/game/antagonist/antagonist.dm +++ b/code/game/antagonist/antagonist.dm @@ -179,7 +179,7 @@ /datum/antagonist/proc/draft_antagonist(var/datum/mind/player) //Check if the player can join in this antag role, or if the player has already been given an antag role. - if(!can_become_antag(player) || player.assigned_role in roundstart_restricted) + if(!can_become_antag(player) || (player.assigned_role in roundstart_restricted)) log_debug("[player.key] was selected for [role_text] by lottery, but is not allowed to be that role.") return 0 if(player.special_role) diff --git a/code/game/antagonist/station/highlander.dm b/code/game/antagonist/station/highlander.dm index f483b1df3b..708f047a57 100644 --- a/code/game/antagonist/station/highlander.dm +++ b/code/game/antagonist/station/highlander.dm @@ -47,7 +47,7 @@ var/datum/antagonist/highlander/highlanders var/obj/item/weapon/card/id/W = new(player) W.name = "[player.real_name]'s ID Card" W.icon_state = "centcom" - W.access = get_all_station_access().Copy + W.access = get_all_station_access().Copy() W.access |= get_all_centcom_access() W.assignment = "Highlander" W.registered_name = player.real_name diff --git a/code/game/antagonist/station/rogue_ai.dm b/code/game/antagonist/station/rogue_ai.dm index 2a46cfd0d9..e1b73b064b 100644 --- a/code/game/antagonist/station/rogue_ai.dm +++ b/code/game/antagonist/station/rogue_ai.dm @@ -54,7 +54,7 @@ var/datum/antagonist/rogue_ai/malf if(!istype(A)) error("Non-AI mob designated malf AI! Report this.") to_world("##ERROR: Non-AI mob designated malf AI! Report this.") - return 0 + return A.setup_for_malf() A.laws = new /datum/ai_laws/nanotrasen/malfunction diff --git a/code/game/dna/genes/gene.dm b/code/game/dna/genes/gene.dm index e52cd4e6c0..a448131b85 100644 --- a/code/game/dna/genes/gene.dm +++ b/code/game/dna/genes/gene.dm @@ -27,7 +27,7 @@ * Is the gene active in this mob's DNA? */ /datum/dna/gene/proc/is_active(var/mob/M) - return M.active_genes && type in M.active_genes + return (M.active_genes && (type in M.active_genes)) // Return 1 if we can activate. // HANDLE MUTCHK_FORCED HERE! diff --git a/code/game/dna/genes/powers.dm b/code/game/dna/genes/powers.dm index 0693ffdd08..efb934e504 100644 --- a/code/game/dna/genes/powers.dm +++ b/code/game/dna/genes/powers.dm @@ -164,7 +164,6 @@ return "hulk_[fat]_s" else return "hulk_[g]_s" - return 0 OnMobLife(var/mob/living/carbon/human/M) if(!istype(M)) return diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 89abedd726..6c499c030c 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -111,7 +111,7 @@ var/hadevent = 0 //world << sound('sound/AI/aliens.ogg') var/list/vents = list() for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines) - if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in using_map.station_levels) + if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in using_map.station_levels)) if(temp_vent.network.normal_members.len > 50) // Stops Aliens getting stuck in small networks. See: Security, Virology vents += temp_vent diff --git a/code/game/gamemodes/events/dust.dm b/code/game/gamemodes/events/dust.dm index 526164cd58..750de2ebd5 100644 --- a/code/game/gamemodes/events/dust.dm +++ b/code/game/gamemodes/events/dust.dm @@ -106,7 +106,7 @@ The "dust" will damage the hull of the station causin minor hull breaches. if(life <= 0) walk(src,0) qdel(src) - return 0 + return return diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm index 6d9f5a36ff..03f7474380 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm @@ -194,7 +194,7 @@ sleep(300) // Hack all APCs, including those built during hack sequence. for(var/obj/machinery/power/apc/A in GLOB.apcs) - if((!A.hacker || A.hacker != src) && !A.aidisabled && A.z in using_map.station_levels) + if((!A.hacker || A.hacker != src) && !A.aidisabled && (A.z in using_map.station_levels)) A.ai_hack(src) @@ -206,4 +206,4 @@ user.verbs += new/datum/game_mode/malfunction/verb/ai_destroy_station() -// END ABILITY VERBS \ No newline at end of file +// END ABILITY VERBS diff --git a/code/game/gamemodes/technomancer/spell_objs_helpers.dm b/code/game/gamemodes/technomancer/spell_objs_helpers.dm index cf83640775..27984c1b04 100644 --- a/code/game/gamemodes/technomancer/spell_objs_helpers.dm +++ b/code/game/gamemodes/technomancer/spell_objs_helpers.dm @@ -53,7 +53,7 @@ continue if(L.invisibility > owner.see_invisible) // Don't target ourselves or people we can't see. continue - if(!L in viewers(owner)) // So we don't shoot at walls if someone is hiding behind one. + if(!(L in viewers(owner))) // So we don't shoot at walls if someone is hiding behind one. continue if(!L.stat) // Don't want to target dead people or SSDs. chosen_target = L diff --git a/code/game/jobs/access.dm b/code/game/jobs/access.dm index c946965072..da640bf05c 100644 --- a/code/game/jobs/access.dm +++ b/code/game/jobs/access.dm @@ -104,6 +104,7 @@ /var/list/priv_all_access /proc/get_all_accesses() + RETURN_TYPE(/list) if(!priv_all_access) priv_all_access = get_access_ids() @@ -111,6 +112,7 @@ /var/list/priv_station_access /proc/get_all_station_access() + RETURN_TYPE(/list) if(!priv_station_access) priv_station_access = get_access_ids(ACCESS_TYPE_STATION) @@ -118,6 +120,7 @@ /var/list/priv_centcom_access /proc/get_all_centcom_access() + RETURN_TYPE(/list) if(!priv_centcom_access) priv_centcom_access = get_access_ids(ACCESS_TYPE_CENTCOM) @@ -125,6 +128,7 @@ /var/list/priv_syndicate_access /proc/get_all_syndicate_access() + RETURN_TYPE(/list) if(!priv_syndicate_access) priv_syndicate_access = get_access_ids(ACCESS_TYPE_SYNDICATE) @@ -132,6 +136,7 @@ /var/list/priv_private_access /proc/get_all_private_access() + RETURN_TYPE(/list) if(!priv_private_access) priv_private_access = get_access_ids(ACCESS_TYPE_PRIVATE) diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 24a8f79cbe..263a108de6 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -108,7 +108,7 @@ var/global/datum/controller/occupations/job_master Debug("FOC is_job_whitelisted failed, Player: [player]") continue //VOREStation Code End - if(flag && (!player.client.prefs.be_special & flag)) + if(flag && !(player.client.prefs.be_special & flag)) Debug("FOC flag failed, Player: [player], Flag: [flag], ") continue if(player.client.prefs.GetJobDepartment(job, level) & job.flag) diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 1aa1967d6d..de0d8dbcd9 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -486,7 +486,7 @@ if(unknown_body) imp += "Unknown body present:" - if(!AN && !open && !infected & !imp) + if(!AN && !open && !infected && !imp) AN = "None:" if(!(e.status & ORGAN_DESTROYED)) dat += "
"
+ for(var/t in typesof(/area))
+ master += text("[]\n", t)
+ //Foreach goto(26)
+ src << browse(master)
+ return
+*/
+
+/mob/verb/memory()
+ set name = "Notes"
+ set category = "IC"
+ if(mind)
+ mind.show_memory(src)
+ else
+ to_chat(src, "The game appears to have misplaced your mind datum, so we can't show you your notes.")
+
+/mob/verb/add_memory(msg as message)
+ set name = "Add Note"
+ set category = "IC"
+
+ msg = sanitize(msg)
+
+ if(mind)
+ mind.store_memory(msg)
+ else
+ to_chat(src, "The game appears to have misplaced your mind datum, so we can't show you your notes.")
+
+/mob/proc/store_memory(msg as message, popup, sane = 1)
+ msg = copytext(msg, 1, MAX_MESSAGE_LEN)
+
+ if (sane)
+ msg = sanitize(msg)
+
+ if (length(memory) == 0)
+ memory += msg
+ else
+ memory += "
[msg]"
+
+ if (popup)
+ memory()
+
+/mob/proc/update_flavor_text()
+ set src in usr
+ if(usr != src)
+ to_chat(usr, "No.")
+ var/msg = sanitize(input(usr,"Set the flavor text in your 'examine' verb.","Flavor Text",html_decode(flavor_text)) as message|null, extra = 0) //VOREStation Edit: separating out OOC notes
+
+ if(msg != null)
+ flavor_text = msg
+
+/mob/proc/warn_flavor_changed()
+ if(flavor_text && flavor_text != "") // don't spam people that don't use it!
+ to_chat(src, "OOC Warning:
")
+ to_chat(src, "Your flavor text is likely out of date! Change")
+
+/mob/proc/print_flavor_text()
+ if (flavor_text && flavor_text != "")
+ var/msg = replacetext(flavor_text, "\n", " ")
+ if(length(msg) <= 40)
+ return "[msg]"
+ else
+ return "[copytext_preserve_html(msg, 1, 37)]... More..."
+
+/*
+/mob/verb/help()
+ set name = "Help"
+ src << browse('html/help.html', "window=help")
+ return
+*/
+
+/mob/proc/set_respawn_timer(var/time)
+ // Try to figure out what time to use
+
+ // Special cases, can never respawn
+ if(ticker?.mode?.deny_respawn)
+ time = -1
+ else if(!config.abandon_allowed)
+ time = -1
+ else if(!config.respawn)
+ time = -1
+
+ // Special case for observing before game start
+ else if(ticker?.current_state <= GAME_STATE_SETTING_UP)
+ time = 1 MINUTE
+
+ // Wasn't given a time, use the config time
+ else if(!time)
+ time = config.respawn_time
+
+ var/keytouse = ckey
+ // Try harder to find a key to use
+ if(!keytouse && key)
+ keytouse = ckey(key)
+ else if(!keytouse && mind?.key)
+ keytouse = ckey(mind.key)
+
+ GLOB.respawn_timers[keytouse] = world.time + time
+
+/mob/observer/dead/set_respawn_timer()
+ if(config.antag_hud_restricted && has_enabled_antagHUD)
+ ..(-1)
+ else
+ return // Don't set it, no need
+
+/mob/verb/abandon_mob()
+ set name = "Return to Menu"
+ set category = "OOC"
+
+ if(stat != DEAD || !ticker)
+ to_chat(usr, "You must be dead to use this!")
+ return
+
+ // Final chance to abort "respawning"
+ if(mind && timeofdeath) // They had spawned before
+ var/choice = alert(usr, "Returning to the menu will prevent your character from being revived in-round. Are you sure?", "Confirmation", "No, wait", "Yes, leave")
+ if(choice == "No, wait")
+ return
+
+ // Beyond this point, you're going to respawn
+ to_chat(usr, config.respawn_message)
+
+ if(!client)
+ log_game("[usr.key] AM failed due to disconnect.")
+ return
+ client.screen.Cut()
+ client.screen += client.void
+ if(!client)
+ log_game("[usr.key] AM failed due to disconnect.")
+ return
+
+ announce_ghost_joinleave(client, 0)
+
+ var/mob/new_player/M = new /mob/new_player()
+ if(!client)
+ log_game("[usr.key] AM failed due to disconnect.")
+ qdel(M)
+ return
+
+ M.key = key
+ if(M.mind)
+ M.mind.reset()
+ return
+
+/client/verb/changes()
+ set name = "Changelog"
+ set category = "OOC"
+ src << browse('html/changelog.html', "window=changes;size=675x650")
+ if(prefs.lastchangelog != changelog_hash)
+ prefs.lastchangelog = changelog_hash
+ SScharacter_setup.queue_preferences_save(prefs)
+ winset(src, "rpane.changelog", "background-color=none;font-style=;")
+
+/mob/verb/observe()
+ set name = "Observe"
+ set category = "OOC"
+ var/is_admin = 0
+
+ if(client.holder && (client.holder.rights & R_ADMIN|R_EVENT))
+ is_admin = 1
+ else if(stat != DEAD || istype(src, /mob/new_player))
+ to_chat(usr, "You must be observing to use this!")
+ return
+
+ if(is_admin && stat == DEAD)
+ is_admin = 0
+
+ var/list/targets = list()
+
+
+ targets += observe_list_format(nuke_disks)
+ targets += observe_list_format(all_singularities)
+ targets += getmobs()
+ targets += observe_list_format(sortAtom(mechas_list))
+ targets += observe_list_format(SSshuttles.ships)
+
+ client.perspective = EYE_PERSPECTIVE
+
+ var/eye_name = null
+
+ var/ok = "[is_admin ? "Admin Observe" : "Observe"]"
+ eye_name = input("Please, select a player!", ok, null, null) as null|anything in targets
+
+ if (!eye_name)
+ return
+
+ var/mob/mob_eye = targets[eye_name]
+
+ if(client && mob_eye)
+ client.eye = mob_eye
+ if (is_admin)
+ client.adminobs = 1
+ if(mob_eye == client.mob || client.eye == client.mob)
+ client.adminobs = 0
+
+/mob/verb/cancel_camera()
+ set name = "Cancel Camera View"
+ set category = "OOC"
+ unset_machine()
+ reset_view(null)
+
+/mob/Topic(href, href_list)
+ if(href_list["mach_close"])
+ var/t1 = text("window=[href_list["mach_close"]]")
+ unset_machine()
+ src << browse(null, t1)
+
+ if(href_list["flavor_more"])
+ usr << browse(text("[] []", name, replacetext(flavor_text, "\n", "
")), text("window=[];size=500x200", name))
+ onclose(usr, "[name]")
+ if(href_list["flavor_change"])
+ update_flavor_text()
+// ..()
+ return
+
+
+/mob/proc/pull_damage()
+ return 0
+
+/mob/verb/stop_pulling()
+
+ set name = "Stop Pulling"
+ set category = "IC"
+
+ if(pulling)
+ if(ishuman(pulling))
+ var/mob/living/carbon/human/H = pulling
+ visible_message(SPAN_WARNING("\The [src] lets go of \the [H]."), SPAN_NOTICE("You let go of \the [H]."), exclude_mobs = list(H))
+ if(!H.stat)
+ to_chat(H, SPAN_WARNING("\The [src] lets go of you."))
+ pulling.pulledby = null
+ pulling = null
+ if(pullin)
+ pullin.icon_state = "pull0"
+
+/mob/proc/start_pulling(var/atom/movable/AM)
+
+ if ( !AM || !usr || src==AM || !isturf(src.loc) ) //if there's no person pulling OR the person is pulling themself OR the object being pulled is inside something: abort!
+ return
+
+ if (AM.anchored)
+ to_chat(src, "It won't budge!")
+ return
+
+ var/mob/M = AM
+ if(ismob(AM))
+
+ if(!can_pull_mobs || !can_pull_size)
+ to_chat(src, "They won't budge!")
+ return
+
+ if((mob_size < M.mob_size) && (can_pull_mobs != MOB_PULL_LARGER))
+ to_chat(src, "[M] is too large for you to move!")
+ return
+
+ if((mob_size == M.mob_size) && (can_pull_mobs == MOB_PULL_SMALLER))
+ to_chat(src, "[M] is too heavy for you to move!")
+ return
+
+ // If your size is larger than theirs and you have some
+ // kind of mob pull value AT ALL, you will be able to pull
+ // them, so don't bother checking that explicitly.
+
+ if(M.grabbed_by.len)
+ // Only start pulling when nobody else has a grab on them
+ . = 1
+ for(var/obj/item/weapon/grab/G in M.grabbed_by)
+ if(G.assailant != usr)
+ . = 0
+ else
+ qdel(G)
+ if(!.)
+ to_chat(src, "Somebody has a grip on them!")
+ return
+
+ if(!iscarbon(src))
+ M.LAssailant = null
+ else
+ M.LAssailant = usr
+
+ else if(isobj(AM))
+ var/obj/I = AM
+ if(!can_pull_size || can_pull_size < I.w_class)
+ to_chat(src, "It won't budge!")
+ return
+
+ if(pulling)
+ var/pulling_old = pulling
+ stop_pulling()
+ // Are we pulling the same thing twice? Just stop pulling.
+ if(pulling_old == AM)
+ return
+
+ src.pulling = AM
+ AM.pulledby = src
+
+ if(pullin)
+ pullin.icon_state = "pull1"
+
+ if(ishuman(AM))
+ var/mob/living/carbon/human/H = AM
+ if(H.lying) // If they're on the ground we're probably dragging their arms to move them
+ visible_message(SPAN_WARNING("\The [src] leans down and grips \the [H]'s arms."), SPAN_NOTICE("You lean down and grip \the [H]'s arms."), exclude_mobs = list(H))
+ if(!H.stat)
+ to_chat(H, SPAN_WARNING("\The [src] leans down and grips your arms."))
+ else //Otherwise we're probably just holding their arm to lead them somewhere
+ visible_message(SPAN_WARNING("\The [src] grips \the [H]'s arm."), SPAN_NOTICE("You grip \the [H]'s arm."), exclude_mobs = list(H))
+ if(!H.stat)
+ to_chat(H, SPAN_WARNING("\The [src] grips your arm."))
+ playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 25) //Quieter than hugging/grabbing but we still want some audio feedback
+
+ if(H.pull_damage())
+ to_chat(src, "Pulling \the [H] in their current condition would probably be a bad idea.")
+
+ //Attempted fix for people flying away through space when cuffed and dragged.
+ if(ismob(AM))
+ var/mob/pulled = AM
+ pulled.inertia_dir = 0
+
+/mob/proc/can_use_hands()
+ return
+
+/mob/proc/is_active()
+ return (0 >= usr.stat)
+
+/mob/proc/is_dead()
+ return stat == DEAD
+
+/mob/proc/is_mechanical()
+ if(mind && (mind.assigned_role == "Cyborg" || mind.assigned_role == "AI"))
+ return 1
+ return istype(src, /mob/living/silicon) || get_species() == "Machine"
+
+/mob/proc/is_ready()
+ return client && !!mind
+
+/mob/proc/get_gender()
+ return gender
+
+/mob/proc/see(message)
+ if(!is_active())
+ return 0
+ to_chat(src,message)
+ return 1
+
+/mob/proc/show_viewers(message)
+ for(var/mob/M in viewers())
+ M.see(message)
+
+/mob/Stat()
+ ..()
+ . = (is_client_active(10 MINUTES))
+
+ if(.)
+ if(statpanel("Status"))
+ stat(null, "Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)")
+ if(ticker && ticker.current_state != GAME_STATE_PREGAME)
+ stat("Station Time", stationtime2text())
+ stat("Station Date", stationdate2text())
+ stat("Round Duration", roundduration2text())
+
+ if(client.holder)
+ if(statpanel("Status"))
+ stat("Location:", "([x], [y], [z]) [loc]")
+ stat("CPU:","[world.cpu]")
+ stat("Instances:","[world.contents.len]")
+ stat(null, "Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)")
+
+ if(statpanel("MC"))
+ stat("Location:", "([x], [y], [z]) [loc]")
+ stat("CPU:","[world.cpu]")
+ stat("Instances:","[world.contents.len]")
+ stat("World Time:", world.time)
+ stat("Real time of day:", REALTIMEOFDAY)
+ stat(null)
+ if(GLOB)
+ GLOB.stat_entry()
+ else
+ stat("Globals:", "ERROR")
+ if(Master)
+ Master.stat_entry()
+ else
+ stat("Master Controller:", "ERROR")
+ if(Failsafe)
+ Failsafe.stat_entry()
+ else
+ stat("Failsafe Controller:", "ERROR")
+ if(Master)
+ stat(null)
+ for(var/datum/controller/subsystem/SS in Master.subsystems)
+ SS.stat_entry()
+
+ if(statpanel("Tickets"))
+ GLOB.ahelp_tickets.stat_entry()
+
+
+ if(length(GLOB.sdql2_queries))
+ if(statpanel("SDQL2"))
+ stat("Access Global SDQL2 List", GLOB.sdql2_vv_statobj)
+ for(var/i in GLOB.sdql2_queries)
+ var/datum/SDQL2_query/Q = i
+ Q.generate_stat()
+
+ if(listed_turf && client)
+ if(!TurfAdjacent(listed_turf))
+ listed_turf = null
+ else
+ if(statpanel("Turf"))
+ stat(listed_turf)
+ for(var/atom/A in listed_turf)
+ if(!A.mouse_opacity)
+ continue
+ if(A.invisibility > see_invisible)
+ continue
+ if(is_type_in_list(A, shouldnt_see))
+ continue
+ if(A.plane > plane)
+ continue
+ stat(A)
+
+
+// facing verbs
+/mob/proc/canface()
+// if(!canmove) return 0 //VOREStation Edit. Redundant check that only affects conscious proning, actual inability to turn and shift around handled by actual inabilities.
+ if(stat) return 0
+ if(anchored) return 0
+ if(transforming) return 0
+ return 1
+
+// Not sure what to call this. Used to check if humans are wearing an AI-controlled exosuit and hence don't need to fall over yet.
+/mob/proc/can_stand_overridden()
+ return 0
+
+//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it.
+/mob/proc/update_canmove()
+ return canmove
+
+
+/mob/proc/facedir(var/ndir)
+ if(!canface() || (client && (client.moving || !checkMoveCooldown())))
+ return 0
+ set_dir(ndir)
+ if(buckled && buckled.buckle_movable)
+ buckled.set_dir(ndir)
+ setMoveCooldown(movement_delay())
+ return 1
+
+
+/mob/verb/eastface()
+ set hidden = 1
+ return facedir(client.client_dir(EAST))
+
+
+/mob/verb/westface()
+ set hidden = 1
+ return facedir(client.client_dir(WEST))
+
+
+/mob/verb/northface()
+ set hidden = 1
+ return facedir(client.client_dir(NORTH))
+
+
+/mob/verb/southface()
+ set hidden = 1
+ return facedir(client.client_dir(SOUTH))
+
+
+//This might need a rename but it should replace the can this mob use things check
+/mob/proc/IsAdvancedToolUser()
+ return 0
+
+/mob/proc/Stun(amount)
+ if(status_flags & CANSTUN)
+ facing_dir = null
+ stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun
+ update_canmove() //updates lying, canmove and icons
+ return
+
+/mob/proc/SetStunned(amount) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned"
+ if(status_flags & CANSTUN)
+ stunned = max(amount,0)
+ update_canmove() //updates lying, canmove and icons
+ return
+
+/mob/proc/AdjustStunned(amount)
+ if(status_flags & CANSTUN)
+ stunned = max(stunned + amount,0)
+ update_canmove() //updates lying, canmove and icons
+ return
+
+/mob/proc/Weaken(amount)
+ if(status_flags & CANWEAKEN)
+ facing_dir = null
+ weakened = max(max(weakened,amount),0)
+ update_canmove() //updates lying, canmove and icons
+ return
+
+/mob/proc/SetWeakened(amount)
+ if(status_flags & CANWEAKEN)
+ weakened = max(amount,0)
+ update_canmove() //can you guess what this does yet?
+ return
+
+/mob/proc/AdjustWeakened(amount)
+ if(status_flags & CANWEAKEN)
+ weakened = max(weakened + amount,0)
+ update_canmove() //updates lying, canmove and icons
+ return
+
+/mob/proc/Paralyse(amount)
+ if(status_flags & CANPARALYSE)
+ facing_dir = null
+ paralysis = max(max(paralysis,amount),0)
+ return
+
+/mob/proc/SetParalysis(amount)
+ if(status_flags & CANPARALYSE)
+ paralysis = max(amount,0)
+ return
+
+/mob/proc/AdjustParalysis(amount)
+ if(status_flags & CANPARALYSE)
+ paralysis = max(paralysis + amount,0)
+ return
+
+/mob/proc/Sleeping(amount)
+ facing_dir = null
+ sleeping = max(max(sleeping,amount),0)
+ return
+
+/mob/proc/SetSleeping(amount)
+ sleeping = max(amount,0)
+ return
+
+/mob/proc/AdjustSleeping(amount)
+ sleeping = max(sleeping + amount,0)
+ return
+
+/mob/proc/Confuse(amount)
+ confused = max(max(confused,amount),0)
+ return
+
+/mob/proc/SetConfused(amount)
+ confused = max(amount,0)
+ return
+
+/mob/proc/AdjustConfused(amount)
+ confused = max(confused + amount,0)
+ return
+
+/mob/proc/Blind(amount)
+ eye_blind = max(max(eye_blind,amount),0)
+ return
+
+/mob/proc/SetBlinded(amount)
+ eye_blind = max(amount,0)
+ return
+
+/mob/proc/AdjustBlinded(amount)
+ eye_blind = max(eye_blind + amount,0)
+ return
+
+/mob/proc/Resting(amount)
+ facing_dir = null
+ resting = max(max(resting,amount),0)
+ update_canmove()
+ return
+
+/mob/proc/SetResting(amount)
+ resting = max(amount,0)
+ update_canmove()
+ return
+
+/mob/proc/AdjustResting(amount)
+ resting = max(resting + amount,0)
+ update_canmove()
+ return
+
+/mob/proc/AdjustLosebreath(amount)
+ losebreath = CLAMP(losebreath + amount, 0, 25)
+
+/mob/proc/SetLosebreath(amount)
+ losebreath = CLAMP(amount, 0, 25)
+
+/mob/proc/get_species()
+ return ""
+
+/mob/proc/flash_weak_pain()
+ flick("weak_pain",pain)
+
+/mob/proc/get_visible_implants(var/class = 0)
+ var/list/visible_implants = list()
+ for(var/obj/item/O in embedded)
+ if(O.w_class > class)
+ visible_implants += O
+ return visible_implants
+
+/mob/proc/embedded_needs_process()
+ return (embedded.len > 0)
+
+mob/proc/yank_out_object()
+ set category = "Object"
+ set name = "Yank out object"
+ set desc = "Remove an embedded item at the cost of bleeding and pain."
+ set src in view(1)
+
+ if(!isliving(usr) || !usr.checkClickCooldown())
+ return
+ usr.setClickCooldown(20)
+
+ if(usr.stat == 1)
+ to_chat(usr, "You are unconcious and cannot do that!")
+ return
+
+ if(usr.restrained())
+ to_chat(usr, "You are restrained and cannot do that!")
+ return
+
+ var/mob/S = src
+ var/mob/U = usr
+ var/list/valid_objects = list()
+ var/self = null
+
+ if(S == U)
+ self = 1 // Removing object from yourself.
+
+ valid_objects = get_visible_implants(0)
+ if(!valid_objects.len)
+ if(self)
+ to_chat(src, "You have nothing stuck in your body that is large enough to remove.")
+ else
+ to_chat(U, "[src] has nothing stuck in their wounds that is large enough to remove.")
+ return
+
+ var/obj/item/weapon/selection = input("What do you want to yank out?", "Embedded objects") in valid_objects
+
+ if(self)
+ to_chat(src, "You attempt to get a good grip on [selection] in your body.")
+ else
+ to_chat(U, "You attempt to get a good grip on [selection] in [S]'s body.")
+
+ if(!do_after(U, 30))
+ return
+ if(!selection || !S || !U)
+ return
+
+ if(self)
+ visible_message("[src] rips [selection] out of their body.","You rip [selection] out of your body.")
+ else
+ visible_message("[usr] rips [selection] out of [src]'s body.","[usr] rips [selection] out of your body.")
+ valid_objects = get_visible_implants(0)
+ if(valid_objects.len == 1) //Yanking out last object - removing verb.
+ src.verbs -= /mob/proc/yank_out_object
+ clear_alert("embeddedobject")
+
+ if(ishuman(src))
+ var/mob/living/carbon/human/H = src
+ var/obj/item/organ/external/affected
+
+ for(var/obj/item/organ/external/organ in H.organs) //Grab the organ holding the implant.
+ for(var/obj/item/O in organ.implants)
+ if(O == selection)
+ affected = organ
+
+ affected.implants -= selection
+ H.shock_stage+=20
+ affected.take_damage((selection.w_class * 3), 0, 0, 1, "Embedded object extraction")
+
+ if(prob(selection.w_class * 5) && (affected.robotic < ORGAN_ROBOT)) //I'M SO ANEMIC I COULD JUST -DIE-.
+ var/datum/wound/internal_bleeding/I = new (min(selection.w_class * 5, 15))
+ affected.wounds += I
+ H.custom_pain("Something tears wetly in your [affected] as [selection] is pulled free!", 50)
+
+ if (ishuman(U))
+ var/mob/living/carbon/human/human_user = U
+ human_user.bloody_hands(H)
+
+ else if(issilicon(src))
+ var/mob/living/silicon/robot/R = src
+ R.embedded -= selection
+ R.adjustBruteLoss(5)
+ R.adjustFireLoss(10)
+
+ selection.forceMove(get_turf(src))
+ U.put_in_hands(selection)
+
+ for(var/obj/item/weapon/O in pinned)
+ if(O == selection)
+ pinned -= O
+ if(!pinned.len)
+ anchored = 0
+ return 1
+
+//Check for brain worms in head.
+/mob/proc/has_brain_worms()
+
+ for(var/I in contents)
+ if(istype(I,/mob/living/simple_mob/animal/borer))
+ return I
+
+ return 0
+
+/mob/proc/updateicon()
+ return
+
+// Please always use this proc, never just set the var directly.
+/mob/proc/set_stat(var/new_stat)
+ . = (stat != new_stat)
+ stat = new_stat
+
+/mob/verb/face_direction()
+
+ set name = "Face Direction"
+ set category = "IC"
+ set src = usr
+
+ set_face_dir()
+
+ if(!facing_dir)
+ to_chat(usr, "You are now not facing anything.")
+ else
+ to_chat(usr, "You are now facing [dir2text(facing_dir)].")
+
+/mob/proc/set_face_dir(var/newdir)
+ if(newdir == facing_dir)
+ facing_dir = null
+ else if(newdir)
+ set_dir(newdir)
+ facing_dir = newdir
+ else if(facing_dir)
+ facing_dir = null
+ else
+ set_dir(dir)
+ facing_dir = dir
+
+/mob/set_dir()
+ if(facing_dir)
+ if(!canface() || lying || buckled || restrained())
+ facing_dir = null
+ else if(dir != facing_dir)
+ return ..(facing_dir)
+ else
+ return ..()
+
+/mob/verb/northfaceperm()
+ set hidden = 1
+ set_face_dir(client.client_dir(NORTH))
+
+/mob/verb/southfaceperm()
+ set hidden = 1
+ set_face_dir(client.client_dir(SOUTH))
+
+/mob/verb/eastfaceperm()
+ set hidden = 1
+ set_face_dir(client.client_dir(EAST))
+
+/mob/verb/westfaceperm()
+ set hidden = 1
+ set_face_dir(client.client_dir(WEST))
+
+// Begin VOREstation edit
+/mob/verb/shiftnorth()
+ set hidden = TRUE
+ if(!canface())
+ return FALSE
+ if(pixel_y <= (default_pixel_y + 16))
+ pixel_y++
+ is_shifted = TRUE
+
+/mob/verb/shiftsouth()
+ set hidden = TRUE
+ if(!canface())
+ return FALSE
+ if(pixel_y >= (default_pixel_y - 16))
+ pixel_y--
+ is_shifted = TRUE
+
+/mob/verb/shiftwest()
+ set hidden = TRUE
+ if(!canface())
+ return FALSE
+ if(pixel_x >= (default_pixel_x - 16))
+ pixel_x--
+ is_shifted = TRUE
+
+mob/verb/shifteast()
+ set hidden = TRUE
+ if(!canface())
+ return FALSE
+ if(pixel_x <= (default_pixel_x + 16))
+ pixel_x++
+ is_shifted = TRUE
+// End VOREstation edit
+
+/mob/proc/adjustEarDamage()
+ return
+
+/mob/proc/setEarDamage()
+ return
+
+// Set client view distance (size of client's screen). Returns TRUE if anything changed.
+/mob/proc/set_viewsize(var/new_view = world.view)
+ if (client && new_view != client.view)
+ client.view = new_view
+ return TRUE
+ return FALSE
+
+//Throwing stuff
+
+/mob/proc/toggle_throw_mode()
+ if (src.in_throw_mode)
+ throw_mode_off()
+ else
+ throw_mode_on()
+
+/mob/proc/throw_mode_off()
+ src.in_throw_mode = 0
+ if(src.throw_icon) //in case we don't have the HUD and we use the hotkey
+ src.throw_icon.icon_state = "act_throw_off"
+
+/mob/proc/throw_mode_on()
+ src.in_throw_mode = 1
+ if(src.throw_icon)
+ src.throw_icon.icon_state = "act_throw_on"
+
+/mob/proc/isSynthetic()
+ return 0
+
+/mob/proc/is_muzzled()
+ return 0
+
+//Exploitable Info Update
+
+/mob/proc/amend_exploitable(var/obj/item/I)
+ if(istype(I))
+ exploit_addons |= I
+ var/exploitmsg = html_decode("\n" + "Has " + I.name + ".")
+ exploit_record += exploitmsg
+
+/client/proc/check_has_body_select()
+ return mob && mob.hud_used && istype(mob.zone_sel, /obj/screen/zone_sel)
+
+/client/verb/body_toggle_head()
+ set name = "body-toggle-head"
+ set hidden = 1
+ toggle_zone_sel(list(BP_HEAD, O_EYES, O_MOUTH))
+
+/client/verb/body_r_arm()
+ set name = "body-r-arm"
+ set hidden = 1
+ toggle_zone_sel(list(BP_R_ARM,BP_R_HAND))
+
+/client/verb/body_l_arm()
+ set name = "body-l-arm"
+ set hidden = 1
+ toggle_zone_sel(list(BP_L_ARM,BP_L_HAND))
+
+/client/verb/body_chest()
+ set name = "body-chest"
+ set hidden = 1
+ toggle_zone_sel(list(BP_TORSO))
+
+/client/verb/body_groin()
+ set name = "body-groin"
+ set hidden = 1
+ toggle_zone_sel(list(BP_GROIN))
+
+/client/verb/body_r_leg()
+ set name = "body-r-leg"
+ set hidden = 1
+ toggle_zone_sel(list(BP_R_LEG,BP_R_FOOT))
+
+/client/verb/body_l_leg()
+ set name = "body-l-leg"
+ set hidden = 1
+ toggle_zone_sel(list(BP_L_LEG,BP_L_FOOT))
+
+/client/proc/toggle_zone_sel(list/zones)
+ if(!check_has_body_select())
+ return
+ var/obj/screen/zone_sel/selector = mob.zone_sel
+ selector.set_selected_zone(next_in_list(mob.zone_sel.selecting,zones))
+
+// This handles setting the client's color variable, which makes everything look a specific color.
+// This proc is here so it can be called without needing to check if the client exists, or if the client relogs.
+// This is for inheritence since /mob/living will serve most cases. If you need ghosts to use this you'll have to implement that yourself.
+/mob/proc/update_client_color()
+ if(client && client.color)
+ animate(client, color = null, time = 10)
+ return
+
+/mob/proc/swap_hand()
+ return
+
+//Throwing stuff
+/mob/proc/throw_item(atom/target)
+ return
+
+/mob/proc/will_show_tooltip()
+ if(alpha <= EFFECTIVE_INVIS)
+ return FALSE
+ return TRUE
+
+/mob/MouseEntered(location, control, params)
+ if(usr != src && usr.is_preference_enabled(/datum/client_preference/mob_tooltips) && src.will_show_tooltip())
+ openToolTip(user = usr, tip_src = src, params = params, title = get_nametag_name(usr), content = get_nametag_desc(usr))
+
+ ..()
+
+/mob/MouseDown()
+ closeToolTip(usr) //No reason not to, really
+
+ ..()
+
+/mob/MouseExited()
+ closeToolTip(usr) //No reason not to, really
+
+ ..()
+
+// Manages a global list of mobs with clients attached, indexed by z-level.
+/mob/proc/update_client_z(new_z) // +1 to register, null to unregister.
+ if(registered_z != new_z)
+ if(registered_z)
+ GLOB.players_by_zlevel[registered_z] -= src
+ if(client)
+ if(new_z)
+ GLOB.players_by_zlevel[new_z] += src
+ registered_z = new_z
+ else
+ registered_z = null
+
+GLOBAL_LIST_EMPTY(living_players_by_zlevel)
+/mob/living/update_client_z(new_z)
+ var/precall_reg_z = registered_z
+ . = ..() // will update registered_z if necessary
+ if(precall_reg_z != registered_z) // parent did work, let's do work too
+ if(precall_reg_z)
+ GLOB.living_players_by_zlevel[precall_reg_z] -= src
+ if(registered_z)
+ GLOB.living_players_by_zlevel[registered_z] += src
+
+/mob/onTransitZ(old_z, new_z)
+ ..()
+ update_client_z(new_z)
+
+/mob/cloak()
+ . = ..()
+ if(client && cloaked_selfimage)
+ client.images += cloaked_selfimage
+
+/mob/uncloak()
+ if(client && cloaked_selfimage)
+ client.images -= cloaked_selfimage
+ return ..()
+
+/mob/get_cloaked_selfimage()
+ var/icon/selficon = getCompoundIcon(src)
+ selficon.MapColors(0,0,0, 0,0,0, 0,0,0, 1,1,1) //White
+ var/image/selfimage = image(selficon)
+ selfimage.color = "#0000FF"
+ selfimage.alpha = 100
+ selfimage.layer = initial(layer)
+ selfimage.plane = initial(plane)
+ selfimage.loc = src
+
+ return selfimage
+
+/mob/proc/GetAltName()
+ return ""
+
+/mob/proc/get_ghost(even_if_they_cant_reenter = 0)
+ if(mind)
+ return mind.get_ghost(even_if_they_cant_reenter)
+
+/mob/proc/grab_ghost(force)
+ if(mind)
+ return mind.grab_ghost(force = force)
+=======
+/mob/Destroy()//This makes sure that mobs withGLOB.clients/keys are not just deleted from the game.
+ mob_list -= src
+ dead_mob_list -= src
+ living_mob_list -= src
+ unset_machine()
+ qdel(hud_used)
+ clear_fullscreen()
+ if(client)
+ for(var/obj/screen/movable/spell_master/spell_master in spell_masters)
+ qdel(spell_master)
+ remove_screen_obj_references()
+ client.screen = list()
+ if(mind && mind.current == src)
+ spellremove(src)
+ ghostize()
+ QDEL_NULL(plane_holder)
+ ..()
+ return QDEL_HINT_HARDDEL_NOW
+
+/mob/proc/remove_screen_obj_references()
+ hands = null
+ pullin = null
+ purged = null
+ internals = null
+ i_select = null
+ m_select = null
+ healths = null
+ throw_icon = null
+ pain = null
+ item_use_icon = null
+ gun_move_icon = null
+ gun_setting_icon = null
+ spell_masters = null
+ zone_sel = null
+
+/mob/Initialize()
+ mob_list += src
+ if(stat == DEAD)
+ dead_mob_list += src
+ else
+ living_mob_list += src
+ lastarea = get_area(src)
+ hook_vr("mob_new",list(src)) //VOREStation Code
+ update_transform() // Some mobs may start bigger or smaller than normal.
+ return ..()
+
+/mob/proc/show_message(msg, type, alt, alt_type)//Message, type of message (1 or 2), alternative message, alt message type (1 or 2)
+
+ if(!client && !teleop) return
+
+ if (type)
+ if((type & VISIBLE_MESSAGE) && (is_blind() || paralysis) )//Vision related
+ if (!( alt ))
+ return
+ else
+ msg = alt
+ type = alt_type
+ if ((type & AUDIBLE_MESSAGE) && is_deaf())//Hearing related
+ if (!( alt ))
+ return
+ else
+ msg = alt
+ type = alt_type
+ if ((type & VISIBLE_MESSAGE) && (sdisabilities & BLIND))
+ return
+ // Added voice muffling for Issue 41.
+ if(stat == UNCONSCIOUS || sleeping > 0)
+ to_chat(src, "... You can almost hear someone talking ...")
+ else
+ to_chat(src,msg)
+ if(teleop)
+ to_chat(teleop, create_text_tag("body", "BODY:", teleop) + "[msg]")
+ return
+
+// Show a message to all mobs and objects in sight of this one
+// This would be for visible actions by the src mob
+// message is the message output to anyone who can see e.g. "[src] does something!"
+// self_message (optional) is what the src mob sees e.g. "You do something!"
+// blind_message (optional) is what blind people will hear e.g. "You hear something!"
+/mob/visible_message(var/message, var/self_message, var/blind_message, var/list/exclude_mobs = null, var/range = world.view)
+ if(self_message)
+ if(LAZYLEN(exclude_mobs))
+ exclude_mobs |= src
+ else
+ exclude_mobs = list(src)
+ src.show_message(self_message, 1, blind_message, 2)
+ // Transfer messages about what we are doing to upstairs
+ if(shadow)
+ shadow.visible_message(message, self_message, blind_message, exclude_mobs, range)
+ . = ..(message, blind_message, exclude_mobs, range) // Really not ideal that atom/visible_message has different arg numbering :(
+
+// Returns an amount of power drawn from the object (-1 if it's not viable).
+// If drain_check is set it will not actually drain power, just return a value.
+// If surge is set, it will destroy/damage the recipient and not return any power.
+// Not sure where to define this, so it can sit here for the rest of time.
+/atom/proc/drain_power(var/drain_check,var/surge, var/amount = 0)
+ return -1
+
+// Show a message to all mobs and objects in earshot of this one
+// This would be for audible actions by the src mob
+// message is the message output to anyone who can hear.
+// self_message (optional) is what the src mob hears.
+// deaf_message (optional) is what deaf people will see.
+// hearing_distance (optional) is the range, how many tiles away the message can be heard.
+/mob/audible_message(var/message, var/deaf_message, var/hearing_distance, var/self_message, var/radio_message)
+
+ var/range = hearing_distance || world.view
+ var/list/hear = get_mobs_and_objs_in_view_fast(get_turf(src),range,remote_ghosts = FALSE)
+
+ var/list/hearing_mobs = hear["mobs"]
+ var/list/hearing_objs = hear["objs"]
+
+ if(radio_message)
+ for(var/obj in hearing_objs)
+ var/obj/O = obj
+ O.hear_talk(src, list(new /datum/multilingual_say_piece(GLOB.all_languages["Noise"], radio_message)), null)
+ else
+ for(var/obj in hearing_objs)
+ var/obj/O = obj
+ O.show_message(message, AUDIBLE_MESSAGE, deaf_message, VISIBLE_MESSAGE)
+
+ for(var/mob in hearing_mobs)
+ var/mob/M = mob
+ var/msg = message
+ if(self_message && M==src)
+ msg = self_message
+ M.show_message(msg, AUDIBLE_MESSAGE, deaf_message, VISIBLE_MESSAGE)
+
+/mob/proc/findname(msg)
+ for(var/mob/M in mob_list)
+ if (M.real_name == text("[]", msg))
+ return M
+ return 0
+
+/mob/proc/Life()
+// if(organStructure)
+// organStructure.ProcessOrgans()
+ return
+
+#define UNBUCKLED 0
+#define PARTIALLY_BUCKLED 1
+#define FULLY_BUCKLED 2
+/mob/proc/buckled()
+ // Preliminary work for a future buckle rewrite,
+ // where one might be fully restrained (like an elecrical chair), or merely secured (shuttle chair, keeping you safe but not otherwise restrained from acting)
+ if(!buckled)
+ return UNBUCKLED
+ return restrained() ? FULLY_BUCKLED : PARTIALLY_BUCKLED
+
+/mob/proc/is_blind()
+ return ((sdisabilities & BLIND) || blinded || incapacitated(INCAPACITATION_KNOCKOUT))
+
+/mob/proc/is_deaf()
+ return ((sdisabilities & DEAF) || ear_deaf || incapacitated(INCAPACITATION_KNOCKOUT))
+
+/mob/proc/is_physically_disabled()
+ return incapacitated(INCAPACITATION_DISABLED)
+
+/mob/proc/cannot_stand()
+ return incapacitated(INCAPACITATION_KNOCKDOWN)
+
+/mob/proc/incapacitated(var/incapacitation_flags = INCAPACITATION_DEFAULT)
+ if ((incapacitation_flags & INCAPACITATION_STUNNED) && stunned)
+ return 1
+
+ if ((incapacitation_flags & INCAPACITATION_FORCELYING) && (weakened || resting))
+ return 1
+
+ if ((incapacitation_flags & INCAPACITATION_KNOCKOUT) && (stat || paralysis || sleeping || (status_flags & FAKEDEATH)))
+ return 1
+
+ if((incapacitation_flags & INCAPACITATION_RESTRAINED) && restrained())
+ return 1
+
+ if((incapacitation_flags & (INCAPACITATION_BUCKLED_PARTIALLY|INCAPACITATION_BUCKLED_FULLY)))
+ var/buckling = buckled()
+ if(buckling >= PARTIALLY_BUCKLED && (incapacitation_flags & INCAPACITATION_BUCKLED_PARTIALLY))
+ return 1
+ if(buckling == FULLY_BUCKLED && (incapacitation_flags & INCAPACITATION_BUCKLED_FULLY))
+ return 1
+
+ return 0
+
+#undef UNBUCKLED
+#undef PARTIALLY_BUCKLED
+#undef FULLY_BUCKLED
+
+/mob/proc/restrained()
+ return
+
+/mob/proc/reset_view(atom/A)
+ if (client)
+ if (istype(A, /atom/movable))
+ client.perspective = EYE_PERSPECTIVE
+ client.eye = A
+ else
+ if (isturf(loc))
+ client.eye = client.mob
+ client.perspective = MOB_PERSPECTIVE
+ else
+ client.perspective = EYE_PERSPECTIVE
+ client.eye = loc
+ return TRUE
+
+/mob/verb/pointed(atom/A as mob|obj|turf in view())
+ set name = "Point To"
+ set category = "Object"
+
+ if(!src || !isturf(src.loc) || !(A in view(src.loc)))
+ return 0
+ if(istype(A, /obj/effect/decal/point))
+ return 0
+
+ var/turf/tile = get_turf(A)
+ if (!tile)
+ return 0
+
+ var/turf/our_tile = get_turf(src)
+ var/obj/visual = new /obj/effect/decal/point(our_tile)
+ visual.invisibility = invisibility
+ visual.plane = ABOVE_PLANE
+ visual.layer = FLY_LAYER
+
+ animate(visual,
+ pixel_x = (tile.x - our_tile.x) * world.icon_size + A.pixel_x,
+ pixel_y = (tile.y - our_tile.y) * world.icon_size + A.pixel_y,
+ time = 1.7,
+ easing = EASE_OUT)
+
+ QDEL_IN(visual, 2 SECONDS) //Better qdel
+
+ face_atom(A)
+ return 1
+
+
+/mob/proc/ret_grab(list/L, flag)
+ return
+
+/mob/verb/mode()
+ set name = "Activate Held Object"
+ set category = "Object"
+ set src = usr
+
+ return
+
+/*
+/mob/verb/dump_source()
+
+ var/master = ""
+ for(var/t in typesof(/area))
+ master += text("[]\n", t)
+ //Foreach goto(26)
+ src << browse(master)
+ return
+*/
+
+/mob/verb/memory()
+ set name = "Notes"
+ set category = "IC"
+ if(mind)
+ mind.show_memory(src)
+ else
+ to_chat(src, "The game appears to have misplaced your mind datum, so we can't show you your notes.")
+
+/mob/verb/add_memory(msg as message)
+ set name = "Add Note"
+ set category = "IC"
+
+ msg = sanitize(msg)
+
+ if(mind)
+ mind.store_memory(msg)
+ else
+ to_chat(src, "The game appears to have misplaced your mind datum, so we can't show you your notes.")
+
+/mob/proc/store_memory(msg as message, popup, sane = 1)
+ msg = copytext(msg, 1, MAX_MESSAGE_LEN)
+
+ if (sane)
+ msg = sanitize(msg)
+
+ if (length(memory) == 0)
+ memory += msg
+ else
+ memory += "
[msg]"
+
+ if (popup)
+ memory()
+
+/mob/proc/update_flavor_text()
+ set src in usr
+ if(usr != src)
+ to_chat(usr, "No.")
+ var/msg = sanitize(input(usr,"Set the flavor text in your 'examine' verb.","Flavor Text",html_decode(flavor_text)) as message|null, extra = 0) //VOREStation Edit: separating out OOC notes
+
+ if(msg != null)
+ flavor_text = msg
+
+/mob/proc/warn_flavor_changed()
+ if(flavor_text && flavor_text != "") // don't spam people that don't use it!
+ to_chat(src, "OOC Warning:
")
+ to_chat(src, "Your flavor text is likely out of date! Change")
+
+/mob/proc/print_flavor_text()
+ if (flavor_text && flavor_text != "")
+ var/msg = replacetext(flavor_text, "\n", " ")
+ if(length(msg) <= 40)
+ return "[msg]"
+ else
+ return "[copytext_preserve_html(msg, 1, 37)]... More..."
+
+/*
+/mob/verb/help()
+ set name = "Help"
+ src << browse('html/help.html', "window=help")
+ return
+*/
+
+/mob/proc/set_respawn_timer(var/time)
+ // Try to figure out what time to use
+
+ // Special cases, can never respawn
+ if(ticker?.mode?.deny_respawn)
+ time = -1
+ else if(!config.abandon_allowed)
+ time = -1
+ else if(!config.respawn)
+ time = -1
+
+ // Special case for observing before game start
+ else if(ticker?.current_state <= GAME_STATE_SETTING_UP)
+ time = 1 MINUTE
+
+ // Wasn't given a time, use the config time
+ else if(!time)
+ time = config.respawn_time
+
+ var/keytouse = ckey
+ // Try harder to find a key to use
+ if(!keytouse && key)
+ keytouse = ckey(key)
+ else if(!keytouse && mind?.key)
+ keytouse = ckey(mind.key)
+
+ GLOB.respawn_timers[keytouse] = world.time + time
+
+/mob/observer/dead/set_respawn_timer()
+ if(config.antag_hud_restricted && has_enabled_antagHUD)
+ ..(-1)
+ else
+ return // Don't set it, no need
+
+/mob/verb/abandon_mob()
+ set name = "Return to Menu"
+ set category = "OOC"
+
+ if(stat != DEAD || !ticker)
+ to_chat(usr, "You must be dead to use this!")
+ return
+
+ // Final chance to abort "respawning"
+ if(mind && timeofdeath) // They had spawned before
+ var/choice = alert(usr, "Returning to the menu will prevent your character from being revived in-round. Are you sure?", "Confirmation", "No, wait", "Yes, leave")
+ if(choice == "No, wait")
+ return
+
+ // Beyond this point, you're going to respawn
+ to_chat(usr, config.respawn_message)
+
+ if(!client)
+ log_game("[usr.key] AM failed due to disconnect.")
+ return
+ client.screen.Cut()
+ client.screen += client.void
+ if(!client)
+ log_game("[usr.key] AM failed due to disconnect.")
+ return
+
+ announce_ghost_joinleave(client, 0)
+
+ var/mob/new_player/M = new /mob/new_player()
+ if(!client)
+ log_game("[usr.key] AM failed due to disconnect.")
+ qdel(M)
+ return
+
+ M.key = key
+ if(M.mind)
+ M.mind.reset()
+ return
+
+/client/verb/changes()
+ set name = "Changelog"
+ set category = "OOC"
+ src << browse('html/changelog.html', "window=changes;size=675x650")
+ if(prefs.lastchangelog != changelog_hash)
+ prefs.lastchangelog = changelog_hash
+ SScharacter_setup.queue_preferences_save(prefs)
+ winset(src, "rpane.changelog", "background-color=none;font-style=;")
+
+/mob/verb/observe()
+ set name = "Observe"
+ set category = "OOC"
+ var/is_admin = 0
+
+ if(client.holder && (client.holder.rights & R_ADMIN|R_EVENT))
+ is_admin = 1
+ else if(stat != DEAD || istype(src, /mob/new_player))
+ to_chat(usr, "You must be observing to use this!")
+ return
+
+ if(is_admin && stat == DEAD)
+ is_admin = 0
+
+ var/list/targets = list()
+
+
+ targets += observe_list_format(nuke_disks)
+ targets += observe_list_format(all_singularities)
+ targets += getmobs()
+ targets += observe_list_format(sortAtom(mechas_list))
+ targets += observe_list_format(SSshuttles.ships)
+
+ client.perspective = EYE_PERSPECTIVE
+
+ var/eye_name = null
+
+ var/ok = "[is_admin ? "Admin Observe" : "Observe"]"
+ eye_name = input("Please, select a player!", ok, null, null) as null|anything in targets
+
+ if (!eye_name)
+ return
+
+ var/mob/mob_eye = targets[eye_name]
+
+ if(client && mob_eye)
+ client.eye = mob_eye
+ if (is_admin)
+ client.adminobs = 1
+ if(mob_eye == client.mob || client.eye == client.mob)
+ client.adminobs = 0
+
+/mob/verb/cancel_camera()
+ set name = "Cancel Camera View"
+ set category = "OOC"
+ unset_machine()
+ reset_view(null)
+
+/mob/Topic(href, href_list)
+ if(href_list["mach_close"])
+ var/t1 = text("window=[href_list["mach_close"]]")
+ unset_machine()
+ src << browse(null, t1)
+
+ if(href_list["flavor_more"])
+ usr << browse(text("[] []", name, replacetext(flavor_text, "\n", "
")), text("window=[];size=500x200", name))
+ onclose(usr, "[name]")
+ if(href_list["flavor_change"])
+ update_flavor_text()
+// ..()
+ return
+
+
+/mob/proc/pull_damage()
+ return 0
+
+/mob/verb/stop_pulling()
+
+ set name = "Stop Pulling"
+ set category = "IC"
+
+ if(pulling)
+ if(ishuman(pulling))
+ var/mob/living/carbon/human/H = pulling
+ visible_message(SPAN_WARNING("\The [src] lets go of \the [H]."), SPAN_NOTICE("You let go of \the [H]."), exclude_mobs = list(H))
+ if(!H.stat)
+ to_chat(H, SPAN_WARNING("\The [src] lets go of you."))
+ pulling.pulledby = null
+ pulling = null
+ if(pullin)
+ pullin.icon_state = "pull0"
+
+/mob/proc/start_pulling(var/atom/movable/AM)
+
+ if ( !AM || !usr || src==AM || !isturf(src.loc) ) //if there's no person pulling OR the person is pulling themself OR the object being pulled is inside something: abort!
+ return
+
+ if (AM.anchored)
+ to_chat(src, "It won't budge!")
+ return
+
+ var/mob/M = AM
+ if(ismob(AM))
+
+ if(!can_pull_mobs || !can_pull_size)
+ to_chat(src, "They won't budge!")
+ return
+
+ if((mob_size < M.mob_size) && (can_pull_mobs != MOB_PULL_LARGER))
+ to_chat(src, "[M] is too large for you to move!")
+ return
+
+ if((mob_size == M.mob_size) && (can_pull_mobs == MOB_PULL_SMALLER))
+ to_chat(src, "[M] is too heavy for you to move!")
+ return
+
+ // If your size is larger than theirs and you have some
+ // kind of mob pull value AT ALL, you will be able to pull
+ // them, so don't bother checking that explicitly.
+
+ if(M.grabbed_by.len)
+ // Only start pulling when nobody else has a grab on them
+ . = 1
+ for(var/obj/item/weapon/grab/G in M.grabbed_by)
+ if(G.assailant != usr)
+ . = 0
+ else
+ qdel(G)
+ if(!.)
+ to_chat(src, "Somebody has a grip on them!")
+ return
+
+ if(!iscarbon(src))
+ M.LAssailant = null
+ else
+ M.LAssailant = usr
+
+ else if(isobj(AM))
+ var/obj/I = AM
+ if(!can_pull_size || can_pull_size < I.w_class)
+ to_chat(src, "It won't budge!")
+ return
+
+ if(pulling)
+ var/pulling_old = pulling
+ stop_pulling()
+ // Are we pulling the same thing twice? Just stop pulling.
+ if(pulling_old == AM)
+ return
+
+ src.pulling = AM
+ AM.pulledby = src
+
+ if(pullin)
+ pullin.icon_state = "pull1"
+
+ if(ishuman(AM))
+ var/mob/living/carbon/human/H = AM
+ if(H.lying) // If they're on the ground we're probably dragging their arms to move them
+ visible_message(SPAN_WARNING("\The [src] leans down and grips \the [H]'s arms."), SPAN_NOTICE("You lean down and grip \the [H]'s arms."), exclude_mobs = list(H))
+ if(!H.stat)
+ to_chat(H, SPAN_WARNING("\The [src] leans down and grips your arms."))
+ else //Otherwise we're probably just holding their arm to lead them somewhere
+ visible_message(SPAN_WARNING("\The [src] grips \the [H]'s arm."), SPAN_NOTICE("You grip \the [H]'s arm."), exclude_mobs = list(H))
+ if(!H.stat)
+ to_chat(H, SPAN_WARNING("\The [src] grips your arm."))
+ playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 25) //Quieter than hugging/grabbing but we still want some audio feedback
+
+ if(H.pull_damage())
+ to_chat(src, "Pulling \the [H] in their current condition would probably be a bad idea.")
+
+ //Attempted fix for people flying away through space when cuffed and dragged.
+ if(ismob(AM))
+ var/mob/pulled = AM
+ pulled.inertia_dir = 0
+
+/mob/proc/can_use_hands()
+ return
+
+/mob/proc/is_active()
+ return (0 >= usr.stat)
+
+/mob/proc/is_dead()
+ return stat == DEAD
+
+/mob/proc/is_mechanical()
+ if(mind && (mind.assigned_role == "Cyborg" || mind.assigned_role == "AI"))
+ return 1
+ return istype(src, /mob/living/silicon) || get_species() == "Machine"
+
+/mob/proc/is_ready()
+ return client && !!mind
+
+/mob/proc/get_gender()
+ return gender
+
+/mob/proc/see(message)
+ if(!is_active())
+ return 0
+ to_chat(src,message)
+ return 1
+
+/mob/proc/show_viewers(message)
+ for(var/mob/M in viewers())
+ M.see(message)
+
+/mob/Stat()
+ ..()
+ . = (is_client_active(10 MINUTES))
+
+ if(.)
+ if(statpanel("Status"))
+ stat(null, "Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)")
+ if(ticker && ticker.current_state != GAME_STATE_PREGAME)
+ stat("Station Time", stationtime2text())
+ stat("Station Date", stationdate2text())
+ stat("Round Duration", roundduration2text())
+
+ if(client.holder)
+ if(statpanel("Status"))
+ stat("Location:", "([x], [y], [z]) [loc]")
+ stat("CPU:","[world.cpu]")
+ stat("Instances:","[world.contents.len]")
+ stat(null, "Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)")
+
+ if(statpanel("MC"))
+ stat("Location:", "([x], [y], [z]) [loc]")
+ stat("CPU:","[world.cpu]")
+ stat("Instances:","[world.contents.len]")
+ stat("World Time:", world.time)
+ stat("Real time of day:", REALTIMEOFDAY)
+ stat(null)
+ if(GLOB)
+ GLOB.stat_entry()
+ else
+ stat("Globals:", "ERROR")
+ if(Master)
+ Master.stat_entry()
+ else
+ stat("Master Controller:", "ERROR")
+ if(Failsafe)
+ Failsafe.stat_entry()
+ else
+ stat("Failsafe Controller:", "ERROR")
+ if(Master)
+ stat(null)
+ for(var/datum/controller/subsystem/SS in Master.subsystems)
+ SS.stat_entry()
+
+ if(statpanel("Tickets"))
+ GLOB.ahelp_tickets.stat_entry()
+
+
+ if(length(GLOB.sdql2_queries))
+ if(statpanel("SDQL2"))
+ stat("Access Global SDQL2 List", GLOB.sdql2_vv_statobj)
+ for(var/i in GLOB.sdql2_queries)
+ var/datum/SDQL2_query/Q = i
+ Q.generate_stat()
+
+ if(listed_turf && client)
+ if(!TurfAdjacent(listed_turf))
+ listed_turf = null
+ else
+ if(statpanel("Turf"))
+ stat(listed_turf)
+ for(var/atom/A in listed_turf)
+ if(!A.mouse_opacity)
+ continue
+ if(A.invisibility > see_invisible)
+ continue
+ if(is_type_in_list(A, shouldnt_see))
+ continue
+ if(A.plane > plane)
+ continue
+ stat(A)
+
+
+// facing verbs
+/mob/proc/canface()
+// if(!canmove) return 0 //VOREStation Edit. Redundant check that only affects conscious proning, actual inability to turn and shift around handled by actual inabilities.
+ if(stat) return 0
+ if(anchored) return 0
+ if(transforming) return 0
+ return 1
+
+// Not sure what to call this. Used to check if humans are wearing an AI-controlled exosuit and hence don't need to fall over yet.
+/mob/proc/can_stand_overridden()
+ return 0
+
+//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it.
+/mob/proc/update_canmove()
+ return canmove
+
+
+/mob/proc/facedir(var/ndir)
+ if(!canface() || (client && (client.moving || !checkMoveCooldown())))
+ return 0
+ set_dir(ndir)
+ if(buckled && buckled.buckle_movable)
+ buckled.set_dir(ndir)
+ setMoveCooldown(movement_delay())
+ return 1
+
+
+/mob/verb/eastface()
+ set hidden = 1
+ return facedir(client.client_dir(EAST))
+
+
+/mob/verb/westface()
+ set hidden = 1
+ return facedir(client.client_dir(WEST))
+
+
+/mob/verb/northface()
+ set hidden = 1
+ return facedir(client.client_dir(NORTH))
+
+
+/mob/verb/southface()
+ set hidden = 1
+ return facedir(client.client_dir(SOUTH))
+
+
+//This might need a rename but it should replace the can this mob use things check
+/mob/proc/IsAdvancedToolUser()
+ return 0
+
+/mob/proc/Stun(amount)
+ if(status_flags & CANSTUN)
+ facing_dir = null
+ stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun
+ update_canmove() //updates lying, canmove and icons
+ return
+
+/mob/proc/SetStunned(amount) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned"
+ if(status_flags & CANSTUN)
+ stunned = max(amount,0)
+ update_canmove() //updates lying, canmove and icons
+ return
+
+/mob/proc/AdjustStunned(amount)
+ if(status_flags & CANSTUN)
+ stunned = max(stunned + amount,0)
+ update_canmove() //updates lying, canmove and icons
+ return
+
+/mob/proc/Weaken(amount)
+ if(status_flags & CANWEAKEN)
+ facing_dir = null
+ weakened = max(max(weakened,amount),0)
+ update_canmove() //updates lying, canmove and icons
+ return
+
+/mob/proc/SetWeakened(amount)
+ if(status_flags & CANWEAKEN)
+ weakened = max(amount,0)
+ update_canmove() //can you guess what this does yet?
+ return
+
+/mob/proc/AdjustWeakened(amount)
+ if(status_flags & CANWEAKEN)
+ weakened = max(weakened + amount,0)
+ update_canmove() //updates lying, canmove and icons
+ return
+
+/mob/proc/Paralyse(amount)
+ if(status_flags & CANPARALYSE)
+ facing_dir = null
+ paralysis = max(max(paralysis,amount),0)
+ return
+
+/mob/proc/SetParalysis(amount)
+ if(status_flags & CANPARALYSE)
+ paralysis = max(amount,0)
+ return
+
+/mob/proc/AdjustParalysis(amount)
+ if(status_flags & CANPARALYSE)
+ paralysis = max(paralysis + amount,0)
+ return
+
+/mob/proc/Sleeping(amount)
+ facing_dir = null
+ sleeping = max(max(sleeping,amount),0)
+ return
+
+/mob/proc/SetSleeping(amount)
+ sleeping = max(amount,0)
+ return
+
+/mob/proc/AdjustSleeping(amount)
+ sleeping = max(sleeping + amount,0)
+ return
+
+/mob/proc/Confuse(amount)
+ confused = max(max(confused,amount),0)
+ return
+
+/mob/proc/SetConfused(amount)
+ confused = max(amount,0)
+ return
+
+/mob/proc/AdjustConfused(amount)
+ confused = max(confused + amount,0)
+ return
+
+/mob/proc/Blind(amount)
+ eye_blind = max(max(eye_blind,amount),0)
+ return
+
+/mob/proc/SetBlinded(amount)
+ eye_blind = max(amount,0)
+ return
+
+/mob/proc/AdjustBlinded(amount)
+ eye_blind = max(eye_blind + amount,0)
+ return
+
+/mob/proc/Resting(amount)
+ facing_dir = null
+ resting = max(max(resting,amount),0)
+ update_canmove()
+ return
+
+/mob/proc/SetResting(amount)
+ resting = max(amount,0)
+ update_canmove()
+ return
+
+/mob/proc/AdjustResting(amount)
+ resting = max(resting + amount,0)
+ update_canmove()
+ return
+
+/mob/proc/AdjustLosebreath(amount)
+ losebreath = CLAMP(losebreath + amount, 0, 25)
+
+/mob/proc/SetLosebreath(amount)
+ losebreath = CLAMP(amount, 0, 25)
+
+/mob/proc/get_species()
+ return ""
+
+/mob/proc/flash_weak_pain()
+ flick("weak_pain",pain)
+
+/mob/proc/get_visible_implants(var/class = 0)
+ var/list/visible_implants = list()
+ for(var/obj/item/O in embedded)
+ if(O.w_class > class)
+ visible_implants += O
+ return visible_implants
+
+/mob/proc/embedded_needs_process()
+ return (embedded.len > 0)
+
+mob/proc/yank_out_object()
+ set category = "Object"
+ set name = "Yank out object"
+ set desc = "Remove an embedded item at the cost of bleeding and pain."
+ set src in view(1)
+
+ if(!isliving(usr) || !usr.checkClickCooldown())
+ return
+ usr.setClickCooldown(20)
+
+ if(usr.stat == 1)
+ to_chat(usr, "You are unconcious and cannot do that!")
+ return
+
+ if(usr.restrained())
+ to_chat(usr, "You are restrained and cannot do that!")
+ return
+
+ var/mob/S = src
+ var/mob/U = usr
+ var/list/valid_objects = list()
+ var/self = null
+
+ if(S == U)
+ self = 1 // Removing object from yourself.
+
+ valid_objects = get_visible_implants(0)
+ if(!valid_objects.len)
+ if(self)
+ to_chat(src, "You have nothing stuck in your body that is large enough to remove.")
+ else
+ to_chat(U, "[src] has nothing stuck in their wounds that is large enough to remove.")
+ return
+
+ var/obj/item/weapon/selection = input("What do you want to yank out?", "Embedded objects") in valid_objects
+
+ if(self)
+ to_chat(src, "You attempt to get a good grip on [selection] in your body.")
+ else
+ to_chat(U, "You attempt to get a good grip on [selection] in [S]'s body.")
+
+ if(!do_after(U, 30))
+ return
+ if(!selection || !S || !U)
+ return
+
+ if(self)
+ visible_message("[src] rips [selection] out of their body.","You rip [selection] out of your body.")
+ else
+ visible_message("[usr] rips [selection] out of [src]'s body.","[usr] rips [selection] out of your body.")
+ valid_objects = get_visible_implants(0)
+ if(valid_objects.len == 1) //Yanking out last object - removing verb.
+ src.verbs -= /mob/proc/yank_out_object
+ clear_alert("embeddedobject")
+
+ if(ishuman(src))
+ var/mob/living/carbon/human/H = src
+ var/obj/item/organ/external/affected
+
+ for(var/obj/item/organ/external/organ in H.organs) //Grab the organ holding the implant.
+ for(var/obj/item/O in organ.implants)
+ if(O == selection)
+ affected = organ
+
+ affected.implants -= selection
+ H.shock_stage+=20
+ affected.take_damage((selection.w_class * 3), 0, 0, 1, "Embedded object extraction")
+
+ if(prob(selection.w_class * 5) && (affected.robotic < ORGAN_ROBOT)) //I'M SO ANEMIC I COULD JUST -DIE-.
+ var/datum/wound/internal_bleeding/I = new (min(selection.w_class * 5, 15))
+ affected.wounds += I
+ H.custom_pain("Something tears wetly in your [affected] as [selection] is pulled free!", 50)
+
+ if (ishuman(U))
+ var/mob/living/carbon/human/human_user = U
+ human_user.bloody_hands(H)
+
+ else if(issilicon(src))
+ var/mob/living/silicon/robot/R = src
+ R.embedded -= selection
+ R.adjustBruteLoss(5)
+ R.adjustFireLoss(10)
+
+ selection.forceMove(get_turf(src))
+ U.put_in_hands(selection)
+
+ for(var/obj/item/weapon/O in pinned)
+ if(O == selection)
+ pinned -= O
+ if(!pinned.len)
+ anchored = 0
+ return 1
+
+//Check for brain worms in head.
+/mob/proc/has_brain_worms()
+
+ for(var/I in contents)
+ if(istype(I,/mob/living/simple_mob/animal/borer))
+ return I
+
+ return 0
+
+/mob/proc/updateicon()
+ return
+
+// Please always use this proc, never just set the var directly.
+/mob/proc/set_stat(var/new_stat)
+ . = (stat != new_stat)
+ stat = new_stat
+
+/mob/verb/face_direction()
+
+ set name = "Face Direction"
+ set category = "IC"
+ set src = usr
+
+ set_face_dir()
+
+ if(!facing_dir)
+ to_chat(usr, "You are now not facing anything.")
+ else
+ to_chat(usr, "You are now facing [dir2text(facing_dir)].")
+
+/mob/proc/set_face_dir(var/newdir)
+ if(newdir == facing_dir)
+ facing_dir = null
+ else if(newdir)
+ set_dir(newdir)
+ facing_dir = newdir
+ else if(facing_dir)
+ facing_dir = null
+ else
+ set_dir(dir)
+ facing_dir = dir
+
+/mob/set_dir()
+ if(facing_dir)
+ if(!canface() || lying || buckled || restrained())
+ facing_dir = null
+ else if(dir != facing_dir)
+ return ..(facing_dir)
+ else
+ return ..()
+
+/mob/verb/northfaceperm()
+ set hidden = 1
+ set_face_dir(client.client_dir(NORTH))
+
+/mob/verb/southfaceperm()
+ set hidden = 1
+ set_face_dir(client.client_dir(SOUTH))
+
+/mob/verb/eastfaceperm()
+ set hidden = 1
+ set_face_dir(client.client_dir(EAST))
+
+/mob/verb/westfaceperm()
+ set hidden = 1
+ set_face_dir(client.client_dir(WEST))
+
+// Begin VOREstation edit
+/mob/verb/shiftnorth()
+ set hidden = TRUE
+ if(!canface())
+ return FALSE
+ if(pixel_y <= (default_pixel_y + 16))
+ pixel_y++
+ is_shifted = TRUE
+
+/mob/verb/shiftsouth()
+ set hidden = TRUE
+ if(!canface())
+ return FALSE
+ if(pixel_y >= (default_pixel_y - 16))
+ pixel_y--
+ is_shifted = TRUE
+
+/mob/verb/shiftwest()
+ set hidden = TRUE
+ if(!canface())
+ return FALSE
+ if(pixel_x >= (default_pixel_x - 16))
+ pixel_x--
+ is_shifted = TRUE
+
+mob/verb/shifteast()
+ set hidden = TRUE
+ if(!canface())
+ return FALSE
+ if(pixel_x <= (default_pixel_x + 16))
+ pixel_x++
+ is_shifted = TRUE
+// End VOREstation edit
+
+/mob/proc/adjustEarDamage()
+ return
+
+/mob/proc/setEarDamage()
+ return
+
+// Set client view distance (size of client's screen). Returns TRUE if anything changed.
+/mob/proc/set_viewsize(var/new_view = world.view)
+ if (client && new_view != client.view)
+ client.view = new_view
+ return TRUE
+ return FALSE
+
+//Throwing stuff
+
+/mob/proc/toggle_throw_mode()
+ if (src.in_throw_mode)
+ throw_mode_off()
+ else
+ throw_mode_on()
+
+/mob/proc/throw_mode_off()
+ src.in_throw_mode = 0
+ if(src.throw_icon) //in case we don't have the HUD and we use the hotkey
+ src.throw_icon.icon_state = "act_throw_off"
+
+/mob/proc/throw_mode_on()
+ src.in_throw_mode = 1
+ if(src.throw_icon)
+ src.throw_icon.icon_state = "act_throw_on"
+
+/mob/proc/isSynthetic()
+ return 0
+
+/mob/proc/is_muzzled()
+ return 0
+
+//Exploitable Info Update
+
+/mob/proc/amend_exploitable(var/obj/item/I)
+ if(istype(I))
+ exploit_addons |= I
+ var/exploitmsg = html_decode("\n" + "Has " + I.name + ".")
+ exploit_record += exploitmsg
+
+/client/proc/check_has_body_select()
+ return mob && mob.hud_used && istype(mob.zone_sel, /obj/screen/zone_sel)
+
+/client/verb/body_toggle_head()
+ set name = "body-toggle-head"
+ set hidden = 1
+ toggle_zone_sel(list(BP_HEAD, O_EYES, O_MOUTH))
+
+/client/verb/body_r_arm()
+ set name = "body-r-arm"
+ set hidden = 1
+ toggle_zone_sel(list(BP_R_ARM,BP_R_HAND))
+
+/client/verb/body_l_arm()
+ set name = "body-l-arm"
+ set hidden = 1
+ toggle_zone_sel(list(BP_L_ARM,BP_L_HAND))
+
+/client/verb/body_chest()
+ set name = "body-chest"
+ set hidden = 1
+ toggle_zone_sel(list(BP_TORSO))
+
+/client/verb/body_groin()
+ set name = "body-groin"
+ set hidden = 1
+ toggle_zone_sel(list(BP_GROIN))
+
+/client/verb/body_r_leg()
+ set name = "body-r-leg"
+ set hidden = 1
+ toggle_zone_sel(list(BP_R_LEG,BP_R_FOOT))
+
+/client/verb/body_l_leg()
+ set name = "body-l-leg"
+ set hidden = 1
+ toggle_zone_sel(list(BP_L_LEG,BP_L_FOOT))
+
+/client/proc/toggle_zone_sel(list/zones)
+ if(!check_has_body_select())
+ return
+ var/obj/screen/zone_sel/selector = mob.zone_sel
+ selector.set_selected_zone(next_in_list(mob.zone_sel.selecting,zones))
+
+// This handles setting the client's color variable, which makes everything look a specific color.
+// This proc is here so it can be called without needing to check if the client exists, or if the client relogs.
+// This is for inheritence since /mob/living will serve most cases. If you need ghosts to use this you'll have to implement that yourself.
+/mob/proc/update_client_color()
+ if(client && client.color)
+ animate(client, color = null, time = 10)
+ return
+
+/mob/proc/swap_hand()
+ return
+
+//Throwing stuff
+/mob/proc/throw_item(atom/target)
+ return
+
+/mob/proc/will_show_tooltip()
+ if(alpha <= EFFECTIVE_INVIS)
+ return FALSE
+ return TRUE
+
+/mob/MouseEntered(location, control, params)
+ if(usr != src && usr.is_preference_enabled(/datum/client_preference/mob_tooltips) && src.will_show_tooltip())
+ openToolTip(user = usr, tip_src = src, params = params, title = get_nametag_name(usr), content = get_nametag_desc(usr))
+
+ ..()
+
+/mob/MouseDown()
+ closeToolTip(usr) //No reason not to, really
+
+ ..()
+
+/mob/MouseExited()
+ closeToolTip(usr) //No reason not to, really
+
+ ..()
+
+// Manages a global list of mobs with clients attached, indexed by z-level.
+/mob/proc/update_client_z(new_z) // +1 to register, null to unregister.
+ if(registered_z != new_z)
+ if(registered_z)
+ GLOB.players_by_zlevel[registered_z] -= src
+ if(client)
+ if(new_z)
+ GLOB.players_by_zlevel[new_z] += src
+ registered_z = new_z
+ else
+ registered_z = null
+
+GLOBAL_LIST_EMPTY_TYPED(living_players_by_zlevel, /list)
+/mob/living/update_client_z(new_z)
+ var/precall_reg_z = registered_z
+ . = ..() // will update registered_z if necessary
+ if(precall_reg_z != registered_z) // parent did work, let's do work too
+ if(precall_reg_z)
+ GLOB.living_players_by_zlevel[precall_reg_z] -= src
+ if(registered_z)
+ GLOB.living_players_by_zlevel[registered_z] += src
+
+/mob/onTransitZ(old_z, new_z)
+ ..()
+ update_client_z(new_z)
+
+/mob/cloak()
+ . = ..()
+ if(client && cloaked_selfimage)
+ client.images += cloaked_selfimage
+
+/mob/uncloak()
+ if(client && cloaked_selfimage)
+ client.images -= cloaked_selfimage
+ return ..()
+
+/mob/get_cloaked_selfimage()
+ var/icon/selficon = getCompoundIcon(src)
+ selficon.MapColors(0,0,0, 0,0,0, 0,0,0, 1,1,1) //White
+ var/image/selfimage = image(selficon)
+ selfimage.color = "#0000FF"
+ selfimage.alpha = 100
+ selfimage.layer = initial(layer)
+ selfimage.plane = initial(plane)
+ selfimage.loc = src
+
+ return selfimage
+
+/mob/proc/GetAltName()
+ return ""
+
+/mob/proc/get_ghost(even_if_they_cant_reenter = 0)
+ if(mind)
+ return mind.get_ghost(even_if_they_cant_reenter)
+
+/mob/proc/grab_ghost(force)
+ if(mind)
+ return mind.grab_ghost(force = force)
+>>>>>>> da4837903c... Merge pull request #10433 from VOREStation/upstream-merge-8085
diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm
index daf9ab6d89..ecd6604a83 100644
--- a/code/modules/mob/mob_defines.dm
+++ b/code/modules/mob/mob_defines.dm
@@ -170,7 +170,7 @@
var/mob/living/carbon/LAssailant = null
//Wizard mode, but can be used in other modes thanks to the brand new "Give Spell" badmin button
- var/spell/list/spell_list = list()
+ var/list/spell/spell_list = list()
//Changlings, but can be used in other modes
// var/obj/effect/proc_holder/changpower/list/power_list = list()
diff --git a/code/modules/mob/mob_planes.dm b/code/modules/mob/mob_planes.dm
index 241840321a..1d557e4e51 100644
--- a/code/modules/mob/mob_planes.dm
+++ b/code/modules/mob/mob_planes.dm
@@ -82,7 +82,7 @@
if(PM.sub_planes)
var/list/subplanes = PM.sub_planes
for(var/SP in subplanes)
- set_vis(which = SP, new_alpha = new_alpha)
+ set_vis(which = SP, state = !!new_alpha)
/datum/plane_holder/proc/set_ao(var/which = null, var/enabled = FALSE)
ASSERT(which)
diff --git a/code/modules/mob/skillset.dm b/code/modules/mob/skillset.dm
index 2877372491..3afb7a97aa 100644
--- a/code/modules/mob/skillset.dm
+++ b/code/modules/mob/skillset.dm
@@ -10,5 +10,3 @@
return 0
else
return fail_chance * 2 ** (factor*(SKILL_BASIC - points))
-
- return FALSE // We don't actually have a skills system, so never fail.
diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm
index fc0c3bebdd..47ccbfac25 100644
--- a/code/modules/mob/transform_procs.dm
+++ b/code/modules/mob/transform_procs.dm
@@ -55,8 +55,7 @@
var/mob/living/silicon/ai/O = ..(move)
if(O)
O.flavor_text = O.client?.prefs?.flavor_texts["general"]
-
- return O
+ return O
//VOREStation Edit End
return ..(move)
diff --git a/code/modules/multiz/hoist.dm b/code/modules/multiz/hoist.dm
index 32e2ed9bb7..4a3f14836c 100644
--- a/code/modules/multiz/hoist.dm
+++ b/code/modules/multiz/hoist.dm
@@ -211,7 +211,7 @@
size = O.w_class
user.visible_message(span("notice", "[user] begins to [movtext] \the [hoistee]!"), span("notice", "You begin to [movtext] \the [hoistee]!"), span("notice", "You hear the sound of a crank."))
- if (do_after(user, (1 SECONDS) * size / 4, act_target = src))
+ if (do_after(user, (1 SECONDS) * size / 4, target = src))
move_dir(movedir, 1)
/obj/structure/hoist/proc/collapse_kit()
diff --git a/code/modules/multiz/movement_vr.dm b/code/modules/multiz/movement_vr.dm
index cba6ebb6c5..963215d389 100644
--- a/code/modules/multiz/movement_vr.dm
+++ b/code/modules/multiz/movement_vr.dm
@@ -39,7 +39,7 @@
else if(prey.can_be_drop_pred && pred.can_be_drop_prey) //Is person being fallen onto pred & person falling prey
pred.feed_grabbed_to_self_falling_nom(prey,pred) //oh, how the tables have turned.
*/
-/mob/zshadow/fall_impact(var/atom/hit_atom) //You actually "fall" onto their shadow, first.
+/mob/zshadow/fall_impact(var/atom/hit_atom, var/damage_min = 0, var/damage_max = 10, var/silent = FALSE, var/planetary = FALSE) //You actually "fall" onto their shadow, first.
/*
var/floor_below = src.loc.below //holy fuck
for(var/mob/M in floor_below.contents)
diff --git a/code/modules/multiz/turf.dm b/code/modules/multiz/turf.dm
index f34cae0065..77885e7ce5 100644
--- a/code/modules/multiz/turf.dm
+++ b/code/modules/multiz/turf.dm
@@ -72,7 +72,7 @@
/turf/simulated/open/proc/update()
plane = OPENSPACE_PLANE + src.z
below = GetBelow(src)
- turf_changed_event.register(below, src, /turf/simulated/open/update_icon)
+ turf_changed_event.register(below, src, /atom/proc/update_icon)
levelupdate()
below.update_icon() // So the 'ceiling-less' overlay gets added.
for(var/atom/movable/A in src)
diff --git a/code/modules/nano/interaction/default.dm b/code/modules/nano/interaction/default.dm
index 812ed40eb5..5076f6a04e 100644
--- a/code/modules/nano/interaction/default.dm
+++ b/code/modules/nano/interaction/default.dm
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
/var/global/datum/topic_state/default/default_state = new()
/datum/topic_state/default/href_list(var/mob/user)
@@ -89,3 +90,97 @@
. = min(., shared_living_nano_distance(src_object))
if(. == STATUS_UPDATE && (TK in mutations)) // If we have telekinesis and remain close enough, allow interaction.
return STATUS_INTERACTIVE
+||||||| parent of da4837903c... Merge pull request #10433 from VOREStation/upstream-merge-8085
+=======
+/var/global/datum/topic_state/default/default_state = new()
+
+/datum/topic_state/default/href_list(var/mob/user)
+ return list()
+
+/datum/topic_state/default/can_use_topic(var/src_object, var/mob/user)
+ return user.default_can_use_topic(src_object)
+
+/mob/proc/default_can_use_topic(var/src_object)
+ return STATUS_CLOSE // By default no mob can do anything with NanoUI
+
+/mob/observer/dead/default_can_use_topic(var/src_object)
+ if(can_admin_interact())
+ return STATUS_INTERACTIVE // Admins are more equal
+ if(!client || get_dist(src_object, src) > client.view) // Preventing ghosts from having a million windows open by limiting to objects in range
+ return STATUS_CLOSE
+ return STATUS_UPDATE // Ghosts can view updates
+
+/mob/living/silicon/pai/default_can_use_topic(var/src_object)
+ if((src_object == src || src_object == radio || src_object == communicator) && !stat)
+ return STATUS_INTERACTIVE
+ else
+ return ..()
+
+/mob/living/silicon/robot/default_can_use_topic(var/src_object)
+ . = shared_nano_interaction()
+ if(. <= STATUS_DISABLED)
+ return
+
+ // robots can interact with things they can see within their view range
+ if((src_object in view(src)) && get_dist(src_object, src) <= src.client.view)
+ return STATUS_INTERACTIVE // interactive (green visibility)
+ return STATUS_DISABLED // no updates, completely disabled (red visibility)
+
+/mob/living/silicon/ai/default_can_use_topic(var/src_object)
+ . = shared_nano_interaction()
+ if(. != STATUS_INTERACTIVE)
+ return
+
+ // 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)
+ if(!T || !(z == T.z || (T.z in using_map.player_levels)))
+ return STATUS_CLOSE
+
+ // If an object is in view then we can interact with it
+ if(src_object in view(client.view, src))
+ return STATUS_INTERACTIVE
+
+ // If we're installed in a chassi, rather than transfered to an inteliCard or other container, then check if we have camera view
+ if(is_in_chassis())
+ //stop AIs from leaving windows open and using then after they lose vision
+ if(cameranet && !cameranet.checkTurfVis(get_turf(src_object)))
+ return STATUS_CLOSE
+ return STATUS_INTERACTIVE
+ else if(get_dist(src_object, src) <= client.view) // View does not return what one would expect while installed in an inteliCard
+ return STATUS_INTERACTIVE
+
+ return STATUS_CLOSE
+
+//Some atoms such as vehicles might have special rules for how mobs inside them interact with NanoUI.
+/atom/proc/contents_nano_distance(var/src_object, var/mob/living/user)
+ return user.shared_living_nano_distance(src_object)
+
+/mob/living/proc/shared_living_nano_distance(var/atom/movable/src_object)
+ if (!(src_object in view(4, src))) // If the src object is not in visable, disable updates
+ return STATUS_CLOSE
+
+ var/dist = get_dist(src_object, src)
+ if (dist <= 1)
+ return STATUS_INTERACTIVE // interactive (green visibility)
+ else if (dist <= 2)
+ return STATUS_UPDATE // update only (orange visibility)
+ else if (dist <= 4)
+ return STATUS_DISABLED // no updates, completely disabled (red visibility)
+ return STATUS_CLOSE
+
+/mob/living/default_can_use_topic(var/src_object)
+ . = shared_nano_interaction(src_object)
+ if(. != STATUS_CLOSE)
+ if(loc)
+ . = min(., loc.contents_nano_distance(src_object, src))
+ if(. == STATUS_INTERACTIVE)
+ return STATUS_UPDATE
+
+/mob/living/carbon/human/default_can_use_topic(var/src_object)
+ . = shared_nano_interaction(src_object)
+ if(. != STATUS_CLOSE)
+ . = min(., shared_living_nano_distance(src_object))
+ if(. == STATUS_UPDATE && (TK in mutations)) // If we have telekinesis and remain close enough, allow interaction.
+ return STATUS_INTERACTIVE
+>>>>>>> da4837903c... Merge pull request #10433 from VOREStation/upstream-merge-8085
diff --git a/code/modules/nano/nanoexternal.dm b/code/modules/nano/nanoexternal.dm
index 08f9deffa9..e9bd608ccc 100644
--- a/code/modules/nano/nanoexternal.dm
+++ b/code/modules/nano/nanoexternal.dm
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
// This file contains all Nano procs/definitions for external classes/objects
/**
@@ -42,3 +43,50 @@
// Used by the Nano UI Manager (/datum/nanomanager) to track UIs opened by this mob
/mob/var/list/open_uis = list()
+||||||| parent of da4837903c... Merge pull request #10433 from VOREStation/upstream-merge-8085
+=======
+ // This file contains all Nano procs/definitions for external classes/objects
+
+ /**
+ * Called when a Nano UI window is closed
+ * This is how Nano handles closed windows
+ * It must be a verb so that it can be called using winset
+ *
+ * @return nothing
+ */
+/client/verb/nanoclose(var/uiref as text)
+ set hidden = 1 // hide this verb from the user's panel
+ set name = "nanoclose"
+
+ var/datum/nanoui/ui = locate(uiref)
+
+ if (istype(ui))
+ ui.close()
+
+ if(ui.ref)
+ var/href = "close=1"
+ src.Topic(href, params2list(href), ui.ref) // this will direct to the atom's Topic() proc via client.Topic()
+ else if (ui.on_close_logic)
+ // no atomref specified (or not found)
+ // so just reset the user mob's machine var
+ if(src && src.mob)
+ src.mob.unset_machine()
+
+ /**
+ * The ui_interact proc is used to open and update Nano UIs
+ * If ui_interact is not used then the UI will not update correctly
+ * ui_interact is currently defined for /atom/movable
+ *
+ * @param user /mob The mob who is interacting with this ui
+ * @param ui_key string A string key to use for this ui. Allows for multiple unique uis on one obj/mob (defaut value "main")
+ * @param ui /datum/nanoui This parameter is passed by the nanoui process() proc when updating an open ui
+ * @param force_open boolean Force the UI to (re)open, even if it's already open
+ *
+ * @return nothing
+ */
+/datum/proc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, master_ui = null, var/datum/topic_state/state = default_state)
+ return
+
+// Used by the Nano UI Manager (/datum/nanomanager) to track UIs opened by this mob
+/mob/var/list/open_uis = list()
+>>>>>>> da4837903c... Merge pull request #10433 from VOREStation/upstream-merge-8085
diff --git a/code/modules/nifsoft/nif_tgui.dm b/code/modules/nifsoft/nif_tgui.dm
index 2d53ad979c..b5978242c4 100644
--- a/code/modules/nifsoft/nif_tgui.dm
+++ b/code/modules/nifsoft/nif_tgui.dm
@@ -60,7 +60,7 @@
user.verbs |= /mob/living/carbon/human/proc/nif_menu
-/datum/component/nif_menu/proc/nif_menu_click(atom/movable/screen/nif/image, location, control, params, user)
+/datum/component/nif_menu/proc/nif_menu_click(obj/screen/nif/image, location, control, params, user)
var/mob/living/carbon/human/H = user
if(istype(H) && H.nif)
INVOKE_ASYNC(H.nif, .proc/tgui_interact, user)
@@ -118,13 +118,14 @@
data["nif_percent"] = round((durability/initial(durability))*100)
data["nif_stat"] = stat
- data["modules"] = list()
+
+ var/list/modules = list()
if(stat == NIF_WORKING)
for(var/nifsoft in nifsofts)
if(!nifsoft)
continue
var/datum/nifsoft/NS = nifsoft
- data["modules"].Add(list(list(
+ modules.Add(list(list(
"name" = NS.name,
"desc" = NS.desc,
"p_drain" = NS.p_drain,
@@ -137,6 +138,7 @@
"stat_text" = NS.stat_text(),
"ref" = REF(NS),
)))
+ data["modules"] = modules
return data
diff --git a/code/modules/nifsoft/software/05_health.dm b/code/modules/nifsoft/software/05_health.dm
index a28bb16941..7ceb260b6e 100644
--- a/code/modules/nifsoft/software/05_health.dm
+++ b/code/modules/nifsoft/software/05_health.dm
@@ -17,7 +17,7 @@
if((. = ..()))
mode = 1
-/datum/nifsoft/medichines_org/deactivate()
+/datum/nifsoft/medichines_org/deactivate(var/force = FALSE)
if((. = ..()))
a_drain = initial(a_drain)
mode = initial(mode)
@@ -94,7 +94,7 @@
if((. = ..()))
mode = 1
-/datum/nifsoft/medichines_syn/deactivate()
+/datum/nifsoft/medichines_syn/deactivate(var/force = FALSE)
if((. = ..()))
mode = 0
@@ -163,7 +163,7 @@
if((. = ..()))
nif.notify("Now taking air from reserves.")
-/datum/nifsoft/spare_breath/deactivate()
+/datum/nifsoft/spare_breath/deactivate(var/force = FALSE)
if((. = ..()))
nif.notify("Now taking air from environment and refilling reserves.")
@@ -214,7 +214,7 @@
deactivate()
return TRUE
-/datum/nifsoft/mindbackup/deactivate()
+/datum/nifsoft/mindbackup/deactivate(var/force = FALSE)
if((. = ..()))
return TRUE
diff --git a/code/modules/nifsoft/software/06_screens.dm b/code/modules/nifsoft/software/06_screens.dm
index 253ed17c8d..3d20514074 100644
--- a/code/modules/nifsoft/software/06_screens.dm
+++ b/code/modules/nifsoft/software/06_screens.dm
@@ -20,7 +20,7 @@
arscreen.tgui_interact(nif.human)
return TRUE
-/datum/nifsoft/crewmonitor/deactivate()
+/datum/nifsoft/crewmonitor/deactivate(var/force = FALSE)
if((. = ..()))
return TRUE
@@ -49,7 +49,7 @@
tgarscreen.tgui_interact(nif.human)
return TRUE
-/datum/nifsoft/alarmmonitor/deactivate()
+/datum/nifsoft/alarmmonitor/deactivate(var/force = FALSE)
if((. = ..()))
return TRUE
diff --git a/code/modules/nifsoft/software/13_soulcatcher.dm b/code/modules/nifsoft/software/13_soulcatcher.dm
index 9912556fdc..717474abc9 100644
--- a/code/modules/nifsoft/software/13_soulcatcher.dm
+++ b/code/modules/nifsoft/software/13_soulcatcher.dm
@@ -35,7 +35,7 @@
spawn(0)
deactivate()
-/datum/nifsoft/soulcatcher/deactivate()
+/datum/nifsoft/soulcatcher/deactivate(var/force = FALSE)
if((. = ..()))
return TRUE
@@ -336,7 +336,7 @@
return FALSE
..()
-/mob/living/carbon/brain/caught_soul/show_message()
+/mob/living/carbon/brain/caught_soul/show_message(msg, type, alt, alt_type)
if(ext_blind || !client)
return FALSE
..()
@@ -363,7 +363,7 @@
else
return ..(direction)
-/mob/living/carbon/brain/caught_soul/say(var/message)
+/mob/living/carbon/brain/caught_soul/say(var/message, var/datum/language/speaking = null, var/whispering = 0)
if(silent) return FALSE
soulcatcher.say_into(message,src,eyeobj)
diff --git a/code/modules/nifsoft/software/15_misc.dm b/code/modules/nifsoft/software/15_misc.dm
index 79592fa030..b4a4e40933 100644
--- a/code/modules/nifsoft/software/15_misc.dm
+++ b/code/modules/nifsoft/software/15_misc.dm
@@ -23,7 +23,7 @@
H.visible_message("Thin snakelike tendrils grow from [H] and connect to \the [apc].","Thin snakelike tendrils grow from you and connect to \the [apc].")
-/datum/nifsoft/apc_recharge/deactivate()
+/datum/nifsoft/apc_recharge/deactivate(var/force = FALSE)
if((. = ..()))
apc = null
@@ -140,7 +140,7 @@
spawn(0)
deactivate()
-/datum/nifsoft/sizechange/deactivate()
+/datum/nifsoft/sizechange/deactivate(var/force = FALSE)
if((. = ..()))
return TRUE
@@ -164,7 +164,7 @@
H.display_alt_appearance("animals", justme)
alt_farmanimals += nif.human
-/datum/nifsoft/worldbend/deactivate()
+/datum/nifsoft/worldbend/deactivate(var/force = FALSE)
if((. = ..()))
var/list/justme = list(nif.human)
for(var/human in human_mob_list)
diff --git a/code/modules/organs/internal/robotic/heatsink.dm b/code/modules/organs/internal/robotic/heatsink.dm
index 4db6e41922..2309a9b7c2 100644
--- a/code/modules/organs/internal/robotic/heatsink.dm
+++ b/code/modules/organs/internal/robotic/heatsink.dm
@@ -38,7 +38,8 @@
var/obj/mecha/M = owner.loc
return M.return_temperature()
else if(istype(owner.loc, /obj/machinery/atmospherics/unary/cryo_cell))
- return owner.loc:air_contents.temperature
+ var/obj/machinery/atmospherics/unary/cryo_cell/cc = owner.loc
+ return cc.air_contents.temperature
var/turf/T = get_turf(src)
diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm
index 37e9429bf0..db5f1fc2e4 100644
--- a/code/modules/organs/organ_external.dm
+++ b/code/modules/organs/organ_external.dm
@@ -582,7 +582,7 @@ This function completely restores a damaged organ to perfect condition.
//external organs handle brokenness a bit differently when it comes to damage. Instead brute_dam is checked inside process()
//this also ensures that an external organ cannot be "broken" without broken_description being set.
/obj/item/organ/external/is_broken()
- return ((status & ORGAN_CUT_AWAY) || (status & ORGAN_BROKEN) && (!splinted || (splinted && splinted in src.contents && prob(30))))
+ return ((status & ORGAN_CUT_AWAY) || (status & ORGAN_BROKEN) && (!splinted || (splinted && (splinted in src.contents) && prob(30))))
//Determines if we even need to process this organ.
/obj/item/organ/external/proc/need_process()
@@ -989,12 +989,12 @@ Note that amputating the affected organ does in fact remove the infection from t
holder = owner
if(!holder)
return
- if (holder.handcuffed && body_part in list(ARM_LEFT, ARM_RIGHT, HAND_LEFT, HAND_RIGHT))
+ if (holder.handcuffed && (body_part in list(ARM_LEFT, ARM_RIGHT, HAND_LEFT, HAND_RIGHT)))
holder.visible_message(\
"\The [holder.handcuffed.name] falls off of [holder.name].",\
"\The [holder.handcuffed.name] falls off you.")
holder.drop_from_inventory(holder.handcuffed)
- if (holder.legcuffed && body_part in list(FOOT_LEFT, FOOT_RIGHT, LEG_LEFT, LEG_RIGHT))
+ if (holder.legcuffed && (body_part in list(FOOT_LEFT, FOOT_RIGHT, LEG_LEFT, LEG_RIGHT)))
holder.visible_message(\
"\The [holder.legcuffed.name] falls off of [holder.name].",\
"\The [holder.legcuffed.name] falls off you.")
diff --git a/code/modules/organs/subtypes/diona.dm b/code/modules/organs/subtypes/diona.dm
index 6b6367e8a0..3d320e3742 100644
--- a/code/modules/organs/subtypes/diona.dm
+++ b/code/modules/organs/subtypes/diona.dm
@@ -15,7 +15,7 @@
if(D)
if(!D.ckey || !D.client)
D.death()
- return 1
+ return
/obj/item/organ/external/diona
name = "tendril"
diff --git a/code/modules/overmap/disperser/disperser_fire.dm b/code/modules/overmap/disperser/disperser_fire.dm
index 421c9b4a20..86116b0677 100644
--- a/code/modules/overmap/disperser/disperser_fire.dm
+++ b/code/modules/overmap/disperser/disperser_fire.dm
@@ -67,7 +67,7 @@
return TRUE
var/obj/effect/overmap/event/finaltarget = pick(candidates)
- log_and_message_admins("A type [chargetype] disperser beam was launched at [finaltarget].", location=finaltarget)
+ log_and_message_admins("A type [chargetype] disperser beam was launched at [finaltarget].")
fire_at_event(finaltarget, chargetype)
return TRUE
diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm
index d67ee7b496..31623ec5e5 100644
--- a/code/modules/paperwork/faxmachine.dm
+++ b/code/modules/paperwork/faxmachine.dm
@@ -212,16 +212,27 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins
adminfaxes += rcvdcopy
//message badmins that a fax has arrived
- if (destination == using_map.boss_name)
+
+ // Sadly, we can't use a switch statement here due to not using a constant value for the current map's centcom name.
+ if(destination == using_map.boss_name)
message_admins(sender, "[uppertext(using_map.boss_short)] FAX", rcvdcopy, "CentComFaxReply", "#006100")
+<<<<<<< HEAD
else if (destination == "Solar Central Government") // YW EDIT
message_admins(sender, "Solar Central Government FAX", rcvdcopy, "CentComFaxReply", "#1F66A0")
else if (destination == "Supply")
+||||||| parent of da4837903c... Merge pull request #10433 from VOREStation/upstream-merge-8085
+ else if (destination == "Virgo-Prime Governmental Authority") // Vorestation Edit
+ message_admins(sender, "VIRGO GOVERNMENT FAX", rcvdcopy, "CentComFaxReply", "#1F66A0")
+ else if (destination == "Supply")
+=======
+ else if(destination == "Virgo-Prime Governmental Authority") // Vorestation Edit
+ message_admins(sender, "VIRGO GOVERNMENT FAX", rcvdcopy, "CentComFaxReply", "#1F66A0") // Vorestation Edit
+ else if(destination == "Supply")
+>>>>>>> da4837903c... Merge pull request #10433 from VOREStation/upstream-merge-8085
message_admins(sender, "[uppertext(using_map.boss_short)] SUPPLY FAX", rcvdcopy, "CentComFaxReply", "#5F4519")
else
message_admins(sender, "[uppertext(destination)] FAX", rcvdcopy, "UNKNOWN")
-
sendcooldown = 1800
sleep(50)
visible_message("[src] beeps, \"Message transmitted successfully.\"")
diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm
index 3d12e68534..c4fa72a9b5 100644
--- a/code/modules/paperwork/filingcabinet.dm
+++ b/code/modules/paperwork/filingcabinet.dm
@@ -90,16 +90,14 @@
ui.open()
/obj/structure/filingcabinet/tgui_data(mob/user)
- var/list/data = list()
-
- data["contents"] = list()
+ var/list/files = list()
for(var/obj/item/P in src)
- data["contents"].Add(list(list(
+ files.Add(list(list(
"name" = P.name,
"ref" = "\ref[P]",
)))
- return data
+ return list("contents" = files)
/obj/structure/filingcabinet/tgui_act(action, params)
if(..())
@@ -146,7 +144,6 @@
P.name = "Security Record ([G.fields["name"]])"
virgin = 0 //tabbing here is correct- it's possible for people to try and use it
//before the records have been generated, so we do this inside the loop.
- ..()
/obj/structure/filingcabinet/security/attack_hand()
populate()
@@ -184,7 +181,6 @@
P.name = "Medical Record ([G.fields["name"]])"
virgin = 0 //tabbing here is correct- it's possible for people to try and use it
//before the records have been generated, so we do this inside the loop.
- ..()
/obj/structure/filingcabinet/medical/attack_hand()
populate()
diff --git a/code/modules/paperwork/stamps.dm b/code/modules/paperwork/stamps.dm
index 7be509c96f..7810af0d9c 100644
--- a/code/modules/paperwork/stamps.dm
+++ b/code/modules/paperwork/stamps.dm
@@ -88,7 +88,7 @@
var/input_stamp = input(user, "Choose a stamp to disguise as.", "Choose a stamp.") in show_stamps
- if(user && src in user.contents)
+ if(user && (src in user.contents)) // Er, how necessary is this in attack_self?
var/obj/item/weapon/stamp/chosen_stamp = stamps[capitalize(input_stamp)]
diff --git a/code/modules/persistence/noticeboard.dm b/code/modules/persistence/noticeboard.dm
index 2677977253..30fd4acb6f 100644
--- a/code/modules/persistence/noticeboard.dm
+++ b/code/modules/persistence/noticeboard.dm
@@ -115,15 +115,16 @@
/obj/structure/noticeboard/tgui_data(mob/user)
var/list/data = ..()
- data["notices"] = list()
+
+ var/list/notices = list()
for(var/obj/item/I in notices)
- data["notices"].Add(list(list(
+ notices.Add(list(list(
"ispaper" = istype(I, /obj/item/weapon/paper),
"isphoto" = istype(I, /obj/item/weapon/photo),
"name" = I.name,
"ref" = "\ref[I]",
)))
-
+ data["notices"] = notices
return data
/obj/structure/noticeboard/tgui_act(action, params)
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index cfc8a9de5a..10b9889f89 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -635,7 +635,6 @@ obj/structure/cable/proc/cableColor(var/colorC)
src.use(15)
else
to_chat(usr, "You cannot do that.")
- ..()
/obj/item/stack/cable_coil/cyborg/verb/set_colour()
set name = "Change Colour"
diff --git a/code/modules/power/fusion/core/core_field.dm b/code/modules/power/fusion/core/core_field.dm
index 0fb3c63b40..9be55a9ce0 100644
--- a/code/modules/power/fusion/core/core_field.dm
+++ b/code/modules/power/fusion/core/core_field.dm
@@ -531,12 +531,10 @@
if(percent_unstable >= warnpoint) //we're unstable, start warning engineering
global_announcer.autosay(warnmessage, "Field Stability Monitor", "Engineering")
- stable = 0 //we know we're not stable, so let's not state the safe message.
- sleep(20)
- return
- if(percent_unstable < warnpoint && stable == 0) //The field is stable again. Let's set our safe variable and state the safe message.
+ stable = FALSE //we know we're not stable, so let's not state the safe message.
+ else if(percent_unstable < warnpoint && stable == 0) //The field is stable again. Let's set our safe variable and state the safe message.
global_announcer.autosay(stablemessage, "Field Stability Monitor", "Engineering")
- stable = 1
+ stable = TRUE
return
//Reaction radiation is fairly buggy and there's at least three procs dealing with radiation here, this is to ensure constant radiation output.
diff --git a/code/modules/power/singularity/containment_field.dm b/code/modules/power/singularity/containment_field.dm
index c3927ec2bd..50655315ad 100644
--- a/code/modules/power/singularity/containment_field.dm
+++ b/code/modules/power/singularity/containment_field.dm
@@ -18,7 +18,7 @@
/obj/machinery/containment_field/Initialize()
. = ..()
shockdirs = list(turn(dir,90),turn(dir,-90))
- sense_proximity(callback = .HasProximity)
+ sense_proximity(callback = /atom/proc/HasProximity)
/obj/machinery/containment_field/set_dir(new_dir)
. = ..()
@@ -26,7 +26,7 @@
shockdirs = list(turn(dir,90),turn(dir,-90))
/obj/machinery/containment_field/Destroy()
- unsense_proximity(callback = .HasProximity)
+ unsense_proximity(callback = /atom/proc/HasProximity)
if(FG1 && !FG1.clean_up)
FG1.cleanup()
if(FG2 && !FG2.clean_up)
diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
index 08af0c23a5..6d7108fbd6 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
@@ -244,7 +244,6 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
update_state()
update_icon()
return 1
- return 0
@@ -384,4 +383,3 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
update_use_power(USE_POWER_IDLE)
update_icon()
return 1
- return 0
diff --git a/code/modules/projectiles/guns/energy/cell_loaded_vr/cell_loaded.dm b/code/modules/projectiles/guns/energy/cell_loaded_vr/cell_loaded.dm
index 9e1311a5d3..fe12a9020a 100644
--- a/code/modules/projectiles/guns/energy/cell_loaded_vr/cell_loaded.dm
+++ b/code/modules/projectiles/guns/energy/cell_loaded_vr/cell_loaded.dm
@@ -39,7 +39,6 @@
if(istype(other_batt,chambered.type) && other_batt.shots_left)
switch_to(other_batt)
return new chambered.projectile_type()
- break
return null
diff --git a/code/modules/projectiles/projectile/hook.dm b/code/modules/projectiles/projectile/hook.dm
index 3e98319ebd..35b39910a0 100644
--- a/code/modules/projectiles/projectile/hook.dm
+++ b/code/modules/projectiles/projectile/hook.dm
@@ -127,7 +127,7 @@
if(!target_mob)
return
- if(Bump(target_mob, forced=1)) //If we hit a turf, try to force an interaction with a mob on the turf.
+ if(Bump(target_mob)) //If we hit a turf, try to force an interaction with a mob on the turf.
done_mob_unique = TRUE
success = TRUE
else if(firer)
diff --git a/code/modules/reagents/reagents/medicine.dm b/code/modules/reagents/reagents/medicine.dm
index 0fda973243..ab87656fda 100644
--- a/code/modules/reagents/reagents/medicine.dm
+++ b/code/modules/reagents/reagents/medicine.dm
@@ -240,7 +240,8 @@
/datum/reagent/carthatoline/overdose(var/mob/living/carbon/M, var/alien, var/removed)
M.adjustHalLoss(2)
var/mob/living/carbon/human/H = M
- H.internal_organs_by_name[O_STOMACH].take_damage(removed * 2) // Causes stomach contractions, makes sense for an overdose to make it much worse.
+ var/obj/item/organ/internal/stomach/st = H.internal_organs_by_name[O_STOMACH]
+ st?.take_damage(removed * 2) // Causes stomach contractions, makes sense for an overdose to make it much worse.
/datum/reagent/dexalin
name = "Dexalin"
@@ -619,7 +620,8 @@
..()
if(prob(5)) // 1 in 20
var/mob/living/carbon/human/H = M
- H.internal_organs_by_name[O_HEART].take_damage(1)
+ var/obj/item/organ/internal/heart/ht = H.internal_organs_by_name[O_HEART]
+ ht?.take_damage(1)
to_chat(M, "Huh... Is this what a heart attack feels like?")
/datum/reagent/alkysine
diff --git a/code/modules/reagents/reagents/toxins.dm b/code/modules/reagents/reagents/toxins.dm
index 6055ff244b..0ea989228a 100644
--- a/code/modules/reagents/reagents/toxins.dm
+++ b/code/modules/reagents/reagents/toxins.dm
@@ -246,7 +246,8 @@
..()
if(prob(10)) // 1 in 10. This thing's made with welder fuel and fertilizer, what do you expect?
var/mob/living/carbon/human/H = M
- H.internal_organs_by_name[O_HEART].take_damage(1)
+ var/obj/item/organ/internal/heart/ht = H.internal_organs_by_name[O_HEART]
+ ht?.take_damage(1)
to_chat(M, "Huh... Is this what a heart attack feels like?")
/datum/reagent/toxin/potassium_chloride
diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm
index ad5c60c998..c9a297288c 100644
--- a/code/modules/recycling/disposal-construction.dm
+++ b/code/modules/recycling/disposal-construction.dm
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
// Disposal pipe construction
// This is the pipe that you drag around, not the attached ones.
@@ -363,3 +364,736 @@
return TRUE
// VOREStation Add End
+||||||| parent of da4837903c... Merge pull request #10433 from VOREStation/upstream-merge-8085
+// Disposal pipe construction
+// This is the pipe that you drag around, not the attached ones.
+
+/obj/structure/disposalconstruct
+
+ name = "disposal pipe segment"
+ desc = "A huge pipe segment used for constructing disposal systems."
+ icon = 'icons/obj/pipes/disposal.dmi'
+ icon_state = "conpipe-s"
+ anchored = 0
+ density = 0
+ pressure_resistance = 5*ONE_ATMOSPHERE
+ matter = list(DEFAULT_WALL_MATERIAL = 1850)
+ level = 2
+ var/sortType = ""
+ var/ptype = 0
+ var/subtype = 0
+ var/dpdir = 0 // directions as disposalpipe
+ var/base_state = "pipe-s"
+
+/obj/structure/disposalconstruct/New(var/newturf, var/newtype, var/newdir, var/flipped, var/newsubtype)
+ ..(newturf)
+ ptype = newtype
+ dir = newdir
+ // Disposals handle "bent"/"corner" strangely, handle this specially.
+ if(ptype == DISPOSAL_PIPE_STRAIGHT && dir in cornerdirs)
+ ptype = DISPOSAL_PIPE_CORNER
+ switch(dir)
+ if(NORTHWEST)
+ dir = WEST
+ if(NORTHEAST)
+ dir = NORTH
+ if(SOUTHWEST)
+ dir = SOUTH
+ if(SOUTHEAST)
+ dir = EAST
+
+ switch(ptype)
+ if(DISPOSAL_PIPE_BIN, DISPOSAL_PIPE_OUTLET, DISPOSAL_PIPE_CHUTE)
+ density = 1
+ if(DISPOSAL_PIPE_SORTER, DISPOSAL_PIPE_SORTER_FLIPPED)
+ subtype = newsubtype
+
+ if(flipped)
+ do_a_flip()
+ else
+ update() // do_a_flip() calls update anyway, so, lazy way of catching unupdated pipe!
+
+// update iconstate and dpdir due to dir and type
+/obj/structure/disposalconstruct/proc/update()
+ var/flip = turn(dir, 180)
+ var/left = turn(dir, 90)
+ var/right = turn(dir, -90)
+
+ switch(ptype)
+ if(DISPOSAL_PIPE_STRAIGHT)
+ base_state = "pipe-s"
+ dpdir = dir | flip
+ if(DISPOSAL_PIPE_CORNER)
+ base_state = "pipe-c"
+ dpdir = dir | right
+ if(DISPOSAL_PIPE_JUNCTION)
+ base_state = "pipe-j1"
+ dpdir = dir | right | flip
+ if(DISPOSAL_PIPE_JUNCTION_FLIPPED)
+ base_state = "pipe-j2"
+ dpdir = dir | left | flip
+ if(DISPOSAL_PIPE_JUNCTION_Y)
+ base_state = "pipe-y"
+ dpdir = dir | left | right
+ if(DISPOSAL_PIPE_TRUNK)
+ base_state = "pipe-t"
+ dpdir = dir
+ // disposal bin has only one dir, thus we don't need to care about setting it
+ if(DISPOSAL_PIPE_BIN)
+ if(anchored)
+ base_state = "disposal"
+ else
+ base_state = "condisposal"
+ if(DISPOSAL_PIPE_OUTLET)
+ base_state = "outlet"
+ dpdir = dir
+ if(DISPOSAL_PIPE_CHUTE)
+ base_state = "intake"
+ dpdir = dir
+ if(DISPOSAL_PIPE_SORTER)
+ base_state = "pipe-j1s"
+ dpdir = dir | right | flip
+ if(DISPOSAL_PIPE_SORTER_FLIPPED)
+ base_state = "pipe-j2s"
+ dpdir = dir | left | flip
+ if(DISPOSAL_PIPE_UPWARD)
+ base_state = "pipe-u"
+ dpdir = dir
+ if(DISPOSAL_PIPE_DOWNWARD)
+ base_state = "pipe-d"
+ dpdir = dir
+ if(DISPOSAL_PIPE_TAGGER)
+ base_state = "pipe-tagger"
+ dpdir = dir | flip
+ if(DISPOSAL_PIPE_TAGGER_PARTIAL)
+ base_state = "pipe-tagger-partial"
+ dpdir = dir | flip
+
+ if(!(ptype in list(DISPOSAL_PIPE_BIN, DISPOSAL_PIPE_OUTLET, DISPOSAL_PIPE_CHUTE, DISPOSAL_PIPE_UPWARD, DISPOSAL_PIPE_DOWNWARD, DISPOSAL_PIPE_TAGGER, DISPOSAL_PIPE_TAGGER_PARTIAL)))
+ icon_state = "con[base_state]"
+ else
+ icon_state = base_state
+
+ if(invisibility) // if invisible, fade icon
+ alpha = 128
+ else
+ alpha = 255
+ //otherwise burying half-finished pipes under floors causes them to half-fade
+
+// hide called by levelupdate if turf intact status changes
+// change visibility status and force update of icon
+/obj/structure/disposalconstruct/hide(var/intact)
+ invisibility = (intact && level==1) ? 101: 0 // hide if floor is intact
+ update()
+
+
+// flip and rotate verbs
+/obj/structure/disposalconstruct/verb/rotate_clockwise()
+ set category = "Object"
+ set name = "Rotate Pipe Clockwise"
+ set src in view(1)
+
+ if(usr.stat)
+ return
+
+ if(anchored)
+ to_chat(usr, "You must unfasten the pipe before rotating it.")
+ return
+
+ src.set_dir(turn(src.dir, 270))
+ update()
+
+/obj/structure/disposalconstruct/verb/flip()
+ set category = "Object"
+ set name = "Flip Pipe"
+ set src in view(1)
+ if(usr.stat)
+ return
+
+ if(anchored)
+ to_chat(usr, "You must unfasten the pipe before flipping it.")
+ return
+
+ do_a_flip()
+
+/obj/structure/disposalconstruct/proc/do_a_flip()
+ switch(ptype)
+ if(DISPOSAL_PIPE_JUNCTION)
+ ptype = DISPOSAL_PIPE_JUNCTION_FLIPPED
+ if(DISPOSAL_PIPE_JUNCTION_FLIPPED)
+ ptype = DISPOSAL_PIPE_JUNCTION
+ if(DISPOSAL_PIPE_SORTER)
+ ptype = DISPOSAL_PIPE_SORTER_FLIPPED
+ if(DISPOSAL_PIPE_SORTER_FLIPPED)
+ ptype = DISPOSAL_PIPE_SORTER
+
+ update()
+
+// returns the type path of disposalpipe corresponding to this item dtype
+/obj/structure/disposalconstruct/proc/dpipetype()
+ switch(ptype)
+ if(DISPOSAL_PIPE_STRAIGHT,DISPOSAL_PIPE_CORNER)
+ return /obj/structure/disposalpipe/segment
+ if(DISPOSAL_PIPE_JUNCTION,DISPOSAL_PIPE_JUNCTION_FLIPPED,DISPOSAL_PIPE_JUNCTION_Y)
+ return /obj/structure/disposalpipe/junction
+ if(DISPOSAL_PIPE_TRUNK)
+ return /obj/structure/disposalpipe/trunk
+ if(DISPOSAL_PIPE_BIN)
+ return /obj/machinery/disposal
+ if(DISPOSAL_PIPE_OUTLET)
+ return /obj/structure/disposaloutlet
+ if(DISPOSAL_PIPE_CHUTE)
+ return /obj/machinery/disposal/deliveryChute
+ if(DISPOSAL_PIPE_SORTER)
+ switch(subtype)
+ if(DISPOSAL_SORT_NORMAL)
+ return /obj/structure/disposalpipe/sortjunction
+ if(DISPOSAL_SORT_WILDCARD)
+ return /obj/structure/disposalpipe/sortjunction/wildcard
+ if(DISPOSAL_SORT_UNTAGGED)
+ return /obj/structure/disposalpipe/sortjunction/untagged
+ if(DISPOSAL_PIPE_SORTER_FLIPPED)
+ switch(subtype)
+ if(DISPOSAL_SORT_NORMAL)
+ return /obj/structure/disposalpipe/sortjunction/flipped
+ if(DISPOSAL_SORT_WILDCARD)
+ return /obj/structure/disposalpipe/sortjunction/wildcard/flipped
+ if(DISPOSAL_SORT_UNTAGGED)
+ return /obj/structure/disposalpipe/sortjunction/untagged/flipped
+ if(DISPOSAL_PIPE_UPWARD)
+ return /obj/structure/disposalpipe/up
+ if(DISPOSAL_PIPE_DOWNWARD)
+ return /obj/structure/disposalpipe/down
+ if(DISPOSAL_PIPE_TAGGER)
+ return /obj/structure/disposalpipe/tagger
+ if(DISPOSAL_PIPE_TAGGER_PARTIAL)
+ return /obj/structure/disposalpipe/tagger/partial
+ return
+
+
+
+// attackby item
+// wrench: (un)anchor
+// weldingtool: convert to real pipe
+/obj/structure/disposalconstruct/attackby(var/obj/item/I, var/mob/user)
+ var/nicetype = "pipe"
+ var/ispipe = 0 // Indicates if we should change the level of this pipe
+ src.add_fingerprint(user)
+ switch(ptype)
+ if(DISPOSAL_PIPE_BIN)
+ nicetype = "disposal bin"
+ if(DISPOSAL_PIPE_OUTLET)
+ nicetype = "disposal outlet"
+ if(DISPOSAL_PIPE_CHUTE)
+ nicetype = "delivery chute"
+ if(DISPOSAL_PIPE_SORTER, DISPOSAL_PIPE_SORTER_FLIPPED)
+ switch(subtype)
+ if(DISPOSAL_SORT_NORMAL)
+ nicetype = "sorting pipe"
+ if(DISPOSAL_SORT_WILDCARD)
+ nicetype = "wildcard sorting pipe"
+ if(DISPOSAL_SORT_UNTAGGED)
+ nicetype = "untagged sorting pipe"
+ ispipe = 1
+ if(DISPOSAL_PIPE_TAGGER)
+ nicetype = "tagging pipe"
+ ispipe = 1
+ if(DISPOSAL_PIPE_TAGGER_PARTIAL)
+ nicetype = "partial tagging pipe"
+ ispipe = 1
+ else
+ nicetype = "pipe"
+ ispipe = 1
+
+ var/turf/T = src.loc
+ if(!T.is_plating())
+ to_chat(user, "You can only attach the [nicetype] if the floor plating is removed.")
+ return
+
+ var/obj/structure/disposalpipe/CP = locate() in T
+
+ // wrench: (un)anchor
+ if(I.is_wrench())
+ if(anchored)
+ anchored = 0
+ if(ispipe)
+ level = 2
+ density = 0
+ else
+ density = 1
+ to_chat(user, "You detach the [nicetype] from the underfloor.")
+ else
+ if(ptype == DISPOSAL_PIPE_BIN || ptype == DISPOSAL_PIPE_OUTLET || ptype == DISPOSAL_PIPE_CHUTE) // Disposal or outlet
+ if(CP) // There's something there
+ if(!istype(CP,/obj/structure/disposalpipe/trunk))
+ to_chat(user, "The [nicetype] requires a trunk underneath it in order to work.")
+ return
+ else // Nothing under, fuck.
+ to_chat(user, "The [nicetype] requires a trunk underneath it in order to work.")
+ return
+ else
+ if(CP)
+ update()
+ var/pdir = CP.dpdir
+ if(istype(CP, /obj/structure/disposalpipe/broken))
+ pdir = CP.dir
+ if(pdir & dpdir)
+ to_chat(user, "There is already a [nicetype] at that location.")
+ return
+
+ anchored = 1
+ if(ispipe)
+ level = 1 // We don't want disposal bins to disappear under the floors
+ density = 0
+ else
+ density = 1 // We don't want disposal bins or outlets to go density 0
+ to_chat(user, "You attach the [nicetype] to the underfloor.")
+ playsound(src, I.usesound, 100, 1)
+ update()
+
+ // weldingtool: convert to real pipe
+ else if(istype(I, /obj/item/weapon/weldingtool))
+ if(anchored)
+ var/obj/item/weapon/weldingtool/W = I
+ if(W.remove_fuel(0,user))
+ playsound(src, W.usesound, 100, 1)
+ to_chat(user, "Welding the [nicetype] in place.")
+ if(do_after(user, 20 * W.toolspeed))
+ if(!src || !W.isOn()) return
+ to_chat(user, "The [nicetype] has been welded in place!")
+ update() // TODO: Make this neat
+ if(ispipe) // Pipe
+
+ var/pipetype = dpipetype()
+ var/obj/structure/disposalpipe/P = new pipetype(src.loc)
+ src.transfer_fingerprints_to(P)
+ P.base_icon_state = base_state
+ P.set_dir(dir)
+ P.dpdir = dpdir
+ P.updateicon()
+
+ //Needs some special treatment ;)
+ if(ptype==DISPOSAL_PIPE_SORTER || ptype==DISPOSAL_PIPE_SORTER_FLIPPED)
+ var/obj/structure/disposalpipe/sortjunction/SortP = P
+ SortP.sortType = sortType
+ SortP.updatedir()
+ SortP.updatedesc()
+ SortP.updatename()
+
+ else if(ptype==DISPOSAL_PIPE_BIN)
+ var/obj/machinery/disposal/P = new /obj/machinery/disposal(src.loc)
+ src.transfer_fingerprints_to(P)
+ P.mode = 0 // start with pump off
+
+ else if(ptype==DISPOSAL_PIPE_OUTLET)
+ var/obj/structure/disposaloutlet/P = new /obj/structure/disposaloutlet(src.loc)
+ src.transfer_fingerprints_to(P)
+ P.set_dir(dir)
+ var/obj/structure/disposalpipe/trunk/Trunk = CP
+ Trunk.linked = P
+
+ else if(ptype==DISPOSAL_PIPE_CHUTE)
+ var/obj/machinery/disposal/deliveryChute/P = new /obj/machinery/disposal/deliveryChute(src.loc)
+ src.transfer_fingerprints_to(P)
+ P.set_dir(dir)
+
+ qdel(src)
+ return
+ else
+ to_chat(user, "You need more welding fuel to complete this task.")
+ return
+ else
+ to_chat(user, "You need to attach it to the plating first!")
+ return
+
+/obj/structure/disposalconstruct/hides_under_flooring()
+ if(anchored)
+ return 1
+ else
+ return 0
+
+// VOREStation Add Start - Helper procs for RCD
+/obj/structure/disposalconstruct/proc/is_pipe()
+ return (ptype != DISPOSAL_PIPE_BIN && ptype != DISPOSAL_PIPE_OUTLET && ptype != DISPOSAL_PIPE_CHUTE)
+
+//helper proc that makes sure you can place the construct (i.e no dense objects stacking)
+/obj/structure/disposalconstruct/proc/can_place()
+ if(is_pipe())
+ return TRUE
+
+ for(var/obj/structure/disposalconstruct/DC in get_turf(src))
+ if(DC == src)
+ continue
+
+ if(!DC.is_pipe()) //there's already a chute/outlet/bin there
+ return FALSE
+
+ return TRUE
+// VOREStation Add End
+=======
+// Disposal pipe construction
+// This is the pipe that you drag around, not the attached ones.
+
+/obj/structure/disposalconstruct
+
+ name = "disposal pipe segment"
+ desc = "A huge pipe segment used for constructing disposal systems."
+ icon = 'icons/obj/pipes/disposal.dmi'
+ icon_state = "conpipe-s"
+ anchored = 0
+ density = 0
+ pressure_resistance = 5*ONE_ATMOSPHERE
+ matter = list(DEFAULT_WALL_MATERIAL = 1850)
+ level = 2
+ var/sortType = ""
+ var/ptype = 0
+ var/subtype = 0
+ var/dpdir = 0 // directions as disposalpipe
+ var/base_state = "pipe-s"
+
+/obj/structure/disposalconstruct/New(var/newturf, var/newtype, var/newdir, var/flipped, var/newsubtype)
+ ..(newturf)
+ ptype = newtype
+ dir = newdir
+ // Disposals handle "bent"/"corner" strangely, handle this specially.
+ if(ptype == DISPOSAL_PIPE_STRAIGHT && (dir in cornerdirs))
+ ptype = DISPOSAL_PIPE_CORNER
+ switch(dir)
+ if(NORTHWEST)
+ dir = WEST
+ if(NORTHEAST)
+ dir = NORTH
+ if(SOUTHWEST)
+ dir = SOUTH
+ if(SOUTHEAST)
+ dir = EAST
+
+ switch(ptype)
+ if(DISPOSAL_PIPE_BIN, DISPOSAL_PIPE_OUTLET, DISPOSAL_PIPE_CHUTE)
+ density = 1
+ if(DISPOSAL_PIPE_SORTER, DISPOSAL_PIPE_SORTER_FLIPPED)
+ subtype = newsubtype
+
+ if(flipped)
+ do_a_flip()
+ else
+ update() // do_a_flip() calls update anyway, so, lazy way of catching unupdated pipe!
+
+// update iconstate and dpdir due to dir and type
+/obj/structure/disposalconstruct/proc/update()
+ var/flip = turn(dir, 180)
+ var/left = turn(dir, 90)
+ var/right = turn(dir, -90)
+
+ switch(ptype)
+ if(DISPOSAL_PIPE_STRAIGHT)
+ base_state = "pipe-s"
+ dpdir = dir | flip
+ if(DISPOSAL_PIPE_CORNER)
+ base_state = "pipe-c"
+ dpdir = dir | right
+ if(DISPOSAL_PIPE_JUNCTION)
+ base_state = "pipe-j1"
+ dpdir = dir | right | flip
+ if(DISPOSAL_PIPE_JUNCTION_FLIPPED)
+ base_state = "pipe-j2"
+ dpdir = dir | left | flip
+ if(DISPOSAL_PIPE_JUNCTION_Y)
+ base_state = "pipe-y"
+ dpdir = dir | left | right
+ if(DISPOSAL_PIPE_TRUNK)
+ base_state = "pipe-t"
+ dpdir = dir
+ // disposal bin has only one dir, thus we don't need to care about setting it
+ if(DISPOSAL_PIPE_BIN)
+ if(anchored)
+ base_state = "disposal"
+ else
+ base_state = "condisposal"
+ if(DISPOSAL_PIPE_OUTLET)
+ base_state = "outlet"
+ dpdir = dir
+ if(DISPOSAL_PIPE_CHUTE)
+ base_state = "intake"
+ dpdir = dir
+ if(DISPOSAL_PIPE_SORTER)
+ base_state = "pipe-j1s"
+ dpdir = dir | right | flip
+ if(DISPOSAL_PIPE_SORTER_FLIPPED)
+ base_state = "pipe-j2s"
+ dpdir = dir | left | flip
+ if(DISPOSAL_PIPE_UPWARD)
+ base_state = "pipe-u"
+ dpdir = dir
+ if(DISPOSAL_PIPE_DOWNWARD)
+ base_state = "pipe-d"
+ dpdir = dir
+ if(DISPOSAL_PIPE_TAGGER)
+ base_state = "pipe-tagger"
+ dpdir = dir | flip
+ if(DISPOSAL_PIPE_TAGGER_PARTIAL)
+ base_state = "pipe-tagger-partial"
+ dpdir = dir | flip
+
+ if(!(ptype in list(DISPOSAL_PIPE_BIN, DISPOSAL_PIPE_OUTLET, DISPOSAL_PIPE_CHUTE, DISPOSAL_PIPE_UPWARD, DISPOSAL_PIPE_DOWNWARD, DISPOSAL_PIPE_TAGGER, DISPOSAL_PIPE_TAGGER_PARTIAL)))
+ icon_state = "con[base_state]"
+ else
+ icon_state = base_state
+
+ if(invisibility) // if invisible, fade icon
+ alpha = 128
+ else
+ alpha = 255
+ //otherwise burying half-finished pipes under floors causes them to half-fade
+
+// hide called by levelupdate if turf intact status changes
+// change visibility status and force update of icon
+/obj/structure/disposalconstruct/hide(var/intact)
+ invisibility = (intact && level==1) ? 101: 0 // hide if floor is intact
+ update()
+
+
+// flip and rotate verbs
+/obj/structure/disposalconstruct/verb/rotate_clockwise()
+ set category = "Object"
+ set name = "Rotate Pipe Clockwise"
+ set src in view(1)
+
+ if(usr.stat)
+ return
+
+ if(anchored)
+ to_chat(usr, "You must unfasten the pipe before rotating it.")
+ return
+
+ src.set_dir(turn(src.dir, 270))
+ update()
+
+/obj/structure/disposalconstruct/verb/flip()
+ set category = "Object"
+ set name = "Flip Pipe"
+ set src in view(1)
+ if(usr.stat)
+ return
+
+ if(anchored)
+ to_chat(usr, "You must unfasten the pipe before flipping it.")
+ return
+
+ do_a_flip()
+
+/obj/structure/disposalconstruct/proc/do_a_flip()
+ switch(ptype)
+ if(DISPOSAL_PIPE_JUNCTION)
+ ptype = DISPOSAL_PIPE_JUNCTION_FLIPPED
+ if(DISPOSAL_PIPE_JUNCTION_FLIPPED)
+ ptype = DISPOSAL_PIPE_JUNCTION
+ if(DISPOSAL_PIPE_SORTER)
+ ptype = DISPOSAL_PIPE_SORTER_FLIPPED
+ if(DISPOSAL_PIPE_SORTER_FLIPPED)
+ ptype = DISPOSAL_PIPE_SORTER
+
+ update()
+
+// returns the type path of disposalpipe corresponding to this item dtype
+/obj/structure/disposalconstruct/proc/dpipetype()
+ switch(ptype)
+ if(DISPOSAL_PIPE_STRAIGHT,DISPOSAL_PIPE_CORNER)
+ return /obj/structure/disposalpipe/segment
+ if(DISPOSAL_PIPE_JUNCTION,DISPOSAL_PIPE_JUNCTION_FLIPPED,DISPOSAL_PIPE_JUNCTION_Y)
+ return /obj/structure/disposalpipe/junction
+ if(DISPOSAL_PIPE_TRUNK)
+ return /obj/structure/disposalpipe/trunk
+ if(DISPOSAL_PIPE_BIN)
+ return /obj/machinery/disposal
+ if(DISPOSAL_PIPE_OUTLET)
+ return /obj/structure/disposaloutlet
+ if(DISPOSAL_PIPE_CHUTE)
+ return /obj/machinery/disposal/deliveryChute
+ if(DISPOSAL_PIPE_SORTER)
+ switch(subtype)
+ if(DISPOSAL_SORT_NORMAL)
+ return /obj/structure/disposalpipe/sortjunction
+ if(DISPOSAL_SORT_WILDCARD)
+ return /obj/structure/disposalpipe/sortjunction/wildcard
+ if(DISPOSAL_SORT_UNTAGGED)
+ return /obj/structure/disposalpipe/sortjunction/untagged
+ if(DISPOSAL_PIPE_SORTER_FLIPPED)
+ switch(subtype)
+ if(DISPOSAL_SORT_NORMAL)
+ return /obj/structure/disposalpipe/sortjunction/flipped
+ if(DISPOSAL_SORT_WILDCARD)
+ return /obj/structure/disposalpipe/sortjunction/wildcard/flipped
+ if(DISPOSAL_SORT_UNTAGGED)
+ return /obj/structure/disposalpipe/sortjunction/untagged/flipped
+ if(DISPOSAL_PIPE_UPWARD)
+ return /obj/structure/disposalpipe/up
+ if(DISPOSAL_PIPE_DOWNWARD)
+ return /obj/structure/disposalpipe/down
+ if(DISPOSAL_PIPE_TAGGER)
+ return /obj/structure/disposalpipe/tagger
+ if(DISPOSAL_PIPE_TAGGER_PARTIAL)
+ return /obj/structure/disposalpipe/tagger/partial
+ return
+
+
+
+// attackby item
+// wrench: (un)anchor
+// weldingtool: convert to real pipe
+/obj/structure/disposalconstruct/attackby(var/obj/item/I, var/mob/user)
+ var/nicetype = "pipe"
+ var/ispipe = 0 // Indicates if we should change the level of this pipe
+ src.add_fingerprint(user)
+ switch(ptype)
+ if(DISPOSAL_PIPE_BIN)
+ nicetype = "disposal bin"
+ if(DISPOSAL_PIPE_OUTLET)
+ nicetype = "disposal outlet"
+ if(DISPOSAL_PIPE_CHUTE)
+ nicetype = "delivery chute"
+ if(DISPOSAL_PIPE_SORTER, DISPOSAL_PIPE_SORTER_FLIPPED)
+ switch(subtype)
+ if(DISPOSAL_SORT_NORMAL)
+ nicetype = "sorting pipe"
+ if(DISPOSAL_SORT_WILDCARD)
+ nicetype = "wildcard sorting pipe"
+ if(DISPOSAL_SORT_UNTAGGED)
+ nicetype = "untagged sorting pipe"
+ ispipe = 1
+ if(DISPOSAL_PIPE_TAGGER)
+ nicetype = "tagging pipe"
+ ispipe = 1
+ if(DISPOSAL_PIPE_TAGGER_PARTIAL)
+ nicetype = "partial tagging pipe"
+ ispipe = 1
+ else
+ nicetype = "pipe"
+ ispipe = 1
+
+ var/turf/T = src.loc
+ if(!T.is_plating())
+ to_chat(user, "You can only attach the [nicetype] if the floor plating is removed.")
+ return
+
+ var/obj/structure/disposalpipe/CP = locate() in T
+
+ // wrench: (un)anchor
+ if(I.is_wrench())
+ if(anchored)
+ anchored = 0
+ if(ispipe)
+ level = 2
+ density = 0
+ else
+ density = 1
+ to_chat(user, "You detach the [nicetype] from the underfloor.")
+ else
+ if(ptype == DISPOSAL_PIPE_BIN || ptype == DISPOSAL_PIPE_OUTLET || ptype == DISPOSAL_PIPE_CHUTE) // Disposal or outlet
+ if(CP) // There's something there
+ if(!istype(CP,/obj/structure/disposalpipe/trunk))
+ to_chat(user, "The [nicetype] requires a trunk underneath it in order to work.")
+ return
+ else // Nothing under, fuck.
+ to_chat(user, "The [nicetype] requires a trunk underneath it in order to work.")
+ return
+ else
+ if(CP)
+ update()
+ var/pdir = CP.dpdir
+ if(istype(CP, /obj/structure/disposalpipe/broken))
+ pdir = CP.dir
+ if(pdir & dpdir)
+ to_chat(user, "There is already a [nicetype] at that location.")
+ return
+
+ anchored = 1
+ if(ispipe)
+ level = 1 // We don't want disposal bins to disappear under the floors
+ density = 0
+ else
+ density = 1 // We don't want disposal bins or outlets to go density 0
+ to_chat(user, "You attach the [nicetype] to the underfloor.")
+ playsound(src, I.usesound, 100, 1)
+ update()
+
+ // weldingtool: convert to real pipe
+ else if(istype(I, /obj/item/weapon/weldingtool))
+ if(anchored)
+ var/obj/item/weapon/weldingtool/W = I
+ if(W.remove_fuel(0,user))
+ playsound(src, W.usesound, 100, 1)
+ to_chat(user, "Welding the [nicetype] in place.")
+ if(do_after(user, 20 * W.toolspeed))
+ if(!src || !W.isOn()) return
+ to_chat(user, "The [nicetype] has been welded in place!")
+ update() // TODO: Make this neat
+ if(ispipe) // Pipe
+
+ var/pipetype = dpipetype()
+ var/obj/structure/disposalpipe/P = new pipetype(src.loc)
+ src.transfer_fingerprints_to(P)
+ P.base_icon_state = base_state
+ P.set_dir(dir)
+ P.dpdir = dpdir
+ P.updateicon()
+
+ //Needs some special treatment ;)
+ if(ptype==DISPOSAL_PIPE_SORTER || ptype==DISPOSAL_PIPE_SORTER_FLIPPED)
+ var/obj/structure/disposalpipe/sortjunction/SortP = P
+ SortP.sortType = sortType
+ SortP.updatedir()
+ SortP.updatedesc()
+ SortP.updatename()
+
+ else if(ptype==DISPOSAL_PIPE_BIN)
+ var/obj/machinery/disposal/P = new /obj/machinery/disposal(src.loc)
+ src.transfer_fingerprints_to(P)
+ P.mode = 0 // start with pump off
+
+ else if(ptype==DISPOSAL_PIPE_OUTLET)
+ var/obj/structure/disposaloutlet/P = new /obj/structure/disposaloutlet(src.loc)
+ src.transfer_fingerprints_to(P)
+ P.set_dir(dir)
+ var/obj/structure/disposalpipe/trunk/Trunk = CP
+ Trunk.linked = P
+
+ else if(ptype==DISPOSAL_PIPE_CHUTE)
+ var/obj/machinery/disposal/deliveryChute/P = new /obj/machinery/disposal/deliveryChute(src.loc)
+ src.transfer_fingerprints_to(P)
+ P.set_dir(dir)
+
+ qdel(src)
+ return
+ else
+ to_chat(user, "You need more welding fuel to complete this task.")
+ return
+ else
+ to_chat(user, "You need to attach it to the plating first!")
+ return
+
+/obj/structure/disposalconstruct/hides_under_flooring()
+ if(anchored)
+ return 1
+ else
+ return 0
+
+// VOREStation Add Start - Helper procs for RCD
+/obj/structure/disposalconstruct/proc/is_pipe()
+ return (ptype != DISPOSAL_PIPE_BIN && ptype != DISPOSAL_PIPE_OUTLET && ptype != DISPOSAL_PIPE_CHUTE)
+
+//helper proc that makes sure you can place the construct (i.e no dense objects stacking)
+/obj/structure/disposalconstruct/proc/can_place()
+ if(is_pipe())
+ return TRUE
+
+ for(var/obj/structure/disposalconstruct/DC in get_turf(src))
+ if(DC == src)
+ continue
+
+ if(!DC.is_pipe()) //there's already a chute/outlet/bin there
+ return FALSE
+
+ return TRUE
+// VOREStation Add End
+>>>>>>> da4837903c... Merge pull request #10433 from VOREStation/upstream-merge-8085
diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm
index 3ea0aede1b..700e1d9040 100644
--- a/code/modules/research/server.dm
+++ b/code/modules/research/server.dm
@@ -178,22 +178,24 @@
for(var/obj/machinery/r_n_d/server/S in machines)
if(istype(S, /obj/machinery/r_n_d/server/centcom) && !badmin)
continue
+ var/list/tech = list()
+ var/list/designs = list()
var/list/server_data = list(
"name" = S.name,
"ref" = REF(S),
"id" = S.server_id,
"id_with_upload" = S.id_with_upload,
"id_with_download" = S.id_with_download,
- "tech" = list(),
- "designs" = list(),
+ "tech" = tech,
+ "designs" = designs,
)
for(var/datum/tech/T in S.files.known_tech)
- server_data["tech"].Add(list(list(
+ tech.Add(list(list(
"name" = T.name,
"id" = T.id,
)))
for(var/datum/design/D in S.files.known_designs)
- server_data["designs"].Add(list(list(
+ designs.Add(list(list(
"name" = D.name,
"id" = D.id,
)))
diff --git a/code/modules/resleeving/computers.dm b/code/modules/resleeving/computers.dm
index 06e62271c5..e49c886247 100644
--- a/code/modules/resleeving/computers.dm
+++ b/code/modules/resleeving/computers.dm
@@ -469,7 +469,7 @@
icon_state = "harddisk"
item_state = "card-id"
w_class = ITEMSIZE_SMALL
- var/datum/transhuman/mind_record/list/stored = list()
+ var/list/datum/transhuman/mind_record/stored = list()
/**
* Sets a temporary message to display to the user
diff --git a/code/modules/resleeving/implant.dm b/code/modules/resleeving/implant.dm
index 7c2893a21c..95ea041dee 100644
--- a/code/modules/resleeving/implant.dm
+++ b/code/modules/resleeving/implant.dm
@@ -50,7 +50,7 @@
throw_range = 5
w_class = ITEMSIZE_SMALL
matter = list(DEFAULT_WALL_MATERIAL = 2000, "glass" = 2000)
- var/obj/item/weapon/implant/backup/list/imps = list()
+ var/list/obj/item/weapon/implant/backup/imps = list()
var/max_implants = 4 //Iconstates need to exist due to the update proc!
/obj/item/weapon/backup_implanter/New()
diff --git a/code/modules/resleeving/infomorph.dm b/code/modules/resleeving/infomorph.dm
index fed79fe078..77eae4e51d 100644
--- a/code/modules/resleeving/infomorph.dm
+++ b/code/modules/resleeving/infomorph.dm
@@ -424,11 +424,11 @@ var/list/infomorph_emotions = list(
else
to_chat(src, "You don't have a radio!")
-/mob/living/silicon/infomorph/say(var/msg)
+/mob/living/silicon/infomorph/say(var/message, var/datum/language/speaking = null, var/whispering = 0)
if(silence_time)
to_chat(src, "Communication circuits remain uninitialized.")
else
- ..(msg)
+ ..(message)
/mob/living/silicon/infomorph/handle_message_mode(message_mode, message, verb, speaking, used_radios, alt_name)
switch(message_mode)
diff --git a/code/modules/rogueminer_vr/controller.dm b/code/modules/rogueminer_vr/controller.dm
index 8f7d883992..4c6c710120 100644
--- a/code/modules/rogueminer_vr/controller.dm
+++ b/code/modules/rogueminer_vr/controller.dm
@@ -143,7 +143,7 @@ var/datum/controller/rogue/rm_controller
return oldest_zone
/datum/controller/rogue/proc/mark_clean(var/datum/rogue/zonemaster/ZM)
- if(!ZM in all_zones) //What? Who?
+ if(!(ZM in all_zones)) //What? Who?
rm_controller.dbg("RMC(mc): Some unknown zone asked to be listed.")
if(ZM in ready_zones)
@@ -152,7 +152,7 @@ var/datum/controller/rogue/rm_controller
clean_zones += ZM
/datum/controller/rogue/proc/mark_ready(var/datum/rogue/zonemaster/ZM)
- if(!ZM in all_zones) //What? Who?
+ if(!(ZM in all_zones)) //What? Who?
rm_controller.dbg("RMC(mr): Some unknown zone asked to be listed.")
if(ZM in clean_zones)
@@ -161,19 +161,19 @@ var/datum/controller/rogue/rm_controller
ready_zones += ZM
/datum/controller/rogue/proc/unmark_clean(var/datum/rogue/zonemaster/ZM)
- if(!ZM in all_zones) //What? Who?
+ if(!(ZM in all_zones)) //What? Who?
rm_controller.dbg("RMC(umc): Some unknown zone asked to be listed.")
- if(!ZM in clean_zones)
+ if(!(ZM in clean_zones))
rm_controller.dbg("RMC(umc): Finite state machine broken.")
clean_zones -= ZM
/datum/controller/rogue/proc/unmark_ready(var/datum/rogue/zonemaster/ZM)
- if(!ZM in all_zones) //What? Who?
+ if(!(ZM in all_zones)) //What? Who?
rm_controller.dbg("RMC(umr): Some unknown zone asked to be listed.")
- if(!ZM in ready_zones)
+ if(!(ZM in ready_zones))
rm_controller.dbg("RMC(umr): Finite state machine broken.")
ready_zones -= ZM
diff --git a/code/modules/rogueminer_vr/zonemaster.dm b/code/modules/rogueminer_vr/zonemaster.dm
index ffca74bb34..8f2eba8426 100644
--- a/code/modules/rogueminer_vr/zonemaster.dm
+++ b/code/modules/rogueminer_vr/zonemaster.dm
@@ -27,8 +27,8 @@
var/original_mobs = 0
//in-use spawns from the area
- var/obj/asteroid_spawner/list/rockspawns = list()
- var/obj/rogue_mobspawner/list/mobspawns = list()
+ var/list/obj/asteroid_spawner/rockspawns = list()
+ var/list/obj/rogue_mobspawner/mobspawns = list()
/datum/rogue/zonemaster/New(var/area/A)
ASSERT(A)
diff --git a/code/modules/scripting/IDE.dm b/code/modules/scripting/IDE.dm
index 3974e2dee4..8adc021c4d 100644
--- a/code/modules/scripting/IDE.dm
+++ b/code/modules/scripting/IDE.dm
@@ -1,7 +1,7 @@
client/verb/tcssave()
set hidden = 1
if(mob.machine || issilicon(mob))
- if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && mob.machine in view(1, mob)) || issilicon(mob))
+ if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && (mob.machine in view(1, mob))) || issilicon(mob))
var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine
if(Machine.editingcode != mob)
return
@@ -28,7 +28,7 @@ client/verb/tcssave()
client/verb/tcscompile()
set hidden = 1
if(mob.machine || issilicon(mob))
- if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && mob.machine in view(1, mob)) || (issilicon(mob) && istype(mob.machine, /obj/machinery/computer/telecomms/traffic) ))
+ if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && (mob.machine in view(1, mob))) || (issilicon(mob) && istype(mob.machine, /obj/machinery/computer/telecomms/traffic) ))
var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine
if(Machine.editingcode != mob)
return
@@ -79,7 +79,7 @@ client/verb/tcscompile()
client/verb/tcsrun()
set hidden = 1
if(mob.machine || issilicon(mob))
- if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && mob.machine in view(1, mob)) || (issilicon(mob) && istype(mob.machine, /obj/machinery/computer/telecomms/traffic) ))
+ if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && (mob.machine in view(1, mob))) || (issilicon(mob) && istype(mob.machine, /obj/machinery/computer/telecomms/traffic) ))
var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine
if(Machine.editingcode != mob)
return
@@ -145,7 +145,7 @@ client/verb/tcsrun()
client/verb/exittcs()
set hidden = 1
if(mob.machine || issilicon(mob))
- if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && mob.machine in view(1, mob)) || (issilicon(mob) && istype(mob.machine, /obj/machinery/computer/telecomms/traffic) ))
+ if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && (mob.machine in view(1, mob))) || (issilicon(mob) && istype(mob.machine, /obj/machinery/computer/telecomms/traffic) ))
var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine
if(Machine.editingcode == mob)
Machine.storedcode = "[winget(mob, "tcscode", "text")]"
@@ -157,7 +157,7 @@ client/verb/exittcs()
client/verb/tcsrevert()
set hidden = 1
if(mob.machine || issilicon(mob))
- if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && mob.machine in view(1, mob)) || (issilicon(mob) && istype(mob.machine, /obj/machinery/computer/telecomms/traffic) ))
+ if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && (mob.machine in view(1, mob))) || (issilicon(mob) && istype(mob.machine, /obj/machinery/computer/telecomms/traffic) ))
var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine
if(Machine.editingcode != mob)
return
@@ -186,7 +186,7 @@ client/verb/tcsrevert()
client/verb/tcsclearmem()
set hidden = 1
if(mob.machine || issilicon(mob))
- if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && mob.machine in view(1, mob)) || (issilicon(mob) && istype(mob.machine, /obj/machinery/computer/telecomms/traffic) ))
+ if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && (mob.machine in view(1, mob))) || (issilicon(mob) && istype(mob.machine, /obj/machinery/computer/telecomms/traffic) ))
var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine
if(Machine.editingcode != mob)
return
diff --git a/code/modules/shieldgen/shield_capacitor.dm b/code/modules/shieldgen/shield_capacitor.dm
index d76a18045a..35cd71e134 100644
--- a/code/modules/shieldgen/shield_capacitor.dm
+++ b/code/modules/shieldgen/shield_capacitor.dm
@@ -40,7 +40,7 @@
if(istype(W, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = W
- if(access_captain in C.access || access_security in C.access || access_engine in C.access)
+ if((access_captain in C.access) || (access_security in C.access) || (access_engine in C.access))
src.locked = !src.locked
to_chat(user, "Controls are now [src.locked ? "locked." : "unlocked."]")
updateDialog()
@@ -59,7 +59,7 @@
owned_gen.capacitors |= src
owned_gen.updateDialog()
else
- if(owned_gen && src in owned_gen.capacitors)
+ if(owned_gen && (src in owned_gen.capacitors))
owned_gen.capacitors -= src
owned_gen = null
else
diff --git a/code/modules/shieldgen/shield_gen.dm b/code/modules/shieldgen/shield_gen.dm
index 08d0b8ce86..af9d10d444 100644
--- a/code/modules/shieldgen/shield_gen.dm
+++ b/code/modules/shieldgen/shield_gen.dm
@@ -60,7 +60,7 @@
/obj/machinery/shield_gen/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = W
- if(access_captain in C.access || access_security in C.access || access_engine in C.access)
+ if((access_captain in C.access) || (access_security in C.access) || (access_engine in C.access))
src.locked = !src.locked
to_chat(user, "Controls are now [src.locked ? "locked." : "unlocked."]")
updateDialog()
@@ -110,36 +110,35 @@
return ..()
/obj/machinery/shield_gen/tgui_data(mob/user)
- var/list/data = list()
+ var/list/lockedData = list()
- data["locked"] = locked
- data["lockedData"] = list()
if(!locked)
- data["lockedData"]["capacitors"] = list()
+ var/list/caps = list()
for(var/obj/machinery/shield_capacitor/C in capacitors)
- data["lockedData"]["capacitors"].Add(list(list(
+ caps.Add(list(list(
"active" = C.active,
"stored_charge" = C.stored_charge,
"max_charge" = C.max_charge,
"failing" = (C.time_since_fail <= 2),
)))
+ lockedData["capacitors"] = caps
+
+ lockedData["active"] = active
+ lockedData["failing"] = (time_since_fail <= 2)
+ lockedData["radius"] = field_radius
+ lockedData["max_radius"] = max_field_radius
+ lockedData["z_range"] = z_range
+ lockedData["max_z_range"] = 10
+ lockedData["average_field_strength"] = average_field_strength
+ lockedData["target_field_strength"] = target_field_strength
+ lockedData["max_field_strength"] = max_field_strength
+ lockedData["shields"] = LAZYLEN(field)
+ lockedData["upkeep"] = round(field.len * max(average_field_strength * dissipation_rate, min_dissipation) / energy_conversion_rate)
+ lockedData["strengthen_rate"] = strengthen_rate
+ lockedData["max_strengthen_rate"] = max_strengthen_rate
+ lockedData["gen_power"] = round(field.len * min(strengthen_rate, target_field_strength - average_field_strength) / energy_conversion_rate)
- data["lockedData"]["active"] = active
- data["lockedData"]["failing"] = (time_since_fail <= 2)
- data["lockedData"]["radius"] = field_radius
- data["lockedData"]["max_radius"] = max_field_radius
- data["lockedData"]["z_range"] = z_range
- data["lockedData"]["max_z_range"] = 10
- data["lockedData"]["average_field_strength"] = average_field_strength
- data["lockedData"]["target_field_strength"] = target_field_strength
- data["lockedData"]["max_field_strength"] = max_field_strength
- data["lockedData"]["shields"] = LAZYLEN(field)
- data["lockedData"]["upkeep"] = round(field.len * max(average_field_strength * dissipation_rate, min_dissipation) / energy_conversion_rate)
- data["lockedData"]["strengthen_rate"] = strengthen_rate
- data["lockedData"]["max_strengthen_rate"] = max_strengthen_rate
- data["lockedData"]["gen_power"] = round(field.len * min(strengthen_rate, target_field_strength - average_field_strength) / energy_conversion_rate)
-
- return data
+ return list("locked" = locked, "lockedData" = lockedData)
/obj/machinery/shield_gen/process()
if (!anchored && active)
diff --git a/code/modules/shuttles/web_datums.dm b/code/modules/shuttles/web_datums.dm
index bbba42dd58..6e34d3750b 100644
--- a/code/modules/shuttles/web_datums.dm
+++ b/code/modules/shuttles/web_datums.dm
@@ -220,6 +220,7 @@
return current_destination.routes.Copy()
/datum/shuttle_web_master/proc/get_current_destination()
+ RETURN_TYPE(/datum/shuttle_destination)
return current_destination
/datum/shuttle_web_master/proc/get_destination_by_type(var/type_to_get)
diff --git a/code/modules/spells/spell_code.dm b/code/modules/spells/spell_code.dm
index f2a85f7bbe..5ab0643450 100644
--- a/code/modules/spells/spell_code.dm
+++ b/code/modules/spells/spell_code.dm
@@ -277,7 +277,7 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now
if(level_max[Sp_TOTAL] <= ( spell_levels[Sp_SPEED] + spell_levels[Sp_POWER] )) //too many levels, can't do it
return 0
- if(upgrade_type && upgrade_type in spell_levels && upgrade_type in level_max)
+ if(upgrade_type && (upgrade_type in spell_levels) && (upgrade_type in level_max))
if(spell_levels[upgrade_type] >= level_max[upgrade_type])
return 0
diff --git a/code/modules/spells/spellbook.dm b/code/modules/spells/spellbook.dm
index 831d44ba2f..b4e5e94b70 100644
--- a/code/modules/spells/spellbook.dm
+++ b/code/modules/spells/spellbook.dm
@@ -291,7 +291,7 @@
/obj/item/weapon/spellbook/oneuse/fireball/recoil(mob/user as mob)
..()
- explosion(user.loc, -1, 0, 2, 3, 0, flame_range = 2)
+ explosion(user.loc, -1, 0, 2, 3, 0)
qdel(src)
/obj/item/weapon/spellbook/oneuse/smoke
diff --git a/code/modules/tables/presets.dm b/code/modules/tables/presets.dm
index 085489b26a..93b9de593b 100644
--- a/code/modules/tables/presets.dm
+++ b/code/modules/tables/presets.dm
@@ -129,7 +129,7 @@
verbs -= /obj/structure/table/proc/do_put
..()
-/obj/structure/table/alien/dismantle(obj/item/weapon/wrench/W, mob/user)
+/obj/structure/table/alien/dismantle(obj/item/weapon/tool/wrench/W, mob/user)
to_chat(user, "You cannot dismantle \the [src].")
return
diff --git a/code/modules/tables/presets_vr.dm b/code/modules/tables/presets_vr.dm
index b5fb2642d5..bb7f6f08c6 100644
--- a/code/modules/tables/presets_vr.dm
+++ b/code/modules/tables/presets_vr.dm
@@ -14,7 +14,7 @@
..()
-/obj/structure/table/darkglass/dismantle(obj/item/weapon/wrench/W, mob/user)
+/obj/structure/table/darkglass/dismantle(obj/item/weapon/tool/wrench/W, mob/user)
to_chat(user, "You cannot dismantle \the [src].")
return
/obj/structure/table/alien/blue
@@ -37,7 +37,7 @@
..()
-/obj/structure/table/fancyblack/dismantle(obj/item/weapon/wrench/W, mob/user)
+/obj/structure/table/fancyblack/dismantle(obj/item/weapon/tool/wrench/W, mob/user)
to_chat(user, "You cannot dismantle \the [src].")
return
diff --git a/code/modules/tables/rack.dm b/code/modules/tables/rack.dm
index b07aa188b7..c39fb2c59f 100644
--- a/code/modules/tables/rack.dm
+++ b/code/modules/tables/rack.dm
@@ -23,6 +23,6 @@
color = material.icon_colour
return
-/obj/structure/table/rack/holorack/dismantle(obj/item/weapon/wrench/W, mob/user)
+/obj/structure/table/rack/holorack/dismantle(obj/item/weapon/tool/wrench/W, mob/user)
to_chat(user, "You cannot dismantle \the [src].")
return
diff --git a/code/modules/telesci/telesci_computer.dm b/code/modules/telesci/telesci_computer.dm
index d2a6a0a35a..bac505f612 100644
--- a/code/modules/telesci/telesci_computer.dm
+++ b/code/modules/telesci/telesci_computer.dm
@@ -197,7 +197,7 @@
// Irradiate everyone in telescience!
for(var/obj/machinery/telepad/E in machines)
var/L = get_turf(E)
- sparks(target = L)
+ sparks()
for(var/mob/living/carbon/human/M in viewers(L, null))
M.apply_effect((rand(10, 20)), IRRADIATE, 0)
to_chat(M, "You feel strange.")
diff --git a/code/modules/tgui/external.dm b/code/modules/tgui/external.dm
index bb39c721d0..6f9a3fc8e3 100644
--- a/code/modules/tgui/external.dm
+++ b/code/modules/tgui/external.dm
@@ -15,7 +15,7 @@
* optional parent_ui datum/tgui A parent UI that, when closed, closes this UI as well.
*/
-/datum/proc/tgui_interact(mob/user, datum/tgui/ui = null, datum/tgui/parent_ui = null)
+/datum/proc/tgui_interact(mob/user, datum/tgui/ui = null, datum/tgui/parent_ui = null, custom_state = null)
return FALSE // Not implemented.
/**
diff --git a/code/modules/tgui/modules/admin_shuttle_controller.dm b/code/modules/tgui/modules/admin_shuttle_controller.dm
index 20e5c47367..d2ce9bc69e 100644
--- a/code/modules/tgui/modules/admin_shuttle_controller.dm
+++ b/code/modules/tgui/modules/admin_shuttle_controller.dm
@@ -58,11 +58,11 @@
target = V.restricted_waypoints[1]
else
to_chat(C, "Unable to jump to [V].")
- return FALSE
+ return
var/turf/T = get_turf(target)
if(!istype(T))
to_chat(C, "Unable to jump to [V].")
- return FALSE
+ return
C.jumptoturf(T)
return TRUE
if("classicmove")
diff --git a/code/modules/tgui/modules/atmos_control.dm b/code/modules/tgui/modules/atmos_control.dm
index 4fd477a531..6f573ad96c 100644
--- a/code/modules/tgui/modules/atmos_control.dm
+++ b/code/modules/tgui/modules/atmos_control.dm
@@ -13,7 +13,7 @@
if(monitored_alarm_ids)
for(var/obj/machinery/alarm/alarm in machines)
- if(alarm.alarm_id && alarm.alarm_id in monitored_alarm_ids)
+ if(alarm.alarm_id && (alarm.alarm_id in monitored_alarm_ids))
monitored_alarms += alarm
// machines may not yet be ordered at this point
monitored_alarms = dd_sortedObjectList(monitored_alarms)
diff --git a/code/modules/tgui/modules/overmap.dm b/code/modules/tgui/modules/overmap.dm
index 2e566e1267..097bf84a05 100644
--- a/code/modules/tgui/modules/overmap.dm
+++ b/code/modules/tgui/modules/overmap.dm
@@ -158,7 +158,6 @@
. = ..()
if(!istype(new_linked))
CRASH("Warning, [new_linked] is not an overmap ship! Something went horribly wrong for [usr]!")
- return
linked = new_linked
name = initial(name) + " ([linked.name])"
// HELM
diff --git a/code/modules/turbolift/turbolift_console.dm b/code/modules/turbolift/turbolift_console.dm
index 4d300bcfc2..9868188d18 100644
--- a/code/modules/turbolift/turbolift_console.dm
+++ b/code/modules/turbolift/turbolift_console.dm
@@ -158,10 +158,10 @@
data["doors_open"] = lift.doors_are_open()
data["fire_mode"] = lift.fire_mode
- data["floors"] = list()
+ var/list/floors = list()
for(var/i in lift.floors.len to 1 step -1)
var/datum/turbolift_floor/floor = lift.floors[i]
- data["floors"].Add(list(list(
+ floors.Add(list(list(
"id" = i,
"ref" = "\ref[floor]",
"queued" = (floor in lift.queued_floors),
@@ -170,6 +170,7 @@
"label" = floor.label,
"name" = floor.name,
)))
+ data["floors"] = floors
return data
diff --git a/code/modules/vchat/vchat_client.dm b/code/modules/vchat/vchat_client.dm
index fa8b0c7c7f..1b60d14ae4 100644
--- a/code/modules/vchat/vchat_client.dm
+++ b/code/modules/vchat/vchat_client.dm
@@ -176,7 +176,6 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of ic
/proc/jsEncode(var/list/message) {
if(!islist(message))
CRASH("Passed a non-list to encode.")
- return; //Necessary?
return url_encode(url_encode(json_encode(message)))
}
diff --git a/code/modules/virus2/disease2.dm b/code/modules/virus2/disease2.dm
index 9d37b1db29..67d76a8177 100644
--- a/code/modules/virus2/disease2.dm
+++ b/code/modules/virus2/disease2.dm
@@ -253,17 +253,18 @@ var/global/list/virusDB = list()
"rate" = stageprob * 10,
"resistance" = resistance,
"species" = jointext(affected_species, ", "),
- "symptoms" = list(),
"ref" = "\ref[src]",
)
-
+
+ var/list/symptoms = list()
for(var/datum/disease2/effectholder/E in effects)
- .["symptoms"].Add(list(list(
+ symptoms.Add(list(list(
"stage" = E.stage,
"name" = E.effect.name,
"strength" = "[E.multiplier >= 3 ? "Severe" : E.multiplier > 1 ? "Above Average" : "Average"]",
"aggressiveness" = E.chance * 15,
)))
+ .["symptoms"] = symptoms
/datum/disease2/disease/proc/addToDB()
if ("[uniqueID]" in virusDB)
diff --git a/code/modules/vore/eating/belly_obj_vr.dm b/code/modules/vore/eating/belly_obj_vr.dm
index 5ef4e9ad31..1a5292bf6f 100644
--- a/code/modules/vore/eating/belly_obj_vr.dm
+++ b/code/modules/vore/eating/belly_obj_vr.dm
@@ -41,7 +41,7 @@
var/obj/item/weapon/storage/vore_egg/ownegg // Is this belly creating an egg?
var/egg_type = "Egg" // Default egg type and path.
var/egg_path = /obj/item/weapon/storage/vore_egg
- var/list/emote_lists = list() // Idle emotes that happen on their own, depending on the bellymode. Contains lists of strings indexed by bellymode
+ var/list/list/emote_lists = list() // Idle emotes that happen on their own, depending on the bellymode. Contains lists of strings indexed by bellymode
var/emote_time = 60 // How long between stomach emotes at prey (in seconds)
var/emote_active = TRUE // Are we even giving emotes out at all or not?
var/next_emote = 0 // When we're supposed to print our next emote, as a world.time
diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm
index 0cb90f1442..3d31c0db4f 100644
--- a/code/modules/vore/eating/vorepanel_vr.dm
+++ b/code/modules/vore/eating/vorepanel_vr.dm
@@ -100,13 +100,13 @@
data["unsaved_changes"] = unsaved_changes
data["show_pictures"] = show_pictures
- data["inside"] = list()
var/atom/hostloc = host.loc
+ var/list/inside = list()
if(isbelly(hostloc))
var/obj/belly/inside_belly = hostloc
var/mob/living/pred = inside_belly.owner
- data["inside"] = list(
+ inside = list(
"absorbed" = host.absorbed,
"belly_name" = inside_belly.name,
"belly_mode" = inside_belly.digest_mode,
@@ -115,7 +115,7 @@
"ref" = "\ref[inside_belly]",
)
- data["inside"]["contents"] = list()
+ var/list/inside_contents = list()
for(var/atom/movable/O in inside_belly)
if(O == host)
continue
@@ -134,22 +134,33 @@
info["stat"] = M.stat
if(M.absorbed)
info["absorbed"] = TRUE
- data["inside"]["contents"].Add(list(info))
+ inside_contents.Add(list(info))
+ inside["contents"] = inside_contents
+ data["inside"] = list()
- data["our_bellies"] = list()
+ var/list/our_bellies = list()
for(var/belly in host.vore_organs)
var/obj/belly/B = belly
- data["our_bellies"].Add(list(list(
+ our_bellies.Add(list(list(
"selected" = (B == host.vore_selected),
"name" = B.name,
"ref" = "\ref[B]",
"digest_mode" = B.digest_mode,
"contents" = LAZYLEN(B.contents),
)))
+<<<<<<< HEAD
data["selected"] = null
+||||||| parent of da4837903c... Merge pull request #10433 from VOREStation/upstream-merge-8085
+
+ data["selected"] = null
+=======
+ data["our_bellies"] = our_bellies
+
+ var/list/selected_list = null
+>>>>>>> da4837903c... Merge pull request #10433 from VOREStation/upstream-merge-8085
if(host.vore_selected)
var/obj/belly/selected = host.vore_selected
- data["selected"] = list(
+ selected_list = list(
"belly_name" = selected.name,
"is_wet" = selected.is_wet,
"wet_loop" = selected.wet_loop,
@@ -172,38 +183,50 @@
"emote_time" = selected.emote_time,
"emote_active" = selected.emote_active,
"belly_fullscreen" = selected.belly_fullscreen,
+<<<<<<< HEAD
"belly_fullscreen_color" = selected.belly_fullscreen_color, //CHOMPEdit
"mapRef" = map_name, //CHOMPEdit
"possible_fullscreens" = icon_states('icons/mob/screen_full_vore_ch.dmi'), //CHOMPedit
"vorespawn_blacklist" = selected.vorespawn_blacklist
) //CHOMP Addition: vorespawn blacklist
+||||||| parent of da4837903c... Merge pull request #10433 from VOREStation/upstream-merge-8085
+ "possible_fullscreens" = icon_states('icons/mob/screen_full_vore.dmi'),
+ )
+=======
+ "possible_fullscreens" = icon_states('icons/mob/screen_full_vore.dmi'),
+ )
+ data["selected"] = selected_list
+>>>>>>> da4837903c... Merge pull request #10433 from VOREStation/upstream-merge-8085
- data["selected"]["addons"] = list()
+
+ var/list/addons = list()
for(var/flag_name in selected.mode_flag_list)
if(selected.mode_flags & selected.mode_flag_list[flag_name])
- data["selected"]["addons"].Add(flag_name)
+ addons.Add(flag_name)
+ selected["addons"] = addons
- data["selected"]["egg_type"] = selected.egg_type
- data["selected"]["contaminates"] = selected.contaminates
- data["selected"]["contaminate_flavor"] = null
- data["selected"]["contaminate_color"] = null
+ selected["egg_type"] = selected.egg_type
+ selected["contaminates"] = selected.contaminates
+ selected["contaminate_flavor"] = null
+ selected["contaminate_color"] = null
if(selected.contaminates)
- data["selected"]["contaminate_flavor"] = selected.contamination_flavor
- data["selected"]["contaminate_color"] = selected.contamination_color
+ selected["contaminate_flavor"] = selected.contamination_flavor
+ selected["contaminate_color"] = selected.contamination_color
- data["selected"]["escapable"] = selected.escapable
- data["selected"]["interacts"] = list()
+ selected["escapable"] = selected.escapable
+ selected["interacts"] = list()
if(selected.escapable)
- data["selected"]["interacts"]["escapechance"] = selected.escapechance
- data["selected"]["interacts"]["escapetime"] = selected.escapetime
- data["selected"]["interacts"]["transferchance"] = selected.transferchance
- data["selected"]["interacts"]["transferlocation"] = selected.transferlocation
- data["selected"]["interacts"]["absorbchance"] = selected.absorbchance
- data["selected"]["interacts"]["digestchance"] = selected.digestchance
+ selected["interacts"]["escapechance"] = selected.escapechance
+ selected["interacts"]["escapetime"] = selected.escapetime
+ selected["interacts"]["transferchance"] = selected.transferchance
+ selected["interacts"]["transferlocation"] = selected.transferlocation
+ selected["interacts"]["absorbchance"] = selected.absorbchance
+ selected["interacts"]["digestchance"] = selected.digestchance
- data["selected"]["disable_hud"] = selected.disable_hud
+ selected["disable_hud"] = selected.disable_hud
- data["selected"]["contents"] = list()
+
+ var/list/selected_contents = list()
for(var/O in selected)
var/list/info = list(
"name" = "[O]",
@@ -219,7 +242,8 @@
info["stat"] = M.stat
if(M.absorbed)
info["absorbed"] = TRUE
- data["selected"]["contents"].Add(list(info))
+ selected_contents.Add(list(info))
+ selected["contents"] = selected_contents
data["selected"]["show_liq"] = selected.show_liquids //CHOMPedit start: liquid belly options
data["selected"]["liq_interacts"] = list()
diff --git a/code/modules/vore/persist/persist_vr.dm b/code/modules/vore/persist/persist_vr.dm
index 3372910973..3bae4a8524 100644
--- a/code/modules/vore/persist/persist_vr.dm
+++ b/code/modules/vore/persist/persist_vr.dm
@@ -48,12 +48,12 @@
// Okay this mob has a real loaded-from-savefile mind in it!
var/datum/preferences/prefs = preferences_datums[persister.mind.loaded_from_ckey]
if(!prefs)
- WARNING("Persist (P4P): [persister.mind] was loaded from ckey [persister.mind.loaded_from_ckey] but no prefs datum found.")
+ warning("Persist (P4P): [persister.mind] was loaded from ckey [persister.mind.loaded_from_ckey] but no prefs datum found.")
return
// Okay, lets do a few checks to see if we should really save tho!
if(!prefs.load_character(persister.mind.loaded_from_slot))
- WARNING("Persist (P4P): [persister.mind] was loaded from slot [persister.mind.loaded_from_slot] but loading prefs failed.")
+ warning("Persist (P4P): [persister.mind] was loaded from slot [persister.mind.loaded_from_slot] but loading prefs failed.")
return // Failed to load character
// For now as a safety measure we will only save if the name matches.
@@ -79,7 +79,7 @@
var/datum/preferences/prefs = prep_for_persist(occupant)
if(!prefs)
- WARNING("Persist (PID): Skipping [occupant] for persisting, as they have no prefs.")
+ warning("Persist (PID): Skipping [occupant] for persisting, as they have no prefs.")
return
//This one doesn't rely on persistence prefs
@@ -232,7 +232,7 @@
prefs = prep_for_persist(H)
if(!prefs)
- WARNING("Persist (NIF): [H] has no prefs datum, skipping")
+ warning("Persist (NIF): [H] has no prefs datum, skipping")
return
var/obj/item/device/nif/nif = H.nif
@@ -254,6 +254,6 @@
var/datum/category_item/player_setup_item/vore/nif/nif_prefs = vore_cat.items_by_name["NIF Data"]
var/savefile/S = new /savefile(prefs.path)
- if(!S) WARNING ("Persist (NIF): Couldn't load NIF save savefile? [prefs.real_name]")
+ if(!S) warning("Persist (NIF): Couldn't load NIF save savefile? [prefs.real_name]")
S.cd = "/character[prefs.default_slot]"
nif_prefs.save_character(S)
diff --git a/code/modules/vore/resizing/sizegun_vr.dm b/code/modules/vore/resizing/sizegun_vr.dm
index 41775af2a5..b25cea2291 100644
--- a/code/modules/vore/resizing/sizegun_vr.dm
+++ b/code/modules/vore/resizing/sizegun_vr.dm
@@ -24,10 +24,7 @@
/obj/item/weapon/gun/energy/sizegun/New()
..()
- if(istype(src, /obj/item/weapon/gun/energy/sizegun/admin))
- verbs += /obj/item/weapon/gun/energy/sizegun/admin/select_size
- else
- verbs += /obj/item/weapon/gun/energy/sizegun/proc/select_size
+ verbs += .proc/select_size
/obj/item/weapon/gun/energy/sizegun/attack_self(mob/user)
. = ..()
diff --git a/code/modules/xenoarcheaology/finds/special.dm b/code/modules/xenoarcheaology/finds/special.dm
index 2a7f149dfa..69aa73a02f 100644
--- a/code/modules/xenoarcheaology/finds/special.dm
+++ b/code/modules/xenoarcheaology/finds/special.dm
@@ -118,7 +118,7 @@
/obj/item/weapon/vampiric/hear_talk(mob/M, list/message_pieces, verb)
..()
- if(world.time - last_bloodcall >= bloodcall_interval && M in view(7, src))
+ if(world.time - last_bloodcall >= bloodcall_interval && (M in view(7, src)))
bloodcall(M)
/obj/item/weapon/vampiric/proc/bloodcall(var/mob/living/carbon/human/M)
diff --git a/code/modules/xgm/xgm_gas_mixture.dm b/code/modules/xgm/xgm_gas_mixture.dm
index 21d1422694..083664f3e7 100644
--- a/code/modules/xgm/xgm_gas_mixture.dm
+++ b/code/modules/xgm/xgm_gas_mixture.dm
@@ -446,7 +446,7 @@
//Equalizes a list of gas mixtures. Used for pipe networks.
-/proc/equalize_gases(datum/gas_mixture/list/gases)
+/proc/equalize_gases(list/datum/gas_mixture/gases)
//Calculate totals from individual components
var/total_volume = 0
var/total_thermal_energy = 0
diff --git a/maps/southern_cross/overmap/sectors.dm b/maps/southern_cross/overmap/sectors.dm
index 7ee2ed70d9..fdf860f082 100644
--- a/maps/southern_cross/overmap/sectors.dm
+++ b/maps/southern_cross/overmap/sectors.dm
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
// Overmap object for Sif, hanging in the void of space
/obj/effect/overmap/visitable/planet/Sif
name = "Sif"
@@ -73,3 +74,93 @@
Z_LEVEL_STATION_TWO,
Z_LEVEL_STATION_THREE,
Z_LEVEL_MISC)
+||||||| parent of da4837903c... Merge pull request #10433 from VOREStation/upstream-merge-8085
+// Overmap object for Sif, hanging in the void of space
+/obj/effect/overmap/visitable/planet/Sif
+ name = "Sif"
+ map_z = list(Z_LEVEL_SURFACE, Z_LEVEL_SURFACE_MINE, Z_LEVEL_SURFACE_WILD)
+ in_space = 0
+ start_x = 10
+ start_y = 10
+ skybox_offset_x = 128
+ skybox_offset_y = 128
+ surface_color = "#2D545B"
+ mountain_color = "#735555"
+ ice_color = "FFFFFF"
+ icecaps = "icecaps"
+
+/obj/effect/overmap/visitable/planet/Sif/Initialize()
+ atmosphere = new(CELL_VOLUME)
+ atmosphere.adjust_gas_temp("oxygen", MOLES_O2STANDARD, 273)
+ atmosphere.adjust_gas_temp("nitrogen", MOLES_N2STANDARD, 273)
+
+ . = ..()
+
+/obj/effect/overmap/visitable/planet/Sif/Initialize()
+ . = ..()
+ docking_codes = null
+
+/obj/effect/overmap/visitable/planet/Sif/get_skybox_representation()
+ . = ..()
+ (.).pixel_x = skybox_offset_x
+ (.).pixel_y = skybox_offset_y
+
+/obj/effect/overmap/visitable/Southern_Cross
+ name = "Southern Cross"
+ icon_state = "object"
+ base = 1
+ in_space = 1
+ start_x = 10
+ start_y = 10
+ map_z = list(Z_LEVEL_STATION_ONE, Z_LEVEL_STATION_TWO, Z_LEVEL_STATION_THREE)
+ extra_z_levels = list(Z_LEVEL_TRANSIT) // Hopefully temporary, so arrivals announcements work.
+
+/obj/effect/overmap/visitable/planet/Sif/Initialize()
+ . = ..()
+ docking_codes = null
+=======
+// Overmap object for Sif, hanging in the void of space
+/obj/effect/overmap/visitable/planet/Sif
+ name = "Sif"
+ map_z = list(Z_LEVEL_SURFACE, Z_LEVEL_SURFACE_MINE, Z_LEVEL_SURFACE_WILD)
+ in_space = 0
+ start_x = 10
+ start_y = 10
+ skybox_offset_x = 128
+ skybox_offset_y = 128
+ surface_color = "#2D545B"
+ mountain_color = "#735555"
+ ice_color = "FFFFFF"
+ icecaps = "icecaps"
+
+/obj/effect/overmap/visitable/planet/Sif/Initialize()
+ atmosphere = new(CELL_VOLUME)
+ atmosphere.adjust_gas_temp("oxygen", MOLES_O2STANDARD, 273)
+ atmosphere.adjust_gas_temp("nitrogen", MOLES_N2STANDARD, 273)
+
+ . = ..()
+
+/obj/effect/overmap/visitable/planet/Sif/Initialize()
+ . = ..()
+ docking_codes = null
+
+/obj/effect/overmap/visitable/planet/Sif/get_skybox_representation()
+ var/image/tmp = ..()
+ tmp.pixel_x = skybox_offset_x
+ tmp.pixel_y = skybox_offset_y
+ return tmp
+
+/obj/effect/overmap/visitable/Southern_Cross
+ name = "Southern Cross"
+ icon_state = "object"
+ base = 1
+ in_space = 1
+ start_x = 10
+ start_y = 10
+ map_z = list(Z_LEVEL_STATION_ONE, Z_LEVEL_STATION_TWO, Z_LEVEL_STATION_THREE)
+ extra_z_levels = list(Z_LEVEL_TRANSIT) // Hopefully temporary, so arrivals announcements work.
+
+/obj/effect/overmap/visitable/planet/Sif/Initialize()
+ . = ..()
+ docking_codes = null
+>>>>>>> da4837903c... Merge pull request #10433 from VOREStation/upstream-merge-8085
diff --git a/vorestation.dme b/vorestation.dme
index 6332f290b7..49d68ff8f1 100644
--- a/vorestation.dme
+++ b/vorestation.dme
@@ -85,6 +85,7 @@
#include "code\__defines\shields.dm"
#include "code\__defines\shuttle.dm"
#include "code\__defines\sound.dm"
+#include "code\__defines\spaceman_dmm.dm"
#include "code\__defines\species_languages.dm"
#include "code\__defines\species_languages_vr.dm"
#include "code\__defines\species_languages_YW.dm"