Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flint and dead trees to forage noisemap #3831

Merged
merged 2 commits into from
Mar 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions code/modules/random_map/noise/forage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@
"towercap"
),
"shallows" = list(
/obj/item/rock/flint,
"rice",
"mollusc",
"clam",
"sugarcane"
),
"cave_shallows" = list(
/obj/item/rock/flint,
"algae",
"mollusc",
"clam"
Expand All @@ -73,9 +75,16 @@
"coffee",
"tea"
),
"riverbed" = list(
/obj/item/rock/flint,
// no rice, generally rice wants at most 10cm water
"mollusc",
"clam"
)
)
var/list/trees = list(
/obj/structure/flora/tree/hardwood/ebony
/obj/structure/flora/tree/hardwood/ebony = 9,
/obj/structure/flora/tree/dead/ebony = 1
)
var/list/cave_trees = list(
/obj/structure/flora/tree/softwood/towercap
Expand Down Expand Up @@ -110,11 +119,14 @@
return
else if(istype(T, /turf/exterior/wildgrass))
if(prob(parse_value * 0.35))
var/tree_type = pick(trees)
var/tree_type = pickweight(trees)
new tree_type(T)
return
place_prob = parse_value * 0.3
place_type = pick(forage["grass"])
else if(istype(T, /turf/exterior/mud/water/deep))
place_prob = parse_value * 0.3
place_type = pick(forage["riverbed"])
else if(istype(T, /turf/exterior/mud/water))
place_prob = parse_value * 0.3
place_type = pick(forage["shallows"])
Expand All @@ -134,9 +146,12 @@
place_type = pick(forage["cave_shallows"])

if(place_type && prob(place_prob))
new /obj/structure/flora/plant(T, null, null, place_type)
for(var/stepdir in global.alldirs)
if(prob(15))
var/turf/neighbor = get_step(T, stepdir)
if(istype(neighbor, T.type) && !(locate(/obj/structure/flora/plant) in neighbor))
new /obj/structure/flora/plant(neighbor, null, null, place_type)
if(istype(place_type, /datum/seed))
new /obj/structure/flora/plant(T, null, null, place_type)
for(var/stepdir in global.alldirs)
if(prob(15))
var/turf/neighbor = get_step(T, stepdir)
if(istype(neighbor, T.type) && !(locate(/obj/structure/flora/plant) in neighbor))
new /obj/structure/flora/plant(neighbor, null, null, place_type)
else if(ispath(place_type, /atom))
new place_type(T)
Loading