Skip to content

Commit

Permalink
Revert "[MIRROR] Exoplanet Gen tweaks"
Browse files Browse the repository at this point in the history
This reverts commit 5e33b89.
  • Loading branch information
SuhEugene committed Sep 14, 2023
1 parent e4923ba commit 9a82abe
Show file tree
Hide file tree
Showing 12 changed files with 97 additions and 143 deletions.
12 changes: 4 additions & 8 deletions code/__defines/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,10 @@
//Lying animation
#define ANIM_LYING_TIME 2


//Planet habitability weight
#define HABITABILITY_LOCKED 1
#define HABITABILITY_TYPICAL 2
#define HABITABILITY_BAD 3
#define HABITABILITY_EXTREME 4
#define HABITABILITY_RANDOM 5

//Planet habitability class
#define HABITABILITY_IDEAL 1
#define HABITABILITY_OKAY 2
#define HABITABILITY_BAD 3

#ifndef WINDOWS_HTTP_POST_DLL_LOCATION
#define WINDOWS_HTTP_POST_DLL_LOCATION "lib/byhttp.dll"
Expand Down
3 changes: 1 addition & 2 deletions code/modules/ZAS/Fire.dm
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,7 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin
adjust_gas(gas_data.burn_product[g], burned_fuel.gas[g])

//calculate the energy produced by the reaction and then set the new temperature of the mix
var/energy = starting_energy + vsc.fire_fuel_energy_release * (used_gas_fuel)
add_thermal_energy(energy)
temperature = (starting_energy + vsc.fire_fuel_energy_release * (used_gas_fuel)) / heat_capacity()
update_values()

#ifdef FIREDBG
Expand Down
15 changes: 13 additions & 2 deletions code/modules/overmap/exoplanets/_exoplanet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,18 @@ GLOBAL_VAR(planet_repopulation_disabled)
var/list/spawned_features

//Either a type or a list of types and weights. You must include all types if it's a list
var/list/habitability_distribution = list(
HABITABILITY_IDEAL = 10,
HABITABILITY_OKAY = 40,
HABITABILITY_BAD = 50
)
var/habitability_class

var/habitability_weight = HABITABILITY_TYPICAL
/obj/effect/overmap/visitable/sector/exoplanet/proc/generate_habitability()
if (isnum(habitability_distribution))
habitability_class = habitability_distribution
else
habitability_class = pickweight_index(habitability_distribution)

/obj/effect/overmap/visitable/sector/exoplanet/New(nloc, max_x, max_y)
if (!GLOB.using_map.use_overmap)
Expand Down Expand Up @@ -105,13 +115,14 @@ GLOBAL_VAR(planet_repopulation_disabled)
..()

/obj/effect/overmap/visitable/sector/exoplanet/proc/build_level()
generate_habitability()
generate_atmosphere()
for (var/datum/exoplanet_theme/T in themes)
T.adjust_atmosphere(src)
if (atmosphere)
//Set up gases for living things
if (!length(breathgas))
var/list/goodgases = atmosphere.gas.Copy()
var/list/goodgases = gas_data.gases.Copy()
var/gasnum = min(rand(1,3), length(goodgases))
for (var/i = 1 to gasnum)
var/gas = pick(goodgases)
Expand Down
48 changes: 17 additions & 31 deletions code/modules/overmap/exoplanets/exoplanet_atmosphere.dm
Original file line number Diff line number Diff line change
@@ -1,61 +1,47 @@
/obj/effect/overmap/visitable/sector/exoplanet/proc/generate_atmosphere()
atmosphere = new
if (habitability_weight == HABITABILITY_LOCKED)
if (habitability_class == HABITABILITY_IDEAL)
atmosphere.adjust_gas(GAS_OXYGEN, MOLES_O2STANDARD, 0)
atmosphere.adjust_gas(GAS_NITROGEN, MOLES_N2STANDARD)
else //let the fuckery commence
var/habitability
var/list/newgases = gas_data.gases.Copy()
if (prob(90)) //all phoron planet should be rare
newgases -= GAS_PHORON
if (prob(50)) //alium gas should be slightly less common than mundane shit
newgases -= GAS_ALIEN
newgases -= GAS_STEAM

switch(habitability_weight)
if (HABITABILITY_TYPICAL)
habitability = NORMAL_RAND
if (HABITABILITY_BAD)
habitability = LINEAR_RAND
if (HABITABILITY_EXTREME)
habitability = SQUARE_RAND
else
habitability = UNIFORM_RAND

var/total_moles = MOLES_CELLSTANDARD * (rand(7, 40) / 10)
var/generator/new_moles = generator("num", 0.05 * total_moles, 0.5 * total_moles, habitability)
var/total_moles = MOLES_CELLSTANDARD * rand(80,120)/100
var/badflag = 0

var/gasnum = rand(max(habitability_weight - 1, 1), 4)
var/i = 0
//Breathable planet
if (habitability_class == HABITABILITY_OKAY)
atmosphere.gas[GAS_OXYGEN] += MOLES_O2STANDARD
total_moles -= MOLES_O2STANDARD
badflag = XGM_GAS_FUEL|XGM_GAS_CONTAMINANT

var/gasnum = rand(1,4)
var/i = 1
var/sanity = prob(99.9)
while (i <= gasnum && total_moles && length(newgases))
if (badflag)
if (badflag && sanity)
for(var/g in newgases)
if (gas_data.flags[g] & badflag)
newgases -= g

var/ng = pick_n_take(newgases) //pick a gas

if (gas_data.flags[ng] & XGM_GAS_OXIDIZER)
badflag |= XGM_GAS_OXIDIZER
if (prob(33))
badflag |= (XGM_GAS_FUSION_FUEL | XGM_GAS_FUEL)

if ((gas_data.flags[ng] & XGM_GAS_FUEL) || (gas_data.flags[ng] & XGM_GAS_FUSION_FUEL))
badflag |= (XGM_GAS_FUSION_FUEL | XGM_GAS_FUEL)
if (prob(33))
if (sanity) //make sure atmosphere is not flammable... always
if (gas_data.flags[ng] & XGM_GAS_OXIDIZER)
badflag |= XGM_GAS_FUEL
if (gas_data.flags[ng] & XGM_GAS_FUEL)
badflag |= XGM_GAS_OXIDIZER
sanity = 0

var/part = min(0.33 * total_moles, new_moles.Rand()) //allocate percentage to it
var/part = total_moles * rand(3,80)/100 //allocate percentage to it
if (i == gasnum || !length(newgases)) //if it's last gas, let it have all remaining moles
part = total_moles

atmosphere.gas[ng] += part
total_moles = max(total_moles - part, 0)
i++
atmosphere.update_values()


/obj/effect/overmap/visitable/sector/exoplanet/proc/get_atmosphere_color()
var/list/colors = list()
Expand Down
11 changes: 7 additions & 4 deletions code/modules/overmap/exoplanets/planet_types/barren.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@
color = "#6c6c6c"
planetary_area = /area/exoplanet/barren
rock_colors = list(COLOR_BEIGE, COLOR_GRAY80, COLOR_BROWN)
possible_themes = list(/datum/exoplanet_theme/mountains)
map_generators = list(/datum/random_map/noise/exoplanet/barren, /datum/random_map/noise/ore/rich)
ruin_tags_blacklist = RUIN_HABITAT|RUIN_WATER
features_budget = 6
surface_color = "#807d7a"
water_color = null
habitability_weight = HABITABILITY_LOCKED
habitability_distribution = HABITABILITY_BAD
has_trees = FALSE

/obj/effect/overmap/visitable/sector/exoplanet/barren/generate_atmosphere()
atmosphere = new
return
..()
atmosphere.remove_ratio(0.9)

/obj/effect/overmap/visitable/sector/exoplanet/barren/generate_flora()
return
if(prob(10))
flora_diversity = 1
..()

/datum/random_map/noise/exoplanet/barren
descriptor = "barren exoplanet"
Expand Down
20 changes: 7 additions & 13 deletions code/modules/overmap/exoplanets/planet_types/chlorine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,28 @@
ruin_tags_blacklist = RUIN_HABITAT|RUIN_WATER
surface_color = "#a3b879"
water_color = COLOR_BOTTLE_GREEN
habitability_weight = HABITABILITY_BAD
habitability_distribution = HABITABILITY_BAD
has_trees = FALSE
flora_diversity = 5
fauna_types = list(/mob/living/simple_animal/thinbug, /mob/living/simple_animal/hostile/retaliate/beast/samak/alt, /mob/living/simple_animal/yithian, /mob/living/simple_animal/tindalos, /mob/living/simple_animal/hostile/retaliate/jelly)
megafauna_types = list(/mob/living/simple_animal/hostile/retaliate/jelly/mega)

/obj/effect/overmap/visitable/sector/exoplanet/chlorine/get_atmosphere_color()
var/air_color = ..()
return MixColors("#e5f2bd", air_color)

return "#e5f2bd"

/obj/effect/overmap/visitable/sector/exoplanet/chlorine/generate_map()
if (prob(50))
if(prob(50))
lightlevel = rand(7,10)/10 //It could be night.
else
lightlevel = 0.1
..()

/obj/effect/overmap/visitable/sector/exoplanet/chlorine/generate_atmosphere()
..()
var/chlorine = (rand(1, 6) / 10) * (atmosphere.total_moles)
atmosphere = atmosphere.remove(chlorine)
atmosphere.adjust_gas(GAS_CHLORINE, chlorine)

var/datum/species/H = all_species[SPECIES_HUMAN]
var/generator/new_temp = generator("num", H.cold_level_1 + 40, H.heat_level_1 + 10, UNIFORM_RAND)
atmosphere.temperature = new_temp.Rand()
atmosphere.update_values()
if(atmosphere)
atmosphere.adjust_gas(GAS_CHLORINE, MOLES_O2STANDARD)
atmosphere.temperature = T100C - rand(0, 100)
atmosphere.update_values()

/datum/random_map/noise/exoplanet/chlorine
descriptor = "chlorine exoplanet"
Expand Down
13 changes: 8 additions & 5 deletions code/modules/overmap/exoplanets/planet_types/desert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
map_generators = list(/datum/random_map/noise/exoplanet/desert, /datum/random_map/noise/ore/rich)
surface_color = "#d6cca4"
water_color = null
habitability_weight = HABITABILITY_TYPICAL
habitability_distribution = list(HABITABILITY_IDEAL = 30, HABITABILITY_OKAY = 50, HABITABILITY_BAD = 10)
has_trees = FALSE
flora_diversity = 4
fauna_types = list(/mob/living/simple_animal/thinbug, /mob/living/simple_animal/tindalos, /mob/living/simple_animal/hostile/voxslug, /mob/living/simple_animal/hostile/retaliate/beast/antlion)
Expand All @@ -21,10 +21,13 @@

/obj/effect/overmap/visitable/sector/exoplanet/desert/generate_atmosphere()
..()
var/datum/species/H = all_species[SPECIES_HUMAN]
var/generator/new_temp = generator("num", H.heat_level_1, 2 * H.heat_level_1, NORMAL_RAND)
atmosphere.temperature = new_temp.Rand()
atmosphere.update_values()
if(atmosphere)
var/limit = 1000
if(habitability_class <= HABITABILITY_OKAY)
var/datum/species/human/H = /datum/species/human
limit = initial(H.heat_level_1) - rand(1,10)
atmosphere.temperature = min(T20C + rand(20, 100), limit)
atmosphere.update_values()

/obj/effect/overmap/visitable/sector/exoplanet/desert/adapt_seed(datum/seed/S)
..()
Expand Down
46 changes: 13 additions & 33 deletions code/modules/overmap/exoplanets/planet_types/grass.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,11 @@
rock_colors = list(COLOR_ASTEROID_ROCK, COLOR_GRAY80, COLOR_BROWN)
plant_colors = list("#0e1e14","#1a3e38","#5a7467","#9eab88","#6e7248", "RANDOM")
map_generators = list(/datum/random_map/noise/exoplanet/grass)
habitability_weight = HABITABILITY_TYPICAL
habitability_distribution = list(HABITABILITY_IDEAL = 70, HABITABILITY_OKAY = 20, HABITABILITY_BAD = 5)
has_trees = TRUE
flora_diversity = 7
fauna_types = list(
/mob/living/simple_animal/yithian,
/mob/living/simple_animal/tindalos,
/mob/living/simple_animal/hostile/retaliate/jelly
)
megafauna_types = list(
/mob/living/simple_animal/hostile/retaliate/parrot/space/megafauna,
/mob/living/simple_animal/hostile/retaliate/goose/dire
)
fauna_types = list(/mob/living/simple_animal/yithian, /mob/living/simple_animal/tindalos, /mob/living/simple_animal/hostile/retaliate/jelly)
megafauna_types = list(/mob/living/simple_animal/hostile/retaliate/parrot/space/megafauna, /mob/living/simple_animal/hostile/retaliate/goose/dire)

/obj/effect/overmap/visitable/sector/exoplanet/grass/generate_map()
if(prob(40))
Expand All @@ -26,10 +19,9 @@

/obj/effect/overmap/visitable/sector/exoplanet/grass/generate_atmosphere()
..()
var/datum/species/H = all_species[SPECIES_HUMAN]
var/generator/new_temp = generator("num", T0C, H.heat_level_1 - 10, UNIFORM_RAND)
atmosphere.temperature = new_temp.Rand()
atmosphere.update_values()
if(atmosphere)
atmosphere.temperature = T20C + rand(10, 30)
atmosphere.update_values()

/obj/effect/overmap/visitable/sector/exoplanet/grass/get_surface_color()
return grass_color
Expand Down Expand Up @@ -87,20 +79,8 @@
lightlevel = 0.5
has_trees = TRUE
flora_diversity = 8
fauna_types = list(
/mob/living/simple_animal/passive/cat,
/mob/living/simple_animal/passive/chicken,
/mob/living/simple_animal/passive/mouse,
/mob/living/simple_animal/passive/opossum,
/mob/living/simple_animal/hostile/retaliate/goat,
/mob/living/simple_animal/hostile/retaliate/goose,
/mob/living/simple_animal/passive/cow
)
megafauna_types = list(
/mob/living/simple_animal/hostile/retaliate/parrot/space/megafauna,
/mob/living/simple_animal/hostile/retaliate/goose/dire
)
habitability_weight = HABITABILITY_LOCKED
fauna_types = list(/mob/living/simple_animal/passive/cat, /mob/living/simple_animal/passive/chicken, /mob/living/simple_animal/passive/mouse, /mob/living/simple_animal/passive/opossum, /mob/living/simple_animal/hostile/retaliate/goat, /mob/living/simple_animal/hostile/retaliate/goose, /mob/living/simple_animal/passive/cow)
megafauna_types = list(/mob/living/simple_animal/hostile/retaliate/parrot/space/megafauna, /mob/living/simple_animal/hostile/retaliate/goose/dire)

//Animals being named alien creature is a bit odd as these would just be earth transplants
species = list( /mob/living/simple_animal/passive/cat = "wild cat",
Expand All @@ -111,14 +91,14 @@
/mob/living/simple_animal/hostile/retaliate/goose = "goose",
/mob/living/simple_animal/passive/cow = "wild cow")

/obj/effect/overmap/visitable/sector/exoplanet/grass/terraformed/generate_habitability()
habitability_class = HABITABILITY_IDEAL

/obj/effect/overmap/visitable/sector/exoplanet/grass/terraformed/generate_atmosphere()
..()
var/datum/species/H = all_species[SPECIES_HUMAN]
var/generator/new_temp = generator("num", T20C, H.heat_level_1 - 15)
atmosphere.temperature = new_temp.Rand()
to_debug_listeners("[name] temperature set to [atmosphere.temperature]. Alternative value could be [new_temp.Rand()].")
atmosphere.update_values()
if(atmosphere)
atmosphere.temperature = T0C + rand(0, 50)
atmosphere.update_values()

/obj/effect/overmap/visitable/sector/exoplanet/grass/generate_map()
lightlevel = rand(0.7,0.9)/10
Expand Down
19 changes: 8 additions & 11 deletions code/modules/overmap/exoplanets/planet_types/shrouded.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,20 @@
water_color = "#2b2840"
has_trees = TRUE
flora_diversity = 4
fauna_types = list(
/mob/living/simple_animal/hostile/retaliate/royalcrab,
/mob/living/simple_animal/hostile/retaliate/jelly/alt,
/mob/living/simple_animal/hostile/retaliate/beast/shantak/alt,
/mob/living/simple_animal/hostile/leech
)
fauna_types = list(/mob/living/simple_animal/hostile/retaliate/royalcrab,
/mob/living/simple_animal/hostile/retaliate/jelly/alt,
/mob/living/simple_animal/hostile/retaliate/beast/shantak/alt,
/mob/living/simple_animal/hostile/leech)


/obj/effect/overmap/visitable/sector/exoplanet/shrouded/generate_atmosphere()
..()
if (atmosphere)
atmosphere.temperature = rand(T0C, T20C)
if(atmosphere)
atmosphere.temperature = T20C - rand(10, 20)
atmosphere.update_values()

/obj/effect/overmap/visitable/sector/exoplanet/shrouded/get_atmosphere_color()
var/air_color = ..()
return MixColors(COLOR_BLACK, air_color)
return COLOR_BLACK

/datum/random_map/noise/exoplanet/shrouded
descriptor = "shrouded exoplanet"
Expand All @@ -44,7 +41,7 @@
/datum/random_map/noise/exoplanet/shrouded/get_additional_spawns(value, turf/T)
..()

if (prob(0.1))
if(prob(0.1))
new/obj/structure/leech_spawner(T)

/area/exoplanet/shrouded
Expand Down
19 changes: 9 additions & 10 deletions code/modules/overmap/exoplanets/planet_types/snow.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,21 @@
map_generators = list(/datum/random_map/noise/exoplanet/snow, /datum/random_map/noise/ore/poor)
surface_color = "#e8faff"
water_color = "#b5dfeb"
habitability_weight = HABITABILITY_BAD
habitability_distribution = list(HABITABILITY_IDEAL = 30, HABITABILITY_OKAY = 50, HABITABILITY_BAD = 10)
has_trees = TRUE
flora_diversity = 4
fauna_types = list(
/mob/living/simple_animal/hostile/retaliate/beast/samak,
/mob/living/simple_animal/hostile/retaliate/beast/diyaab,
/mob/living/simple_animal/hostile/retaliate/beast/shantak
)
fauna_types = list(/mob/living/simple_animal/hostile/retaliate/beast/samak, /mob/living/simple_animal/hostile/retaliate/beast/diyaab, /mob/living/simple_animal/hostile/retaliate/beast/shantak)
megafauna_types = list(/mob/living/simple_animal/hostile/retaliate/giant_crab)

/obj/effect/overmap/visitable/sector/exoplanet/snow/generate_atmosphere()
..()
var/datum/species/H = all_species[SPECIES_HUMAN]
var/generator/new_temp = generator("num", H.cold_level_1 - 50, H.cold_level_3, NORMAL_RAND)
atmosphere.temperature = new_temp.Rand()
atmosphere.update_values()
if(atmosphere)
var/limit = 0
if(habitability_class <= HABITABILITY_OKAY)
var/datum/species/human/H = /datum/species/human
limit = initial(H.cold_level_1) + rand(1,10)
atmosphere.temperature = max(T0C - rand(10, 100), limit)
atmosphere.update_values()

/datum/random_map/noise/exoplanet/snow
descriptor = "snow exoplanet"
Expand Down
Loading

0 comments on commit 9a82abe

Please sign in to comment.