Grammar and something.

This commit is contained in:
Ghommie
2019-12-10 16:20:57 +01:00
parent 19a3aca619
commit 8ed21b47b6
6 changed files with 29 additions and 28 deletions
+15 -14
View File
@@ -174,35 +174,36 @@
/**
* Returns either the base area the target's belongs to or the target's area itself.
* Returns the base area the target is located in if there is one.
* Alternatively, returns the area as is.
*/
/proc/get_base_area(atom/target)
var/area/A = get_area(target)
if(A?.master_area)
return A.master_area
if(A?.base_area)
return A.base_area
return A
/**
* Returns either null, or a list containing all the sub_areas associated with the base area the target is located in.
* Returns either null, or a list containing every sub area associated with our base area.
* If include_base is TRUE, the base area will also be added to the return list.
*/
/proc/get_sub_areas(atom/target, include_base = FALSE)
/proc/get_sub_areas(atom/target, include_base = TRUE)
var/area/A = get_area(target)
if(!A)
return
. = list()
if(A.master_area)
A = A.master_area
if(A.base_area)
A = A.base_area
if(include_base)
. += A
if(A.sub_areas)
. += A.sub_areas
/**
* Proc for purposes similar to the get_areas_turfs(), but aimed to include associated areas.
* Only takes area (A) instances and paths, no text strings.
* Returns a list of all turfs found in the associated sub_areas (including the base's if include_base is TRUE)
* and located in the same z as target_z, or anywhere if the latter is 0
* Proc used for purposes similar to get_areas_turfs(), but aimed to include associated areas.
* Only accepts area instances and paths for the first arg, no text strings.
* Returns a list of all turfs found in the sub areas (including the base's if include_base is TRUE)
* and located in a z level matching target_z, or anywhere if target_z is 0
*/
/proc/get_sub_areas_turfs(area/A, target_z = 0, include_base = TRUE)
@@ -212,7 +213,7 @@
if(target_z == 0 || target_z == T.z)
. += T
/**
* Simple proc that returns all a sum of all contents from all associated areas,
* Simple proc that returns a sum of all contents from every sub area,
* Think of the above but for all contents, not just turfs, and without target z.
*/
@@ -221,8 +222,8 @@
A = GLOB.areas_by_type[A]
if(!A)
return
if(A.master_area)
A = A.master_area
if(A.base_area)
A = A.base_area
. = list(A.contents)
for(var/i in A.sub_areas)
. += A.sub_areas[i].contents
+9 -9
View File
@@ -70,7 +70,7 @@
* Friendly reminder: don't varedit area paths, make new typepaths instead.
*/
var/list/area/sub_areas //list of typepaths of the areas you wish to link here, will be replaced with a list of references on mapload.
var/area/master_area //The area we wish to use in place of src for certain actions such as APC area linking.
var/area/base_area //The area we wish to use in place of src for certain actions such as APC area linking.
/*Adding a wizard area teleport list because motherfucking lag -- Urist*/
/*I am far too lazy to make it a proper list of areas so I'll just make it run the usual telepot routine at the start of the game*/
@@ -144,16 +144,16 @@ GLOBAL_LIST_EMPTY(teleportlocs)
if(A == src)
WARNING("\"[src]\" area a attempted to link with itself.")
continue
if(A.master_area)
WARNING("[src] attempted to link with [A] while the latter is already linked to another area ([A.master_area]).")
if(A.base_area)
WARNING("[src] attempted to link with [A] while the latter is already linked to another area ([A.base_area]).")
continue
LAZYADD(sub_areas, A)
A.master_area = src
A.base_area = src
return INITIALIZE_HINT_LATELOAD
/area/LateInitialize()
if(!master_area) //we don't want to run it twice.
if(!base_area) //we don't want to run it twice.
power_change() // all machines set to current power level, also updates icon
/area/proc/reg_in_areas_in_z()
@@ -177,13 +177,13 @@ GLOBAL_LIST_EMPTY(teleportlocs)
/area/Destroy()
if(GLOB.areas_by_type[type] == src)
GLOB.areas_by_type[type] = null
if(master_area)
LAZYREMOVE(master_area, src)
master_area = null
if(base_area)
LAZYREMOVE(base_area, src)
base_area = null
if(sub_areas)
for(var/i in sub_areas)
var/area/A = i
A.master_area = null
A.base_area = null
sub_areas -= A
if(A.requires_power)
A.power_light = FALSE
+2 -2
View File
@@ -12,7 +12,7 @@
var/list/skipped_areas = list(/area/engine/engineering, /area/engine/supermatter, /area/engine/atmospherics_engine, /area/ai_monitored/turret_protected/ai)
for(var/area/A in world)
if( !A.requires_power || A.always_unpowered || A.master_area)
if( !A.requires_power || A.always_unpowered || A.base_area)
continue
var/skip = 0
@@ -63,7 +63,7 @@
S.power_change()
for(var/area/A in world)
if(!istype(A, /area/space) && !istype(A, /area/shuttle) && !istype(A, /area/arrival) && !A.always_unpowered && !A.master_area)
if(!istype(A, /area/space) && !istype(A, /area/shuttle) && !istype(A, /area/arrival) && !A.always_unpowered && !A.base_area)
A.power_light = TRUE
A.power_equip = TRUE
A.power_environ = TRUE
@@ -482,7 +482,7 @@ Difficulty: Very Hard
. = ..()
if(!.)
return
for(var/i in get_sub_areas(src, include_base = TRUE))
for(var/i in get_sub_areas(src))
var/area/A = i
if(A.outdoors || (A in affected_targets))
continue
+1 -1
View File
@@ -180,7 +180,7 @@
name = "\improper [A.name] APC"
stat |= MAINT
update_icon()
addtimer(CALLBACK(src, .proc/update), 5)
addtimer(CALLBACK(src, .proc/update), 5)
GLOB.apcs_list += src
+1 -1
View File
@@ -382,7 +382,7 @@
return null
/area/proc/get_apc()
var/target = master_area ? master_area : src
var/target = base_area ? base_area : src
for(var/obj/machinery/power/apc/APC in GLOB.apcs_list)
if(APC.area == target)
return APC