diff --git a/aurorastation.dme b/aurorastation.dme index b9a6d9d4518..af9a8d40cc6 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -61,6 +61,7 @@ #include "code\__defines\research.dm" #include "code\__defines\rust_g.dm" #include "code\__defines\shuttle.dm" +#include "code\__defines\space_sectors.dm" #include "code\__defines\spaceman_dmm.dm" #include "code\__defines\species.dm" #include "code\__defines\species_languages.dm" @@ -1349,6 +1350,8 @@ #include "code\modules\background\religion\tajara.dm" #include "code\modules\background\religion\unathi.dm" #include "code\modules\background\religion\vaurca.dm" +#include "code\modules\background\space_sectors\space_sector.dm" +#include "code\modules\background\space_sectors\tauceti.dm" #include "code\modules\battlemonsters\datum_core.dm" #include "code\modules\battlemonsters\datum_elements.dm" #include "code\modules\battlemonsters\datum_monsters.dm" diff --git a/code/__defines/space_sectors.dm b/code/__defines/space_sectors.dm new file mode 100644 index 00000000000..53f40130f0b --- /dev/null +++ b/code/__defines/space_sectors.dm @@ -0,0 +1,3 @@ +#define SECTOR_ROMANOVICH "Romanovich Cloud" +#define SECTOR_TAU_CETI "Tau Ceti" +#define SECTOR_CORP_ZONE "Corporate Reconstruction Zone" \ No newline at end of file diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 409884ea627..61f8493b1d8 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -321,6 +321,8 @@ var/list/gamemode_cache = list() var/lore_summary + var/current_space_sector + /datum/configuration/New() var/list/L = typesof(/datum/game_mode) - /datum/game_mode for (var/T in L) @@ -895,6 +897,9 @@ var/list/gamemode_cache = list() if("time_to_call_emergency_shuttle") config.time_to_call_emergency_shuttle = text2num(value) + if("current_space_sector") + config.current_space_sector = value + if("force_map") override_map = value diff --git a/code/controllers/subsystems/initialization/atlas.dm b/code/controllers/subsystems/initialization/atlas.dm index 951b619f8e8..cecc58f4d0a 100644 --- a/code/controllers/subsystems/initialization/atlas.dm +++ b/code/controllers/subsystems/initialization/atlas.dm @@ -19,6 +19,8 @@ var/datum/controller/subsystem/atlas/SSatlas var/list/list/connected_z_cache = list() var/z_levels = 0 // Each bit represents a connection between adjacent levels. So the first bit means levels 1 and 2 are connected. + var/datum/space_sector/current_sector + var/list/possible_sectors = list () /datum/controller/subsystem/atlas/stat_entry() ..("W:{X:[world.maxx] Y:[world.maxy] Z:[world.maxz]} ZL:[z_levels]") @@ -76,6 +78,27 @@ var/datum/controller/subsystem/atlas/SSatlas QDEL_NULL(maploader) + InitializeSectors() + + var/chosen_sector + var/using_sector_config = FALSE + + if(config.current_space_sector) + chosen_sector = config.current_space_sector + using_sector_config = TRUE + else + chosen_sector = current_map.default_sector + + var/datum/space_sector/selected_sector = SSatlas.possible_sectors[chosen_sector] + + if(!selected_sector) + if(using_sector_config) + log_debug("atlas: [chosen_sector] used in the config file is not a valid space sector") + current_sector = new /datum/space_sector/tau_ceti //if all fails, we go with tau ceti + log_debug("atlas: Unable to select [chosen_sector] as a valid space sector. Tau Ceti will be used instead.") + else + current_sector = selected_sector + ..() /datum/controller/subsystem/atlas/proc/load_map_directory(directory, overwrite_default_z = FALSE) @@ -164,6 +187,15 @@ var/datum/controller/subsystem/atlas/SSatlas var/datum/spawnpoint/S = new type spawn_locations[S.display_name] = S +/datum/controller/subsystem/atlas/proc/InitializeSectors() + for (var/type in subtypesof(/datum/space_sector)) + var/datum/space_sector/space_sector = new type() + + possible_sectors[space_sector.name] = space_sector + + if (!possible_sectors.len) + crash_with("No space sectors located in SSatlas.") + // Called when there's a fatal, unrecoverable error in mapload. This reboots the server. /world/proc/map_panic(reason) to_chat(world, "Fatal error during map setup, unable to continue! Server will reboot in 60 seconds.") @@ -185,10 +217,6 @@ var/datum/controller/subsystem/atlas/SSatlas world.name = sname world.log << "Set world.name to [sname]." -/proc/system_name() - ASSERT(current_map) - return current_map.system_name - /proc/commstation_name() ASSERT(current_map) return current_map.dock_name \ No newline at end of file diff --git a/code/controllers/subsystems/initialization/map_finalization.dm b/code/controllers/subsystems/initialization/map_finalization.dm index f30304dc96e..58140b3f20b 100644 --- a/code/controllers/subsystems/initialization/map_finalization.dm +++ b/code/controllers/subsystems/initialization/map_finalization.dm @@ -73,9 +73,9 @@ log_ss("map_finalization", "Error while creating away mission datum: [ec]") continue - if(length(am.valid_maps)) - if(!(current_map.name in am.valid_maps)) - log_ss("map_finalization", "[current_map.name] is not a valid map for [am.name]") + if(length(am.valid_sectors)) + if(!(SSatlas.current_sector.name in am.valid_sectors)) + log_ss("map_finalization", "[SSatlas.current_sector.name] is not a valid map for [am.name]") continue if(!am.validate_maps(folder)) diff --git a/code/controllers/subsystems/job.dm b/code/controllers/subsystems/job.dm index d3b16cc4522..6201eddf0fe 100644 --- a/code/controllers/subsystems/job.dm +++ b/code/controllers/subsystems/job.dm @@ -309,6 +309,11 @@ Debug("ER/([H]): Entry, joined_late=[joined_late],megavend=[megavend].") + if(SSatlas.current_sector.description) + var/sector_desc = "
Current Sector: [SSatlas.current_sector.name]!
" + sector_desc += "[SSatlas.current_sector.description]
" + to_chat(H, sector_desc) + var/datum/job/job = GetJob(rank) var/list/spawn_in_storage = list() diff --git a/code/controllers/subsystems/responseteam.dm b/code/controllers/subsystems/responseteam.dm index b1c5653bd81..3c23896b591 100644 --- a/code/controllers/subsystems/responseteam.dm +++ b/code/controllers/subsystems/responseteam.dm @@ -26,7 +26,7 @@ for(var/team in all_teams) CHECK_TICK var/datum/responseteam/ert = new team - if(!ert.admin) + if(SSatlas.current_sector.name in ert.possible_space_sector) available_teams += ert all_ert_teams += ert diff --git a/code/controllers/subsystems/trade.dm b/code/controllers/subsystems/trade.dm index 8c3d8f17acc..fa1488d61d5 100644 --- a/code/controllers/subsystems/trade.dm +++ b/code/controllers/subsystems/trade.dm @@ -23,6 +23,12 @@ if(!T.tick()) traders -= T qdel(T) + + if(!T.system_allowed()) + traders -= T + qdel(T) + generateTrader() + if(prob(100-traders.len*10)) generateTrader() diff --git a/code/datums/ert/nanotrasen.dm b/code/datums/ert/nanotrasen.dm index 4c7f59841d7..784c4e19b55 100644 --- a/code/datums/ert/nanotrasen.dm +++ b/code/datums/ert/nanotrasen.dm @@ -2,9 +2,9 @@ name = "Nanotrasen ERT" chance = 20 spawner = /datum/ghostspawner/human/ert/nanotrasen + possible_space_sector = list(SECTOR_ROMANOVICH, SECTOR_TAU_CETI) /datum/responseteam/deathsquad name = "Nanotrasen Asset Protection" spawner = /datum/ghostspawner/human/ert/deathsquad - admin = TRUE chance = 1 \ No newline at end of file diff --git a/code/datums/ert/outsider.dm b/code/datums/ert/outsider.dm index 680f4d308c2..9054356bcfa 100644 --- a/code/datums/ert/outsider.dm +++ b/code/datums/ert/outsider.dm @@ -3,33 +3,35 @@ chance = 15 spawner = /datum/ghostspawner/human/ert/mercenary equipment_map = /datum/map_template/distress_freelancers + possible_space_sector = list(SECTOR_ROMANOVICH, SECTOR_TAU_CETI, SECTOR_CORP_ZONE) /datum/responseteam/kataphracts name = "Kataphracts" chance = 15 spawner = /datum/ghostspawner/human/ert/kataphract equipment_map = /datum/map_template/distress_kataphract + possible_space_sector = list(SECTOR_ROMANOVICH, SECTOR_CORP_ZONE) /datum/responseteam/iac name = "Interstellar Aid Corps" chance = 1 spawner = /datum/ghostspawner/human/ert/iac equipment_map = /datum/map_template/distress_iac - admin = TRUE /datum/responseteam/ap_eridani name = "Eridani Asset Protection Team" chance = 15 spawner = /datum/ghostspawner/human/ert/ap_eridani equipment_map = /datum/map_template/distress_iac + possible_space_sector = list(SECTOR_ROMANOVICH, SECTOR_TAU_CETI, SECTOR_CORP_ZONE) /datum/responseteam/fsf name = "Free Solarian Fleets Fireteam" chance = 15 spawner = /datum/ghostspawner/human/ert/fsf + possible_space_sector = list(SECTOR_ROMANOVICH, SECTOR_CORP_ZONE) /datum/responseteam/syndicate name = "Syndicate Commandos" spawner = /datum/ghostspawner/human/ert/commando - admin = TRUE chance = 1 diff --git a/code/datums/ert/responseteam.dm b/code/datums/ert/responseteam.dm index f27569dc869..cf82dd7be75 100644 --- a/code/datums/ert/responseteam.dm +++ b/code/datums/ert/responseteam.dm @@ -2,5 +2,5 @@ var/name = "Default Team" //ERT name. var/chance //Probability to get picked. var/datum/ghostspawner/human/ert/spawner //This response type's BASE spawner type. - var/admin = FALSE // if this is a special team that is not supossed to show up in regular rounds + var/list/possible_space_sector = list() //Which space sectors this ert can spawn, leave empty for admin only erts var/datum/map_template/equipment_map // if this team spawns extra equipment diff --git a/code/datums/ert/tcfl.dm b/code/datums/ert/tcfl.dm index 17c7effc012..0d191effe8d 100644 --- a/code/datums/ert/tcfl.dm +++ b/code/datums/ert/tcfl.dm @@ -2,3 +2,4 @@ name = "Tau Ceti Foreign Legion" chance = 20 spawner = /datum/ghostspawner/human/ert/tcfl + possible_space_sector = list(SECTOR_ROMANOVICH, SECTOR_TAU_CETI, SECTOR_CORP_ZONE) \ No newline at end of file diff --git a/code/datums/helper_datums/away_mission.dm b/code/datums/helper_datums/away_mission.dm index c0006563a7b..0d8f9fe2717 100644 --- a/code/datums/helper_datums/away_mission.dm +++ b/code/datums/helper_datums/away_mission.dm @@ -3,7 +3,7 @@ var/weight = 1 var/autoselect = TRUE var/list/map_files = null - var/list/valid_maps = null + var/list/valid_sectors = null var/list/characteristics = null var/base_dir = null @@ -13,7 +13,7 @@ weight = config["weight"] autoselect = config["autoselect"] map_files = config["map_files"] - valid_maps = config["valid_maps"] + valid_sectors = config["valid_sectors"] characteristics = config["characteristics"] base_dir = i_base_dir diff --git a/code/datums/trading/trade.dm b/code/datums/trading/trade.dm index 1d64855d7ae..c8be3876119 100644 --- a/code/datums/trading/trade.dm +++ b/code/datums/trading/trade.dm @@ -12,7 +12,7 @@ var/list/possible_trading_items //List of all possible trading items. Structure is (type = mode) var/list/trading_items = list() //What items they are currently trading away. var/list/blacklisted_trade_items = list(/mob/living/carbon/human) - //Things they will automatically refuse + var/list/allowed_space_sectors = list(SECTOR_ROMANOVICH, SECTOR_TAU_CETI, SECTOR_CORP_ZONE) //which sector this merchant can show up //Things they will automatically refuse var/list/speech = list() //The list of all their replies and messages. Structure is (id = talk) /*SPEECH IDS: @@ -258,4 +258,10 @@ qdel(offer) /datum/trader/proc/bribe_to_stay_longer(var/amt) - return get_response("bribe_refusal", "How about... no?") \ No newline at end of file + return get_response("bribe_refusal", "How about... no?") + +/datum/trader/proc/system_allowed() + if(SSatlas.current_sector.name in allowed_space_sectors) + return TRUE + else + return FALSE diff --git a/code/datums/trading/unique.dm b/code/datums/trading/unique.dm index f8f90c028bd..eb628e80e03 100644 --- a/code/datums/trading/unique.dm +++ b/code/datums/trading/unique.dm @@ -28,6 +28,7 @@ /datum/trader/ship/unique/syndicate name = "Cyndie Kate" origin = "Cloaked ship" + allowed_space_sectors = list(SECTOR_ROMANOVICH, SECTOR_CORP_ZONE) possible_wanted_items = list ( /obj/item/gun/energy/captain = TRADER_THIS_TYPE, @@ -78,6 +79,7 @@ /datum/trader/ship/unique/severance name = "Unknown" origin = "SGS Severance" + allowed_space_sectors = list(SECTOR_ROMANOVICH, SECTOR_CORP_ZONE) possible_wanted_items = list( /obj/item/reagent_containers/food/snacks/human = TRADER_SUBTYPES_ONLY, diff --git a/code/datums/trading/weaponry.dm b/code/datums/trading/weaponry.dm index ea7c2c957be..c351a9ded89 100644 --- a/code/datums/trading/weaponry.dm +++ b/code/datums/trading/weaponry.dm @@ -98,6 +98,8 @@ "insult_bad" = "Rrrracist!" ) + allowed_space_sectors = list(SECTOR_ROMANOVICH, SECTOR_CORP_ZONE) + possible_trading_items = list( /obj/item/gun/projectile/shotgun/pump/rifle = TRADER_ALL, /obj/item/gun/projectile/dragunov = TRADER_THIS_TYPE, diff --git a/code/modules/background/space_sectors/space_sector.dm b/code/modules/background/space_sectors/space_sector.dm new file mode 100644 index 00000000000..0619135f087 --- /dev/null +++ b/code/modules/background/space_sectors/space_sector.dm @@ -0,0 +1,4 @@ +/datum/space_sector + var/name + var/description + var/list/possible_erts = list() \ No newline at end of file diff --git a/code/modules/background/space_sectors/tauceti.dm b/code/modules/background/space_sectors/tauceti.dm new file mode 100644 index 00000000000..d6c41b3b516 --- /dev/null +++ b/code/modules/background/space_sectors/tauceti.dm @@ -0,0 +1,19 @@ +/datum/space_sector/tau_ceti + name = SECTOR_TAU_CETI + description = "Tau Ceti is a system located in close proximity of Sol, and serves as the main base of operation for the megacorporation NanoTrasen. Tau Ceti is governed by the \ + Republic of Biesel, a young Republic that became independent of the economically troubled Sol Alliance in 2452 due to heavy pressure by Nanotrasen. There is still resentment in \ + the Sol Alliance over the loss of such a wealthy system, while Nanotrasen continues to have a heavy hand in all levels of Tau Ceti." + +/datum/space_sector/tau_ceti/romanovich + name = SECTOR_ROMANOVICH + description = "The Romanovich Cloud is a shell of icy, rocky and metallic bodies that orbit very distant Tau Ceti, past even the Dust Belt. Rich in deposits of precious and\ + semi-precious metals as well as radioactive elements, the Romanovich Cloud is the source of nearly all the raw materials used within Tau Ceti.The cloud is also one of the few\ + sources of Phoron, a volatile but highly-sought after compound, known for its uses in the biomedical and energy industries. Most of the sources of Phoron within the Romanovich \ + Cloud are under control of NanoTrasen, which has consequently established many high-tech research facilities in the area in the past few years." + +/datum/space_sector/tau_ceti/corp_zone + name = SECTOR_CORP_ZONE + description = "Formerly Solarian space, the Corporate Reconstruction Zone is the name for all systems occupied by the Republic of Biesel that are not within Tau Ceti's gravity well. \ + The Zone, or the CRZ, is an area of instability and logistical chaos where once-Alliance colonies exist in relative peace compared to the adjacent Human Wildlands. This is owed to \ + two factors: the presence of the lingering Stellar Corporate Conglomerate, and the federal authority of the Republic of Biesel backing them up. Warlords and major antagonistic \ + factions (to Biesel) generally refrain from entering these territories to avoid the ire of the Conglomerate, much less the repercussions of engaging its allies." diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index cee5462ede1..a80159f0dc4 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -843,6 +843,7 @@ if(statpanel("Status") && SSticker.current_state != GAME_STATE_PREGAME) stat("Game ID", game_id) stat("Map", current_map.full_name) + stat("Current Space Sector", SSatlas.current_sector.name) stat("Station Time", worldtime2text()) stat("Round Duration", get_round_duration_formatted()) stat("Last Transfer Vote", SSvote.last_transfer_vote ? time2text(SSvote.last_transfer_vote, "hh:mm") : "Never") @@ -928,7 +929,7 @@ lying = 1 canmove = 0 pixel_y = V.mob_offset_y - 5 - else + else if(buckled_to.buckle_lying != -1) lying = buckled_to.buckle_lying canmove = 1 pixel_y = V.mob_offset_y diff --git a/config/example/config.txt b/config/example/config.txt index 0209196b205..618a508d01a 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -539,6 +539,9 @@ FORCE_MAP runtime # Reminds ticket handlers/all admin staff of not-closed tickets after this many SECONDS. #TICKET_REMINDER_PERIOD 600 +# What sector the station/station is currently on. Check _defines/space_sectors.dm for possible options +CURRENT_SPACE_SECTOR Romanovich Cloud + # If using TGS, counts how many regularly TGS hard restarts the server process. # -1 - never do this. # 0 - do this after every round. diff --git a/html/changelogs/alberyk-sector.yml b/html/changelogs/alberyk-sector.yml new file mode 100644 index 00000000000..1d1612ad825 --- /dev/null +++ b/html/changelogs/alberyk-sector.yml @@ -0,0 +1,6 @@ +author: Alberyk + +delete-after: True + +changes: + - rscadd: "Added a space sector system framework for use in the future." diff --git a/maps/_common/mapsystem/map.dm b/maps/_common/mapsystem/map.dm index 69654fc9bc5..85e58b1fda5 100644 --- a/maps/_common/mapsystem/map.dm +++ b/maps/_common/mapsystem/map.dm @@ -35,7 +35,6 @@ var/boss_short = "Cap'" var/company_name = "BadMan" var/company_short = "BM" - var/system_name = "Uncharted System" var/command_spawn_enabled = FALSE var/command_spawn_message = "Someone didn't fill this in." @@ -74,6 +73,7 @@ var/overmap_z = 0 //If 0 will generate overmap zlevel on init. Otherwise will populate the zlevel provided. var/overmap_event_areas = 0 //How many event "clouds" will be generated var/list/map_shuttles = list() // A list of all our shuttles. + var/default_sector = SECTOR_ROMANOVICH //What is the default space sector for this map /datum/map/New() if(!map_levels) diff --git a/maps/aurora/code/aurora.dm b/maps/aurora/code/aurora.dm index ebcf922d0d6..35c9521cf79 100644 --- a/maps/aurora/code/aurora.dm +++ b/maps/aurora/code/aurora.dm @@ -35,7 +35,6 @@ boss_short = "CentCom" company_name = "NanoTrasen" company_short = "NT" - system_name = "Tau Ceti" command_spawn_enabled = TRUE command_spawn_message = "Welcome to the Odin! Simply proceed down and to the right to board the shuttle to your workplace!" diff --git a/maps/exodus/code/exodus.dm b/maps/exodus/code/exodus.dm index cf63b8789ad..0ab1cada147 100644 --- a/maps/exodus/code/exodus.dm +++ b/maps/exodus/code/exodus.dm @@ -15,7 +15,6 @@ boss_short = "CentCom" company_name = "NanoTrasen" company_short = "NT" - system_name = "Tau Ceti" station_networks = list( NETWORK_CIVILIAN_EAST, diff --git a/maps/runtime/code/runtime.dm b/maps/runtime/code/runtime.dm index 89a5ad0e6c9..62305ecf567 100644 --- a/maps/runtime/code/runtime.dm +++ b/maps/runtime/code/runtime.dm @@ -18,7 +18,6 @@ boss_short = "Coders" company_name = "BanoTarsen" company_short = "BT" - system_name = "runtime.dm" station_networks = list( NETWORK_CIVILIAN_MAIN,