Where No Spaceman Has Gone Before: a space sector system (#11801)

This commit is contained in:
Alberyk
2021-05-31 00:32:07 +02:00
committed by GitHub
parent c40366dcf2
commit da4f065701
25 changed files with 114 additions and 21 deletions
+3
View File
@@ -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"
+3
View File
@@ -0,0 +1,3 @@
#define SECTOR_ROMANOVICH "Romanovich Cloud"
#define SECTOR_TAU_CETI "Tau Ceti"
#define SECTOR_CORP_ZONE "Corporate Reconstruction Zone"
+5
View File
@@ -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
@@ -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, "<span class='danger'>Fatal error during map setup, unable to continue! Server will reboot in 60 seconds.</span>")
@@ -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
@@ -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))
+5
View File
@@ -309,6 +309,11 @@
Debug("ER/([H]): Entry, joined_late=[joined_late],megavend=[megavend].")
if(SSatlas.current_sector.description)
var/sector_desc = "<hr><div align='center'><hr1><B>Current Sector: [SSatlas.current_sector.name]!</B></hr1><br>"
sector_desc += "<i>[SSatlas.current_sector.description]</i><hr></div>"
to_chat(H, sector_desc)
var/datum/job/job = GetJob(rank)
var/list/spawn_in_storage = list()
+1 -1
View File
@@ -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
+6
View File
@@ -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()
+1 -1
View File
@@ -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
+4 -2
View File
@@ -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
+1 -1
View File
@@ -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
+1
View File
@@ -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)
+2 -2
View File
@@ -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
+8 -2
View File
@@ -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?")
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
+2
View File
@@ -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,
+2
View File
@@ -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,
@@ -0,0 +1,4 @@
/datum/space_sector
var/name
var/description
var/list/possible_erts = list()
@@ -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."
+2 -1
View File
@@ -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
+3
View File
@@ -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.
+6
View File
@@ -0,0 +1,6 @@
author: Alberyk
delete-after: True
changes:
- rscadd: "Added a space sector system framework for use in the future."
+1 -1
View File
@@ -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)
-1
View File
@@ -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!"
-1
View File
@@ -15,7 +15,6 @@
boss_short = "CentCom"
company_name = "NanoTrasen"
company_short = "NT"
system_name = "Tau Ceti"
station_networks = list(
NETWORK_CIVILIAN_EAST,
-1
View File
@@ -18,7 +18,6 @@
boss_short = "Coders"
company_name = "BanoTarsen"
company_short = "BT"
system_name = "runtime.dm"
station_networks = list(
NETWORK_CIVILIAN_MAIN,