diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 10e9a730ad0..f412597ff51 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -169,23 +169,6 @@ else return FALSE -// Returns true if direction is blocked from loc -// Checks if doors are open -/proc/DirBlocked(turf/loc, dir) - for(var/obj/structure/window/D in loc) - if(!D.density) - continue - if(D.fulltile) - return 1 - if(D.dir == dir) - return 1 - - for(var/obj/machinery/door/D in loc) - if(!D.density)//if the door is open - continue - else return 1 // if closed, it's a real, air blocking door - return 0 - ///////////////////////////////////////////////////////////////////////// /** @@ -675,40 +658,6 @@ Returns 1 if the chain up to the area contains the given typepath return TRUE return FALSE -/proc/get_step_towards2(atom/ref , atom/trg) - var/base_dir = get_dir(ref, get_step_towards(ref,trg)) - var/turf/temp = get_step_towards(ref,trg) - - if(is_blocked_turf(temp)) - var/dir_alt1 = turn(base_dir, 90) - var/dir_alt2 = turn(base_dir, -90) - var/turf/turf_last1 = temp - var/turf/turf_last2 = temp - var/free_tile - var/breakpoint = 0 - - while(!free_tile && breakpoint < 10) - if(!is_blocked_turf(turf_last1)) - free_tile = turf_last1 - break - if(!is_blocked_turf(turf_last2)) - free_tile = turf_last2 - break - turf_last1 = get_step(turf_last1,dir_alt1) - turf_last2 = get_step(turf_last2,dir_alt2) - breakpoint++ - - if(!free_tile) return get_step(ref, base_dir) - else return get_step_towards(ref,free_tile) - - else return get_step(ref, base_dir) - -//Takes: Anything that could possibly have variables and a varname to check. -//Returns: 1 if found, 0 if not. -/proc/hasvar(datum/A, varname) - if(A.vars.Find(lowertext(varname))) return 1 - else return 0 - //Returns: all the areas in the world /proc/return_areas() var/list/area/areas = list() @@ -752,22 +701,6 @@ Returns 1 if the chain up to the area contains the given typepath turfs += T return turfs -//Takes: Area type as text string or as typepath OR an instance of the area. -//Returns: A list of all atoms (objs, turfs, mobs) in areas of that type of that type in the world. -/proc/get_area_all_atoms(areatype) - if(!areatype) return null - if(istext(areatype)) areatype = text2path(areatype) - if(isarea(areatype)) - var/area/areatemp = areatype - areatype = areatemp.type - - var/list/atoms = list() - for(var/area/N in world) - if(istype(N, areatype)) - for(var/atom/A in N) - atoms += A - return atoms - /// Simple datum for storing coordinates. /datum/coords var/x_pos @@ -1053,10 +986,6 @@ Returns 1 if the chain up to the area contains the given typepath var/dy = abs(B.y - A.y) return get_dir(A, B) & (rand() * (dx+dy) < dy ? 3 : 12) -//chances are 1:value. anyprob(1) will always return true -/proc/anyprob(value) - return (rand(1,value)==value) - /proc/view_or_range(distance = world.view , center = usr , type) switch(type) if("view") @@ -1148,17 +1077,6 @@ Returns 1 if the chain up to the area contains the given typepath if(final_x || final_y) return locate(final_x, final_y, T.z) -//Finds the distance between two atoms, in pixels -//centered = 0 counts from turf edge to edge -//centered = 1 counts from turf center to turf center -//of course mathematically this is just adding world.icon_size on again -/proc/getPixelDistance(atom/A, atom/B, centered = 1) - if(!istype(A)||!istype(B)) - return 0 - . = bounds_dist(A, B) + sqrt((((A.pixel_x+B.pixel_x)**2) + ((A.pixel_y+B.pixel_y)**2))) - if(centered) - . += world.icon_size - /proc/get(atom/loc, type) while(loc) if(istype(loc, type)) @@ -1211,17 +1129,6 @@ GLOBAL_LIST_INIT(wall_items, typecacheof(list(/obj/machinery/power/apc, /obj/mac /proc/format_text(text) return replacetext(replacetext(text,"\proper ",""),"\improper ","") -/* -Standard way to write links -Sayu -*/ - -/proc/topic_link(datum/D, arglist, content) - if(islist(arglist)) - arglist = list2params(arglist) - return "[content]" - - - /proc/get_location_accessible(mob/M, location) var/covered_locations = 0 //based on body_parts_covered var/face_covered = 0 //based on flags_inv @@ -1326,16 +1233,6 @@ Standard way to write links -Sayu chance = max(chance - (initial_chance / steps), 0) steps-- -/proc/get_random_colour(simple, lower, upper) - var/colour - if(simple) - colour = pick("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF") - else - for(var/i=1;i<=3;i++) - var/temp_col = "[num2hex(rand(lower,upper), 2)]" - colour += temp_col - return colour - /proc/get_distant_turf(turf/T, direction, distance) if(!T || !direction || !distance) return