Skip to content

Commit

Permalink
Merge pull request #4708 from MistakeNot4892/feature/wormreturn
Browse files Browse the repository at this point in the history
Readding worms to turf digging.
  • Loading branch information
out-of-phaze authored Jan 12, 2025
2 parents 57b0f8d + a2fe6ec commit 854862d
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions code/game/turfs/floors/floor_digging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,20 @@

/turf/floor/get_diggable_resources()
var/decl/material/my_material = get_material()
if(is_fundament() && istype(my_material) && my_material.dug_drop_type && (get_physical_height() > -(FLUID_DEEP)))
. = list()
.[my_material.dug_drop_type] = list("amount" = 3, "variance" = 2, "material" = my_material.type)
if(!gemstone_dropped && prob(my_material.gemstone_chance) && LAZYLEN(my_material.gemstone_types))
gemstone_dropped = TRUE
var/gem_mat = pick(my_material.gemstone_types)
.[/obj/item/gemstone] = list("amount" = 1, "material" = gem_mat)
if(!is_fundament() || !istype(my_material) || !my_material.dug_drop_type || (get_physical_height() <= -(FLUID_DEEP)))
return

. = list()

// All turfs drop resources to backfill them with (or make firepits, etc)
.[my_material.dug_drop_type] = list("amount" = 3, "variance" = 2, "material" = my_material.type)

// Dirt/mud/etc might have some worms.
if(prob(5 * get_plant_growth_rate()))
.[/obj/item/food/worm] = list("amount" = 1, "material" = /obj/item/food/worm::material)

// Some materials (like clay) might contain gemstones.
if(!gemstone_dropped && prob(my_material.gemstone_chance) && LAZYLEN(my_material.gemstone_types))
gemstone_dropped = TRUE
var/gem_mat = pick(my_material.gemstone_types)
.[/obj/item/gemstone] = list("amount" = 1, "material" = gem_mat)

0 comments on commit 854862d

Please sign in to comment.