mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
Fixes #10753
This commit is contained in:
@@ -203,7 +203,6 @@
|
||||
#include "code\defines\procs\records.dm"
|
||||
#include "code\defines\procs\sd_Alert.dm"
|
||||
#include "code\defines\procs\statistics.dm"
|
||||
#include "code\game\asteroid.dm"
|
||||
#include "code\game\atoms.dm"
|
||||
#include "code\game\atoms_movable.dm"
|
||||
#include "code\game\periodic_news.dm"
|
||||
|
||||
@@ -1,162 +0,0 @@
|
||||
|
||||
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/effect/alien/resin)
|
||||
if(!floor)
|
||||
floor = pick(/turf/simulated/floor,/turf/simulated/floor/engine)
|
||||
|
||||
for(var/x = 0,x<x_size,x++)
|
||||
for(var/y = 0,y<y_size,y++)
|
||||
var/turf/T
|
||||
var/cur_loc = locate(start_loc.x+x,start_loc.y+y,start_loc.z)
|
||||
if(clean)
|
||||
for(var/O in cur_loc)
|
||||
qdel(O)
|
||||
|
||||
var/area/asteroid/artifactroom/A = new
|
||||
if(name)
|
||||
A.name = name
|
||||
else
|
||||
A.name = "Artifact Room #[start_loc.x][start_loc.y][start_loc.z]"
|
||||
|
||||
|
||||
|
||||
if(x == 0 || x==x_size-1 || y==0 || y==y_size-1)
|
||||
if(wall == /obj/effect/alien/resin)
|
||||
T = new floor(cur_loc)
|
||||
new /obj/effect/alien/resin(T)
|
||||
else
|
||||
T = new wall(cur_loc)
|
||||
room_turfs["walls"] += T
|
||||
else
|
||||
T = new floor(cur_loc)
|
||||
room_turfs["floors"] += T
|
||||
|
||||
A.contents += T
|
||||
|
||||
|
||||
return room_turfs
|
||||
|
||||
proc/admin_spawn_room_at_pos()
|
||||
var/wall
|
||||
var/floor
|
||||
var/x = input("X position","X pos",usr.x)
|
||||
var/y = input("Y position","Y pos",usr.y)
|
||||
var/z = input("Z position","Z pos",usr.z)
|
||||
var/x_len = input("Desired length.","Length",5)
|
||||
var/y_len = input("Desired width.","Width",5)
|
||||
var/clean = input("Delete existing items in area?" , "Clean area?", 0)
|
||||
switch(alert("Wall type",null,"Reinforced wall","Regular wall","Resin wall"))
|
||||
if("Reinforced wall")
|
||||
wall=/turf/simulated/wall/r_wall
|
||||
if("Regular wall")
|
||||
wall=/turf/simulated/wall
|
||||
if("Resin wall")
|
||||
wall=/obj/effect/alien/resin
|
||||
switch(alert("Floor type",null,"Regular floor","Reinforced floor"))
|
||||
if("Regular floor")
|
||||
floor=/turf/simulated/floor
|
||||
if("Reinforced floor")
|
||||
floor=/turf/simulated/floor/engine
|
||||
if(x && y && z && wall && floor && x_len && y_len)
|
||||
spawn_room(locate(x,y,z),x_len,y_len,wall,floor,clean)
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
proc/make_mining_asteroid_secret(var/size = 5)
|
||||
var/valid = 0
|
||||
var/turf/T = null
|
||||
var/sanity = 0
|
||||
var/list/room = null
|
||||
var/list/turfs = null
|
||||
|
||||
|
||||
turfs = get_area_turfs(/area/mine/unexplored)
|
||||
|
||||
if(!turfs.len)
|
||||
return 0
|
||||
|
||||
while(!valid)
|
||||
valid = 1
|
||||
sanity++
|
||||
if(sanity > 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
|
||||
|
||||
|
||||
@@ -162,12 +162,4 @@ var/global/list/random_maps = list()
|
||||
map[check_cell] = 3
|
||||
ore_count--
|
||||
|
||||
sleep(-1)
|
||||
|
||||
// Place random asteroid rooms.
|
||||
var/rooms_placed = 0
|
||||
for(var/i = 0, i < max_secret_rooms, i++)
|
||||
if(make_mining_asteroid_secret())
|
||||
rooms_placed++
|
||||
admin_notice("<span class='danger'>Placed [rooms_placed] secrets.</span>", R_DEBUG)
|
||||
return 1
|
||||
Reference in New Issue
Block a user