|
169 | 169 | else |
170 | 170 | return FALSE |
171 | 171 |
|
172 | | -// Returns true if direction is blocked from loc |
173 | | -// Checks if doors are open |
174 | | -/proc/DirBlocked(turf/loc, dir) |
175 | | - for(var/obj/structure/window/D in loc) |
176 | | - if(!D.density) |
177 | | - continue |
178 | | - if(D.fulltile) |
179 | | - return 1 |
180 | | - if(D.dir == dir) |
181 | | - return 1 |
182 | | - |
183 | | - for(var/obj/machinery/door/D in loc) |
184 | | - if(!D.density)//if the door is open |
185 | | - continue |
186 | | - else return 1 // if closed, it's a real, air blocking door |
187 | | - return 0 |
188 | | - |
189 | 172 | ///////////////////////////////////////////////////////////////////////// |
190 | 173 |
|
191 | 174 | /** |
@@ -675,40 +658,6 @@ Returns 1 if the chain up to the area contains the given typepath |
675 | 658 | return TRUE |
676 | 659 | return FALSE |
677 | 660 |
|
678 | | -/proc/get_step_towards2(atom/ref , atom/trg) |
679 | | - var/base_dir = get_dir(ref, get_step_towards(ref,trg)) |
680 | | - var/turf/temp = get_step_towards(ref,trg) |
681 | | - |
682 | | - if(is_blocked_turf(temp)) |
683 | | - var/dir_alt1 = turn(base_dir, 90) |
684 | | - var/dir_alt2 = turn(base_dir, -90) |
685 | | - var/turf/turf_last1 = temp |
686 | | - var/turf/turf_last2 = temp |
687 | | - var/free_tile |
688 | | - var/breakpoint = 0 |
689 | | - |
690 | | - while(!free_tile && breakpoint < 10) |
691 | | - if(!is_blocked_turf(turf_last1)) |
692 | | - free_tile = turf_last1 |
693 | | - break |
694 | | - if(!is_blocked_turf(turf_last2)) |
695 | | - free_tile = turf_last2 |
696 | | - break |
697 | | - turf_last1 = get_step(turf_last1,dir_alt1) |
698 | | - turf_last2 = get_step(turf_last2,dir_alt2) |
699 | | - breakpoint++ |
700 | | - |
701 | | - if(!free_tile) return get_step(ref, base_dir) |
702 | | - else return get_step_towards(ref,free_tile) |
703 | | - |
704 | | - else return get_step(ref, base_dir) |
705 | | - |
706 | | -//Takes: Anything that could possibly have variables and a varname to check. |
707 | | -//Returns: 1 if found, 0 if not. |
708 | | -/proc/hasvar(datum/A, varname) |
709 | | - if(A.vars.Find(lowertext(varname))) return 1 |
710 | | - else return 0 |
711 | | - |
712 | 661 | //Returns: all the areas in the world |
713 | 662 | /proc/return_areas() |
714 | 663 | var/list/area/areas = list() |
@@ -752,22 +701,6 @@ Returns 1 if the chain up to the area contains the given typepath |
752 | 701 | turfs += T |
753 | 702 | return turfs |
754 | 703 |
|
755 | | -//Takes: Area type as text string or as typepath OR an instance of the area. |
756 | | -//Returns: A list of all atoms (objs, turfs, mobs) in areas of that type of that type in the world. |
757 | | -/proc/get_area_all_atoms(areatype) |
758 | | - if(!areatype) return null |
759 | | - if(istext(areatype)) areatype = text2path(areatype) |
760 | | - if(isarea(areatype)) |
761 | | - var/area/areatemp = areatype |
762 | | - areatype = areatemp.type |
763 | | - |
764 | | - var/list/atoms = list() |
765 | | - for(var/area/N in world) |
766 | | - if(istype(N, areatype)) |
767 | | - for(var/atom/A in N) |
768 | | - atoms += A |
769 | | - return atoms |
770 | | - |
771 | 704 | /// Simple datum for storing coordinates. |
772 | 705 | /datum/coords |
773 | 706 | var/x_pos |
@@ -1053,10 +986,6 @@ Returns 1 if the chain up to the area contains the given typepath |
1053 | 986 | var/dy = abs(B.y - A.y) |
1054 | 987 | return get_dir(A, B) & (rand() * (dx+dy) < dy ? 3 : 12) |
1055 | 988 |
|
1056 | | -//chances are 1:value. anyprob(1) will always return true |
1057 | | -/proc/anyprob(value) |
1058 | | - return (rand(1,value)==value) |
1059 | | - |
1060 | 989 | /proc/view_or_range(distance = world.view , center = usr , type) |
1061 | 990 | switch(type) |
1062 | 991 | if("view") |
@@ -1148,17 +1077,6 @@ Returns 1 if the chain up to the area contains the given typepath |
1148 | 1077 | if(final_x || final_y) |
1149 | 1078 | return locate(final_x, final_y, T.z) |
1150 | 1079 |
|
1151 | | -//Finds the distance between two atoms, in pixels |
1152 | | -//centered = 0 counts from turf edge to edge |
1153 | | -//centered = 1 counts from turf center to turf center |
1154 | | -//of course mathematically this is just adding world.icon_size on again |
1155 | | -/proc/getPixelDistance(atom/A, atom/B, centered = 1) |
1156 | | - if(!istype(A)||!istype(B)) |
1157 | | - return 0 |
1158 | | - . = bounds_dist(A, B) + sqrt((((A.pixel_x+B.pixel_x)**2) + ((A.pixel_y+B.pixel_y)**2))) |
1159 | | - if(centered) |
1160 | | - . += world.icon_size |
1161 | | - |
1162 | 1080 | /proc/get(atom/loc, type) |
1163 | 1081 | while(loc) |
1164 | 1082 | if(istype(loc, type)) |
@@ -1211,17 +1129,6 @@ GLOBAL_LIST_INIT(wall_items, typecacheof(list(/obj/machinery/power/apc, /obj/mac |
1211 | 1129 | /proc/format_text(text) |
1212 | 1130 | return replacetext(replacetext(text,"\proper ",""),"\improper ","") |
1213 | 1131 |
|
1214 | | -/* |
1215 | | -Standard way to write links -Sayu |
1216 | | -*/ |
1217 | | - |
1218 | | -/proc/topic_link(datum/D, arglist, content) |
1219 | | - if(islist(arglist)) |
1220 | | - arglist = list2params(arglist) |
1221 | | - return "<a href='byond://?src=[D.UID()];[arglist]'>[content]</a>" |
1222 | | - |
1223 | | - |
1224 | | - |
1225 | 1132 | /proc/get_location_accessible(mob/M, location) |
1226 | 1133 | var/covered_locations = 0 //based on body_parts_covered |
1227 | 1134 | var/face_covered = 0 //based on flags_inv |
@@ -1326,16 +1233,6 @@ Standard way to write links -Sayu |
1326 | 1233 | chance = max(chance - (initial_chance / steps), 0) |
1327 | 1234 | steps-- |
1328 | 1235 |
|
1329 | | -/proc/get_random_colour(simple, lower, upper) |
1330 | | - var/colour |
1331 | | - if(simple) |
1332 | | - colour = pick("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF") |
1333 | | - else |
1334 | | - for(var/i=1;i<=3;i++) |
1335 | | - var/temp_col = "[num2hex(rand(lower,upper), 2)]" |
1336 | | - colour += temp_col |
1337 | | - return colour |
1338 | | - |
1339 | 1236 | /proc/get_distant_turf(turf/T, direction, distance) |
1340 | 1237 | if(!T || !direction || !distance) return |
1341 | 1238 |
|
|
0 commit comments