diff --git a/_maps/RandomRuins/LavaRuins/_maplisting.txt b/_maps/RandomRuins/LavaRuins/_maplisting.txt deleted file mode 100644 index 175537f9008..00000000000 --- a/_maps/RandomRuins/LavaRuins/_maplisting.txt +++ /dev/null @@ -1,34 +0,0 @@ -#List ALL lava ruins here. This file is for small things that would appear in lavaland, like a downed ship or hidden room. -#Maps must be the full path to them. Any map you make but forget to list here may as well not exist as far as the game is concerned. -#Blacklisting ruins takes place at conflig/lavaRuinBlacklist.txt, don't remove anything here unless you're removing the map entirely - -#SPECIFYING AN INVALID MAP WILL RESULT IN RUNTIMES ON GAME START - -##BIODOMES -_maps/RandomRuins/LavaRuins/lavaland_surface_biodome_winter.dmm -_maps/RandomRuins/LavaRuins/lavaland_biodome_beach.dmm -_maps/RandomRuins/LavaRuins/lavaland_biodome_clown_planet.dmm -_maps/RandomRuins/LavaRuins/lavaland_surface_cube.dmm - -##RESPAWN -_maps/RandomRuins/LavaRuins/lavaland_surface_prisoner_crash.dmm -_maps/RandomRuins/LavaRuins/lavaland_surface_seed_vault.dmm -_maps/RandomRuins/LavaRuins/lavaland_surface_ash_walker1.dmm -_maps/RandomRuins/LavaRuins/lavaland_surface_golem_ship.dmm -_maps/RandomRuins/LavaRuins/lavaland_surface_animal_hospital.dmm - -##SIN -_maps/RandomRuins/LavaRuins/lavaland_surface_envy.dmm -_maps/RandomRuins/LavaRuins/lavaland_surface_gluttony.dmm -_maps/RandomRuins/LavaRuins/lavaland_surface_greed.dmm -_maps/RandomRuins/LavaRuins/lavaland_surface_pride.dmm -_maps/RandomRuins/LavaRuins/lavaland_surface_sloth.dmm - -##MISC -_maps/RandomRuins/LavaRuins/lavaland_surface_automated_trade_outpost.dmm -_maps/RandomRuins/LavaRuins/lavaland_surface_ufo_crash.dmm -_maps/RandomRuins/LavaRuins/lavaland_surface_ww_vault.dmm -_maps/RandomRuins/LavaRuins/lavaland_surface_automated_trade_outpost.dmm -_maps/RandomRuins/LavaRuins/lavaland_surface_xeno_nest.dmm -_maps/RandomRuins/LavaRuins/lavaland_fountain_hall.dmm -_maps/RandomRuins/LavaRuins/lavaland_gym.dmm \ No newline at end of file diff --git a/_maps/RandomRuins/SpaceRuins/_maplisting.txt b/_maps/RandomRuins/SpaceRuins/_maplisting.txt deleted file mode 100644 index 72681d304a3..00000000000 --- a/_maps/RandomRuins/SpaceRuins/_maplisting.txt +++ /dev/null @@ -1,26 +0,0 @@ -#List ALL space ruins here. This file is for small things that would appear in space, like an asteroid or broken escape pod. -#Maps must be the full path to them. Any map you make but forget to list here may as well not exist as far as the game is concerned. -#Blacklisting ruins takes place in the config folder file spaceRuinBlacklist.txt, don't remove anything here unless you're removing the map entirely - -#SPECIFYING AN INVALID MAP WILL RESULT IN RUNTIMES ON GAME START - -_maps/RandomRuins/SpaceRuins/way_home.dmm -_maps/RandomRuins/SpaceRuins/asteroid1.dmm -_maps/RandomRuins/SpaceRuins/asteroid2.dmm -_maps/RandomRuins/SpaceRuins/asteroid3.dmm -_maps/RandomRuins/SpaceRuins/asteroid4.dmm -_maps/RandomRuins/SpaceRuins/asteroid5.dmm -_maps/RandomRuins/SpaceRuins/derelict1.dmm -_maps/RandomRuins/SpaceRuins/derelict2.dmm -_maps/RandomRuins/SpaceRuins/derelict3.dmm -_maps/RandomRuins/SpaceRuins/derelict4.dmm -_maps/RandomRuins/SpaceRuins/derelict5.dmm -_maps/RandomRuins/SpaceRuins/spacebar.dmm -_maps/RandomRuins/SpaceRuins/abandonedzoo.dmm -_maps/RandomRuins/SpaceRuins/deepstorage.dmm -_maps/RandomRuins/SpaceRuins/emptyshell.dmm -_maps/RandomRuins/SpaceRuins/gasthelizards.dmm -_maps/RandomRuins/SpaceRuins/intactemptyship.dmm -_maps/RandomRuins/SpaceRuins/mechtransport.dmm -_maps/RandomRuins/SpaceRuins/turretedoutpost.dmm -_maps/RandomRuins/SpaceRuins/onehalf.dmm \ No newline at end of file diff --git a/_maps/RandomRuins/SpaceRuins/abandonedzoo.dmm b/_maps/RandomRuins/SpaceRuins/abandonedzoo.dmm index 8991d416385..57039bae9d3 100644 --- a/_maps/RandomRuins/SpaceRuins/abandonedzoo.dmm +++ b/_maps/RandomRuins/SpaceRuins/abandonedzoo.dmm @@ -13,7 +13,7 @@ "am" = (/mob/living/simple_animal/hostile/poison/bees,/mob/living/simple_animal/hostile/poison/bees,/mob/living/simple_animal/hostile/poison/bees,/mob/living/simple_animal/hostile/poison/bees,/mob/living/simple_animal/hostile/poison/bees,/mob/living/simple_animal/hostile/poison/bees,/turf/open/floor/grass,/area/ruin/unpowered) "an" = (/mob/living/simple_animal/hostile/poison/bees,/turf/open/floor/grass,/area/ruin/unpowered) "ao" = (/obj/structure/flora/ausbushes/lavendergrass,/turf/open/floor/grass,/area/ruin/unpowered) -"ap" = (/mob/living/simple_animal/hostile/asteroid/goldgrub,/turf/open/floor/plating/asteroid,/area/ruin/unpowered) +"ap" = (/mob/living/simple_animal/hostile/asteroid/goldgrub{will_burrow = 0},/turf/open/floor/plating/asteroid,/area/ruin/unpowered) "aq" = (/obj/structure/flora/ausbushes/grassybush,/turf/open/floor/grass,/area/ruin/unpowered) "ar" = (/obj/structure/flora/rock/pile,/turf/open/floor/plating/asteroid,/area/ruin/unpowered) "as" = (/mob/living/simple_animal/hostile/asteroid/basilisk,/turf/open/floor/plating/asteroid,/area/ruin/unpowered) diff --git a/code/_globalvars/lists/mapping.dm b/code/_globalvars/lists/mapping.dm index 0d8be652a22..b88a9362eb4 100644 --- a/code/_globalvars/lists/mapping.dm +++ b/code/_globalvars/lists/mapping.dm @@ -56,6 +56,8 @@ var/list/sortedAreas = list() //List of preloaded templates var/list/datum/map_template/map_templates = list() + +var/list/datum/map_template/ruins_templates = list() var/list/datum/map_template/space_ruins_templates = list() var/list/datum/map_template/lava_ruins_templates = list() diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 067730d32bf..93dd4a0555a 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -173,6 +173,8 @@ var/generate_minimaps = 0 var/grey_assistants = 0 + var/lavaland_budget = 60 + var/aggressive_changelog = 0 var/reactionary_explosions = 0 //If we use reactionary explosions, explosions that react to walls and doors @@ -584,6 +586,8 @@ config.starlight = 1 if("grey_assistants") config.grey_assistants = 1 + if("lavaland_budget") + config.lavaland_budget = text2num(value) if("no_summon_guns") config.no_summon_guns = 1 if("no_summon_magic") @@ -751,4 +755,4 @@ if(!statclick) statclick = new/obj/effect/statclick/debug("Edit", src) - stat("[name]:", statclick) \ No newline at end of file + stat("[name]:", statclick) diff --git a/code/controllers/master.dm b/code/controllers/master.dm index d48be2c82c4..a01c867c134 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -85,7 +85,8 @@ var/global/datum/controller/master/Master = new() var/mining_type = MINETYPE if(mining_type == "lavaland") - seedRuins(5, 5, /area/lavaland/surface/outdoors, lava_ruins_templates) + seedRuins(5, config.lavaland_budget, \ + /area/lavaland/surface/outdoors, lava_ruins_templates) spawn_rivers() else make_mining_asteroid_secrets() diff --git a/code/datums/helper_datums/map_template.dm b/code/datums/helper_datums/map_template.dm index bedb903a1b4..a545622036a 100644 --- a/code/datums/helper_datums/map_template.dm +++ b/code/datums/helper_datums/map_template.dm @@ -89,17 +89,28 @@ preloadShuttleTemplates() /proc/preloadRuinTemplates() - var/list/potentialSpaceRuins = generateMapList(filename = "_maps/RandomRuins/SpaceRuins/_maplisting.txt", blacklist = "config/spaceRuinBlacklist.txt") - for(var/ruin in potentialSpaceRuins) - var/datum/map_template/T = new(path = "[ruin]", rename = "[ruin]") - space_ruins_templates[T.name] = T - map_templates[T.name] = T + // Still supporting bans by filename + var/list/banned = generateMapList("config/lavaRuinBlacklist.txt") + banned += generateMapList("config/spaceRuinBlacklist.txt") + + for(var/item in subtypesof(/datum/map_template/ruin)) + var/datum/map_template/ruin/ruin_type = item + // screen out the abstract subtypes + if(!initial(ruin_type.id)) + continue + var/datum/map_template/ruin/R = new ruin_type() + + if(banned.Find(R.mappath)) + continue + + map_templates[R.name] = R + ruins_templates[R.name] = R + + if(istype(R, /datum/map_template/ruin/lavaland)) + lava_ruins_templates[R.name] = R + else if(istype(R, /datum/map_template/ruin/space)) + space_ruins_templates[R.name] = R - var/list/potentialLavaRuins = generateMapList(filename = "_maps/RandomRuins/LavaRuins/_maplisting.txt", blacklist = "config/lavaRuinBlacklist.txt") - for(var/ruin in potentialLavaRuins) - var/datum/map_template/T = new(path = "[ruin]", rename = "[ruin]") - lava_ruins_templates[T.name] = T - map_templates[T.name] = T /proc/preloadShuttleTemplates() for(var/item in subtypesof(/datum/map_template/shuttle)) diff --git a/code/datums/ruins.dm b/code/datums/ruins.dm new file mode 100644 index 00000000000..d9c2ca348d5 --- /dev/null +++ b/code/datums/ruins.dm @@ -0,0 +1,22 @@ +/datum/map_template/ruin + //name = "A Chest of Doubloons" + name = null + var/id = null // For blacklisting purposes, all ruins need an id + var/description = "In the middle of a clearing in the rockface, there's a \ + chest filled with gold coins with Spanish engravings. How is there a \ + wooden container filled with 18th century coinage in the middle of a \ + lavawracked hellscape? It is clearly a mystery." + + var/cost = null + var/allow_duplicates = TRUE + + var/prefix = null + var/suffix = null + +/datum/map_template/ruin/New() + if(!name && id) + name = id + + mappath = prefix + suffix + ..(path = mappath) + diff --git a/code/datums/ruins/lavaland.dm b/code/datums/ruins/lavaland.dm new file mode 100644 index 00000000000..9409e9b3b6f --- /dev/null +++ b/code/datums/ruins/lavaland.dm @@ -0,0 +1,176 @@ +/datum/map_template/ruin/lavaland + prefix = "_maps/RandomRuins/LavaRuins/" + +/datum/map_template/ruin/lavaland/biodome + cost = 5 + allow_duplicates = FALSE + +/datum/map_template/ruin/lavaland/biodome/beach + name = "Biodome Beach" + id = "biodome-beach" + description = "Seemingly plucked from a tropical destination, this beach \ + is calm and cool, with the salty waves roaring softly in the \ + background. Comes with a rustic wooden bar and suicidal bartender." + suffix = "lavaland_biodome_beach.dmm" + +/datum/map_template/ruin/lavaland/biodome/winter + name = "Biodome Winter" + id = "biodome-winter" + description = "For those getaways where you want to get back to nature, \ + but you don't want to leave the fortified military compound where you \ + spend your days. Includes a unique(*) laser pistol display case, \ + and the recently introduced I.C.E(tm)." + suffix = "lavaland_surface_biodome_winter.dmm" + +/datum/map_template/ruin/lavaland/biodome/clown + name = "Biodome Clown Planet" + id = "biodome-clown" + description = "WELCOME TO CLOWN PLANET! HONK HONK HONK etc.!" + suffix = "lavaland_biodome_clown_planet.dmm" + +/datum/map_template/ruin/lavaland/cube + name = "The Wishgranter Cube" + id = "wishgranter-cube" + description = "Nothing good can come from this. Learn from their mistakes \ + and turn around." + suffix = "lavaland_surface_cube.dmm" + cost = 10 + allow_duplicates = FALSE + +/datum/map_template/ruin/lavaland/prisoners + name = "Prisoner Crash" + id = "prisoner-crash" + description = "This incredibly high security shuttle clearly didn't have \ + 'avoiding lavafilled hellscapes' as a design priority. As such, it \ + has crashed, waking the prisoners from their cryostasis, and setting \ + them loose on the wastes. If they live long enough, that is." + suffix = "lavaland_surface_prisoner_crash.dmm" + cost = 15 + allow_duplicates = FALSE + +/datum/map_template/ruin/lavaland/seed_vault + name = "Seed Vault" + id = "seed-vault" + description = "The creators of these vaults were a highly advanced and \ + benevolent race, and launched many into the stars, hoping to aid \ + fledgling civilizations. However, all the inhabitants seem to do is \ + grow drugs and guns." + suffix = "lavaland_surface_seed_vault.dmm" + cost = 10 + +/datum/map_template/ruin/lavaland/ash_walker + name = "Ash Walker Nest" + id = "ash-walker" + description = "A race of unbreathing lizards live here, that run faster \ + than a human can, worship a broken dead city, and are capable of \ + reproducing by something involving tentacles? Probably best to \ + stay clear." + suffix = "lavaland_surface_ash_walker1.dmm" + cost = 20 + allow_duplicates = FALSE + +/datum/map_template/ruin/lavaland/free_golem + name = "Free Golem Ship" + id = "golem-ship" + description = "Lumbering humanoids, made out of precious metals, move \ + inside this ship. They frequently leave to mine more minerals, \ + which they somehow turn into more of them. Seem very intent on \ + research and individual liberty, and also geology based naming?" + cost = 20 + suffix = "lavaland_surface_golem_ship.dmm" + allow_duplicates = FALSE + +/datum/map_template/ruin/lavaland/animal_hospital + name = "Animal Hospital" + id = "animal-hospital" + description = "Rats with cancer do not live very long. And the ones that \ + wake up from cryostasis seem to commit suicide out of boredom." + cost = 5 + suffix = "lavaland_surface_animal_hospital.dmm" + allow_duplicates = FALSE + +/datum/map_template/ruin/lavaland/sin + cost = 10 + +/datum/map_template/ruin/lavaland/sin/envy + name = "Ruin of Envy" + id = "envy" + description = "When you get what they have, then you'll finally be happy." + suffix = "lavaland_surface_envy.dmm" + +/datum/map_template/ruin/lavaland/sin/gluttony + name = "Ruin of Gluttony" + id = "gluttony" + description = "If you eat enough, then eating will be all that you do." + suffix = "lavaland_surface_gluttony.dmm" + +/datum/map_template/ruin/lavaland/sin/greed + name = "Ruin of Greed" + id = "greed" + description = "Sure you don't need magical powers, but you WANT them, and \ + that's what's important." + suffix = "lavaland_surface_greed.dmm" + +/datum/map_template/ruin/lavaland/sin/pride + name = "Ruin of Pride" + id = "pride" + description = "Wormhole lifebelts are for LOSERS, who you are better than." + suffix = "lavaland_surface_pride.dmm" + +/datum/map_template/ruin/lavaland/sin/sloth + name = "Ruin of Sloth" + id = "sloth" + description = "..." + suffix = "lavaland_surface_sloth.dmm" + // Generates nothing but atmos runtimes and salt + cost = 0 + allow_duplicates = FALSE + +/datum/map_template/ruin/lavaland/ato + name = "Automated Trade Outpost" + id = "ato" + description = "A sign at the front says 'Stealing is bad.'" + suffix = "lavaland_surface_automated_trade_outpost.dmm" + cost = 5 + +/datum/map_template/ruin/lavaland/ufo_crash + name = "UFO Crash" + id = "ufo-crash" + description = "Turns out that keeping your abductees unconcious is really \ + important. Who knew?" + suffix = "lavaland_surface_ufo_crash.dmm" + cost = 5 + +/datum/map_template/ruin/lavaland/ww_vault + name = "Wishgranter Vault" + id = "ww-vault" + description = "Scrawled on the large double doors is both a message and a \ + warning: 'meat grinder requires sacri...'. You're not so sure about \ + this anymore." + suffix = "lavaland_surface_ww_vault.dmm" + cost = 20 + +/datum/map_template/ruin/lavaland/xeno_nest + name = "Xenomorph Nest" + id = "xeno-nest" + description = "These xenomorphs got bored of horrifically slaughtering \ + people on space stations, and have settled down on a nice lava filled \ + hellscape to focus on what's really important in life. Quality memes." + suffix = "lavaland_surface_xeno_nest.dmm" + cost = 20 + +/datum/map_template/ruin/lavaland/fountain + name = "Fountain Hall" + id = "fountain" + description = "The fountain has a warning on the side. DANGER: May have \ + undeclared side effects that only become obvious when implemented." + suffix = "lavaland_fountain_hall.dmm" + cost = 5 + +/datum/map_template/ruin/lavaland/zombie_gym + name = "Zombie Gym" + id = "zombie-gym" + description = "The patrons at this gym are serious about health, and \ + making sure people work on their cardio." + suffix = "lavaland_gym.dmm" + cost = 10 diff --git a/code/datums/ruins/space.dm b/code/datums/ruins/space.dm new file mode 100644 index 00000000000..de83a4bedb4 --- /dev/null +++ b/code/datums/ruins/space.dm @@ -0,0 +1,157 @@ +/datum/map_template/ruin/space + prefix = "_maps/RandomRuins/SpaceRuins/" + cost = 1 + +/datum/map_template/ruin/space/zoo + id = "zoo" + suffix = "abandonedzoo.dmm" + name = "Biological Storage Facility" + description = "In case society crumbles, we will be able to restore our \ + zoos to working order with the breeding stock kept in these 100% \ + secure and unbreachable storage facilities. At no point has anything \ + escaped. That's our story, and we're sticking to it." + +/datum/map_template/ruin/space/asteroid1 + id = "asteroid1" + suffix = "asteroid1.dmm" + name = "Asteroid 1" + description = "I-spy with my little eye, something beginning with R." + +/datum/map_template/ruin/space/asteroid2 + id = "asteroid2" + suffix = "asteroid2.dmm" + name = "Asteroid 2" + description = "Oh my god, a giant rock!" + +/datum/map_template/ruin/space/asteroid3 + id = "asteroid3" + suffix = "asteroid3.dmm" + name = "Asteroid 3" + description = "This asteroid floating in space has no official \ + designation, because the scientist that discovered it deemed it \ + 'super dull'." + +/datum/map_template/ruin/space/asteroid4 + id = "asteroid4" + suffix = "asteroid4.dmm" + name = "Asteroid 4" + description = "Nanotrasen Escape Pods have a 100%* success rate, and a \ + 99%* customer satisfaction rate. *Please note that these statistics, \ + are taken from pods that have successfully docked with a recovery \ + vessel." + +/datum/map_template/ruin/space/asteroid5 + id = "asteroid5" + suffix = "asteroid5.dmm" + name = "Asteroid 5" + description = "Oh my god, another giant rock!" + +/datum/map_template/ruin/space/deep_storage + id = "deep-storage" + suffix = "deepstorage.dmm" + name = "Survivalist Bunker" + description = "Assume the best, prepare for the worst. Generally, you \ + should do so by digging a three man heavily fortified bunker into \ + a giant unused asteroid. Then make it self sufficient, mask any \ + evidence of construction, hook it covertly into the \ + telecommunications network and hope for the best." + +/datum/map_template/ruin/space/derelict1 + id = "derelict1" + suffix = "derelict1.dmm" + name = "Derelict 1" + description = "Nothing to see here citizen, move along, certainly no \ + xeno outbreaks on this piece of station debris. That purple stuff? \ + It's uh... station nectar. It's a top secret research installation." + +/datum/map_template/ruin/space/derelict2 + id = "derelict2" + suffix = "derelict2.dmm" + name = "Dinner for Two" + description = "Oh this is the night\n\ + It's a beautiful night\n\ + And we call it bella notte" + +/datum/map_template/ruin/space/derelict3 + id = "derelict3" + suffix = "derelict3.dmm" + name = "Derelict 3" + description = "These hulks were once part of a larger structure, where \ + the three great \[REDACTED\] were forged." + +/datum/map_template/ruin/space/derelict4 + id = "derelict4" + suffix = "derelict4.dmm" + name = "Derelict 4" + description = "Centcom ferries have never crashed, will never crash, \ + there is no current investigation into a crashed ferry, and we \ + will not let Internal Affairs trample over high security information \ + in the name of this baseless witchhunt." + +/datum/map_template/ruin/space/derelict5 + id = "derelict5" + suffix = "derelict5.dmm" + name = "Derelict 5" + description = "The plan is, we put a whole bunch of crates full of \ + treasure in this disused warehouse, launch it into space, and then \ + ignore it. Forever." + +/datum/map_template/ruin/space/empty_shell + id = "empty-shell" + suffix = "emptyshell.dmm" + name = "Empty Shell" + description = "Cosy, rural property availible for young professional \ + couple. Only twelve parsecs from the nearest hyperspace lane!" + +/datum/map_template/ruin/space/gas_the_lizards + id = "gas-the-lizards" + suffix = "gasthelizards.dmm" + name = "Disposal Facility 17" + description = "Gas efficiency at 95.6%, fluid elimination at 96.2%. \ + Will require renewed supplies of 'carpet' before the end of the \ + quarter." + +/datum/map_template/ruin/space/intact_empty_ship + id = "intact-empty-ship" + suffix = "intactemptyship.dmm" + name = "Authorship" + description = "Just somewhere quiet, where I can focus on my work with \ + no interruptions." + +/datum/map_template/ruin/space/mech_transport + id = "mech-transport" + suffix = "mechtransport.dmm" + name = "CF Corsair" + description = "Well, when is it getting here? I have bills to pay; very \ + well-armed clients who want their shipments as soon as possible! I \ + don't care, just find it!" + +/datum/map_template/ruin/space/onehalf + id = "onehalf" + suffix = "onehalf.dmm" + name = "DK Excavator 453" + description = "Based on the trace elements we've detected on the \ + gutted asteroids, we suspect that a mining ship using a restricted \ + engine is somewhere in the area. We'd like to request a patrol vessel \ + to investigate." + +/datum/map_template/ruin/space/spacebar + id = "spacebar" + suffix = "spacebar.dmm" + name = "The Rampant Golem and Yellow Hound" + description = "No questions asked. No shoes/foot protection, no service. \ + No tabs. No violence in the inside areas. That's it. Welcome to the \ + Rampant Golem and Yellow Hound. Can I take your order?" + +/datum/map_template/ruin/space/turreted_outpost + id = "turreted-outpost" + suffix = "turretedoutpost.dmm" + name = "Unnamed Turreted Outpost" + description = "We'd ask them to stop blaring that ruskiepop music, but \ + none of us are brave enough to go near those death turrets they have." + +/datum/map_template/ruin/space/way_home + id = "way-home" + suffix = "way_home.dmm" + name = "Salvation" + description = "In the darkest times, we will find our way home." diff --git a/code/modules/awaymissions/zlevel.dm b/code/modules/awaymissions/zlevel.dm index 17d563703d5..bbb573909b2 100644 --- a/code/modules/awaymissions/zlevel.dm +++ b/code/modules/awaymissions/zlevel.dm @@ -29,40 +29,12 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away return -/proc/generateMapList(filename, blacklist) +/proc/generateMapList(filename) var/list/potentialMaps = list() - var/list/blacklistedMaps = list() var/list/Lines = file2list(filename) if(!Lines.len) return - - if(blacklist) - var/list/Blines = file2list(blacklist) - for (var/t in Blines) - if (!t) - continue - - t = trim(t) - if (length(t) == 0) - continue - else if (copytext(t, 1, 2) == "#") - continue - - var/pos = findtext(t, " ") - var/name = null - - if (pos) - name = lowertext(copytext(t, 1, pos)) - - else - name = lowertext(t) - - if (!name) - continue - - blacklistedMaps.Add(t) - for (var/t in Lines) if (!t) continue @@ -87,40 +59,44 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away potentialMaps.Add(t) + return potentialMaps - return (potentialMaps - blacklistedMaps) +/proc/seedRuins(z_level = 1, budget = 0, whitelist = /area/space, list/potentialRuins = space_ruins_templates) + var/overall_sanity = 100 + var/ruins = potentialRuins.Copy() -/proc/seedRuins(z_level = 1, ruin_number = 0, whitelist = /area/space, list/potentialRuins = space_ruins_templates) - ruin_number = min(ruin_number, potentialRuins.len) - - while(ruin_number) - var/sanity = 0 - var/valid = FALSE - var/datum/map_template/template = potentialRuins[pick(potentialRuins)] - while(!valid) - valid = TRUE - sanity++ - if(sanity > 100) - ruin_number-- - break + while(budget > 0 && overall_sanity > 0) + // Pick a ruin + var/datum/map_template/ruin/ruin = ruins[pick(ruins)] + // Can we afford it + if(ruin.cost > budget) + overall_sanity-- + continue + // If so, try to place it + var/sanity = 100 + // And if we can't fit it anywhere, give up, try again + while(sanity > 0) + sanity-- var/turf/T = locate(rand(25, world.maxx - 25), rand(25, world.maxy - 25), z_level) - for(var/turf/check in template.get_affected_turfs(T,1)) + for(var/turf/check in ruin.get_affected_turfs(T,1)) var/area/new_area = get_area(check) if(!(istype(new_area, whitelist))) - valid = FALSE - break + continue - if(valid) - world.log << "Ruin \"[template.mappath]\" placed at ([T.x], [T.y], [T.z])" - var/obj/effect/ruin_loader/R = new /obj/effect/ruin_loader(T) - R.Load(potentialRuins,template) - potentialRuins -= template - ruin_number -- + world.log << "Ruin \"[ruin.name]\" placed at ([T.x], [T.y], [T.z])" - return + var/obj/effect/ruin_loader/R = new /obj/effect/ruin_loader(T) + R.Load(ruins,ruin) + budget -= ruin.cost + if(!ruin.allow_duplicates) + ruins -= ruin.name + break + + if(!overall_sanity) + world.log << "Ruin loader gave up with [budget] left to spend." /obj/effect/ruin_loader name = "random ruin" diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm index d66f5fe2aae..6ea3114ffed 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm @@ -132,6 +132,7 @@ /obj/item/weapon/ore/uranium) var/chase_time = 100 + var/will_burrow = TRUE /mob/living/simple_animal/hostile/asteroid/goldgrub/New() ..() @@ -151,8 +152,9 @@ visible_message("The [src.name] tries to flee from [target.name]!") retreat_distance = 10 minimum_distance = 10 - spawn(chase_time) - Burrow() + if(will_burrow) + spawn(chase_time) + Burrow() /mob/living/simple_animal/hostile/asteroid/goldgrub/AttackingTarget() if(istype(target, /obj/item/weapon/ore)) diff --git a/config/game_options.txt b/config/game_options.txt index 767aff019fc..914a64e3bcf 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -40,7 +40,7 @@ EMOJIS ## These values get directly added to values and totals ingame. ## To speed things up make the number negative, to slow things down, make the number positive. -## These modify the run/walk speed of all mobs before the mob-specific modifiers are applied. +## These modify the run/walk speed of all mobs before the mob-specific modifiers are applied. RUN_DELAY 1 WALK_DELAY 4 @@ -186,7 +186,7 @@ ALLOW_RANDOM_EVENTS ## Set to 0 to make dangerous events avaliable from round start. EVENTS_MIN_TIME_MUL 1 -## Multiplier for minimal player count (players = alive non-AFK humans) for dangerous events to start. +## Multiplier for minimal player count (players = alive non-AFK humans) for dangerous events to start. ## Set to 0 to make dangerous events avaliable for all populations. EVENTS_MIN_PLAYERS_MUL 1 @@ -347,4 +347,9 @@ BOMBCAP 20 #BOMBCAP 28 - +## Lavaland "Budget" +# Lavaland ruin spawning has an imaginary budget to spend on ruins, where +# a less lootfilled or smaller or less round effecting ruin costs less to +# spawn, while the converse is true. Alter this number to affect the amount +# of ruins. +LAVALAND_BUDGET 60 diff --git a/tgstation.dme b/tgstation.dme index 50fa5be7eb0..9473432efad 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -162,6 +162,7 @@ #include "code\datums\outfit.dm" #include "code\datums\progressbar.dm" #include "code\datums\recipe.dm" +#include "code\datums\ruins.dm" #include "code\datums\shuttles.dm" #include "code\datums\votablemap.dm" #include "code\datums\diseases\_disease.dm" @@ -225,6 +226,8 @@ #include "code\datums\helper_datums\topic_input.dm" #include "code\datums\martial\krav_maga.dm" #include "code\datums\martial\wrestling.dm" +#include "code\datums\ruins\lavaland.dm" +#include "code\datums\ruins\space.dm" #include "code\datums\wires\airalarm.dm" #include "code\datums\wires\airlock.dm" #include "code\datums\wires\apc.dm"