mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-11 18:33:36 +00:00
initial commit - cross reference with 5th port - obviously has compile errors
This commit is contained in:
45
code/modules/procedural_mapping/mapGenerators/asteroid.dm
Normal file
45
code/modules/procedural_mapping/mapGenerators/asteroid.dm
Normal file
@@ -0,0 +1,45 @@
|
||||
//Asteroid turfs
|
||||
/datum/mapGeneratorModule/bottomLayer/asteroidTurfs
|
||||
spawnableTurfs = list(/turf/open/floor/plating/asteroid = 100)
|
||||
|
||||
/datum/mapGeneratorModule/bottomLayer/asteroidWalls
|
||||
spawnableTurfs = list(/turf/closed/mineral = 100)
|
||||
|
||||
//Border walls
|
||||
/datum/mapGeneratorModule/border/asteroidWalls
|
||||
spawnableAtoms = list()
|
||||
spawnableTurfs = list(/turf/closed/mineral = 100)
|
||||
|
||||
//Random walls
|
||||
/datum/mapGeneratorModule/splatterLayer/asteroidWalls
|
||||
clusterCheckFlags = CLUSTER_CHECK_NONE
|
||||
spawnableAtoms = list()
|
||||
spawnableTurfs = list(/turf/closed/mineral = 30)
|
||||
|
||||
//Monsters
|
||||
/datum/mapGeneratorModule/splatterLayer/asteroidMonsters
|
||||
spawnableTurfs = list()
|
||||
spawnableAtoms = list(/mob/living/simple_animal/hostile/asteroid/basilisk = 10, \
|
||||
/mob/living/simple_animal/hostile/asteroid/hivelord = 10, \
|
||||
/mob/living/simple_animal/hostile/asteroid/goliath = 10)
|
||||
|
||||
|
||||
// GENERATORS
|
||||
|
||||
/datum/mapGenerator/asteroid/hollow
|
||||
modules = list(/datum/mapGeneratorModule/bottomLayer/asteroidTurfs, \
|
||||
/datum/mapGeneratorModule/border/asteroidWalls)
|
||||
|
||||
/datum/mapGenerator/asteroid/hollow/random
|
||||
modules = list(/datum/mapGeneratorModule/bottomLayer/asteroidTurfs, \
|
||||
/datum/mapGeneratorModule/border/asteroidWalls, \
|
||||
/datum/mapGeneratorModule/splatterLayer/asteroidWalls)
|
||||
|
||||
/datum/mapGenerator/asteroid/hollow/random/monsters
|
||||
modules = list(/datum/mapGeneratorModule/bottomLayer/asteroidTurfs, \
|
||||
/datum/mapGeneratorModule/border/asteroidWalls, \
|
||||
/datum/mapGeneratorModule/splatterLayer/asteroidWalls, \
|
||||
/datum/mapGeneratorModule/splatterLayer/asteroidMonsters)
|
||||
|
||||
/datum/mapGenerator/asteroid/filled
|
||||
modules = list(/datum/mapGeneratorModule/bottomLayer/asteroidWalls)
|
||||
98
code/modules/procedural_mapping/mapGenerators/cellular.dm
Normal file
98
code/modules/procedural_mapping/mapGenerators/cellular.dm
Normal file
@@ -0,0 +1,98 @@
|
||||
// Very Simple Cellular Automata generators
|
||||
// Mostly for better caves
|
||||
// Should probably move these up and refactor modules so these can be mixed with other ones
|
||||
|
||||
/datum/mapGenerator/ca
|
||||
var/list/b_rule = list() // 0 -> 1, 1 -> 1
|
||||
var/list/s_rule = list() // 0 -> 0, 1 -> 1
|
||||
var/iterations = 1
|
||||
var/loop_edges = 0
|
||||
var/edge_value = 1 //if loop_edges = 0
|
||||
var/list/old_state
|
||||
var/list/current_state
|
||||
var/width = 10
|
||||
var/height = 10
|
||||
var/list/type_map = list(/turf/open/floor/plating,/turf/closed/wall)
|
||||
var/turf/start = null
|
||||
|
||||
/datum/mapGenerator/ca/defineRegion(turf/Start, turf/End, replace = 0)
|
||||
. = ..()
|
||||
|
||||
var/min_x = min(Start.x,End.x)
|
||||
var/max_x = max(Start.x,End.x)
|
||||
var/min_y = min(Start.y,End.y)
|
||||
var/max_y = max(Start.y,End.y)
|
||||
width = max_x - min_x
|
||||
height = max_y - min_y
|
||||
|
||||
//We assume 2D everywhere anyway
|
||||
start = locate(min_x,min_y,Start.z)
|
||||
|
||||
/datum/mapGenerator/ca/proc/initialize()
|
||||
old_state = new/list(width)
|
||||
for(var/i = 1,i<=width,i++)
|
||||
old_state[i] = new/list(height)
|
||||
for(var/j = 1,j<=height,j++)
|
||||
old_state[i][j] = rand(0,1)
|
||||
|
||||
current_state = old_state.Copy()
|
||||
|
||||
/datum/mapGenerator/ca/generate()
|
||||
set background = 1
|
||||
|
||||
//Abandon all hope for efficency all who enter here
|
||||
//Maybe some less basic implemetation later, but this is just simple admin tool
|
||||
initialize()
|
||||
|
||||
for(var/generation = 0,generation<iterations,generation++)
|
||||
for(var/i = 1,i<=width,i++)
|
||||
for(var/j = 1,j<=height,j++)
|
||||
current_state[i][j] = apply_rule(i,j)
|
||||
//copy state over
|
||||
old_state = current_state.Copy()
|
||||
|
||||
for(var/i=1,i<=width,i++)
|
||||
for(var/j=1,j<=height,j++)
|
||||
var/turf/T = locate(start.x+i-1,start.y+j-1,start.z)
|
||||
if(T)
|
||||
T.ChangeTurf(type_map[current_state[i][j]+1])
|
||||
|
||||
/datum/mapGenerator/ca/proc/apply_rule(i,j)
|
||||
var/value = 0
|
||||
for(var/dx=-1,dx<=1,dx++)
|
||||
for(var/dy=-1,dy<=1,dy++)
|
||||
var/n_x = i+dx
|
||||
var/n_y = j+dy
|
||||
if(n_x < 1 || n_x > width || n_y <1 || n_y > height)
|
||||
if(loop_edges)
|
||||
if(n_x < 1)
|
||||
n_x = width
|
||||
else if(n_x > width)
|
||||
n_x = 1
|
||||
if(n_y < 1)
|
||||
n_y = height
|
||||
else if(n_y > height)
|
||||
n_y = 1
|
||||
else
|
||||
value += edge_value
|
||||
continue
|
||||
value += old_state[n_x][n_y]
|
||||
value -= old_state[i][j]
|
||||
|
||||
if(value in b_rule)
|
||||
return 1
|
||||
if(value in s_rule)
|
||||
return old_state[i][j]
|
||||
return 0
|
||||
|
||||
/datum/mapGenerator/ca/caves
|
||||
b_rule = list(5,6,7,8)
|
||||
s_rule = list(4)
|
||||
type_map = list(/turf/open/floor/plating/asteroid/basalt,/turf/closed/mineral/volcanic)
|
||||
iterations = 5
|
||||
|
||||
/datum/mapGenerator/ca/maze
|
||||
b_rule = list(3)
|
||||
s_rule = list(1,2,3,4,5)
|
||||
iterations = 20
|
||||
edge_value = 0
|
||||
27
code/modules/procedural_mapping/mapGenerators/lava_river.dm
Normal file
27
code/modules/procedural_mapping/mapGenerators/lava_river.dm
Normal file
@@ -0,0 +1,27 @@
|
||||
/datum/mapGenerator/lavaland
|
||||
var/start_z = 5
|
||||
var/min_x = 0
|
||||
var/min_y = 0
|
||||
var/max_x = 0
|
||||
var/max_y = 0
|
||||
modules = list(/datum/mapGeneratorModule/river)
|
||||
|
||||
/datum/mapGenerator/lavaland/defineRegion(turf/Start, turf/End, replace = 0)
|
||||
start_z = Start.z
|
||||
min_x = min(Start.x,End.x)
|
||||
min_y = min(Start.y,End.y)
|
||||
max_x = max(Start.x,End.x)
|
||||
max_y = max(Start.y,End.y)
|
||||
..()
|
||||
|
||||
/datum/mapGeneratorModule/river
|
||||
var/river_type = /turf/open/floor/plating/lava/smooth
|
||||
var/river_nodes = 4
|
||||
var/start_z = 5
|
||||
|
||||
/datum/mapGeneratorModule/river/generate()
|
||||
var/datum/mapGenerator/lavaland/L = mother
|
||||
if(!istype(L))
|
||||
return
|
||||
start_z = L.start_z
|
||||
spawn_rivers(start_z, river_nodes, river_type, min_x = L.min_x, min_y = L.min_y, max_x = L.max_x, max_y = L.max_y)
|
||||
11
code/modules/procedural_mapping/mapGenerators/nature.dm
Normal file
11
code/modules/procedural_mapping/mapGenerators/nature.dm
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
//Exists primarily as a test type.
|
||||
|
||||
/datum/mapGenerator/nature
|
||||
modules = list(/datum/mapGeneratorModule/bottomLayer/grassTurfs, \
|
||||
/datum/mapGeneratorModule/pineTrees, \
|
||||
/datum/mapGeneratorModule/deadTrees, \
|
||||
/datum/mapGeneratorModule/randBushes, \
|
||||
/datum/mapGeneratorModule/randRocks, \
|
||||
/datum/mapGeneratorModule/denseLayer/grassTufts)
|
||||
|
||||
15
code/modules/procedural_mapping/mapGenerators/shuttle.dm
Normal file
15
code/modules/procedural_mapping/mapGenerators/shuttle.dm
Normal file
@@ -0,0 +1,15 @@
|
||||
/datum/mapGeneratorModule/bottomLayer/shuttleFloor
|
||||
spawnableTurfs = list(/turf/open/floor/plasteel/shuttle = 100)
|
||||
|
||||
/datum/mapGeneratorModule/border/shuttleWalls
|
||||
spawnableAtoms = list()
|
||||
spawnableTurfs = list(/turf/closed/wall/shuttle = 100)
|
||||
// Generators
|
||||
|
||||
/datum/mapGenerator/shuttle/full
|
||||
modules = list(/datum/mapGeneratorModule/bottomLayer/shuttleFloor, \
|
||||
/datum/mapGeneratorModule/border/shuttleWalls,\
|
||||
/datum/mapGeneratorModule/bottomLayer/repressurize)
|
||||
|
||||
/datum/mapGenerator/shuttle/floor
|
||||
modules = list(/datum/mapGeneratorModule/bottomLayer/shuttleFloor)
|
||||
52
code/modules/procedural_mapping/mapGenerators/syndicate.dm
Normal file
52
code/modules/procedural_mapping/mapGenerators/syndicate.dm
Normal file
@@ -0,0 +1,52 @@
|
||||
// Modules
|
||||
|
||||
/turf/open/floor/plasteel/shuttle/red/syndicate
|
||||
name = "floor" //Not Brig Floor
|
||||
|
||||
/datum/mapGeneratorModule/bottomLayer/syndieFloor
|
||||
spawnableTurfs = list(/turf/open/floor/plasteel/shuttle/red/syndicate = 100)
|
||||
|
||||
/datum/mapGeneratorModule/border/syndieWalls
|
||||
spawnableAtoms = list()
|
||||
spawnableTurfs = list(/turf/closed/wall/r_wall = 100)
|
||||
|
||||
|
||||
/datum/mapGeneratorModule/syndieFurniture
|
||||
clusterCheckFlags = CLUSTER_CHECK_ALL
|
||||
spawnableTurfs = list()
|
||||
spawnableAtoms = list(/obj/structure/table = 20,/obj/structure/chair = 15,/obj/structure/chair/stool = 10, \
|
||||
/obj/structure/frame/computer = 15, /obj/item/weapon/storage/toolbox/syndicate = 15 ,\
|
||||
/obj/structure/closet/syndicate = 25, /obj/machinery/suit_storage_unit/syndicate = 15)
|
||||
|
||||
/datum/mapGeneratorModule/splatterLayer/syndieMobs
|
||||
spawnableAtoms = list(/mob/living/simple_animal/hostile/syndicate = 30, \
|
||||
/mob/living/simple_animal/hostile/syndicate/melee = 20, \
|
||||
/mob/living/simple_animal/hostile/syndicate/ranged = 20, \
|
||||
/mob/living/simple_animal/hostile/viscerator = 30)
|
||||
spawnableTurfs = list()
|
||||
|
||||
// Generators
|
||||
|
||||
/datum/mapGenerator/syndicate/empty //walls and floor only
|
||||
modules = list(/datum/mapGeneratorModule/bottomLayer/syndieFloor, \
|
||||
/datum/mapGeneratorModule/border/syndieWalls,\
|
||||
/datum/mapGeneratorModule/bottomLayer/repressurize)
|
||||
|
||||
/datum/mapGenerator/syndicate/mobsonly
|
||||
modules = list(/datum/mapGeneratorModule/bottomLayer/syndieFloor, \
|
||||
/datum/mapGeneratorModule/border/syndieWalls,\
|
||||
/datum/mapGeneratorModule/splatterLayer/syndieMobs, \
|
||||
/datum/mapGeneratorModule/bottomLayer/repressurize)
|
||||
|
||||
/datum/mapGenerator/syndicate/furniture
|
||||
modules = list(/datum/mapGeneratorModule/bottomLayer/syndieFloor, \
|
||||
/datum/mapGeneratorModule/border/syndieWalls,\
|
||||
/datum/mapGeneratorModule/syndieFurniture, \
|
||||
/datum/mapGeneratorModule/bottomLayer/repressurize)
|
||||
|
||||
/datum/mapGenerator/syndicate/full
|
||||
modules = list(/datum/mapGeneratorModule/bottomLayer/syndieFloor, \
|
||||
/datum/mapGeneratorModule/border/syndieWalls,\
|
||||
/datum/mapGeneratorModule/syndieFurniture, \
|
||||
/datum/mapGeneratorModule/splatterLayer/syndieMobs, \
|
||||
/datum/mapGeneratorModule/bottomLayer/repressurize)
|
||||
Reference in New Issue
Block a user