Skip to content

Commit

Permalink
Use regex to remove all instances of var/ in proc args
Browse files Browse the repository at this point in the history
  • Loading branch information
Xander3359 committed Jan 29, 2024
1 parent ef47ac1 commit 1f67b03
Show file tree
Hide file tree
Showing 1,330 changed files with 3,745 additions and 3,745 deletions.
6 changes: 3 additions & 3 deletions code/__defines/directions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#define DOWN 16
#define UP 32

/proc/is_cardinal_dir(var/dir)
/proc/is_cardinal_dir(dir)
return dir && (dir == NORTH || dir == SOUTH || dir == EAST || dir == WEST)

/proc/is_intercardinal_dir(var/dir)
return dir && (dir == NORTHEAST || dir == SOUTHEAST || dir == SOUTHWEST || dir == NORTHWEST)
/proc/is_intercardinal_dir(dir)
return dir && (dir == NORTHEAST || dir == SOUTHEAST || dir == SOUTHWEST || dir == NORTHWEST)
4 changes: 2 additions & 2 deletions code/__defines/radio.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#define RADIO_FREQ_MAX 1899


/proc/frequency_to_name(var/frequency)
/proc/frequency_to_name(frequency)

switch(frequency)
if(RADIO_FREQ_ALPHA)
Expand All @@ -63,4 +63,4 @@
if(frequency == SSradio.radio_rev)
return "Revolutionary"

return "Unknown"
return "Unknown"
2 changes: 1 addition & 1 deletion code/__defines/types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var/global/list/all_typecaches = list()
#define istypecache(needle,haystack) (needle && length(all_typecaches[haystack]) ? (all_typecaches[haystack][needle.type] ? TRUE : FALSE) : FALSE)
#define ispathcache(needle,haystack) (needle && length(all_typecaches[haystack]) ? (all_typecaches[haystack][needle] ? TRUE : FALSE) : FALSE)

/proc/createtypecache(var/datum/type_to_generate)
/proc/createtypecache(datum/type_to_generate)

if(all_typecaches[type_to_generate])
CRASH("Tried generating a typecache that already exists!")
Expand Down
2 changes: 1 addition & 1 deletion code/__helpers/adjectives.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/get_numerical_adjective(var/current=0.5,var/min=0,var/max=1)
/proc/get_numerical_adjective(current=0.5,min=0,max=1)
var/scaled_number = SCALE(current,min,max)
switch(0)

Expand Down
4 changes: 2 additions & 2 deletions code/__helpers/alert.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define within_range(point_A,point_B,range) (point_A.z == point_B.z && get_dist(point_A,point_B) <= range)

/proc/create_alert_process(var/list/list_to_use,var/range = VIEW_RANGE,var/atom/epicenter,var/atom/alert_source,var/alert_level = ALERT_LEVEL_NOISE,var/visual=FALSE)
/proc/create_alert_process(list/list_to_use,range = VIEW_RANGE,atom/epicenter,atom/alert_source,alert_level = ALERT_LEVEL_NOISE,visual=FALSE)

. = 0

Expand Down Expand Up @@ -29,7 +29,7 @@



/proc/create_alert(var/range = VIEW_RANGE,var/turf/epicenter,var/atom/alert_source,var/alert_level = ALERT_LEVEL_NOISE,var/visual=FALSE)
/proc/create_alert(range = VIEW_RANGE,turf/epicenter,atom/alert_source,alert_level = ALERT_LEVEL_NOISE,visual=FALSE)

if(!epicenter)
CRASH("create_alert() had no epicenter!")
Expand Down
10 changes: 5 additions & 5 deletions code/__helpers/armor.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* OLD
//https://www.desmos.com/calculator/uyznrero9w
/proc/calculate_damage_with_armor(var/damage_dealt,var/armor_rating)
/proc/calculate_damage_with_armor(damage_dealt,armor_rating)
if(damage_dealt < 0)
CRASH_SAFE("Damage [damage_dealt] was negative!")
return 0
Expand All @@ -16,7 +16,7 @@

/* OLD
//https://www.desmos.com/calculator/vsmeclqdpy
/proc/calculate_damage_with_armor(var/damage_dealt,var/armor_rating)
/proc/calculate_damage_with_armor(damage_dealt,armor_rating)
if(damage_dealt < 0)
CRASH_SAFE("Damage [damage_dealt] was negative!")
return 0
Expand All @@ -31,7 +31,7 @@

/* OLD
//https://www.desmos.com/calculator/sf50j6wote
/proc/calculate_damage_with_armor(var/damage_dealt,var/armor_rating)
/proc/calculate_damage_with_armor(damage_dealt,armor_rating)
if(damage_dealt < 0)
CRASH_SAFE("Damage [damage_dealt] was negative!")
return 0
Expand All @@ -46,7 +46,7 @@

/* OLD
//https://www.desmos.com/calculator/ihpykmskji
/proc/calculate_damage_with_armor(var/damage_dealt,var/armor_rating)
/proc/calculate_damage_with_armor(damage_dealt,armor_rating)
if(damage_dealt < 0)
CRASH_SAFE("Damage [damage_dealt] was negative!")
return 0
Expand All @@ -69,7 +69,7 @@
*/

// https://www.desmos.com/calculator/4fggsyju5k
/proc/calculate_damage_with_armor(var/damage_dealt,var/armor_rating)
/proc/calculate_damage_with_armor(damage_dealt,armor_rating)

if(damage_dealt < 0)
CRASH("Damage [damage_dealt] was negative!")
Expand Down
4 changes: 2 additions & 2 deletions code/__helpers/astar.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Some code modified to work with Burgerstation.



/proc/AStar_Circle_node(var/obj/marker/map_node/start, var/obj/marker/map_node/goal, var/atom/movable/walker, min_dist=0, maxtraverse=100,var/debug=FALSE)
/proc/AStar_Circle_node(obj/marker/map_node/start, obj/marker/map_node/goal, atom/movable/walker, min_dist=0, maxtraverse=100,debug=FALSE)

var/list/obj/marker/map_node/closedSet = list()
var/list/obj/marker/map_node/openSet = list(start)
Expand Down Expand Up @@ -158,4 +158,4 @@ Some code modified to work with Burgerstation.
if(traverse > maxtraverse)
if(debug) log_debug("AStar_Circle_node: Maximum traverse reached...")
return null // it's taking too long, abandon
return null // if we reach this part, there's no more nodes left to explore
return null // if we reach this part, there's no more nodes left to explore
4 changes: 2 additions & 2 deletions code/__helpers/blood.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#define BLOOD_LIMIT 3
#define BLOOD_LIMIT_HARD 6 //Maximum of how many blood particles there are on a turf.

/proc/create_blood(var/obj/effect/cleanable/blood/desired_effect, var/turf/simulated/desired_loc,var/desired_color = "#FFFFFF",var/desired_x=0,var/desired_y=0,var/bypass_blood_limit=FALSE)
/proc/create_blood(obj/effect/cleanable/blood/desired_effect, turf/simulated/desired_loc,desired_color = "#FFFFFF",desired_x=0,desired_y=0,bypass_blood_limit=FALSE)

if(!desired_loc)
CRASH("No desired_loc provided!")
Expand Down Expand Up @@ -45,4 +45,4 @@
//Move the blood to desired location.
if(desired_x || desired_y)
animate(B,pixel_x = clamp(desired_x,-8,8), pixel_y = clamp(desired_y,-8,8), time = 3)
return B
return B
12 changes: 6 additions & 6 deletions code/__helpers/cmp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
/proc/cmp_name_dsc(atom/a, atom/b)
return sorttext(a.name, b.name)

/proc/cmp_recipe_name_asc(var/reagent_recipe/A,var/reagent_recipe/B)
/proc/cmp_recipe_name_asc(reagent_recipe/A,reagent_recipe/B)
return sorttext(B.name, A.name)

/proc/cmp_recipe_name_dsc(var/reagent_recipe/A,var/reagent_recipe/B)
/proc/cmp_recipe_name_dsc(reagent_recipe/A,reagent_recipe/B)
return sorttext(A.name, B.name)

// Datum cmp with vars is always slower than a specialist cmp proc, use your judgement.
Expand Down Expand Up @@ -56,7 +56,7 @@
/proc/cmp_subsystem_priority(subsystem/a, subsystem/b)
return cmp_numeric_asc(a.priority,b.priority)

/proc/cmp_generation_priority(var/obj/marker/generation/a,var/obj/marker/generation/b)
/proc/cmp_generation_priority(obj/marker/generation/a,obj/marker/generation/b)
return cmp_numeric_asc(a.priority,b.priority)

/proc/cmp_cqc_priority(cqc/a, cqc/b)
Expand All @@ -83,14 +83,14 @@
/proc/cmp_typepaths_asc(A, B)
return sorttext("[B]","[A]")

/proc/cmp_worn_layer_hybrid_asc(var/obj/item/A,var/obj/item/B)
/proc/cmp_worn_layer_hybrid_asc(obj/item/A,obj/item/B)
var/A_score = A.item_slot*10 + A.item_slot_layer
var/B_score = B.item_slot*10 + B.item_slot_layer
return cmp_numeric_asc(A_score,B_score)

/proc/cmp_loadout_dsc(var/list/A,var/list/B)
/proc/cmp_loadout_dsc(list/A,list/B)
return sorttext("[A["name"]]","[B["name"]]")


/proc/cmp_recipe_priority_dsc(var/reagent_recipe/A,var/reagent_recipe/B)
/proc/cmp_recipe_priority_dsc(reagent_recipe/A,reagent_recipe/B)
return cmp_numeric_dsc(A.priority,B.priority)
12 changes: 6 additions & 6 deletions code/__helpers/colors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@


// Couple of helpers to get the RGB of a hexadecimal colour string.
/proc/GetRedPart(var/hexadecimal)
/proc/GetRedPart(hexadecimal)
return hex2num(copytext(hexadecimal, 2, 4))

/proc/GetGreenPart(var/hexadecimal)
/proc/GetGreenPart(hexadecimal)
return hex2num(copytext(hexadecimal, 4, 6))

/proc/GetBluePart(var/hexadecimal)
/proc/GetBluePart(hexadecimal)
return hex2num(copytext(hexadecimal, 6))


/proc/blend_colors(var/color_01,var/color_02,var/power = 0.5)
/proc/blend_colors(color_01,color_02,power = 0.5)
power = clamp(power,0,1)
var/new_red = GetRedPart(color_01)*(1-power) + GetRedPart(color_02)*power
var/new_green = GetGreenPart(color_01)*(1-power) + GetGreenPart(color_02)*power
Expand All @@ -28,11 +28,11 @@


/*
/proc/blend_colors(var/color_01,var/color_02,var/power = 0.5)
/proc/blend_colors(color_01,color_02,power = 0.5)
power = clamp(power,0,1)
var/new_red = GetRedPart(color_01) + GetRedPart(color_02)*power
var/new_green = GetGreenPart(color_01) + GetGreenPart(color_02)*power
var/new_blue = GetBluePart(color_01) + GetBluePart(color_02)*power
var/mod = max(1,max(new_red,new_green,new_blue)/255) //Normalize if needed.
return rgb(new_red/mod,new_green/mod,new_blue/mod)
*/
*/
2 changes: 1 addition & 1 deletion code/__helpers/conversions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
//The string is well, obviously the string being checked
//The datum is used as a source for var names, to check validity
//Otherwise every single word could technically be a variable!
/proc/string2listofvars(var/t_string, var/datum/var_source)
/proc/string2listofvars(t_string, datum/var_source)
if(!t_string || !var_source)
return list()

Expand Down
4 changes: 2 additions & 2 deletions code/__helpers/debug.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/type_debug(var/x)
/proc/type_debug(x)

if(ispath(x))
return "[x] (PATH)"
Expand All @@ -15,4 +15,4 @@
var/datum/D = x
return D.get_debug_name()

return "[x] (UNKNOWN)"
return "[x] (UNKNOWN)"
20 changes: 10 additions & 10 deletions code/__helpers/direction.dm
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
/proc/reverse_direction(var/dir)
/proc/reverse_direction(dir)
return turn(dir, 180)

proc/direction_to_pixel_offset(var/dir)
var/offset_x = (dir & EAST ? 1 : 0) - (dir & WEST ? 1 : 0)
var/offset_y = (dir & NORTH ? 1 : 0) - (dir & SOUTH ? 1 : 0)
return list(offset_x,offset_y)

/proc/get_angle(var/atom/A1,var/atom/A2)
/proc/get_angle(atom/A1,atom/A2)
if(!A1 || !A1.z || !A2 || !A2.z)
return 0
return MODULUS(ATAN2(A1.x - A2.x,A2.y - A1.y) - 90,360) //The 90 offset is needed.

/proc/is_behind(var/atom/A,var/atom/B) //Returns the facing direction if A is directly behind B.
/proc/is_behind(atom/A,atom/B) //Returns the facing direction if A is directly behind B.
return A.loc != B.loc && (get_true_4dir(B.dir) & get_dir_advanced(A,B))

/proc/is_facing(var/atom/A,var/atom/B) //Returns the facing direction if A is facing B.
/proc/is_facing(atom/A,atom/B) //Returns the facing direction if A is facing B.
return A.loc != B.loc && (get_true_4dir(A.dir) & get_dir_advanced(A,B))

/proc/is_facing_cheap(var/atom/A,var/atom/B) //Returns the facing direction if A is facing B.
/proc/is_facing_cheap(atom/A,atom/B) //Returns the facing direction if A is facing B.
return A.loc != B.loc && (get_true_4dir(A.dir) & get_dir(A,B))

/proc/get_directional_offsets(var/atom/A,var/atom/B)
/proc/get_directional_offsets(atom/A,atom/B)
var/x_diff = B.x - A.x
var/y_diff = B.y - A.y
var/maximum = max(abs(x_diff),abs(y_diff))
Expand Down Expand Up @@ -75,11 +75,11 @@ proc/get_true_4dir_advanced(var/previous_dir,var/dir) //Converts a possible 8 wa

return .

/proc/get_dir_advanced(var/atom/A,var/atom/B,var/cardinal_only=FALSE)
/proc/get_dir_advanced(atom/A,atom/B,cardinal_only=FALSE)
var/angle = get_angle(A,B)
return cardinal_only ? angle2dir_cardinal(angle) : angle2dir(angle)

/proc/sanitize_direction(var/dir)
/proc/sanitize_direction(dir)
. = 0x0

var/north = dir & NORTH
Expand All @@ -99,5 +99,5 @@ proc/get_true_4dir_advanced(var/previous_dir,var/dir) //Converts a possible 8 wa
if(west && !east)
. |= WEST

/proc/dir2letter(var/x)
return "[x & 1 ? "n" : ""][x & 2 ? "s" : ""][x & 4 ? "e" : ""][x & 8 ? "w" : ""]"
/proc/dir2letter(x)
return "[x & 1 ? "n" : ""][x & 2 ? "s" : ""][x & 4 ? "e" : ""][x & 8 ? "w" : ""]"
4 changes: 2 additions & 2 deletions code/__helpers/dview.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var/mob/abstract/dview/dview = new


// Version of view() that ignores luminosity and allows you to set
/proc/dview(var/range = world.view, var/atom/source, var/see_invisible = 0)
/proc/dview(range = world.view, atom/source, see_invisible = 0)
dview.loc = source
dview.see_invisible = see_invisible

Expand All @@ -13,4 +13,4 @@ var/mob/abstract/dview/dview = new
dview.see_invisible = invis_flags; \
for(type in view(range, dview))

#define END_FOR_DVIEW dview.loc = null
#define END_FOR_DVIEW dview.loc = null
2 changes: 1 addition & 1 deletion code/__helpers/experience.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/calculate_class(var/mob/living/owner,var/list/skills_and_attributes)
/proc/calculate_class(mob/living/owner,list/skills_and_attributes)

var/list/experience/total_list = owner.skills + owner.attributes

Expand Down
2 changes: 1 addition & 1 deletion code/__helpers/footstep.dm
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/proc/get_footstep_sound(var/material_type)
/proc/get_footstep_sound(material_type)
2 changes: 1 addition & 1 deletion code/__helpers/get.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/mobs_in_range(var/range = VIEW_RANGE,var/atom/A = usr)
/proc/mobs_in_range(range = VIEW_RANGE,atom/A = usr)
. = list()
var/turf/T = get_turf(A)
for(var/k in SSliving.all_mobs)
Expand Down
4 changes: 2 additions & 2 deletions code/__helpers/ghost.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/proc/notify_ghosts(var/text,var/turf/T)
/proc/notify_ghosts(text,turf/T)
var/formatted_message = span("dead bold","[text] (Click <a href='?spectate=1;x=[T.x];y=[T.y];z=[T.z]'>here</a> to observe.)")

for(var/mob/abstract/observer/ghost/O in SSliving.all_mobs)
O.to_chat(formatted_message)

return TRUE
return TRUE
4 changes: 2 additions & 2 deletions code/__helpers/html.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/proc/span(var/class,var/text,var/style)
/proc/span(class,text,style)
return "<span class='[class]' [style ? "style='[style]'" : ""]>[text]</span>"

/proc/div(var/class,var/text)
/proc/div(class,text)
return "<div class='[class]'>[text]</div>"
2 changes: 1 addition & 1 deletion code/__helpers/list.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/debug_list(var/list/L)
/proc/debug_list(list/L)
for(var/k in L)
var/v = L[k]
log_debug("[k]: [v]")
Expand Down
Loading

0 comments on commit 1f67b03

Please sign in to comment.