-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
_biome.dm
50 lines (41 loc) · 2.36 KB
/
_biome.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
///This datum handles the transitioning from a turf to a specific biome, and handles spawning decorative structures and mobs.
/datum/biome
///Type of turf this biome creates
var/turf_type
///Chance of having a structure from the flora types list spawn
var/flora_density = 0
///Chance of having a mob from the fauna types list spawn
var/fauna_density = 0
///list of type paths of objects that can be spawned when the turf spawns flora
var/list/flora_types = list(/obj/structure/flora/grass/jungle)
///list of type paths of mobs that can be spawned when the turf spawns fauna
var/list/fauna_types = list()
///This proc handles the creation of a turf of a specific biome type
/datum/biome/proc/generate_turf(turf/gen_turf)
gen_turf.ChangeTurf(turf_type, null, CHANGETURF_DEFER_CHANGE)
if(length(fauna_types) && prob(fauna_density))
var/mob/fauna = pick(fauna_types)
new fauna(gen_turf)
if(length(flora_types) && prob(flora_density))
var/obj/structure/flora = pick(flora_types)
new flora(gen_turf)
/datum/biome/mudlands
turf_type = /turf/open/floor/plating/dirt/jungle/dark
flora_types = list(/obj/structure/flora/grass/jungle,/obj/structure/flora/grass/jungle/b, /obj/structure/flora/rock/jungle, /obj/structure/flora/rock/pile/largejungle)
flora_density = 3
/datum/biome/plains
turf_type = /turf/open/floor/plating/grass/jungle
flora_types = list(/obj/structure/flora/grass/jungle,/obj/structure/flora/grass/jungle/b, /obj/structure/flora/tree/jungle, /obj/structure/flora/rock/jungle, /obj/structure/flora/junglebush, /obj/structure/flora/junglebush/b, /obj/structure/flora/junglebush/c, /obj/structure/flora/junglebush/large, /obj/structure/flora/rock/pile/largejungle)
flora_density = 15
/datum/biome/jungle
turf_type = /turf/open/floor/plating/grass/jungle
flora_types = list(/obj/structure/flora/grass/jungle,/obj/structure/flora/grass/jungle/b, /obj/structure/flora/tree/jungle, /obj/structure/flora/rock/jungle, /obj/structure/flora/junglebush, /obj/structure/flora/junglebush/b, /obj/structure/flora/junglebush/c, /obj/structure/flora/junglebush/large, /obj/structure/flora/rock/pile/largejungle)
flora_density = 40
/datum/biome/jungle/deep
flora_density = 65
/datum/biome/wasteland
turf_type = /turf/open/floor/plating/dirt/jungle/wasteland
/datum/biome/water
turf_type = /turf/open/water/jungle
/datum/biome/mountain
turf_type = /turf/closed/mineral/random/jungle