Skip to content

Commit

Permalink
Feat: Station fluff (ss220club#916)
Browse files Browse the repository at this point in the history
## Что этот PR делает

Добавляет возможность добавить картам станции определенное статическое
имя и звук приветствия.
Добавляет так же возможно спавнить капитана без station_charte.
Добавляет это всё для Cyberiad

## Почему это хорошо для игры

Важно для погружения в игру, вместо всяких случайных непонятных имен.
А звук просто крутой.

## Тестирование

Протестил. Всё работает.
  • Loading branch information
Gaxeer authored Dec 25, 2024
1 parent 2d40450 commit f1d1b11
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 4 deletions.
5 changes: 5 additions & 0 deletions _maps/cyberiad.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"map_name": "Cyberiad",
"map_path": "map_files/Cyberiad",
"map_file": "Cyberiad.dmm",
"fluff_name": "ИСН Кибериада",
"welcome_sound_override": "modular_bandastation/aesthetics_sounds/sound/welcome_sounds/welcome_cyberiad.ogg",
"shuttles": {
"cargo": "cargo_box",
"ferry": "ferry_fancy",
Expand All @@ -22,6 +24,9 @@
"Cook": {
"additional_cqc_areas": ["/area/station/service/bar", "/area/station/commons/lounge", "/area/station/service/kitchen"]
},
"Captain": {
"no_charter": 1
},
"Nanotrasen Representative": {
"spawn_positions": 1
},
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/names.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ GLOBAL_VAR(command_name)
/proc/station_name()
if(!GLOB.station_name)
var/newname
var/config_station_name = CONFIG_GET(string/stationname)
var/config_station_name = SSmapping.current_map?.fluff_name || CONFIG_GET(string/stationname) // BANDASTATION ADDITION - Station Fluff
if(config_station_name)
newname = config_station_name
else
Expand Down
3 changes: 2 additions & 1 deletion code/controllers/subsystem/events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ GLOBAL_LIST(holidays)
if(GLOB.holidays.len)
shuffle_inplace(GLOB.holidays)
// regenerate station name because holiday prefixes.
set_station_name(new_station_name())
if(isnull(SSmapping.current_map?.fluff_name)) // BANDASTATION ADDITION - Station Fluff
set_station_name(new_station_name())
world.update_status()

return TRUE
2 changes: 1 addition & 1 deletion code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ SUBSYSTEM_DEF(ticker)
INVOKE_ASYNC(SSdbcore, TYPE_PROC_REF(/datum/controller/subsystem/dbcore,SetRoundStart))

to_chat(world, span_notice(span_bold("Welcome to [station_name()], enjoy your stay!")))
SEND_SOUND(world, sound(SSstation.announcer.get_rand_welcome_sound()))
SEND_SOUND(world, sound(SSmapping.current_map?.welcome_sound_override || SSstation.announcer.get_rand_welcome_sound()))

current_state = GAME_STATE_PLAYING
Master.SetRunLevel(RUNLEVEL_GAME)
Expand Down
20 changes: 19 additions & 1 deletion code/datums/map_config.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
var/space_empty_levels = DEFAULT_SPACE_EMPTY_LEVELS
/// Boolean that tells us if this is a planetary station. (like IceBoxStation)
var/planetary = FALSE

///The type of mining Z-level that should be loaded.
var/minetype = "lavaland"
///If no minetype is set, this will be the blacklist file used
Expand All @@ -49,6 +49,14 @@
/// Boolean that tells SSmapping to load all away missions in the codebase.
var/load_all_away_missions = FALSE

// BANDASTATION ADDITION START - Station Fluff
/// This name will override all other station names, like holiday or randomly generated.
/// Station name change still will work.
var/fluff_name = null
/// Welcome sound that will play on round start instead of the announcer's one.
var/sound/welcome_sound_override = null
// BANDASTATION ADDITION END - Station Fluff

/**
* Proc that simply loads the default map config, which should always be functional.
*/
Expand Down Expand Up @@ -191,6 +199,16 @@
if ("load_all_away_missions" in json)
load_all_away_missions = json["load_all_away_missions"]

// BANDASTATION ADDITION START - Station Fluff
if ("fluff_name" in json)
fluff_name = json["fluff_name"]
if ("welcome_sound_override" in json)
var/file_path = json["welcome_sound_override"]
if(!fexists(file_path))
log_world("Welcome sound ([file_path]) does not exist!")
else
welcome_sound_override = file(file_path)
// BANDASTATION ADDITION END - Station Fluff
allow_custom_shuttles = json["allow_custom_shuttles"] != FALSE

if ("job_changes" in json)
Expand Down
5 changes: 5 additions & 0 deletions code/modules/jobs/job_types/captain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@

/datum/outfit/job/captain/pre_equip(mob/living/carbon/human/H, visuals_only)
. = ..()
// BANDASTATION ADDITION START - Station Fluff
if(CHECK_MAP_JOB_CHANGE(JOB_CAPTAIN, "no_charter"))
backpack_contents -= /obj/item/station_charter
return
// BANDASTATION ADDITION END - Station Fluff
special_charter = CHECK_MAP_JOB_CHANGE(JOB_CAPTAIN, "special_charter")
if(!special_charter)
return
Expand Down
Binary file not shown.

0 comments on commit f1d1b11

Please sign in to comment.