mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-01 12:31:32 +00:00
About The Pull Request Converts every single usage of playsound's vary parameter to use the boolean define instead of 1 or 0. I'm tired of people copypasting the incorrect usage. Also changes a couple of places where a list was picked from instead of using get_sfx internal calls This was done via regex: (playsound\(.+,.+,.+, ?)1( ?\)| ?,.+\)) to match 1 (playsound\(.+,.+,.+, ?)0( ?\)| ?,.+\)) to match 0 full sed commands: /(playsound\(.+,.+,.+, ?)1( ?\)| ?,.+\))/\1TRUE\2/ 1 to TRUE /(playsound\(.+,.+,.+, ?)0( ?\)| ?,.+\))/\1FALSE\2/ 0 to FALSE I'm not very good with regex and these could probably be optimized, but they worked. Why It's Good For The Game Code usability
44 lines
1.4 KiB
Plaintext
44 lines
1.4 KiB
Plaintext
/datum/round_event_control/nightmare
|
|
name = "Spawn Nightmare"
|
|
typepath = /datum/round_event/ghost_role/nightmare
|
|
max_occurrences = 1
|
|
min_players = 20
|
|
|
|
/datum/round_event/ghost_role/nightmare
|
|
minimum_required = 1
|
|
role_name = "nightmare"
|
|
fakeable = FALSE
|
|
|
|
/datum/round_event/ghost_role/nightmare/spawn_role()
|
|
var/list/candidates = get_candidates(ROLE_ALIEN, null, ROLE_ALIEN)
|
|
if(!candidates.len)
|
|
return NOT_ENOUGH_PLAYERS
|
|
|
|
var/mob/dead/selected = pick(candidates)
|
|
|
|
var/datum/mind/player_mind = new /datum/mind(selected.key)
|
|
player_mind.active = TRUE
|
|
|
|
var/list/spawn_locs = list()
|
|
for(var/X in GLOB.xeno_spawn)
|
|
var/turf/T = X
|
|
var/light_amount = T.get_lumcount()
|
|
if(light_amount < SHADOW_SPECIES_LIGHT_THRESHOLD)
|
|
spawn_locs += T
|
|
|
|
if(!spawn_locs.len)
|
|
message_admins("No valid spawn locations found, aborting...")
|
|
return MAP_ERROR
|
|
|
|
var/mob/living/carbon/human/S = new ((pick(spawn_locs)))
|
|
player_mind.transfer_to(S)
|
|
player_mind.assigned_role = "Nightmare"
|
|
player_mind.special_role = "Nightmare"
|
|
player_mind.add_antag_datum(/datum/antagonist/nightmare)
|
|
S.set_species(/datum/species/shadow/nightmare)
|
|
playsound(S, 'sound/magic/ethereal_exit.ogg', 50, TRUE, -1)
|
|
message_admins("[ADMIN_LOOKUPFLW(S)] has been made into a Nightmare by an event.")
|
|
log_game("[key_name(S)] was spawned as a Nightmare by an event.")
|
|
spawned_mobs += S
|
|
return SUCCESSFUL_SPAWN
|