Adds Asteroid Cracks

Adds a new type of turf, which is a cracked asteroid floor.  It is functionally a space tile, which means air can escape through the cracks and into the void.  These cracks can be plugged by building a floor over them using rods and tiles.  The cracks are generated randomly along with the asteroid whenever a floor is placed, with a 1 in 10 chance of it being a cracked floor.
This commit is contained in:
Neerti
2016-10-02 06:24:32 -04:00
parent 5963d65ad7
commit 393c9899a9
6 changed files with 23 additions and 3 deletions

View File

@@ -0,0 +1,16 @@
// This is used to have vacuums inside the asteroid be more present.
/turf/space/cracked_asteroid
icon = 'icons/turf/flooring/asteroid.dmi'
name = "cracked sand"
desc = "Rough sand with a huge crack. It probably leads out into the void."
icon_state = "asteroid_cracked"
dynamic_lighting = TRUE
/turf/space/cracked_asteroid/is_space() // So people don't start floating when standing on it.
return FALSE
/turf/space/cracked_asteroid/New()
..()
spawn(2 SECONDS)
overlays.Cut()

View File

@@ -9,7 +9,7 @@
// heat_capacity = 700000 No.
/turf/space/New()
if(!istype(src, /turf/space/transit))
if(!istype(src, /turf/space/transit) && !istype(src, /turf/space/cracked_asteroid))
icon_state = "[((x + y) ^ ~(x * y) + z) % 25]"
update_starlight()
..()

View File

@@ -139,7 +139,7 @@ var/list/mining_overlay_cache = list()
overlays += mining_overlay_cache["dug_overlay"]
for(var/direction in cardinal)
if(istype(get_step(src, direction), /turf/space))
if(istype(get_step(src, direction), /turf/space) && !istype(get_step(src, direction), /turf/space/cracked_asteroid))
if(!mining_overlay_cache["asteroid_edge_[direction]"])
mining_overlay_cache["asteroid_edge_[direction]"] = image('icons/turf/flooring/asteroid.dmi', "asteroid_edges", dir = direction)
overlays += mining_overlay_cache["asteroid_edge_[direction]"]

View File

@@ -45,7 +45,10 @@
var/turf/simulated/mineral/T = locate((origin_x-1)+x,(origin_y-1)+y,origin_z)
if(istype(T) && !T.ignore_mapgen)
if(map[current_cell] == FLOOR_CHAR)
T.make_floor()
if(prob(90))
T.make_floor()
else
T.ChangeTurf(/turf/space/cracked_asteroid)
else
T.make_wall()
if(map[current_cell] == DOOR_CHAR)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@@ -994,6 +994,7 @@
#include "code\game\turfs\simulated\wall_types.dm"
#include "code\game\turfs\simulated\walls.dm"
#include "code\game\turfs\snow\snow.dm"
#include "code\game\turfs\space\cracked_asteroid.dm"
#include "code\game\turfs\space\space.dm"
#include "code\game\turfs\space\transit.dm"
#include "code\game\turfs\unsimulated\beach.dm"