var/global/list/space_surprises = list( /obj/item/clothing/mask/facehugger =4, /obj/item/weapon/pickaxe/silver =4, /obj/item/weapon/pickaxe/drill =4, /obj/item/weapon/pickaxe/jackhammer =4, //mob/living/simple_animal/hostile/carp =3, /obj/item/weapon/pickaxe/diamond =3, /obj/item/weapon/pickaxe/diamonddrill =3, /obj/item/weapon/pickaxe/gold =3, /obj/item/weapon/pickaxe/plasmacutter =2, /obj/structure/closet/syndicate/resources =2, /obj/item/weapon/melee/energy/sword/pirate =1, /obj/mecha/working/ripley/mining =1 ) var/global/list/spawned_surprises = list() var/global/max_secret_rooms = 3 proc/spawn_room(var/atom/start_loc,var/x_size,var/y_size,var/wall,var/floor , var/clean = 0 , var/name) var/list/room_turfs = list("walls"=list(),"floors"=list()) //world << "Room spawned at [start_loc.x],[start_loc.y],[start_loc.z]" if(!wall) wall = pick(/turf/simulated/wall/r_wall,/turf/simulated/wall,/obj/structure/alien/resin/wall) if(!floor) floor = pick(/turf/simulated/floor,/turf/simulated/floor/engine) for(var/x = 0,x 100) return 0 T=pick(turfs) if(!T) return 0 var/list/surroundings = list() surroundings += range(7, locate(T.x,T.y,T.z)) surroundings += range(7, locate(T.x+size,T.y,T.z)) surroundings += range(7, locate(T.x,T.y+size,T.z)) surroundings += range(7, locate(T.x+size,T.y+size,T.z)) if(locate(/area/mine/explored) in surroundings) // +5s are for view range valid = 0 continue if(locate(/turf/space) in surroundings) valid = 0 continue if(locate(/area/asteroid/artifactroom) in surroundings) valid = 0 continue if(locate(/turf/simulated/floor/plating/airless/asteroid) in surroundings) valid = 0 continue if(!T) return 0 room = spawn_room(T,size,size,,,1) if(room) T = pick(room["floors"]) if(T) var/surprise = null valid = 0 while(!valid) surprise = pickweight(space_surprises) if(surprise in spawned_surprises) if(prob(20)) valid++ else continue else valid++ spawned_surprises.Add(surprise) new surprise(T) return 1 proc/check_complex_placement(var/turf/T,var/size_x,var/size_y,var/ignore_walls=0) var/list/surroundings = list() surroundings |= range(7, locate(T.x,T.y,T.z)) surroundings |= range(7, locate(T.x+size_x,T.y,T.z)) surroundings |= range(7, locate(T.x,T.y+size_y,T.z)) surroundings |= range(7, locate(T.x+size_x,T.y+size_y,T.z)) if(locate(/area/mine/explored) in surroundings) // +5s are for view range return 0 if(locate(/turf/space) in surroundings) return 0 /* /vg/: Allow combining rooms. if(locate(/area/asteroid/artifactroom) in surroundings) return 0 if(locate(/turf/unsimulated/floor/asteroid) in surroundings) return 0 */ // /vg/: Stop spawning shit inside of the vox hideout if(locate(/turf/simulated/wall) in surroundings && !ignore_walls) return 0 return 1