Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into Ghommie-cit611
This commit is contained in:
@@ -368,22 +368,25 @@
|
||||
var/list/datum/dynamic_storyteller/runnable_storytellers = new
|
||||
var/list/probabilities = Get(/datum/config_entry/keyed_list/storyteller_weight)
|
||||
var/list/repeated_mode_adjust = Get(/datum/config_entry/number_list/repeated_mode_adjust)
|
||||
var/list/min_player_counts = Get(/datum/config_entry/keyed_list/storyteller_min_players)
|
||||
for(var/T in storyteller_cache)
|
||||
var/datum/dynamic_storyteller/S = T
|
||||
var/config_tag = initial(S.config_tag)
|
||||
var/final_weight = initial(S.weight)
|
||||
if(probabilities[config_tag]<=0)
|
||||
var/probability = (config_tag in probabilities) ? probabilities[config_tag] : initial(S.weight)
|
||||
var/min_players = (config_tag in min_player_counts) ? min_player_counts[config_tag] : initial(S.min_players)
|
||||
if(probability <= 0)
|
||||
continue
|
||||
final_weight = probabilities[config_tag]
|
||||
if(SSpersistence.saved_storytellers.len == 3 && repeated_mode_adjust.len == 3)
|
||||
if(length(GLOB.player_list) < min_players)
|
||||
continue
|
||||
if(SSpersistence.saved_storytellers.len == repeated_mode_adjust.len)
|
||||
var/name = initial(S.name)
|
||||
var/recent_round = min(SSpersistence.saved_storytellers.Find(name),3)
|
||||
var/adjustment = 0
|
||||
while(recent_round)
|
||||
adjustment += repeated_mode_adjust[recent_round]
|
||||
recent_round = SSpersistence.saved_modes.Find(name,recent_round+1,0)
|
||||
final_weight *= ((100-adjustment)/100)
|
||||
runnable_storytellers[S] = final_weight
|
||||
probability *= ((100-adjustment)/100)
|
||||
runnable_storytellers[S] = probability
|
||||
return runnable_storytellers
|
||||
|
||||
|
||||
|
||||
@@ -92,3 +92,7 @@
|
||||
/datum/config_entry/keyed_list/storyteller_weight
|
||||
key_mode = KEY_MODE_TEXT
|
||||
value_mode = VALUE_MODE_NUM
|
||||
|
||||
/datum/config_entry/keyed_list/storyteller_min_players
|
||||
key_mode = KEY_MODE_TEXT
|
||||
value_mode = VALUE_MODE_NUM
|
||||
|
||||
@@ -396,6 +396,14 @@
|
||||
key_mode = KEY_MODE_TEXT
|
||||
value_mode = VALUE_MODE_NUM
|
||||
|
||||
/datum/config_entry/keyed_list/job_threat
|
||||
key_mode = KEY_MODE_TEXT
|
||||
value_mode = VALUE_MODE_NUM
|
||||
|
||||
/datum/config_entry/keyed_list/antag_threat
|
||||
key_mode = KEY_MODE_TEXT
|
||||
value_mode = VALUE_MODE_NUM
|
||||
|
||||
/datum/config_entry/number/monkeycap
|
||||
config_entry_value = 64
|
||||
min_val = 0
|
||||
@@ -423,3 +431,21 @@
|
||||
config_entry_value = 3
|
||||
|
||||
/datum/config_entry/flag/suicide_allowed
|
||||
|
||||
/datum/config_entry/keyed_list/breasts_cups_prefs
|
||||
key_mode = KEY_MODE_TEXT
|
||||
value_mode = VALUE_MODE_FLAG
|
||||
config_entry_value = list("a", "b", "c", "d", "e") //keep these lowercase
|
||||
|
||||
/datum/config_entry/number/penis_min_inches_prefs
|
||||
config_entry_value = 1
|
||||
min_val = 0
|
||||
|
||||
/datum/config_entry/number/penis_max_inches_prefs
|
||||
config_entry_value = 20
|
||||
min_val = 0
|
||||
|
||||
/datum/config_entry/keyed_list/safe_visibility_toggles
|
||||
key_mode = KEY_MODE_TEXT
|
||||
value_mode = VALUE_MODE_FLAG
|
||||
config_entry_value = list(GEN_VISIBLE_NO_CLOTHES, GEN_VISIBLE_NO_UNDIES, GEN_VISIBLE_NEVER) //refer to cit_helpers for all toggles.
|
||||
|
||||
@@ -82,17 +82,23 @@
|
||||
config_entry_value = 600
|
||||
min_val = 0
|
||||
|
||||
/datum/config_entry/number/vote_autotransfer_initial //length of time before the first autotransfer vote is called (deciseconds, default 2 hours)
|
||||
/// Length of time before the first autotransfer vote is called (deciseconds, default 2 hours)
|
||||
/// Set to 0 to disable the subsystem altogether.
|
||||
/datum/config_entry/number/vote_autotransfer_initial
|
||||
config_entry_value = 72000
|
||||
min_val = 0
|
||||
|
||||
/datum/config_entry/number/vote_autotransfer_interval //length of time to wait before subsequent autotransfer votes (deciseconds, default 30 minutes)
|
||||
///length of time to wait before subsequent autotransfer votes (deciseconds, default 30 minutes)
|
||||
/datum/config_entry/number/vote_autotransfer_interval
|
||||
config_entry_value = 18000
|
||||
min_val = 0
|
||||
|
||||
/datum/config_entry/number/vote_autotransfer_maximum // maximum extensions until the round autoends
|
||||
/// maximum extensions until the round autoends.
|
||||
/// Set to 0 to force automatic crew transfer after the 'vote_autotransfer_initial' elapsed.
|
||||
/// Set to -1 to disable the maximum extensions cap.
|
||||
/datum/config_entry/number/vote_autotransfer_maximum
|
||||
config_entry_value = 4
|
||||
min_val = 0
|
||||
min_val = -1
|
||||
|
||||
/datum/config_entry/flag/default_no_vote // vote does not default to nochange/norestart
|
||||
|
||||
@@ -459,3 +465,6 @@
|
||||
/datum/config_entry/number/max_bunker_days
|
||||
config_entry_value = 7
|
||||
min_val = 1
|
||||
|
||||
/datum/config_entry/flag/minimaps_enabled
|
||||
config_entry_value = TRUE
|
||||
|
||||
@@ -27,13 +27,11 @@
|
||||
var/hook_path = text2path("/hook/[hook]")
|
||||
if(!hook_path)
|
||||
CRASH("Invalid hook '/hook/[hook]' called.")
|
||||
return 0
|
||||
|
||||
var/caller = new hook_path
|
||||
var/status = 1
|
||||
for(var/P in typesof("[hook_path]/proc"))
|
||||
if(!call(caller, P)(arglist(args)))
|
||||
CRASH("Hook '[P]' failed or runtimed.")
|
||||
status = 0
|
||||
|
||||
return status
|
||||
|
||||
@@ -257,8 +257,7 @@ SUBSYSTEM_DEF(air)
|
||||
T.add_atom_colour("#00ff00", TEMPORARY_COLOUR_PRIORITY)
|
||||
#endif
|
||||
T.excited = TRUE
|
||||
active_turfs |= T
|
||||
SSair_turfs.currentrun |= T
|
||||
active_turfs[T] = SSair_turfs.currentrun[T] = TRUE
|
||||
if(blockchanges && T.excited_group)
|
||||
T.excited_group.garbage_collect()
|
||||
add_to_react_queue(T)
|
||||
@@ -274,10 +273,9 @@ SUBSYSTEM_DEF(air)
|
||||
|
||||
/datum/controller/subsystem/air/proc/add_to_react_queue(turf/open/T)
|
||||
if(istype(T) && T.air)
|
||||
turf_react_queue |= T
|
||||
turf_react_queue[T] = TRUE
|
||||
if(currentpart == SSAIR_REACTQUEUE)
|
||||
currentrun |= T
|
||||
return
|
||||
currentrun[T] = TRUE
|
||||
|
||||
/datum/controller/subsystem/air/proc/remove_from_react_queue(turf/open/T)
|
||||
turf_react_queue -= T
|
||||
|
||||
@@ -16,7 +16,7 @@ SUBSYSTEM_DEF(atoms)
|
||||
|
||||
/datum/controller/subsystem/atoms/Initialize(timeofday)
|
||||
GLOB.fire_overlay.appearance_flags = RESET_COLOR
|
||||
setupGenetics() //to set the mutations' place in structural enzymes, so monkey.initialize() knows where to put the monkey mutation.
|
||||
setupGenetics() //to set the mutations' sequence.
|
||||
initialized = INITIALIZATION_INNEW_MAPLOAD
|
||||
InitializeAtoms()
|
||||
return ..()
|
||||
@@ -108,16 +108,19 @@ SUBSYSTEM_DEF(atoms)
|
||||
BadInitializeCalls = SSatoms.BadInitializeCalls
|
||||
|
||||
/datum/controller/subsystem/atoms/proc/setupGenetics()
|
||||
var/list/avnums = new /list(DNA_STRUC_ENZYMES_BLOCKS)
|
||||
for(var/i=1, i<=DNA_STRUC_ENZYMES_BLOCKS, i++)
|
||||
avnums[i] = i
|
||||
CHECK_TICK
|
||||
|
||||
for(var/A in subtypesof(/datum/mutation/human))
|
||||
var/datum/mutation/human/B = new A()
|
||||
if(B.dna_block == NON_SCANNABLE)
|
||||
var/list/mutations = subtypesof(/datum/mutation/human)
|
||||
shuffle_inplace(mutations)
|
||||
for(var/A in subtypesof(/datum/generecipe))
|
||||
var/datum/generecipe/GR = A
|
||||
GLOB.mutation_recipes[initial(GR.required)] = initial(GR.result)
|
||||
for(var/i in 1 to LAZYLEN(mutations))
|
||||
var/path = mutations[i] //byond gets pissy when we do it in one line
|
||||
var/datum/mutation/human/B = new path ()
|
||||
B.alias = "Mutation #[i]"
|
||||
GLOB.all_mutations[B.type] = B
|
||||
GLOB.full_sequences[B.type] = generate_gene_sequence(B.blocks)
|
||||
if(B.locked)
|
||||
continue
|
||||
B.dna_block = pick_n_take(avnums)
|
||||
if(B.quality == POSITIVE)
|
||||
GLOB.good_mutations |= B
|
||||
else if(B.quality == NEGATIVE)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define NO_MAXVOTES_CAP -1
|
||||
|
||||
SUBSYSTEM_DEF(autotransfer)
|
||||
name = "Autotransfer Vote"
|
||||
flags = SS_KEEP_TIMING | SS_BACKGROUND
|
||||
@@ -7,21 +9,32 @@ SUBSYSTEM_DEF(autotransfer)
|
||||
var/targettime
|
||||
var/voteinterval
|
||||
var/maxvotes
|
||||
var/curvotes
|
||||
var/curvotes = 0
|
||||
|
||||
/datum/controller/subsystem/autotransfer/Initialize(timeofday)
|
||||
var/init_vote = CONFIG_GET(number/vote_autotransfer_initial)
|
||||
if(!init_vote) //Autotransfer voting disabled.
|
||||
can_fire = FALSE
|
||||
return ..()
|
||||
starttime = world.time
|
||||
targettime = starttime + CONFIG_GET(number/vote_autotransfer_initial)
|
||||
targettime = starttime + init_vote
|
||||
voteinterval = CONFIG_GET(number/vote_autotransfer_interval)
|
||||
maxvotes = CONFIG_GET(number/vote_autotransfer_maximum)
|
||||
curvotes = 0
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/autotransfer/Recover()
|
||||
starttime = SSautotransfer.starttime
|
||||
voteinterval = SSautotransfer.voteinterval
|
||||
curvotes = SSautotransfer.curvotes
|
||||
|
||||
/datum/controller/subsystem/autotransfer/fire()
|
||||
if(maxvotes > curvotes)
|
||||
if(world.time > targettime)
|
||||
SSvote.initiate_vote("transfer",null) //TODO figure out how to not use null as the user
|
||||
targettime = targettime + voteinterval
|
||||
curvotes += 1
|
||||
if(world.time < targettime)
|
||||
return
|
||||
if(maxvotes == NO_MAXVOTES_CAP || maxvotes > curvotes)
|
||||
SSvote.initiate_vote("transfer","server")
|
||||
targettime = targettime + voteinterval
|
||||
curvotes++
|
||||
else
|
||||
SSshuttle.autoEnd()
|
||||
|
||||
#undef NO_MAXVOTES_CAP
|
||||
@@ -1,30 +1,59 @@
|
||||
PROCESSING_SUBSYSTEM_DEF(dcs)
|
||||
name = "Datum Component System"
|
||||
flags = SS_NO_INIT
|
||||
|
||||
var/list/elements_by_type = list()
|
||||
|
||||
/datum/controller/subsystem/processing/dcs/Recover()
|
||||
comp_lookup = SSdcs.comp_lookup
|
||||
|
||||
/datum/controller/subsystem/processing/dcs/proc/GetElement(datum/element/eletype, ...)
|
||||
/datum/controller/subsystem/processing/dcs/proc/GetElement(list/arguments)
|
||||
var/datum/element/eletype = arguments[1]
|
||||
var/element_id = eletype
|
||||
|
||||
if(!ispath(eletype, /datum/element))
|
||||
CRASH("Attempted to instantiate [eletype] as a /datum/element")
|
||||
|
||||
if(initial(eletype.element_flags) & ELEMENT_BESPOKE)
|
||||
var/list/fullid = list("[eletype]")
|
||||
for(var/i in initial(eletype.id_arg_index) to length(args))
|
||||
var/argument = args[i]
|
||||
if(istext(argument) || isnum(argument))
|
||||
fullid += "[argument]"
|
||||
else
|
||||
if(islist(argument))
|
||||
fullid += deep_list2params(argument)
|
||||
else
|
||||
fullid += "[REF(argument)]"
|
||||
element_id = fullid.Join("&")
|
||||
element_id = GetIdFromArguments(arguments)
|
||||
|
||||
. = elements_by_type[element_id]
|
||||
if(.)
|
||||
return
|
||||
if(!ispath(eletype, /datum/element))
|
||||
CRASH("Attempted to instantiate [eletype] as a /datum/element")
|
||||
. = elements_by_type[element_id] = new eletype
|
||||
. = elements_by_type[element_id] = new eletype
|
||||
|
||||
/****
|
||||
* Generates an id for bespoke elements when given the argument list
|
||||
* Generating the id here is a bit complex because we need to support named arguments
|
||||
* Named arguments can appear in any order and we need them to appear after ordered arguments
|
||||
* We assume that no one will pass in a named argument with a value of null
|
||||
**/
|
||||
/datum/controller/subsystem/processing/dcs/proc/GetIdFromArguments(list/arguments)
|
||||
var/datum/element/eletype = arguments[1]
|
||||
var/list/fullid = list("[eletype]")
|
||||
var/list/named_arguments = list()
|
||||
for(var/i in initial(eletype.id_arg_index) to length(arguments))
|
||||
var/key = arguments[i]
|
||||
var/value
|
||||
if(istext(key))
|
||||
value = arguments[key]
|
||||
if(!(istext(key) || isnum(key)))
|
||||
if(islist(key)) // CITADEL EDIT
|
||||
key = deep_list2params(key)
|
||||
else
|
||||
key = REF(key)
|
||||
key = "[key]" // Key is stringified so numbers dont break things
|
||||
if(!isnull(value))
|
||||
if(!(istext(value) || isnum(value)))
|
||||
if(islist(value)) // CITADEL EDIT
|
||||
value = deep_list2params(value)
|
||||
else
|
||||
value = REF(value)
|
||||
named_arguments["[key]"] = value
|
||||
else
|
||||
fullid += "[key]"
|
||||
|
||||
if(length(named_arguments))
|
||||
named_arguments = sortList(named_arguments)
|
||||
fullid += named_arguments
|
||||
return list2params(fullid)
|
||||
|
||||
@@ -66,6 +66,7 @@ SUBSYSTEM_DEF(job)
|
||||
|
||||
|
||||
/datum/controller/subsystem/job/proc/GetJob(rank)
|
||||
RETURN_TYPE(/datum/job)
|
||||
if(!occupations.len)
|
||||
SetupOccupations()
|
||||
return name_occupations[rank]
|
||||
@@ -738,4 +739,4 @@ SUBSYSTEM_DEF(job)
|
||||
. |= player.mind
|
||||
|
||||
/datum/controller/subsystem/job/proc/JobDebug(message)
|
||||
log_job_debug(message)
|
||||
log_job_debug(message)
|
||||
|
||||
@@ -103,7 +103,7 @@ SUBSYSTEM_DEF(jukeboxes)
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(!M.client)
|
||||
continue
|
||||
if(!(M.client.prefs.toggles & SOUND_INSTRUMENTS))
|
||||
if(!(M.client.prefs.toggles & SOUND_INSTRUMENTS) || !M.can_hear())
|
||||
M.stop_sound_channel(jukeinfo[2])
|
||||
continue
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
SUBSYSTEM_DEF(minimaps)
|
||||
name = "Minimaps"
|
||||
flags = SS_NO_FIRE
|
||||
var/list/station_minimaps
|
||||
var/datum/minimap_group/station_minimap
|
||||
|
||||
/datum/controller/subsystem/minimaps/Initialize()
|
||||
if(!CONFIG_GET(flag/minimaps_enabled))
|
||||
to_chat(world, "<span class='boldwarning'>Minimaps disabled! Skipping init.</span>")
|
||||
return ..()
|
||||
build_minimaps()
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/minimaps/proc/build_minimaps()
|
||||
station_minimaps = list()
|
||||
for(var/z in SSmapping.levels_by_trait(ZTRAIT_STATION))
|
||||
var/datum/space_level/SL = SSmapping.get_level(z)
|
||||
var/name = (SL.name == initial(SL.name))? "[z] - Station" : "[z] - [SL.name]"
|
||||
station_minimaps += new /datum/minimap(z, name = name)
|
||||
station_minimap = new(station_minimaps, "Station")
|
||||
@@ -26,18 +26,16 @@ SUBSYSTEM_DEF(mobs)
|
||||
var/seconds = wait * 0.1
|
||||
if (!resumed)
|
||||
src.currentrun = GLOB.mob_living_list.Copy()
|
||||
if (GLOB.living_cameras.len)
|
||||
src.currentrun += GLOB.living_cameras
|
||||
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
var/list/currentrun = src.currentrun
|
||||
var/times_fired = src.times_fired
|
||||
while(currentrun.len)
|
||||
var/mob/M = currentrun[currentrun.len]
|
||||
var/mob/living/L = currentrun[currentrun.len]
|
||||
currentrun.len--
|
||||
if(M)
|
||||
M.Life(seconds, times_fired)
|
||||
if(L)
|
||||
L.Life(seconds, times_fired)
|
||||
else
|
||||
GLOB.mob_living_list.Remove(M)
|
||||
GLOB.mob_living_list.Remove(L)
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
@@ -14,6 +14,7 @@ SUBSYSTEM_DEF(persistence)
|
||||
var/list/saved_modes = list(1,2,3)
|
||||
var/list/saved_dynamic_rules = list(list(),list(),list())
|
||||
var/list/saved_storytellers = list("foo","bar","baz")
|
||||
var/list/average_dynamic_threat = 50
|
||||
var/list/saved_maps
|
||||
var/list/saved_trophies = list()
|
||||
var/list/spawned_objects = list()
|
||||
@@ -191,6 +192,7 @@ SUBSYSTEM_DEF(persistence)
|
||||
if(!json)
|
||||
return
|
||||
saved_storytellers = json["data"]
|
||||
average_dynamic_threat = saved_storytellers[4]
|
||||
saved_storytellers.len = 3
|
||||
|
||||
/datum/controller/subsystem/persistence/proc/LoadRecentMaps()
|
||||
@@ -434,9 +436,10 @@ SUBSYSTEM_DEF(persistence)
|
||||
saved_storytellers[3] = saved_storytellers[2]
|
||||
saved_storytellers[2] = saved_storytellers[1]
|
||||
saved_storytellers[1] = mode.storyteller.name
|
||||
average_dynamic_threat = (mode.threat_average + average_dynamic_threat) / 2
|
||||
var/json_file = file("data/RecentStorytellers.json")
|
||||
var/list/file_data = list()
|
||||
file_data["data"] = saved_storytellers
|
||||
file_data["data"] = saved_storytellers + average_dynamic_threat
|
||||
fdel(json_file)
|
||||
WRITE_FILE(json_file, json_encode(file_data))
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
PROCESSING_SUBSYSTEM_DEF(chemistry)
|
||||
wait = 5
|
||||
flags = SS_KEEP_TIMING
|
||||
|
||||
|
||||
name = "Chemistry"
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
PROCESSING_SUBSYSTEM_DEF(instruments)
|
||||
name = "Instruments"
|
||||
wait = 0.5
|
||||
init_order = INIT_ORDER_INSTRUMENTS
|
||||
flags = SS_KEEP_TIMING
|
||||
priority = FIRE_PRIORITY_INSTRUMENTS
|
||||
var/static/list/datum/instrument/instrument_data = list() //id = datum
|
||||
var/static/list/datum/song/songs = list()
|
||||
var/static/musician_maxlines = 600
|
||||
var/static/musician_maxlinechars = 300
|
||||
var/static/musician_hearcheck_mindelay = 5
|
||||
var/static/max_instrument_channels = MAX_INSTRUMENT_CHANNELS
|
||||
var/static/current_instrument_channels = 0
|
||||
|
||||
/datum/controller/subsystem/processing/instruments/Initialize()
|
||||
initialize_instrument_data()
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/processing/instruments/proc/on_song_new(datum/song/S)
|
||||
songs += S
|
||||
|
||||
/datum/controller/subsystem/processing/instruments/proc/on_song_del(datum/song/S)
|
||||
songs -= S
|
||||
|
||||
/datum/controller/subsystem/processing/instruments/proc/initialize_instrument_data()
|
||||
for(var/path in subtypesof(/datum/instrument))
|
||||
var/datum/instrument/I = path
|
||||
if(initial(I.abstract_type) == path)
|
||||
continue
|
||||
I = new path
|
||||
I.Initialize()
|
||||
instrument_data[I.id || "[I.type]"] = I
|
||||
CHECK_TICK
|
||||
|
||||
/datum/controller/subsystem/processing/instruments/proc/get_instrument(id_or_path)
|
||||
return instrument_data["[id_or_path]"]
|
||||
|
||||
/datum/controller/subsystem/processing/instruments/proc/reserve_instrument_channel(datum/instrument/I)
|
||||
if(current_instrument_channels > max_instrument_channels)
|
||||
return
|
||||
. = SSsounds.reserve_sound_channel(I)
|
||||
if(!isnull(.))
|
||||
current_instrument_channels++
|
||||
@@ -37,11 +37,11 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
|
||||
if(job?.blacklisted_quirks)
|
||||
cut = filter_quirks(my_quirks, job.blacklisted_quirks)
|
||||
for(var/V in my_quirks)
|
||||
var/datum/quirk/Q = quirks[V]
|
||||
if(Q)
|
||||
if(V in quirks)
|
||||
var/datum/quirk/Q = quirks[V]
|
||||
user.add_quirk(Q, spawn_effects)
|
||||
else
|
||||
stack_trace("Invalid quirk \"[V]\" in client [cli.ckey] preferences")
|
||||
log_admin("Invalid quirk \"[V]\" in client [cli.ckey] preferences")
|
||||
cli.prefs.all_quirks -= V
|
||||
badquirk = TRUE
|
||||
if(badquirk)
|
||||
@@ -85,7 +85,7 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
|
||||
our_quirks -= i
|
||||
cut += i
|
||||
pointscut += quirk_points_by_name(i)
|
||||
if (pointscut >= 0) //with how it works, it needs to be above zero, not below, as points for positive is positive, and negative is negative, we only want it to break if it's above zero, ie. we cut more positive than negative
|
||||
if (pointscut >= 0)
|
||||
break
|
||||
/* //Code to automatically reduce positive quirks until balance is even.
|
||||
var/points_used = total_points(our_quirks)
|
||||
@@ -102,7 +102,7 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
|
||||
*/
|
||||
|
||||
//Nah, let's null all non-neutrals out.
|
||||
if (pointscut != 0)// only if the pointscutting didn't work.
|
||||
if (pointscut < 0)// only if the pointscutting didn't work.
|
||||
if(cut.len)
|
||||
for(var/i in our_quirks)
|
||||
if(quirk_points_by_name(i) != 0)
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
PROCESSING_SUBSYSTEM_DEF(status_effects)
|
||||
wait = 1
|
||||
flags = SS_TICKER
|
||||
name = "Status Effects"
|
||||
@@ -47,7 +47,6 @@ PROCESSING_SUBSYSTEM_DEF(weather)
|
||||
break
|
||||
if (!ispath(weather_datum_type, /datum/weather))
|
||||
CRASH("run_weather called with invalid weather_datum_type: [weather_datum_type || "null"]")
|
||||
return
|
||||
|
||||
if (isnull(z_levels))
|
||||
z_levels = SSmapping.levels_by_trait(initial(weather_datum_type.target_trait))
|
||||
@@ -55,7 +54,6 @@ PROCESSING_SUBSYSTEM_DEF(weather)
|
||||
z_levels = list(z_levels)
|
||||
else if (!islist(z_levels))
|
||||
CRASH("run_weather called with invalid z_levels: [z_levels || "null"]")
|
||||
return
|
||||
|
||||
var/datum/weather/W = new weather_datum_type(z_levels)
|
||||
W.telegraph()
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
#define DATUMLESS "NO_DATUM"
|
||||
|
||||
SUBSYSTEM_DEF(sounds)
|
||||
name = "Sounds"
|
||||
flags = SS_NO_FIRE
|
||||
init_order = INIT_ORDER_SOUNDS
|
||||
var/static/using_channels_max = CHANNEL_HIGHEST_AVAILABLE //BYOND max channels
|
||||
|
||||
// Hey uh these two needs to be initialized fast because the whole "things get deleted before init" thing.
|
||||
/// Assoc list, "[channel]" = either the datum using it or TRUE for an unsafe-reserved (datumless reservation) channel
|
||||
var/list/using_channels = list()
|
||||
/// Assoc list datum = list(channel1, channel2, ...) for what channels something reserved.
|
||||
var/list/using_channels_by_datum = list()
|
||||
/// List of all available channels with associations set to TRUE for fast lookups/allocation.
|
||||
var/list/available_channels
|
||||
|
||||
/datum/controller/subsystem/sounds/Initialize()
|
||||
setup_available_channels()
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/sounds/proc/setup_available_channels()
|
||||
available_channels = list()
|
||||
for(var/i in 1 to using_channels_max)
|
||||
available_channels[num2text(i)] = TRUE
|
||||
|
||||
/// Removes a channel from using list.
|
||||
/datum/controller/subsystem/sounds/proc/free_sound_channel(channel)
|
||||
channel = num2text(channel)
|
||||
var/using = using_channels[channel]
|
||||
using_channels -= channel
|
||||
if(using)
|
||||
using_channels_by_datum[using] -= channel
|
||||
if(!length(using_channels_by_datum[using]))
|
||||
using_channels_by_datum -= using
|
||||
available_channels[channel] = TRUE
|
||||
|
||||
/// Frees all the channels a datum is using.
|
||||
/datum/controller/subsystem/sounds/proc/free_datum_channels(datum/D)
|
||||
var/list/L = using_channels_by_datum[D]
|
||||
if(!L)
|
||||
return
|
||||
for(var/channel in L)
|
||||
using_channels -= channel
|
||||
available_channels[channel] = TRUE
|
||||
using_channels_by_datum -= D
|
||||
|
||||
/// Frees all datumless channels
|
||||
/datum/controller/subsystem/sounds/proc/free_datumless_channels()
|
||||
free_datum_channels(DATUMLESS)
|
||||
|
||||
/// NO AUTOMATIC CLEANUP - If you use this, you better manually free it later! Returns an integer for channel.
|
||||
/datum/controller/subsystem/sounds/proc/reserve_sound_channel_datumless()
|
||||
var/channel = random_available_channel_text()
|
||||
if(!channel) //oh no..
|
||||
return FALSE
|
||||
available_channels -= channel
|
||||
using_channels[channel] = DATUMLESS
|
||||
LAZYINITLIST(using_channels_by_datum[DATUMLESS])
|
||||
using_channels_by_datum[DATUMLESS] += channel
|
||||
return text2num(channel)
|
||||
|
||||
/// Reserves a channel for a datum. Automatic cleanup only when the datum is deleted. Returns an integer for channel.
|
||||
/datum/controller/subsystem/sounds/proc/reserve_sound_channel(datum/D)
|
||||
if(!D) //i don't like typechecks but someone will fuck it up
|
||||
CRASH("Attempted to reserve sound channel without datum using the managed proc.")
|
||||
var/channel = random_available_channel_text()
|
||||
if(!channel)
|
||||
return FALSE
|
||||
available_channels -= channel
|
||||
using_channels[channel] = D
|
||||
LAZYINITLIST(using_channels_by_datum[D])
|
||||
using_channels_by_datum[D] += channel
|
||||
return text2num(channel)
|
||||
|
||||
/// Random available channel, returns text.
|
||||
/datum/controller/subsystem/sounds/proc/random_available_channel_text()
|
||||
return pick(available_channels)
|
||||
|
||||
/// Random available channel, returns number
|
||||
/datum/controller/subsystem/sounds/proc/random_available_channel()
|
||||
return text2num(pick(available_channels))
|
||||
|
||||
/// If a channel is available
|
||||
/datum/controller/subsystem/sounds/proc/is_channel_available(channel)
|
||||
return available_channels[num2text(channel)]
|
||||
|
||||
/// How many channels we have left.
|
||||
/datum/controller/subsystem/sounds/proc/available_channels_left()
|
||||
return length(available_channels)
|
||||
|
||||
#undef DATUMLESS
|
||||
@@ -479,15 +479,15 @@ SUBSYSTEM_DEF(ticker)
|
||||
var/vote_type = CONFIG_GET(string/map_vote_type)
|
||||
switch(vote_type)
|
||||
if("PLURALITY")
|
||||
SSvote.initiate_vote("map","server",hideresults=TRUE)
|
||||
SSvote.initiate_vote("map","server", display = SHOW_RESULTS)
|
||||
if("APPROVAL")
|
||||
SSvote.initiate_vote("map","server",hideresults=TRUE,votesystem = APPROVAL_VOTING)
|
||||
SSvote.initiate_vote("map","server", display = SHOW_RESULTS, votesystem = APPROVAL_VOTING)
|
||||
if("IRV")
|
||||
SSvote.initiate_vote("map","server",hideresults=TRUE,votesystem = INSTANT_RUNOFF_VOTING)
|
||||
SSvote.initiate_vote("map","server", display = SHOW_RESULTS, votesystem = INSTANT_RUNOFF_VOTING)
|
||||
if("SCORE")
|
||||
SSvote.initiate_vote("map","server",hideresults=TRUE,votesystem = MAJORITY_JUDGEMENT_VOTING)
|
||||
SSvote.initiate_vote("map","server", display = SHOW_RESULTS, votesystem = MAJORITY_JUDGEMENT_VOTING)
|
||||
else
|
||||
SSvote.initiate_vote("map","server",hideresults=TRUE)
|
||||
SSvote.initiate_vote("map","server", display = SHOW_RESULTS)
|
||||
// fallback
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/HasRoundStarted()
|
||||
@@ -503,9 +503,9 @@ SUBSYSTEM_DEF(ticker)
|
||||
SSticker.modevoted = TRUE
|
||||
var/dynamic = CONFIG_GET(flag/dynamic_voting)
|
||||
if(dynamic)
|
||||
SSvote.initiate_vote("dynamic","server",hideresults=TRUE,votesystem=SCORE_VOTING,forced=TRUE,vote_time = 20 MINUTES)
|
||||
SSvote.initiate_vote("dynamic", "server", display = NONE, votesystem = SCORE_VOTING, forced = TRUE,vote_time = 20 MINUTES)
|
||||
else
|
||||
SSvote.initiate_vote("roundtype","server",hideresults=TRUE,votesystem=PLURALITY_VOTING,forced=TRUE, \
|
||||
SSvote.initiate_vote("roundtype", "server", display = NONE, votesystem = PLURALITY_VOTING, forced=TRUE, \
|
||||
vote_time = (CONFIG_GET(flag/modetier_voting) ? 1 MINUTES : 20 MINUTES))
|
||||
|
||||
/datum/controller/subsystem/ticker/Recover()
|
||||
|
||||
@@ -69,12 +69,12 @@ SUBSYSTEM_DEF(traumas)
|
||||
|
||||
"spiders" = typecacheof(list(/obj/structure/spider)),
|
||||
|
||||
"security" = typecacheof(list(/obj/item/clothing/under/rank/security, /obj/item/clothing/under/rank/warden,
|
||||
/obj/item/clothing/under/rank/head_of_security, /obj/item/clothing/under/rank/det,
|
||||
"security" = typecacheof(list(/obj/item/clothing/under/rank/security/officer, /obj/item/clothing/under/rank/security/warden,
|
||||
/obj/item/clothing/under/rank/security/head_of_security, /obj/item/clothing/under/rank/security/detective,
|
||||
/obj/item/melee/baton, /obj/item/gun/energy/taser, /obj/item/restraints/handcuffs,
|
||||
/obj/machinery/door/airlock/security, /obj/effect/hallucination/simple/securitron)),
|
||||
|
||||
"clowns" = typecacheof(list(/obj/item/clothing/under/rank/clown, /obj/item/clothing/shoes/clown_shoes,
|
||||
"clowns" = typecacheof(list(/obj/item/clothing/under/rank/civilian/clown, /obj/item/clothing/shoes/clown_shoes,
|
||||
/obj/item/clothing/mask/gas/clown_hat, /obj/item/instrument/bikehorn,
|
||||
/obj/item/pda/clown, /obj/item/grown/bananapeel)),
|
||||
|
||||
@@ -87,15 +87,15 @@ SUBSYSTEM_DEF(traumas)
|
||||
"skeletons" = typecacheof(list(/obj/item/organ/tongue/bone, /obj/item/clothing/suit/armor/bone, /obj/item/stack/sheet/bone,
|
||||
/obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/skeleton,
|
||||
/obj/effect/decal/remains/human)),
|
||||
"conspiracies" = typecacheof(list(/obj/item/clothing/under/rank/captain, /obj/item/clothing/under/rank/head_of_security,
|
||||
/obj/item/clothing/under/rank/chief_engineer, /obj/item/clothing/under/rank/chief_medical_officer,
|
||||
/obj/item/clothing/under/rank/head_of_personnel, /obj/item/clothing/under/rank/research_director,
|
||||
/obj/item/clothing/under/rank/head_of_security/grey, /obj/item/clothing/under/rank/head_of_security/alt,
|
||||
/obj/item/clothing/under/rank/research_director/alt, /obj/item/clothing/under/rank/research_director/turtleneck,
|
||||
/obj/item/clothing/under/captainparade, /obj/item/clothing/under/hosparademale, /obj/item/clothing/under/hosparadefem,
|
||||
"conspiracies" = typecacheof(list(/obj/item/clothing/under/rank/captain, /obj/item/clothing/under/rank/security/head_of_security,
|
||||
/obj/item/clothing/under/rank/engineering/chief_engineer, /obj/item/clothing/under/rank/medical/chief_medical_officer,
|
||||
/obj/item/clothing/under/rank/civilian/head_of_personnel, /obj/item/clothing/under/rank/rnd/research_director,
|
||||
/obj/item/clothing/under/rank/security/head_of_security/grey, /obj/item/clothing/under/rank/security/head_of_security/alt,
|
||||
/obj/item/clothing/under/rank/rnd/research_director/alt, /obj/item/clothing/under/rank/rnd/research_director/turtleneck,
|
||||
/obj/item/clothing/under/rank/captain/parade, /obj/item/clothing/under/rank/security/head_of_security/parade, /obj/item/clothing/under/rank/security/head_of_security/parade/female,
|
||||
/obj/item/clothing/head/helmet/abductor, /obj/item/clothing/suit/armor/abductor/vest, /obj/item/abductor/baton,
|
||||
/obj/item/storage/belt/military/abductor, /obj/item/gun/energy/alien, /obj/item/abductor/silencer,
|
||||
/obj/item/abductor/gizmo, /obj/item/clothing/under/rank/centcom_officer,
|
||||
/obj/item/abductor/gizmo, /obj/item/clothing/under/rank/centcom/officer,
|
||||
/obj/item/clothing/suit/space/hardsuit/ert, /obj/item/clothing/suit/space/hardsuit/ert/sec,
|
||||
/obj/item/clothing/suit/space/hardsuit/ert/engi, /obj/item/clothing/suit/space/hardsuit/ert/med,
|
||||
/obj/item/clothing/suit/space/hardsuit/deathsquad, /obj/item/clothing/head/helmet/space/hardsuit/deathsquad,
|
||||
@@ -103,8 +103,8 @@ SUBSYSTEM_DEF(traumas)
|
||||
"robots" = typecacheof(list(/obj/machinery/computer/upload, /obj/item/aiModule/, /obj/machinery/recharge_station,
|
||||
/obj/item/aicard, /obj/item/deactivated_swarmer, /obj/effect/mob_spawn/swarmer)),
|
||||
|
||||
"doctors" = typecacheof(list(/obj/item/clothing/under/rank/medical, /obj/item/clothing/under/rank/chemist,
|
||||
/obj/item/clothing/under/rank/nursesuit, /obj/item/clothing/under/rank/chief_medical_officer,
|
||||
"doctors" = typecacheof(list(/obj/item/clothing/under/rank/medical/doctor, /obj/item/clothing/under/rank/medical/chemist,
|
||||
/obj/item/clothing/under/rank/medical/doctor/nurse, /obj/item/clothing/under/rank/medical/chief_medical_officer,
|
||||
/obj/item/reagent_containers/syringe, /obj/item/reagent_containers/pill/, /obj/item/reagent_containers/hypospray,
|
||||
/obj/item/storage/firstaid, /obj/item/storage/pill_bottle, /obj/item/healthanalyzer,
|
||||
/obj/structure/sign/departments/medbay, /obj/machinery/door/airlock/medical, /obj/machinery/sleeper,
|
||||
@@ -112,10 +112,10 @@ SUBSYSTEM_DEF(traumas)
|
||||
/obj/item/retractor, /obj/item/hemostat, /obj/item/cautery, /obj/item/surgicaldrill, /obj/item/scalpel, /obj/item/circular_saw,
|
||||
/obj/item/clothing/suit/bio_suit/plaguedoctorsuit, /obj/item/clothing/head/plaguedoctorhat, /obj/item/clothing/mask/gas/plaguedoctor)),
|
||||
|
||||
"authority" = typecacheof(list(/obj/item/clothing/under/rank/captain, /obj/item/clothing/under/rank/head_of_personnel,
|
||||
/obj/item/clothing/under/rank/head_of_security, /obj/item/clothing/under/rank/research_director,
|
||||
/obj/item/clothing/under/rank/chief_medical_officer, /obj/item/clothing/under/rank/chief_engineer,
|
||||
/obj/item/clothing/under/rank/centcom_officer, /obj/item/clothing/under/rank/centcom_commander,
|
||||
"authority" = typecacheof(list(/obj/item/clothing/under/rank/captain, /obj/item/clothing/under/rank/civilian/head_of_personnel,
|
||||
/obj/item/clothing/under/rank/security/head_of_security, /obj/item/clothing/under/rank/rnd/research_director,
|
||||
/obj/item/clothing/under/rank/medical/chief_medical_officer, /obj/item/clothing/under/rank/engineering/chief_engineer,
|
||||
/obj/item/clothing/under/rank/centcom/officer, /obj/item/clothing/under/rank/centcom/commander,
|
||||
/obj/item/melee/classic_baton/telescopic, /obj/item/card/id/silver, /obj/item/card/id/gold,
|
||||
/obj/item/card/id/captains_spare, /obj/item/card/id/centcom, /obj/machinery/door/airlock/command)),
|
||||
|
||||
@@ -131,7 +131,7 @@ SUBSYSTEM_DEF(traumas)
|
||||
/obj/item/clothing/suit/wizrobe, /obj/item/clothing/head/wizard, /obj/item/spellbook, /obj/item/staff,
|
||||
/obj/item/clothing/suit/space/hardsuit/shielded/wizard, /obj/item/clothing/suit/space/hardsuit/wizard,
|
||||
/obj/item/gun/magic/staff, /obj/item/gun/magic/wand,
|
||||
/obj/item/nullrod, /obj/item/clothing/under/rank/chaplain)),
|
||||
/obj/item/nullrod, /obj/item/clothing/under/rank/civilian/chaplain)),
|
||||
|
||||
"aliens" = typecacheof(list(/obj/item/clothing/mask/facehugger, /obj/item/organ/body_egg/alien_embryo,
|
||||
/obj/structure/alien, /obj/item/toy/toy_xeno,
|
||||
@@ -145,21 +145,21 @@ SUBSYSTEM_DEF(traumas)
|
||||
|
||||
"birds" = typecacheof(list(/obj/item/clothing/mask/gas/plaguedoctor, /obj/item/reagent_containers/food/snacks/cracker,
|
||||
/obj/item/clothing/suit/chickensuit, /obj/item/clothing/head/chicken,
|
||||
/obj/item/clothing/suit/toggle/owlwings, /obj/item/clothing/under/owl, /obj/item/clothing/mask/gas/owl_mask,
|
||||
/obj/item/clothing/under/griffin, /obj/item/clothing/shoes/griffin, /obj/item/clothing/head/griffin,
|
||||
/obj/item/clothing/suit/toggle/owlwings, /obj/item/clothing/under/costume/owl, /obj/item/clothing/mask/gas/owl_mask,
|
||||
/obj/item/clothing/under/costume/griffin, /obj/item/clothing/shoes/griffin, /obj/item/clothing/head/griffin,
|
||||
/obj/item/clothing/head/helmet/space/freedom, /obj/item/clothing/suit/space/freedom)),
|
||||
|
||||
"anime" = typecacheof(list(/obj/item/clothing/under/schoolgirl, /obj/item/katana, /obj/item/reagent_containers/food/snacks/sashimi, /obj/item/reagent_containers/food/snacks/chawanmushi,
|
||||
"anime" = typecacheof(list(/obj/item/clothing/under/costume/schoolgirl, /obj/item/katana, /obj/item/reagent_containers/food/snacks/sashimi, /obj/item/reagent_containers/food/snacks/chawanmushi,
|
||||
/obj/item/reagent_containers/food/drinks/bottle/sake, /obj/item/throwing_star, /obj/item/clothing/head/kitty/genuine, /obj/item/clothing/suit/space/space_ninja,
|
||||
/obj/item/clothing/mask/gas/space_ninja, /obj/item/clothing/shoes/space_ninja, /obj/item/clothing/gloves/space_ninja, /obj/item/twohanded/vibro_weapon,
|
||||
/obj/item/nullrod/scythe/vibro, /obj/item/energy_katana, /obj/item/toy/katana, /obj/item/nullrod/claymore/katana, /obj/structure/window/paperframe, /obj/structure/mineral_door/paperframe)),
|
||||
|
||||
"mimes" = typecacheof(list(/obj/item/pda/mime, /obj/item/clothing/under/rank/mime, /obj/item/clothing/mask/gas/mime,
|
||||
"mimes" = typecacheof(list(/obj/item/pda/mime, /obj/item/clothing/under/rank/civilian/mime, /obj/item/clothing/mask/gas/mime,
|
||||
/obj/item/clothing/head/frenchberet, /obj/item/clothing/suit/suspenders, /obj/item/reagent_containers/food/drinks/bottle/bottleofnothing,
|
||||
/obj/item/storage/backpack/mime, /obj/item/reagent_containers/food/snacks/grown/banana/mime,
|
||||
/obj/item/grown/bananapeel/mimanapeel, /obj/item/cartridge/virus/mime, /obj/item/clothing/shoes/sneakers/mime,
|
||||
/obj/item/bedsheet/mime, /obj/item/reagent_containers/food/snacks/burger/mime, /obj/item/clothing/head/beret, /obj/item/clothing/mask/gas/sexymime,
|
||||
/obj/item/clothing/under/sexymime, /obj/item/toy/figure/mime, /obj/item/toy/crayon/mime, /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/silenced, /obj/mecha/combat/reticence)),
|
||||
/obj/item/clothing/under/rank/civilian/mime/sexy, /obj/item/toy/figure/mime, /obj/item/toy/crayon/mime, /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/silenced, /obj/mecha/combat/reticence)),
|
||||
|
||||
"cats" = typecacheof(list(/obj/item/organ/ears/cat, /obj/item/organ/tail/cat, /obj/item/laser_pointer, /obj/item/toy/cattoy, /obj/item/clothing/head/kitty,
|
||||
/obj/item/clothing/head/collectable/kitty, /obj/item/melee/chainofcommand/tailwhip/kitty, /obj/item/stack/sheet/animalhide/cat)),
|
||||
@@ -172,7 +172,7 @@ SUBSYSTEM_DEF(traumas)
|
||||
/obj/item/ammo_box/magazine/pistolm9mm, /obj/item/ammo_box/a357, /obj/item/ammo_box/magazine/m12g, /obj/item/ammo_box/magazine/mm195x129, /obj/item/antag_spawner/nuke_ops, /obj/mecha/combat/gygax/dark, /obj/mecha/combat/marauder/mauler, /obj/item/soap/syndie, /obj/item/gun/syringe/syndicate, /obj/item/cartridge/virus/syndicate,
|
||||
/obj/item/cartridge/virus/frame, /obj/item/chameleon, /obj/item/storage/box/syndie_kit/cutouts, /obj/item/clothing/suit/space/hardsuit/syndi, /obj/item/card/emag, /obj/item/storage/toolbox/syndicate, /obj/item/storage/book/bible/syndicate, /obj/item/encryptionkey/binary, /obj/item/encryptionkey/syndicate, /obj/item/aiModule/syndicate,
|
||||
/obj/item/clothing/shoes/magboots/syndie, /obj/item/powersink, /obj/item/sbeacondrop, /obj/item/sbeacondrop/bomb, /obj/item/syndicatedetonator, /obj/item/shield/energy, /obj/item/assault_pod, /obj/item/slimepotion/slime/sentience/nuclear, /obj/item/stack/telecrystal, /obj/item/jammer, /obj/item/codespeak_manual/unlimited,
|
||||
/obj/item/toy/cards/deck/syndicate, /obj/item/storage/secure/briefcase/syndie, /obj/item/storage/fancy/cigarettes/cigpack_syndicate, /obj/item/toy/syndicateballoon, /obj/item/clothing/gloves/rapid, /obj/item/paper/fluff/ruins/thederelict/syndie_mission, /obj/item/organ/cyberimp/eyes/hud/security/syndicate, /obj/item/clothing/head/HoS/syndicate,
|
||||
/obj/item/toy/cards/deck/syndicate, /obj/item/storage/secure/briefcase/syndie, /obj/item/storage/fancy/cigarettes/cigpack_syndicate, /obj/item/toy/syndicateballoon, /obj/item/clothing/gloves/fingerless/pugilist/rapid, /obj/item/paper/fluff/ruins/thederelict/syndie_mission, /obj/item/organ/cyberimp/eyes/hud/security/syndicate, /obj/item/clothing/head/HoS/syndicate,
|
||||
/obj/machinery/computer/pod/old/syndicate, /obj/machinery/vending/medical/syndicate_access, /obj/item/mmi/syndie, /obj/item/target/syndicate, /obj/machinery/vending/cigarette/syndicate, /obj/item/robot_module/syndicate, /obj/item/clothing/mask/gas/syndicate, /obj/machinery/power/singularity_beacon/syndicate, /obj/item/clothing/head/syndicatefake,
|
||||
/obj/item/radio/headset/syndicate, /obj/item/gun/ballistic/automatic/pistol/antitank/syndicate, /obj/item/pda/syndicate, /obj/item/clothing/suit/armor/vest/capcarapace/syndicate, /obj/item/gun/ballistic/automatic/flechette, /obj/item/ammo_box/magazine/flechette, /obj/item/clothing/suit/toggle/lawyer/black/syndie, /obj/item/melee/transforming/energy/sword/cx/traitor,
|
||||
/obj/structure/sign/poster/contraband/syndicate_pistol, /obj/structure/sign/poster/contraband/syndicate_recruitment, /obj/item/bedsheet/syndie, /obj/item/borg/upgrade/syndicate, /obj/item/tank/jetpack/oxygen/harness, /obj/item/firing_pin/implant/pindicate, /obj/item/reagent_containers/glass/bottle/traitor, /obj/item/storage/belt/military,
|
||||
|
||||
@@ -23,7 +23,7 @@ SUBSYSTEM_DEF(vote)
|
||||
var/list/generated_actions = list()
|
||||
var/next_pop = 0
|
||||
|
||||
var/obfuscated = FALSE//CIT CHANGE - adds obfuscated/admin-only votes
|
||||
var/display_votes = SHOW_RESULTS|SHOW_VOTES|SHOW_WINNER|SHOW_ABSTENTION //CIT CHANGE - adds obfuscated/admin-only votes
|
||||
|
||||
var/list/stored_gamemode_votes = list() //Basically the last voted gamemode is stored here for end-of-round use.
|
||||
|
||||
@@ -59,7 +59,7 @@ SUBSYSTEM_DEF(vote)
|
||||
voted.Cut()
|
||||
voting.Cut()
|
||||
scores.Cut()
|
||||
obfuscated = FALSE //CIT CHANGE - obfuscated votes
|
||||
display_votes = initial(display_votes) //CIT CHANGE - obfuscated votes
|
||||
remove_action_buttons()
|
||||
|
||||
/datum/controller/subsystem/vote/proc/get_result()
|
||||
@@ -89,20 +89,6 @@ SUBSYSTEM_DEF(vote)
|
||||
choices[GLOB.master_mode] += non_voters.len
|
||||
if(choices[GLOB.master_mode] >= greatest_votes)
|
||||
greatest_votes = choices[GLOB.master_mode]
|
||||
else if(mode == "transfer") // austation begin -- Crew autotransfer vote
|
||||
var/factor = 1
|
||||
switch(world.time / (1 MINUTES))
|
||||
if(0 to 60)
|
||||
factor = 0.5
|
||||
if(61 to 120)
|
||||
factor = 0.8
|
||||
if(121 to 240)
|
||||
factor = 1
|
||||
if(241 to 300)
|
||||
factor = 1.2
|
||||
else
|
||||
factor = 1.4
|
||||
choices["Initiate Crew Transfer"] += round(non_voters.len * factor) // austation end
|
||||
//get all options with that many votes and return them in a list
|
||||
. = list()
|
||||
if(greatest_votes)
|
||||
@@ -264,7 +250,7 @@ SUBSYSTEM_DEF(vote)
|
||||
if(winners.len > 0)
|
||||
if(was_roundtype_vote)
|
||||
stored_gamemode_votes = list()
|
||||
if(!obfuscated)
|
||||
if(display_votes & SHOW_RESULTS)
|
||||
if(vote_system == SCHULZE_VOTING)
|
||||
text += "\nIt should be noted that this is not a raw tally of votes (impossible in ranked choice) but the score determined by the schulze method of voting, so the numbers will look weird!"
|
||||
if(vote_system == MAJORITY_JUDGEMENT_VOTING)
|
||||
@@ -275,15 +261,15 @@ SUBSYSTEM_DEF(vote)
|
||||
votes = 0
|
||||
if(was_roundtype_vote)
|
||||
stored_gamemode_votes[choices[i]] = votes
|
||||
text += "\n<b>[choices[i]]:</b> [obfuscated ? "???" : votes]" //CIT CHANGE - adds obfuscated votes
|
||||
text += "\n<b>[choices[i]]:</b> [display_votes & SHOW_RESULTS ? votes : "???"]" //CIT CHANGE - adds obfuscated votes
|
||||
if(mode != "custom")
|
||||
if(winners.len > 1 && !obfuscated) //CIT CHANGE - adds obfuscated votes
|
||||
if(winners.len > 1 && display_votes & SHOW_WINNER) //CIT CHANGE - adds obfuscated votes
|
||||
text = "\n<b>Vote Tied Between:</b>"
|
||||
for(var/option in winners)
|
||||
text += "\n\t[option]"
|
||||
. = pick(winners)
|
||||
text += "\n<b>Vote Result: [obfuscated ? "???" : .]</b>" //CIT CHANGE - adds obfuscated votes
|
||||
else
|
||||
text += "\n<b>Vote Result: [display_votes & SHOW_WINNER ? . : "???"]</b>" //CIT CHANGE - adds obfuscated votes
|
||||
if(display_votes & SHOW_ABSTENTION)
|
||||
text += "\n<b>Did not vote:</b> [GLOB.clients.len-voted.len]"
|
||||
else if(vote_system == SCORE_VOTING)
|
||||
for(var/score_name in scores)
|
||||
@@ -292,7 +278,7 @@ SUBSYSTEM_DEF(vote)
|
||||
score = 0
|
||||
if(was_roundtype_vote)
|
||||
stored_gamemode_votes[score_name] = score
|
||||
text = "\n<b>[score_name]:</b> [obfuscated ? "???" : score]"
|
||||
text = "\n<b>[score_name]:</b> [display_votes & SHOW_RESULTS ? score : "???"]"
|
||||
. = 1
|
||||
else
|
||||
text += "<b>Vote Result: Inconclusive - No Votes!</b>"
|
||||
@@ -309,7 +295,7 @@ SUBSYSTEM_DEF(vote)
|
||||
if(islist(myvote))
|
||||
for(var/j=1,j<=myvote.len,j++)
|
||||
SSblackbox.record_feedback("nested tally","voting",1,list(vote_title_text,"[j]\th",choices[myvote[j]]))
|
||||
if(obfuscated) //CIT CHANGE - adds obfuscated votes. this messages admins with the vote's true results
|
||||
if(!(display_votes & SHOW_RESULTS)) //CIT CHANGE - adds obfuscated votes. this messages admins with the vote's true results
|
||||
var/admintext = "Obfuscated results"
|
||||
if(vote_system != SCORE_VOTING)
|
||||
if(vote_system == SCHULZE_VOTING)
|
||||
@@ -341,7 +327,7 @@ SUBSYSTEM_DEF(vote)
|
||||
if(CONFIG_GET(flag/modetier_voting))
|
||||
reset()
|
||||
started_time = 0
|
||||
initiate_vote("mode tiers","server",hideresults=FALSE,votesystem=SCORE_VOTING,forced=TRUE, vote_time = 30 MINUTES)
|
||||
initiate_vote("mode tiers","server", votesystem=SCORE_VOTING, forced=TRUE, vote_time = 30 MINUTES)
|
||||
to_chat(world,"<b>The vote will end right as the round starts.</b>")
|
||||
return .
|
||||
if("restart")
|
||||
@@ -368,11 +354,15 @@ SUBSYSTEM_DEF(vote)
|
||||
return message_admins("A vote has tried to change the gamemode, but the game has already started. Aborting.")
|
||||
GLOB.master_mode = "dynamic"
|
||||
var/list/runnable_storytellers = config.get_runnable_storytellers()
|
||||
var/datum/dynamic_storyteller/picked
|
||||
for(var/T in runnable_storytellers)
|
||||
var/datum/dynamic_storyteller/S = T
|
||||
runnable_storytellers[S] *= scores[initial(S.name)]
|
||||
var/datum/dynamic_storyteller/S = pickweightAllowZero(runnable_storytellers)
|
||||
GLOB.dynamic_storyteller_type = S
|
||||
if(stored_gamemode_votes[initial(S.name)] == 1 && CHECK_BITFIELD(initial(S.flags), FORCE_IF_WON))
|
||||
picked = S
|
||||
runnable_storytellers[S] *= round(stored_gamemode_votes[initial(S.name)]*100000,1)
|
||||
if(!picked)
|
||||
picked = pickweightAllowZero(runnable_storytellers)
|
||||
GLOB.dynamic_storyteller_type = picked
|
||||
if("map")
|
||||
var/datum/map_config/VM = config.maplist[.]
|
||||
message_admins("The map has been voted for and will change to: [VM.map_name]")
|
||||
@@ -446,7 +436,7 @@ SUBSYSTEM_DEF(vote)
|
||||
saved -= usr.ckey
|
||||
return 0
|
||||
|
||||
/datum/controller/subsystem/vote/proc/initiate_vote(vote_type, initiator_key, hideresults, votesystem = PLURALITY_VOTING, forced = FALSE,vote_time = -1)//CIT CHANGE - adds hideresults argument to votes to allow for obfuscated votes
|
||||
/datum/controller/subsystem/vote/proc/initiate_vote(vote_type, initiator_key, display = display_votes, votesystem = PLURALITY_VOTING, forced = FALSE,vote_time = -1)//CIT CHANGE - adds display argument to votes to allow for obfuscated votes
|
||||
vote_system = votesystem
|
||||
if(!mode)
|
||||
if(started_time)
|
||||
@@ -457,7 +447,7 @@ SUBSYSTEM_DEF(vote)
|
||||
|
||||
var/admin = FALSE
|
||||
var/ckey = ckey(initiator_key)
|
||||
if(GLOB.admin_datums[ckey])
|
||||
if(GLOB.admin_datums[ckey] || initiator_key == "server")
|
||||
admin = TRUE
|
||||
|
||||
if(next_allowed_time > world.time && !admin)
|
||||
@@ -466,7 +456,7 @@ SUBSYSTEM_DEF(vote)
|
||||
|
||||
SEND_SOUND(world, sound('sound/misc/notice2.ogg'))
|
||||
reset()
|
||||
obfuscated = hideresults //CIT CHANGE - adds obfuscated votes
|
||||
display_votes = display //CIT CHANGE - adds obfuscated votes
|
||||
switch(vote_type)
|
||||
if("restart")
|
||||
choices.Add("Restart Round","Continue Playing")
|
||||
@@ -499,10 +489,11 @@ SUBSYSTEM_DEF(vote)
|
||||
modes_to_add -= "traitor" // makes it so that traitor is always available
|
||||
choices.Add(modes_to_add)
|
||||
if("dynamic")
|
||||
var/list/probabilities = CONFIG_GET(keyed_list/storyteller_weight)
|
||||
for(var/T in config.storyteller_cache)
|
||||
var/datum/dynamic_storyteller/S = T
|
||||
var/list/probabilities = CONFIG_GET(keyed_list/storyteller_weight)
|
||||
if(probabilities[initial(S.config_tag)] > 0)
|
||||
var/probability = ((initial(S.config_tag) in probabilities) ? probabilities[initial(S.config_tag)] : initial(S.weight))
|
||||
if(probability > 0)
|
||||
choices.Add(initial(S.name))
|
||||
choice_descs.Add(initial(S.desc))
|
||||
if("custom")
|
||||
@@ -516,6 +507,21 @@ SUBSYSTEM_DEF(vote)
|
||||
if(!option || mode || !usr.client)
|
||||
break
|
||||
choices.Add(option)
|
||||
var/keep_going = TRUE
|
||||
var/toggles = SHOW_RESULTS|SHOW_VOTES|SHOW_WINNER
|
||||
while(keep_going)
|
||||
var/list/choices = list()
|
||||
for(var/A in GLOB.display_vote_settings)
|
||||
var/toggletext
|
||||
var/bitflag = GLOB.display_vote_settings[A]
|
||||
toggletext = "[toggles & bitflag ? "Show" : "Hide"] [A]"
|
||||
choices[toggletext] = bitflag
|
||||
var/chosen = input(usr, "Toggle vote display settings. Cancel to finalize.", toggles) as null|anything in choices
|
||||
if(!chosen)
|
||||
keep_going = FALSE
|
||||
else
|
||||
toggles ^= choices[chosen]
|
||||
display_votes = toggles
|
||||
else
|
||||
return 0
|
||||
mode = vote_type
|
||||
@@ -586,7 +592,7 @@ SUBSYSTEM_DEF(vote)
|
||||
ivotedforthis = ((C.ckey in voted) && (i in voted[C.ckey]))
|
||||
if(!votes)
|
||||
votes = 0
|
||||
. += "<li>[ivotedforthis ? "<b>" : ""]<a href='?src=[REF(src)];vote=[i]'>[choices[i]]</a> ([obfuscated ? (admin ? "??? ([votes])" : "???") : votes] votes)[ivotedforthis ? "</b>" : ""]</li>" // CIT CHANGE - adds obfuscated votes
|
||||
. += "<li>[ivotedforthis ? "<b>" : ""]<a href='?src=[REF(src)];vote=[i]'>[choices[i]]</a> ([display_votes & SHOW_VOTES ? votes : (admin ? "??? ([votes])" : "???")] votes)[ivotedforthis ? "</b>" : ""]</li>" // CIT CHANGE - adds obfuscated votes
|
||||
if(choice_descs.len >= i)
|
||||
. += "<li>[choice_descs[i]]</li>"
|
||||
. += "</ul><hr>"
|
||||
|
||||
Reference in New Issue
Block a user