From 95c8e00af794a372f7d6591cfe23e36d0f59c56a Mon Sep 17 00:00:00 2001 From: Ghilker <42839747+Ghilker@users.noreply.github.com> Date: Tue, 12 Oct 2021 15:48:51 +0200 Subject: [PATCH] cleanup _HELPERS/_lists.dm and all the necessary files (#61827) Bring _HELPERS/_lists.dm to latest standards by: -Adding proper documentation and fixing existing one -Giving vars proper names -Procs now use snake case as per standard (many files that use those procs will be affected) --- code/__DEFINES/misc.dm | 2 +- code/__HELPERS/_lists.dm | 417 ++++++++++-------- code/__HELPERS/_string_lists.dm | 2 +- code/__HELPERS/atoms.dm | 2 +- code/__HELPERS/files.dm | 2 +- code/__HELPERS/game.dm | 6 +- code/__HELPERS/global_lists.dm | 6 +- code/__HELPERS/mobs.dm | 8 +- code/__HELPERS/piping_colors_lists.dm | 4 +- code/__HELPERS/roundend.dm | 2 +- code/__HELPERS/sorts/__main.dm | 34 +- code/__HELPERS/text.dm | 2 +- code/__HELPERS/type_processing.dm | 2 +- code/_globalvars/lists/flavor_misc.dm | 4 +- code/_globalvars/traumas.dm | 2 +- code/controllers/master.dm | 2 +- code/controllers/subsystem/blackbox.dm | 2 +- code/controllers/subsystem/dcs.dm | 2 +- code/controllers/subsystem/mapping.dm | 4 +- code/controllers/subsystem/materials.dm | 2 +- .../subsystem/processing/quirks.dm | 2 +- .../subsystem/processing/station.dm | 2 +- code/controllers/subsystem/server_maint.dm | 4 +- code/controllers/subsystem/shuttle.dm | 2 +- code/controllers/subsystem/ticker.dm | 4 +- code/controllers/subsystem/timer.dm | 2 +- code/controllers/subsystem/weather.dm | 2 +- code/datums/ai/monkey/monkey_behaviors.dm | 2 +- code/datums/ai_laws.dm | 4 +- code/datums/changelog/changelog.dm | 2 +- code/datums/components/fantasy/_fantasy.dm | 2 +- code/datums/components/fantasy/suffixes.dm | 2 +- .../components/food/ice_cream_holder.dm | 6 +- code/datums/components/soundplayer.dm | 2 +- code/datums/components/squeak.dm | 4 +- code/datums/components/subtype_picker.dm | 2 +- code/datums/diseases/advance/advance.dm | 6 +- code/datums/elements/surgery_initiator.dm | 2 +- code/datums/looping_sounds/_looping_sound.dm | 2 +- code/datums/mapgen/CaveGenerator.dm | 12 +- code/datums/mind.dm | 4 +- code/datums/mutations/actions.dm | 2 +- code/datums/mutations/antenna.dm | 2 +- code/datums/outfit.dm | 2 +- code/datums/station_traits/negative_traits.dm | 2 +- code/game/atoms.dm | 2 +- code/game/gamemodes/dynamic/dynamic.dm | 6 +- .../gamemodes/dynamic/dynamic_rulesets.dm | 2 +- .../game/gamemodes/dynamic/ruleset_picking.dm | 2 +- code/game/gamemodes/objective.dm | 8 +- code/game/machinery/_machinery.dm | 2 +- code/game/machinery/autolathe.dm | 2 +- code/game/machinery/camera/camera.dm | 2 +- code/game/machinery/camera/camera_assembly.dm | 2 +- code/game/machinery/camera/tracking.dm | 2 +- code/game/machinery/computer/arcade/arcade.dm | 8 +- code/game/machinery/computer/arcade/orion.dm | 2 +- code/game/machinery/computer/arena.dm | 2 +- code/game/machinery/computer/atmos_control.dm | 2 +- code/game/machinery/computer/medical.dm | 2 +- code/game/machinery/computer/security.dm | 2 +- code/game/machinery/computer/teleporter.dm | 4 +- code/game/machinery/doors/airlock.dm | 2 +- code/game/machinery/hologram.dm | 2 +- code/game/machinery/newscaster.dm | 2 +- code/game/objects/buckling.dm | 4 +- .../objects/effects/spawners/random/random.dm | 8 +- code/game/objects/effects/spiders.dm | 2 +- code/game/objects/items/cardboard_cutouts.dm | 2 +- code/game/objects/items/cards_ids.dm | 2 +- code/game/objects/items/chromosome.dm | 2 +- .../circuitboards/machine_circuitboards.dm | 2 +- code/game/objects/items/devices/PDA/PDA.dm | 4 +- code/game/objects/items/devices/PDA/cart.dm | 6 +- code/game/objects/items/devices/camera_bug.dm | 2 +- code/game/objects/items/devices/scanners.dm | 2 +- .../game/objects/items/grenades/ghettobomb.dm | 2 +- code/game/objects/items/mail.dm | 2 +- code/game/objects/items/pinpointer.dm | 2 +- code/game/objects/items/storage/boxes.dm | 2 +- .../game/objects/items/storage/uplink_kits.dm | 4 +- code/game/objects/items/tcg/tcg.dm | 6 +- code/game/objects/items/toys.dm | 2 +- code/game/objects/items/wayfinding.dm | 2 +- code/game/objects/objs.dm | 2 +- code/game/objects/structures/barsigns.dm | 2 +- code/game/objects/structures/bedsheet_bin.dm | 2 +- .../structures/crates_lockers/closets.dm | 2 +- .../crates_lockers/closets/utility_closets.dm | 2 +- code/game/objects/structures/janicart.dm | 2 +- code/game/objects/structures/maintenance.dm | 2 +- code/game/objects/structures/mirror.dm | 2 +- code/game/objects/structures/signs/_signs.dm | 2 +- code/game/turfs/closed/minerals.dm | 2 +- code/modules/NTNet/netdata.dm | 4 +- code/modules/admin/admin_investigate.dm | 2 +- code/modules/admin/admin_verbs.dm | 8 +- code/modules/admin/create_object.dm | 2 +- .../admin/smites/imaginary_friend_special.dm | 2 +- code/modules/admin/stickyban.dm | 2 +- code/modules/admin/team_panel.dm | 4 +- code/modules/admin/topic.dm | 4 +- .../SDQL2/SDQL_spells/spell_edit_menu.dm | 4 +- code/modules/admin/verbs/admin.dm | 6 +- code/modules/admin/verbs/adminevents.dm | 2 +- code/modules/admin/verbs/adminjump.dm | 4 +- code/modules/admin/verbs/adminpm.dm | 2 +- code/modules/admin/verbs/borgpanel.dm | 2 +- code/modules/admin/verbs/cinematic.dm | 2 +- code/modules/admin/verbs/debug.dm | 18 +- code/modules/admin/verbs/ert.dm | 2 +- code/modules/admin/verbs/hiddenprints.dm | 4 +- .../admin/verbs/map_template_loadverb.dm | 2 +- code/modules/admin/verbs/maprotation.dm | 2 +- code/modules/admin/verbs/playsound.dm | 2 +- code/modules/admin/verbs/secrets.dm | 2 +- .../view_variables/mass_edit_variables.dm | 2 +- .../admin/view_variables/modify_variables.dm | 6 +- .../admin/view_variables/topic_basic.dm | 8 +- .../admin/view_variables/topic_list.dm | 4 +- .../admin/view_variables/view_variables.dm | 2 +- code/modules/antagonists/brother/brother.dm | 2 +- .../antagonists/changeling/powers/absorb.dm | 2 +- .../changeling/powers/humanform.dm | 2 +- .../changeling/powers/pheromone_receptors.dm | 2 +- code/modules/antagonists/cult/cult.dm | 2 +- .../eldritch_cult/eldritch_effects.dm | 2 +- .../eldritch_cult/eldritch_knowledge.dm | 4 +- .../antagonists/wizard/equipment/artefact.dm | 2 +- code/modules/aquarium/fish.dm | 2 +- code/modules/asset_cache/asset_list.dm | 2 +- .../atmospherics/machinery/datum_pipeline.dm | 2 +- .../machinery/portable/canister.dm | 2 +- .../awaymissions/mission_code/wildwest.dm | 2 +- code/modules/capture_the_flag/ctf_classes.dm | 2 +- code/modules/capture_the_flag/ctf_game.dm | 2 +- code/modules/cargo/centcom_podlauncher.dm | 2 +- code/modules/cargo/coupon.dm | 2 +- code/modules/cargo/exports.dm | 2 +- code/modules/cargo/packs.dm | 4 +- code/modules/client/preferences.dm | 2 +- .../preferences/middleware/keybindings.dm | 2 +- code/modules/client/preferences/species.dm | 6 +- code/modules/client/preferences_savefile.dm | 2 +- code/modules/client/verbs/ooc.dm | 2 +- code/modules/client/verbs/who.dm | 2 +- code/modules/clothing/chameleon.dm | 2 +- code/modules/events/brain_trauma.dm | 2 +- code/modules/events/brand_intelligence.dm | 2 +- code/modules/events/false_alarm.dm | 2 +- code/modules/events/heart_attack.dm | 2 +- code/modules/events/meteor_wave.dm | 2 +- code/modules/events/wizard/madness.dm | 2 +- .../explorer_drone/exploration_site.dm | 2 +- code/modules/explorer_drone/loot.dm | 4 +- code/modules/flufftext/Hallucination.dm | 2 +- .../food_and_drinks/drinks/drinks/bottle.dm | 2 +- .../kitchen_machinery/smartfridge.dm | 2 +- code/modules/food_and_drinks/pizzabox.dm | 4 +- .../food_and_drinks/restaurant/_venue.dm | 2 +- .../restaurant/customers/_customer.dm | 4 +- .../restaurant/generic_venues.dm | 2 +- code/modules/hydroponics/hydroponics.dm | 4 +- .../jobs/job_types/security_officer.dm | 2 +- code/modules/library/lib_items.dm | 2 +- code/modules/mapping/preloader.dm | 2 +- code/modules/mapping/ruins.dm | 2 +- code/modules/meteors/meteors.dm | 2 +- .../mining/equipment/marker_beacons.dm | 2 +- code/modules/mining/fulton.dm | 2 +- code/modules/mining/laborcamp/laborstacker.dm | 2 +- code/modules/mining/machine_vending.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 6 +- code/modules/mob/emote.dm | 2 +- code/modules/mob/inventory.dm | 2 +- .../carbon/alien/humanoid/alien_powers.dm | 4 +- code/modules/mob/living/carbon/carbon.dm | 8 +- code/modules/mob/living/carbon/human/human.dm | 4 +- code/modules/mob/living/carbon/human/login.dm | 2 +- .../carbon/human/species_types/jellypeople.dm | 2 +- code/modules/mob/living/silicon/ai/ai.dm | 10 +- .../mob/living/silicon/pai/pai_shell.dm | 2 +- .../mob/living/silicon/pai/software.dm | 8 +- .../living/simple_animal/guardian/guardian.dm | 4 +- .../simple_animal/guardian/types/ranged.dm | 2 +- .../hostile/mining_mobs/hivelord.dm | 22 +- .../mob/living/simple_animal/simple_animal.dm | 2 +- .../mob/living/simple_animal/slime/powers.dm | 2 +- code/modules/mob/mob_helpers.dm | 2 +- code/modules/mob/transform_procs.dm | 4 +- .../computers/item/computer.dm | 2 +- code/modules/ninja/suit/ninjaDrainAct.dm | 2 +- .../suit/ninja_equipment_actions/ninja_net.dm | 2 +- code/modules/projectiles/gun.dm | 2 +- .../chemistry/machinery/chem_dispenser.dm | 6 +- .../reagents/reagent_containers/borghydro.dm | 2 +- code/modules/research/experimentor.dm | 4 +- .../xenobiology/crossbreeding/charged.dm | 2 +- .../crossbreeding/selfsustaining.dm | 2 +- .../xenobiology/crossbreeding/stabilized.dm | 2 +- .../xenobiology/vatgrowing/samples/_sample.dm | 4 +- code/modules/shuttle/navigation_computer.dm | 2 +- code/modules/spells/spell.dm | 2 +- code/modules/spells/spell_types/shapeshift.dm | 2 +- code/modules/surgery/bodyparts/_bodyparts.dm | 2 +- code/modules/surgery/organ_manipulation.dm | 2 +- code/modules/vehicles/mecha/_mecha.dm | 2 +- 207 files changed, 551 insertions(+), 522 deletions(-) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index c634b7053e7..e2298d3d3b5 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -229,7 +229,7 @@ GLOBAL_LIST_EMPTY(bloody_footprints_cache) #define ORBITRON "Orbitron" #define SHARE "Share Tech Mono" -GLOBAL_LIST_INIT(pda_styles, sortList(list(MONO, VT, ORBITRON, SHARE))) +GLOBAL_LIST_INIT(pda_styles, sort_list(list(MONO, VT, ORBITRON, SHARE))) ///////////////////////////////////// // atom.appearence_flags shortcuts // diff --git a/code/__HELPERS/_lists.dm b/code/__HELPERS/_lists.dm index faebf2299c0..5bbc3572879 100644 --- a/code/__HELPERS/_lists.dm +++ b/code/__HELPERS/_lists.dm @@ -9,31 +9,46 @@ * Misc */ +///Initialize the lazylist #define LAZYINITLIST(L) if (!L) { L = list(); } +///If the provided list is empty, set it to null #define UNSETEMPTY(L) if (L && !length(L)) L = null ///Like LAZYCOPY - copies an input list if the list has entries, If it doesn't the assigned list is nulled #define LAZYLISTDUPLICATE(L) (L ? L.Copy() : null ) +///Remove an item from the list, set the list to null if empty #define LAZYREMOVE(L, I) if(L) { L -= I; if(!length(L)) { L = null; } } +///Add an item to the list, if the list is null it will initialize it #define LAZYADD(L, I) if(!L) { L = list(); } L += I; +///Add an item to the list if not already present, if the list is null it will initialize it #define LAZYOR(L, I) if(!L) { L = list(); } L |= I; +///Returns the key of the submitted item in the list #define LAZYFIND(L, V) (L ? L.Find(V) : 0) ///returns L[I] if L exists and I is a valid index of L, runtimes if L is not a list #define LAZYACCESS(L, I) (L ? (isnum(I) ? (I > 0 && I <= length(L) ? L[I] : null) : L[I]) : null) +///Sets the item K to the value V, if the list is null it will initialize it #define LAZYSET(L, K, V) if(!L) { L = list(); } L[K] = V; +///Returns the lenght of the list #define LAZYLEN(L) length(L) ///Sets a list to null #define LAZYNULL(L) L = null +///Adds to the item K the value V, if the list is null it will initialize it #define LAZYADDASSOC(L, K, V) if(!L) { L = list(); } L[K] += V; ///This is used to add onto lazy assoc list when the value you're adding is a /list/. This one has extra safety over lazyaddassoc because the value could be null (and thus cant be used to += objects) #define LAZYADDASSOCLIST(L, K, V) if(!L) { L = list(); } L[K] += list(V); +///Removes the value V from the item K, if the item K is empty will remove it from the list, if the list is empty will set the list to null #define LAZYREMOVEASSOC(L, K, V) if(L) { if(L[K]) { L[K] -= V; if(!length(L[K])) L -= K; } if(!length(L)) L = null; } +///Accesses an associative list, returns null if nothing is found #define LAZYACCESSASSOC(L, I, K) L ? L[I] ? L[I][K] ? L[I][K] : null : null : null +///Qdel every item in the list before setting the list to null #define QDEL_LAZYLIST(L) for(var/I in L) qdel(I); L = null; //These methods don't null the list -#define LAZYCOPY(L) (L ? L.Copy() : list() ) //Use LAZYLISTDUPLICATE instead if you want it to null with no entries -#define LAZYCLEARLIST(L) if(L) L.Cut() // Consider LAZYNULL instead +///Use LAZYLISTDUPLICATE instead if you want it to null with no entries +#define LAZYCOPY(L) (L ? L.Copy() : list() ) +/// Consider LAZYNULL instead +#define LAZYCLEARLIST(L) if(L) L.Cut() +///Returns the list if it's actually a valid list, otherwise will initialize it #define SANITIZE_LIST(L) ( islist(L) ? L : list() ) -#define reverseList(L) reverseRange(L.Copy()) +#define reverseList(L) reverse_range(L.Copy()) /// Performs an insertion on the given lazy list with the given key and value. If the value already exists, a new one will not be made. #define LAZYORASSOCLIST(lazy_list, key, value) \ @@ -116,7 +131,7 @@ };\ } while(FALSE) -//Returns a list in plain english as a string +///Returns a list in plain english as a string /proc/english_list(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "" ) var/total = length(input) switch(total) @@ -138,27 +153,28 @@ return "[output][and_text][input[index]]" -//Checks for specific types in a list -/proc/is_type_in_list(atom/A, list/L) - if(!LAZYLEN(L) || !A) +///Checks for specific types in a list +/proc/is_type_in_list(atom/type_to_check, list/list_to_check) + if(!LAZYLEN(list_to_check) || !type_to_check) return FALSE - for(var/type in L) - if(istype(A, type)) + for(var/type in list_to_check) + if(istype(type_to_check, type)) return TRUE return FALSE -//Checks for specific types in specifically structured (Assoc "type" = TRUE) lists ('typecaches') +///Checks for specific types in specifically structured (Assoc "type" = TRUE) lists ('typecaches') #define is_type_in_typecache(A, L) (A && length(L) && L[(ispath(A) ? A : A:type)]) -//returns a new list with only atoms that are in typecache L +///returns a new list with only atoms that are in the typecache list /proc/typecache_filter_list(list/atoms, list/typecache) RETURN_TYPE(/list) . = list() for(var/thing in atoms) - var/atom/A = thing - if (typecache[A.type]) - . += A + var/atom/atom_checked = thing + if (typecache[atom_checked.type]) + . += atom_checked +///return a new list with atoms that are not in the typecache list /proc/typecache_filter_list_reverse(list/atoms, list/typecache) RETURN_TYPE(/list) . = list() @@ -166,6 +182,7 @@ if(!typecache[atom.type]) . += atom +///similar to typecache_filter_list and typecache_filter_list_reverse but it supports an inclusion list and and exclusion list /proc/typecache_filter_multi_list_exclusion(list/atoms, list/typecache_include, list/typecache_exclude) . = list() for(var/atom/atom as anything in atoms) @@ -202,13 +219,15 @@ output[subpath] = TRUE return output -//Removes any null entries from the list -//Returns TRUE if the list had nulls, FALSE otherwise -/proc/listclearnulls(list/L) - var/start_len = L.len - var/list/N = new(start_len) - L -= N - return L.len < start_len +/** + * Removes any null entries from the list + * Returns TRUE if the list had nulls, FALSE otherwise +**/ +/proc/list_clear_nulls(list/list_to_clear) + var/start_len = list_to_clear.len + var/list/new_list = new(start_len) + list_to_clear -= new_list + return list_to_clear.len < start_len /* * Returns list containing all the entries from first list that are not present in second. @@ -232,7 +251,7 @@ * If skipref = 1, repeated elements are treated as one. * If either of arguments is not a list, returns null */ -/proc/uniquemergelist(list/first, list/second, skiprep=0) +/proc/unique_merge_list(list/first, list/second, skiprep=0) if(!islist(first) || !islist(second)) return var/list/result = new @@ -242,53 +261,55 @@ result = first ^ second return result -//Picks a random element from a list based on a weighting system: -//1. Adds up the total of weights for each element -//2. Gets a number between 1 and that total -//3. For each element in the list, subtracts its weighting from that number -//4. If that makes the number 0 or less, return that element. -//Will output null sometimes if you use decimals (e.g. 0.1 instead of 10) as rand() uses integers, not floats -/proc/pickweight(list/L) +/** + * Picks a random element from a list based on a weighting system: + * 1. Adds up the total of weights for each element + * 2. Gets a number between 1 and that total + * 3. For each element in the list, subtracts its weighting from that number + * 4. If that makes the number 0 or less, return that element. + * Will output null sometimes if you use decimals (e.g. 0.1 instead of 10) as rand() uses integers, not floats +**/ +/proc/pick_weight(list/list_to_pick) var/total = 0 var/item - for (item in L) - if (!L[item]) - L[item] = 1 - total += L[item] + for(item in list_to_pick) + if(!list_to_pick[item]) + list_to_pick[item] = 1 + total += list_to_pick[item] total = rand(1, total) - for (item in L) - total -=L [item] - if (total <= 0) + for(item in list_to_pick) + total -= list_to_pick[item] + if(total <= 0) return item return null - -/proc/pickweightAllowZero(list/L) //The original pickweight proc will sometimes pick entries with zero weight. I'm not sure if changing the original will break anything, so I left it be. +///The original pickweight proc will sometimes pick entries with zero weight. I'm not sure if changing the original will break anything, so I left it be. +/proc/pick_weight_allow_zero(list/list_to_pick) var/total = 0 var/item - for (item in L) - if (!L[item]) - L[item] = 0 - total += L[item] + for(item in list_to_pick) + if(!list_to_pick[item]) + list_to_pick[item] = 0 + total += list_to_pick[item] total = rand(0, total) - for (item in L) - total -=L [item] - if (total <= 0 && L[item]) + for(item in list_to_pick) + total -= list_to_pick[item] + if(total <= 0 && list_to_pick[item]) return item return null /// Pick a random element from the list and remove it from the list. -/proc/pick_n_take(list/L) - RETURN_TYPE(L[_].type) - if(L.len) - var/picked = rand(1,L.len) - . = L[picked] - L.Cut(picked,picked+1) //Cut is far more efficient that Remove() +/proc/pick_n_take(list/list_to_pick) + RETURN_TYPE(list_to_pick[_].type) + if(list_to_pick.len) + var/picked = rand(1,list_to_pick.len) + . = list_to_pick[picked] + list_to_pick.Cut(picked,picked+1) //Cut is far more efficient that Remove() -//Returns the top(last) element from the list and removes it from the list (typical stack function) +///Returns the top(last) element from the list and removes it from the list (typical stack function) /proc/pop(list/L) if(L.len) . = L[L.len] @@ -305,233 +326,239 @@ pos-- L.Insert(pos+1, thing) -// Returns the next item in a list -/proc/next_list_item(item, list/L) +/// Returns the next item in a list +/proc/next_list_item(item, list/inserted_list) var/i - i = L.Find(item) - if(i == L.len) + i = inserted_list.Find(item) + if(i == inserted_list.len) i = 1 else i++ - return L[i] + return inserted_list[i] -// Returns the previous item in a list -/proc/previous_list_item(item, list/L) +/// Returns the previous item in a list +/proc/previous_list_item(item, list/inserted_list) var/i - i = L.Find(item) + i = inserted_list.Find(item) if(i == 1) - i = L.len + i = inserted_list.len else i-- - return L[i] + return inserted_list[i] -//Randomize: Return the list in a random order -/proc/shuffle(list/L) - if(!L) +///Randomize: Return the list in a random order +/proc/shuffle(list/inserted_list) + if(!inserted_list) return - L = L.Copy() + inserted_list = inserted_list.Copy() - for(var/i=1, i= 0 ? /proc/cmp_ckey_asc : /proc/cmp_ckey_dsc) +///for sorting clients or mobs by ckey +/proc/sort_key(list/ckey_list, order=1) + return sortTim(ckey_list, order >= 0 ? /proc/cmp_ckey_asc : /proc/cmp_ckey_dsc) -//Specifically for record datums in a list. -/proc/sortRecord(list/L, field = "name", order = 1) +///Specifically for record datums in a list. +/proc/sort_record(list/record_list, field = "name", order = 1) GLOB.cmp_field = field - return sortTim(L, order >= 0 ? /proc/cmp_records_asc : /proc/cmp_records_dsc) + return sortTim(record_list, order >= 0 ? /proc/cmp_records_asc : /proc/cmp_records_dsc) -//any value in a list -/proc/sortList(list/L, cmp=/proc/cmp_text_asc) - return sortTim(L.Copy(), cmp) +///sort any value in a list +/proc/sort_list(list/list_to_sort, cmp=/proc/cmp_text_asc) + return sortTim(list_to_sort.Copy(), cmp) -//uses sortList() but uses the var's name specifically. This should probably be using mergeAtom() instead -/proc/sortNames(list/L, order=1) - return sortTim(L.Copy(), order >= 0 ? /proc/cmp_name_asc : /proc/cmp_name_dsc) +///uses sort_list() but uses the var's name specifically. This should probably be using mergeAtom() instead +/proc/sort_names(list/list_to_sort, order=1) + return sortTim(list_to_sort.Copy(), order >= 0 ? /proc/cmp_name_asc : /proc/cmp_name_dsc) -//Converts a bitfield to a list of numbers (or words if a wordlist is provided) -/proc/bitfield2list(bitfield = 0, list/wordlist) - var/list/r = list() +///Converts a bitfield to a list of numbers (or words if a wordlist is provided) +/proc/bitfield_to_list(bitfield = 0, list/wordlist) + var/list/return_list = list() if(islist(wordlist)) - var/max = min(wordlist.len,24) + var/max = min(wordlist.len, 24) var/bit = 1 - for(var/i=1, i<=max, i++) + for(var/i = 1, i <= max, i++) if(bitfield & bit) - r += wordlist[i] + return_list += wordlist[i] bit = bit << 1 else - for(var/bit=1, bit<=(1<<24), bit = bit << 1) + for(var/bit = 1, bit <= (1<<24), bit = bit << 1) if(bitfield & bit) - r += bit + return_list += bit - return r + return return_list -// Returns the key based on the index +/// Returns the key based on the index #define KEYBYINDEX(L, index) (((index <= length(L)) && (index > 0)) ? L[index] : null) -/proc/count_by_type(list/L, type) +///return the amount of items of the same type inside a list +/proc/count_by_type(list/inserted_list, type) var/i = 0 - for(var/T in L) - if(istype(T, type)) + for(var/item_type in inserted_list) + if(istype(item_type, type)) i++ return i /// Returns datum/data/record -/proc/find_record(field, value, list/L) - for(var/datum/data/record/R in L) - if(R.fields[field] == value) - return R +/proc/find_record(field, value, list/inserted_list) + for(var/datum/data/record/record_to_check in inserted_list) + if(record_to_check.fields[field] == value) + return record_to_check return null -//Move a single element from position fromIndex within a list, to position toIndex -//All elements in the range [1,toIndex) before the move will be before the pivot afterwards -//All elements in the range [toIndex, L.len+1) before the move will be after the pivot afterwards -//In other words, it's as if the range [fromIndex,toIndex) have been rotated using a <<< operation common to other languages. -//fromIndex and toIndex must be in the range [1,L.len+1] -//This will preserve associations ~Carnie -/proc/moveElement(list/L, fromIndex, toIndex) - if(fromIndex == toIndex || fromIndex+1 == toIndex) //no need to move +/** + * Move a single element from position from_index within a list, to position to_index + * All elements in the range [1,to_index) before the move will be before the pivot afterwards + * All elements in the range [to_index, L.len+1) before the move will be after the pivot afterwards + * In other words, it's as if the range [from_index,to_index) have been rotated using a <<< operation common to other languages. + * from_index and to_index must be in the range [1,L.len+1] + * This will preserve associations ~Carnie +**/ +/proc/move_element(list/inserted_list, from_index, to_index) + if(from_index == to_index || from_index + 1 == to_index) //no need to move return - if(fromIndex > toIndex) - ++fromIndex //since a null will be inserted before fromIndex, the index needs to be nudged right by one + if(from_index > to_index) + ++from_index //since a null will be inserted before from_index, the index needs to be nudged right by one - L.Insert(toIndex, null) - L.Swap(fromIndex, toIndex) - L.Cut(fromIndex, fromIndex+1) + inserted_list.Insert(to_index, null) + inserted_list.Swap(from_index, to_index) + inserted_list.Cut(from_index, from_index + 1) -//Move elements [fromIndex,fromIndex+len) to [toIndex-len, toIndex) -//Same as moveElement but for ranges of elements -//This will preserve associations ~Carnie -/proc/moveRange(list/L, fromIndex, toIndex, len=1) - var/distance = abs(toIndex - fromIndex) +/** + * Move elements [from_index,from_index+len) to [to_index-len, to_index) + * Same as moveElement but for ranges of elements + * This will preserve associations ~Carnie +**/ +/proc/move_range(list/inserted_list, from_index, to_index, len = 1) + var/distance = abs(to_index - from_index) if(len >= distance) //there are more elements to be moved than the distance to be moved. Therefore the same result can be achieved (with fewer operations) by moving elements between where we are and where we are going. The result being, our range we are moving is shifted left or right by dist elements - if(fromIndex <= toIndex) + if(from_index <= to_index) return //no need to move - fromIndex += len //we want to shift left instead of right + from_index += len //we want to shift left instead of right - for(var/i=0, i toIndex) - fromIndex += len + if(from_index > to_index) + from_index += len - for(var/i=0, i distance) //there is an overlap, therefore swapping each element will require more swaps than inserting new elements - if(fromIndex < toIndex) - toIndex += len + if(from_index < to_index) + to_index += len else - fromIndex += len + from_index += len - for(var/i=0, i fromIndex) - var/a = toIndex - toIndex = fromIndex - fromIndex = a + if(to_index > from_index) + var/a = to_index + to_index = from_index + from_index = a - for(var/i=0, i numeric value entries @@ -596,6 +624,7 @@ keys += key return keys +///compare two lists, returns TRUE if they are the same /proc/compare_list(list/l,list/d) if(!islist(l) || !islist(d)) return FALSE diff --git a/code/__HELPERS/_string_lists.dm b/code/__HELPERS/_string_lists.dm index cdbee26f9ba..5dab48761ec 100644 --- a/code/__HELPERS/_string_lists.dm +++ b/code/__HELPERS/_string_lists.dm @@ -1,5 +1,5 @@ #define pick_list(FILE, KEY) (pick(strings(FILE, KEY))) -#define pick_list_weighted(FILE, KEY) (pickweight(strings(FILE, KEY))) +#define pick_list_weighted(FILE, KEY) (pick_weight(strings(FILE, KEY))) #define pick_list_replacements(FILE, KEY) (strings_replacement(FILE, KEY)) #define json_load(FILE) (json_decode(file2text(FILE))) diff --git a/code/__HELPERS/atoms.dm b/code/__HELPERS/atoms.dm index 3e81cd53190..43c57618853 100644 --- a/code/__HELPERS/atoms.dm +++ b/code/__HELPERS/atoms.dm @@ -268,7 +268,7 @@ rough example of the "cone" made by the 3 dirs checked else if(random) chosen = pick(matches) || null else - chosen = input("Select a type", "Pick Type", matches[1]) as null|anything in sortList(matches) + chosen = input("Select a type", "Pick Type", matches[1]) as null|anything in sort_list(matches) if(!chosen) return chosen = matches[chosen] diff --git a/code/__HELPERS/files.dm b/code/__HELPERS/files.dm index 144f127e3ba..3d39a8b52a6 100644 --- a/code/__HELPERS/files.dm +++ b/code/__HELPERS/files.dm @@ -21,7 +21,7 @@ GLOBAL_VAR_INIT(fileaccess_timer, 0) if(path != root) choices.Insert(1,"/") - var/choice = input(src,"Choose a file to access:","Download",null) as null|anything in sortList(choices) + var/choice = input(src,"Choose a file to access:","Download",null) as null|anything in sort_list(choices) switch(choice) if(null) return diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index fcb40a99341..22c89d4f7e8 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -37,7 +37,7 @@ get_area(get_ranged_target_turf(center, EAST, 1)), get_area(get_ranged_target_turf(center, WEST, 1)) ) - listclearnulls(.) + list_clear_nulls(.) ///Returns the open turf next to the center in a specific direction /proc/get_open_turf_in_dir(atom/center, dir) @@ -53,7 +53,7 @@ get_open_turf_in_dir(center, EAST), get_open_turf_in_dir(center, WEST) ) - listclearnulls(.) + list_clear_nulls(.) ///Returns a list with all the adjacent areas by getting the adjacent open turfs /proc/get_adjacent_open_areas(atom/center) @@ -449,7 +449,7 @@ if(!asking_mob.key || !asking_mob.client) result -= asking_mob - listclearnulls(result) + list_clear_nulls(result) return result diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index 3d3db534947..bc0f8e1df15 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -38,12 +38,12 @@ for(var/spath in subtypesof(/datum/species)) var/datum/species/S = new spath() GLOB.species_list[S.id] = spath - sortList(GLOB.species_list, /proc/cmp_typepaths_asc) + sort_list(GLOB.species_list, /proc/cmp_typepaths_asc) //Surgeries for(var/path in subtypesof(/datum/surgery)) GLOB.surgeries_list += new path() - sortList(GLOB.surgeries_list, /proc/cmp_typepaths_asc) + sort_list(GLOB.surgeries_list, /proc/cmp_typepaths_asc) // Hair Gradients - Initialise all /datum/sprite_accessory/hair_gradient into an list indexed by gradient-style name for(var/path in subtypesof(/datum/sprite_accessory/hair_gradient)) @@ -63,7 +63,7 @@ /proc/init_crafting_recipes(list/crafting_recipes) for(var/path in subtypesof(/datum/crafting_recipe)) var/datum/crafting_recipe/recipe = new path() - recipe.reqs = sortList(recipe.reqs, /proc/cmp_crafting_req_priority) + recipe.reqs = sort_list(recipe.reqs, /proc/cmp_crafting_req_priority) crafting_recipes += recipe return crafting_recipes diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 6430d0ed4de..18520f5b47e 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -139,7 +139,7 @@ /proc/random_skin_tone() return pick(GLOB.skin_tones) -GLOBAL_LIST_INIT(skin_tones, sortList(list( +GLOBAL_LIST_INIT(skin_tones, sort_list(list( "albino", "caucasian1", "caucasian2", @@ -646,7 +646,7 @@ GLOBAL_LIST_EMPTY(species_list) var/list/borgs = active_free_borgs() if(borgs.len) if(user) - . = input(user,"Unshackled cyborg signals detected:", "Cyborg Selection", borgs[1]) in sortList(borgs) + . = input(user,"Unshackled cyborg signals detected:", "Cyborg Selection", borgs[1]) in sort_list(borgs) else . = pick(borgs) return . @@ -655,7 +655,7 @@ GLOBAL_LIST_EMPTY(species_list) var/list/ais = active_ais(FALSE, z) if(ais.len) if(user) - . = input(user,"AI signals detected:", "AI Selection", ais[1]) in sortList(ais) + . = input(user,"AI signals detected:", "AI Selection", ais[1]) in sort_list(ais) else . = pick(ais) return . @@ -683,7 +683,7 @@ GLOBAL_LIST_EMPTY(species_list) ///Orders mobs by type then by name. Accepts optional arg to sort a custom list, otherwise copies GLOB.mob_list. /proc/sort_mobs() var/list/moblist = list() - var/list/sortmob = sortNames(GLOB.mob_list) + var/list/sortmob = sort_names(GLOB.mob_list) for(var/mob/living/silicon/ai/mob_to_sort in sortmob) moblist += mob_to_sort for(var/mob/camera/mob_to_sort in sortmob) diff --git a/code/__HELPERS/piping_colors_lists.dm b/code/__HELPERS/piping_colors_lists.dm index 35e9a42e61c..96ad7dc32ec 100644 --- a/code/__HELPERS/piping_colors_lists.dm +++ b/code/__HELPERS/piping_colors_lists.dm @@ -15,7 +15,7 @@ GLOBAL_LIST_INIT(pipe_paint_colors, list( )) ///List that sorts the colors and is used for setting up the pipes layer so that they overlap correctly -GLOBAL_LIST_INIT(pipe_colors_ordered, sortList(list( +GLOBAL_LIST_INIT(pipe_colors_ordered, sort_list(list( COLOR_AMETHYST = -6, COLOR_BLUE = -5, COLOR_BROWN = -4, @@ -31,7 +31,7 @@ GLOBAL_LIST_INIT(pipe_colors_ordered, sortList(list( ))) ///Names shown in the examine for every colored atmos component -GLOBAL_LIST_INIT(pipe_color_name, sortList(list( +GLOBAL_LIST_INIT(pipe_color_name, sort_list(list( COLOR_VERY_LIGHT_GRAY = "omni", COLOR_BLUE = "blue", COLOR_RED = "red", diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index 744ef0f814d..54e40132fa8 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -316,7 +316,7 @@ //Economy & Money parts += market_report() - listclearnulls(parts) + list_clear_nulls(parts) return parts.Join() diff --git a/code/__HELPERS/sorts/__main.dm b/code/__HELPERS/sorts/__main.dm index 8a60c4143f4..cc642998229 100644 --- a/code/__HELPERS/sorts/__main.dm +++ b/code/__HELPERS/sorts/__main.dm @@ -119,7 +119,7 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sort_instance, new()) left = mid+1 //ASSERT(left == right) - moveElement(L, start, left) //move pivot element to correct location in the sorted range + move_element(L, start, left) //move pivot element to correct location in the sorted range /* Returns the length of the run beginning at the specified position and reverses the run if it is back-to-front @@ -150,7 +150,7 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sort_instance, new()) if(call(cmp)(current, last) >= 0) break ++runHi - reverseRange(L, lo, runHi) + reverse_range(L, lo, runHi) else while(runHi < hi) last = current @@ -371,16 +371,16 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sort_instance, new()) //degenerate cases if(len2 == 1) - moveElement(L, cursor2, cursor1) + move_element(L, cursor2, cursor1) return if(len1 == 1) - moveElement(L, cursor1, cursor2+len2) + move_element(L, cursor1, cursor2+len2) return //Move first element of second run - moveElement(L, cursor2++, cursor1++) + move_element(L, cursor2++, cursor1++) --len2 outer: @@ -393,7 +393,7 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sort_instance, new()) do //ASSERT(len1 > 1 && len2 > 0) if(call(cmp)(fetchElement(L,cursor2), fetchElement(L,cursor1)) < 0) - moveElement(L, cursor2++, cursor1++) + move_element(L, cursor2++, cursor1++) --len2 ++count2 @@ -426,7 +426,7 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sort_instance, new()) if(len1 <= 1) break outer - moveElement(L, cursor2, cursor1) + move_element(L, cursor2, cursor1) ++cursor2 ++cursor1 if(--len2 == 0) @@ -434,7 +434,7 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sort_instance, new()) count2 = gallopLeft(fetchElement(L,cursor1), cursor2, len2, 0) if(count2) - moveRange(L, cursor2, cursor1, count2) + move_range(L, cursor2, cursor1, count2) cursor2 += count2 cursor1 += count2 @@ -458,7 +458,7 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sort_instance, new()) if(len1 == 1) //ASSERT(len2 > 0) - moveElement(L, cursor1, cursor2+len2) + move_element(L, cursor1, cursor2+len2) //else //ASSERT(len2 == 0) @@ -473,14 +473,14 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sort_instance, new()) //degenerate cases if(len2 == 1) - moveElement(L, base2, base1) + move_element(L, base2, base1) return if(len1 == 1) - moveElement(L, base1, cursor2+1) + move_element(L, base1, cursor2+1) return - moveElement(L, cursor1--, cursor2-- + 1) + move_element(L, cursor1--, cursor2-- + 1) --len1 outer: @@ -492,7 +492,7 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sort_instance, new()) do //ASSERT(len1 > 0 && len2 > 1) if(call(cmp)(fetchElement(L,cursor2), fetchElement(L,cursor1)) < 0) - moveElement(L, cursor1--, cursor2-- + 1) + move_element(L, cursor1--, cursor2-- + 1) --len1 ++count1 @@ -520,7 +520,7 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sort_instance, new()) if(count1) cursor1 -= count1 - moveRange(L, cursor1+1, cursor2+1, count1) //cursor1+1 == cursor2 by definition + move_range(L, cursor1+1, cursor2+1, count1) //cursor1+1 == cursor2 by definition cursor2 -= count1 len1 -= count1 @@ -541,7 +541,7 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sort_instance, new()) if(len2 <= 1) break outer - moveElement(L, cursor1--, cursor2-- + 1) + move_element(L, cursor1--, cursor2-- + 1) --len1 if(len1 == 0) @@ -558,7 +558,7 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sort_instance, new()) //ASSERT(len1 > 0) cursor1 -= len1 - moveRange(L, cursor1+1, cursor2+1, len1) + move_range(L, cursor1+1, cursor2+1, len1) //else //ASSERT(len1 == 0) @@ -625,7 +625,7 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sort_instance, new()) break val1 = fetchElement(L,cursor1) else - moveElement(L,cursor2,cursor1) + move_element(L,cursor2,cursor1) if(++cursor2 >= end2) break diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index b4e69e9f48f..d074ed1875e 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -712,7 +712,7 @@ GLOBAL_LIST_INIT(binary, list("0","1")) var/list/finalized = list() finalized = accepted.Copy() + oldentries.Copy() //we keep old and unreferenced phrases near the bottom for culling - listclearnulls(finalized) + list_clear_nulls(finalized) if(length(finalized) > storemax) finalized.Cut(storemax + 1) fdel(log) diff --git a/code/__HELPERS/type_processing.dm b/code/__HELPERS/type_processing.dm index ad4f9deaa2c..127626a1344 100644 --- a/code/__HELPERS/type_processing.dm +++ b/code/__HELPERS/type_processing.dm @@ -46,7 +46,7 @@ /proc/get_fancy_list_of_datum_types() var/static/list/pre_generated_list if (!pre_generated_list) //init - pre_generated_list = make_types_fancy(sortList(typesof(/datum) - typesof(/atom))) + pre_generated_list = make_types_fancy(sort_list(typesof(/datum) - typesof(/atom))) return pre_generated_list diff --git a/code/_globalvars/lists/flavor_misc.dm b/code/_globalvars/lists/flavor_misc.dm index 07789f9b88b..d6f955313fc 100644 --- a/code/_globalvars/lists/flavor_misc.dm +++ b/code/_globalvars/lists/flavor_misc.dm @@ -118,7 +118,7 @@ GLOBAL_LIST_INIT(ghost_forms_with_accessories_list, list( "ghost_camo",)) //stores the ghost forms that support hair and other such things -GLOBAL_LIST_INIT(ai_core_display_screens, sortList(list( +GLOBAL_LIST_INIT(ai_core_display_screens, sort_list(list( ":thinking:", "Alien", "Angel", @@ -179,7 +179,7 @@ GLOBAL_LIST_INIT(ai_core_display_screens, sortList(list( return resolve_ai_icon_sync(input) -GLOBAL_LIST_INIT(security_depts_prefs, sortList(list( +GLOBAL_LIST_INIT(security_depts_prefs, sort_list(list( SEC_DEPT_NONE, SEC_DEPT_ENGINEERING, SEC_DEPT_MEDICAL, diff --git a/code/_globalvars/traumas.dm b/code/_globalvars/traumas.dm index 8344c2c476f..32ba63045c1 100644 --- a/code/_globalvars/traumas.dm +++ b/code/_globalvars/traumas.dm @@ -2,7 +2,7 @@ /// Phobia types that can be pulled randomly for brain traumas. /// Also determines what phobias you can choose as your preference with the quirk. -GLOBAL_LIST_INIT(phobia_types, sortList(list( +GLOBAL_LIST_INIT(phobia_types, sort_list(list( "aliens", "anime", "authority", diff --git a/code/controllers/master.dm b/code/controllers/master.dm index e375fde21b3..8e0d916247e 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -127,7 +127,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new /datum/controller/master/Shutdown() processing = FALSE sortTim(subsystems, /proc/cmp_subsystem_init) - reverseRange(subsystems) + reverse_range(subsystems) for(var/datum/controller/subsystem/ss in subsystems) log_world("Shutting down [ss.name] subsystem...") ss.Shutdown() diff --git a/code/controllers/subsystem/blackbox.dm b/code/controllers/subsystem/blackbox.dm index e3ec6774675..abc5a6a02f1 100644 --- a/code/controllers/subsystem/blackbox.dm +++ b/code/controllers/subsystem/blackbox.dm @@ -63,7 +63,7 @@ SUBSYSTEM_DEF(blackbox) //no touchie /datum/controller/subsystem/blackbox/vv_get_var(var_name) if(var_name == "feedback") - return debug_variable(var_name, deepCopyList(feedback), 0, src) + return debug_variable(var_name, deep_copy_list(feedback), 0, src) return ..() /datum/controller/subsystem/blackbox/vv_edit_var(var_name, var_value) diff --git a/code/controllers/subsystem/dcs.dm b/code/controllers/subsystem/dcs.dm index 104c3eef31d..35dc40c7516 100644 --- a/code/controllers/subsystem/dcs.dm +++ b/code/controllers/subsystem/dcs.dm @@ -49,6 +49,6 @@ PROCESSING_SUBSYSTEM_DEF(dcs) fullid += "[key]" if(length(named_arguments)) - named_arguments = sortList(named_arguments) + named_arguments = sort_list(named_arguments) fullid += named_arguments return list2params(fullid) diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index 2ad24b4c846..18e30c10886 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -366,7 +366,7 @@ GLOBAL_LIST_EMPTY(the_station_areas) if(pmv) mapvotes[map] = mapvotes[map]*VM.voteweight - var/pickedmap = pickweight(mapvotes) + var/pickedmap = pick_weight(mapvotes) if (!pickedmap) return var/datum/map_config/VM = global.config.maplist[pickedmap] @@ -408,7 +408,7 @@ GLOBAL_LIST_EMPTY(the_station_areas) banned += generateMapList("[global.config.directory]/spaceruinblacklist.txt") banned += generateMapList("[global.config.directory]/iceruinblacklist.txt") - for(var/item in sortList(subtypesof(/datum/map_template/ruin), /proc/cmp_ruincost_priority)) + for(var/item in sort_list(subtypesof(/datum/map_template/ruin), /proc/cmp_ruincost_priority)) var/datum/map_template/ruin/ruin_type = item // screen out the abstract subtypes if(!initial(ruin_type.id)) diff --git a/code/controllers/subsystem/materials.dm b/code/controllers/subsystem/materials.dm index 08cd651505a..244ba96fde9 100644 --- a/code/controllers/subsystem/materials.dm +++ b/code/controllers/subsystem/materials.dm @@ -138,7 +138,7 @@ SUBSYSTEM_DEF(materials) fullid += "[key]" if(length(named_arguments)) - named_arguments = sortList(named_arguments) + named_arguments = sort_list(named_arguments) fullid += named_arguments return list2params(fullid) diff --git a/code/controllers/subsystem/processing/quirks.dm b/code/controllers/subsystem/processing/quirks.dm index f2a3d1544df..72405540cc9 100644 --- a/code/controllers/subsystem/processing/quirks.dm +++ b/code/controllers/subsystem/processing/quirks.dm @@ -42,7 +42,7 @@ PROCESSING_SUBSYSTEM_DEF(quirks) /datum/controller/subsystem/processing/quirks/proc/SetupQuirks() // Sort by Positive, Negative, Neutral; and then by name - var/list/quirk_list = sortList(subtypesof(/datum/quirk), /proc/cmp_quirk_asc) + var/list/quirk_list = sort_list(subtypesof(/datum/quirk), /proc/cmp_quirk_asc) for(var/type in quirk_list) var/datum/quirk/quirk_type = type diff --git a/code/controllers/subsystem/processing/station.dm b/code/controllers/subsystem/processing/station.dm index 84387913e63..bca36de0967 100644 --- a/code/controllers/subsystem/processing/station.dm +++ b/code/controllers/subsystem/processing/station.dm @@ -69,7 +69,7 @@ PROCESSING_SUBSYSTEM_DEF(station) if(!amount) return for(var/iterator in 1 to amount) - var/datum/station_trait/trait_type = pickweight(selectable_traits_by_types[trait_sign]) //Rolls from the table for the specific trait type + var/datum/station_trait/trait_type = pick_weight(selectable_traits_by_types[trait_sign]) //Rolls from the table for the specific trait type setup_trait(trait_type) ///Creates a given trait of a specific type, while also removing any blacklisted ones from the future pool. diff --git a/code/controllers/subsystem/server_maint.dm b/code/controllers/subsystem/server_maint.dm index 8b64e31606b..8eccc89db16 100644 --- a/code/controllers/subsystem/server_maint.dm +++ b/code/controllers/subsystem/server_maint.dm @@ -34,7 +34,7 @@ SUBSYSTEM_DEF(server_maint) /datum/controller/subsystem/server_maint/fire(resumed = FALSE) if(!resumed) - if(listclearnulls(GLOB.clients)) + if(list_clear_nulls(GLOB.clients)) log_world("Found a null in clients list!") src.currentrun = GLOB.clients.Copy() @@ -42,7 +42,7 @@ SUBSYSTEM_DEF(server_maint) if(!(position_in_loop % 1)) //If it's a whole number var/listname = lists_to_clear[position_in_loop] - if(listclearnulls(lists_to_clear[listname])) + if(list_clear_nulls(lists_to_clear[listname])) log_world("Found a null in [listname]!") cleanup_ticker++ diff --git a/code/controllers/subsystem/shuttle.dm b/code/controllers/subsystem/shuttle.dm index 145a75546f1..660668c6e70 100644 --- a/code/controllers/subsystem/shuttle.dm +++ b/code/controllers/subsystem/shuttle.dm @@ -834,7 +834,7 @@ SUBSYSTEM_DEF(shuttle) templates[S.port_id]["templates"] += list(L) - data["templates_tabs"] = sortList(data["templates_tabs"]) + data["templates_tabs"] = sort_list(data["templates_tabs"]) data["existing_shuttle"] = null diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 3237555a3d6..3251aa74c4a 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -466,7 +466,7 @@ SUBSYSTEM_DEF(ticker) return var/hpc = CONFIG_GET(number/hard_popcap) if(!hpc) - listclearnulls(queued_players) + list_clear_nulls(queued_players) for (var/mob/dead/new_player/NP in queued_players) to_chat(NP, span_userdanger("The alive players limit has been released!
[html_encode(">>Join Game<<")]")) SEND_SOUND(NP, sound('sound/misc/notice1.ogg')) @@ -480,7 +480,7 @@ SUBSYSTEM_DEF(ticker) switch(queue_delay) if(5) //every 5 ticks check if there is a slot available - listclearnulls(queued_players) + list_clear_nulls(queued_players) if(living_player_count() < hpc) if(next_in_line?.client) to_chat(next_in_line, span_userdanger("A slot has opened! You have approximately 20 seconds to join. \>\>Join Game\<\<")) diff --git a/code/controllers/subsystem/timer.dm b/code/controllers/subsystem/timer.dm index c5e5f99f2d4..f4f3f601ffd 100644 --- a/code/controllers/subsystem/timer.dm +++ b/code/controllers/subsystem/timer.dm @@ -488,7 +488,7 @@ SUBSYSTEM_DEF(timer) /datum/timedevent/proc/bucketJoin() // Generate debug-friendly name for timer var/static/list/bitfield_flags = list("TIMER_UNIQUE", "TIMER_OVERRIDE", "TIMER_CLIENT_TIME", "TIMER_STOPPABLE", "TIMER_NO_HASH_WAIT", "TIMER_LOOP") - name = "Timer: [id] (\ref[src]), TTR: [timeToRun], wait:[wait] Flags: [jointext(bitfield2list(flags, bitfield_flags), ", ")], \ + name = "Timer: [id] (\ref[src]), TTR: [timeToRun], wait:[wait] Flags: [jointext(bitfield_to_list(flags, bitfield_flags), ", ")], \ callBack: \ref[callBack], callBack.object: [callBack.object]\ref[callBack.object]([getcallingtype()]), \ callBack.delegate:[callBack.delegate]([callBack.arguments ? callBack.arguments.Join(", ") : ""]), source: [source]" diff --git a/code/controllers/subsystem/weather.dm b/code/controllers/subsystem/weather.dm index cb45ad7ef5f..8afd2550f89 100644 --- a/code/controllers/subsystem/weather.dm +++ b/code/controllers/subsystem/weather.dm @@ -26,7 +26,7 @@ SUBSYSTEM_DEF(weather) // start random weather on relevant levels for(var/z in eligible_zlevels) var/possible_weather = eligible_zlevels[z] - var/datum/weather/our_event = pickweight(possible_weather) + var/datum/weather/our_event = pick_weight(possible_weather) run_weather(our_event, list(text2num(z))) eligible_zlevels -= z var/randTime = rand(3000, 6000) diff --git a/code/datums/ai/monkey/monkey_behaviors.dm b/code/datums/ai/monkey/monkey_behaviors.dm index 22f2c8938ee..f631cf414fd 100644 --- a/code/datums/ai/monkey/monkey_behaviors.dm +++ b/code/datums/ai/monkey/monkey_behaviors.dm @@ -304,5 +304,5 @@ if(!valids.len) finish_action(controller, FALSE) - controller.blackboard[set_key] = pickweight(valids) + controller.blackboard[set_key] = pick_weight(valids) finish_action(controller, TRUE) diff --git a/code/datums/ai_laws.dm b/code/datums/ai_laws.dm index 4f5db69e110..72ab8de442f 100644 --- a/code/datums/ai_laws.dm +++ b/code/datums/ai_laws.dm @@ -261,7 +261,7 @@ if(HAS_TRAIT(SSstation, STATION_TRAIT_UNIQUE_AI)) law_weights -= AI_LAWS_ASIMOV while(!lawtype && law_weights.len) - var/possible_id = pickweightAllowZero(law_weights) + var/possible_id = pick_weight_allow_zero(law_weights) lawtype = lawid_to_type(possible_id) if(!lawtype) law_weights -= possible_id @@ -328,7 +328,7 @@ replaceable_groups[LAW_INHERENT] = inherent.len if(supplied.len && (LAW_SUPPLIED in groups)) replaceable_groups[LAW_SUPPLIED] = supplied.len - var/picked_group = pickweight(replaceable_groups) + var/picked_group = pick_weight(replaceable_groups) switch(picked_group) if(LAW_ZEROTH) . = zeroth diff --git a/code/datums/changelog/changelog.dm b/code/datums/changelog/changelog.dm index 415237f3a00..1b7c7623253 100644 --- a/code/datums/changelog/changelog.dm +++ b/code/datums/changelog/changelog.dm @@ -25,7 +25,7 @@ var/list/data = list( "dates" = list() ) var/regex/ymlRegex = regex(@"\.yml", "g") - for(var/archive_file in sortList(flist("html/changelogs/archive/"))) + for(var/archive_file in sort_list(flist("html/changelogs/archive/"))) var/archive_date = ymlRegex.Replace(archive_file, "") data["dates"] = list(archive_date) + data["dates"] diff --git a/code/datums/components/fantasy/_fantasy.dm b/code/datums/components/fantasy/_fantasy.dm index 83bebe1c7d1..71351002ffa 100644 --- a/code/datums/components/fantasy/_fantasy.dm +++ b/code/datums/components/fantasy/_fantasy.dm @@ -80,7 +80,7 @@ var/usedSlots = NONE for(var/i in 1 to max(1, abs(quality))) // We want at least 1 affix applied - var/datum/fantasy_affix/affix = pickweight(affixListing) + var/datum/fantasy_affix/affix = pick_weight(affixListing) if(affix.placement & usedSlots) continue if(!(affix.alignment & alignment)) diff --git a/code/datums/components/fantasy/suffixes.dm b/code/datums/components/fantasy/suffixes.dm index 28978c918c8..9a265237a6d 100644 --- a/code/datums/components/fantasy/suffixes.dm +++ b/code/datums/components/fantasy/suffixes.dm @@ -154,7 +154,7 @@ /obj/projectile/temp/hot = 15, /obj/projectile/beam/disabler = 15) - var/obj/projectile/picked_projectiletype = pickweight(weighted_projectile_types) + var/obj/projectile/picked_projectiletype = pick_weight(weighted_projectile_types) var/obj/item/master = comp.parent comp.appliedComponents += master.AddComponent(/datum/component/mirv, picked_projectiletype) diff --git a/code/datums/components/food/ice_cream_holder.dm b/code/datums/components/food/ice_cream_holder.dm index 1af459ce703..a9a117cafd2 100644 --- a/code/datums/components/food/ice_cream_holder.dm +++ b/code/datums/components/food/ice_cream_holder.dm @@ -80,7 +80,7 @@ source.name = initial(source.name) else var/name_to_use = filled_name || initial(source.name) - var/list/unique_list = uniqueList(scoops) + var/list/unique_list = unique_list(scoops) if(scoops_len > 1 && length(unique_list) == 1) // multiple flavours, and all of the same type source.name = "[make_tuple(scoops_len)] [scoops[1]] [name_to_use]" // "double vanilla" sounds cooler than just "vanilla" else @@ -94,7 +94,7 @@ var/scoops_len = length(scoops) if(!scoops_len) source.desc = initial(source.desc) - else if(scoops_len == 1 || length(uniqueList(scoops)) == 1) /// Only one flavour. + else if(scoops_len == 1 || length(unique_list(scoops)) == 1) /// Only one flavour. var/key = scoops[1] var/datum/ice_cream_flavour/flavour = GLOB.ice_cream_flavours[LAZYACCESS(special_scoops, key) || key] if(!flavour?.desc) //I scream. @@ -107,7 +107,7 @@ /datum/component/ice_cream_holder/proc/on_examine_more(atom/source, mob/mob, list/examine_list) SIGNAL_HANDLER var/scoops_len = length(scoops) - if(scoops_len == 1 || length(uniqueList(scoops)) == 1) /// Only one flavour. + if(scoops_len == 1 || length(unique_list(scoops)) == 1) /// Only one flavour. var/key = scoops[1] var/datum/ice_cream_flavour/flavour = GLOB.ice_cream_flavours[LAZYACCESS(special_scoops, key) || key] if(flavour?.desc) //I scream. diff --git a/code/datums/components/soundplayer.dm b/code/datums/components/soundplayer.dm index 1873d8c8e5f..d3e729d4749 100644 --- a/code/datums/components/soundplayer.dm +++ b/code/datums/components/soundplayer.dm @@ -31,7 +31,7 @@ */ /datum/component/sound_player/proc/play_sound() SIGNAL_HANDLER - playsound(parent, pickweight(sounds), volume, TRUE) + playsound(parent, pick_weight(sounds), volume, TRUE) switch(amount_left) if(-1) return diff --git a/code/datums/components/squeak.dm b/code/datums/components/squeak.dm index b07e2bd6ff4..3cfff08064f 100644 --- a/code/datums/components/squeak.dm +++ b/code/datums/components/squeak.dm @@ -75,9 +75,9 @@ if(prob(squeak_chance)) if(!override_squeak_sounds) - playsound(parent, pickweight(default_squeak_sounds), volume, TRUE, sound_extra_range, sound_falloff_exponent, falloff_distance = sound_falloff_distance) + playsound(parent, pick_weight(default_squeak_sounds), volume, TRUE, sound_extra_range, sound_falloff_exponent, falloff_distance = sound_falloff_distance) else - playsound(parent, pickweight(override_squeak_sounds), volume, TRUE, sound_extra_range, sound_falloff_exponent, falloff_distance = sound_falloff_distance) + playsound(parent, pick_weight(override_squeak_sounds), volume, TRUE, sound_extra_range, sound_falloff_exponent, falloff_distance = sound_falloff_distance) /datum/component/squeak/proc/step_squeak() SIGNAL_HANDLER diff --git a/code/datums/components/subtype_picker.dm b/code/datums/components/subtype_picker.dm index 6660e20c458..71576ac7edf 100644 --- a/code/datums/components/subtype_picker.dm +++ b/code/datums/components/subtype_picker.dm @@ -49,7 +49,7 @@ name2subtype[initial(subtype.name)] = subtype built_radial_list += list(initial(subtype.name) = option) - built_radial_list = sortList(built_radial_list) + built_radial_list = sort_list(built_radial_list) /** * pick_subtype: called from on_attack_self, shows a user a radial menu of all available null rod reskins and replaces the current null rod with the user's chosen reskinned variant diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index c4aec06d144..a62917f82eb 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -362,7 +362,7 @@ L += "[S.id]N" else L += S.id - L = sortList(L) // Sort the list so it doesn't matter which order the symptoms are in. + L = sort_list(L) // Sort the list so it doesn't matter which order the symptoms are in. var/result = jointext(L, ":") id = result return id @@ -451,7 +451,7 @@ symptoms += SSdisease.list_symptoms.Copy() do if(user) - var/symptom = input(user, "Choose a symptom to add ([i] remaining)", "Choose a Symptom") in sortList(symptoms, /proc/cmp_typepaths_asc) + var/symptom = input(user, "Choose a symptom to add ([i] remaining)", "Choose a Symptom") in sort_list(symptoms, /proc/cmp_typepaths_asc) if(isnull(symptom)) return else if(istext(symptom)) @@ -473,7 +473,7 @@ D.name = new_name //Updates our copy var/list/targets = list("Random") - targets += sortNames(GLOB.human_list) + targets += sort_names(GLOB.human_list) var/target = input(user, "Pick a viable human target for the disease.", "Disease Target") as null|anything in targets var/mob/living/carbon/human/H diff --git a/code/datums/elements/surgery_initiator.dm b/code/datums/elements/surgery_initiator.dm index f6a460343d7..edc365072b3 100644 --- a/code/datums/elements/surgery_initiator.dm +++ b/code/datums/elements/surgery_initiator.dm @@ -65,7 +65,7 @@ if(!available_surgeries.len) return - var/pick_your_surgery = input("Begin which procedure?", "Surgery", null, null) as null|anything in sortList(available_surgeries) + var/pick_your_surgery = input("Begin which procedure?", "Surgery", null, null) as null|anything in sort_list(available_surgeries) if(pick_your_surgery && user?.Adjacent(livingtarget) && (source in user)) var/datum/surgery/surgeryinstance_notonmob = available_surgeries[pick_your_surgery] diff --git a/code/datums/looping_sounds/_looping_sound.dm b/code/datums/looping_sounds/_looping_sound.dm index e8c6bc4d22f..b893ef6a6fa 100644 --- a/code/datums/looping_sounds/_looping_sound.dm +++ b/code/datums/looping_sounds/_looping_sound.dm @@ -94,7 +94,7 @@ /datum/looping_sound/proc/get_sound(starttime, _mid_sounds) . = _mid_sounds || mid_sounds while(!isfile(.) && !isnull(.)) - . = pickweight(.) + . = pick_weight(.) /datum/looping_sound/proc/on_start() var/start_wait = 0 diff --git a/code/datums/mapgen/CaveGenerator.dm b/code/datums/mapgen/CaveGenerator.dm index 7aa8a6f51e8..f79b8e288a1 100644 --- a/code/datums/mapgen/CaveGenerator.dm +++ b/code/datums/mapgen/CaveGenerator.dm @@ -63,7 +63,7 @@ if(gen_turf.turf_flags & NO_RUINS) stored_flags |= NO_RUINS - var/turf/new_turf = pickweight(closed ? closed_turf_types : open_turf_types) + var/turf/new_turf = pick_weight(closed ? closed_turf_types : open_turf_types) new_turf = gen_turf.ChangeTurf(new_turf, initial(new_turf.baseturfs), CHANGETURF_DEFER_CHANGE) @@ -83,7 +83,7 @@ if(!(A.area_flags & FLORA_ALLOWED)) can_spawn = FALSE if(can_spawn) - spawned_flora = pickweight(flora_spawn_list) + spawned_flora = pick_weight(flora_spawn_list) spawned_flora = new spawned_flora(new_open_turf) //FEATURE SPAWNING HERE @@ -94,7 +94,7 @@ if(!(A.area_flags & FLORA_ALLOWED)) //checks the same flag because lol dunno can_spawn = FALSE - var/atom/picked_feature = pickweight(feature_spawn_list) + var/atom/picked_feature = pick_weight(feature_spawn_list) for(var/obj/structure/F in range(7, new_open_turf)) if(istype(F, picked_feature)) @@ -111,13 +111,13 @@ if(!(A.area_flags & MOB_SPAWN_ALLOWED)) can_spawn = FALSE - var/atom/picked_mob = pickweight(mob_spawn_list) + var/atom/picked_mob = pick_weight(mob_spawn_list) if(picked_mob == SPAWN_MEGAFAUNA) // if((A.area_flags & MEGAFAUNA_SPAWN_ALLOWED) && megafauna_spawn_list?.len) //this is danger. it's boss time. - picked_mob = pickweight(megafauna_spawn_list) + picked_mob = pick_weight(megafauna_spawn_list) else //this is not danger, don't spawn a boss, spawn something else - picked_mob = pickweight(mob_spawn_list - SPAWN_MEGAFAUNA) //What if we used 100% of the brain...and did something (slightly) less shit than a while loop? + picked_mob = pick_weight(mob_spawn_list - SPAWN_MEGAFAUNA) //What if we used 100% of the brain...and did something (slightly) less shit than a while loop? for(var/thing in urange(12, new_open_turf)) //prevents mob clumps if(!ishostile(thing) && !istype(thing, /obj/structure/spawner)) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index ef90eb30d5a..79f6d3bd80b 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -484,7 +484,7 @@ A.admin_remove(usr) if (href_list["role_edit"]) - var/new_role = input("Select new role", "Assigned role", assigned_role.title) as null|anything in sortList(SSjob.station_jobs) + var/new_role = input("Select new role", "Assigned role", assigned_role.title) as null|anything in sort_list(SSjob.station_jobs) if(isnull(new_role)) return var/datum/job/new_job = SSjob.GetJob(new_role) @@ -522,7 +522,7 @@ if(1) target_antag = antag_datums[1] else - var/datum/antagonist/target = input("Which antagonist gets the objective:", "Antagonist", "(new custom antag)") as null|anything in sortList(antag_datums) + "(new custom antag)" + var/datum/antagonist/target = input("Which antagonist gets the objective:", "Antagonist", "(new custom antag)") as null|anything in sort_list(antag_datums) + "(new custom antag)" if (QDELETED(target)) return else if(target == "(new custom antag)") diff --git a/code/datums/mutations/actions.dm b/code/datums/mutations/actions.dm index 7596b32cc82..25ed84fe440 100644 --- a/code/datums/mutations/actions.dm +++ b/code/datums/mutations/actions.dm @@ -61,7 +61,7 @@ if(!length(possible)) to_chat(user,span_warning("Despite your best efforts, there are no scents to be found on [sniffed]...")) return - tracking_target = input(user, "Choose a scent to remember.", "Scent Tracking") as null|anything in sortNames(possible) + tracking_target = input(user, "Choose a scent to remember.", "Scent Tracking") as null|anything in sort_names(possible) if(!tracking_target) if(!old_target) to_chat(user,span_warning("You decide against remembering any scents. Instead, you notice your own nose in your peripheral vision. This goes on to remind you of that one time you started breathing manually and couldn't stop. What an awful day that was.")) diff --git a/code/datums/mutations/antenna.dm b/code/datums/mutations/antenna.dm index 0ffd48c0ff9..8ab14debef3 100644 --- a/code/datums/mutations/antenna.dm +++ b/code/datums/mutations/antenna.dm @@ -79,7 +79,7 @@ if(nlog_type & LOG_SAY) var/list/reversed = log_source[log_type] if(islist(reversed)) - say_log = reverseRange(reversed.Copy()) + say_log = reverse_range(reversed.Copy()) break if(LAZYLEN(say_log)) for(var/spoken_memory in say_log) diff --git a/code/datums/outfit.dm b/code/datums/outfit.dm index 1def91f371b..c27d16efa91 100755 --- a/code/datums/outfit.dm +++ b/code/datums/outfit.dm @@ -315,7 +315,7 @@ var/list/types = list(uniform, suit, back, belt, gloves, shoes, head, mask, neck, ears, glasses, id, l_pocket, r_pocket, suit_store, r_hand, l_hand) types += chameleon_extras types += skillchips - listclearnulls(types) + list_clear_nulls(types) return types /// Return a json list of this outfit diff --git a/code/datums/station_traits/negative_traits.dm b/code/datums/station_traits/negative_traits.dm index fb2679090f4..400c829fa2f 100644 --- a/code/datums/station_traits/negative_traits.dm +++ b/code/datums/station_traits/negative_traits.dm @@ -193,7 +193,7 @@ var/mob/living/carbon/human/species/monkey/punpun/punpun = locate() if(!punpun) return - var/weapon_type = pickweight(weapon_types) + var/weapon_type = pick_weight(weapon_types) var/obj/item/weapon = new weapon_type if(!punpun.put_in_l_hand(weapon) && !punpun.put_in_r_hand(weapon)) // Guess they did all this with whatever they have in their hands already diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 152a8bcff78..5c836a34a8a 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1259,7 +1259,7 @@ if(!valid_id) to_chat(usr, span_warning("A reagent with that ID doesn't exist!")) if("Choose from a list") - chosen_id = input(usr, "Choose a reagent to add.", "Choose a reagent.") as null|anything in sortList(subtypesof(/datum/reagent), /proc/cmp_typepaths_asc) + chosen_id = input(usr, "Choose a reagent to add.", "Choose a reagent.") as null|anything in sort_list(subtypesof(/datum/reagent), /proc/cmp_typepaths_asc) if("I'm feeling lucky") chosen_id = pick(subtypesof(/datum/reagent)) if(chosen_id) diff --git a/code/game/gamemodes/dynamic/dynamic.dm b/code/game/gamemodes/dynamic/dynamic.dm index 99233baf8bd..7ea131377ef 100644 --- a/code/game/gamemodes/dynamic/dynamic.dm +++ b/code/game/gamemodes/dynamic/dynamic.dm @@ -222,7 +222,7 @@ GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1) else if (href_list["stacking_limit"]) GLOB.dynamic_stacking_limit = input(usr,"Change the threat limit at which round-endings rulesets will start to stack.", "Change stacking limit", null) as num else if(href_list["force_latejoin_rule"]) - var/added_rule = input(usr,"What ruleset do you want to force upon the next latejoiner? This will bypass threat level and population restrictions.", "Rigging Latejoin", null) as null|anything in sortNames(init_rulesets(/datum/dynamic_ruleset/latejoin)) + var/added_rule = input(usr,"What ruleset do you want to force upon the next latejoiner? This will bypass threat level and population restrictions.", "Rigging Latejoin", null) as null|anything in sort_names(init_rulesets(/datum/dynamic_ruleset/latejoin)) if (!added_rule) return forced_latejoin_rule = added_rule @@ -233,7 +233,7 @@ GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1) log_admin("[key_name(usr)] cleared the forced latejoin ruleset.") message_admins("[key_name(usr)] cleared the forced latejoin ruleset.") else if(href_list["force_midround_rule"]) - var/added_rule = input(usr,"What ruleset do you want to force right now? This will bypass threat level and population restrictions.", "Execute Ruleset", null) as null|anything in sortNames(init_rulesets(/datum/dynamic_ruleset/midround)) + var/added_rule = input(usr,"What ruleset do you want to force right now? This will bypass threat level and population restrictions.", "Execute Ruleset", null) as null|anything in sort_names(init_rulesets(/datum/dynamic_ruleset/midround)) if (!added_rule) return log_admin("[key_name(usr)] executed the [added_rule] ruleset.") @@ -470,7 +470,7 @@ GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1) var/round_start_budget_left = round_start_budget while (round_start_budget_left > 0) - var/datum/dynamic_ruleset/roundstart/ruleset = pickweightAllowZero(drafted_rules) + var/datum/dynamic_ruleset/roundstart/ruleset = pick_weight_allow_zero(drafted_rules) if (isnull(ruleset)) log_game("DYNAMIC: No more rules can be applied, stopping with [round_start_budget] left.") break diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets.dm b/code/game/gamemodes/dynamic/dynamic_rulesets.dm index 788baba4f1e..ab2180ecbf0 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets.dm @@ -4,7 +4,7 @@ /datum/dynamic_ruleset /// For admin logging and round end screen. // If you want to change this variable name, the force latejoin/midround rulesets - // to not use sortNames. + // to not use sort_names. var/name = "" /// For admin logging and round end screen, do not change this unless making a new rule type. var/ruletype = "" diff --git a/code/game/gamemodes/dynamic/ruleset_picking.dm b/code/game/gamemodes/dynamic/ruleset_picking.dm index 678c4fdedc0..429e6c1d8e7 100644 --- a/code/game/gamemodes/dynamic/ruleset_picking.dm +++ b/code/game/gamemodes/dynamic/ruleset_picking.dm @@ -7,7 +7,7 @@ return null while (TRUE) - var/datum/dynamic_ruleset/rule = pickweight(drafted_rules) + var/datum/dynamic_ruleset/rule = pick_weight(drafted_rules) if (!rule) return null diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 77484dc88b2..78c41945c78 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -40,7 +40,7 @@ GLOBAL_LIST_EMPTY(objectives) if ((possible_target != src) && ishuman(possible_target.current)) possible_targets += possible_target.current - possible_targets = list("Free objective", "Random") + sortNames(possible_targets) + possible_targets = list("Free objective", "Random") + sort_names(possible_targets) if(target?.current) @@ -595,7 +595,7 @@ GLOBAL_LIST_EMPTY(possible_items) /datum/objective/steal/admin_edit(mob/admin) var/list/possible_items_all = GLOB.possible_items - var/new_target = input(admin,"Select target:", "Objective target", steal_target) as null|anything in sortNames(possible_items_all)+"custom" + var/new_target = input(admin,"Select target:", "Objective target", steal_target) as null|anything in sort_names(possible_items_all)+"custom" if (!new_target) return @@ -829,7 +829,7 @@ GLOBAL_LIST_EMPTY(possible_items_special) /datum/objective/destroy/admin_edit(mob/admin) var/list/possible_targets = active_ais(1) if(possible_targets.len) - var/mob/new_target = input(admin,"Select target:", "Objective target") as null|anything in sortNames(possible_targets) + var/mob/new_target = input(admin,"Select target:", "Objective target") as null|anything in sort_names(possible_targets) target = new_target.mind else to_chat(admin, span_boldwarning("No active AIs with minds.")) @@ -902,7 +902,7 @@ GLOBAL_LIST_EMPTY(possible_items_special) /proc/generate_admin_objective_list() GLOB.admin_objective_list = list() - var/list/allowed_types = sortList(list( + var/list/allowed_types = sort_list(list( /datum/objective/assassinate, /datum/objective/maroon, /datum/objective/debrain, diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index 58b4b5b9999..7e04aee2660 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -627,7 +627,7 @@ if(user_unbuckle_mob(buckled_mobs[1],user)) return TRUE - var/unbuckled = input(user, "Who do you wish to unbuckle?","Unbuckle Who?") as null|mob in sortNames(buckled_mobs) + var/unbuckled = input(user, "Who do you wish to unbuckle?","Unbuckle Who?") as null|mob in sort_names(buckled_mobs) if(user_unbuckle_mob(unbuckled,user)) return TRUE diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index de3aa122166..e82d32c7f58 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -206,7 +206,7 @@ if(materials.materials[i] > 0) list_to_show += i - used_material = input("Choose [used_material]", "Custom Material") as null|anything in sortList(list_to_show, /proc/cmp_typepaths_asc) + used_material = input("Choose [used_material]", "Custom Material") as null|anything in sort_list(list_to_show, /proc/cmp_typepaths_asc) if(!used_material) return //Didn't pick any material, so you can't build shit either. custom_materials[used_material] += amount_needed diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 8cef2621c92..d91640ef980 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -225,7 +225,7 @@ droppable_parts += assembly.proxy_module if(!droppable_parts.len) return - var/obj/item/choice = input(user, "Select a part to remove:", src) as null|obj in sortNames(droppable_parts) + var/obj/item/choice = input(user, "Select a part to remove:", src) as null|obj in sort_names(droppable_parts) if(!choice || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return to_chat(user, span_notice("You remove [choice] from [src].")) diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index e603040d381..c87e5cc2a84 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -202,7 +202,7 @@ droppable_parts += proxy_module if(!droppable_parts.len) return - var/obj/item/choice = input(user, "Select a part to remove:", src) as null|obj in sortNames(droppable_parts) + var/obj/item/choice = input(user, "Select a part to remove:", src) as null|obj in sort_names(droppable_parts) if(!choice || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return to_chat(user, span_notice("You remove [choice] from [src].")) diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index fd07fda75d4..cf57acbafe5 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -53,7 +53,7 @@ else track.others[name] = WEAKREF(L) - var/list/targets = sortList(track.humans) + sortList(track.others) + var/list/targets = sort_list(track.humans) + sort_list(track.others) return targets diff --git a/code/game/machinery/computer/arcade/arcade.dm b/code/game/machinery/computer/arcade/arcade.dm index fda8475cc3a..05dfe065080 100644 --- a/code/game/machinery/computer/arcade/arcade.dm +++ b/code/game/machinery/computer/arcade/arcade.dm @@ -99,9 +99,9 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list( var/prizeselect if(prize_override) - prizeselect = pickweight(prize_override) + prizeselect = pick_weight(prize_override) else - prizeselect = pickweight(GLOB.arcade_prize_pool) + prizeselect = pick_weight(GLOB.arcade_prize_pool) var/atom/movable/the_prize = new prizeselect(get_turf(src)) playsound(src, 'sound/machines/machine_vend.ogg', 50, TRUE, extrarange = -3) visible_message(span_notice("[src] dispenses [the_prize]!"), span_notice("You hear a chime and a clunk.")) @@ -124,9 +124,9 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list( num_of_prizes = rand(0,2) for(var/i = num_of_prizes; i > 0; i--) if(override) - empprize = pickweight(prize_override) + empprize = pick_weight(prize_override) else - empprize = pickweight(GLOB.arcade_prize_pool) + empprize = pick_weight(GLOB.arcade_prize_pool) new empprize(loc) explosion(src, devastation_range = -1, light_impact_range = 1+num_of_prizes, flame_range = 1+num_of_prizes) diff --git a/code/game/machinery/computer/arcade/orion.dm b/code/game/machinery/computer/arcade/orion.dm index d8d1bc5d971..64292b4298e 100644 --- a/code/game/machinery/computer/arcade/orion.dm +++ b/code/game/machinery/computer/arcade/orion.dm @@ -328,7 +328,7 @@ GLOBAL_LIST_INIT(orion_events, generate_orion_events()) */ /obj/machinery/computer/arcade/orion_trail/proc/encounter_event(path, gamer, gamer_skill, gamer_skill_level, gamer_skill_rands) if(!path) - event = pickweightAllowZero(events) + event = pick_weight_allow_zero(events) else for(var/datum/orion_event/instance as anything in events) if(instance.type == path) diff --git a/code/game/machinery/computer/arena.dm b/code/game/machinery/computer/arena.dm index 931d31867c6..20b44ff6b04 100644 --- a/code/game/machinery/computer/arena.dm +++ b/code/game/machinery/computer/arena.dm @@ -168,7 +168,7 @@ var/list/keys = list() for(var/mob/M in GLOB.player_list) keys += M.client - var/client/selection = input("Please, select a player!", "Team member", null, null) as null|anything in sortKey(keys) + var/client/selection = input("Please, select a player!", "Team member", null, null) as null|anything in sort_key(keys) //Could be freeform if you want to add disconnected i guess if(!selection) return diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm index 855d653099d..b8628194002 100644 --- a/code/game/machinery/computer/atmos_control.dm +++ b/code/game/machinery/computer/atmos_control.dm @@ -430,7 +430,7 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers) IO |= text[1] if(!IO.len) to_chat(user, span_alert("No machinery detected.")) - var/S = input("Select the device set: ", "Selection", IO[1]) as anything in sortList(IO) + var/S = input("Select the device set: ", "Selection", IO[1]) as anything in sort_list(IO) if(src) src.input_tag = "[S]_in" src.output_tag = "[S]_out" diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 39a67441220..38a00787742 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -63,7 +63,7 @@ if(!isnull(GLOB.data_core.general)) - for(var/datum/data/record/R in sortRecord(GLOB.data_core.general, sortBy, order)) + for(var/datum/data/record/R in sort_record(GLOB.data_core.general, sortBy, order)) var/blood_type = "" var/b_dna = "" for(var/datum/data/record/E in GLOB.data_core.medical) diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index b846128d8cc..a9c086a222b 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -285,7 +285,7 @@ Criminal Status "} if(!isnull(GLOB.data_core.general)) - for(var/datum/data/record/R in sortRecord(GLOB.data_core.general, sortBy, order)) + for(var/datum/data/record/R in sort_record(GLOB.data_core.general, sortBy, order)) var/crimstat = "" for(var/datum/data/record/E in GLOB.data_core.security) if((E.fields["name"] == R.fields["name"]) && (E.fields["id"] == R.fields["id"])) diff --git a/code/game/machinery/computer/teleporter.dm b/code/game/machinery/computer/teleporter.dm index c3f7d25c266..2821874cc3a 100644 --- a/code/game/machinery/computer/teleporter.dm +++ b/code/game/machinery/computer/teleporter.dm @@ -183,7 +183,7 @@ var/list/targets = get_targets() if (regime_set == "Teleporter") - var/desc = input("Please select a location to lock in.", "Locking Computer") as null|anything in sortList(targets) + var/desc = input("Please select a location to lock in.", "Locking Computer") as null|anything in sort_list(targets) set_teleport_target(targets[desc]) var/turf/target_turf = get_turf(targets[desc]) log_game("[key_name(user)] has set the teleporter target to [targets[desc]] at [AREACOORD(target_turf)]") @@ -192,7 +192,7 @@ to_chat(user, span_alert("No active connected stations located.")) return - var/desc = input("Please select a station to lock in.", "Locking Computer") as null|anything in sortList(targets) + var/desc = input("Please select a station to lock in.", "Locking Computer") as null|anything in sort_list(targets) var/obj/machinery/teleport/station/target_station = targets[desc] if(!target_station || !target_station.teleporter_hub) return diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 1e0cdf6796f..bc1a10f3828 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1192,7 +1192,7 @@ return // reads from the airlock painter's `available paintjob` list. lets the player choose a paint option, or cancel painting - var/current_paintjob = input(user, "Please select a paintjob for this airlock.") as null|anything in sortList(painter.available_paint_jobs) + var/current_paintjob = input(user, "Please select a paintjob for this airlock.") as null|anything in sort_list(painter.available_paint_jobs) if(!current_paintjob) // if the user clicked cancel on the popup, return return diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 228dd562088..1c6eca676f9 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -295,7 +295,7 @@ Possible to do for anyone motivated enough: if(A) LAZYADD(callnames[A], I) callnames -= get_area(src) - var/result = tgui_input_list(usr, "Choose an area to call", "Holocall", sortNames(callnames)) + var/result = tgui_input_list(usr, "Choose an area to call", "Holocall", sort_names(callnames)) if(QDELETED(usr) || !result || outgoing_call) return if(usr.loc == loc) diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 72eac69633e..68609a2fdf5 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -576,7 +576,7 @@ GLOBAL_LIST_EMPTY(allCasters) for(var/datum/newscaster/feed_channel/F in GLOB.news_network.network_channels) if( (!F.locked || F.author == scanned_user) && !F.censored) available_channels += F.channel_name - channel_name = input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in sortList(available_channels) + channel_name = input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in sort_list(available_channels) updateUsrDialog() else if(href_list["set_new_message"]) var/temp_message = trim(stripped_multiline_input(usr, "Write your Feed story", "Network Channel Handler", msg)) diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index d0b105e3fea..b2a17826d24 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -19,7 +19,7 @@ return if(can_buckle && has_buckled_mobs()) if(buckled_mobs.len > 1) - var/unbuckled = input(user, "Who do you wish to unbuckle?","Unbuckle Who?") as null|mob in sortNames(buckled_mobs) + var/unbuckled = input(user, "Who do you wish to unbuckle?","Unbuckle Who?") as null|mob in sort_names(buckled_mobs) if(user_unbuckle_mob(unbuckled,user)) return TRUE else @@ -45,7 +45,7 @@ return if(Adjacent(user) && can_buckle && has_buckled_mobs()) if(buckled_mobs.len > 1) - var/unbuckled = input(user, "Who do you wish to unbuckle?","Unbuckle Who?") as null|mob in sortNames(buckled_mobs) + var/unbuckled = input(user, "Who do you wish to unbuckle?","Unbuckle Who?") as null|mob in sort_names(buckled_mobs) return user_unbuckle_mob(unbuckled,user) else return user_unbuckle_mob(buckled_mobs[1], user) diff --git a/code/game/objects/effects/spawners/random/random.dm b/code/game/objects/effects/spawners/random/random.dm index d4a381ec1b1..7104c698464 100644 --- a/code/game/objects/effects/spawners/random/random.dm +++ b/code/game/objects/effects/spawners/random/random.dm @@ -62,9 +62,9 @@ if(loot?.len) var/loot_spawned = 0 while((spawn_loot_count-loot_spawned) && loot.len) - var/lootspawn = pickweight(loot) + var/lootspawn = pick_weight(loot) while(islist(lootspawn)) - lootspawn = pickweight(lootspawn) + lootspawn = pick_weight(lootspawn) if(!spawn_loot_double) loot.Remove(lootspawn) if(lootspawn && (spawn_scatter_radius == 0 || spawn_locations.len)) @@ -139,7 +139,7 @@ stat_table[item] /= loot_count /obj/item/loot_table_maker/proc/pick_loot(lootpool) //selects path from loot table and returns it - var/lootspawn = pickweight(lootpool) + var/lootspawn = pick_weight(lootpool) while(islist(lootspawn)) - lootspawn = pickweight(lootspawn) + lootspawn = pick_weight(lootspawn) return lootspawn diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 6738bec0258..4f2fcd3152f 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -261,7 +261,7 @@ option.image = image(icon = initial(spider.icon), icon_state = initial(spider.icon_state)) option.info = span_boldnotice("[initial(spider.menu_description)]") display_spiders[initial(spider.name)] = option - sortList(display_spiders) + sort_list(display_spiders) var/chosen_spider = show_radial_menu(user, egg, display_spiders, radius = 38) chosen_spider = spider_list[chosen_spider] if(QDELETED(src) || QDELETED(user) || !chosen_spider) diff --git a/code/game/objects/items/cardboard_cutouts.dm b/code/game/objects/items/cardboard_cutouts.dm index 7b24ddd8922..f6d55bc64dc 100644 --- a/code/game/objects/items/cardboard_cutouts.dm +++ b/code/game/objects/items/cardboard_cutouts.dm @@ -15,7 +15,7 @@ /obj/item/cardboard_cutout/Initialize(mapload) . = ..() - possible_appearances = sortList(list( + possible_appearances = sort_list(list( "Assistant" = image(icon = src.icon, icon_state = "cutout_greytide"), "Clown" = image(icon = src.icon, icon_state = "cutout_clown"), "Mime" = image(icon = src.icon, icon_state = "cutout_mime"), diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index a4831f7585f..595c6b6106c 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -1271,7 +1271,7 @@ trim_list[fake_trim_name] = trim_path var/selected_trim_path - selected_trim_path = input("Select trim to apply to your card.\nNote: This will not grant any trim accesses.", "Forge Trim", selected_trim_path) as null|anything in sortList(trim_list, /proc/cmp_typepaths_asc) + selected_trim_path = input("Select trim to apply to your card.\nNote: This will not grant any trim accesses.", "Forge Trim", selected_trim_path) as null|anything in sort_list(trim_list, /proc/cmp_typepaths_asc) if(selected_trim_path) SSid_access.apply_trim_to_chameleon_card(src, trim_list[selected_trim_path]) diff --git a/code/game/objects/items/chromosome.dm b/code/game/objects/items/chromosome.dm index f5b693879bf..75646583d75 100644 --- a/code/game/objects/items/chromosome.dm +++ b/code/game/objects/items/chromosome.dm @@ -48,7 +48,7 @@ if(!initial(CM.weight)) break chromosomes[A] = initial(CM.weight) - return pickweight(chromosomes) + return pick_weight(chromosomes) /obj/item/chromosome/stabilizer diff --git a/code/game/objects/items/circuitboards/machine_circuitboards.dm b/code/game/objects/items/circuitboards/machine_circuitboards.dm index 8988f2d3922..92b9b30ded2 100644 --- a/code/game/objects/items/circuitboards/machine_circuitboards.dm +++ b/code/game/objects/items/circuitboards/machine_circuitboards.dm @@ -564,7 +564,7 @@ display_vending_names_paths = list() for(var/path in vending_names_paths) display_vending_names_paths[vending_names_paths[path]] = path - var/choice = input(user,"Choose a new brand","Select an Item") as null|anything in sortList(display_vending_names_paths) + var/choice = input(user,"Choose a new brand","Select an Item") as null|anything in sort_list(display_vending_names_paths) set_type(display_vending_names_paths[choice]) else return ..() diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index bc472e55b7b..73c526dab38 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -1215,7 +1215,7 @@ GLOBAL_LIST_EMPTY(PDAs) plist[avoid_assoc_duplicate_keys(pda.owner, namecounts)] = pda - var/choice = tgui_input_list(user, "Please select a PDA", "PDA Messenger", sortList(plist)) + var/choice = tgui_input_list(user, "Please select a PDA", "PDA Messenger", sort_list(plist)) if (!choice) return @@ -1264,7 +1264,7 @@ GLOBAL_LIST_EMPTY(PDAs) else sortmode = /proc/cmp_pdaname_asc - for(var/obj/item/pda/P in sortList(GLOB.PDAs, sortmode)) + for(var/obj/item/pda/P in sort_list(GLOB.PDAs, sortmode)) if(!P.owner || P.toff || P.hidden) continue . += P diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm index 132389f9c96..84427ac2bce 100644 --- a/code/game/objects/items/devices/PDA/cart.dm +++ b/code/game/objects/items/devices/PDA/cart.dm @@ -297,7 +297,7 @@ Code: if (44) //medical records //This thing only displays a single screen so it's hard to really get the sub-menu stuff working. menu = "

[PDAIMG(medical)] Medical Record List

" if(GLOB.data_core.general) - for(var/datum/data/record/R in sortRecord(GLOB.data_core.general)) + for(var/datum/data/record/R in sort_record(GLOB.data_core.general)) menu += "[R.fields["id"]]: [R.fields["name"]]
" menu += "
" if(441) @@ -340,7 +340,7 @@ Code: if (45) //security records menu = "

[PDAIMG(cuffs)] Security Record List

" if(GLOB.data_core.general) - for (var/datum/data/record/R in sortRecord(GLOB.data_core.general)) + for (var/datum/data/record/R in sort_record(GLOB.data_core.general)) menu += "
[R.fields["id"]]: [R.fields["name"]]
" menu += "
" @@ -530,7 +530,7 @@ Code: if(!emoji_table) var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/chat) var/list/collate = list("
") - for(var/emoji in sortList(icon_states(icon(EMOJI_SET)))) + for(var/emoji in sort_list(icon_states(icon(EMOJI_SET)))) var/tag = sheet.icon_tag("emoji-[emoji]") collate += "" collate += "
[emoji][tag]

" diff --git a/code/game/objects/items/devices/camera_bug.dm b/code/game/objects/items/devices/camera_bug.dm index f45a2c979f8..3fb71484f58 100644 --- a/code/game/objects/items/devices/camera_bug.dm +++ b/code/game/objects/items/devices/camera_bug.dm @@ -87,7 +87,7 @@ if(!camera_ref || !camera.c_tag) continue bugged_cameras[camera.c_tag] = camera_ref - return sortList(bugged_cameras) + return sort_list(bugged_cameras) /obj/item/camera_bug/proc/menu(list/cameras) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 1a24417dcde..c6834409a87 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -844,7 +844,7 @@ GENE SCANNER for(var/A in buffer) options += get_display_name(A) - var/answer = input(user, "Analyze Potential", "Sequence Analyzer") as null|anything in sortList(options) + var/answer = input(user, "Analyze Potential", "Sequence Analyzer") as null|anything in sort_list(options) if(answer && ready && user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) var/sequence for(var/A in buffer) //this physically hurts but i dont know what anything else short of an assoc list diff --git a/code/game/objects/items/grenades/ghettobomb.dm b/code/game/objects/items/grenades/ghettobomb.dm index 5d1861556a9..8cbc7197f7e 100644 --- a/code/game/objects/items/grenades/ghettobomb.dm +++ b/code/game/objects/items/grenades/ghettobomb.dm @@ -25,7 +25,7 @@ add_overlay("improvised_grenade_filled") add_overlay("improvised_grenade_wired") times = list("5" = 10, "-1" = 20, "[rand(30,80)]" = 50, "[rand(65,180)]" = 20)// "Premature, Dud, Short Fuse, Long Fuse"=[weighting value] - det_time = text2num(pickweight(times)) + det_time = text2num(pick_weight(times)) if(det_time < 0) //checking for 'duds' range = 1 det_time = rand(30,80) diff --git a/code/game/objects/items/mail.dm b/code/game/objects/items/mail.dm index 84fee270dac..ac041f9af8c 100644 --- a/code/game/objects/items/mail.dm +++ b/code/game/objects/items/mail.dm @@ -158,7 +158,7 @@ goodies += job_goodies for(var/iterator = 0, iterator < goodie_count, iterator++) - var/target_good = pickweight(goodies) + var/target_good = pick_weight(goodies) var/atom/movable/target_atom = new target_good(src) body.log_message("[key_name(body)] received [target_atom.name] in the mail ([target_good])", LOG_GAME) diff --git a/code/game/objects/items/pinpointer.dm b/code/game/objects/items/pinpointer.dm index c510baba7d2..fdce5aa358b 100644 --- a/code/game/objects/items/pinpointer.dm +++ b/code/game/objects/items/pinpointer.dm @@ -143,7 +143,7 @@ user.visible_message(span_notice("[user]'s pinpointer fails to detect a signal."), span_notice("Your pinpointer fails to detect a signal.")) return - var/A = input(user, "Person to track", "Pinpoint") in sortList(names) + var/A = input(user, "Person to track", "Pinpoint") in sort_list(names) if(!A || QDELETED(src) || !user || !user.is_holding(src) || user.incapacitated()) return diff --git a/code/game/objects/items/storage/boxes.dm b/code/game/objects/items/storage/boxes.dm index 73875e408bc..a6757805b24 100644 --- a/code/game/objects/items/storage/boxes.dm +++ b/code/game/objects/items/storage/boxes.dm @@ -929,7 +929,7 @@ /obj/item/storage/box/papersack/Initialize(mapload) . = ..() - papersack_designs = sortList(list( + papersack_designs = sort_list(list( "None" = image(icon = src.icon, icon_state = "paperbag_None"), "NanotrasenStandard" = image(icon = src.icon, icon_state = "paperbag_NanotrasenStandard"), "SyndiSnacks" = image(icon = src.icon, icon_state = "paperbag_SyndiSnacks"), diff --git a/code/game/objects/items/storage/uplink_kits.dm b/code/game/objects/items/storage/uplink_kits.dm index 3d962a3484b..90a67b1e751 100644 --- a/code/game/objects/items/storage/uplink_kits.dm +++ b/code/game/objects/items/storage/uplink_kits.dm @@ -23,7 +23,7 @@ /obj/item/storage/box/syndicate /obj/item/storage/box/syndicate/bundle_a/PopulateContents() - switch (pickweight(list( + switch (pick_weight(list( KIT_RECON = 2, KIT_BLOODY_SPAI = 3, KIT_STEALTHY = 2, @@ -153,7 +153,7 @@ new /obj/item/card/emag/doorjack(src) // 3 tc /obj/item/storage/box/syndicate/bundle_b/PopulateContents() - switch (pickweight(list( + switch (pick_weight(list( KIT_JAMES_BOND = 2, KIT_NINJA = 1, KIT_DARK_LORD = 1, diff --git a/code/game/objects/items/tcg/tcg.dm b/code/game/objects/items/tcg/tcg.dm index 4ceb054dd85..b6ffa4b3726 100644 --- a/code/game/objects/items/tcg/tcg.dm +++ b/code/game/objects/items/tcg/tcg.dm @@ -304,7 +304,7 @@ GLOBAL_LIST_EMPTY(tcgcard_radial_choices) /obj/item/tcgcard_deck/proc/flip_deck() flipped = !flipped var/list/temp_deck = contents.Copy() - contents = reverseRange(temp_deck) + contents = reverse_range(temp_deck) //Now flip the cards to their opposite positions. for(var/a in 1 to contents.len) var/obj/item/tcgcard/nu_card = contents[a] @@ -437,7 +437,7 @@ GLOBAL_LIST_EMPTY(tcgcard_radial_choices) weight += rarity_table[chance] var/random = rand(weight) for(var/bracket in rarity_table) - //Steals blatently from pickweight(), sorry buddy I need the index + //Steals blatently from pick_weight(), sorry buddy I need the index random -= rarity_table[bracket] if(random <= 0) rarity = bracket @@ -565,7 +565,7 @@ GLOBAL_LIST_EMPTY(tcgcard_radial_choices) totalCards++ cardsByCount[id] += 1 var/toSend = "Out of [totalCards] cards" - for(var/id in sortList(cardsByCount, /proc/cmp_num_string_asc)) + for(var/id in sort_list(cardsByCount, /proc/cmp_num_string_asc)) if(id) var/datum/card/template = GLOB.cached_cards[pack.series]["ALL"][id] toSend += "\nID:[id] [template.name] [(cardsByCount[id] * 100) / totalCards]% Total:[cardsByCount[id]]" diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 817db684579..28e71594bb0 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -1498,7 +1498,7 @@ pixel_x = rand(-5, 5) pixel_y = rand(-5, 5) icon_state = "shell[rand(1,3)]" - color = pickweight(possible_colors) + color = pick_weight(possible_colors) setDir(pick(GLOB.cardinals)) /obj/item/toy/brokenradio diff --git a/code/game/objects/items/wayfinding.dm b/code/game/objects/items/wayfinding.dm index e0255a3e741..4ba178cb8e7 100644 --- a/code/game/objects/items/wayfinding.dm +++ b/code/game/objects/items/wayfinding.dm @@ -262,7 +262,7 @@ to_chat(user, span_notice("Your pinpointer fails to detect a signal.")) return - var/A = input(user, "", "Pinpoint") as null|anything in sortList(beacons) + var/A = input(user, "", "Pinpoint") as null|anything in sort_list(beacons) if(!A || QDELETED(src) || !user || !user.is_holding(src) || user.incapacitated()) return diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index f37f04f5329..141b2300641 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -348,7 +348,7 @@ for(var/reskin_option in unique_reskin) var/image/item_image = image(icon = src.icon, icon_state = unique_reskin[reskin_option]) items += list("[reskin_option]" = item_image) - sortList(items) + sort_list(items) var/pick = show_radial_menu(M, src, items, custom_check = CALLBACK(src, .proc/check_reskin_menu, M), radius = 38, require_near = TRUE) if(!pick) diff --git a/code/game/objects/structures/barsigns.dm b/code/game/objects/structures/barsigns.dm index b3103a731be..e973e2af226 100644 --- a/code/game/objects/structures/barsigns.dm +++ b/code/game/objects/structures/barsigns.dm @@ -123,7 +123,7 @@ /obj/structure/sign/barsign/proc/pick_sign(mob/user) - var/picked_name = input(user, "Available Signage", "Bar Sign", name) as null|anything in sortList(get_bar_names()) + var/picked_name = input(user, "Available Signage", "Bar Sign", name) as null|anything in sort_list(get_bar_names()) if(!picked_name) return chosen_sign = set_sign_by_name(picked_name) diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index 6c4995dce7f..fc90c927439 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -268,7 +268,7 @@ LINEN BINS /obj/item/bedsheet/dorms/Initialize(mapload) ..() - var/type = pickweight(list("Colors" = 80, "Special" = 20)) + var/type = pick_weight(list("Colors" = 80, "Special" = 20)) switch(type) if("Colors") type = pick(list(/obj/item/bedsheet, diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index e7a2df063f1..ab332fc6ffa 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -234,7 +234,7 @@ for(var/atom/movable/AM in L) if(AM != src && insert(AM) == LOCKER_FULL) // limit reached break - for(var/i in reverseRange(L.get_all_contents())) + for(var/i in reverse_range(L.get_all_contents())) var/atom/movable/thing = i SEND_SIGNAL(thing, COMSIG_TRY_STORAGE_HIDE_ALL) diff --git a/code/game/objects/structures/crates_lockers/closets/utility_closets.dm b/code/game/objects/structures/crates_lockers/closets/utility_closets.dm index 3a80d848cbb..5090c7105e6 100644 --- a/code/game/objects/structures/crates_lockers/closets/utility_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/utility_closets.dm @@ -26,7 +26,7 @@ if (prob(40)) new /obj/item/storage/toolbox/emergency(src) - switch (pickweight(list("small" = 35, "aid" = 30, "tank" = 20, "both" = 10, "nothing" = 4, "delete" = 1))) + switch (pick_weight(list("small" = 35, "aid" = 30, "tank" = 20, "both" = 10, "nothing" = 4, "delete" = 1))) if ("small") new /obj/item/tank/internals/emergency_oxygen(src) new /obj/item/tank/internals/emergency_oxygen(src) diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm index f806e6bb7da..6ca31708e9d 100644 --- a/code/game/objects/structures/janicart.dm +++ b/code/game/objects/structures/janicart.dm @@ -115,7 +115,7 @@ if(!length(items)) return - items = sortList(items) + items = sort_list(items) var/pick = show_radial_menu(user, src, items, custom_check = CALLBACK(src, .proc/check_menu, user), radius = 38, require_near = TRUE) if(!pick) return diff --git a/code/game/objects/structures/maintenance.dm b/code/game/objects/structures/maintenance.dm index e4993a9eba0..8648da8c8e4 100644 --- a/code/game/objects/structures/maintenance.dm +++ b/code/game/objects/structures/maintenance.dm @@ -32,7 +32,7 @@ at the cost of risking a vicious bite.**/ if(prob(40)) critter_infested = FALSE if(prob(75)) - var/picked_item = pickweight(loot) + var/picked_item = pick_weight(loot) hidden_item = new picked_item(src) loot = null AddElement(/datum/element/swabable, CELL_LINE_TABLE_MOIST, CELL_VIRUS_TABLE_GENERIC, rand(2,4), 20) diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index abf40ae8087..20952433ec5 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -146,7 +146,7 @@ var/datum/species/S = speciestype if(initial(S.changesource_flags) & MIRROR_MAGIC) choosable_races += initial(S.id) - choosable_races = sortList(choosable_races) + choosable_races = sort_list(choosable_races) /obj/structure/mirror/magic/lesser/Initialize(mapload) choosable_races = get_selectable_species().Copy() diff --git a/code/game/objects/structures/signs/_signs.dm b/code/game/objects/structures/signs/_signs.dm index f83a3cf4857..31eb646808b 100644 --- a/code/game/objects/structures/signs/_signs.dm +++ b/code/game/objects/structures/signs/_signs.dm @@ -65,7 +65,7 @@ if(!initial(potential_sign.is_editable)) continue output[initial(potential_sign.sign_change_name)] = potential_sign - output = sortList(output) //Alphabetizes the results. + output = sort_list(output) //Alphabetizes the results. return output /obj/structure/sign/wrench_act(mob/living/user, obj/item/wrench/I) diff --git a/code/game/turfs/closed/minerals.dm b/code/game/turfs/closed/minerals.dm index 3a5903c4d47..f7561c7cc53 100644 --- a/code/game/turfs/closed/minerals.dm +++ b/code/game/turfs/closed/minerals.dm @@ -190,7 +190,7 @@ . = ..() if (prob(mineralChance)) - var/path = pickweight(mineralSpawnChanceList) + var/path = pick_weight(mineralSpawnChanceList) if(ispath(path, /turf)) var/stored_flags = 0 if(turf_flags & NO_RUINS) diff --git a/code/modules/NTNet/netdata.dm b/code/modules/NTNet/netdata.dm index 496df1562e0..3ba782ff96e 100644 --- a/code/modules/NTNet/netdata.dm +++ b/code/modules/NTNet/netdata.dm @@ -92,11 +92,11 @@ C.user = user C.next = null if(deep_copy) - C.data = deepCopyList(data) + C.data = deep_copy_list(data) else C.data = data return C - + /datum/netdata/proc/json_to_data(json) data = json_decode(json) diff --git a/code/modules/admin/admin_investigate.dm b/code/modules/admin/admin_investigate.dm index 9bd7304a622..101bcde8851 100644 --- a/code/modules/admin/admin_investigate.dm +++ b/code/modules/admin/admin_investigate.dm @@ -22,7 +22,7 @@ else logs_missing += "[subject] (empty)" - var/list/combined = sortList(logs_present) + sortList(logs_missing) + var/list/combined = sort_list(logs_present) + sort_list(logs_missing) var/selected = input("Investigate what?", "Investigate") as null|anything in combined diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 35a31c834de..4d8ae37ea17 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -606,7 +606,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) if(!SStrading_card_game.loaded) message_admins("The card subsystem is not currently loaded") return - var/pack = input("Which pack should we test?", "You fucked it didn't you") as null|anything in sortList(SStrading_card_game.card_packs) + var/pack = input("Which pack should we test?", "You fucked it didn't you") as null|anything in sort_list(SStrading_card_game.card_packs) var/batchCount = input("How many times should we open it?", "Don't worry, I understand") as null|num var/batchSize = input("How many cards per batch?", "I hope you remember to check the validation") as null|num var/guar = input("Should we use the pack's guaranteed rarity? If so, how many?", "We've all been there. Man you should have seen the old system") as null|num @@ -626,7 +626,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) var/type_length = length_char("/obj/effect/proc_holder/spell") + 2 for(var/spell in GLOB.spells) spell_list[copytext_char("[spell]", type_length)] = spell - var/spell_desc = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in sortList(spell_list) + var/spell_desc = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in sort_list(spell_list) if(!spell_desc) return @@ -663,7 +663,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) if(!length(target_spell_list)) return - var/obj/effect/proc_holder/spell/removed_spell = input("Choose the spell to remove", "NO ABRAKADABRA") as null|anything in sortList(target_spell_list) + var/obj/effect/proc_holder/spell/removed_spell = input("Choose the spell to remove", "NO ABRAKADABRA") as null|anything in sort_list(target_spell_list) if(removed_spell) removal_target.mind.RemoveSpell(removed_spell) log_admin("[key_name(usr)] removed the spell [removed_spell] from [key_name(removal_target)].") @@ -677,7 +677,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) if(!istype(T)) to_chat(src, span_notice("You can only give a disease to a mob of type /mob/living."), confidential = TRUE) return - var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in sortList(SSdisease.diseases, /proc/cmp_typepaths_asc) + var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in sort_list(SSdisease.diseases, /proc/cmp_typepaths_asc) if(!D) return T.ForceContractDisease(new D, FALSE, TRUE) diff --git a/code/modules/admin/create_object.dm b/code/modules/admin/create_object.dm index 00f642c7946..79640e37d41 100644 --- a/code/modules/admin/create_object.dm +++ b/code/modules/admin/create_object.dm @@ -19,7 +19,7 @@ /obj/item, /obj/item/clothing, /obj/item/stack, /obj/item, /obj/item/reagent_containers, /obj/item/gun) - var/path = input("Select the path of the object you wish to create.", "Path", /obj) in sortList(create_object_forms, /proc/cmp_typepaths_asc) + var/path = input("Select the path of the object you wish to create.", "Path", /obj) in sort_list(create_object_forms, /proc/cmp_typepaths_asc) var/html_form = create_object_forms[path] if (!html_form) diff --git a/code/modules/admin/smites/imaginary_friend_special.dm b/code/modules/admin/smites/imaginary_friend_special.dm index 5490a2ad108..6090dcab09d 100644 --- a/code/modules/admin/smites/imaginary_friend_special.dm +++ b/code/modules/admin/smites/imaginary_friend_special.dm @@ -14,7 +14,7 @@ var/random_appearance /datum/smite/custom_imaginary_friend/configure(client/user) - friend_candidate_client = tgui_input_list(user, "Pick the player to put in control.", "New Imaginary Friend", sortList(GLOB.clients)) + friend_candidate_client = tgui_input_list(user, "Pick the player to put in control.", "New Imaginary Friend", sort_list(GLOB.clients)) if(QDELETED(friend_candidate_client)) to_chat(user, span_notice("Selected player no longer has a client, aborting.")) diff --git a/code/modules/admin/stickyban.dm b/code/modules/admin/stickyban.dm index c7e42241905..537e0b92acb 100644 --- a/code/modules/admin/stickyban.dm +++ b/code/modules/admin/stickyban.dm @@ -403,7 +403,7 @@ if (SSstickyban.dbcacheexpire) return SSstickyban.dbcache.Copy() - return sortList(world.GetConfig("ban")) + return sort_list(world.GetConfig("ban")) /proc/get_stickyban_from_ckey(ckey) diff --git a/code/modules/admin/team_panel.dm b/code/modules/admin/team_panel.dm index b2a21b6f23f..54e469105b6 100644 --- a/code/modules/admin/team_panel.dm +++ b/code/modules/admin/team_panel.dm @@ -111,7 +111,7 @@ for(var/mob/M in GLOB.mob_list) if(M.mind) minds |= M.mind - var/datum/mind/value = input("Select new member:", "New team member", null) as null|anything in sortNames(minds) + var/datum/mind/value = input("Select new member:", "New team member", null) as null|anything in sort_names(minds) if (!value) return @@ -169,7 +169,7 @@ //This is here if you want admin created teams to tell each other apart easily. /datum/team/custom/proc/admin_force_hud(mob/user) var/list/possible_icons = icon_states('icons/mob/hud.dmi') - var/new_hud_state = input(user,"Choose hud icon state","Custom HUD","traitor") as null|anything in sortList(possible_icons) + var/new_hud_state = input(user,"Choose hud icon state","Custom HUD","traitor") as null|anything in sort_list(possible_icons) if(!new_hud_state) return //suppose could ask for color too diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 97892466aa6..f9a8466e0d8 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -476,7 +476,7 @@ for (var/rule in subtypesof(/datum/dynamic_ruleset/roundstart)) var/datum/dynamic_ruleset/roundstart/newrule = new rule() roundstart_rules[newrule.name] = newrule - var/added_rule = input(usr,"What ruleset do you want to force? This will bypass threat level and population restrictions.", "Rigging Roundstart", null) as null|anything in sortList(roundstart_rules) + var/added_rule = input(usr,"What ruleset do you want to force? This will bypass threat level and population restrictions.", "Rigging Roundstart", null) as null|anything in sort_list(roundstart_rules) if (added_rule) GLOB.dynamic_forced_roundstart_ruleset += roundstart_rules[added_rule] log_admin("[key_name(usr)] set [added_rule] to be a forced roundstart ruleset.") @@ -1432,7 +1432,7 @@ var/list/available_channels = list() for(var/datum/newscaster/feed_channel/F in GLOB.news_network.network_channels) available_channels += F.channel_name - src.admincaster_feed_channel.channel_name = adminscrub(input(usr, "Choose receiving Feed Channel.", "Network Channel Handler") in sortList(available_channels) ) + src.admincaster_feed_channel.channel_name = adminscrub(input(usr, "Choose receiving Feed Channel.", "Network Channel Handler") in sort_list(available_channels) ) src.access_news_network() else if(href_list["ac_set_new_message"]) diff --git a/code/modules/admin/verbs/SDQL2/SDQL_spells/spell_edit_menu.dm b/code/modules/admin/verbs/SDQL2/SDQL_spells/spell_edit_menu.dm index 00ffcfb82e6..07a959d323c 100644 --- a/code/modules/admin/verbs/SDQL2/SDQL_spells/spell_edit_menu.dm +++ b/code/modules/admin/verbs/SDQL2/SDQL_spells/spell_edit_menu.dm @@ -335,7 +335,7 @@ GLOBAL_LIST_INIT_TYPED(sdql_spells, /obj/effect/proc_holder/spell, list()) var/path = saved_vars[special_list_vars[params["list"]]] var/datum/sample = new path var/list/choosable_vars = map_var_list(sample.vars-list_vars[params["list"]], sample) - var/chosen_var = tgui_input_list(user, "Select variable to add.", "Add SDQL Spell", sortList(choosable_vars)) + var/chosen_var = tgui_input_list(user, "Select variable to add.", "Add SDQL Spell", sort_list(choosable_vars)) if(chosen_var) if(islist(sample.vars[choosable_vars[chosen_var]])) list_vars[params["list"]][choosable_vars[chosen_var]] = list("type" = "list", "value" = null, "flags" = LIST_VAR_FLAGS_TYPED|LIST_VAR_FLAGS_NAMED) @@ -425,7 +425,7 @@ GLOBAL_LIST_INIT_TYPED(sdql_spells, /obj/effect/proc_holder/spell, list()) //Change all references in the list vars, either to null (for saving) or to their string representation (for display) /datum/give_sdql_spell/proc/json_sanitize_list_vars(list/list_vars, mode = SANITIZE_NULLIFY) - var/list/temp_list_vars = deepCopyList(list_vars) + var/list/temp_list_vars = deep_copy_list(list_vars) for(var/V in temp_list_vars) var/list/L = temp_list_vars[V] for(var/W in L) diff --git a/code/modules/admin/verbs/admin.dm b/code/modules/admin/verbs/admin.dm index 6a7d45f6f18..bbcc7a5de23 100644 --- a/code/modules/admin/verbs/admin.dm +++ b/code/modules/admin/verbs/admin.dm @@ -65,7 +65,7 @@ var/list/msg = list() msg += "Playtime ReportPlaytime:
" @@ -140,7 +140,7 @@ var/name = GLOB.trait_name_map[trait] || trait available_traits[name] = trait - var/chosen_trait = input("Select trait to modify", "Trait") as null|anything in sortList(available_traits) + var/chosen_trait = input("Select trait to modify", "Trait") as null|anything in sort_list(available_traits) if(!chosen_trait) return chosen_trait = available_traits[chosen_trait] @@ -159,7 +159,7 @@ if("All") source = null if("Specific") - source = input("Source to be removed","Trait Remove/Add") as null|anything in sortList(D.status_traits[chosen_trait]) + source = input("Source to be removed","Trait Remove/Add") as null|anything in sort_list(D.status_traits[chosen_trait]) if(!source) return REMOVE_TRAIT(D,chosen_trait,source) diff --git a/code/modules/admin/verbs/adminevents.dm b/code/modules/admin/verbs/adminevents.dm index c67d81cd161..45d3ec0f00f 100644 --- a/code/modules/admin/verbs/adminevents.dm +++ b/code/modules/admin/verbs/adminevents.dm @@ -491,7 +491,7 @@ if(!holder) return - var/weather_type = input("Choose a weather", "Weather") as null|anything in sortList(subtypesof(/datum/weather), /proc/cmp_typepaths_asc) + var/weather_type = input("Choose a weather", "Weather") as null|anything in sort_list(subtypesof(/datum/weather), /proc/cmp_typepaths_asc) if(!weather_type) return diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index cb843524246..3624e1baf78 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -84,7 +84,7 @@ var/list/keys = list() for(var/mob/M in GLOB.player_list) keys += M.client - var/client/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in sortKey(keys) + var/client/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in sort_key(keys) if(!selection) to_chat(src, "No keys found.", confidential = TRUE) return @@ -137,7 +137,7 @@ var/list/keys = list() for(var/mob/M in GLOB.player_list) keys += M.client - var/client/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in sortKey(keys) + var/client/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in sort_key(keys) if(!selection) return var/mob/M = selection.mob diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 67cee2e72eb..b3b2fbcc64a 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -36,7 +36,7 @@ targets["[client.mob.real_name](as [client.mob.name]) - [client]"] = client else targets["(No Mob) - [client]"] = client - var/target = input(src,"To whom shall we send a message?","Admin PM",null) as null|anything in sortList(targets) + var/target = input(src,"To whom shall we send a message?","Admin PM",null) as null|anything in sort_list(targets) cmd_admin_pm(targets[target],null) SSblackbox.record_feedback("tally", "admin_verb", 1, "Admin PM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/borgpanel.dm b/code/modules/admin/verbs/borgpanel.dm index 50a50aaa382..caf5b9b6ef8 100644 --- a/code/modules/admin/verbs/borgpanel.dm +++ b/code/modules/admin/verbs/borgpanel.dm @@ -7,7 +7,7 @@ return if (!istype(borgo, /mob/living/silicon/robot)) - borgo = input("Select a borg", "Select a borg", null, null) as null|anything in sortNames(GLOB.silicon_mobs) + borgo = input("Select a borg", "Select a borg", null, null) as null|anything in sort_names(GLOB.silicon_mobs) if (!istype(borgo, /mob/living/silicon/robot)) to_chat(usr, span_warning("Borg is required for borgpanel"), confidential = TRUE) diff --git a/code/modules/admin/verbs/cinematic.dm b/code/modules/admin/verbs/cinematic.dm index 2293f63896a..2cb8d1a0f04 100644 --- a/code/modules/admin/verbs/cinematic.dm +++ b/code/modules/admin/verbs/cinematic.dm @@ -6,6 +6,6 @@ if(!SSticker) return - var/datum/cinematic/choice = input(src,"Cinematic","Choose",null) as null|anything in sortList(subtypesof(/datum/cinematic), /proc/cmp_typepaths_asc) + var/datum/cinematic/choice = input(src,"Cinematic","Choose",null) as null|anything in sort_list(subtypesof(/datum/cinematic), /proc/cmp_typepaths_asc) if(choice) Cinematic(initial(choice.id),world,null) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 136ae48827d..d65e9620324 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -96,7 +96,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that for(var/mob/C in GLOB.mob_list) if(C.key) available.Add(C) - var/mob/choice = tgui_input_list(usr, "Choose a player to play the pAI", "Spawn pAI", sortNames(available)) + var/mob/choice = tgui_input_list(usr, "Choose a player to play the pAI", "Spawn pAI", sort_names(available)) if(!choice) return if(!isobserver(choice)) @@ -162,7 +162,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that if(matches.len==0) return - var/hsbitem = input(usr, "Choose an object to delete.", "Delete:") as null|anything in sortList(matches) + var/hsbitem = input(usr, "Choose an object to delete.", "Delete:") as null|anything in sort_list(matches) if(hsbitem) hsbitem = matches[hsbitem] var/counter = 0 @@ -259,7 +259,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that if(M.ckey) if(tgui_alert(usr,"This mob is being controlled by [M.key]. Are you sure you wish to give someone else control of it? [M.key] will be made a ghost.",,list("Yes","No")) != "Yes") return - var/client/newkey = input(src, "Pick the player to put in control.", "New player") as null|anything in sortList(GLOB.clients) + var/client/newkey = input(src, "Pick the player to put in control.", "New player") as null|anything in sort_list(GLOB.clients) var/mob/oldmob = newkey.mob var/delmob = FALSE if((isobserver(oldmob) || tgui_alert(usr,"Do you want to delete [newkey]'s old mob?","Delete?",list("Yes","No")) != "No")) @@ -505,7 +505,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that var/datum/outfit/O = path //not much to initalize here but whatever outfits[initial(O.name)] = path - var/dresscode = input("Select outfit", "Robust quick dress shop") as null|anything in baseoutfits + sortList(outfits) + var/dresscode = input("Select outfit", "Robust quick dress shop") as null|anything in baseoutfits + sort_list(outfits) if (isnull(dresscode)) return @@ -519,7 +519,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that var/datum/outfit/O = path job_outfits[initial(O.name)] = path - dresscode = input("Select job equipment", "Robust quick dress shop") as null|anything in sortList(job_outfits) + dresscode = input("Select job equipment", "Robust quick dress shop") as null|anything in sort_list(job_outfits) dresscode = job_outfits[dresscode] if(isnull(dresscode)) return @@ -531,7 +531,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that var/datum/outfit/O = path plasmaman_outfits[initial(O.name)] = path - dresscode = input("Select plasmeme equipment", "Robust quick dress shop") as null|anything in sortList(plasmaman_outfits) + dresscode = input("Select plasmeme equipment", "Robust quick dress shop") as null|anything in sort_list(plasmaman_outfits) dresscode = plasmaman_outfits[dresscode] if(isnull(dresscode)) return @@ -540,7 +540,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that var/list/custom_names = list() for(var/datum/outfit/D in GLOB.custom_outfits) custom_names[D.name] = D - var/selected_name = input("Select outfit", "Robust quick dress shop") as null|anything in sortList(custom_names) + var/selected_name = input("Select outfit", "Robust quick dress shop") as null|anything in sort_list(custom_names) dresscode = custom_names[selected_name] if(isnull(dresscode)) return @@ -700,7 +700,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that names[name] = ruin_landmark - var/ruinname = input("Select ruin", "Jump to Ruin") as null|anything in sortList(names) + var/ruinname = input("Select ruin", "Jump to Ruin") as null|anything in sort_list(names) var/obj/effect/landmark/ruin/landmark = names[ruinname] @@ -737,7 +737,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that for(var/name in SSmapping.ice_ruins_underground_templates) names[name] = list(SSmapping.ice_ruins_underground_templates[name], ZTRAIT_ICE_RUINS_UNDERGROUND, list(/area/icemoon/underground/unexplored)) - var/ruinname = input("Select ruin", "Spawn Ruin") as null|anything in sortList(names) + var/ruinname = input("Select ruin", "Spawn Ruin") as null|anything in sort_list(names) var/data = names[ruinname] if (!data) return diff --git a/code/modules/admin/verbs/ert.dm b/code/modules/admin/verbs/ert.dm index 0a9af6c3fbd..0da192c53a7 100644 --- a/code/modules/admin/verbs/ert.dm +++ b/code/modules/admin/verbs/ert.dm @@ -157,7 +157,7 @@ var/mob/dead/observer/potential_leader = i candidate_living_exps[potential_leader] = potential_leader.client?.get_exp_living(TRUE) - candidate_living_exps = sortList(candidate_living_exps, cmp=/proc/cmp_numeric_dsc) + candidate_living_exps = sort_list(candidate_living_exps, cmp=/proc/cmp_numeric_dsc) if(candidate_living_exps.len > ERT_EXPERIENCED_LEADER_CHOOSE_TOP) candidate_living_exps = candidate_living_exps.Cut(ERT_EXPERIENCED_LEADER_CHOOSE_TOP+1) // pick from the top ERT_EXPERIENCED_LEADER_CHOOSE_TOP contenders in playtime earmarked_leader = pick(candidate_living_exps) diff --git a/code/modules/admin/verbs/hiddenprints.dm b/code/modules/admin/verbs/hiddenprints.dm index dc0d5776655..2d87e404498 100644 --- a/code/modules/admin/verbs/hiddenprints.dm +++ b/code/modules/admin/verbs/hiddenprints.dm @@ -9,12 +9,12 @@ victim_hiddenprints = list() var/list/hiddenprints = flatten_list(victim_hiddenprints) - removeNullsFromList(hiddenprints) + remove_nulls_from_list(hiddenprints) if(!length(hiddenprints)) hiddenprints = list("Nobody has touched this yet!") - hiddenprints = sortList(hiddenprints, /proc/cmp_hiddenprint_lasttime_dsc) + hiddenprints = sort_list(hiddenprints, /proc/cmp_hiddenprint_lasttime_dsc) for(var/record in hiddenprints) interface += "
  • [record]

  • " diff --git a/code/modules/admin/verbs/map_template_loadverb.dm b/code/modules/admin/verbs/map_template_loadverb.dm index 11a9911a1c7..3832dae0c7e 100644 --- a/code/modules/admin/verbs/map_template_loadverb.dm +++ b/code/modules/admin/verbs/map_template_loadverb.dm @@ -4,7 +4,7 @@ var/datum/map_template/template - var/map = input(src, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template") as null|anything in sortList(SSmapping.map_templates) + var/map = input(src, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template") as null|anything in sort_list(SSmapping.map_templates) if(!map) return template = SSmapping.map_templates[map] diff --git a/code/modules/admin/verbs/maprotation.dm b/code/modules/admin/verbs/maprotation.dm index 57b5c111da6..c02d1df70a7 100644 --- a/code/modules/admin/verbs/maprotation.dm +++ b/code/modules/admin/verbs/maprotation.dm @@ -32,7 +32,7 @@ mapname += "\]" maprotatechoices[mapname] = VM - var/chosenmap = tgui_input_list(usr, "Choose a map to change to", "Change Map", sortList(maprotatechoices)|"Custom") + var/chosenmap = tgui_input_list(usr, "Choose a map to change to", "Change Map", sort_list(maprotatechoices)|"Custom") if (!chosenmap) return diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index b8c5dbbb704..48d942ca3c2 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -57,7 +57,7 @@ return if(!M) - M = input(usr, "Choose a mob to play the sound to. Only they will hear it.", "Play Mob Sound") as null|anything in sortNames(GLOB.player_list) + M = input(usr, "Choose a mob to play the sound to. Only they will hear it.", "Play Mob Sound") as null|anything in sort_names(GLOB.player_list) if(!M || QDELETED(M)) return log_admin("[key_name(src)] played a direct mob sound [S] to [M].") diff --git a/code/modules/admin/verbs/secrets.dm b/code/modules/admin/verbs/secrets.dm index 8d709cd8d01..9d75497f56f 100644 --- a/code/modules/admin/verbs/secrets.dm +++ b/code/modules/admin/verbs/secrets.dm @@ -222,7 +222,7 @@ GLOBAL_DATUM(everyone_a_traitor, /datum/everyone_is_a_traitor_controller) var/datum/round_event_control/disease_outbreak/DC = locate(/datum/round_event_control/disease_outbreak) in SSevents.control E = DC.runEvent() if("Choose") - var/virus = input("Choose the virus to spread", "BIOHAZARD") as null|anything in sortList(typesof(/datum/disease), /proc/cmp_typepaths_asc) + var/virus = input("Choose the virus to spread", "BIOHAZARD") as null|anything in sort_list(typesof(/datum/disease), /proc/cmp_typepaths_asc) var/datum/round_event_control/disease_outbreak/DC = locate(/datum/round_event_control/disease_outbreak) in SSevents.control var/datum/round_event/disease_outbreak/DO = DC.runEvent() DO.virus_type = virus diff --git a/code/modules/admin/view_variables/mass_edit_variables.dm b/code/modules/admin/view_variables/mass_edit_variables.dm index 138dd573379..02acca95496 100644 --- a/code/modules/admin/view_variables/mass_edit_variables.dm +++ b/code/modules/admin/view_variables/mass_edit_variables.dm @@ -29,7 +29,7 @@ for (var/V in O.vars) names += V - names = sortList(names) + names = sort_list(names) variable = input("Which var?", "Var") as null|anything in names else diff --git a/code/modules/admin/view_variables/modify_variables.dm b/code/modules/admin/view_variables/modify_variables.dm index b97a76ef064..045fbfc4261 100644 --- a/code/modules/admin/view_variables/modify_variables.dm +++ b/code/modules/admin/view_variables/modify_variables.dm @@ -142,7 +142,7 @@ GLOBAL_PROTECT(VVpixelmovement) if(variable == "(CLEAR NULLS)") L = L.Copy() - listclearnulls(L) + list_clear_nulls(L) if (!O.vv_edit_var(objectvar, L)) to_chat(src, "Your edit was rejected by the object.", confidential = TRUE) return @@ -152,7 +152,7 @@ GLOBAL_PROTECT(VVpixelmovement) return if(variable == "(CLEAR DUPES)") - L = uniqueList(L) + L = unique_list(L) if (!O.vv_edit_var(objectvar, L)) to_chat(src, "Your edit was rejected by the object.", confidential = TRUE) return @@ -306,7 +306,7 @@ GLOBAL_PROTECT(VVpixelmovement) for (var/V in O.vars) names += V - names = sortList(names) + names = sort_list(names) variable = input("Which var?","Var") as null|anything in names if(!variable) diff --git a/code/modules/admin/view_variables/topic_basic.dm b/code/modules/admin/view_variables/topic_basic.dm index 5753db26a10..141310f9fd3 100644 --- a/code/modules/admin/view_variables/topic_basic.dm +++ b/code/modules/admin/view_variables/topic_basic.dm @@ -54,11 +54,11 @@ if(!check_rights(NONE)) return var/list/names = list() - var/list/componentsubtypes = sortList(subtypesof(/datum/component), /proc/cmp_typepaths_asc) + var/list/componentsubtypes = sort_list(subtypesof(/datum/component), /proc/cmp_typepaths_asc) names += "---Components---" names += componentsubtypes names += "---Elements---" - names += sortList(subtypesof(/datum/element), /proc/cmp_typepaths_asc) + names += sort_list(subtypesof(/datum/element), /proc/cmp_typepaths_asc) var/result = tgui_input_list(usr, "Choose a component/element to add", "Add Component", names) if(!usr || !result || result == "---Components---" || result == "---Elements---") return @@ -93,10 +93,10 @@ var/list/names = list() names += "---Components---" if(length(components)) - names += sortList(components, /proc/cmp_typepaths_asc) + names += sort_list(components, /proc/cmp_typepaths_asc) names += "---Elements---" // We have to list every element here because there is no way to know what element is on this object without doing some sort of hack. - names += sortList(subtypesof(/datum/element), /proc/cmp_typepaths_asc) + names += sort_list(subtypesof(/datum/element), /proc/cmp_typepaths_asc) var/path = tgui_input_list(usr, "Choose a component/element to remove. All elements listed here may not be on the datum.", "Remove element", names) if(!usr || !path || path == "---Components---" || path == "---Elements---") return diff --git a/code/modules/admin/view_variables/topic_list.dm b/code/modules/admin/view_variables/topic_list.dm index c5dece8139f..21b534d3d4e 100644 --- a/code/modules/admin/view_variables/topic_list.dm +++ b/code/modules/admin/view_variables/topic_list.dm @@ -19,12 +19,12 @@ if(href_list[VV_HK_LIST_ADD]) mod_list_add(target, null, "list", "contents") if(href_list[VV_HK_LIST_ERASE_DUPES]) - uniqueList_inplace(target) + unique_list_in_place(target) log_world("### ListVarEdit by [src]: /list contents: CLEAR DUPES") log_admin("[key_name(src)] modified list's contents: CLEAR DUPES") message_admins("[key_name_admin(src)] modified list's contents: CLEAR DUPES") if(href_list[VV_HK_LIST_ERASE_NULLS]) - listclearnulls(target) + list_clear_nulls(target) log_world("### ListVarEdit by [src]: /list contents: CLEAR NULLS") log_admin("[key_name(src)] modified list's contents: CLEAR NULLS") message_admins("[key_name_admin(src)] modified list's contents: CLEAR NULLS") diff --git a/code/modules/admin/view_variables/view_variables.dm b/code/modules/admin/view_variables/view_variables.dm index 32ea4c497b0..8e056d97b26 100644 --- a/code/modules/admin/view_variables/view_variables.dm +++ b/code/modules/admin/view_variables/view_variables.dm @@ -87,7 +87,7 @@ value = L[key] variable_html += debug_variable(i, value, 0, L) else - names = sortList(names) + names = sort_list(names) for(var/V in names) if(D.can_vv_get(V)) variable_html += D.vv_get_var(V) diff --git a/code/modules/antagonists/brother/brother.dm b/code/modules/antagonists/brother/brother.dm index bbadfa70b90..8571edb6bec 100644 --- a/code/modules/antagonists/brother/brother.dm +++ b/code/modules/antagonists/brother/brother.dm @@ -107,7 +107,7 @@ continue candidates[L.mind.name] = L.mind - var/choice = input(admin,"Choose the blood brother.", "Brother") as null|anything in sortNames(candidates) + var/choice = input(admin,"Choose the blood brother.", "Brother") as null|anything in sort_names(candidates) if(!choice) return var/datum/mind/bro = candidates[choice] diff --git a/code/modules/antagonists/changeling/powers/absorb.dm b/code/modules/antagonists/changeling/powers/absorb.dm index 95a79be8897..dc7b63ad4af 100644 --- a/code/modules/antagonists/changeling/powers/absorb.dm +++ b/code/modules/antagonists/changeling/powers/absorb.dm @@ -101,7 +101,7 @@ if(nlog_type & LOG_SAY) var/list/reversed = log_source[log_type] if(islist(reversed)) - say_log = reverseRange(reversed.Copy()) + say_log = reverse_range(reversed.Copy()) break if(LAZYLEN(say_log) > LING_ABSORB_RECENT_SPEECH) diff --git a/code/modules/antagonists/changeling/powers/humanform.dm b/code/modules/antagonists/changeling/powers/humanform.dm index 422df7dff1e..a42277706b4 100644 --- a/code/modules/antagonists/changeling/powers/humanform.dm +++ b/code/modules/antagonists/changeling/powers/humanform.dm @@ -15,7 +15,7 @@ for(var/datum/changelingprofile/prof in changeling.stored_profiles) names += "[prof.name]" - var/chosen_name = input("Select the target DNA: ", "Target DNA", null) as null|anything in sortList(names) + var/chosen_name = input("Select the target DNA: ", "Target DNA", null) as null|anything in sort_list(names) if(!chosen_name) return diff --git a/code/modules/antagonists/changeling/powers/pheromone_receptors.dm b/code/modules/antagonists/changeling/powers/pheromone_receptors.dm index 3b73e880195..57140472fc8 100644 --- a/code/modules/antagonists/changeling/powers/pheromone_receptors.dm +++ b/code/modules/antagonists/changeling/powers/pheromone_receptors.dm @@ -48,7 +48,7 @@ changelings[C] = (CHANGELING_PHEROMONE_MAX_DISTANCE ** 2) - (distance ** 2) if(changelings.len) - scan_target = pickweight(changelings) //Point at a 'random' changeling, biasing heavily towards closer ones. + scan_target = pick_weight(changelings) //Point at a 'random' changeling, biasing heavily towards closer ones. else scan_target = null diff --git a/code/modules/antagonists/cult/cult.dm b/code/modules/antagonists/cult/cult.dm index 7e10352f678..43db3103326 100644 --- a/code/modules/antagonists/cult/cult.dm +++ b/code/modules/antagonists/cult/cult.dm @@ -336,7 +336,7 @@ for(var/mob/living/carbon/human/player in GLOB.player_list) if(player.mind && !player.mind.has_antag_datum(/datum/antagonist/cult) && player.stat != DEAD) target_candidates += player.mind - listclearnulls(target_candidates) + list_clear_nulls(target_candidates) if(LAZYLEN(target_candidates)) target = pick(target_candidates) update_explanation_text() diff --git a/code/modules/antagonists/eldritch_cult/eldritch_effects.dm b/code/modules/antagonists/eldritch_cult/eldritch_effects.dm index 230ebf3910f..68fcb51f5b8 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_effects.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_effects.dm @@ -134,7 +134,7 @@ */ /datum/reality_smash_tracker/proc/ReworkNetwork() SIGNAL_HANDLER - listclearnulls(smashes) + list_clear_nulls(smashes) for(var/mind in targets) if(isnull(mind)) stack_trace("A null somehow landed in a list of minds") diff --git a/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm b/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm index 4167b50d84f..1e32a5610ff 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm @@ -146,7 +146,7 @@ fingerprints = list() for(var/atom/requirements as anything in atoms) fingerprints |= requirements.return_fingerprints() - listclearnulls(fingerprints) + list_clear_nulls(fingerprints) if(fingerprints.len == 0) return FALSE return TRUE @@ -164,7 +164,7 @@ to_chat(user, span_warning("These items don't possess the required fingerprints or DNA.")) return FALSE - var/chosen_mob = input("Select the person you wish to curse","Your target") as null|anything in sortList(compiled_list, /proc/cmp_mob_realname_dsc) + var/chosen_mob = input("Select the person you wish to curse","Your target") as null|anything in sort_list(compiled_list, /proc/cmp_mob_realname_dsc) if(!chosen_mob) return FALSE curse(compiled_list[chosen_mob]) diff --git a/code/modules/antagonists/wizard/equipment/artefact.dm b/code/modules/antagonists/wizard/equipment/artefact.dm index 88674d533ac..e6c4bce220e 100644 --- a/code/modules/antagonists/wizard/equipment/artefact.dm +++ b/code/modules/antagonists/wizard/equipment/artefact.dm @@ -272,7 +272,7 @@ H.dust(TRUE) spooky_scaries.Remove(X) continue - listclearnulls(spooky_scaries) + list_clear_nulls(spooky_scaries) //Funny gimmick, skeletons always seem to wear roman/ancient armour /obj/item/necromantic_stone/proc/equip_roman_skeleton(mob/living/carbon/human/H) diff --git a/code/modules/aquarium/fish.dm b/code/modules/aquarium/fish.dm index 523a9fdb50e..216f252c201 100644 --- a/code/modules/aquarium/fish.dm +++ b/code/modules/aquarium/fish.dm @@ -37,7 +37,7 @@ if(initial(fish_behavior.available_in_random_cases) || !case_fish_only) chance_table[fish_behavior] = initial(fish_behavior.random_case_rarity) probability_table[argkey] = chance_table - return pickweight(probability_table[argkey]) + return pick_weight(probability_table[argkey]) // Actual fish definitions below - there's no specific paths, they are autogenerated from behaviours diff --git a/code/modules/asset_cache/asset_list.dm b/code/modules/asset_cache/asset_list.dm index cda297edc8b..4f4bb65e27b 100644 --- a/code/modules/asset_cache/asset_list.dm +++ b/code/modules/asset_cache/asset_list.dm @@ -334,7 +334,7 @@ GLOBAL_LIST_EMPTY(asset_datums) if (legacy) assets |= parents var/list/hashlist = list() - var/list/sorted_assets = sortList(assets) + var/list/sorted_assets = sort_list(assets) for (var/asset_name in sorted_assets) var/datum/asset_cache_item/ACI = new(asset_name, sorted_assets[asset_name]) diff --git a/code/modules/atmospherics/machinery/datum_pipeline.dm b/code/modules/atmospherics/machinery/datum_pipeline.dm index ba07fecae81..232f96d9470 100644 --- a/code/modules/atmospherics/machinery/datum_pipeline.dm +++ b/code/modules/atmospherics/machinery/datum_pipeline.dm @@ -218,7 +218,7 @@ . = other_airs + air if(null in .) stack_trace("[src] has one or more null gas mixtures, which may cause bugs. Null mixtures will not be considered in reconcile_air().") - return removeNullsFromList(.) + return remove_nulls_from_list(.) /// Called when the pipenet needs to update and mix together all the air mixes /datum/pipeline/proc/reconcile_air() diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index 223dcc19af1..fc19b2ce65d 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -9,7 +9,7 @@ GLOBAL_LIST_INIT(gas_id_to_canister, init_gas_id_to_canister()) /proc/init_gas_id_to_canister() - return sortList(list( + return sort_list(list( "n2" = /obj/machinery/portable_atmospherics/canister/nitrogen, "o2" = /obj/machinery/portable_atmospherics/canister/oxygen, "co2" = /obj/machinery/portable_atmospherics/canister/carbon_dioxide, diff --git a/code/modules/awaymissions/mission_code/wildwest.dm b/code/modules/awaymissions/mission_code/wildwest.dm index 055543e0d12..5f7f1892bd6 100644 --- a/code/modules/awaymissions/mission_code/wildwest.dm +++ b/code/modules/awaymissions/mission_code/wildwest.dm @@ -88,7 +88,7 @@ else chargesa-- insistinga = 0 - var/wish = input("You want...","Wish") as null|anything in sortList(list("Power","Wealth","Immortality","Peace")) + var/wish = input("You want...","Wish") as null|anything in sort_list(list("Power","Wealth","Immortality","Peace")) switch(wish) if("Power") to_chat(user, "Your wish is granted, but at a terrible cost...") diff --git a/code/modules/capture_the_flag/ctf_classes.dm b/code/modules/capture_the_flag/ctf_classes.dm index 05a674dc039..b63fe79ca8f 100644 --- a/code/modules/capture_the_flag/ctf_classes.dm +++ b/code/modules/capture_the_flag/ctf_classes.dm @@ -47,7 +47,7 @@ // Make items in the hands NODROP for(var/obj/item/held_item in human_to_equip.held_items) no_drops += held_item - listclearnulls(no_drops) // For any slots we didn't have filled + list_clear_nulls(no_drops) // For any slots we didn't have filled // Apply TRAIT_NODROP to everything for(var/obj/item/item_to_nodrop as anything in no_drops) ADD_TRAIT(item_to_nodrop, TRAIT_NODROP, CAPTURE_THE_FLAG_TRAIT) diff --git a/code/modules/capture_the_flag/ctf_game.dm b/code/modules/capture_the_flag/ctf_game.dm index 5b2e31cef0a..f71f45dc598 100644 --- a/code/modules/capture_the_flag/ctf_game.dm +++ b/code/modules/capture_the_flag/ctf_game.dm @@ -380,7 +380,7 @@ option.info = "[initial(class.class_description)]" display_classes[key] = option - sortList(display_classes) + sort_list(display_classes) var/choice = show_radial_menu(new_team_member.mob, src, display_classes, radius = 38) if(!choice || !(GLOB.ghost_role_flags & GHOSTROLE_MINIGAME) || (new_team_member.ckey in recently_dead_ckeys) || !isobserver(new_team_member.mob) || src.ctf_enabled == FALSE || !(new_team_member.ckey in src.team_members)) return //picked nothing, admin disabled it, cheating to respawn faster, cheating to respawn... while in game?, diff --git a/code/modules/cargo/centcom_podlauncher.dm b/code/modules/cargo/centcom_podlauncher.dm index df07b6c1828..8597f8ea197 100644 --- a/code/modules/cargo/centcom_podlauncher.dm +++ b/code/modules/cargo/centcom_podlauncher.dm @@ -346,7 +346,7 @@ if (temp_pod.effectShrapnel == TRUE) //If already doing custom damage, set back to default (no shrapnel) temp_pod.effectShrapnel = FALSE return - var/shrapnelInput = input("Please enter the type of pellet cloud you'd like to create on landing (Can be any projectile!)", "Projectile Typepath", 0) in sortList(subtypesof(/obj/projectile), /proc/cmp_typepaths_asc) + var/shrapnelInput = input("Please enter the type of pellet cloud you'd like to create on landing (Can be any projectile!)", "Projectile Typepath", 0) in sort_list(subtypesof(/obj/projectile), /proc/cmp_typepaths_asc) if (isnull(shrapnelInput)) return var/shrapnelMagnitude = input("Enter the magnitude of the pellet cloud. This is usually a value around 1-5. Please note that Ryll-Ryll has asked me to tell you that if you go too crazy with the projectiles you might crash the server. So uh, be gentle!", "Shrapnel Magnitude", 0) as null|num diff --git a/code/modules/cargo/coupon.dm b/code/modules/cargo/coupon.dm index f7edf5702fe..dba06acb96f 100644 --- a/code/modules/cargo/coupon.dm +++ b/code/modules/cargo/coupon.dm @@ -18,7 +18,7 @@ if(rig_omen) discount_pct_off = COUPON_OMEN else - discount_pct_off = pickweight(chances) + discount_pct_off = pick_weight(chances) if(discount_pct_off == COUPON_OMEN) name = "coupon - fuck you" desc = "The small text reads, 'You will be slaughtered'... That doesn't sound right, does it?" diff --git a/code/modules/cargo/exports.dm b/code/modules/cargo/exports.dm index b6900c38fca..5d4a95740d3 100644 --- a/code/modules/cargo/exports.dm +++ b/code/modules/cargo/exports.dm @@ -41,7 +41,7 @@ Then the player gets the profit from selling his own wasted time. report = new // We go backwards, so it'll be innermost objects sold first - for(var/i in reverseRange(contents)) + for(var/i in reverse_range(contents)) var/atom/movable/thing = i var/sold = FALSE if(QDELETED(thing)) diff --git a/code/modules/cargo/packs.dm b/code/modules/cargo/packs.dm index 17a62086118..b71dc0d10e5 100644 --- a/code/modules/cargo/packs.dm +++ b/code/modules/cargo/packs.dm @@ -1902,7 +1902,7 @@ continue //here we randomly replace our pizzas for a chance at the full range - var/obj/item/food/pizza/replacement_type = pickweight(pizza_types) + var/obj/item/food/pizza/replacement_type = pick_weight(pizza_types) pizza_types -= replacement_type if(replacement_type && !istype(P.pizza, replacement_type)) QDEL_NULL(P.pizza) @@ -2370,7 +2370,7 @@ var/the_toy for(var/i in 1 to num_contained) if(prob(50)) - the_toy = pickweight(GLOB.arcade_prize_pool) + the_toy = pick_weight(GLOB.arcade_prize_pool) else the_toy = pick(subtypesof(/obj/item/toy/plush)) new the_toy(C) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 453b1bacdb3..c818a8d9715 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -104,7 +104,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) max_save_slots = 8 // give them default keybinds and update their movement keys - key_bindings = deepCopyList(GLOB.default_hotkeys) + key_bindings = deep_copy_list(GLOB.default_hotkeys) key_bindings_by_key = get_key_bindings_by_key(key_bindings) randomise = get_default_randomization() diff --git a/code/modules/client/preferences/middleware/keybindings.dm b/code/modules/client/preferences/middleware/keybindings.dm index 7cb41269743..67102f1e17f 100644 --- a/code/modules/client/preferences/middleware/keybindings.dm +++ b/code/modules/client/preferences/middleware/keybindings.dm @@ -24,7 +24,7 @@ ) /datum/preference_middleware/keybindings/proc/reset_all_keybinds(list/params, mob/user) - preferences.key_bindings = deepCopyList(GLOB.default_hotkeys) + preferences.key_bindings = deep_copy_list(GLOB.default_hotkeys) preferences.key_bindings_by_key = preferences.get_key_bindings_by_key(preferences.key_bindings) preferences.update_static_data(user) diff --git a/code/modules/client/preferences/species.dm b/code/modules/client/preferences/species.dm index 6cfffda9525..a854a9e703c 100644 --- a/code/modules/client/preferences/species.dm +++ b/code/modules/client/preferences/species.dm @@ -42,9 +42,9 @@ if (!(TRAIT_NOHUNGER in species.inherent_traits)) diet = list( - "liked_food" = bitfield2list(species.liked_food, food_flags), - "disliked_food" = bitfield2list(species.disliked_food, food_flags), - "toxic_food" = bitfield2list(species.toxic_food, food_flags), + "liked_food" = bitfield_to_list(species.liked_food, food_flags), + "disliked_food" = bitfield_to_list(species.disliked_food, food_flags), + "toxic_food" = bitfield_to_list(species.toxic_food, food_flags), ) data[species_id] = list( diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 7026d143fff..512178ee3be 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -188,7 +188,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car var/datum/outfit/path = text2path(typetext) if(ispath(path)) //whatever typepath fails this check probably doesn't exist anymore parsed_favs += path - favorite_outfits = uniqueList(parsed_favs) + favorite_outfits = unique_list(parsed_favs) // Custom hotkeys READ_FILE(S["key_bindings"], key_bindings) diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index 612274369cc..d7868326c7a 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -248,7 +248,7 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8") return // Sort the list - players = sortList(players) + players = sort_list(players) // Request the player to ignore var/selection = input("Please, select a player!", "Ignore", null, null) as null|anything in players diff --git a/code/modules/client/verbs/who.dm b/code/modules/client/verbs/who.dm index 56b88ba8d5d..444a992f4a2 100644 --- a/code/modules/client/verbs/who.dm +++ b/code/modules/client/verbs/who.dm @@ -56,7 +56,7 @@ var/num_lines = 0 msg += "" - for(var/line in sortList(Lines)) + for(var/line in sort_list(Lines)) msg += "" num_lines += 1 diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm index ec1b9e789e7..3771aceef3f 100644 --- a/code/modules/clothing/chameleon.dm +++ b/code/modules/clothing/chameleon.dm @@ -182,7 +182,7 @@ /datum/action/item_action/chameleon/change/proc/select_look(mob/user) var/obj/item/picked_item var/picked_name - picked_name = input("Select [chameleon_name] to change into", "Chameleon [chameleon_name]", picked_name) as null|anything in sortList(chameleon_list, /proc/cmp_typepaths_asc) + picked_name = input("Select [chameleon_name] to change into", "Chameleon [chameleon_name]", picked_name) as null|anything in sort_list(chameleon_list, /proc/cmp_typepaths_asc) if(!picked_name) return picked_item = chameleon_list[picked_name] diff --git a/code/modules/events/brain_trauma.dm b/code/modules/events/brain_trauma.dm index 7350fd682fb..09d61633600 100644 --- a/code/modules/events/brain_trauma.dm +++ b/code/modules/events/brain_trauma.dm @@ -27,7 +27,7 @@ 15;TRAUMA_RESILIENCE_LOBOTOMY, 5;TRAUMA_RESILIENCE_MAGIC) - var/trauma_type = pickweight(list( + var/trauma_type = pick_weight(list( BRAIN_TRAUMA_MILD = 60, BRAIN_TRAUMA_SEVERE = 30, BRAIN_TRAUMA_SPECIAL = 10 diff --git a/code/modules/events/brand_intelligence.dm b/code/modules/events/brand_intelligence.dm index d6d2dad5079..78469224b8d 100644 --- a/code/modules/events/brand_intelligence.dm +++ b/code/modules/events/brand_intelligence.dm @@ -54,7 +54,7 @@ originMachine.visible_message(span_notice("[originMachine] beeps and seems lifeless.")) kill() return - vendingMachines = removeNullsFromList(vendingMachines) + vendingMachines = remove_nulls_from_list(vendingMachines) if(!vendingMachines.len) //if every machine is infected for(var/obj/machinery/vending/upriser in infectedMachines) if(!QDELETED(upriser)) diff --git a/code/modules/events/false_alarm.dm b/code/modules/events/false_alarm.dm index 07041b8e4fd..18913c73f12 100644 --- a/code/modules/events/false_alarm.dm +++ b/code/modules/events/false_alarm.dm @@ -18,7 +18,7 @@ continue possible_types += E - forced_type = input(usr, "Select the scare.","False event") as null|anything in sortNames(possible_types) + forced_type = input(usr, "Select the scare.","False event") as null|anything in sort_names(possible_types) /datum/round_event_control/falsealarm/canSpawnEvent(players_amt) return ..() && length(gather_false_events()) diff --git a/code/modules/events/heart_attack.dm b/code/modules/events/heart_attack.dm index 5e398a236d3..7e2568fa111 100644 --- a/code/modules/events/heart_attack.dm +++ b/code/modules/events/heart_attack.dm @@ -18,7 +18,7 @@ heart_attack_contestants[victim] = 1 if(LAZYLEN(heart_attack_contestants)) - var/mob/living/carbon/human/winner = pickweight(heart_attack_contestants) + var/mob/living/carbon/human/winner = pick_weight(heart_attack_contestants) var/datum/disease/D = new /datum/disease/heart_failure() winner.ForceContractDisease(D, FALSE, TRUE) announce_to_ghosts(winner) diff --git a/code/modules/events/meteor_wave.dm b/code/modules/events/meteor_wave.dm index a63ac7df3a4..204436123c6 100644 --- a/code/modules/events/meteor_wave.dm +++ b/code/modules/events/meteor_wave.dm @@ -22,7 +22,7 @@ /datum/round_event/meteor_wave/proc/determine_wave_type() if(!wave_name) - wave_name = pickweight(list( + wave_name = pick_weight(list( "normal" = 50, "threatening" = 40, "catastrophic" = 10)) diff --git a/code/modules/events/wizard/madness.dm b/code/modules/events/wizard/madness.dm index ac86236623b..a5964de1993 100644 --- a/code/modules/events/wizard/madness.dm +++ b/code/modules/events/wizard/madness.dm @@ -12,7 +12,7 @@ var/suggested = pick(strings(REDPILL_FILE, "redpill_questions")) - forced_secret = (input(usr, "What horrifying truth will you reveal?", "Curse of Madness", sortList(suggested)) as text|null) || suggested + forced_secret = (input(usr, "What horrifying truth will you reveal?", "Curse of Madness", sort_list(suggested)) as text|null) || suggested /datum/round_event/wizard/madness/start() var/datum/round_event_control/wizard/madness/C = control diff --git a/code/modules/explorer_drone/exploration_site.dm b/code/modules/explorer_drone/exploration_site.dm index 8ac8e3b1d24..5576ae13d8e 100644 --- a/code/modules/explorer_drone/exploration_site.dm +++ b/code/modules/explorer_drone/exploration_site.dm @@ -69,7 +69,7 @@ GLOBAL_LIST_EMPTY(exploration_sites) category_weights[modifier] += distance*distance_modifiers[modifier] var/min_events_amount = CEILING(0.4*distance+0.2,1) for(var/i in 1 to rand(min_events_amount,min_events_amount+2)) - var/chosen_category = pickweight(category_weights) + var/chosen_category = pick_weight(category_weights) var/datum/exploration_event/event = generate_event(site_traits,chosen_category) if(event) add_event(event) diff --git a/code/modules/explorer_drone/loot.dm b/code/modules/explorer_drone/loot.dm index 4048a5034b1..d88a45f438a 100644 --- a/code/modules/explorer_drone/loot.dm +++ b/code/modules/explorer_drone/loot.dm @@ -29,9 +29,9 @@ GLOBAL_LIST_INIT(adventure_loot_generator_index,generate_generator_index()) /datum/adventure_loot_generator/maintenance/generate() var/list/all_loot = list() for(var/i in 1 to amount) - var/lootspawn = pickweight(GLOB.maintenance_loot) + var/lootspawn = pick_weight(GLOB.maintenance_loot) while(islist(lootspawn)) - lootspawn = pickweight(lootspawn) + lootspawn = pick_weight(lootspawn) var/atom/movable/loot = new lootspawn() all_loot += loot return all_loot diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 7e20bcf6bb5..d8a2184a5b6 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -34,7 +34,7 @@ GLOBAL_LIST_INIT(hallucination_list, list( if(world.time < next_hallucination) return - var/halpick = pickweight(GLOB.hallucination_list) + var/halpick = pick_weight(GLOB.hallucination_list) new halpick(src, FALSE) next_hallucination = world.time + rand(100, 600) diff --git a/code/modules/food_and_drinks/drinks/drinks/bottle.dm b/code/modules/food_and_drinks/drinks/drinks/bottle.dm index fce9c0a82eb..14d3f9fd0c3 100644 --- a/code/modules/food_and_drinks/drinks/drinks/bottle.dm +++ b/code/modules/food_and_drinks/drinks/drinks/bottle.dm @@ -324,7 +324,7 @@ // There was a large fight in the coderbus about a player reference // in absinthe. Ergo, this is why the name generation is now so // complicated. Judge us kindly. - var/shortname = pickweight( + var/shortname = pick_weight( list("T&T" = 1, "A&A" = 1, "Generic" = 1)) var/fullname switch(shortname) diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm index de2ec62e5b2..2638820721f 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm @@ -190,7 +190,7 @@ listofitems[md5name]["amount"]++ // The good news is, #30519 made smartfridge UIs non-auto-updating else listofitems[md5name] = list("name" = O.name, "type" = O.type, "amount" = 1) - sortList(listofitems) + sort_list(listofitems) .["contents"] = listofitems .["name"] = name diff --git a/code/modules/food_and_drinks/pizzabox.dm b/code/modules/food_and_drinks/pizzabox.dm index daf44c7d408..099b3c53f31 100644 --- a/code/modules/food_and_drinks/pizzabox.dm +++ b/code/modules/food_and_drinks/pizzabox.dm @@ -376,11 +376,11 @@ else if(nommer.has_quirk(/datum/quirk/pineapple_hater)) var/list/pineapple_pizza_liker = pizza_types.Copy() pineapple_pizza_liker -= /obj/item/food/pizza/pineapple - pizza_preferences[nommer.ckey] = pickweight(pineapple_pizza_liker) + pizza_preferences[nommer.ckey] = pick_weight(pineapple_pizza_liker) else if(nommer.mind?.assigned_role.title == /datum/job/botanist) pizza_preferences[nommer.ckey] = /obj/item/food/pizza/dank else - pizza_preferences[nommer.ckey] = pickweight(pizza_types) + pizza_preferences[nommer.ckey] = pick_weight(pizza_types) if(pizza) //if the pizza isn't our favourite, delete it if(pizza.type != pizza_preferences[nommer.ckey]) diff --git a/code/modules/food_and_drinks/restaurant/_venue.dm b/code/modules/food_and_drinks/restaurant/_venue.dm index 8588ba92a17..c3510bd87f5 100644 --- a/code/modules/food_and_drinks/restaurant/_venue.dm +++ b/code/modules/food_and_drinks/restaurant/_venue.dm @@ -48,7 +48,7 @@ // In practice, the list will never run out, but this is for sanity. while (customer_types_to_choose.len) - customer_type = pickweight(customer_types_to_choose) + customer_type = pick_weight(customer_types_to_choose) var/datum/customer_data/customer = SSrestaurant.all_customers[customer_type] if (customer.can_use(src)) diff --git a/code/modules/food_and_drinks/restaurant/customers/_customer.dm b/code/modules/food_and_drinks/restaurant/customers/_customer.dm index b0d486d46aa..1dcb1629269 100644 --- a/code/modules/food_and_drinks/restaurant/customers/_customer.dm +++ b/code/modules/food_and_drinks/restaurant/customers/_customer.dm @@ -52,7 +52,7 @@ /// You want to override this if you have dynamic orders, such as the moth tourists requesting the chef's clothes. /// If the list of orders are static, just modify orderable_objects. /datum/customer_data/proc/get_order(datum/venue/venue) - return pickweight(orderable_objects[venue.venue_type]) + return pick_weight(orderable_objects[venue.venue_type]) /datum/customer_data/proc/get_overlays(mob/living/simple_animal/robot_customer/customer) return @@ -309,7 +309,7 @@ orderable[buffet.shoes] = 1 if (orderable.len) - var/datum/order = pickweight(orderable) + var/datum/order = pick_weight(orderable) return order.type /datum/customer_data/moth/proc/get_wings(mob/living/simple_animal/robot_customer/customer) diff --git a/code/modules/food_and_drinks/restaurant/generic_venues.dm b/code/modules/food_and_drinks/restaurant/generic_venues.dm index 2d5484e9844..13c36851a5f 100644 --- a/code/modules/food_and_drinks/restaurant/generic_venues.dm +++ b/code/modules/food_and_drinks/restaurant/generic_venues.dm @@ -91,7 +91,7 @@ ) /datum/venue/bar/order_food(mob/living/simple_animal/robot_customer/customer_pawn, datum/customer_data/customer_data) - var/datum/reagent/reagent_to_order = pickweight(customer_data.orderable_objects[venue_type]) + var/datum/reagent/reagent_to_order = pick_weight(customer_data.orderable_objects[venue_type]) var/glass_visual diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index a19ef67da7a..27b8ccc57f0 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -640,7 +640,7 @@ if(!(gene.mutability_flags & PLANT_GENE_REMOVABLE)) continue // Don't show genes that can't be removed. current_traits[gene.name] = gene - var/removed_trait = (input(user, "Select a trait to remove from the [myseed.plantname].", "Plant Trait Removal") as null|anything in sortList(current_traits)) + var/removed_trait = (input(user, "Select a trait to remove from the [myseed.plantname].", "Plant Trait Removal") as null|anything in sort_list(current_traits)) if(removed_trait == null) return if(!user.canUseTopic(src, BE_CLOSE)) @@ -725,7 +725,7 @@ for(var/muties in myseed.mutatelist) var/obj/item/seeds/another_mut = new muties fresh_mut_list[another_mut.plantname] = muties - var/locked_mutation = (input(user, "Select a mutation to lock.", "Plant Mutation Locks") as null|anything in sortList(fresh_mut_list)) + var/locked_mutation = (input(user, "Select a mutation to lock.", "Plant Mutation Locks") as null|anything in sort_list(fresh_mut_list)) if(!user.canUseTopic(src, BE_CLOSE) || !locked_mutation) return myseed.mutatelist = list(fresh_mut_list[locked_mutation]) diff --git a/code/modules/jobs/job_types/security_officer.dm b/code/modules/jobs/job_types/security_officer.dm index 73d93062944..2477bebb82c 100644 --- a/code/modules/jobs/job_types/security_officer.dm +++ b/code/modules/jobs/job_types/security_officer.dm @@ -381,7 +381,7 @@ GLOBAL_LIST_EMPTY(security_officer_distribution) indices -= chosen preferences[chosen] = null - listclearnulls(preferences) + list_clear_nulls(preferences) departments -= biggest_preference diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index 97036d154fe..050cc066c66 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -143,7 +143,7 @@ create_random_books(books_to_load, src, FALSE, random_category) load_random_books = FALSE if(contents.len) - var/obj/item/book/choice = input(user, "Which book would you like to remove from the shelf?") as null|obj in sortNames(contents.Copy()) + var/obj/item/book/choice = input(user, "Which book would you like to remove from the shelf?") as null|obj in sort_names(contents.Copy()) if(choice) if(!(user.mobility_flags & MOBILITY_USE) || user.stat != CONSCIOUS || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !in_range(loc, user)) return diff --git a/code/modules/mapping/preloader.dm b/code/modules/mapping/preloader.dm index 6fb1e4cdb64..c2c4cd959a9 100644 --- a/code/modules/mapping/preloader.dm +++ b/code/modules/mapping/preloader.dm @@ -20,7 +20,7 @@ GLOBAL_DATUM_INIT(_preloader, /datum/map_preloader, new) for(var/attribute in preloader_local.attributes) var/value = preloader_local.attributes[attribute] if(islist(value)) - value = deepCopyList(value) + value = deep_copy_list(value) #ifdef TESTING if(what.vars[attribute] == value) var/message = "[what.type] at [AREACOORD(what)] - VAR:[attribute] = [isnull(value) ? "null" : (isnum(value) ? value : "\"[value]\"")]" diff --git a/code/modules/mapping/ruins.dm b/code/modules/mapping/ruins.dm index 09f77985a65..150874bfa3b 100644 --- a/code/modules/mapping/ruins.dm +++ b/code/modules/mapping/ruins.dm @@ -101,7 +101,7 @@ forced = TRUE break else //Otherwise just pick random one - current_pick = pickweight(ruins_available) + current_pick = pick_weight(ruins_available) var/placement_tries = forced_turf ? 1 : PLACEMENT_TRIES //Only try once if we target specific turf var/failed_to_place = TRUE diff --git a/code/modules/meteors/meteors.dm b/code/modules/meteors/meteors.dm index d4fde6d063d..8158704d7b4 100644 --- a/code/modules/meteors/meteors.dm +++ b/code/modules/meteors/meteors.dm @@ -39,7 +39,7 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event max_i-- if(max_i<=0) return - var/Me = pickweight(meteortypes) + var/Me = pick_weight(meteortypes) var/obj/effect/meteor/M = new Me(pickedstart, pickedgoal) M.dest = pickedgoal diff --git a/code/modules/mining/equipment/marker_beacons.dm b/code/modules/mining/equipment/marker_beacons.dm index d49744c438a..49c7da3a035 100644 --- a/code/modules/mining/equipment/marker_beacons.dm +++ b/code/modules/mining/equipment/marker_beacons.dm @@ -1,5 +1,5 @@ /*****************Marker Beacons**************************/ -GLOBAL_LIST_INIT(marker_beacon_colors, sortList(list( +GLOBAL_LIST_INIT(marker_beacon_colors, sort_list(list( "Random" = FALSE, //not a true color, will pick a random color "Burgundy" = LIGHT_COLOR_FLARE, "Bronze" = LIGHT_COLOR_ORANGE, diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm index 4dec6836e60..51b61ff47df 100644 --- a/code/modules/mining/fulton.dm +++ b/code/modules/mining/fulton.dm @@ -31,7 +31,7 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons) else var/A - A = input("Select a beacon to connect to", "Balloon Extraction Pack", A) as null|anything in sortNames(possible_beacons) + A = input("Select a beacon to connect to", "Balloon Extraction Pack", A) as null|anything in sort_names(possible_beacons) if(!A) return diff --git a/code/modules/mining/laborcamp/laborstacker.dm b/code/modules/mining/laborcamp/laborstacker.dm index dce21b25a90..79b1c200aa4 100644 --- a/code/modules/mining/laborcamp/laborstacker.dm +++ b/code/modules/mining/laborcamp/laborstacker.dm @@ -31,7 +31,7 @@ GLOBAL_LIST(labor_sheet_values) if(!initial(sheet.point_value) || (initial(sheet.merge_type) && initial(sheet.merge_type) != sheet_type)) //ignore no-value sheets and x/fifty subtypes continue sheet_list += list(list("ore" = initial(sheet.name), "value" = initial(sheet.point_value))) - GLOB.labor_sheet_values = sortList(sheet_list, /proc/cmp_sheet_list) + GLOB.labor_sheet_values = sort_list(sheet_list, /proc/cmp_sheet_list) /obj/machinery/mineral/labor_claim_console/Destroy() QDEL_NULL(Radio) diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm index 2bab1630400..f8b4e19d9fc 100644 --- a/code/modules/mining/machine_vending.dm +++ b/code/modules/mining/machine_vending.dm @@ -170,7 +170,7 @@ /obj/machinery/mineral/equipment_vendor/proc/RedeemVoucher(obj/item/mining_voucher/voucher, mob/redeemer) var/items = list("Survival Capsule and Explorer's Webbing", "Resonator Kit", "Minebot Kit", "Extraction and Rescue Kit", "Crusher Kit", "Mining Conscription Kit") - var/selection = input(redeemer, "Pick your equipment", "Mining Voucher Redemption") as null|anything in sortList(items) + var/selection = input(redeemer, "Pick your equipment", "Mining Voucher Redemption") as null|anything in sort_list(items) if(!selection || !Adjacent(redeemer) || QDELETED(voucher) || voucher.loc != redeemer) return var/drop_location = drop_location() diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index ae040cc0dff..a055725f566 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -611,8 +611,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp ..() /proc/updateallghostimages() - listclearnulls(GLOB.ghost_images_default) - listclearnulls(GLOB.ghost_images_simple) + list_clear_nulls(GLOB.ghost_images_default) + list_clear_nulls(GLOB.ghost_images_simple) for (var/mob/dead/observer/O in GLOB.player_list) O.updateghostimages() @@ -649,7 +649,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(!(L in GLOB.player_list) && !L.mind) possessible += L - var/mob/living/target = input("Your new life begins today!", "Possess Mob", null, null) as null|anything in sortNames(possessible) + var/mob/living/target = input("Your new life begins today!", "Possess Mob", null, null) as null|anything in sort_names(possessible) if(!target) return FALSE diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm index c709982585f..3e532c829c9 100644 --- a/code/modules/mob/emote.dm +++ b/code/modules/mob/emote.dm @@ -55,7 +55,7 @@ if(P.can_run_emote(user, status_check = FALSE , intentional = TRUE)) keys += P.key - keys = sortList(keys) + keys = sort_list(keys) message += keys.Join(", ") message += "." message = message.Join("") diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 79a42bcea24..1ef7a390867 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -484,7 +484,7 @@ //GetAllContents that is reasonable and not stupid /mob/living/carbon/proc/get_all_gear() var/list/processing_list = get_equipped_items(include_pockets = TRUE) + held_items - listclearnulls(processing_list) // handles empty hands + list_clear_nulls(processing_list) // handles empty hands var/i = 0 while(i < length(processing_list) ) var/atom/A = processing_list[++i] diff --git a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm index 580b0e6b726..4ae6783e823 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm @@ -88,7 +88,7 @@ Doesn't work on other aliens/AI.*/ var/list/options = list() for(var/mob/living/Ms in oview(user)) options += Ms - var/mob/living/M = input("Select who to whisper to:","Whisper to?",null) as null|mob in sortNames(options) + var/mob/living/M = input("Select who to whisper to:","Whisper to?",null) as null|mob in sort_names(options) if(!M) return FALSE if(M.anti_magic_check(FALSE, FALSE, TRUE, 0)) @@ -123,7 +123,7 @@ Doesn't work on other aliens/AI.*/ for(var/mob/living/carbon/A in oview(user)) if(A.getorgan(/obj/item/organ/alien/plasmavessel)) aliens_around.Add(A) - var/mob/living/carbon/M = input("Select who to transfer to:","Transfer plasma to?",null) as mob in sortNames(aliens_around) + var/mob/living/carbon/M = input("Select who to transfer to:","Transfer plasma to?",null) as mob in sort_names(aliens_around) if(!M) return var/amount = input("Amount:", "Transfer Plasma to [M]") as num|null diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index ab07ec3eeba..8f743583056 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -990,7 +990,7 @@ limb_list = list(BODY_ZONE_HEAD, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) for(var/obj/item/bodypart/B in bodyparts) limb_list -= B.body_zone - var/result = input(usr, "Please choose which body part to [edit_action]","[capitalize(edit_action)] Body Part") as null|anything in sortList(limb_list) + var/result = input(usr, "Please choose which body part to [edit_action]","[capitalize(edit_action)] Body Part") as null|anything in sort_list(limb_list) if(result) var/obj/item/bodypart/BP = get_bodypart(result) switch(edit_action) @@ -1032,7 +1032,7 @@ for(var/i in artpaths) var/datum/martial_art/M = i artnames[initial(M.name)] = M - var/result = input(usr, "Choose the martial art to teach","JUDO CHOP") as null|anything in sortList(artnames, /proc/cmp_typepaths_asc) + var/result = input(usr, "Choose the martial art to teach","JUDO CHOP") as null|anything in sort_list(artnames, /proc/cmp_typepaths_asc) if(!usr) return if(QDELETED(src)) @@ -1048,7 +1048,7 @@ if(!check_rights(NONE)) return var/list/traumas = subtypesof(/datum/brain_trauma) - var/result = input(usr, "Choose the brain trauma to apply","Traumatize") as null|anything in sortList(traumas, /proc/cmp_typepaths_asc) + var/result = input(usr, "Choose the brain trauma to apply","Traumatize") as null|anything in sort_list(traumas, /proc/cmp_typepaths_asc) if(!usr) return if(QDELETED(src)) @@ -1070,7 +1070,7 @@ if(!check_rights(NONE)) return var/list/hallucinations = subtypesof(/datum/hallucination) - var/result = input(usr, "Choose the hallucination to apply","Send Hallucination") as null|anything in sortList(hallucinations, /proc/cmp_typepaths_asc) + var/result = input(usr, "Choose the hallucination to apply","Send Hallucination") as null|anything in sort_list(hallucinations, /proc/cmp_typepaths_asc) if(!usr) return if(QDELETED(src)) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 0ce48bd9d23..481f331cd6a 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -801,7 +801,7 @@ var/name = initial(mut.name) options[dna.check_mutation(mut) ? "[name] (Remove)" : "[name] (Add)"] = mut - var/result = input(usr, "Choose mutation to add/remove","Mutation Mod") as null|anything in sortList(options) + var/result = input(usr, "Choose mutation to add/remove","Mutation Mod") as null|anything in sort_list(options) if(result) if(result == "Clear") dna.remove_all_mutations() @@ -825,7 +825,7 @@ var/qname = initial(quirk_type.name) options[has_quirk(quirk_type) ? "[qname] (Remove)" : "[qname] (Add)"] = quirk_type - var/result = input(usr, "Choose quirk to add/remove","Quirk Mod") as null|anything in sortList(options) + var/result = input(usr, "Choose quirk to add/remove","Quirk Mod") as null|anything in sort_list(options) if(result) if(result == "Clear") for(var/datum/quirk/q in quirks) diff --git a/code/modules/mob/living/carbon/human/login.dm b/code/modules/mob/living/carbon/human/login.dm index 0146cb4c297..54f3e19cf4c 100644 --- a/code/modules/mob/living/carbon/human/login.dm +++ b/code/modules/mob/living/carbon/human/login.dm @@ -7,7 +7,7 @@ print_msg += span_info("*---------*") print_msg += span_userdanger("As you snap back to consciousness, you recall people messing with your stuff...") - afk_thefts = reverseRange(afk_thefts) + afk_thefts = reverse_range(afk_thefts) for(var/list/iter_theft as anything in afk_thefts) if(!islist(iter_theft) || LAZYLEN(iter_theft) != AFK_THEFT_TIME) diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index cbc6b4c8338..72e735b460d 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -729,7 +729,7 @@ var/list/options = list() for(var/mob/living/Ms in oview(H)) options += Ms - var/mob/living/M = input("Select who to send your message to:","Send thought to?",null) as null|mob in sortNames(options) + var/mob/living/M = input("Select who to send your message to:","Send thought to?",null) as null|mob in sort_names(options) if(!M) return if(M.anti_magic_check(FALSE, FALSE, TRUE, 0)) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index c5ea5f885d0..c98998de755 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -558,7 +558,7 @@ for(var/i in C.network) cameralist[i] = i var/old_network = network - network = input(U, "Which network would you like to view?") as null|anything in sortList(cameralist) + network = input(U, "Which network would you like to view?") as null|anything in sort_list(cameralist) if(!U.eyeobj) U.view_core() @@ -593,7 +593,7 @@ personnel_list["[t.fields["name"]]: [t.fields["rank"]]"] = t.fields["image"]//Pull names, rank, and image. if(personnel_list.len) - input = input("Select a crew member:") as null|anything in sortList(personnel_list) + input = input("Select a crew member:") as null|anything in sort_list(personnel_list) var/icon/character_icon = personnel_list[input] if(character_icon) qdel(holo_icon)//Clear old icon so we're not storing it in memory. @@ -618,7 +618,7 @@ "spider" = 'icons/mob/animal.dmi' ) - input = input("Please select a hologram:") as null|anything in sortList(icon_list) + input = input("Please select a hologram:") as null|anything in sort_list(icon_list) if(input) qdel(holo_icon) switch(input) @@ -639,7 +639,7 @@ "clock" = 'icons/mob/ai.dmi' ) - input = input("Please select a hologram:") as null|anything in sortList(icon_list) + input = input("Please select a hologram:") as null|anything in sort_list(icon_list) if(input) qdel(holo_icon) switch(input) @@ -909,7 +909,7 @@ to_chat(src, "No usable AI shell beacons detected.") if(!target || !(target in possible)) //If the AI is looking for a new shell, or its pre-selected shell is no longer valid - target = input(src, "Which body to control?") as null|anything in sortNames(possible) + target = input(src, "Which body to control?") as null|anything in sort_names(possible) if (!target || target.stat == DEAD || target.deployed || !(!target.connected_ai ||(target.connected_ai == src))) return diff --git a/code/modules/mob/living/silicon/pai/pai_shell.dm b/code/modules/mob/living/silicon/pai/pai_shell.dm index 1a0433d6907..44f73ed32b4 100644 --- a/code/modules/mob/living/silicon/pai/pai_shell.dm +++ b/code/modules/mob/living/silicon/pai/pai_shell.dm @@ -80,7 +80,7 @@ for(var/holochassis_option in possible_chassis) var/image/item_image = image(icon = src.icon, icon_state = holochassis_option) skins += list("[holochassis_option]" = item_image) - sortList(skins) + sort_list(skins) var/atom/anchor = get_atom_on_turf(src) var/choice = show_radial_menu(src, anchor, skins, custom_check = CALLBACK(src, .proc/check_menu, anchor), radius = 40, require_near = TRUE) diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index 4a021c67f85..873347e676f 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -145,7 +145,7 @@ radio.attack_self(src) if("image") // Set pAI card display face - var/newImage = tgui_input_list(usr, "Select your new display image.", "Display Image", sortList(list("Happy", "Cat", "Extremely Happy", "Face", "Laugh", "Off", "Sad", "Angry", "What", "Sunglasses"))) + var/newImage = tgui_input_list(usr, "Select your new display image.", "Display Image", sort_list(list("Happy", "Cat", "Extremely Happy", "Face", "Laugh", "Off", "Sad", "Angry", "What", "Sunglasses"))) switch(newImage) if(null) card.emotion_icon = "null" @@ -400,7 +400,7 @@ /mob/living/silicon/pai/proc/softwareManifest() . += "

    Crew Manifest



    " if(GLOB.data_core.general) - for(var/datum/data/record/t in sortRecord(GLOB.data_core.general)) + for(var/datum/data/record/t in sort_record(GLOB.data_core.general)) . += "[t.fields["name"]] - [t.fields["rank"]]
    " . += "" return . @@ -411,7 +411,7 @@ if(0) . += "

    Medical Records


    " if(GLOB.data_core.general) - for(var/datum/data/record/R in sortRecord(GLOB.data_core.general)) + for(var/datum/data/record/R in sort_record(GLOB.data_core.general)) . += "[R.fields["id"]]: [R.fields["name"]]
    " if(1) . += "
    Medical Record

    " @@ -433,7 +433,7 @@ if(0) . += "

    Security Records


    " if(GLOB.data_core.general) - for(var/datum/data/record/R in sortRecord(GLOB.data_core.general)) + for(var/datum/data/record/R in sort_record(GLOB.data_core.general)) . += "
    [R.fields["id"]]: [R.fields["name"]]
    " if(1) . += "

    Security Record

    " diff --git a/code/modules/mob/living/simple_animal/guardian/guardian.dm b/code/modules/mob/living/simple_animal/guardian/guardian.dm index ca7598e1a7c..14ef1b6dc79 100644 --- a/code/modules/mob/living/simple_animal/guardian/guardian.dm +++ b/code/modules/mob/living/simple_animal/guardian/guardian.dm @@ -454,7 +454,7 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians if(P.reset) guardians -= P //clear out guardians that are already reset if(guardians.len) - var/mob/living/simple_animal/hostile/guardian/G = input(src, "Pick the guardian you wish to reset", "Guardian Reset") as null|anything in sortNames(guardians) + var/mob/living/simple_animal/hostile/guardian/G = input(src, "Pick the guardian you wish to reset", "Guardian Reset") as null|anything in sort_names(guardians) if(G) to_chat(src, span_holoparasite("You attempt to reset [G.real_name]'s personality...")) var/list/mob/dead/observer/candidates = poll_ghost_candidates("Do you want to play as [src.real_name]'s [G.real_name]?", ROLE_PAI, FALSE, 100) @@ -551,7 +551,7 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians if(random) guardiantype = pick(possible_guardians) else - guardiantype = input(user, "Pick the type of [mob_name]", "[mob_name] Creation") as null|anything in sortList(possible_guardians) + guardiantype = input(user, "Pick the type of [mob_name]", "[mob_name] Creation") as null|anything in sort_list(possible_guardians) if(!guardiantype || !candidate.client) to_chat(user, "[failure_message]" ) used = FALSE diff --git a/code/modules/mob/living/simple_animal/guardian/types/ranged.dm b/code/modules/mob/living/simple_animal/guardian/types/ranged.dm index 3b01dd85c59..47f7b56d934 100644 --- a/code/modules/mob/living/simple_animal/guardian/types/ranged.dm +++ b/code/modules/mob/living/simple_animal/guardian/types/ranged.dm @@ -98,7 +98,7 @@ set name = "Remove Surveillance Snare" set category = "Guardian" set desc = "Disarm unwanted surveillance snares." - var/picked_snare = input(src, "Pick which snare to remove", "Remove Snare") as null|anything in sortNames(snares) + var/picked_snare = input(src, "Pick which snare to remove", "Remove Snare") as null|anything in sort_names(snares) if(picked_snare) snares -= picked_snare qdel(picked_snare) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/hivelord.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/hivelord.dm index 26751961f5b..1e63d2312c7 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/hivelord.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/hivelord.dm @@ -301,10 +301,10 @@ H.dna.add_mutation(DWARFISM) /obj/effect/mob_spawn/human/corpse/damaged/legioninfested/Initialize(mapload) - var/type = pickweight(list("Miner" = 66, "Ashwalker" = 10, "Golem" = 10,"Clown" = 10, pick(list("Shadow", "YeOlde","Operative", "Cultist")) = 4)) + var/type = pick_weight(list("Miner" = 66, "Ashwalker" = 10, "Golem" = 10,"Clown" = 10, pick(list("Shadow", "YeOlde","Operative", "Cultist")) = 4)) switch(type) if("Miner") - mob_species = pickweight(list(/datum/species/human = 70, /datum/species/lizard = 26, /datum/species/fly = 2, /datum/species/plasmaman = 2)) + mob_species = pick_weight(list(/datum/species/human = 70, /datum/species/lizard = 26, /datum/species/fly = 2, /datum/species/plasmaman = 2)) if(mob_species == /datum/species/plasmaman) uniform = /obj/item/clothing/under/plasmaman head = /obj/item/clothing/head/helmet/space/plasmaman @@ -312,9 +312,9 @@ else uniform = /obj/item/clothing/under/rank/cargo/miner/lavaland if (prob(4)) - belt = pickweight(list(/obj/item/storage/belt/mining = 2, /obj/item/storage/belt/mining/alt = 2)) + belt = pick_weight(list(/obj/item/storage/belt/mining = 2, /obj/item/storage/belt/mining/alt = 2)) else if(prob(10)) - belt = pickweight(list(/obj/item/pickaxe = 8, /obj/item/pickaxe/mini = 4, /obj/item/pickaxe/silver = 2, /obj/item/pickaxe/diamond = 1)) + belt = pick_weight(list(/obj/item/pickaxe = 8, /obj/item/pickaxe/mini = 4, /obj/item/pickaxe/silver = 2, /obj/item/pickaxe/diamond = 1)) else belt = /obj/item/tank/internals/emergency_oxygen/engi if(mob_species != /datum/species/lizard) @@ -322,11 +322,11 @@ gloves = /obj/item/clothing/gloves/color/black mask = /obj/item/clothing/mask/gas/explorer if(prob(20)) - suit = pickweight(list(/obj/item/clothing/suit/hooded/explorer = 18, /obj/item/clothing/suit/hooded/cloak/goliath = 2)) + suit = pick_weight(list(/obj/item/clothing/suit/hooded/explorer = 18, /obj/item/clothing/suit/hooded/cloak/goliath = 2)) if(prob(30)) - r_pocket = pickweight(list(/obj/item/stack/marker_beacon = 20, /obj/item/stack/spacecash/c1000 = 7, /obj/item/reagent_containers/hypospray/medipen/survival = 2, /obj/item/borg/upgrade/modkit/damage = 1 )) + r_pocket = pick_weight(list(/obj/item/stack/marker_beacon = 20, /obj/item/stack/spacecash/c1000 = 7, /obj/item/reagent_containers/hypospray/medipen/survival = 2, /obj/item/borg/upgrade/modkit/damage = 1 )) if(prob(10)) - l_pocket = pickweight(list(/obj/item/stack/spacecash/c1000 = 7, /obj/item/reagent_containers/hypospray/medipen/survival = 2, /obj/item/borg/upgrade/modkit/cooldown = 1 )) + l_pocket = pick_weight(list(/obj/item/stack/spacecash/c1000 = 7, /obj/item/reagent_containers/hypospray/medipen/survival = 2, /obj/item/borg/upgrade/modkit/cooldown = 1 )) if("Ashwalker") mob_species = /datum/species/lizard/ashwalker uniform = /obj/item/clothing/under/costume/gladiator/ash_walker @@ -337,7 +337,7 @@ suit = /obj/item/clothing/suit/armor/bone gloves = /obj/item/clothing/gloves/bracer if(prob(5)) - back = pickweight(list(/obj/item/spear/bonespear = 3, /obj/item/fireaxe/boneaxe = 2)) + back = pick_weight(list(/obj/item/spear/bonespear = 3, /obj/item/fireaxe/boneaxe = 2)) if(prob(10)) belt = /obj/item/storage/belt/mining/primitive if(prob(30)) @@ -352,15 +352,15 @@ if(prob(70)) backpack_contents += pick(list(/obj/item/stamp/clown = 1, /obj/item/reagent_containers/spray/waterflower = 1, /obj/item/food/grown/banana = 1, /obj/item/megaphone/clown = 1, /obj/item/reagent_containers/food/drinks/soda_cans/canned_laughter = 1, /obj/item/pneumatic_cannon/pie = 1)) if(prob(30)) - backpack_contents += list(/obj/item/stack/sheet/mineral/bananium = pickweight(list( 1 = 3, 2 = 2, 3 = 1))) + backpack_contents += list(/obj/item/stack/sheet/mineral/bananium = pick_weight(list( 1 = 3, 2 = 2, 3 = 1))) if(prob(10)) - l_pocket = pickweight(list(/obj/item/bikehorn/golden = 3, /obj/item/bikehorn/airhorn= 1 )) + l_pocket = pick_weight(list(/obj/item/bikehorn/golden = 3, /obj/item/bikehorn/airhorn= 1 )) if(prob(10)) r_pocket = /obj/item/implanter/sad_trombone if("Golem") mob_species = pick(list(/datum/species/golem/adamantine, /datum/species/golem/plasma, /datum/species/golem/diamond, /datum/species/golem/gold, /datum/species/golem/silver, /datum/species/golem/plasteel, /datum/species/golem/titanium, /datum/species/golem/plastitanium)) if(prob(30)) - glasses = pickweight(list(/obj/item/clothing/glasses/meson = 2, /obj/item/clothing/glasses/hud/health = 2, /obj/item/clothing/glasses/hud/diagnostic =2, /obj/item/clothing/glasses/science = 2, /obj/item/clothing/glasses/welding = 2, /obj/item/clothing/glasses/night = 1)) + glasses = pick_weight(list(/obj/item/clothing/glasses/meson = 2, /obj/item/clothing/glasses/hud/health = 2, /obj/item/clothing/glasses/hud/diagnostic =2, /obj/item/clothing/glasses/science = 2, /obj/item/clothing/glasses/welding = 2, /obj/item/clothing/glasses/night = 1)) if(prob(10)) belt = pick(list(/obj/item/storage/belt/mining/vendor, /obj/item/storage/belt/utility/full)) if(prob(50)) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 8582ad67a5a..732b7f05906 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -529,7 +529,7 @@ return //we never mate when not alone, so just abort early if(alone && partner && children < 3) - var/childspawn = pickweight(childtype) + var/childspawn = pick_weight(childtype) var/turf/target = get_turf(loc) if(target) return new childspawn(target) diff --git a/code/modules/mob/living/simple_animal/slime/powers.dm b/code/modules/mob/living/simple_animal/slime/powers.dm index 46f017044eb..82cbbe1849f 100644 --- a/code/modules/mob/living/simple_animal/slime/powers.dm +++ b/code/modules/mob/living/simple_animal/slime/powers.dm @@ -34,7 +34,7 @@ if(C!=src && Adjacent(C)) choices += C - var/mob/living/M = input(src,"Who do you wish to feed on?") in null|sortNames(choices) + var/mob/living/M = input(src,"Who do you wish to feed on?") in null|sort_names(choices) if(!M) return FALSE if(CanFeedon(M)) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 190cbe35454..ff0b4e995ec 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -38,7 +38,7 @@ if(prob(probability)) zone = check_zone(zone) else - zone = pickweight(list(BODY_ZONE_HEAD = 1, BODY_ZONE_CHEST = 1, BODY_ZONE_L_ARM = 4, BODY_ZONE_R_ARM = 4, BODY_ZONE_L_LEG = 4, BODY_ZONE_R_LEG = 4)) + zone = pick_weight(list(BODY_ZONE_HEAD = 1, BODY_ZONE_CHEST = 1, BODY_ZONE_L_ARM = 4, BODY_ZONE_R_ARM = 4, BODY_ZONE_L_LEG = 4, BODY_ZONE_R_LEG = 4)) return zone ///Would this zone be above the neck diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 50e43d3f977..b88a46d3171 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -294,7 +294,7 @@ /mob/living/carbon/human/Animalize() var/list/mobtypes = typesof(/mob/living/simple_animal) - var/mobpath = tgui_input_list(usr, "Which type of mob should [src] turn into?", "Choose a type", sortList(mobtypes, /proc/cmp_typepaths_asc)) + var/mobpath = tgui_input_list(usr, "Which type of mob should [src] turn into?", "Choose a type", sort_list(mobtypes, /proc/cmp_typepaths_asc)) if(!safe_animal(mobpath)) to_chat(usr, span_danger("Sorry but this mob type is currently unavailable.")) @@ -327,7 +327,7 @@ /mob/proc/Animalize() var/list/mobtypes = typesof(/mob/living/simple_animal) - var/mobpath = tgui_input_list(usr, "Which type of mob should [src] turn into?", "Choose a type", sortList(mobtypes, /proc/cmp_typepaths_asc)) + var/mobpath = tgui_input_list(usr, "Which type of mob should [src] turn into?", "Choose a type", sort_list(mobtypes, /proc/cmp_typepaths_asc)) if(!safe_animal(mobpath)) to_chat(usr, span_danger("Sorry but this mob type is currently unavailable.")) diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index a84318607d2..9af211ab894 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -494,7 +494,7 @@ var/obj/item/computer_hardware/H = all_components[h] component_names.Add(H.name) - var/choice = input(user, "Which component do you want to uninstall?", "Computer maintenance", null) as null|anything in sortList(component_names) + var/choice = input(user, "Which component do you want to uninstall?", "Computer maintenance", null) as null|anything in sort_list(component_names) if(!choice) return diff --git a/code/modules/ninja/suit/ninjaDrainAct.dm b/code/modules/ninja/suit/ninjaDrainAct.dm index ffb1b98804d..4c4287e2b39 100644 --- a/code/modules/ninja/suit/ninjaDrainAct.dm +++ b/code/modules/ninja/suit/ninjaDrainAct.dm @@ -157,7 +157,7 @@ return INVALID_DRAIN AI_notify_hack() if(do_after(ninja, 200)) - for(var/datum/data/record/rec in sortRecord(GLOB.data_core.general, sortBy, order)) + for(var/datum/data/record/rec in sort_record(GLOB.data_core.general, sortBy, order)) for(var/datum/data/record/security_record in GLOB.data_core.security) security_record.fields["criminal"] = "*Arrest*" var/datum/antagonist/ninja/ninja_antag = ninja.mind.has_antag_datum(/datum/antagonist/ninja) diff --git a/code/modules/ninja/suit/ninja_equipment_actions/ninja_net.dm b/code/modules/ninja/suit/ninja_equipment_actions/ninja_net.dm index fbfc53f2d93..b4890fbf421 100644 --- a/code/modules/ninja/suit/ninja_equipment_actions/ninja_net.dm +++ b/code/modules/ninja/suit/ninja_equipment_actions/ninja_net.dm @@ -12,7 +12,7 @@ */ /obj/item/clothing/suit/space/space_ninja/proc/ninjanet() var/mob/living/carbon/human/ninja = affecting - var/mob/living/net_target = input("Select who to capture:","Capture who?",null) as null|mob in sortNames(oview(ninja)) + var/mob/living/net_target = input("Select who to capture:","Capture who?",null) as null|mob in sort_names(oview(ninja)) if(QDELETED(net_target)||!(net_target in oview(ninja))) return diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 913889fd0be..d567e30763d 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -451,7 +451,7 @@ return if((can_flashlight && gun_light) && (can_bayonet && bayonet)) //give them a choice instead of removing both var/list/possible_items = list(gun_light, bayonet) - var/obj/item/item_to_remove = input(user, "Select an attachment to remove", "Attachment Removal") as null|obj in sortNames(possible_items) + var/obj/item/item_to_remove = input(user, "Select an attachment to remove", "Attachment Removal") as null|obj in sort_names(possible_items) if(!item_to_remove || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return return remove_gun_attachment(user, I, item_to_remove) diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 69226ff2b39..d9b7494c712 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -89,11 +89,11 @@ /obj/machinery/chem_dispenser/Initialize(mapload) . = ..() - dispensable_reagents = sortList(dispensable_reagents, /proc/cmp_reagents_asc) + dispensable_reagents = sort_list(dispensable_reagents, /proc/cmp_reagents_asc) if(emagged_reagents) - emagged_reagents = sortList(emagged_reagents, /proc/cmp_reagents_asc) + emagged_reagents = sort_list(emagged_reagents, /proc/cmp_reagents_asc) if(upgrade_reagents) - upgrade_reagents = sortList(upgrade_reagents, /proc/cmp_reagents_asc) + upgrade_reagents = sort_list(upgrade_reagents, /proc/cmp_reagents_asc) if(is_operational) begin_processing() update_appearance() diff --git a/code/modules/reagents/reagent_containers/borghydro.dm b/code/modules/reagents/reagent_containers/borghydro.dm index 92efdbe6172..a17145159db 100644 --- a/code/modules/reagents/reagent_containers/borghydro.dm +++ b/code/modules/reagents/reagent_containers/borghydro.dm @@ -123,7 +123,7 @@ Borg Hypospray log_combat(user, M, "injected", src, "(CHEMICALS: [english_list(injected)])") /obj/item/reagent_containers/borghypo/attack_self(mob/user) - var/chosen_reagent = modes[reagent_names[input(user, "What reagent do you want to dispense?") as null|anything in sortList(reagent_names)]] + var/chosen_reagent = modes[reagent_names[input(user, "What reagent do you want to dispense?") as null|anything in sort_list(reagent_names)]] if(!chosen_reagent) return mode = chosen_reagent diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm index 23336d379df..1db28a47037 100644 --- a/code/modules/research/experimentor.dm +++ b/code/modules/research/experimentor.dm @@ -194,7 +194,7 @@ use_power(750) if(dotype != FAIL) var/list/nodes = techweb_item_boost_check(process) - var/picked = pickweight(nodes) //This should work. + var/picked = pick_weight(nodes) //This should work. stored_research.boost_with_path(SSresearch.techweb_node_by_id(picked), process.type) updateUsrDialog() @@ -285,7 +285,7 @@ else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff)) var/savedName = "[exp_on]" ejectItem(TRUE) - var/newPath = text2path(pickweight(valid_items)) + var/newPath = text2path(pick_weight(valid_items)) loaded_item = new newPath(src) visible_message(span_warning("[src] malfunctions, transforming [savedName] into [loaded_item]!")) investigate_log("Experimentor has transformed [savedName] into [loaded_item]", INVESTIGATE_EXPERIMENTOR) diff --git a/code/modules/research/xenobiology/crossbreeding/charged.dm b/code/modules/research/xenobiology/crossbreeding/charged.dm index f0a4d93ecc2..a65735ca558 100644 --- a/code/modules/research/xenobiology/crossbreeding/charged.dm +++ b/code/modules/research/xenobiology/crossbreeding/charged.dm @@ -169,7 +169,7 @@ Charged extracts: if(!istype(H)) to_chat(user, span_warning("You must be a humanoid to use this!")) return - var/racechoice = input(H, "Choose your slime subspecies.", "Slime Selection") as null|anything in sortList(subtypesof(/datum/species/jelly), /proc/cmp_typepaths_asc) + var/racechoice = input(H, "Choose your slime subspecies.", "Slime Selection") as null|anything in sort_list(subtypesof(/datum/species/jelly), /proc/cmp_typepaths_asc) if(!racechoice) to_chat(user, span_notice("You decide not to become a slime for now.")) return diff --git a/code/modules/research/xenobiology/crossbreeding/selfsustaining.dm b/code/modules/research/xenobiology/crossbreeding/selfsustaining.dm index 731b4dab961..da67881218e 100644 --- a/code/modules/research/xenobiology/crossbreeding/selfsustaining.dm +++ b/code/modules/research/xenobiology/crossbreeding/selfsustaining.dm @@ -32,7 +32,7 @@ Self-sustaining extracts: return ..() /obj/item/autoslime/attack_self(mob/user) - var/reagentselect = input(user, "Choose the reagent the extract will produce.", "Self-sustaining Reaction") as null|anything in sortList(extract.activate_reagents, /proc/cmp_typepaths_asc) + var/reagentselect = input(user, "Choose the reagent the extract will produce.", "Self-sustaining Reaction") as null|anything in sort_list(extract.activate_reagents, /proc/cmp_typepaths_asc) var/amount = 5 var/secondary diff --git a/code/modules/research/xenobiology/crossbreeding/stabilized.dm b/code/modules/research/xenobiology/crossbreeding/stabilized.dm index b5c01f6e726..3d298e320d4 100644 --- a/code/modules/research/xenobiology/crossbreeding/stabilized.dm +++ b/code/modules/research/xenobiology/crossbreeding/stabilized.dm @@ -134,7 +134,7 @@ Stabilized extracts: generate_mobtype() /obj/item/slimecross/stabilized/gold/attack_self(mob/user) - var/choice = input(user, "Which do you want to reset?", "Familiar Adjustment") as null|anything in sortList(list("Familiar Location", "Familiar Species", "Familiar Sentience", "Familiar Name")) + var/choice = input(user, "Which do you want to reset?", "Familiar Adjustment") as null|anything in sort_list(list("Familiar Location", "Familiar Species", "Familiar Sentience", "Familiar Name")) if(!user.canUseTopic(src, BE_CLOSE)) return if(isliving(user)) diff --git a/code/modules/research/xenobiology/vatgrowing/samples/_sample.dm b/code/modules/research/xenobiology/vatgrowing/samples/_sample.dm index 8047e863fb4..c8485b94f78 100644 --- a/code/modules/research/xenobiology/vatgrowing/samples/_sample.dm +++ b/code/modules/research/xenobiology/vatgrowing/samples/_sample.dm @@ -13,13 +13,13 @@ var/list/temp_weight_list = GLOB.cell_line_tables[cell_line_define].Copy() //Temp list to prevent double picking for(var/i in 1 to cell_line_amount) - var/datum/micro_organism/chosen_type = pickweight(temp_weight_list) + var/datum/micro_organism/chosen_type = pick_weight(temp_weight_list) temp_weight_list -= chosen_type micro_organisms += new chosen_type if(prob(virus_chance)) if(!GLOB.cell_virus_tables[virus_define]) return - var/datum/micro_organism/chosen_type = pickweight(GLOB.cell_virus_tables[virus_define]) + var/datum/micro_organism/chosen_type = pick_weight(GLOB.cell_virus_tables[virus_define]) micro_organisms += new chosen_type ///Takes another sample and merges it into use. This can cause one very big sample but we limit it to 3 layers. diff --git a/code/modules/shuttle/navigation_computer.dm b/code/modules/shuttle/navigation_computer.dm index 14d86ebb826..d2084806518 100644 --- a/code/modules/shuttle/navigation_computer.dm +++ b/code/modules/shuttle/navigation_computer.dm @@ -378,7 +378,7 @@ L["([L.len]) [nav_beacon.name] locked"] = null playsound(console, 'sound/machines/terminal_prompt.ogg', 25, FALSE) - var/selected = input("Choose location to jump to", "Locations", null) as null|anything in sortList(L) + var/selected = input("Choose location to jump to", "Locations", null) as null|anything in sort_list(L) if(QDELETED(src) || QDELETED(target) || !isliving(target)) return playsound(src, "terminal_type", 25, FALSE) diff --git a/code/modules/spells/spell.dm b/code/modules/spells/spell.dm index 9150944521a..a0f891c7c29 100644 --- a/code/modules/spells/spell.dm +++ b/code/modules/spells/spell.dm @@ -452,7 +452,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th //Adds a safety check post-input to make sure those targets are actually in range. var/mob/M if(!random_target) - M = input("Choose the target for the spell.", "Targeting") as null|mob in sortNames(possible_targets) + M = input("Choose the target for the spell.", "Targeting") as null|mob in sort_names(possible_targets) else switch(random_target_priority) if(TARGET_RANDOM) diff --git a/code/modules/spells/spell_types/shapeshift.dm b/code/modules/spells/spell_types/shapeshift.dm index 9a24d957d64..a972050fbfe 100644 --- a/code/modules/spells/spell_types/shapeshift.dm +++ b/code/modules/spells/spell_types/shapeshift.dm @@ -40,7 +40,7 @@ animal_list[initial(animal.name)] = path var/image/animal_image = image(icon = initial(animal.icon), icon_state = initial(animal.icon_state)) display_animals += list(initial(animal.name) = animal_image) - sortList(display_animals) + sort_list(display_animals) var/new_shapeshift_type = show_radial_menu(M, M, display_animals, custom_check = CALLBACK(src, .proc/check_menu, user), radius = 38, require_near = TRUE) if(shapeshift_type) return diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm index 0f0e9f8ccf6..1fe383b3d62 100644 --- a/code/modules/surgery/bodyparts/_bodyparts.dm +++ b/code/modules/surgery/bodyparts/_bodyparts.dm @@ -977,7 +977,7 @@ bleed_rate += 0.5 //We want an accurate reading of .len - listclearnulls(embedded_objects) + list_clear_nulls(embedded_objects) for(var/obj/item/embeddies in embedded_objects) if(!embeddies.isEmbedHarmless()) bleed_rate += 0.25 diff --git a/code/modules/surgery/organ_manipulation.dm b/code/modules/surgery/organ_manipulation.dm index 24280d5c5d0..fc543fe58ee 100644 --- a/code/modules/surgery/organ_manipulation.dm +++ b/code/modules/surgery/organ_manipulation.dm @@ -118,7 +118,7 @@ organs -= organ organs[organ.name] = organ - target_organ = input("Remove which organ?", "Surgery", null, null) as null|anything in sortList(organs) + target_organ = input("Remove which organ?", "Surgery", null, null) as null|anything in sort_list(organs) if(target_organ && user && target && user.Adjacent(target) && user.get_active_held_item() == tool) target_organ = organs[target_organ] if(!target_organ) diff --git a/code/modules/vehicles/mecha/_mecha.dm b/code/modules/vehicles/mecha/_mecha.dm index 97002789f18..8dfe8b0560d 100644 --- a/code/modules/vehicles/mecha/_mecha.dm +++ b/code/modules/vehicles/mecha/_mecha.dm @@ -829,7 +829,7 @@ to_chat(user, span_warning("No AI detected in the [name] onboard computer.")) return if(ai_pilots.len > 1) //Input box for multiple AIs, but if there's only one we'll default to them. - AI = input(user,"Which AI do you wish to card?", "AI Selection") as null|anything in sortList(ai_pilots) + AI = input(user,"Which AI do you wish to card?", "AI Selection") as null|anything in sort_list(ai_pilots) else AI = ai_pilots[1] if(!AI)
    [line]