cleanup _HELPERS/_lists.dm and all the necessary files (#61827)

Bring _HELPERS/_lists.dm to latest standards by:
-Adding proper documentation and fixing existing one
-Giving vars proper names
-Procs now use snake case as per standard (many files that use those procs will be affected)
This commit is contained in:
Ghilker
2021-10-12 14:48:51 +01:00
committed by GitHub
parent 56d21164d0
commit 95c8e00af7
207 changed files with 551 additions and 522 deletions
+1 -1
View File
@@ -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))
+1 -1
View File
@@ -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)
@@ -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.
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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