Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 0 additions & 4 deletions _maps/shuttles/independent/independent_dwayne_anomaly.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,6 @@
/obj/item/clothing/under/utility,
/obj/item/clothing/under/utility/skirt,
/obj/item/clothing/under/utility/skirt,
/obj/item/clothing/shoes/workboots/mining,
/obj/item/clothing/shoes/workboots/mining,
/obj/item/clothing/shoes/workboots,
/obj/item/clothing/shoes/workboots,
/obj/item/clothing/suit/jacket/leather/duster,
/obj/item/clothing/suit/jacket/leather/duster,
/obj/item/clothing/gloves/fingerless,
Expand Down
8 changes: 8 additions & 0 deletions code/__DEFINES/overmap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@

#define DYNAMIC_WORLD_TEST "test"

#define DYNAMIC_WORLD_JUNGLE_INFESTED "jungle_infested"

//Possible ship states
#define OVERMAP_SHIP_IDLE "idle"
#define OVERMAP_SHIP_FLYING "flying"
Expand Down Expand Up @@ -113,3 +115,9 @@
#define SHIPMODULE_HELMCONSOLE "helm_console"
#define SHIPMODULE_TRANSPONDER "transponder"

//Sector types
#define GREEN_STAR "green star" //Starter area
#define YELLOW_STAR "yellow star" //Mid, controlled area
#define RED_STAR "red star" //Hard, contested area
#define BLACK_ORBIT "black orbit" //Neutral, ffa
#define MIDNIGHT_SUN "midnight sun" //Enemy territory, such as pirate bases or infested systems
21 changes: 18 additions & 3 deletions code/controllers/subsystem/missions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ SUBSYSTEM_DEF(missions)

// should probably come up with a better solution for this
// hierarchical weighting? would need to distinguish between "real" and "fake" missions
/datum/controller/subsystem/missions/proc/get_weighted_mission_type()
var/static/list/weighted_missions
/datum/controller/subsystem/missions/proc/get_weighted_mission_type(list/overmaptally, list/basemissions)
/*var/static/list/weighted_missions
if(!weighted_missions)
weighted_missions = list()
var/list/mission_types = subtypesof(/datum/mission)
Expand All @@ -56,7 +56,22 @@ SUBSYSTEM_DEF(missions)
continue
if(mis_type::weight > 0)
weighted_missions[mis_type] = mis_type::weight
return pickweight_float(weighted_missions)
return pickweight_float(weighted_missions)*/
var/list/doablemissionlist = list()
for(var/opmission in basemissions)
if(ispath(opmission, /datum/mission/outpost/survey))
var/datum/mission/outpost/survey/sv = new opmission //This thing is choking on cock and wasting precious processing power and memory, but thankfully it is only called sparesely and I have no better idea how to do this...
for(var/ptvar in sv.target_planets)
if(overmaptally[ptvar])
doablemissionlist[opmission] = basemissions[opmission]
else if(ispath(opmission, /datum/mission/outpost/research))
var/datum/mission/outpost/research/rsc = opmission
if(overmaptally[rsc.objective_type])
doablemissionlist[opmission] = basemissions[opmission]
else if(ispath(opmission, /datum/mission/outpost/drill))
doablemissionlist[opmission] = basemissions[opmission]
return pickweight_float(doablemissionlist)


/datum/controller/subsystem/missions/proc/get_researcher_name()
var/group = pick(list(
Expand Down
136 changes: 133 additions & 3 deletions code/controllers/subsystem/overmap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ SUBSYSTEM_DEF(overmap)
dynamic_encounters = list()
events = list()

default_system = create_new_star_system(new /datum/overmap_star_system/shiptest)
//default_system = create_new_star_system(new /datum/overmap_star_system/shiptest)
default_system = create_new_star_system(new /datum/overmap_star_system/greenstar)
create_new_star_system(new /datum/overmap_star_system/yellowstar)
create_new_star_system(new /datum/overmap_star_system/redstar)
return ..()

/datum/controller/subsystem/overmap/proc/spawn_new_star_system(datum/overmap_star_system/system_to_spawn=/datum/overmap_star_system)
Expand Down Expand Up @@ -282,6 +285,8 @@ SUBSYSTEM_DEF(overmap)
///Type of the star
var/datum/overmap/star/startype

var/sector_type = YELLOW_STAR

///Defines which generator to use for the overmap
var/generator_type
///List of all overmap objects in the star system.
Expand Down Expand Up @@ -345,6 +350,10 @@ SUBSYSTEM_DEF(overmap)
//can our pallete be selected randomly roundstart? set to no for subtypes or if you dont change the pallete
var/can_be_selected_randomly = TRUE

var/rewardmult = 1

var/list/mission_catalogue = list()

COOLDOWN_DECLARE(dynamic_despawn_cooldown)

/datum/overmap_star_system/New(generate_now=TRUE)
Expand All @@ -355,7 +364,7 @@ SUBSYSTEM_DEF(overmap)
if(!starname)
starname = gen_star_name() //we reuse this for the name of the star if name isnt defined, like a uncharted sector or something
if(!name)
name = starname //we then give it here
name = starname + " (" + sector_type +")"//we then give it here
overmap_objects = list()
controlled_ships = list()
outposts = list()
Expand Down Expand Up @@ -593,7 +602,7 @@ SUBSYSTEM_DEF(overmap)
)

vlevel.reserve_margin(QUADRANT_SIZE_BORDER)

mapgen.difficulty = dynamic_datum.difficulty
mapgen.pre_generation(dynamic_datum)

// the generataed turfs start unpopulated (i.e. no flora / fauna / etc.). we add that AFTER placing the ruin, relying on the ruin's areas to determine what gets populated
Expand Down Expand Up @@ -918,6 +927,49 @@ SUBSYSTEM_DEF(overmap)

return list("x" = edge_x, "y" = edge_y)

/datum/overmap_star_system/proc/get_overmap_planet_types()
var/list/tally = list()
for(var/overmap_object in overmap_objects)
if(istype(overmap_object,/datum/overmap/dynamic))
var/datum/overmap/dynamic/d = overmap_object
if(d.planet)
if(tally[d.planet.type])
tally[d.planet.type] += 1
else
tally[d.planet.type] = 1
return tally

/datum/overmap_star_system/proc/get_overmap_planet_drillable_types()
var/list/tally = list()
for(var/overmap_object in overmap_objects)
if(istype(overmap_object,/datum/overmap/dynamic))
var/datum/overmap/dynamic/d = overmap_object
if(d.planet && d.planet.vein)
if(tally[d.planet.type])
tally[d.planet.type] += 1
else
tally[d.planet.type] = 1
return tally

/datum/overmap_star_system/proc/get_overmap_object_types()
var/list/tally = list()
for(var/overmap_object in overmap_objects)
if(istype(overmap_object,/datum/overmap/dynamic))
var/datum/overmap/dynamic/d = overmap_object
if(d.planet)
if(tally[d.planet.type])
tally[d.planet.type] += 1
else
tally[d.planet.type] = 1
else if(istype(overmap_object, /datum/overmap/event))
var/datum/overmap/event/e = overmap_object
if(tally[e.basetype])
tally[e.basetype] += 1
else
tally[e.basetype] = 1
return tally


//meant to be a duplicate of default to be selectable in the spawn menu
/datum/overmap_star_system/wilderness
can_be_selected_randomly = FALSE
Expand Down Expand Up @@ -1120,3 +1172,81 @@ SUBSYSTEM_DEF(overmap)
The [span_notice("MODIF. OVERMAP")] tool is similar in usuage to BUILD ADV but to manipulate the overmap only.
"}
return ..()

/datum/overmap_star_system/greenstar

has_outpost = TRUE
encounters_refresh = TRUE
//main colors, used for dockable terrestrials, and background
secondary_color = "#1d4627"
overmap_icon_state = "overmap"
sector_type = GREEN_STAR
dynamic_probabilities = list(
DYNAMIC_WORLD_BEACHPLANET = 50,
DYNAMIC_WORLD_DESERT = 5,
DYNAMIC_WORLD_JUNGLE = 10,
DYNAMIC_WORLD_MOON = 20,
DYNAMIC_WORLD_ASTEROID = 20
)
mission_catalogue = list(\
/datum/mission/outpost/survey/garden = 20,
/datum/mission/outpost/research/meteor = 5,
/datum/mission/outpost/research/carp = 5,
/datum/mission/outpost/research/dust = 5,
/datum/mission/outpost/research/radstorm = 5,
/datum/mission/outpost/research/ion = 5,
/datum/mission/outpost/research/flare = 5,
/datum/mission/outpost/drill = 10,
/datum/mission/outpost/drill/classtwo = 5,
/datum/mission/outpost/drill/classthree = 1
)

rewardmult = 0.5


/datum/overmap_star_system/yellowstar

has_outpost = TRUE
secondary_color = "#524f28"
overmap_icon_state = "overmap"
sector_type = YELLOW_STAR
dynamic_probabilities = list(
DYNAMIC_WORLD_WASTEPLANET = 10,
DYNAMIC_WORLD_DESERT = 20,
DYNAMIC_WORLD_JUNGLE = 5,
DYNAMIC_WORLD_LAVA = 20,
DYNAMIC_WORLD_SAND = 20,
DYNAMIC_WORLD_ROCKPLANET = 5,
DYNAMIC_WORLD_ICE = 20,
DYNAMIC_WORLD_MOON = 20,
DYNAMIC_WORLD_ASTEROID = 20,
DYNAMIC_WORLD_SPACERUIN = 20
)
mission_catalogue = list(\
/datum/mission/outpost/survey/garden/waste = 10,
/datum/mission/outpost/survey/garden/ice = 10,
/datum/mission/outpost/survey/garden/arid = 10,
/datum/mission/outpost/drill = 10,
/datum/mission/outpost/drill/classtwo = 30,
/datum/mission/outpost/drill/classthree = 10
)
rewardmult = 1

/datum/overmap_star_system/redstar
has_outpost = TRUE
secondary_color = "#522828"
overmap_icon_state = "overmap"
sector_type = RED_STAR
dynamic_probabilities = list(
DYNAMIC_WORLD_WASTEPLANET = 50,
DYNAMIC_WORLD_LAVA = 50,
DYNAMIC_WORLD_ICE = 50,
DYNAMIC_WORLD_JUNGLE_INFESTED = 50,
DYNAMIC_WORLD_SPACERUIN = 40
)
mission_catalogue = list(\
/datum/mission/outpost/drill = 5,
/datum/mission/outpost/drill/classtwo = 10,
/datum/mission/outpost/drill/classthree = 50
)
rewardmult = 2
8 changes: 4 additions & 4 deletions code/datums/anomaly_loadout/anomaly_loadouts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,10 @@
"price" = 600,
"faction" = FALSE,
)
GLOB.anomaly_loadout_utility_indie[/obj/item/storage/box/emptysandbags] = list(
"name" = "box of empty sandbags",
"desc" = "Fortifications on a budget",
"price" = 150,
GLOB.anomaly_loadout_utility_indie[/obj/item/stack/sandbags_empty/full] = list(
"name" = "50 empty sandbags",
"desc" = "Fortifications on a budget. Sand sold seperately. Can also be filled with snow!",
"price" = 100,
"faction" = FALSE,
)
GLOB.anomaly_loadout_utility_indie[/obj/item/grenade/smokebomb] = list(
Expand Down
3 changes: 3 additions & 0 deletions code/datums/mapgen/_MapGenerator.dm
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
/// Management class used to handle successive calls used to generate a list of turfs.
/datum/map_generator
var/difficulty = 1

/// Gets the overmap object this is tied to and do checks before generating
/datum/map_generator/proc/pre_generation(datum/overmap/our_planet)
var/datum/overmap/dynamic/actual_our_planet = our_planet
difficulty = actual_our_planet.difficulty
return

/// Goes through the planet's turfs again, for touchups or more importantly, greebles.
Expand Down
7 changes: 5 additions & 2 deletions code/datums/mapgen/_biome.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
/// The features and creatures compare against and add to the lists passed to determine
/// if they can spawn at the tested turf. This method of checking reduces the amount of
/// time spent populating a planet.
/datum/biome/proc/populate_turf(turf/gen_turf, list/feature_list, list/mob_list)
/datum/biome/proc/populate_turf(turf/gen_turf, list/feature_list, list/mob_list, difficultymod)

if(isclosedturf(gen_turf))
return
Expand Down Expand Up @@ -98,12 +98,15 @@

if(can_spawn)
spawned_feature = new feature_type(open_turf)
if(istype(spawned_feature, /obj/structure/vein))
var/obj/structure/vein/v = spawned_feature
v.difficultymod = difficultymod
// insert at the head of the list, so the most recent features get checked first
feature_list.Insert(1, spawned_feature)
open_turf.flags_1 |= NO_LAVA_GEN_1

//MOB SPAWNING HERE
if(length(mob_spawn_list_expanded) && !spawned_flora && !spawned_feature && prob(mob_spawn_chance) && (a_flags & MOB_SPAWN_ALLOWED))
if(length(mob_spawn_list_expanded) && !spawned_flora && !spawned_feature && prob(mob_spawn_chance*difficultymod) && (a_flags & MOB_SPAWN_ALLOWED))
var/atom/picked_mob = pick(mob_spawn_list_expanded)

var/can_spawn = TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/datums/mapgen/planetary/AsteroidGenerator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
return

mountain_height = nearby_event.mountain_height_override
return TRUE
difficulty = 1

/datum/biome/asteroid
open_turf_types = list(
Expand Down
2 changes: 1 addition & 1 deletion code/datums/mapgen/planetary/JungleGenerator.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/datum/map_generator/planet_generator/jungle
perlin_zoom = 65
mountain_height = 0.85
mountain_height = 0.60

primary_area_type = /area/overmap_encounter/planetoid/jungle

Expand Down
Loading