From fa519bdde3d6d17f6b8aaabab95f0fc48c73a326 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 13 Oct 2021 22:07:35 +0200 Subject: [PATCH] [MIRROR] cleanup _HELPERS/_lists.dm and all the necessary files [MDB IGNORE] (#8783) * cleanup _HELPERS/_lists.dm and all the necessary files * Epbic Co-authored-by: Ghilker <42839747+Ghilker@users.noreply.github.com> Co-authored-by: Gandalf --- 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 | 11 +- 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/traumas.dm | 263 ---- 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/miscellaneous.dm | 409 ------ code/game/objects/items/pinpointer.dm | 2 +- code/game/objects/items/storage/backpack.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/randomverbs.dm | 1111 ----------------- 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/preferences_toggles.dm | 517 -------- 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 | 4 +- .../suit/ninja_equipment_actions/ninja_net.dm | 2 +- code/modules/projectiles/gun.dm | 2 +- .../chemistry/machinery/chem_dispenser.dm | 12 +- .../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 +- .../game/objects/structures/trash_pile.dm | 4 +- .../code/modules/projectiles/guns/gun.dm | 4 +- .../code/advanced_choice_beacon.dm | 4 +- .../modules/mob/living/silicon/robot/robot.dm | 2 +- .../mob/living/silicon/robot/robot_modules.dm | 20 +- modular_skyrat/modules/cme/code/cme.dm | 6 +- .../modules/client/preferences.dm | 6 +- .../modules/client/preferences_savefile.dm | 2 +- .../code/additionalemotes/turf_emote.dm | 2 +- .../modules/fishing/code/fishing.dm | 2 +- .../icspawning/code/_onclick/observer.dm | 8 +- .../modules/mentor/code/mentorpm.dm | 2 +- .../modules/sec_haul/code/guns/ammo.dm | 4 +- .../modules/sec_haul/code/guns/gun_spawns.dm | 4 +- .../game/objects/items/borg_shapeshifter.dm | 26 +- .../living/sillicon/robot/robot_module.dm | 4 +- .../modules/research/xenoarch/strange_rock.dm | 6 +- .../research/xenoarch/xenoarch_machine.dm | 14 +- .../research/xenoarch/xenoarch_tool.dm | 14 +- 231 files changed, 626 insertions(+), 2896 deletions(-) delete mode 100644 code/controllers/subsystem/traumas.dm delete mode 100644 code/game/objects/items/miscellaneous.dm delete mode 100644 code/modules/admin/verbs/randomverbs.dm delete mode 100644 code/modules/client/preferences_toggles.dm diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index b24bcc44468..e34284e3ed8 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -240,7 +240,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 73b0945aa03..7f564757b5c 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) @@ -454,7 +454,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 29dfe3c4efb..b1270078add 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -43,24 +43,25 @@ for(var/spath in subtypesof(/datum/scream_type)) var/datum/scream_type/S = new spath() GLOB.scream_types[S.name] = spath - sortList(GLOB.scream_types, /proc/cmp_typepaths_asc) + sort_list(GLOB.scream_types, /proc/cmp_typepaths_asc) //Laugh types for(var/spath in subtypesof(/datum/laugh_type)) var/datum/laugh_type/L = new spath() GLOB.laugh_types[L.name] = spath - sortList(GLOB.laugh_types, /proc/cmp_typepaths_asc) + sort_list(GLOB.laugh_types, /proc/cmp_typepaths_asc) + //SKYRAT EDIT END //Species 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)) @@ -81,7 +82,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 208ad2c2546..afa74e02a1a 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -144,7 +144,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", @@ -643,7 +643,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 . @@ -652,7 +652,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 . @@ -680,7 +680,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 2c2dccddd40..824495076f6 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -322,7 +322,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 9c295b98c76..3e75cc93d99 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -713,7 +713,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 ac038b0ae45..79373479b5d 100644 --- a/code/_globalvars/lists/flavor_misc.dm +++ b/code/_globalvars/lists/flavor_misc.dm @@ -122,7 +122,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", @@ -183,7 +183,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 8a926f7c650..061aefef547 100644 --- a/code/controllers/subsystem/blackbox.dm +++ b/code/controllers/subsystem/blackbox.dm @@ -64,7 +64,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 d3d91f66fae..d81fea9f367 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -416,7 +416,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] @@ -458,7 +458,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 710714b4fdc..099ab160c06 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 e2169be4759..37007afa2a9 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 aad87742348..f5e9d53bcca 100644 --- a/code/controllers/subsystem/shuttle.dm +++ b/code/controllers/subsystem/shuttle.dm @@ -846,7 +846,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 4fbe9feadce..7fbb0d0e15f 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -485,7 +485,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')) @@ -499,7 +499,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/traumas.dm b/code/controllers/subsystem/traumas.dm deleted file mode 100644 index 0f172954c56..00000000000 --- a/code/controllers/subsystem/traumas.dm +++ /dev/null @@ -1,263 +0,0 @@ -SUBSYSTEM_DEF(traumas) - name = "Traumas" - flags = SS_NO_FIRE - var/list/phobia_types - var/list/phobia_regexes - var/list/phobia_mobs - var/list/phobia_objs - var/list/phobia_turfs - var/list/phobia_species - -#define PHOBIA_FILE "phobia.json" - -/datum/controller/subsystem/traumas/Initialize() - //phobia types is to pull from randomly for brain traumas, e.g. conspiracies is for special assignment only - phobia_types = sortList(list("spiders", "space", "security", "clowns", "greytide", "lizards", - "skeletons", "snakes", "robots", "doctors", "authority", "the supernatural", - "aliens", "strangers", "birds", "falling", "anime", "insects", "guns")) - - phobia_regexes = list( - "spiders" = construct_phobia_regex("spiders"), - "space" = construct_phobia_regex("space"), - "security" = construct_phobia_regex("security"), - "clowns" = construct_phobia_regex("clowns"), - "greytide" = construct_phobia_regex("greytide"), - "lizards" = construct_phobia_regex("lizards"), - "skeletons" = construct_phobia_regex("skeletons"), - "snakes" = construct_phobia_regex("snakes"), - "robots" = construct_phobia_regex("robots"), - "doctors" = construct_phobia_regex("doctors"), - "authority" = construct_phobia_regex("authority"), - "the supernatural" = construct_phobia_regex("the supernatural"), - "aliens" = construct_phobia_regex("aliens"), - "strangers" = construct_phobia_regex("strangers"), - "conspiracies" = construct_phobia_regex("conspiracies"), - "birds" = construct_phobia_regex("birds"), - "falling" = construct_phobia_regex("falling"), - "anime" = construct_phobia_regex("anime"), - "insects" = construct_phobia_regex("insects"), - "ocky icky" = construct_phobia_regex("ocky icky"), - "guns" = construct_phobia_regex("guns"), - ) - - phobia_mobs = list( - "spiders" = typecacheof(list(/mob/living/simple_animal/hostile/giant_spider)), - "security" = typecacheof(list(/mob/living/simple_animal/bot/secbot)), - "lizards" = typecacheof(list(/mob/living/simple_animal/hostile/lizard)), - "skeletons" = typecacheof(list(/mob/living/simple_animal/hostile/skeleton)), - "snakes" = typecacheof(list(/mob/living/simple_animal/hostile/retaliate/snake)), - "robots" = typecacheof(list(/mob/living/silicon/robot, /mob/living/silicon/ai, - /mob/living/simple_animal/drone, /mob/living/simple_animal/bot, /mob/living/simple_animal/hostile/swarmer, - )), - "doctors" = typecacheof(list(/mob/living/simple_animal/bot/medbot)), - "the supernatural" = typecacheof(list( - /mob/living/simple_animal/hostile/construct, - /mob/living/simple_animal/revenant, /mob/living/simple_animal/shade, - /mob/living/simple_animal/hostile/skeleton, /mob/living/simple_animal/hostile/retaliate/ghost, - /mob/living/simple_animal/hostile/imp, /mob/dead/observer, /mob/living/simple_animal/bot/mulebot/paranormal, - /mob/living/simple_animal/hostile/retaliate/bat, /mob/living/simple_animal/hostile/dark_wizard, - /mob/living/simple_animal/hostile/faithless, /mob/living/simple_animal/hostile/wizard, - /mob/living/simple_animal/hostile/zombie - )), - "aliens" = typecacheof(list(/mob/living/carbon/alien, /mob/living/simple_animal/slime)), - "conspiracies" = typecacheof(list( - /mob/living/simple_animal/bot/secbot, /mob/living/simple_animal/drone, - /mob/living/simple_animal/pet/penguin - )), - "birds" = typecacheof(list( - /mob/living/simple_animal/parrot, /mob/living/simple_animal/chick, /mob/living/simple_animal/chicken, - /mob/living/simple_animal/pet/penguin, - )), - "anime" = typecacheof(list(/mob/living/simple_animal/hostile/guardian)), - "clowns" = typecacheof(list(/mob/living/simple_animal/hostile/retaliate/clown, /mob/living/simple_animal/bot/honkbot)), - "insects" = typecacheof(list(/mob/living/basic/cockroach, /mob/living/simple_animal/hostile/bee)) - ) - - phobia_objs = list( - "snakes" = typecacheof(list(/obj/item/rod_of_asclepius, /obj/item/toy/plush/snakeplushie)), - "spiders" = typecacheof(list(/obj/structure/spider)), - "security" = typecacheof(list( - /obj/item/clothing/under/rank/security/officer, /obj/item/clothing/under/rank/security/warden, - /obj/item/clothing/under/rank/security/head_of_security, /obj/item/clothing/under/rank/security/detective, - /obj/item/melee/baton, /obj/item/gun/energy/taser, /obj/item/restraints/handcuffs, - /obj/machinery/door/airlock/security, /obj/effect/hallucination/simple/securitron, - /obj/item/stamp/hos, /obj/item/megaphone/sec, /obj/item/toy/figure/hos, /obj/item/toy/figure/secofficer, - /obj/structure/statue/silver/sec, /obj/structure/statue/silver/secborg, /obj/structure/statue/gold/hos - )), - "clowns" = typecacheof(list( - /obj/item/clothing/under/rank/civilian/clown, /obj/item/clothing/shoes/clown_shoes, - /obj/item/clothing/mask/gas/clown_hat, /obj/item/instrument/bikehorn, - /obj/item/pda/clown, /obj/item/grown/bananapeel, /obj/item/food/cheesiehonkers, - /obj/item/trash/cheesie, /obj/item/stack/ore/bananium, /obj/item/stack/tile/mineral/bananium, - /obj/structure/falsewall/bananium, /obj/item/stack/ore/bananium, /obj/machinery/door/airlock/bananium, - /obj/structure/statue/bananium, /obj/item/toy/crayon/rainbow, /obj/vehicle/sealed/mecha/combat/honker, - /obj/item/toy/mecha/honk, /obj/item/toy/mecha/darkhonk, - /obj/structure/mecha_wreckage/honker, /obj/item/megaphone/clown, /obj/item/stamp/clown, - /obj/item/storage/backpack/clown, /obj/item/storage/backpack/ert/clown, /obj/item/storage/backpack/duffelbag/clown, - /obj/item/food/pie/cream, /obj/item/pneumatic_cannon/pie, /obj/item/bedsheet/clown, /obj/vehicle/sealed/car/clowncar, - /obj/item/gun/magic/staff/honk, /obj/item/clothing/suit/chaplainsuit/clownpriest, /obj/item/clothing/head/clownmitre, - /obj/item/clothing/under/plasmaman/clown - )), - - "greytide" = typecacheof(list(/obj/item/clothing/under/color/grey, /obj/item/melee/baton/security/cattleprod, - /obj/item/spear, /obj/item/clothing/mask/gas, - )), - "lizards" = typecacheof(list( - /obj/item/toy/plush/lizard_plushie, /obj/item/food/kebab/tail, /obj/item/organ/tail/lizard, - /obj/item/reagent_containers/food/drinks/bottle/lizardwine, /obj/item/clothing/head/lizard, /obj/item/clothing/shoes/cowboy/lizard, - )), - "skeletons" = typecacheof(list( - /obj/item/organ/tongue/bone, /obj/item/clothing/suit/armor/bone, /obj/item/stack/sheet/bone, - /obj/item/food/meat/slab/human/mutant/skeleton, - /obj/effect/decal/remains/human, - )), - "conspiracies" = typecacheof(list( - /obj/item/clothing/under/rank/captain, /obj/item/clothing/under/rank/security/head_of_security, - /obj/item/clothing/under/rank/engineering/chief_engineer, /obj/item/clothing/under/rank/medical/chief_medical_officer, - /obj/item/clothing/under/rank/civilian/head_of_personnel, /obj/item/clothing/under/rank/rnd/research_director, - /obj/item/clothing/under/rank/security/head_of_security/grey, /obj/item/clothing/under/rank/security/head_of_security/alt, - /obj/item/clothing/under/rank/rnd/research_director/alt, /obj/item/clothing/under/rank/rnd/research_director/turtleneck, - /obj/item/clothing/under/rank/captain/parade, /obj/item/clothing/under/rank/security/head_of_security/parade, /obj/item/clothing/under/rank/security/head_of_security/parade/female, - /obj/item/clothing/head/helmet/abductor, /obj/item/clothing/suit/armor/abductor/vest, /obj/item/melee/baton/abductor, - /obj/item/storage/belt/military/abductor, /obj/item/gun/energy/alien, /obj/item/abductor/silencer, - /obj/item/abductor/gizmo, /obj/item/clothing/under/rank/centcom/officer, - /obj/item/clothing/suit/space/hardsuit/ert, /obj/item/clothing/suit/space/hardsuit/ert/sec, - /obj/item/clothing/suit/space/hardsuit/ert/engi, /obj/item/clothing/suit/space/hardsuit/ert/med, - /obj/item/clothing/suit/space/hardsuit/deathsquad, /obj/item/clothing/head/helmet/space/hardsuit/deathsquad, - /obj/machinery/door/airlock/centcom, /obj/machinery/atmospherics/miner, /obj/item/toy/figure/captain, /obj/item/toy/figure/ce, - /obj/item/toy/figure/dsquad, /obj/item/toy/figure/hop, /obj/item/toy/figure/hos, /obj/item/toy/figure/rd, - /obj/item/toy/figure/cmo, /obj/item/stamp/captain, /obj/item/stamp/hop, /obj/item/stamp/hos, /obj/item/stamp/ce, - /obj/item/stamp/rd, /obj/item/stamp/cmo, /obj/item/stamp/centcom, /obj/item/megaphone/command - )), - "robots" = typecacheof(list( - /obj/machinery/computer/upload, /obj/item/ai_module, /obj/machinery/recharge_station, - /obj/item/aicard, /obj/structure/swarmer_beacon, /obj/item/toy/figure/borg, /obj/item/toy/talking/ai, - /obj/structure/statue/silver/medborg, /obj/structure/statue/silver/secborg, /obj/structure/statue/diamond/ai1, - /obj/structure/statue/diamond/ai2, - )), - "doctors" = typecacheof(list( - /obj/item/clothing/under/rank/medical, /obj/item/reagent_containers/syringe, - /obj/item/reagent_containers/pill/, /obj/item/reagent_containers/hypospray, - /obj/item/storage/firstaid, /obj/item/storage/pill_bottle, /obj/item/healthanalyzer, - /obj/structure/sign/departments/medbay, /obj/machinery/door/airlock/medical, /obj/machinery/sleeper, /obj/machinery/stasis, - /obj/machinery/dna_scannernew, /obj/machinery/atmospherics/components/unary/cryo_cell, /obj/item/surgical_drapes, - /obj/item/retractor, /obj/item/hemostat, /obj/item/cautery, /obj/item/surgicaldrill, /obj/item/scalpel, /obj/item/circular_saw, - /obj/item/clothing/suit/bio_suit/plaguedoctorsuit, /obj/item/clothing/head/plaguedoctorhat, /obj/item/clothing/mask/gas/plaguedoctor, - /obj/item/toy/figure/md, /obj/item/toy/figure/cmo, /obj/structure/statue/gold/cmo, - /obj/structure/statue/silver/md, /obj/structure/statue/silver/medborg - )), - "authority" = typecacheof(list( - /obj/item/clothing/under/rank/captain, /obj/item/clothing/under/rank/civilian/head_of_personnel, - /obj/item/clothing/under/rank/security/head_of_security, /obj/item/clothing/under/rank/rnd/research_director, - /obj/item/clothing/under/rank/medical/chief_medical_officer, /obj/item/clothing/under/rank/engineering/chief_engineer, - /obj/item/clothing/under/rank/centcom/officer, /obj/item/clothing/under/rank/centcom/commander, - /obj/item/melee/baton/telescopic, /obj/item/card/id/advanced/silver, /obj/item/card/id/advanced/gold, - /obj/item/card/id/advanced/centcom, /obj/machinery/door/airlock/command, /obj/item/card/id/advanced/black, - /obj/item/toy/figure/captain, /obj/item/toy/figure/ce, - /obj/item/toy/figure/dsquad, /obj/item/toy/figure/hop, /obj/item/toy/figure/hos, /obj/item/toy/figure/rd, - /obj/item/toy/figure/cmo, /obj/item/stamp/captain, /obj/item/stamp/hop, /obj/item/stamp/hos, /obj/item/stamp/ce, - /obj/item/stamp/rd, /obj/item/stamp/cmo, /obj/item/stamp/centcom, /obj/item/megaphone/command, - /obj/structure/statue/gold/hos, /obj/structure/statue/gold/ce, /obj/structure/statue/gold/cmo, /obj/structure/statue/gold/rd, - /obj/structure/statue/gold/hop, /obj/structure/statue/diamond/captain - )), - "the supernatural" = typecacheof(list( - /obj/structure/destructible/cult, /obj/item/tome, - /obj/item/melee/cultblade, /obj/item/cult_bastard, - /obj/item/restraints/legcuffs/bola/cult, /obj/item/clothing/suit/space/hardsuit/cult, - /obj/item/clothing/suit/hooded/cultrobes, /obj/item/clothing/head/hooded/cult_hoodie, /obj/effect/rune, - /obj/item/stack/sheet/runed_metal, /obj/machinery/door/airlock/cult, /obj/narsie, /obj/item/soulstone, - /obj/item/clothing/suit/wizrobe, /obj/item/clothing/head/wizard, /obj/item/spellbook, /obj/item/staff, - /obj/item/clothing/suit/space/hardsuit/shielded/wizard, /obj/item/clothing/suit/space/hardsuit/wizard, - /obj/item/gun/magic/staff, /obj/item/gun/magic/wand, /obj/item/scrying, /obj/item/necromantic_stone, - /obj/item/warpwhistle, /obj/item/nullrod, /obj/item/clothing/under/rank/civilian/chaplain, - /obj/structure/spirit_board, /obj/item/toy/eightball/haunted, /obj/item/storage/toolbox/haunted, - /obj/item/stack/sheet/hauntium, - )), - "aliens" = typecacheof(list( - /obj/item/clothing/mask/facehugger, /obj/item/organ/body_egg/alien_embryo, - /obj/structure/alien, /obj/item/toy/toy_xeno, - /obj/item/clothing/suit/armor/abductor, /obj/item/abductor, /obj/item/gun/energy/alien, - /obj/item/melee/baton/abductor, /obj/item/radio/headset/abductor, /obj/item/scalpel/alien, /obj/item/hemostat/alien, - /obj/item/retractor/alien, /obj/item/circular_saw/alien, /obj/item/surgicaldrill/alien, /obj/item/cautery/alien, - /obj/item/clothing/head/helmet/abductor, /obj/structure/bed/abductor, /obj/structure/table_frame/abductor, - /obj/structure/table/abductor, /obj/structure/table/optable/abductor, /obj/structure/closet/abductor, /obj/item/organ/heart/gland, - /obj/machinery/abductor, /obj/item/crowbar/abductor, /obj/item/screwdriver/abductor, /obj/item/weldingtool/abductor, - /obj/item/wirecutters/abductor, /obj/item/wrench/abductor, /obj/item/stack/sheet/mineral/abductor, /obj/item/toy/toy_xeno, - /obj/structure/statue/plasma/xeno - )), - "birds" = typecacheof(list( - /obj/item/clothing/mask/gas/plaguedoctor, /obj/item/food/cracker, - /obj/item/clothing/suit/chickensuit, /obj/item/clothing/head/chicken, - /obj/item/clothing/suit/toggle/owlwings, /obj/item/clothing/under/costume/owl, /obj/item/clothing/mask/gas/owl_mask, - /obj/item/clothing/under/costume/griffin, /obj/item/clothing/shoes/griffin, /obj/item/clothing/head/griffin, - /obj/item/clothing/head/helmet/space/freedom, /obj/item/clothing/suit/space/freedom, - )), - "anime" = typecacheof(list( - /obj/item/clothing/under/costume/schoolgirl, /obj/item/katana, /obj/item/food/sashimi, /obj/item/food/chawanmushi, - /obj/item/reagent_containers/food/drinks/bottle/sake, /obj/item/throwing_star, /obj/item/clothing/head/kitty/genuine, - /obj/item/clothing/suit/space/space_ninja, /obj/item/clothing/mask/gas/space_ninja, /obj/item/clothing/shoes/space_ninja, - /obj/item/clothing/gloves/space_ninja, /obj/item/vibro_weapon, /obj/item/nullrod/scythe/vibro, - /obj/item/energy_katana, /obj/item/toy/katana, /obj/item/nullrod/claymore/katana, - /obj/structure/window/paperframe, /obj/structure/mineral_door/paperframe - )), - "birds" = typecacheof(list( - /obj/item/clothing/mask/gas/plaguedoctor, /obj/item/food/cracker, - /obj/item/clothing/suit/chickensuit, /obj/item/clothing/head/chicken, - /obj/item/clothing/suit/toggle/owlwings, /obj/item/clothing/under/costume/owl, /obj/item/clothing/mask/gas/owl_mask, - /obj/item/clothing/under/costume/griffin, /obj/item/clothing/shoes/griffin, /obj/item/clothing/head/griffin, - /obj/item/clothing/head/helmet/space/freedom, /obj/item/clothing/suit/space/freedom - )), - "guns" = typecacheof(list( - /obj/item/gun/ballistic, /obj/item/gun/energy, /obj/item/gun/syringe, /obj/item/gun/chem, - /obj/item/gun/blastcannon, /obj/item/gun/grenadelauncher, /obj/machinery/porta_turret, /obj/machinery/power/emitter, - /obj/item/ammo_casing, /obj/item/storage/belt/bandolier, /obj/item/storage/belt/holster, /obj/item/ammo_box, - /obj/item/mecha_ammo, /obj/item/mecha_parts/mecha_equipment/weapon/ballistic, /obj/item/mecha_parts/mecha_equipment/weapon/energy - )), - "insects" = typecacheof(list( - /obj/item/toy/plush/moth, /obj/item/toy/plush/beeplushie, /obj/item/clothing/mask/animal/rat/bee, - /obj/item/clothing/suit/hooded/bee_costume, /obj/structure/beebox - )), - ) - - phobia_turfs = list( - "space" = typecacheof(list(/turf/open/space, /turf/open/floor/holofloor/space, /turf/open/floor/fakespace)), - "the supernatural" = typecacheof(list(/turf/open/floor/cult, /turf/closed/wall/mineral/cult)), - "aliens" = typecacheof(list( - /turf/open/floor/plating/abductor, /turf/open/floor/plating/abductor2, - /turf/open/floor/mineral/abductor, /turf/closed/wall/mineral/abductor - )), - "clowns" = typecacheof(list(/turf/closed/wall/mineral/bananium, /turf/open/floor/mineral/bananium)), - "falling" = typecacheof(list(/turf/open/chasm, /turf/open/floor/fakepit, /turf/open/openspace)) - ) - - phobia_species = list( - "lizards" = typecacheof(list(/datum/species/lizard)), - "skeletons" = typecacheof(list(/datum/species/skeleton, /datum/species/plasmaman)), - "conspiracies" = typecacheof(list(/datum/species/abductor, /datum/species/lizard, /datum/species/synth)), - "robots" = typecacheof(list(/datum/species/android)), - "the supernatural" = typecacheof(list( - /datum/species/golem/runic, /datum/species/skeleton, /datum/species/zombie, - /datum/species/vampire, /datum/species/shadow - )), - "aliens" = typecacheof(list(/datum/species/abductor, /datum/species/jelly, /datum/species/pod, /datum/species/shadow)), - "anime" = typecacheof(list(/datum/species/human/felinid)), - "clowns" = typecacheof(list(/datum/species/golem/bananium)), - "insects" = typecacheof(list(/datum/species/fly, /datum/species/moth)) - ) - - return ..() - -///Creates a regular expression to match against the given phobia -///Capture group 2 = the scary word -///Capture group 3 = an optional suffix on the scary word -/datum/controller/subsystem/traumas/proc/construct_phobia_regex(list/name) - var/list/words = strings(PHOBIA_FILE, name) - if(!length(words)) - CRASH("phobia [name] has no entries") - var/words_match = "" - for(var/word in words) - words_match += "[REGEX_QUOTE(word)]|" - words_match = copytext(words_match, 1, -1) - return regex("(\\b|\\A)([words_match])('?s*)(\\b|\\|)", "ig") - -#undef PHOBIA_FILE 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 4faad72be8c..207ca64cb6d 100644 --- a/code/datums/mapgen/CaveGenerator.dm +++ b/code/datums/mapgen/CaveGenerator.dm @@ -67,7 +67,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) @@ -87,7 +87,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 @@ -98,7 +98,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)) @@ -115,13 +115,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 ac5c9c61530..ec6aa9c5a46 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -505,7 +505,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) @@ -543,7 +543,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 073df6f4177..ce34a5ed17f 100755 --- a/code/datums/outfit.dm +++ b/code/datums/outfit.dm @@ -349,7 +349,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 18f4ed5e40f..602a14b1a0e 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 2135f6f91d9..ea9f1e8323f 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1263,7 +1263,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 91297884e82..fb23d839014 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 986bb080cf0..c786b5ab23e 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 4ff2c6f25fc..a30361160fa 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 ebd2f0e81ba..1445f01ce51 100644 --- a/code/game/machinery/computer/atmos_control.dm +++ b/code/game/machinery/computer/atmos_control.dm @@ -435,7 +435,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 37bee146f68..763df4faeb1 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -65,7 +65,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 20c2c4b1fa4..0b429bd042b 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -287,7 +287,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 60dedbf9043..93fcf6bf54a 100644 --- a/code/game/machinery/computer/teleporter.dm +++ b/code/game/machinery/computer/teleporter.dm @@ -188,7 +188,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)]") @@ -197,7 +197,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 86323384942..72e53f4a170 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1233,7 +1233,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 0e272108974..bbd0e5e3660 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -318,7 +318,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 580c760ada1..bb04c33d6ea 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 f44e961c683..1f0b1d2a1f6 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -1313,7 +1313,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 19cdcbc9a6f..cdfc8bb2125 100644 --- a/code/game/objects/items/circuitboards/machine_circuitboards.dm +++ b/code/game/objects/items/circuitboards/machine_circuitboards.dm @@ -566,7 +566,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 bf5a7744b7e..ff5563b1d8c 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -1220,7 +1220,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 @@ -1269,7 +1269,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 2e248ac417e..8217b1fcc75 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 457b9382fd9..eb24c363cf2 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 8e81dddbdca..8c1d72ce830 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -902,7 +902,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 29e0ae80f73..369b71b642c 100644 --- a/code/game/objects/items/mail.dm +++ b/code/game/objects/items/mail.dm @@ -160,7 +160,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/miscellaneous.dm b/code/game/objects/items/miscellaneous.dm deleted file mode 100644 index a795e99c631..00000000000 --- a/code/game/objects/items/miscellaneous.dm +++ /dev/null @@ -1,409 +0,0 @@ -/obj/item/choice_beacon - name = "choice beacon" - desc = "Hey, why are you viewing this?!! Please let CentCom know about this odd occurrence." - icon = 'icons/obj/device.dmi' - icon_state = "gangtool-blue" - inhand_icon_state = "radio" - var/uses = 1 - -/obj/item/choice_beacon/attack_self(mob/user) - if(canUseBeacon(user)) - generate_options(user) - -/obj/item/choice_beacon/proc/generate_display_names() // return the list that will be used in the choice selection. entries should be in (type.name = type) fashion. see choice_beacon/hero for how this is done. - return list() - -/obj/item/choice_beacon/proc/canUseBeacon(mob/living/user) - if(user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) - return TRUE - else - playsound(src, 'sound/machines/buzz-sigh.ogg', 40, TRUE) - return FALSE - -/obj/item/choice_beacon/proc/generate_options(mob/living/M) - var/list/display_names = generate_display_names() - if(!display_names.len) - return - var/choice = input(M,"Which item would you like to order?","Select an Item") as null|anything in sortList(display_names) - if(!choice || !M.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) - return - - spawn_option(display_names[choice],M) - uses-- - if(!uses) - qdel(src) - else - to_chat(M, span_notice("[uses] use[uses > 1 ? "s" : ""] remaining on the [src].")) - -/obj/item/choice_beacon/proc/spawn_option(obj/choice,mob/living/M) - podspawn(list( - "target" = get_turf(src), - "style" = STYLE_BLUESPACE, - "spawn" = choice, - )) - var/msg = "After making your selection, you notice a strange target on the ground. It might be best to step back!" - if(ishuman(M)) - var/mob/living/carbon/human/H = M - if(istype(H.ears, /obj/item/radio/headset)) - msg = "You hear something crackle in your ears for a moment before a voice speaks. \"Please stand by for a message from Central Command. Message as follows: [span_bold("Item request received. Your package is inbound, please stand back from the landing site.")] Message ends.\"" - to_chat(M, msg) - -/obj/item/choice_beacon/ingredient - name = "ingredient delivery beacon" - desc = "Summon a box of ingredients to help you get started cooking." - icon_state = "gangtool-white" - -/obj/item/choice_beacon/ingredient/generate_display_names() - var/list/ingredients = list() - for(var/V in subtypesof(/obj/item/storage/box/ingredients)) - var/obj/item/storage/box/ingredients/A = V - ingredients[initial(A.theme_name)] = A - return ingredients - -/obj/item/choice_beacon/ingredient/spawn_option(obj/choice,mob/living/M) - new choice(get_turf(M)) - to_chat(M, span_hear("You hear something crackle from the beacon for a moment before a voice speaks. \"Please stand by for a message from Sophronia Broadcasting. Message as follows: Please enjoy your Sophronia Broadcasting's 'Plasteel Chef' Ingredients Box, exactly as shown in the hit show! Message ends.\"")) - -/obj/item/storage/box/ingredients //This box is for the randomly chosen version the chef used to spawn with, it shouldn't actually exist. - name = "ingredients box" - illustration = "fruit" - var/theme_name - -/obj/item/storage/box/ingredients/Initialize() - . = ..() - if(theme_name) - name = "[name] ([theme_name])" - desc = "A box containing supplementary ingredients for the aspiring chef. The box's theme is '[theme_name]'." - inhand_icon_state = "syringe_kit" - -/obj/item/storage/box/ingredients/wildcard - theme_name = "wildcard" - -/obj/item/storage/box/ingredients/wildcard/PopulateContents() - for(var/i in 1 to 7) - var/randomFood = pick(/obj/item/food/grown/chili, - /obj/item/food/grown/tomato, - /obj/item/food/grown/carrot, - /obj/item/food/grown/potato, - /obj/item/food/grown/potato/sweet, - /obj/item/food/grown/apple, - /obj/item/food/chocolatebar, - /obj/item/food/grown/cherries, - /obj/item/food/grown/banana, - /obj/item/food/grown/cabbage, - /obj/item/food/grown/soybeans, - /obj/item/food/grown/corn, - /obj/item/food/grown/mushroom/plumphelmet, - /obj/item/food/grown/mushroom/chanterelle) - new randomFood(src) - -/obj/item/storage/box/ingredients/fiesta - theme_name = "fiesta" - -/obj/item/storage/box/ingredients/fiesta/PopulateContents() - new /obj/item/food/tortilla(src) - for(var/i in 1 to 2) - new /obj/item/food/grown/corn(src) - new /obj/item/food/grown/soybeans(src) - new /obj/item/food/grown/chili(src) - -/obj/item/storage/box/ingredients/italian - theme_name = "italian" - -/obj/item/storage/box/ingredients/italian/PopulateContents() - for(var/i in 1 to 3) - new /obj/item/food/grown/tomato(src) - new /obj/item/food/meatball(src) - new /obj/item/reagent_containers/food/drinks/bottle/wine(src) - -/obj/item/storage/box/ingredients/vegetarian - theme_name = "vegetarian" - -/obj/item/storage/box/ingredients/vegetarian/PopulateContents() - for(var/i in 1 to 2) - new /obj/item/food/grown/carrot(src) - new /obj/item/food/grown/eggplant(src) - new /obj/item/food/grown/potato(src) - new /obj/item/food/grown/apple(src) - new /obj/item/food/grown/corn(src) - new /obj/item/food/grown/tomato(src) - -/obj/item/storage/box/ingredients/american - theme_name = "american" - -/obj/item/storage/box/ingredients/american/PopulateContents() - for(var/i in 1 to 2) - new /obj/item/food/grown/potato(src) - new /obj/item/food/grown/tomato(src) - new /obj/item/food/grown/corn(src) - new /obj/item/food/meatball(src) - -/obj/item/storage/box/ingredients/fruity - theme_name = "fruity" - -/obj/item/storage/box/ingredients/fruity/PopulateContents() - for(var/i in 1 to 2) - new /obj/item/food/grown/apple(src) - new /obj/item/food/grown/citrus/orange(src) - new /obj/item/food/grown/citrus/lemon(src) - new /obj/item/food/grown/citrus/lime(src) - new /obj/item/food/grown/watermelon(src) - -/obj/item/storage/box/ingredients/sweets - theme_name = "sweets" - -/obj/item/storage/box/ingredients/sweets/PopulateContents() - for(var/i in 1 to 2) - new /obj/item/food/grown/cherries(src) - new /obj/item/food/grown/banana(src) - new /obj/item/food/chocolatebar(src) - new /obj/item/food/grown/cocoapod(src) - new /obj/item/food/grown/apple(src) - -/obj/item/storage/box/ingredients/delights - theme_name = "delights" - -/obj/item/storage/box/ingredients/delights/PopulateContents() - for(var/i in 1 to 2) - new /obj/item/food/grown/potato/sweet(src) - new /obj/item/food/grown/bluecherries(src) - new /obj/item/food/grown/vanillapod(src) - new /obj/item/food/grown/cocoapod(src) - new /obj/item/food/grown/berries(src) - -/obj/item/storage/box/ingredients/grains - theme_name = "grains" - -/obj/item/storage/box/ingredients/grains/PopulateContents() - for(var/i in 1 to 3) - new /obj/item/food/grown/oat(src) - new /obj/item/food/grown/wheat(src) - new /obj/item/food/grown/cocoapod(src) - new /obj/item/reagent_containers/honeycomb(src) - new /obj/item/seeds/poppy(src) - -/obj/item/storage/box/ingredients/carnivore - theme_name = "carnivore" - -/obj/item/storage/box/ingredients/carnivore/PopulateContents() - new /obj/item/food/meat/slab/bear(src) - new /obj/item/food/meat/slab/spider(src) - new /obj/item/food/spidereggs(src) - new /obj/item/food/fishmeat/carp(src) - new /obj/item/food/meat/slab/xeno(src) - new /obj/item/food/meat/slab/corgi(src) - new /obj/item/food/meatball(src) - -/obj/item/storage/box/ingredients/exotic - theme_name = "exotic" - -/obj/item/storage/box/ingredients/exotic/PopulateContents() - for(var/i in 1 to 2) - new /obj/item/food/fishmeat/carp(src) - new /obj/item/food/grown/soybeans(src) - new /obj/item/food/grown/cabbage(src) - new /obj/item/food/grown/chili(src) - -/obj/item/storage/box/ingredients/random - theme_name = "random" - desc = "This box should not exist, contact the proper authorities." - -/obj/item/storage/box/ingredients/random/Initialize() - .=..() - var/chosen_box = pick(subtypesof(/obj/item/storage/box/ingredients) - /obj/item/storage/box/ingredients/random) - new chosen_box(loc) - return INITIALIZE_HINT_QDEL - -/obj/item/choice_beacon/hero - name = "heroic beacon" - desc = "To summon heroes from the past to protect the future." - -/obj/item/choice_beacon/hero/generate_display_names() - var/static/list/hero_item_list - if(!hero_item_list) - hero_item_list = list() - var/list/templist = typesof(/obj/item/storage/box/hero) //we have to convert type = name to name = type, how lovely! - for(var/V in templist) - var/atom/A = V - hero_item_list[initial(A.name)] = A - return hero_item_list - -/obj/item/choice_beacon/hero/spawn_option(obj/choice,mob/living/M) - new choice(get_turf(M)) - to_chat(M, span_hear("You hear something crackle from the beacon for a moment before a voice speaks. \"Please stand by for a message from Sophronia Broadcasting. Message as follows: Please enjoy your Sophronia Broadcasting's 'History Comes Alive branded' Costume Set, exactly as shown in the hit show! Message ends.\"")) - - -/obj/item/storage/box/hero - name = "Courageous Tomb Raider - 1940's." - desc = "This legendary figure of still dubious historical accuracy is thought to have been a world-famous archeologist who embarked on countless adventures in far away lands, along with his trademark whip and fedora hat." - -/obj/item/storage/box/hero/PopulateContents() - new /obj/item/clothing/head/fedora/curator(src) - new /obj/item/clothing/suit/curator(src) - new /obj/item/clothing/under/rank/civilian/curator/treasure_hunter(src) - new /obj/item/clothing/shoes/workboots/mining(src) - new /obj/item/melee/curator_whip(src) - -/obj/item/storage/box/hero/astronaut - name = "First Man on the Moon - 1960's." - desc = "One small step for a man, one giant leap for mankind. Relive the beginnings of space exploration with this fully functional set of vintage EVA equipment." - -/obj/item/storage/box/hero/astronaut/PopulateContents() - new /obj/item/clothing/suit/space/nasavoid(src) - new /obj/item/clothing/head/helmet/space/nasavoid(src) - new /obj/item/tank/internals/oxygen(src) - new /obj/item/gps(src) - -/obj/item/storage/box/hero/scottish - name = "Braveheart, the Scottish rebel - 1300's." - desc = "Seemingly a legendary figure in the battle for Scottish independence, this historical figure is closely associated with blue facepaint, big swords, strange man skirts, and his ever enduring catchphrase: 'FREEDOM!!'" - -/obj/item/storage/box/hero/scottish/PopulateContents() - new /obj/item/clothing/under/costume/kilt(src) - new /obj/item/claymore/weak/ceremonial(src) - new /obj/item/toy/crayon/spraycan(src) - new /obj/item/clothing/shoes/sandal(src) - -/obj/item/storage/box/hero/carphunter - name = "Carp Hunter, Wildlife Expert - 2506." - desc = "Despite his nickname, this wildlife expert was mainly known as a passionate environmentalist and conservationist, often coming in contact with dangerous wildlife to teach about the beauty of nature." - -/obj/item/storage/box/hero/carphunter/PopulateContents() - new /obj/item/clothing/suit/space/hardsuit/carp/old(src) - new /obj/item/clothing/mask/gas/carp(src) - new /obj/item/kitchen/knife/hunting(src) - new /obj/item/storage/box/papersack/meat(src) - - -/obj/item/choice_beacon/augments - name = "augment beacon" - desc = "Summons augmentations. Can be used 3 times!" - uses = 3 - -/obj/item/choice_beacon/augments/generate_display_names() - var/static/list/augment_list - if(!augment_list) - augment_list = list() - var/list/templist = list( - /obj/item/organ/cyberimp/brain/anti_drop, - /obj/item/organ/cyberimp/arm/toolset, - /obj/item/organ/cyberimp/arm/surgery, - /obj/item/organ/cyberimp/chest/thrusters, - /obj/item/organ/lungs/cybernetic/tier3, - /obj/item/organ/liver/cybernetic/tier3) //cyberimplants range from a nice bonus to fucking broken bullshit so no subtypesof - for(var/V in templist) - var/atom/A = V - augment_list[initial(A.name)] = A - return augment_list - -/obj/item/choice_beacon/augments/spawn_option(obj/choice,mob/living/M) - new choice(get_turf(M)) - to_chat(M, span_hear("You hear something crackle from the beacon for a moment before a voice speaks. \"Please stand by for a message from S.E.L.F. Message as follows: Item request received. Your package has been transported, use the autosurgeon supplied to apply the upgrade. Message ends.\"")) - -/obj/item/skub - desc = "It's skub." - name = "skub" - icon = 'icons/obj/items_and_weapons.dmi' - icon_state = "skub" - w_class = WEIGHT_CLASS_BULKY - attack_verb_continuous = list("skubs") - attack_verb_simple = list("skub") - -/obj/item/skub/ComponentInitialize() - . = ..() - AddComponent(/datum/component/container_item/tank_holder, "holder_skub", FALSE) - -/obj/item/skub/suicide_act(mob/living/user) - user.visible_message(span_suicide("[user] has declared themself as anti-skub! The skub tears them apart!")) - - user.gib() - playsound(src, 'sound/items/eatfood.ogg', 50, TRUE, -1) - return MANUAL_SUICIDE - -/obj/item/virgin_mary - name = "\proper a picture of the virgin mary" - desc = "A small, cheap icon depicting the virgin mother." - icon = 'icons/obj/blackmarket.dmi' - icon_state = "madonna" - resistance_flags = FLAMMABLE - ///Has this item been used already. - var/used_up = FALSE - ///List of mobs that have already been mobbed. - var/static/list/mob_mobs = list() - -#define NICKNAME_CAP (MAX_NAME_LEN/2) -/obj/item/virgin_mary/attackby(obj/item/W, mob/user, params) - . = ..() - if(resistance_flags & ON_FIRE) - return - if(!burn_paper_product_attackby_check(W, user, TRUE)) - return - if(used_up) - return - if(!isliving(user) || !user.mind) //A sentient mob needs to be burning it, ya cheezit. - return - var/mob/living/joe = user - - if(joe in mob_mobs) //Only one nickname fuckhead - to_chat(joe, span_warning("You have already been initiated into the mafioso life.")) - return - - to_chat(joe, span_notice("As you burn the picture, a nickname comes to mind...")) - var/nickname = stripped_input(joe, "Pick a nickname", "Mafioso Nicknames", null, NICKNAME_CAP, TRUE) - nickname = reject_bad_name(nickname, allow_numbers = FALSE, max_length = NICKNAME_CAP, ascii_only = TRUE) - if(!nickname) - return - var/new_name - var/space_position = findtext(joe.real_name, " ") - if(space_position)//Can we find a space? - new_name = "[copytext(joe.real_name, 1, space_position)] \"[nickname]\" [copytext(joe.real_name, space_position)]" - else //Append otherwise - new_name = "[joe.real_name] \"[nickname]\"" - joe.real_name = new_name - used_up = TRUE - mob_mobs += joe - joe.say("My soul will burn like this saint if I betray my family. I enter alive and I will have to get out dead.", forced = /obj/item/virgin_mary) - to_chat(joe, span_userdanger("Being inducted into the mafia does not grant antagonist status.")) - -#undef NICKNAME_CAP - -/obj/item/virgin_mary/suicide_act(mob/living/user) - user.visible_message(span_suicide("[user] starts saying their Hail Mary's at a terrifying pace! It looks like [user.p_theyre()] trying to enter the afterlife!")) - user.say("Hail Mary, full of grace, the Lord is with thee. Blessed are thou amongst women, and blessed is the fruit of thy womb, Jesus. Holy Mary, mother of God, pray for us sinners, now and at the hour of our death. Amen. ", forced = /obj/item/virgin_mary) - addtimer(CALLBACK(src, .proc/manual_suicide, user), 75) - addtimer(CALLBACK(user, /atom/movable/proc/say, "O my Mother, preserve me this day from mortal sin..."), 50) - return MANUAL_SUICIDE - -/obj/item/virgin_mary/proc/manual_suicide(mob/living/user) - user.adjustOxyLoss(200) - user.death(0) - -// Bouquets -/obj/item/bouquet - name = "mixed bouquet" - desc = "A bouquet of sunflowers, lilies, and geraniums. How delightful." - icon = 'icons/obj/items_and_weapons.dmi' - icon_state = "mixedbouquet" - -/obj/item/bouquet/sunflower - name = "sunflower bouquet" - desc = "A bright bouquet of sunflowers." - icon_state = "sunbouquet" - -/obj/item/bouquet/poppy - name = "poppy bouquet" - desc = "A bouquet of poppies. You feel loved just looking at it." - icon_state = "poppybouquet" - -/obj/item/bouquet/rose - name = "rose bouquet" - desc = "A bouquet of roses. A bundle of love." - icon_state = "rosebouquet" - -/obj/item/gun_maintenance_supplies - name = "gun maintenance supplies" - desc = "plastic box containing gun maintenance supplies and spare parts. Use them on a Mosin Nagant to clean it." - icon = 'icons/obj/storage.dmi' - icon_state = "plasticbox" - w_class = WEIGHT_CLASS_SMALL - custom_price = PAYCHECK_HARD * 3 //SKYRAT EDIT ADDITION 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/backpack.dm b/code/game/objects/items/storage/backpack.dm index 139e8e06d93..d280d460466 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -333,7 +333,7 @@ */ var/contraband_list = list(/obj/item/storage/bag/ammo=4, /obj/item/storage/belt/utility/syndicate=1, /obj/item/storage/toolbox/syndicate=7, /obj/item/card/id/advanced/chameleon=6, /obj/item/storage/secure/briefcase/syndie=3, /obj/item/stack/telecrystal=2, /obj/item/storage/belt/military=12, /obj/item/storage/pill_bottle/aranesp=11, /obj/item/storage/pill_bottle/happy=12, /obj/item/storage/pill_bottle/stimulant=9, /obj/item/storage/pill_bottle/lsd=10, /obj/item/storage/fancy/cigarettes/cigpack_syndicate=8, /obj/item/storage/fancy/cigarettes/cigpack_shadyjims=10, /obj/item/reagent_containers/food/drinks/bottle/absinthe=12, /obj/item/storage/box/fireworks/dangerous=11, /obj/item/food/grown/cannabis/white=9, /obj/item/food/grown/cannabis=13, /obj/item/food/grown/cannabis/rainbow=8, /obj/item/food/grown/mushroom/libertycap=11, /obj/item/clothing/mask/gas/syndicate=10, /obj/item/vending_refill/donksoft=13, /obj/item/ammo_box/foambox/riot=11, /obj/item/soap/syndie=7) for(var/i in 1 to 3) - var/contraband_type = pickweight(contraband_list) + var/contraband_type = pick_weight(contraband_list) contraband_list -= contraband_type new contraband_type(src) diff --git a/code/game/objects/items/storage/boxes.dm b/code/game/objects/items/storage/boxes.dm index 8a11281dbc6..c0deb2be739 100644 --- a/code/game/objects/items/storage/boxes.dm +++ b/code/game/objects/items/storage/boxes.dm @@ -942,7 +942,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 48b166eb38a..9a0be5ca6d6 100644 --- a/code/game/objects/structures/barsigns.dm +++ b/code/game/objects/structures/barsigns.dm @@ -126,7 +126,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 060f9666913..899b9bdc4ea 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 9fdfeff6334..269400ec3c9 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 1eb144c3f9e..92f808aff90 100644 --- a/code/game/turfs/closed/minerals.dm +++ b/code/game/turfs/closed/minerals.dm @@ -191,7 +191,7 @@ . = ..() if (prob(mineralChance)) - var/path = pickweight(mineralSpawnChanceList) + var/path = pick_weight(mineralSpawnChanceList) if(ispath(path, /turf)) var/stored_flags = 0 var/stored_color = color //SKYRAT EDIT ADDITION 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 4920cbac110..5fe9af7a0ac 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -623,7 +623,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 @@ -643,7 +643,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 @@ -680,7 +680,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)].") @@ -694,7 +694,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 4625ca6d6f8..467eaf95972 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -523,7 +523,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.") @@ -1486,7 +1486,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 454b677ce31..4d13556aca6 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 0ecf8bb6f50..34478818402 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] @@ -741,7 +741,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that names[name] = list(SSmapping.rockplanet_ruins_templates[name], ZTRAIT_ROCKPLANET_RUINS, list(/area/rockplanet/surface/outdoors/unexplored)) //SKYRAT EDIT END// - 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 e786eacf638..e7c8ff1908b 100644 --- a/code/modules/admin/verbs/ert.dm +++ b/code/modules/admin/verbs/ert.dm @@ -159,7 +159,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 9c781af5ed3..a21117ea011 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 f9bc7d2aadf..ee54b0b76cb 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/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm deleted file mode 100644 index fbac72a3644..00000000000 --- a/code/modules/admin/verbs/randomverbs.dm +++ /dev/null @@ -1,1111 +0,0 @@ -/client/proc/cmd_admin_drop_everything(mob/M in GLOB.mob_list) - set category = null - set name = "Drop Everything" - if(!check_rights(R_ADMIN)) - return - - var/confirm = tgui_alert(usr, "Make [M] drop everything?", "Message", list("Yes", "No")) - if(confirm != "Yes") - return - - for(var/obj/item/W in M) - if(!M.dropItemToGround(W)) - qdel(W) - M.regenerate_icons() - - log_admin("[key_name(usr)] made [key_name(M)] drop everything!") - var/msg = "[key_name_admin(usr)] made [ADMIN_LOOKUPFLW(M)] drop everything!" - message_admins(msg) - admin_ticket_log(M, msg) - SSblackbox.record_feedback("tally", "admin_verb", 1, "Drop Everything") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/cmd_admin_subtle_message(mob/M in GLOB.mob_list) - set category = "Admin.Events" - set name = "Subtle Message" - - if(!ismob(M)) - return - if(!check_rights(R_ADMIN)) - return - - message_admins("[key_name_admin(src)] has started answering [ADMIN_LOOKUPFLW(M)]'s prayer.") - var/msg = input("Message:", text("Subtle PM to [M.key]")) as text|null - - if(!msg) - message_admins("[key_name_admin(src)] decided not to answer [ADMIN_LOOKUPFLW(M)]'s prayer") - return - if(usr) - if (usr.client) - if(usr.client.holder) - to_chat(M, "You hear a voice in your head... [msg]", confidential = TRUE) - - log_admin("SubtlePM: [key_name(usr)] -> [key_name(M)] : [msg]") - msg = span_adminnotice(" SubtleMessage: [key_name_admin(usr)] -> [key_name_admin(M)] : [msg]") - message_admins(msg) - admin_ticket_log(M, msg) - SSblackbox.record_feedback("tally", "admin_verb", 1, "Subtle Message") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/cmd_admin_headset_message(mob/M in GLOB.mob_list) - set category = "Admin.Events" - set name = "Headset Message" - - admin_headset_message(M) - -/client/proc/admin_headset_message(mob/M in GLOB.mob_list, sender = null) - var/mob/living/carbon/human/H = M - - if(!check_rights(R_ADMIN)) - return - - if(!istype(H)) - to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human", confidential = TRUE) - return - if(!istype(H.ears, /obj/item/radio/headset)) - to_chat(usr, "The person you are trying to contact is not wearing a headset.", confidential = TRUE) - return - - if (!sender) - //sender = input("Who is the message from?", "Sender") as null|anything in list(RADIO_CHANNEL_CENTCOM,RADIO_CHANNEL_SYNDICATE) //ORIGINAL - sender = input("Who is the message from?", "Sender") as null|anything in list(RADIO_CHANNEL_CENTCOM,RADIO_CHANNEL_SYNDICATE,RADIO_CHANNEL_FACTION) //SKYRAT EDIT CHANGE - if(!sender) - return - - message_admins("[key_name_admin(src)] has started answering [key_name_admin(H)]'s [sender] request.") - var/input = input("Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from [sender]", "") as text|null - if(!input) - message_admins("[key_name_admin(src)] decided not to answer [key_name_admin(H)]'s [sender] request.") - return - - log_directed_talk(mob, H, input, LOG_ADMIN, "reply") - message_admins("[key_name_admin(src)] replied to [key_name_admin(H)]'s [sender] message with: \"[input]\"") - to_chat(H, span_hear("You hear something crackle in your ears for a moment before a voice speaks. \"Please stand by for a message from [sender == "Syndicate" ? "your benefactor" : "Central Command"]. Message as follows[sender == "Syndicate" ? ", agent." : ":"] [input]. Message ends.\""), confidential = TRUE) - - SSblackbox.record_feedback("tally", "admin_verb", 1, "Headset Message") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/cmd_admin_world_narrate() - set category = "Admin.Events" - set name = "Global Narrate" - - if(!check_rights(R_ADMIN)) - return - - var/msg = input("Message:", text("Enter the text you wish to appear to everyone:")) as text|null - - if (!msg) - return - to_chat(world, "[msg]", confidential = TRUE) - log_admin("GlobalNarrate: [key_name(usr)] : [msg]") - message_admins(span_adminnotice("[key_name_admin(usr)] Sent a global narrate")) - SSblackbox.record_feedback("tally", "admin_verb", 1, "Global Narrate") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/cmd_admin_direct_narrate(mob/M) - set category = "Admin.Events" - set name = "Direct Narrate" - - if(!check_rights(R_ADMIN)) - return - - if(!M) - M = input("Direct narrate to whom?", "Active Players") as null|anything in GLOB.player_list - - if(!M) - return - - var/msg = input("Message:", text("Enter the text you wish to appear to your target:")) as text|null - - if( !msg ) - return - - to_chat(M, msg, confidential = TRUE) - log_admin("DirectNarrate: [key_name(usr)] to ([M.name]/[M.key]): [msg]") - msg = span_adminnotice(" DirectNarrate: [key_name(usr)] to ([M.name]/[M.key]): [msg]
    ") - message_admins(msg) - admin_ticket_log(M, msg) - SSblackbox.record_feedback("tally", "admin_verb", 1, "Direct Narrate") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/cmd_admin_local_narrate(atom/A) - set category = "Admin.Events" - set name = "Local Narrate" - - if(!check_rights(R_ADMIN)) - return - if(!A) - return - var/range = input("Range:", "Narrate to mobs within how many tiles:", 7) as num|null - if(!range) - return - var/msg = input("Message:", text("Enter the text you wish to appear to everyone within view:")) as text|null - if (!msg) - return - for(var/mob/M in view(range,A)) - to_chat(M, msg, confidential = TRUE) - - log_admin("LocalNarrate: [key_name(usr)] at [AREACOORD(A)]: [msg]") - message_admins(span_adminnotice(" LocalNarrate: [key_name_admin(usr)] at [ADMIN_VERBOSEJMP(A)]: [msg]
    ")) - SSblackbox.record_feedback("tally", "admin_verb", 1, "Local Narrate") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/cmd_admin_godmode(mob/M in GLOB.mob_list) - set category = "Admin.Game" - set name = "Godmode" - if(!check_rights(R_ADMIN)) - return - - M.status_flags ^= GODMODE - to_chat(usr, span_adminnotice("Toggled [(M.status_flags & GODMODE) ? "ON" : "OFF"]"), confidential = TRUE) - - log_admin("[key_name(usr)] has toggled [key_name(M)]'s nodamage to [(M.status_flags & GODMODE) ? "On" : "Off"]") - var/msg = "[key_name_admin(usr)] has toggled [ADMIN_LOOKUPFLW(M)]'s nodamage to [(M.status_flags & GODMODE) ? "On" : "Off"]" - message_admins(msg) - admin_ticket_log(M, msg) - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Godmode", "[M.status_flags & GODMODE ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - - -/proc/cmd_admin_mute(whom, mute_type, automute = 0) - if(!whom) - return - - var/muteunmute - var/mute_string - var/feedback_string - switch(mute_type) - if(MUTE_IC) - mute_string = "IC (say and emote)" - feedback_string = "IC" - if(MUTE_OOC) - mute_string = "OOC" - feedback_string = "OOC" - if(MUTE_PRAY) - mute_string = "pray" - feedback_string = "Pray" - if(MUTE_ADMINHELP) - mute_string = "adminhelp, admin PM and ASAY" - feedback_string = "Adminhelp" - if(MUTE_DEADCHAT) - mute_string = "deadchat and DSAY" - feedback_string = "Deadchat" - // Skyrat Edit Addition - LOOC Muting - if(MUTE_LOOC) - mute_string = "LOOC" - feedback_string = "LOOC" - // Skyrat Edit End - if(MUTE_ALL) - mute_string = "everything" - feedback_string = "Everything" - else - return - - var/client/C - if(istype(whom, /client)) - C = whom - else if(istext(whom)) - C = GLOB.directory[whom] - else - return - - var/datum/preferences/P - if(C) - P = C.prefs - else - P = GLOB.preferences_datums[whom] - if(!P) - return - - if(automute) - if(!CONFIG_GET(flag/automute_on)) - return - else - if(!check_rights()) - return - - if(automute) - muteunmute = "auto-muted" - P.muted |= mute_type - log_admin("SPAM AUTOMUTE: [muteunmute] [key_name(whom)] from [mute_string]") - message_admins("SPAM AUTOMUTE: [muteunmute] [key_name_admin(whom)] from [mute_string].") - if(C) - to_chat(C, "You have been [muteunmute] from [mute_string] by the SPAM AUTOMUTE system. Contact an admin.", confidential = TRUE) - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Auto Mute [feedback_string]", "1")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - return - - if(P.muted & mute_type) - muteunmute = "unmuted" - P.muted &= ~mute_type - else - muteunmute = "muted" - P.muted |= mute_type - - log_admin("[key_name(usr)] has [muteunmute] [key_name(whom)] from [mute_string]") - message_admins("[key_name_admin(usr)] has [muteunmute] [key_name_admin(whom)] from [mute_string].") - if(C) - to_chat(C, "You have been [muteunmute] from [mute_string] by [key_name(usr, include_name = FALSE)].", confidential = TRUE) - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Mute [feedback_string]", "[P.muted & mute_type]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - - -/* -If a guy was gibbed and you want to revive him, this is a good way to do so. -Works kind of like entering the game with a new character. Character receives a new mind if they didn't have one. -Traitors and the like can also be revived with the previous role mostly intact. -/N */ -/client/proc/respawn_character() - set category = "Admin.Game" - set name = "Respawn Character" - set desc = "Respawn a person that has been gibbed/dusted/killed. They must be a ghost for this to work and preferably should not have a body to go back into." - if(!check_rights(R_ADMIN)) - return - - var/input = ckey(input(src, "Please specify which key will be respawned.", "Key", "")) - if(!input) - return - - var/mob/dead/observer/G_found - for(var/mob/dead/observer/G in GLOB.player_list) - if(G.ckey == input) - G_found = G - break - - if(!G_found)//If a ghost was not found. - to_chat(usr, "There is no active key like that in the game or the person is not currently a ghost.", confidential = TRUE) - return - - if(G_found.mind && !G_found.mind.active) //mind isn't currently in use by someone/something - //check if they were a monkey - if(findtext(G_found.real_name,"monkey")) - if(tgui_alert(usr,"This character appears to have been a monkey. Would you like to respawn them as such?",,list("Yes","No"))=="Yes") - var/mob/living/carbon/human/species/monkey/new_monkey = new - SSjob.SendToLateJoin(new_monkey) - G_found.mind.transfer_to(new_monkey) //be careful when doing stuff like this! I've already checked the mind isn't in use - new_monkey.key = G_found.key - to_chat(new_monkey, "You have been fully respawned. Enjoy the game.", confidential = TRUE) - var/msg = span_adminnotice("[key_name_admin(usr)] has respawned [new_monkey.key] as a filthy monkey.") - message_admins(msg) - admin_ticket_log(new_monkey, msg) - return //all done. The ghost is auto-deleted - - - //Ok, it's not a monkey. So, spawn a human. - var/mob/living/carbon/human/new_character = new//The mob being spawned. - SSjob.SendToLateJoin(new_character) - - var/datum/data/record/record_found //Referenced to later to either randomize or not randomize the character. - if(G_found.mind && !G_found.mind.active) //mind isn't currently in use by someone/something - /*Try and locate a record for the person being respawned through GLOB.data_core. - This isn't an exact science but it does the trick more often than not.*/ - var/id = md5("[G_found.real_name][G_found.mind.assigned_role.title]") - - record_found = find_record("id", id, GLOB.data_core.locked) - - if(record_found)//If they have a record we can determine a few things. - new_character.real_name = record_found.fields["name"] - new_character.gender = record_found.fields["gender"] - new_character.age = record_found.fields["age"] - new_character.hardset_dna(record_found.fields["identity"], record_found.fields["enzymes"], null, record_found.fields["name"], record_found.fields["blood_type"], new record_found.fields["species"], record_found.fields["features"]) - else - new_character.randomize_human_appearance() - new_character.dna.update_dna_identity() - - new_character.name = new_character.real_name - - if(G_found.mind && !G_found.mind.active) - G_found.mind.transfer_to(new_character) //be careful when doing stuff like this! I've already checked the mind isn't in use - else - new_character.mind_initialize() - if(is_unassigned_job(new_character.mind.assigned_role)) - new_character.mind.set_assigned_role(SSjob.GetJobType(SSjob.overflow_role)) - - new_character.key = G_found.key - - /* - The code below functions with the assumption that the mob is already a traitor if they have a special role. - So all it does is re-equip the mob with powers and/or items. Or not, if they have no special role. - If they don't have a mind, they obviously don't have a special role. - */ - - //Two variables to properly announce later on. - var/admin = key_name_admin(src) - var/player_key = G_found.key - - //Now for special roles and equipment. - var/datum/antagonist/traitor/traitordatum = new_character.mind.has_antag_datum(/datum/antagonist/traitor) - if(traitordatum) - SSjob.EquipRank(new_character, new_character.mind.assigned_role, 1) - new_character.mind.give_uplink(silent = TRUE, antag_datum = traitordatum) - - switch(new_character.mind.special_role) - if(ROLE_WIZARD) - new_character.forceMove(pick(GLOB.wizardstart)) - var/datum/antagonist/wizard/A = new_character.mind.has_antag_datum(/datum/antagonist/wizard,TRUE) - A.equip_wizard() - if(ROLE_SYNDICATE) - new_character.forceMove(pick(GLOB.nukeop_start)) - var/datum/antagonist/nukeop/N = new_character.mind.has_antag_datum(/datum/antagonist/nukeop,TRUE) - N.equip_op() - if(ROLE_NINJA) - var/list/ninja_spawn = list() - for(var/obj/effect/landmark/carpspawn/L in GLOB.landmarks_list) - ninja_spawn += L - var/datum/antagonist/ninja/ninjadatum = new_character.mind.has_antag_datum(/datum/antagonist/ninja) - ninjadatum.equip_space_ninja() - if(ninja_spawn.len) - new_character.forceMove(pick(ninja_spawn)) - - else//They may also be a cyborg or AI. - switch(new_character.mind.assigned_role.type) - if(/datum/job/cyborg)//More rigging to make em' work and check if they're traitor. - new_character = new_character.Robotize(TRUE) - if(/datum/job/ai) - new_character = new_character.AIize() - else - if(!traitordatum) // Already equipped there. - SSjob.EquipRank(new_character, new_character.mind.assigned_role, new_character.client)//Or we simply equip them. - - //Announces the character on all the systems, based on the record. - if(!record_found && (new_character.mind.assigned_role.job_flags & JOB_CREW_MEMBER)) - //Power to the user! - if(tgui_alert(new_character,"Warning: No data core entry detected. Would you like to announce the arrival of this character by adding them to various databases, such as medical records?",,list("No","Yes"))=="Yes") - GLOB.data_core.manifest_inject(new_character) - - if(tgui_alert(new_character,"Would you like an active AI to announce this character?",,list("No","Yes"))=="Yes") - AnnounceArrival(new_character, new_character.mind.assigned_role.title) - - var/msg = span_adminnotice("[admin] has respawned [player_key] as [new_character.real_name].") - message_admins(msg) - admin_ticket_log(new_character, msg) - - to_chat(new_character, "You have been fully respawned. Enjoy the game.", confidential = TRUE) - - SSblackbox.record_feedback("tally", "admin_verb", 1, "Respawn Character") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - return new_character - -/client/proc/cmd_admin_add_freeform_ai_law() - set category = "Admin.Events" - set name = "Add Custom AI law" - - if(!check_rights(R_ADMIN)) - return - - var/input = input(usr, "Please enter anything you want the AI to do. Anything. Serious.", "What?", "") as text|null - if(!input) - return - - log_admin("Admin [key_name(usr)] has added a new AI law - [input]") - message_admins("Admin [key_name_admin(usr)] has added a new AI law - [input]") - - var/show_log = tgui_alert(usr, "Show ion message?", "Message", list("Yes", "No")) - var/announce_ion_laws = (show_log == "Yes" ? 100 : 0) - - var/datum/round_event/ion_storm/add_law_only/ion = new() - ion.announceChance = announce_ion_laws - ion.ionMessage = input - - SSblackbox.record_feedback("tally", "admin_verb", 1, "Add Custom AI Law") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/cmd_admin_rejuvenate(mob/living/M in GLOB.mob_list) - set category = "Debug" - set name = "Rejuvenate" - - if(!check_rights(R_ADMIN)) - return - - if(!mob) - return - if(!istype(M)) - tgui_alert(usr,"Cannot revive a ghost") - return - M.revive(full_heal = TRUE, admin_revive = TRUE) - - log_admin("[key_name(usr)] healed / revived [key_name(M)]") - var/msg = span_danger("Admin [key_name_admin(usr)] healed / revived [ADMIN_LOOKUPFLW(M)]!") - message_admins(msg) - admin_ticket_log(M, msg) - SSblackbox.record_feedback("tally", "admin_verb", 1, "Rejuvenate") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/cmd_admin_delete(atom/A as obj|mob|turf in world) - set category = "Debug" - set name = "Delete" - - if(!check_rights(R_SPAWN|R_DEBUG)) - return - - admin_delete(A) - -/client/proc/cmd_admin_list_open_jobs() - set category = "Admin.Game" - set name = "Manage Job Slots" - - if(!check_rights(R_ADMIN)) - return - holder.manage_free_slots() - SSblackbox.record_feedback("tally", "admin_verb", 1, "Manage Job Slots") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/cmd_admin_explosion(atom/O as obj|mob|turf in world) - set category = "Admin.Fun" - set name = "Explosion" - - if(!check_rights(R_ADMIN)) - return - - var/devastation = input("Range of total devastation. -1 to none", text("Input")) as num|null - if(devastation == null) - return - var/heavy = input("Range of heavy impact. -1 to none", text("Input")) as num|null - if(heavy == null) - return - var/light = input("Range of light impact. -1 to none", text("Input")) as num|null - if(light == null) - return - var/flash = input("Range of flash. -1 to none", text("Input")) as num|null - if(flash == null) - return - var/flames = input("Range of flames. -1 to none", text("Input")) as num|null - if(flames == null) - return - - if ((devastation != -1) || (heavy != -1) || (light != -1) || (flash != -1) || (flames != -1)) - if ((devastation > 20) || (heavy > 20) || (light > 20) || (flames > 20)) - if (tgui_alert(usr, "Are you sure you want to do this? It will laaag.", "Confirmation", list("Yes", "No")) == "No") - return - - explosion(O, devastation, heavy, light, flames, flash) - log_admin("[key_name(usr)] created an explosion ([devastation],[heavy],[light],[flames]) at [AREACOORD(O)]") - message_admins("[key_name_admin(usr)] created an explosion ([devastation],[heavy],[light],[flames]) at [AREACOORD(O)]") - SSblackbox.record_feedback("tally", "admin_verb", 1, "Explosion") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - return - else - return - -/client/proc/cmd_admin_emp(atom/O as obj|mob|turf in world) - set category = "Admin.Fun" - set name = "EM Pulse" - - if(!check_rights(R_ADMIN)) - return - - var/heavy = input("Range of heavy pulse.", text("Input")) as num|null - if(heavy == null) - return - var/light = input("Range of light pulse.", text("Input")) as num|null - if(light == null) - return - - if (heavy || light) - - empulse(O, heavy, light) - log_admin("[key_name(usr)] created an EM Pulse ([heavy],[light]) at [AREACOORD(O)]") - message_admins("[key_name_admin(usr)] created an EM Pulse ([heavy],[light]) at [AREACOORD(O)]") - SSblackbox.record_feedback("tally", "admin_verb", 1, "EM Pulse") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - - return - else - return - -/client/proc/cmd_admin_gib(mob/victim in GLOB.mob_list) - set category = "Admin.Fun" - set name = "Gib" - - if(!check_rights(R_ADMIN)) - return - - var/confirm = tgui_alert(usr, "Drop a brain?", "Confirm", list("Yes", "No","Cancel")) - if(confirm == "Cancel") - return - //Due to the delay here its easy for something to have happened to the mob - if(!victim) - return - - log_admin("[key_name(usr)] has gibbed [key_name(victim)]") - message_admins("[key_name_admin(usr)] has gibbed [key_name_admin(victim)]") - - if(isobserver(victim)) - new /obj/effect/gibspawner/generic(get_turf(victim)) - return - - var/mob/living/living_victim = victim - if (istype(living_victim)) - if(confirm == "Yes") - living_victim.gib() - else - living_victim.gib(TRUE) - - SSblackbox.record_feedback("tally", "admin_verb", 1, "Gib") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/cmd_admin_gib_self() - set name = "Gibself" - set category = "Admin.Fun" - - var/confirm = tgui_alert(usr, "You sure?", "Confirm", list("Yes", "No")) - if(confirm == "Yes") - log_admin("[key_name(usr)] used gibself.") - message_admins(span_adminnotice("[key_name_admin(usr)] used gibself.")) - SSblackbox.record_feedback("tally", "admin_verb", 1, "Gib Self") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - - var/mob/living/ourself = mob - if (istype(ourself)) - ourself.gib(TRUE, TRUE, TRUE) - -/client/proc/cmd_admin_check_contents(mob/living/M in GLOB.mob_list) - set category = "Debug" - set name = "Check Contents" - - var/list/L = M.get_contents() - for(var/t in L) - to_chat(usr, "[t]", confidential = TRUE) - SSblackbox.record_feedback("tally", "admin_verb", 1, "Check Contents") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/toggle_view_range() - set category = "Admin.Game" - set name = "Change View Range" - set desc = "switches between 1x and custom views" - - if(view_size.getView() == view_size.default) - view_size.setTo(input("Select view range:", "FUCK YE", 7) in list(1,2,3,4,5,6,7,8,9,10,11,12,13,14,37) - 7) - else - view_size.resetToDefault(getScreenSize(prefs.widescreenpref)) - - log_admin("[key_name(usr)] changed their view range to [view].") - //message_admins("\blue [key_name_admin(usr)] changed their view range to [view].") //why? removed by order of XSI - - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Change View Range", "[view]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/admin_call_shuttle() - set category = "Admin.Events" - set name = "Call Shuttle" - - if(EMERGENCY_AT_LEAST_DOCKED) - return - - if(!check_rights(R_ADMIN)) - return - - var/confirm = tgui_alert(usr, "You sure?", "Confirm", list("Yes", "Yes (No Recall)", "No")) - switch(confirm) - if(null, "No") - return - if("Yes (No Recall)") - SSshuttle.adminEmergencyNoRecall = TRUE - SSshuttle.emergency.mode = SHUTTLE_IDLE - - SSshuttle.emergency.request() - SSblackbox.record_feedback("tally", "admin_verb", 1, "Call Shuttle") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - log_admin("[key_name(usr)] admin-called the emergency shuttle.") - message_admins(span_adminnotice("[key_name_admin(usr)] admin-called the emergency shuttle[confirm == "Yes (No Recall)" ? " (non-recallable)" : ""].")) - return - -/client/proc/admin_cancel_shuttle() - set category = "Admin.Events" - set name = "Cancel Shuttle" - if(!check_rights(0)) - return - if(tgui_alert(usr, "You sure?", "Confirm", list("Yes", "No")) != "Yes") - return - - if(SSshuttle.adminEmergencyNoRecall) - SSshuttle.adminEmergencyNoRecall = FALSE - - if(EMERGENCY_AT_LEAST_DOCKED) - return - - SSshuttle.emergency.cancel() - SSblackbox.record_feedback("tally", "admin_verb", 1, "Cancel Shuttle") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - log_admin("[key_name(usr)] admin-recalled the emergency shuttle.") - message_admins(span_adminnotice("[key_name_admin(usr)] admin-recalled the emergency shuttle.")) - - return - -/client/proc/admin_disable_shuttle() - set category = "Admin.Events" - set name = "Disable Shuttle" - - if(!check_rights(R_ADMIN)) - return - - if(SSshuttle.emergency.mode == SHUTTLE_DISABLED) - to_chat(usr, span_warning("Error, shuttle is already disabled.")) - return - - if(tgui_alert(usr, "You sure?", "Confirm", list("Yes", "No")) != "Yes") - return - - message_admins(span_adminnotice("[key_name_admin(usr)] disabled the shuttle.")) - - SSshuttle.lastMode = SSshuttle.emergency.mode - SSshuttle.lastCallTime = SSshuttle.emergency.timeLeft(1) - SSshuttle.adminEmergencyNoRecall = TRUE - SSshuttle.emergency.setTimer(0) - SSshuttle.emergency.mode = SHUTTLE_DISABLED - priority_announce("Warning: Emergency Shuttle uplink failure, shuttle disabled until further notice.", "Emergency Shuttle Uplink Alert", 'sound/misc/announce_dig.ogg') - -/client/proc/admin_enable_shuttle() - set category = "Admin.Events" - set name = "Enable Shuttle" - - if(!check_rights(R_ADMIN)) - return - - if(SSshuttle.emergency.mode != SHUTTLE_DISABLED) - to_chat(usr, span_warning("Error, shuttle not disabled.")) - return - - if(tgui_alert(usr, "You sure?", "Confirm", list("Yes", "No")) != "Yes") - return - - message_admins(span_adminnotice("[key_name_admin(usr)] enabled the emergency shuttle.")) - SSshuttle.adminEmergencyNoRecall = FALSE - SSshuttle.emergencyNoRecall = FALSE - if(SSshuttle.lastMode == SHUTTLE_DISABLED) //If everything goes to shit, fix it. - SSshuttle.lastMode = SHUTTLE_IDLE - - SSshuttle.emergency.mode = SSshuttle.lastMode - if(SSshuttle.lastCallTime < 10 SECONDS && SSshuttle.lastMode != SHUTTLE_IDLE) - SSshuttle.lastCallTime = 10 SECONDS //Make sure no insta departures. - SSshuttle.emergency.setTimer(SSshuttle.lastCallTime) - priority_announce("Warning: Emergency Shuttle uplink reestablished, shuttle enabled.", "Emergency Shuttle Uplink Alert", 'sound/misc/announce_dig.ogg') - -/client/proc/everyone_random() - set category = "Admin.Fun" - set name = "Make Everyone Random" - set desc = "Make everyone have a random appearance. You can only use this before rounds!" - - if(SSticker.HasRoundStarted()) - to_chat(usr, "Nope you can't do this, the game's already started. This only works before rounds!", confidential = TRUE) - return - - var/frn = CONFIG_GET(flag/force_random_names) - if(frn) - CONFIG_SET(flag/force_random_names, FALSE) - message_admins("Admin [key_name_admin(usr)] has disabled \"Everyone is Special\" mode.") - to_chat(usr, "Disabled.", confidential = TRUE) - return - - - var/notifyplayers = tgui_alert(usr, "Do you want to notify the players?", "Options", list("Yes", "No", "Cancel")) - if(notifyplayers == "Cancel") - return - - log_admin("Admin [key_name(src)] has forced the players to have random appearances.") - message_admins("Admin [key_name_admin(usr)] has forced the players to have random appearances.") - - if(notifyplayers == "Yes") - to_chat(world, span_adminnotice("Admin [usr.key] has forced the players to have completely random identities!"), confidential = TRUE) - - to_chat(usr, "Remember: you can always disable the randomness by using the verb again, assuming the round hasn't started yet.", confidential = TRUE) - - CONFIG_SET(flag/force_random_names, TRUE) - SSblackbox.record_feedback("tally", "admin_verb", 1, "Make Everyone Random") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - - -/client/proc/toggle_random_events() - set category = "Server" - set name = "Toggle random events on/off" - set desc = "Toggles random events such as meteors, black holes, blob (but not space dust) on/off" - var/new_are = !CONFIG_GET(flag/allow_random_events) - CONFIG_SET(flag/allow_random_events, new_are) - if(new_are) - to_chat(usr, "Random events enabled", confidential = TRUE) - message_admins("Admin [key_name_admin(usr)] has enabled random events.") - else - to_chat(usr, "Random events disabled", confidential = TRUE) - message_admins("Admin [key_name_admin(usr)] has disabled random events.") - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Random Events", "[new_are ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - - -/client/proc/admin_change_sec_level() - set category = "Admin.Events" - set name = "Set Security Level" - set desc = "Changes the security level. Announcement only, i.e. setting to Delta won't activate nuke" - - if(!check_rights(R_ADMIN)) - return - - var/level = input("Select security level to change to","Set Security Level") as null|anything in list("green","blue","violet","orange","amber","red","delta","gamma") - if(level) - set_security_level(level) - - log_admin("[key_name(usr)] changed the security level to [level]") - message_admins("[key_name_admin(usr)] changed the security level to [level]") - SSblackbox.record_feedback("tally", "admin_verb", 1, "Set Security Level [capitalize(level)]") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/toggle_nuke(obj/machinery/nuclearbomb/N in GLOB.nuke_list) - set name = "Toggle Nuke" - set category = "Admin.Events" - set popup_menu = FALSE - if(!check_rights(R_DEBUG)) - return - - if(!N.timing) - var/newtime = input(usr, "Set activation timer.", "Activate Nuke", "[N.timer_set]") as num|null - if(!newtime) - return - N.timer_set = newtime - N.set_safety() - N.set_active() - - log_admin("[key_name(usr)] [N.timing ? "activated" : "deactivated"] a nuke at [AREACOORD(N)].") - message_admins("[ADMIN_LOOKUPFLW(usr)] [N.timing ? "activated" : "deactivated"] a nuke at [ADMIN_VERBOSEJMP(N)].") - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Nuke", "[N.timing]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/toggle_combo_hud() - set category = "Admin.Game" - set name = "Toggle Combo HUD" - set desc = "Toggles the Admin Combo HUD (antag, sci, med, eng)" - - if(!check_rights(R_ADMIN)) - return - - var/adding_hud = !has_antag_hud() - - for(var/hudtype in list(DATA_HUD_SECURITY_ADVANCED, DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC_ADVANCED)) // add data huds - var/datum/atom_hud/H = GLOB.huds[hudtype] - (adding_hud) ? H.add_hud_to(usr) : H.remove_hud_from(usr) - for(var/datum/atom_hud/antag/H in GLOB.huds) // add antag huds - (adding_hud) ? H.add_hud_to(usr) : H.remove_hud_from(usr) - - if(prefs.toggles & COMBOHUD_LIGHTING) - if(adding_hud) - mob.lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE - else - mob.lighting_alpha = initial(mob.lighting_alpha) - - mob.update_sight() - - to_chat(usr, "You toggled your admin combo HUD [adding_hud ? "ON" : "OFF"].", confidential = TRUE) - message_admins("[key_name_admin(usr)] toggled their admin combo HUD [adding_hud ? "ON" : "OFF"].") - log_admin("[key_name(usr)] toggled their admin combo HUD [adding_hud ? "ON" : "OFF"].") - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Combo HUD", "[adding_hud ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - - -/client/proc/has_antag_hud() - var/datum/atom_hud/A = GLOB.huds[ANTAG_HUD_TRAITOR] - return A.hudusers[mob] - - -/client/proc/run_weather() - set category = "Admin.Events" - set name = "Run Weather" - set desc = "Triggers a weather on the z-level you choose." - - if(!holder) - return - - var/weather_type = input("Choose a weather", "Weather") as null|anything in sortList(subtypesof(/datum/weather), /proc/cmp_typepaths_asc) - if(!weather_type) - return - - var/turf/T = get_turf(mob) - var/z_level = input("Z-Level to target?", "Z-Level", T?.z) as num|null - if(!isnum(z_level)) - return - - SSweather.run_weather(weather_type, z_level) - - message_admins("[key_name_admin(usr)] started weather of type [weather_type] on the z-level [z_level].") - log_admin("[key_name(usr)] started weather of type [weather_type] on the z-level [z_level].") - SSblackbox.record_feedback("tally", "admin_verb", 1, "Run Weather") - -/client/proc/mass_zombie_infection() - set category = "Admin.Fun" - set name = "Mass Zombie Infection" - set desc = "Infects all humans with a latent organ that will zombify \ - them on death." - - if(!check_rights(R_ADMIN)) - return - - var/confirm = tgui_alert(usr, "Please confirm you want to add latent zombie organs in all humans?", "Confirm Zombies", list("Yes", "No")) - if(confirm != "Yes") - return - - for(var/i in GLOB.human_list) - var/mob/living/carbon/human/H = i - new /obj/item/organ/zombie_infection/nodamage(H) - - message_admins("[key_name_admin(usr)] added a latent zombie infection to all humans.") - log_admin("[key_name(usr)] added a latent zombie infection to all humans.") - SSblackbox.record_feedback("tally", "admin_verb", 1, "Mass Zombie Infection") - -/client/proc/mass_zombie_cure() - set category = "Admin.Fun" - set name = "Mass Zombie Cure" - set desc = "Removes the zombie infection from all humans, returning them to normal." - if(!check_rights(R_ADMIN)) - return - - var/confirm = tgui_alert(usr, "Please confirm you want to cure all zombies?", "Confirm Zombie Cure", list("Yes", "No")) - if(confirm != "Yes") - return - - for(var/obj/item/organ/zombie_infection/nodamage/I in GLOB.zombie_infection_list) - qdel(I) - - message_admins("[key_name_admin(usr)] cured all zombies.") - log_admin("[key_name(usr)] cured all zombies.") - SSblackbox.record_feedback("tally", "admin_verb", 1, "Mass Zombie Cure") - -/client/proc/polymorph_all() - set category = "Admin.Fun" - set name = "Polymorph All" - set desc = "Applies the effects of the bolt of change to every single mob." - - if(!check_rights(R_ADMIN)) - return - - var/confirm = tgui_alert(usr, "Please confirm you want polymorph all mobs?", "Confirm Polymorph", list("Yes", "No")) - if(confirm != "Yes") - return - - var/list/mobs = shuffle(GLOB.alive_mob_list.Copy()) // might change while iterating - var/who_did_it = key_name_admin(usr) - - message_admins("[key_name_admin(usr)] started polymorphed all living mobs.") - log_admin("[key_name(usr)] polymorphed all living mobs.") - SSblackbox.record_feedback("tally", "admin_verb", 1, "Polymorph All") - - for(var/mob/living/M in mobs) - CHECK_TICK - - if(!M) - continue - - M.audible_message(span_hear("...wabbajack...wabbajack...")) - playsound(M.loc, 'sound/magic/staff_change.ogg', 50, TRUE, -1) - - wabbajack(M) - - message_admins("Mass polymorph started by [who_did_it] is complete.") - - -/client/proc/show_tip() - set category = "Admin" - set name = "Show Tip" - set desc = "Sends a tip (that you specify) to all players. After all \ - you're the experienced player here." - - if(!check_rights(R_ADMIN)) - return - - var/input = input(usr, "Please specify your tip that you want to send to the players.", "Tip", "") as message|null - if(!input) - return - - if(!SSticker) - return - - SSticker.selected_tip = input - - // If we've already tipped, then send it straight away. - if(SSticker.tipped) - SSticker.send_tip_of_the_round() - - - message_admins("[key_name_admin(usr)] sent a tip of the round.") - log_admin("[key_name(usr)] sent \"[input]\" as the Tip of the Round.") - SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Tip") - -/client/proc/modify_goals() - set category = "Debug" - set name = "Modify goals" - - if(!check_rights(R_ADMIN)) - return - - holder.modify_goals() - -/datum/admins/proc/modify_goals() - var/dat = "" - for(var/datum/station_goal/S in GLOB.station_goals) - dat += "[S.name] - Announce | Remove
    " - dat += "
    Add New Goal" - usr << browse(dat, "window=goals;size=400x400") - -/proc/immerse_player(mob/living/carbon/target, toggle=TRUE, remove=FALSE) - var/list/immersion_components = list(/datum/component/manual_breathing, /datum/component/manual_blinking) - - for(var/immersies in immersion_components) - var/has_component = target.GetComponent(immersies) - - if(has_component && (toggle || remove)) - qdel(has_component) - else if(toggle || !remove) - target.AddComponent(immersies) - -/proc/mass_immerse(remove=FALSE) - for(var/mob/living/carbon/M in GLOB.mob_list) - immerse_player(M, toggle=FALSE, remove=remove) - -/client/proc/toggle_hub() - set category = "Server" - set name = "Toggle Hub" - - world.update_hub_visibility(!GLOB.hub_visibility) - - log_admin("[key_name(usr)] has toggled the server's hub status for the round, it is now [(GLOB.hub_visibility?"on":"off")] the hub.") - message_admins("[key_name_admin(usr)] has toggled the server's hub status for the round, it is now [(GLOB.hub_visibility?"on":"off")] the hub.") - if (GLOB.hub_visibility && !world.reachable) - message_admins("WARNING: The server will not show up on the hub because byond is detecting that a filewall is blocking incoming connections.") - - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggled Hub Visibility", "[GLOB.hub_visibility ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/smite(mob/living/target as mob) - set name = "Smite" - set category = "Admin.Fun" - if(!check_rights(R_ADMIN) || !check_rights(R_FUN)) - return - - - var/punishment = input("Choose a punishment", "DIVINE SMITING") as null|anything in GLOB.smites - - if(QDELETED(target) || !punishment) - return - - var/smite_path = GLOB.smites[punishment] - var/datum/smite/smite = new smite_path - var/configuration_success = smite.configure(usr) - if (configuration_success == FALSE) - return - smite.effect(src, target) - -/proc/breadify(atom/movable/target) - var/obj/item/food/bread/plain/bread = new(get_turf(target)) - target.forceMove(bread) - -/** - * firing_squad is a proc for the :B:erforate smite to shoot each individual bullet at them, so that we can add actual delays without sleep() nonsense - * - * Hilariously, if you drag someone away mid smite, the bullets will still chase after them from the original spot, possibly hitting other people. Too funny to fix imo - * - * Arguments: - * * target- guy we're shooting obviously - * * source_turf- where the bullet begins, preferably on a turf next to the target - * * body_zone- which bodypart we're aiming for, if there is one there - * * wound_bonus- the wounding power we're assigning to the bullet, since we don't care about the base one - * * damage- the damage we're assigning to the bullet, since we don't care about the base one - */ -/proc/firing_squad(mob/living/carbon/target, turf/source_turf, body_zone, wound_bonus, damage) - if(!target.get_bodypart(body_zone)) - return - playsound(target, 'sound/weapons/gun/revolver/shot.ogg', 100) - var/obj/projectile/bullet/smite/divine_wrath = new(source_turf) - divine_wrath.damage = damage - divine_wrath.wound_bonus = wound_bonus - divine_wrath.original = target - divine_wrath.def_zone = body_zone - divine_wrath.spread = 0 - divine_wrath.preparePixelProjectile(target, source_turf) - divine_wrath.fire() - -/client/proc/punish_log(whom, punishment) - var/msg = "[key_name_admin(src)] punished [key_name_admin(whom)] with [punishment]." - message_admins(msg) - admin_ticket_log(whom, msg) - log_admin("[key_name(src)] punished [key_name(whom)] with [punishment].") - -/client/proc/trigger_centcom_recall() - if(!check_rights(R_ADMIN)) - return - var/message = pick(GLOB.admiral_messages) - message = input("Enter message from the on-call admiral to be put in the recall report.", "Admiral Message", message) as text|null - - if(!message) - return - - message_admins("[key_name_admin(usr)] triggered a CentCom recall, with the admiral message of: [message]") - log_game("[key_name(usr)] triggered a CentCom recall, with the message of: [message]") - SSshuttle.centcom_recall(SSshuttle.emergency.timer, message) - -/client/proc/cmd_admin_check_player_exp() //Allows admins to determine who the newer players are. - set category = "Admin" - set name = "Player Playtime" - if(!check_rights(R_ADMIN)) - return - - if(!CONFIG_GET(flag/use_exp_tracking)) - to_chat(usr, span_warning("Tracking is disabled in the server configuration file."), confidential = TRUE) - return - - var/list/msg = list() - msg += "Playtime ReportPlaytime:
      " - var/list/clients_list_copy = GLOB.clients.Copy() - sortList(clients_list_copy) - for(var/client/C in clients_list_copy) - msg += "
    • - [key_name_admin(C)]: " + C.get_exp_living() + "
    • " - msg += "
    " - src << browse(msg.Join(), "window=Player_playtime_check") - -/datum/admins/proc/cmd_show_exp_panel(client/client_to_check) - if(!check_rights(R_ADMIN)) - return - if(!client_to_check) - to_chat(usr, span_danger("ERROR: Client not found."), confidential = TRUE) - return - if(!CONFIG_GET(flag/use_exp_tracking)) - to_chat(usr, span_warning("Tracking is disabled in the server configuration file."), confidential = TRUE) - return - - new /datum/job_report_menu(client_to_check, usr) - -/datum/admins/proc/toggle_exempt_status(client/C) - if(!check_rights(R_ADMIN)) - return - if(!C) - to_chat(usr, span_danger("ERROR: Client not found."), confidential = TRUE) - return - - if(!C.set_db_player_flags()) - to_chat(usr, span_danger("ERROR: Unable read player flags from database. Please check logs."), confidential = TRUE) - var/dbflags = C.prefs.db_flags - var/newstate = FALSE - if(dbflags & DB_FLAG_EXEMPT) - newstate = FALSE - else - newstate = TRUE - - if(C.update_flag_db(DB_FLAG_EXEMPT, newstate)) - to_chat(usr, span_danger("ERROR: Unable to update player flags. Please check logs."), confidential = TRUE) - else - message_admins("[key_name_admin(usr)] has [newstate ? "activated" : "deactivated"] job exp exempt status on [key_name_admin(C)]") - log_admin("[key_name(usr)] has [newstate ? "activated" : "deactivated"] job exp exempt status on [key_name(C)]") - -/// Allow admin to add or remove traits of datum -/datum/admins/proc/modify_traits(datum/D) - if(!D) - return - - var/add_or_remove = input("Remove/Add?", "Trait Remove/Add") as null|anything in list("Add","Remove") - if(!add_or_remove) - return - var/list/available_traits = list() - - switch(add_or_remove) - if("Add") - for(var/key in GLOB.traits_by_type) - if(istype(D,key)) - available_traits += GLOB.traits_by_type[key] - if("Remove") - if(!GLOB.trait_name_map) - GLOB.trait_name_map = generate_trait_name_map() - for(var/trait in D.status_traits) - 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) - if(!chosen_trait) - return - chosen_trait = available_traits[chosen_trait] - - var/source = "adminabuse" - switch(add_or_remove) - if("Add") //Not doing source choosing here intentionally to make this bit faster to use, you can always vv it. - if(GLOB.movement_type_trait_to_flag[chosen_trait]) //include the required element. - D.AddElement(/datum/element/movetype_handler) - ADD_TRAIT(D,chosen_trait,source) - if("Remove") - var/specific = input("All or specific source ?", "Trait Remove/Add") as null|anything in list("All","Specific") - if(!specific) - return - switch(specific) - 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]) - if(!source) - return - REMOVE_TRAIT(D,chosen_trait,source) 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 47cec0d9fe3..f0bd2c7e688 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 c1d0348088f..2e145062361 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 6d2019b15f5..80a1abfdc2d 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 86d858189e2..0b6f76fe725 100644 --- a/code/modules/asset_cache/asset_list.dm +++ b/code/modules/asset_cache/asset_list.dm @@ -333,7 +333,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 73aa1c4bbc1..628feecc47c 100644 --- a/code/modules/atmospherics/machinery/datum_pipeline.dm +++ b/code/modules/atmospherics/machinery/datum_pipeline.dm @@ -232,7 +232,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 4fd001980e1..a6fdf1de72b 100644 --- a/code/modules/cargo/packs.dm +++ b/code/modules/cargo/packs.dm @@ -1925,7 +1925,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) @@ -2393,7 +2393,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 0031b7a2d49..2cef583a090 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -108,7 +108,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) max_save_slots = 40 //SKYRAT EDIT CHANGE // 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 28bdeccf0d5..ca1eb66532e 100644 --- a/code/modules/client/preferences/species.dm +++ b/code/modules/client/preferences/species.dm @@ -62,9 +62,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 ba0a53cd7ec..117db16680e 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/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm deleted file mode 100644 index f908cdf5893..00000000000 --- a/code/modules/client/preferences_toggles.dm +++ /dev/null @@ -1,517 +0,0 @@ -//this works as is to create a single checked item, but has no back end code for toggleing the check yet -#define TOGGLE_CHECKBOX(PARENT, CHILD) PARENT/CHILD/abstract = TRUE;PARENT/CHILD/checkbox = CHECKBOX_TOGGLE;PARENT/CHILD/verb/CHILD - -//Example usage TOGGLE_CHECKBOX(datum/verbs/menu/settings/Ghost/chatterbox, toggle_ghost_ears)() - -/datum/verbs/menu/settings - name = "Settings" - -//override because we don't want to save preferences twice. -/datum/verbs/menu/settings/Set_checked(client/C, verbpath) - if (checkbox == CHECKBOX_GROUP) - C.prefs.menuoptions[type] = verbpath - else if (checkbox == CHECKBOX_TOGGLE) - var/checked = Get_checked(C) - C.prefs.menuoptions[type] = !checked - winset(C, "[verbpath]", "is-checked = [!checked]") - -/datum/verbs/menu/settings/verb/setup_character() - set name = "Game Preferences" - set category = "Preferences" - set desc = "Open Game Preferences Window" - usr.client.prefs.current_tab = 1 - usr.client.prefs.needs_update = TRUE //SKYRAT EDIT ADDITION - CUSTOMIZATION - usr.client.prefs.ShowChoices(usr) - -/datum/verbs/menu/settings/ghost - name = "Ghost" - -//toggles -/datum/verbs/menu/settings/ghost/chatterbox - name = "Chat Box Spam" - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings/ghost/chatterbox, toggle_ghost_ears)() - set name = "Show/Hide GhostEars" - set category = "Preferences" - set desc = "See All Speech" - usr.client.prefs.chat_toggles ^= CHAT_GHOSTEARS - to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTEARS) ? "see all speech in the world" : "only see speech from nearby mobs"].") - usr.client.prefs.save_preferences() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Ears", "[usr.client.prefs.chat_toggles & CHAT_GHOSTEARS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/verbs/menu/settings/ghost/chatterbox/toggle_ghost_ears/Get_checked(client/C) - return C.prefs.chat_toggles & CHAT_GHOSTEARS - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings/ghost/chatterbox, toggle_ghost_sight)() - set name = "Show/Hide GhostSight" - set category = "Preferences" - set desc = "See All Emotes" - usr.client.prefs.chat_toggles ^= CHAT_GHOSTSIGHT - to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTSIGHT) ? "see all emotes in the world" : "only see emotes from nearby mobs"].") - usr.client.prefs.save_preferences() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Sight", "[usr.client.prefs.chat_toggles & CHAT_GHOSTSIGHT ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/verbs/menu/settings/ghost/chatterbox/toggle_ghost_sight/Get_checked(client/C) - return C.prefs.chat_toggles & CHAT_GHOSTSIGHT - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings/ghost/chatterbox, toggle_ghost_whispers)() - set name = "Show/Hide GhostWhispers" - set category = "Preferences" - set desc = "See All Whispers" - usr.client.prefs.chat_toggles ^= CHAT_GHOSTWHISPER - to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTWHISPER) ? "see all whispers in the world" : "only see whispers from nearby mobs"].") - usr.client.prefs.save_preferences() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Whispers", "[usr.client.prefs.chat_toggles & CHAT_GHOSTWHISPER ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/verbs/menu/settings/ghost/chatterbox/toggle_ghost_whispers/Get_checked(client/C) - return C.prefs.chat_toggles & CHAT_GHOSTWHISPER - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings/ghost/chatterbox, toggle_ghost_radio)() - set name = "Show/Hide GhostRadio" - set category = "Preferences" - set desc = "See All Radio Chatter" - usr.client.prefs.chat_toggles ^= CHAT_GHOSTRADIO - to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTRADIO) ? "see radio chatter" : "not see radio chatter"].") - usr.client.prefs.save_preferences() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Radio", "[usr.client.prefs.chat_toggles & CHAT_GHOSTRADIO ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! //social experiment, increase the generation whenever you copypaste this shamelessly GENERATION 1 -/datum/verbs/menu/settings/ghost/chatterbox/toggle_ghost_radio/Get_checked(client/C) - return C.prefs.chat_toggles & CHAT_GHOSTRADIO - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings/ghost/chatterbox, toggle_ghost_pda)() - set name = "Show/Hide GhostPDA" - set category = "Preferences" - set desc = "See All PDA Messages" - usr.client.prefs.chat_toggles ^= CHAT_GHOSTPDA - to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTPDA) ? "see all pda messages in the world" : "only see pda messages from nearby mobs"].") - usr.client.prefs.save_preferences() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost PDA", "[usr.client.prefs.chat_toggles & CHAT_GHOSTPDA ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/verbs/menu/settings/ghost/chatterbox/toggle_ghost_pda/Get_checked(client/C) - return C.prefs.chat_toggles & CHAT_GHOSTPDA - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings/ghost/chatterbox, toggle_ghost_laws)() - set name = "Show/Hide GhostLaws" - set category = "Preferences" - set desc = "See All Law Changes" - usr.client.prefs.chat_toggles ^= CHAT_GHOSTLAWS - to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTLAWS) ? "be notified of all law changes" : "no longer be notified of law changes"].") - usr.client.prefs.save_preferences() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Laws", "[usr.client.prefs.chat_toggles & CHAT_GHOSTLAWS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/verbs/menu/settings/ghost/chatterbox/toggle_ghost_laws/Get_checked(client/C) - return C.prefs.chat_toggles & CHAT_GHOSTLAWS - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings/ghost/chatterbox, toggle_hear_login_logout)() - set name = "Show/Hide Login/Logout messages" - set category = "Preferences" - set desc = "As a ghost, see when someone reconnects or disconnects" - usr.client.prefs.chat_toggles ^= CHAT_LOGIN_LOGOUT - to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_LOGIN_LOGOUT) ? "be notified" : "no longer be notified"] when someone disconnects or reconnects.") - usr.client.prefs.save_preferences() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Hearing Login/Logout", "[usr.client.prefs.chat_toggles & CHAT_LOGIN_LOGOUT ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/verbs/menu/settings/ghost/chatterbox/toggle_hear_login_logout/Get_checked(client/C) - return C.prefs.chat_toggles & CHAT_LOGIN_LOGOUT - -/datum/verbs/menu/settings/ghost/chatterbox/events - name = "Events" - -//please be aware that the following two verbs have inverted stat output, so that "Toggle Deathrattle|1" still means you activated it -TOGGLE_CHECKBOX(/datum/verbs/menu/settings/ghost/chatterbox/events, toggle_deathrattle)() - set name = "Toggle Deathrattle" - set category = "Preferences" - set desc = "Death" - usr.client.prefs.toggles ^= DISABLE_DEATHRATTLE - usr.client.prefs.save_preferences() - to_chat(usr, "You will [(usr.client.prefs.toggles & DISABLE_DEATHRATTLE) ? "no longer" : "now"] get messages when a sentient mob dies.") - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Deathrattle", "[!(usr.client.prefs.toggles & DISABLE_DEATHRATTLE) ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, maybe you should spend some time reading the comments. -/datum/verbs/menu/settings/ghost/chatterbox/events/toggle_deathrattle/Get_checked(client/C) - return !(C.prefs.toggles & DISABLE_DEATHRATTLE) - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings/ghost/chatterbox/events, toggle_arrivalrattle)() - set name = "Toggle Arrivalrattle" - set category = "Preferences" - set desc = "New Player Arrival" - usr.client.prefs.toggles ^= DISABLE_ARRIVALRATTLE - to_chat(usr, "You will [(usr.client.prefs.toggles & DISABLE_ARRIVALRATTLE) ? "no longer" : "now"] get messages when someone joins the station.") - usr.client.prefs.save_preferences() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Arrivalrattle", "[!(usr.client.prefs.toggles & DISABLE_ARRIVALRATTLE) ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, maybe you should rethink where your life went so wrong. -/datum/verbs/menu/settings/ghost/chatterbox/events/toggle_arrivalrattle/Get_checked(client/C) - return !(C.prefs.toggles & DISABLE_ARRIVALRATTLE) - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings/ghost, togglemidroundantag)() - set name = "Toggle Midround Antagonist" - set category = "Preferences" - set desc = "Midround Antagonist" - usr.client.prefs.toggles ^= MIDROUND_ANTAG - usr.client.prefs.save_preferences() - to_chat(usr, "You will [(usr.client.prefs.toggles & MIDROUND_ANTAG) ? "now" : "no longer"] be considered for midround antagonist positions.") - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Midround Antag", "[usr.client.prefs.toggles & MIDROUND_ANTAG ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/verbs/menu/settings/ghost/togglemidroundantag/Get_checked(client/C) - return C.prefs.toggles & MIDROUND_ANTAG - -/datum/verbs/menu/settings/sound - name = "Sound" - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings/sound, toggletitlemusic)() - set name = "Hear/Silence Lobby Music" - set category = "Preferences" - set desc = "Hear Music In Lobby" - usr.client.prefs.toggles ^= SOUND_LOBBY - usr.client.prefs.save_preferences() - if(usr.client.prefs.toggles & SOUND_LOBBY) - to_chat(usr, "You will now hear music in the game lobby.") - if(isnewplayer(usr)) - usr.client.playtitlemusic() - else - to_chat(usr, "You will no longer hear music in the game lobby.") - usr.stop_sound_channel(CHANNEL_LOBBYMUSIC) - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Lobby Music", "[usr.client.prefs.toggles & SOUND_LOBBY ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/verbs/menu/settings/sound/toggletitlemusic/Get_checked(client/C) - return C.prefs.toggles & SOUND_LOBBY - - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings/sound, toggleendofroundsounds)() - set name = "Hear/Silence End of Round Sounds" - set category = "Preferences" - set desc = "Hear Round End Sounds" - usr.client.prefs.toggles ^= SOUND_ENDOFROUND - usr.client.prefs.save_preferences() - if(usr.client.prefs.toggles & SOUND_ENDOFROUND) - to_chat(usr, "You will now hear sounds played before the server restarts.") - else - to_chat(usr, "You will no longer hear sounds played before the server restarts.") - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle End of Round Sounds", "[usr.client.prefs.toggles & SOUND_ENDOFROUND ? "Enabled" : "Disabled"]")) -/datum/verbs/menu/settings/sound/toggleendofroundsounds/Get_checked(client/C) - return C.prefs.toggles & SOUND_ENDOFROUND - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings/sound, togglecombatmodesound)() - set name = "Hear/Silence Combat Mode Toggle Sound" - set category = "Preferences" - set desc = "Hear Combat Mode Toggle Sound" - usr.client.prefs.toggles ^= SOUND_COMBATMODE - usr.client.prefs.save_preferences() - if(usr.client.prefs.toggles & SOUND_COMBATMODE) - to_chat(usr, "You will now hear a sound when combat mode is turned on.") - else - to_chat(usr, "You will no longer hear a sound when combat mode is turned on.") - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Combat Mode Toggle Sounds", "[usr.client.prefs.toggles & SOUND_COMBATMODE ? "Enabled" : "Disabled"]")) - -/datum/verbs/menu/settings/sound/togglecombatmodesound/Get_checked(client/C) - return C.prefs.toggles & SOUND_COMBATMODE - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings/sound, togglemidis)() - set name = "Hear/Silence Midis" - set category = "Preferences" - set desc = "Hear Admin Triggered Music/Sounds" - usr.client.prefs.toggles ^= SOUND_MIDI - usr.client.prefs.save_preferences() - if(usr.client.prefs.toggles & SOUND_MIDI) - to_chat(usr, "You will now hear any sounds uploaded by admins.") - else - to_chat(usr, "You will no longer hear sounds uploaded by admins") - usr.stop_sound_channel(CHANNEL_ADMIN) - var/client/C = usr.client - C?.tgui_panel?.stop_music() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Hearing Midis", "[usr.client.prefs.toggles & SOUND_MIDI ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/verbs/menu/settings/sound/togglemidis/Get_checked(client/C) - return C.prefs.toggles & SOUND_MIDI - - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings/sound, toggle_instruments)() - set name = "Hear/Silence Instruments" - set category = "Preferences" - set desc = "Hear In-game Instruments" - usr.client.prefs.toggles ^= SOUND_INSTRUMENTS - usr.client.prefs.save_preferences() - if(usr.client.prefs.toggles & SOUND_INSTRUMENTS) - to_chat(usr, "You will now hear people playing musical instruments.") - else - to_chat(usr, "You will no longer hear musical instruments.") - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Instruments", "[usr.client.prefs.toggles & SOUND_INSTRUMENTS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/verbs/menu/settings/sound/toggle_instruments/Get_checked(client/C) - return C.prefs.toggles & SOUND_INSTRUMENTS - - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings/sound, Toggle_Soundscape)() - set name = "Hear/Silence Ambience" - set category = "Preferences" - set desc = "Hear Ambient Sound Effects" - usr.client.prefs.toggles ^= SOUND_AMBIENCE - usr.client.prefs.save_preferences() - if(usr.client.prefs.toggles & SOUND_AMBIENCE) - to_chat(usr, "You will now hear ambient sounds.") - else - to_chat(usr, "You will no longer hear ambient sounds.") - usr.stop_sound_channel(CHANNEL_AMBIENCE) - usr.stop_sound_channel(CHANNEL_BUZZ) - usr.client.update_ambience_pref() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ambience", "[usr.client.prefs.toggles & SOUND_AMBIENCE ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/verbs/menu/settings/sound/Toggle_Soundscape/Get_checked(client/C) - return C.prefs.toggles & SOUND_AMBIENCE - - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings/sound, toggle_ship_ambience)() - set name = "Hear/Silence Ship Ambience" - set category = "Preferences" - set desc = "Hear Ship Ambience Roar" - usr.client.prefs.toggles ^= SOUND_SHIP_AMBIENCE - usr.client.prefs.save_preferences() - if(usr.client.prefs.toggles & SOUND_SHIP_AMBIENCE) - to_chat(usr, "You will now hear ship ambience.") - else - to_chat(usr, "You will no longer hear ship ambience.") - usr.stop_sound_channel(CHANNEL_BUZZ) - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ship Ambience", "[usr.client.prefs.toggles & SOUND_SHIP_AMBIENCE ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, I bet you read this comment expecting to see the same thing :^) -/datum/verbs/menu/settings/sound/toggle_ship_ambience/Get_checked(client/C) - return C.prefs.toggles & SOUND_SHIP_AMBIENCE - - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings/sound, toggle_announcement_sound)() - set name = "Hear/Silence Announcements" - set category = "Preferences" - set desc = "Hear Announcement Sound" - usr.client.prefs.toggles ^= SOUND_ANNOUNCEMENTS - to_chat(usr, "You will now [(usr.client.prefs.toggles & SOUND_ANNOUNCEMENTS) ? "hear announcement sounds" : "no longer hear announcements"].") - usr.client.prefs.save_preferences() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Announcement Sound", "[usr.client.prefs.toggles & SOUND_ANNOUNCEMENTS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/verbs/menu/settings/sound/toggle_announcement_sound/Get_checked(client/C) - return C.prefs.toggles & SOUND_ANNOUNCEMENTS - - -/datum/verbs/menu/settings/sound/verb/stop_client_sounds() - set name = "Stop Sounds" - set category = "Preferences" - set desc = "Stop Current Sounds" - SEND_SOUND(usr, sound(null)) - var/client/C = usr.client - C?.tgui_panel?.stop_music() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Stop Self Sounds")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings, listen_ooc)() - set name = "Show/Hide OOC" - set category = "Preferences" - set desc = "Show OOC Chat" - usr.client.prefs.chat_toggles ^= CHAT_OOC - usr.client.prefs.save_preferences() - to_chat(usr, "You will [(usr.client.prefs.chat_toggles & CHAT_OOC) ? "now" : "no longer"] see messages on the OOC channel.") - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Seeing OOC", "[usr.client.prefs.chat_toggles & CHAT_OOC ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/verbs/menu/settings/listen_ooc/Get_checked(client/C) - return C.prefs.chat_toggles & CHAT_OOC - -TOGGLE_CHECKBOX(/datum/verbs/menu/settings, listen_bank_card)() - set name = "Show/Hide Income Updates" - set category = "Preferences" - set desc = "Show or hide updates to your income" - usr.client.prefs.chat_toggles ^= CHAT_BANKCARD - usr.client.prefs.save_preferences() - to_chat(usr, "You will [(usr.client.prefs.chat_toggles & CHAT_BANKCARD) ? "now" : "no longer"] be notified when you get paid.") - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Income Notifications", "[(usr.client.prefs.chat_toggles & CHAT_BANKCARD) ? "Enabled" : "Disabled"]")) -/datum/verbs/menu/settings/listen_bank_card/Get_checked(client/C) - return C.prefs.chat_toggles & CHAT_BANKCARD - - -GLOBAL_LIST_INIT(ghost_forms, sortList(list("ghost","ghostking","ghostian2","skeleghost","ghost_red","ghost_black", \ - "ghost_blue","ghost_yellow","ghost_green","ghost_pink", \ - "ghost_cyan","ghost_dblue","ghost_dred","ghost_dgreen", \ - "ghost_dcyan","ghost_grey","ghost_dyellow","ghost_dpink", "ghost_purpleswirl","ghost_funkypurp","ghost_pinksherbert","ghost_blazeit",\ - "ghost_mellow","ghost_rainbow","ghost_camo","ghost_fire", "catghost"))) -/client/proc/pick_form() - if(!is_content_unlocked()) - tgui_alert(usr,"This setting is for accounts with BYOND premium only.") - return - var/new_form = input(src, "Thanks for supporting BYOND - Choose your ghostly form:","Thanks for supporting BYOND",null) as null|anything in GLOB.ghost_forms - if(new_form) - prefs.ghost_form = new_form - prefs.save_preferences() - if(isobserver(mob)) - var/mob/dead/observer/O = mob - O.update_icon(ALL, new_form) - -GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOST_ORBIT_SQUARE,GHOST_ORBIT_HEXAGON,GHOST_ORBIT_PENTAGON)) - -/client/proc/pick_ghost_orbit() - if(!is_content_unlocked()) - tgui_alert(usr,"This setting is for accounts with BYOND premium only.") - return - var/new_orbit = input(src, "Thanks for supporting BYOND - Choose your ghostly orbit:","Thanks for supporting BYOND",null) as null|anything in GLOB.ghost_orbits - if(new_orbit) - prefs.ghost_orbit = new_orbit - prefs.save_preferences() - if(isobserver(mob)) - var/mob/dead/observer/O = mob - O.ghost_orbit = new_orbit - -/client/proc/pick_ghost_accs() - var/new_ghost_accs = tgui_alert(usr,"Do you want your ghost to show full accessories where possible, hide accessories but still use the directional sprites where possible, or also ignore the directions and stick to the default sprites?",,list("full accessories", "only directional sprites", "default sprites")) - if(new_ghost_accs) - switch(new_ghost_accs) - if("full accessories") - prefs.ghost_accs = GHOST_ACCS_FULL - if("only directional sprites") - prefs.ghost_accs = GHOST_ACCS_DIR - if("default sprites") - prefs.ghost_accs = GHOST_ACCS_NONE - prefs.save_preferences() - if(isobserver(mob)) - var/mob/dead/observer/O = mob - O.update_appearance() - -/client/verb/pick_ghost_customization() - set name = "Ghost Customization" - set category = "Preferences" - set desc = "Customize your ghastly appearance." - if(is_content_unlocked()) - switch(tgui_alert(usr,"Which setting do you want to change?",,list("Ghost Form","Ghost Orbit","Ghost Accessories"))) - if("Ghost Form") - pick_form() - if("Ghost Orbit") - pick_ghost_orbit() - if("Ghost Accessories") - pick_ghost_accs() - else - pick_ghost_accs() - -/client/verb/pick_ghost_others() - set name = "Ghosts of Others" - set category = "Preferences" - set desc = "Change display settings for the ghosts of other players." - var/new_ghost_others = tgui_alert(usr,"Do you want the ghosts of others to show up as their own setting, as their default sprites or always as the default white ghost?",,list("Their Setting", "Default Sprites", "White Ghost")) - if(new_ghost_others) - switch(new_ghost_others) - if("Their Setting") - prefs.ghost_others = GHOST_OTHERS_THEIR_SETTING - if("Default Sprites") - prefs.ghost_others = GHOST_OTHERS_DEFAULT_SPRITE - if("White Ghost") - prefs.ghost_others = GHOST_OTHERS_SIMPLE - prefs.save_preferences() - if(isobserver(mob)) - var/mob/dead/observer/O = mob - O.update_sight() - -/client/verb/toggle_ghost_hud_pref() - set name = "Toggle Ghost HUD" - set category = "Preferences" - set desc = "Hide/Show Ghost HUD" - - prefs.ghost_hud = !prefs.ghost_hud - to_chat(src, "Ghost HUD will now be [prefs.ghost_hud ? "visible" : "hidden"].") - prefs.save_preferences() - if(isobserver(mob)) - mob.hud_used.show_hud() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost HUD", "[prefs.ghost_hud ? "Enabled" : "Disabled"]")) - -/client/verb/toggle_inquisition() // warning: unexpected inquisition - set name = "Toggle Inquisitiveness" - set desc = "Sets whether your ghost examines everything on click by default" - set category = "Preferences" - - prefs.inquisitive_ghost = !prefs.inquisitive_ghost - prefs.save_preferences() - if(prefs.inquisitive_ghost) - to_chat(src, span_notice("You will now examine everything you click on.")) - else - to_chat(src, span_notice("You will no longer examine things you click on.")) - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Inquisitiveness", "[prefs.inquisitive_ghost ? "Enabled" : "Disabled"]")) - -//Admin Preferences -/client/proc/toggleadminhelpsound() - set name = "Hear/Silence Adminhelps" - set category = "Preferences.Admin" - set desc = "Toggle hearing a notification when admin PMs are received" - if(!holder) - return - prefs.toggles ^= SOUND_ADMINHELP - prefs.save_preferences() - to_chat(usr, "You will [(prefs.toggles & SOUND_ADMINHELP) ? "now" : "no longer"] hear a sound when adminhelps arrive.") - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Adminhelp Sound", "[prefs.toggles & SOUND_ADMINHELP ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/toggleannouncelogin() - set name = "Do/Don't Announce Login" - set category = "Preferences.Admin" - set desc = "Toggle if you want an announcement to admins when you login during a round" - if(!holder) - return - prefs.toggles ^= ANNOUNCE_LOGIN - prefs.save_preferences() - to_chat(usr, "You will [(prefs.toggles & ANNOUNCE_LOGIN) ? "now" : "no longer"] have an announcement to other admins when you login.") - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Login Announcement", "[prefs.toggles & ANNOUNCE_LOGIN ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/toggle_hear_radio() - set name = "Show/Hide Radio Chatter" - set category = "Preferences.Admin" - set desc = "Toggle seeing radiochatter from nearby radios and speakers" - if(!holder) - return - prefs.chat_toggles ^= CHAT_RADIO - prefs.save_preferences() - to_chat(usr, "You will [(prefs.chat_toggles & CHAT_RADIO) ? "now" : "no longer"] see radio chatter from nearby radios or speakers") - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Radio Chatter", "[prefs.chat_toggles & CHAT_RADIO ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/toggle_split_admin_tabs() - set name = "Toggle Split Admin Tabs" - set category = "Preferences.Admin" - set desc = "Toggle the admin tab being split into separate tabs instead of being merged into one" - if(!holder) - return - prefs.toggles ^= SPLIT_ADMIN_TABS - prefs.save_preferences() - to_chat(src, "Admin tabs will now [(prefs.toggles & SPLIT_ADMIN_TABS) ? "be" : "not be"] split.") - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Split Admin Tabs", "[prefs.toggles & SPLIT_ADMIN_TABS ? "Enabled" : "Disabled"]")) - -/client/proc/deadchat() - set name = "Show/Hide Deadchat" - set category = "Preferences.Admin" - set desc ="Toggles seeing deadchat" - if(!holder) - return - prefs.chat_toggles ^= CHAT_DEAD - prefs.save_preferences() - to_chat(src, "You will [(prefs.chat_toggles & CHAT_DEAD) ? "now" : "no longer"] see deadchat.") - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Deadchat Visibility", "[prefs.chat_toggles & CHAT_DEAD ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/toggleprayers() - set name = "Show/Hide Prayers" - set category = "Preferences.Admin" - set desc = "Toggles seeing prayers" - if(!holder) - return - prefs.chat_toggles ^= CHAT_PRAYER - prefs.save_preferences() - to_chat(src, "You will [(prefs.chat_toggles & CHAT_PRAYER) ? "now" : "no longer"] see prayerchat.") - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Prayer Visibility", "[prefs.chat_toggles & CHAT_PRAYER ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/toggle_prayer_sound() - set name = "Hear/Silence Prayer Sounds" - set category = "Preferences.Admin" - set desc = "Hear Prayer Sounds" - if(!holder) - return - prefs.toggles ^= SOUND_PRAYERS - prefs.save_preferences() - to_chat(usr, "You will [(prefs.toggles & SOUND_PRAYERS) ? "now" : "no longer"] hear a sound when prayers arrive.") - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Prayer Sounds", "[usr.client.prefs.toggles & SOUND_PRAYERS ? "Enabled" : "Disabled"]")) - -/client/proc/colorasay() - set name = "Set Admin Say Color" - set category = "Preferences.Admin" - set desc = "Set the color of your ASAY messages" - if(!holder) - return - if(!CONFIG_GET(flag/allow_admin_asaycolor)) - to_chat(src, "Custom Asay color is currently disabled by the server.") - return - var/new_asaycolor = input(src, "Please select your ASAY color.", "ASAY color", prefs.asaycolor) as color|null - if(new_asaycolor) - prefs.asaycolor = sanitize_ooccolor(new_asaycolor) - prefs.save_preferences() - SSblackbox.record_feedback("tally", "admin_verb", 1, "Set ASAY Color") - return - -/client/proc/resetasaycolor() - set name = "Reset your Admin Say Color" - set desc = "Returns your ASAY Color to default" - set category = "Preferences.Admin" - if(!holder) - return - if(!CONFIG_GET(flag/allow_admin_asaycolor)) - to_chat(src, "Custom Asay color is currently disabled by the server.") - return - prefs.asaycolor = initial(prefs.asaycolor) - prefs.save_preferences() 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 8ad41fd482f..54563b92900 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 f32ffbf9c0c..1ff5a78e4de 100644 --- a/code/modules/events/brain_trauma.dm +++ b/code/modules/events/brain_trauma.dm @@ -28,7 +28,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 b387318e487..4e1a4d7353d 100644 --- a/code/modules/events/brand_intelligence.dm +++ b/code/modules/events/brand_intelligence.dm @@ -55,7 +55,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 cf3e8a36594..ed8f47d1be7 100644 --- a/code/modules/events/heart_attack.dm +++ b/code/modules/events/heart_attack.dm @@ -19,7 +19,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 a32615bbc9e..c1ee73801a8 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 f29013852ea..7bb58e40677 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 d28c5fa9b9c..1a311315480 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 7acb4eb9117..b520854d20a 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 0ca63555d68..00dfed2c84d 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 0bc23407eec..2c2f7de392b 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 b6bf22aa3b0..bd8771dc7b7 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 a55fc3a4c47..3247058064b 100644 --- a/code/modules/mining/machine_vending.dm +++ b/code/modules/mining/machine_vending.dm @@ -175,7 +175,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", "Neural Lace Kit") //SKYRAT EDIT - Neural Laces - 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 89726ebe2ac..1e1092a24e2 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -618,8 +618,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() @@ -656,7 +656,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 2a309117358..5530caa303d 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1030,7 +1030,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) @@ -1072,7 +1072,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)) @@ -1088,7 +1088,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)) @@ -1110,7 +1110,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 6a0ddf50dd0..cce61c850e2 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -836,7 +836,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() @@ -860,7 +860,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 52534a77582..71d1ca0decf 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -738,7 +738,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 bb02dda68c1..5b0b832dae8 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -561,7 +561,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() @@ -596,7 +596,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. @@ -621,7 +621,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) @@ -642,7 +642,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) @@ -912,7 +912,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 a29fd2b093f..97d7b2a4404 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 8731bc1d14e..0bf11af8af1 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 4406ecd056a..4c7558377bf 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) @@ -300,7 +300,7 @@ laws = new /datum/ai_laws/ninja_override() //SKYRAT EDIT CHANGE BEGIN - Role Selection //model.transform_to(pick(/obj/item/robot_model/syndicate, /obj/item/robot_model/syndicate_medical, /obj/item/robot_model/saboteur)) - SKYRAT EDIT - ORIGINAL - var/choice = input(src,"What role do you wish to become?","Select Role") in sortList(modelselected) + var/choice = input(src,"What role do you wish to become?","Select Role") in sort_list(modelselected) model.transform_to(modelselected[choice]) //SKYRAT EDIT CHANGE END 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 5973780eaa4..ccd8606da75 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 6a899646a8a..0b05ec37bea 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -124,18 +124,18 @@ /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) //SKYRAT EDIT ADDITION BEGIN - Skyrat-SS13/Skyrat-tg#1931 if(upgrade_reagents) - upgrade_reagents = sortList(upgrade_reagents, /proc/cmp_reagents_asc) + upgrade_reagents = sort_list(upgrade_reagents, /proc/cmp_reagents_asc) if(upgrade_reagents2) - upgrade_reagents2 = sortList(upgrade_reagents2, /proc/cmp_reagents_asc) + upgrade_reagents2 = sort_list(upgrade_reagents2, /proc/cmp_reagents_asc) if(upgrade_reagents3) - upgrade_reagents3 = sortList(upgrade_reagents3, /proc/cmp_reagents_asc) + upgrade_reagents3 = sort_list(upgrade_reagents3, /proc/cmp_reagents_asc) //SKYRAT EDIT ADDITION END if(is_operational) begin_processing() diff --git a/code/modules/reagents/reagent_containers/borghydro.dm b/code/modules/reagents/reagent_containers/borghydro.dm index b05189c596b..8463c142768 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 c39908b20c6..5fa4a44b109 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 8bc22952053..e0b4c9f17da 100644 --- a/code/modules/surgery/bodyparts/_bodyparts.dm +++ b/code/modules/surgery/bodyparts/_bodyparts.dm @@ -1027,7 +1027,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) diff --git a/modular_skyrat/master_files/code/game/objects/structures/trash_pile.dm b/modular_skyrat/master_files/code/game/objects/structures/trash_pile.dm index cb3bf6db0a7..e4b49651023 100644 --- a/modular_skyrat/master_files/code/game/objects/structures/trash_pile.dm +++ b/modular_skyrat/master_files/code/game/objects/structures/trash_pile.dm @@ -68,9 +68,9 @@ //Random lists /obj/structure/trash_pile/proc/produce_alpha_item() - var/lootspawn = pickweight(GLOB.maintenance_loot) + var/lootspawn = pick_weight(GLOB.maintenance_loot) while(islist(lootspawn)) - lootspawn = pickweight(lootspawn) + lootspawn = pick_weight(lootspawn) var/obj/item/I = new lootspawn(get_turf(src)) return I diff --git a/modular_skyrat/master_files/code/modules/projectiles/guns/gun.dm b/modular_skyrat/master_files/code/modules/projectiles/guns/gun.dm index 7af27843c74..2608aa0e20a 100644 --- a/modular_skyrat/master_files/code/modules/projectiles/guns/gun.dm +++ b/modular_skyrat/master_files/code/modules/projectiles/guns/gun.dm @@ -127,7 +127,7 @@ burst_size = 1 - sortList(fire_select_modes, /proc/cmp_numeric_asc) + sort_list(fire_select_modes, /proc/cmp_numeric_asc) if(fire_select_modes.len > 1) firemode_action = new(src) @@ -570,7 +570,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/modular_skyrat/modules/advanced_choice_beacons/code/advanced_choice_beacon.dm b/modular_skyrat/modules/advanced_choice_beacons/code/advanced_choice_beacon.dm index a1b943f6450..24bfe2df1e7 100644 --- a/modular_skyrat/modules/advanced_choice_beacons/code/advanced_choice_beacon.dm +++ b/modular_skyrat/modules/advanced_choice_beacons/code/advanced_choice_beacon.dm @@ -50,7 +50,7 @@ options[our_object] = option - sortList(options) + sort_list(options) return options @@ -75,6 +75,6 @@ options[our_crate] = option - sortList(options) + sort_list(options) return options diff --git a/modular_skyrat/modules/altborgs/code/modules/mob/living/silicon/robot/robot.dm b/modular_skyrat/modules/altborgs/code/modules/mob/living/silicon/robot/robot.dm index eb6e3b9d9ef..ff251f939fd 100644 --- a/modular_skyrat/modules/altborgs/code/modules/mob/living/silicon/robot/robot.dm +++ b/modular_skyrat/modules/altborgs/code/modules/mob/living/silicon/robot/robot.dm @@ -90,7 +90,7 @@ "Skyrat Service(alt skins)" = /obj/item/robot_model/service/skyrat, "Skyrat Miner(alt skins)" = /obj/item/robot_model/miner/skyrat ) - var/input_model_sk = input("Please select a module, or choose a reskin.", "Robot", null, null) as null|anything in sortList(skyratmodel) + var/input_model_sk = input("Please select a module, or choose a reskin.", "Robot", null, null) as null|anything in sort_list(skyratmodel) if(input_model_sk == "Departmental Modules" || !input_model_sk || model.type != /obj/item/robot_model) return ..() else diff --git a/modular_skyrat/modules/altborgs/code/modules/mob/living/silicon/robot/robot_modules.dm b/modular_skyrat/modules/altborgs/code/modules/mob/living/silicon/robot/robot_modules.dm index 69cec795ac6..329c2f6b159 100644 --- a/modular_skyrat/modules/altborgs/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/modular_skyrat/modules/altborgs/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -41,7 +41,7 @@ var/image/wide = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/widerobot_serv.dmi', icon_state = L[a]) wide.pixel_x = -16 standard_icons[a] = wide - standard_icons = sortList(standard_icons) + standard_icons = sort_list(standard_icons) var/standard_borg_icon = show_radial_menu(cyborg, cyborg , standard_icons, custom_check = CALLBACK(src, .proc/check_menu, cyborg, old_model), radius = 42, require_near = TRUE) switch(standard_borg_icon) if("Default") @@ -113,7 +113,7 @@ var/image/wide = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/widerobot_med.dmi', icon_state = L[a]) wide.pixel_x = -16 med_icons[a] = wide - med_icons = sortList(med_icons) + med_icons = sort_list(med_icons) var/med_borg_icon = show_radial_menu(cyborg, cyborg , med_icons, custom_check = CALLBACK(src, .proc/check_menu, cyborg, old_model), radius = 42, require_near = TRUE) switch(med_borg_icon) if("Default") @@ -241,7 +241,7 @@ var/image/wide = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/widerobot_eng.dmi', icon_state = L[a]) wide.pixel_x = -16 engi_icons[a] = wide - engi_icons = sortList(engi_icons) + engi_icons = sort_list(engi_icons) var/engi_borg_icon = show_radial_menu(cyborg, cyborg , engi_icons, custom_check = CALLBACK(src, .proc/check_menu, cyborg, old_model), radius = 42, require_near = TRUE) switch(engi_borg_icon) if("Default") @@ -373,7 +373,7 @@ var/image/wide = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/widerobot_sec.dmi', icon_state = L[a]) wide.pixel_x = -16 sec_icons[a] = wide - sec_icons = sortList(sec_icons) + sec_icons = sort_list(sec_icons) var/sec_borg_icon = show_radial_menu(cyborg, cyborg , sec_icons, custom_check = CALLBACK(src, .proc/check_menu, cyborg, old_model), radius = 42, require_near = TRUE) switch(sec_borg_icon) if("Default") @@ -486,7 +486,7 @@ var/image/wide = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/widerobot_pk.dmi', icon_state = L[a]) wide.pixel_x = -16 peace_icons[a] = wide - peace_icons = sortList(peace_icons) + peace_icons = sort_list(peace_icons) var/peace_borg_icon = show_radial_menu(cyborg, cyborg , peace_icons, custom_check = CALLBACK(src, .proc/check_menu, cyborg, old_model), radius = 42, require_near = TRUE) switch(peace_borg_icon) if("Default") @@ -567,7 +567,7 @@ var/image/wide = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/widerobot_jani.dmi', icon_state = L[a]) wide.pixel_x = -16 janitor_icons[a] = wide - janitor_icons = sortList(janitor_icons) + janitor_icons = sort_list(janitor_icons) var/janitor_robot_icon = show_radial_menu(cyborg, cyborg , janitor_icons, custom_check = CALLBACK(src, .proc/check_menu, cyborg, old_model), radius = 42, require_near = TRUE) switch(janitor_robot_icon) if("Default") @@ -649,7 +649,7 @@ //CLOWN /obj/item/robot_model/clown/be_transformed_to(obj/item/robot_model/old_model) var/mob/living/silicon/robot/cyborg = loc - var/static/list/clown_icons = sortList(list( + var/static/list/clown_icons = sort_list(list( "Default" = image(icon = 'icons/mob/robots.dmi', icon_state = "clown"), "Bootyborg" = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/robots_clown.dmi', icon_state = "bootyclown"), "Male Bootyborg" = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/robots_clown.dmi', icon_state = "male_bootyclown"), @@ -712,7 +712,7 @@ var/image/wide = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/widerobot_serv.dmi', icon_state = L[a]) wide.pixel_x = -16 service_icons[a] = wide - service_icons = sortList(service_icons) + service_icons = sort_list(service_icons) var/service_robot_icon = show_radial_menu(cyborg, cyborg , service_icons, custom_check = CALLBACK(src, .proc/check_menu, cyborg, old_model), radius = 42, require_near = TRUE) switch(service_robot_icon) if("Waitress") @@ -817,7 +817,7 @@ var/image/wide = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/widerobot_mine.dmi', icon_state = L[a]) wide.pixel_x = -16 mining_icons[a] = wide - mining_icons = sortList(mining_icons) + mining_icons = sort_list(mining_icons) var/mining_borg_icon = show_radial_menu(cyborg, cyborg , mining_icons, custom_check = CALLBACK(src, .proc/check_menu, cyborg, old_model), radius = 42, require_near = TRUE) switch(mining_borg_icon) if("Lavaland") @@ -945,7 +945,7 @@ /obj/item/robot_model/syndicatejack/be_transformed_to(obj/item/robot_model/old_model) var/mob/living/silicon/robot/cyborg = loc - var/static/list/syndicatejack_icons = sortList(list( + var/static/list/syndicatejack_icons = sort_list(list( "Saboteur" = image(icon = 'icons/mob/robots.dmi', icon_state = "synd_engi"), "Medical" = image(icon = 'icons/mob/robots.dmi', icon_state = "synd_medical"), "Assault" = image(icon = 'icons/mob/robots.dmi', icon_state = "synd_sec"), diff --git a/modular_skyrat/modules/cme/code/cme.dm b/modular_skyrat/modules/cme/code/cme.dm index e3133c9ebd2..a0fd4b1be53 100644 --- a/modular_skyrat/modules/cme/code/cme.dm +++ b/modular_skyrat/modules/cme/code/cme.dm @@ -273,7 +273,7 @@ Armageddon is truly going to fuck the station, use it sparingly. color = COLOR_WHITE light_color = COLOR_WHITE neutralized = TRUE - var/atom/movable/loot = pickweight(GLOB.cme_loot_list) + var/atom/movable/loot = pick_weight(GLOB.cme_loot_list) new loot(loc) /obj/effect/cme/extreme/anomalyNeutralize() @@ -285,7 +285,7 @@ Armageddon is truly going to fuck the station, use it sparingly. color = COLOR_WHITE light_color = COLOR_WHITE neutralized = TRUE - var/atom/movable/loot = pickweight(GLOB.cme_loot_list) + var/atom/movable/loot = pick_weight(GLOB.cme_loot_list) new loot(loc) /obj/effect/cme/armageddon/anomalyNeutralize() @@ -297,5 +297,5 @@ Armageddon is truly going to fuck the station, use it sparingly. color = COLOR_WHITE light_color = COLOR_WHITE neutralized = TRUE - var/atom/movable/loot = pickweight(GLOB.cme_loot_list) + var/atom/movable/loot = pick_weight(GLOB.cme_loot_list) new loot(loc) diff --git a/modular_skyrat/modules/customization/modules/client/preferences.dm b/modular_skyrat/modules/customization/modules/client/preferences.dm index 84220221233..992f3b544a3 100644 --- a/modular_skyrat/modules/customization/modules/client/preferences.dm +++ b/modular_skyrat/modules/customization/modules/client/preferences.dm @@ -2659,7 +2659,7 @@ GLOBAL_LIST_INIT(food, list( friendlyname += " (disabled)" maplist[friendlyname] = VM.map_name maplist[default] = null - var/pickedmap = input(user, "Choose your preferred map. This will be used to help weight random map selection.", "Character Preference") as null|anything in sortList(maplist) + var/pickedmap = input(user, "Choose your preferred map. This will be used to help weight random map selection.", "Character Preference") as null|anything in sort_list(maplist) if (pickedmap) preferred_map = maplist[pickedmap] @@ -2669,7 +2669,7 @@ GLOBAL_LIST_INIT(food, list( clientfps = sanitize_integer(desiredfps, -1, 1000, clientfps) parent.fps = (clientfps < 0) ? RECOMMENDED_FPS : clientfps if("ui") - var/pickedui = input(user, "Choose your UI style.", "Character Preference", UI_style) as null|anything in sortList(GLOB.available_ui_styles) + var/pickedui = input(user, "Choose your UI style.", "Character Preference", UI_style) as null|anything in sort_list(GLOB.available_ui_styles) if(pickedui) UI_style = pickedui if (parent && parent.mob && parent.mob.hud_used) @@ -2799,7 +2799,7 @@ GLOBAL_LIST_INIT(food, list( if(!length(key_bindings[old_key])) key_bindings -= old_key key_bindings[full_key] += list(kb_name) - key_bindings[full_key] = sortList(key_bindings[full_key]) + key_bindings[full_key] = sort_list(key_bindings[full_key]) user << browse(null, "window=capturekeypress") user.client.set_macros() diff --git a/modular_skyrat/modules/customization/modules/client/preferences_savefile.dm b/modular_skyrat/modules/customization/modules/client/preferences_savefile.dm index ecde6f878e4..5b5bed9eeaf 100644 --- a/modular_skyrat/modules/customization/modules/client/preferences_savefile.dm +++ b/modular_skyrat/modules/customization/modules/client/preferences_savefile.dm @@ -492,7 +492,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["alt_titles_preferences"] >> alt_titles_preferences alt_titles_preferences = SANITIZE_LIST(alt_titles_preferences) if(SSjob) - for(var/datum/job/job as anything in sortList(SSjob.joinable_occupations, /proc/cmp_job_display_asc)) + for(var/datum/job/job as anything in sort_list(SSjob.joinable_occupations, /proc/cmp_job_display_asc)) if(alt_titles_preferences[job.title]) if(!(alt_titles_preferences[job.title] in job.alt_titles)) alt_titles_preferences.Remove(job.title) diff --git a/modular_skyrat/modules/emotes/code/additionalemotes/turf_emote.dm b/modular_skyrat/modules/emotes/code/additionalemotes/turf_emote.dm index a657ca220a7..1d49191fb00 100644 --- a/modular_skyrat/modules/emotes/code/additionalemotes/turf_emote.dm +++ b/modular_skyrat/modules/emotes/code/additionalemotes/turf_emote.dm @@ -86,7 +86,7 @@ var/current_turf display_turf[initial(choice)] = option - sortList(display_turf) + sort_list(display_turf) var/chosen_turf = show_radial_menu(user, user, display_turf, custom_check = CALLBACK(src, .proc/check_menu, user)) if(QDELETED(src) || QDELETED(user) || !chosen_turf) diff --git a/modular_skyrat/modules/fishing/code/fishing.dm b/modular_skyrat/modules/fishing/code/fishing.dm index b1386121fe2..81391f2177a 100644 --- a/modular_skyrat/modules/fishing/code/fishing.dm +++ b/modular_skyrat/modules/fishing/code/fishing.dm @@ -76,7 +76,7 @@ GLOBAL_LIST_INIT(fishing_weights, list( /datum/component/fishing/proc/create_reward(turf/spawning_turf) if(generate_fish) generate_fish(spawning_turf, random_fish_type()) - var/atom/spawning_reward = pickweight(possible_loot) + var/atom/spawning_reward = pick_weight(possible_loot) new spawning_reward(spawning_turf) atom_parent.visible_message(span_notice("Something flys out of [atom_parent]!")) if(prob(1)) diff --git a/modular_skyrat/modules/icspawning/code/_onclick/observer.dm b/modular_skyrat/modules/icspawning/code/_onclick/observer.dm index 7701e34a43b..cf37b91868a 100644 --- a/modular_skyrat/modules/icspawning/code/_onclick/observer.dm +++ b/modular_skyrat/modules/icspawning/code/_onclick/observer.dm @@ -93,7 +93,7 @@ var/datum/outfit/O = path //not much to initalize here but whatever outfits[initial(O.name)] = path - var/dresscode = tgui_input_list(src, "Select outfit", "Robust quick dress shop", baseoutfits + sortList(outfits)) + var/dresscode = tgui_input_list(src, "Select outfit", "Robust quick dress shop", baseoutfits + sort_list(outfits)) if (isnull(dresscode)) return @@ -108,7 +108,7 @@ 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 @@ -120,7 +120,7 @@ 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 @@ -129,7 +129,7 @@ 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 diff --git a/modular_skyrat/modules/mentor/code/mentorpm.dm b/modular_skyrat/modules/mentor/code/mentorpm.dm index f48df50048a..a2c12a264ce 100644 --- a/modular_skyrat/modules/mentor/code/mentorpm.dm +++ b/modular_skyrat/modules/mentor/code/mentorpm.dm @@ -9,7 +9,7 @@ for(var/client/T) targets["[T]"] = T - var/list/sorted = sortList(targets) + var/list/sorted = sort_list(targets) var/target = input(src,"To whom shall we send a message?","Mentor PM",null) in sorted|null cmd_mentor_pm(targets[target],null) SSblackbox.record_feedback("tally", "Mentor_verb", 1, "APM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/modular_skyrat/modules/sec_haul/code/guns/ammo.dm b/modular_skyrat/modules/sec_haul/code/guns/ammo.dm index 93e8d377c42..aa7774277d5 100644 --- a/modular_skyrat/modules/sec_haul/code/guns/ammo.dm +++ b/modular_skyrat/modules/sec_haul/code/guns/ammo.dm @@ -155,7 +155,7 @@ . = ..() if(possible_types.len <= 1) return - var/new_type = input("Please select a magazine type to reskin to:", "Reskin", null, null) as null|anything in sortList(possible_types) + var/new_type = input("Please select a magazine type to reskin to:", "Reskin", null, null) as null|anything in sort_list(possible_types) if(!new_type) new_type = AMMO_TYPE_LETHAL round_type = new_type @@ -194,7 +194,7 @@ /obj/item/ammo_box/revolver/AltClick(mob/user) . = ..() - var/new_type = input("Please select a magazine type to reskin to:", "Reskin", null, null) as null|anything in sortList(possible_types) + var/new_type = input("Please select a magazine type to reskin to:", "Reskin", null, null) as null|anything in sort_list(possible_types) if(!new_type) new_type = AMMO_TYPE_LETHAL round_type = new_type diff --git a/modular_skyrat/modules/sec_haul/code/guns/gun_spawns.dm b/modular_skyrat/modules/sec_haul/code/guns/gun_spawns.dm index 2e4c9f05ee6..2953cdebda8 100644 --- a/modular_skyrat/modules/sec_haul/code/guns/gun_spawns.dm +++ b/modular_skyrat/modules/sec_haul/code/guns/gun_spawns.dm @@ -22,9 +22,9 @@ if(guns?.len) var/guns_spawned = 0 while((gun_count - guns_spawned) && guns.len) - var/gunspawn = pickweight(guns) + var/gunspawn = pick_weight(guns) while(islist(gunspawn)) - gunspawn = pickweight(gunspawn) + gunspawn = pick_weight(gunspawn) if(!gun_doubles) guns.Remove(gunspawn) diff --git a/modular_skyrat/modules/shapeshifting_module/code/game/objects/items/borg_shapeshifter.dm b/modular_skyrat/modules/shapeshifting_module/code/game/objects/items/borg_shapeshifter.dm index d43b2fba615..e40f8de0b00 100644 --- a/modular_skyrat/modules/shapeshifting_module/code/game/objects/items/borg_shapeshifter.dm +++ b/modular_skyrat/modules/shapeshifting_module/code/game/objects/items/borg_shapeshifter.dm @@ -142,7 +142,7 @@ to_chat(user, "\the [src] is recharging.") return var/mob/living/silicon/robot/R = loc - var/static/list/model_icons = sortList(list( + var/static/list/model_icons = sort_list(list( "Standard" = image(icon = 'icons/mob/robots.dmi', icon_state = "robot"), "Medical" = image(icon = 'icons/mob/robots.dmi', icon_state = "medical"), "Engineer" = image(icon = 'icons/mob/robots.dmi', icon_state = "engineer"), @@ -160,7 +160,7 @@ switch(model_selection) if("Standard") - var/static/list/standard_icons = sortList(list( + var/static/list/standard_icons = sort_list(list( "Default" = image(icon = 'icons/mob/robots.dmi', icon_state = "robot"), "Marina" = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/robots.dmi', icon_state = "marinasd"), "Heavy" = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/robots.dmi', icon_state = "heavysd"), @@ -176,7 +176,7 @@ var/image/wide = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/widerobot_serv.dmi', icon_state = L[a]) wide.pixel_x = -16 standard_icons[a] = wide - standard_icons = sortList(standard_icons) + standard_icons = sort_list(standard_icons) var/borg_icon = show_radial_menu(R, R , standard_icons, custom_check = CALLBACK(src, .proc/check_menu, R), radius = 42, require_near = TRUE) if(!borg_icon) return FALSE @@ -245,7 +245,7 @@ var/image/wide = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/widerobot_med.dmi', icon_state = L[a]) wide.pixel_x = -16 med_icons[a] = wide - med_icons = sortList(med_icons) + med_icons = sort_list(med_icons) var/borg_icon = show_radial_menu(R, R , med_icons, custom_check = CALLBACK(src, .proc/check_menu, R), radius = 42, require_near = TRUE) if(!borg_icon) return FALSE @@ -352,7 +352,7 @@ var/image/wide = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/widerobot_eng.dmi', icon_state = L[a]) wide.pixel_x = -16 engi_icons[a] = wide - engi_icons = sortList(engi_icons) + engi_icons = sort_list(engi_icons) var/borg_icon = show_radial_menu(R, R , engi_icons, custom_check = CALLBACK(src, .proc/check_menu, R), radius = 42, require_near = TRUE) if(!borg_icon) return FALSE @@ -475,7 +475,7 @@ var/image/wide = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/widerobot_sec.dmi', icon_state = L[a]) wide.pixel_x = -16 sec_icons[a] = wide - sec_icons = sortList(sec_icons) + sec_icons = sort_list(sec_icons) var/borg_icon = show_radial_menu(R, R , sec_icons, custom_check = CALLBACK(src, .proc/check_menu, R), radius = 42, require_near = TRUE) if(!borg_icon) return FALSE @@ -594,7 +594,7 @@ var/image/wide = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/widerobot_jani.dmi', icon_state = L[a]) wide.pixel_x = -16 service_icons[a] = wide - service_icons = sortList(service_icons) + service_icons = sort_list(service_icons) var/borg_icon = show_radial_menu(R, R , service_icons, custom_check = CALLBACK(src, .proc/check_menu, R), radius = 42, require_near = TRUE) if(!borg_icon) return FALSE @@ -751,7 +751,7 @@ var/image/wide = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/widerobot_mine.dmi', icon_state = L[a]) wide.pixel_x = -16 mining_icons[a] = wide - mining_icons = sortList(mining_icons) + mining_icons = sort_list(mining_icons) var/borg_icon = show_radial_menu(R, R , mining_icons, custom_check = CALLBACK(src, .proc/check_menu, R), radius = 42, require_near = TRUE) if(!borg_icon) return FALSE @@ -833,7 +833,7 @@ else return FALSE if("Peacekeeper") - var/static/list/peace_icons = sortList(list( + var/static/list/peace_icons = sort_list(list( "Default" = image(icon = 'icons/mob/robots.dmi', icon_state = "peace"), "Spider" = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/robots_pk.dmi', icon_state = "whitespider"), "Sleek" = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/robots_pk.dmi', icon_state = "sleekpeace"), @@ -849,7 +849,7 @@ var/image/wide = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/widerobot_pk.dmi', icon_state = L[a]) wide.pixel_x = -16 peace_icons[a] = wide - peace_icons = sortList(peace_icons) + peace_icons = sort_list(peace_icons) var/borg_icon = show_radial_menu(R, R , peace_icons, custom_check = CALLBACK(src, .proc/check_menu, R), radius = 42, require_near = TRUE) if(!borg_icon) return FALSE @@ -899,7 +899,7 @@ else return FALSE if("Clown") - var/static/list/clown_icons = sortList(list( + var/static/list/clown_icons = sort_list(list( "Default" = image(icon = 'icons/mob/robots.dmi', icon_state = "clown"), "Bootyborg" = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/robots_clown.dmi', icon_state = "bootyclown"), "Male Bootyborg" = image(icon = 'modular_skyrat/modules/altborgs/icons/mob/robots_clown.dmi', icon_state = "male_bootyclown"), @@ -938,7 +938,7 @@ else return FALSE if("Syndicate") - var/static/list/syndicatejack_icons = sortList(list( + var/static/list/syndicatejack_icons = sort_list(list( "Saboteur" = image(icon = 'icons/mob/robots.dmi', icon_state = "synd_engi"), "Medical" = image(icon = 'icons/mob/robots.dmi', icon_state = "synd_medical"), "Assault" = image(icon = 'icons/mob/robots.dmi', icon_state = "synd_sec"), @@ -991,7 +991,7 @@ else return FALSE if("Spider Clan") - var/static/list/ninja_icons = sortList(list( + var/static/list/ninja_icons = sort_list(list( "Saboteur" = image(icon = 'modular_skyrat/modules/specborg/icons/mob/moreborgs.dmi', icon_state = "ninja_engi"), "Medical" = image(icon = 'modular_skyrat/modules/specborg/icons/mob/moreborgs.dmi', icon_state = "ninja_medical"), "Assault" = image(icon = 'modular_skyrat/modules/specborg/icons/mob/moreborgs.dmi', icon_state = "ninja_sec"), diff --git a/modular_skyrat/modules/specborg/code/modules/living/sillicon/robot/robot_module.dm b/modular_skyrat/modules/specborg/code/modules/living/sillicon/robot/robot_module.dm index 38794ec5fb6..06261ed2abd 100644 --- a/modular_skyrat/modules/specborg/code/modules/living/sillicon/robot/robot_module.dm +++ b/modular_skyrat/modules/specborg/code/modules/living/sillicon/robot/robot_module.dm @@ -28,7 +28,7 @@ /obj/item/robot_model/ninja/be_transformed_to(obj/item/robot_model/old_model) var/mob/living/silicon/robot/cyborg = loc - var/static/list/ninja_icons = sortList(list( + var/static/list/ninja_icons = sort_list(list( "Saboteur" = image(icon = 'modular_skyrat/modules/specborg/icons/mob/moreborgs.dmi', icon_state = "ninja_engi"), "Medical" = image(icon = 'modular_skyrat/modules/specborg/icons/mob/moreborgs.dmi', icon_state = "ninja_medical"), "Assault" = image(icon = 'modular_skyrat/modules/specborg/icons/mob/moreborgs.dmi', icon_state = "ninja_sec"), @@ -137,7 +137,7 @@ /obj/item/robot_model/ninja_saboteur/be_transformed_to(obj/item/robot_model/old_model) var/mob/living/silicon/robot/cyborg = loc - var/static/list/ninja_icons = sortList(list( + var/static/list/ninja_icons = sort_list(list( "Saboteur" = image(icon = 'modular_skyrat/modules/specborg/icons/mob/moreborgs.dmi', icon_state = "ninja_engi"), "Medical" = image(icon = 'modular_skyrat/modules/specborg/icons/mob/moreborgs.dmi', icon_state = "ninja_medical"), "Assault" = image(icon = 'modular_skyrat/modules/specborg/icons/mob/moreborgs.dmi', icon_state = "ninja_sec"), diff --git a/modular_skyrat/modules/xenoarch/code/modules/research/xenoarch/strange_rock.dm b/modular_skyrat/modules/xenoarch/code/modules/research/xenoarch/strange_rock.dm index 4da08a956c2..ef52c6d8ade 100644 --- a/modular_skyrat/modules/xenoarch/code/modules/research/xenoarch/strange_rock.dm +++ b/modular_skyrat/modules/xenoarch/code/modules/research/xenoarch/strange_rock.dm @@ -48,11 +48,11 @@ var/choose_tier = rand(1,100) switch(choose_tier) if(1 to 70) - hidden_item = pickweight(GLOB.tier1_reward) + hidden_item = pick_weight(GLOB.tier1_reward) if(71 to 97) - hidden_item = pickweight(GLOB.tier2_reward) + hidden_item = pick_weight(GLOB.tier2_reward) if(98 to 100) - hidden_item = pickweight(GLOB.tier3_reward) + hidden_item = pick_weight(GLOB.tier3_reward) /obj/item/xenoarch/strange_rock/proc/create_depth() max_depth = rand(21, 100) diff --git a/modular_skyrat/modules/xenoarch/code/modules/research/xenoarch/xenoarch_machine.dm b/modular_skyrat/modules/xenoarch/code/modules/research/xenoarch/xenoarch_machine.dm index d99740756f4..23b080847d1 100644 --- a/modular_skyrat/modules/xenoarch/code/modules/research/xenoarch/xenoarch_machine.dm +++ b/modular_skyrat/modules/xenoarch/code/modules/research/xenoarch/xenoarch_machine.dm @@ -219,34 +219,34 @@ qdel(content_obj) return if(istype(content_obj, /obj/item/xenoarch/broken_item/tech)) - var/spawn_item = pickweight(GLOB.tech_reward) + var/spawn_item = pick_weight(GLOB.tech_reward) recover_item(spawn_item, content_obj) return if(istype(content_obj, /obj/item/xenoarch/broken_item/weapon)) - var/spawn_item = pickweight(GLOB.weapon_reward) + var/spawn_item = pick_weight(GLOB.weapon_reward) recover_item(spawn_item, content_obj) return if(istype(content_obj, /obj/item/xenoarch/broken_item/illegal)) - var/spawn_item = pickweight(GLOB.illegal_reward) + var/spawn_item = pick_weight(GLOB.illegal_reward) recover_item(spawn_item, content_obj) return if(istype(content_obj, /obj/item/xenoarch/broken_item/alien)) - var/spawn_item = pickweight(GLOB.alien_reward) + var/spawn_item = pick_weight(GLOB.alien_reward) recover_item(spawn_item, content_obj) return if(istype(content_obj, /obj/item/xenoarch/broken_item/plant)) - var/spawn_item = pickweight(GLOB.plant_reward) + var/spawn_item = pick_weight(GLOB.plant_reward) recover_item(spawn_item, content_obj) return if(istype(content_obj, /obj/item/xenoarch/broken_item/clothing)) - var/spawn_item = pickweight(GLOB.clothing_reward) + var/spawn_item = pick_weight(GLOB.clothing_reward) recover_item(spawn_item, content_obj) return if(istype(content_obj, /obj/item/xenoarch/broken_item/animal)) var/spawn_item var/turf/src_turf = get_turf(src) for(var/looptime in 1 to rand(1,4)) - spawn_item = pickweight(GLOB.animal_reward) + spawn_item = pick_weight(GLOB.animal_reward) new spawn_item(src_turf) recover_item(spawn_item, content_obj) return diff --git a/modular_skyrat/modules/xenoarch/code/modules/research/xenoarch/xenoarch_tool.dm b/modular_skyrat/modules/xenoarch/code/modules/research/xenoarch/xenoarch_tool.dm index b45b44f8c3c..8450e1fb07e 100644 --- a/modular_skyrat/modules/xenoarch/code/modules/research/xenoarch/xenoarch_tool.dm +++ b/modular_skyrat/modules/xenoarch/code/modules/research/xenoarch/xenoarch_tool.dm @@ -132,32 +132,32 @@ return var/turf/target_turf = get_turf(target) if(istype(target, /obj/item/xenoarch/broken_item/tech)) - var/spawn_item = pickweight(GLOB.tech_reward) + var/spawn_item = pick_weight(GLOB.tech_reward) new spawn_item(target_turf) qdel(target) return if(istype(target, /obj/item/xenoarch/broken_item/weapon)) - var/spawn_item = pickweight(GLOB.weapon_reward) + var/spawn_item = pick_weight(GLOB.weapon_reward) new spawn_item(target_turf) qdel(target) return if(istype(target, /obj/item/xenoarch/broken_item/illegal)) - var/spawn_item = pickweight(GLOB.illegal_reward) + var/spawn_item = pick_weight(GLOB.illegal_reward) new spawn_item(target_turf) qdel(target) return if(istype(target, /obj/item/xenoarch/broken_item/alien)) - var/spawn_item = pickweight(GLOB.alien_reward) + var/spawn_item = pick_weight(GLOB.alien_reward) new spawn_item(target_turf) qdel(target) return if(istype(target, /obj/item/xenoarch/broken_item/plant)) - var/spawn_item = pickweight(GLOB.plant_reward) + var/spawn_item = pick_weight(GLOB.plant_reward) new spawn_item(target_turf) qdel(target) return if(istype(target, /obj/item/xenoarch/broken_item/clothing)) - var/spawn_item = pickweight(GLOB.clothing_reward) + var/spawn_item = pick_weight(GLOB.clothing_reward) new spawn_item(target_turf) qdel(target) return @@ -165,7 +165,7 @@ var/spawn_item var/turf/src_turf = get_turf(src) for(var/looptime in 1 to rand(1,4)) - spawn_item = pickweight(GLOB.animal_reward) + spawn_item = pick_weight(GLOB.animal_reward) new spawn_item(src_turf) qdel(target) return
    [line]