Refactored random map generator system and added several terrain generators.

Created a global list to track base turfs for explosions/shuttle moves.
Remaps the asteroid to be a moonlet. Tidies up some references to 'asteroid', removes moonbase from the accessible z level list.
This commit is contained in:
Zuhayr
2015-06-03 04:36:19 +09:30
parent d4327658ab
commit ebe62cefd8
47 changed files with 1453 additions and 1175 deletions

View File

@@ -84,7 +84,7 @@
//Dig out the tasty ores.
if(resource_field.len)
var/turf/harvesting = pick(resource_field)
var/turf/simulated/harvesting = pick(resource_field)
while(resource_field.len && !harvesting.resources)
harvesting.has_resources = 0
@@ -253,7 +253,7 @@
var/tx = T.x - 2
var/ty = T.y - 2
var/turf/mine_turf
var/turf/simulated/mine_turf
for(var/iy = 0,iy < 5, iy++)
for(var/ix = 0, ix < 5, ix++)
mine_turf = locate(tx + ix, ty + iy, T.z)

View File

@@ -20,7 +20,7 @@
"exotic matter" = 0
)
for(var/turf/T in range(2, get_turf(user)))
for(var/turf/simulated/T in range(2, get_turf(user)))
if(!T.has_resources)
continue

View File

@@ -1,5 +1,8 @@
/**********************Mineral deposits**************************/
/turf/unsimulated/mineral
name = "impassable rock"
icon = 'icons/turf/walls.dmi'
icon_state = "rock-dark"
/turf/simulated/mineral //wall piece
name = "Rock"
@@ -11,6 +14,7 @@
density = 1
blocks_air = 1
temperature = T0C
var/mined_turf = /turf/simulated/floor/plating/airless/asteroid
var/ore/mineral
var/mined_ore = 0
var/last_act = 0
@@ -28,21 +32,20 @@
has_resources = 1
/turf/simulated/mineral/New()
spawn(0)
MineralSpread()
spawn(2)
var/list/step_overlays = list("s" = NORTH, "n" = SOUTH, "w" = EAST, "e" = WEST)
for(var/direction in step_overlays)
var/turf/turf_to_check = get_step(src,step_overlays[direction])
updateMineralOverlays(1)
if(istype(turf_to_check,/turf/simulated/floor/plating/airless/asteroid))
var/turf/simulated/floor/plating/airless/asteroid/T = turf_to_check
T.updateMineralOverlays()
else if(istype(turf_to_check,/turf/space) || istype(turf_to_check,/turf/simulated/floor))
turf_to_check.overlays += image('icons/turf/walls.dmi', "rock_side_[direction]")
/turf/simulated/mineral/proc/updateMineralOverlays(var/update_neighbors)
var/list/step_overlays = list("s" = NORTH, "n" = SOUTH, "w" = EAST, "e" = WEST)
for(var/direction in step_overlays)
var/turf/turf_to_check = get_step(src,step_overlays[direction])
if(update_neighbors && istype(turf_to_check,/turf/simulated/floor/plating/airless/asteroid))
var/turf/simulated/floor/plating/airless/asteroid/T = turf_to_check
T.updateMineralOverlays()
else if(istype(turf_to_check,/turf/space) || istype(turf_to_check,/turf/simulated/floor))
turf_to_check.overlays += image('icons/turf/walls.dmi', "rock_side_[direction]")
/turf/simulated/mineral/ex_act(severity)
switch(severity)
@@ -280,8 +283,7 @@
//Add some rubble, you did just clear out a big chunk of rock.
var/turf/simulated/floor/plating/airless/asteroid/N = ChangeTurf(/turf/simulated/floor/plating/airless/asteroid)
N.overlay_detail = "asteroid[rand(0,9)]"
var/turf/simulated/floor/plating/airless/asteroid/N = ChangeTurf(mined_turf)
// Kill and update the space overlays around us.
for(var/direction in step_overlays)
@@ -292,13 +294,9 @@
if(istype(get_step(T, step_overlays[next_direction]),/turf/simulated/mineral))
T.overlays += image('icons/turf/walls.dmi', "rock_side_[next_direction]")
// Update the
N.updateMineralOverlays(1)
if(rand(1,500) == 1)
visible_message("<span class='notice'>An old dusty crate was buried within!</span>")
new /obj/structure/closet/crate/secure/loot(src)
if(istype(N))
N.overlay_detail = "asteroid[rand(0,9)]"
N.updateMineralOverlays(1)
/turf/simulated/mineral/proc/excavate_find(var/prob_clean = 0, var/datum/find/F)
//with skill and luck, players can cleanly extract finds
@@ -391,7 +389,7 @@
/turf/simulated/floor/plating/airless/asteroid //floor piece
name = "asteroid"
name = "sand"
icon = 'icons/turf/floors.dmi'
icon_state = "asteroid"
oxygen = 0