Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into dynamic-lings-2
This commit is contained in:
@@ -54,12 +54,18 @@ GLOBAL_VAR_INIT(dynamic_storyteller_type, /datum/dynamic_storyteller/classic)
|
||||
// Current storyteller
|
||||
var/datum/dynamic_storyteller/storyteller = null
|
||||
// Threat logging vars
|
||||
/// Starting threat level, for things that increase it but can bring it back down.
|
||||
var/initial_threat_level = 0
|
||||
/// Target threat level right now. Events and antags will try to keep the round at this level.
|
||||
var/threat_level = 0
|
||||
/// The current antag threat. Recalculated every time a ruletype starts or ends.
|
||||
var/threat = 0
|
||||
/// Starting threat level, for things that increase it but can bring it back down.
|
||||
var/initial_threat_level = 0
|
||||
/// Threat average over the course of the round, for endgame logs.
|
||||
var/threat_average = 0
|
||||
/// Number of times threat average has been calculated, for calculating above.
|
||||
var/threat_average_weight = 0
|
||||
/// Last time a threat average sample was taken. Used for weighting the rolling average.
|
||||
var/last_threat_sample_time = 0
|
||||
/// Things that cause a rolling threat adjustment to be displayed at roundend.
|
||||
var/list/threat_tallies = list()
|
||||
/// Running information about the threat. Can store text or datum entries.
|
||||
@@ -717,6 +723,16 @@ GLOBAL_VAR_INIT(dynamic_storyteller_type, /datum/dynamic_storyteller/classic)
|
||||
continue
|
||||
current_players[CURRENT_DEAD_PLAYERS].Add(M) // Players who actually died (and admins who ghosted, would be nice to avoid counting them somehow)
|
||||
threat = storyteller.calculate_threat() + added_threat
|
||||
if(threat_average_weight)
|
||||
var/cur_sample_weight = world.time - last_threat_sample_time
|
||||
threat_average = ((threat_average * threat_average_weight) + threat) / (threat_average_weight + cur_sample_weight)
|
||||
threat_average_weight += cur_sample_weight
|
||||
last_threat_sample_time = world.time
|
||||
else
|
||||
threat_average = threat
|
||||
threat_average_weight++
|
||||
last_threat_sample_time = world.time
|
||||
|
||||
/// Removes type from the list
|
||||
/datum/game_mode/dynamic/proc/remove_from_list(list/type_list, type)
|
||||
for(var/I in type_list)
|
||||
|
||||
@@ -34,8 +34,7 @@
|
||||
living_players = trim_list(mode.current_players[CURRENT_LIVING_PLAYERS])
|
||||
living_antags = trim_list(mode.current_players[CURRENT_LIVING_ANTAGS])
|
||||
list_observers = trim_list(mode.current_players[CURRENT_OBSERVERS])
|
||||
var/datum/element/ghost_role_eligibility/eligibility = SSdcs.GetElement(list(/datum/element/ghost_role_eligibility))
|
||||
ghost_eligible = trim_list(eligibility.get_all_ghost_role_eligible())
|
||||
ghost_eligible = trim_list(get_all_ghost_role_eligible())
|
||||
|
||||
/datum/dynamic_ruleset/midround/proc/trim_list(list/L = list())
|
||||
var/list/trimmed_list = L.Copy()
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
WAROPS_ALWAYS_ALLOWED: Can always do warops, regardless of threat level.
|
||||
USE_PREF_WEIGHTS: Will use peoples' preferences to change the threat centre.
|
||||
FORCE_IF_WON: If this mode won the vote, forces it
|
||||
USE_PREV_ROUND_WEIGHTS: Changes its threat centre based on the average chaos of previous rounds.
|
||||
*/
|
||||
var/flags = 0
|
||||
var/dead_player_weight = 1 // How much dead players matter for threat calculation
|
||||
@@ -92,6 +93,8 @@ Property weights are:
|
||||
mean += 5
|
||||
if(voters)
|
||||
GLOB.dynamic_curve_centre += (mean/voters)
|
||||
if(flags & USE_PREV_ROUND_WEIGHTS)
|
||||
GLOB.dynamic_curve_centre += (50 - SSpersistence.average_dynamic_threat) / 10
|
||||
GLOB.dynamic_forced_threat_level = forced_threat_level
|
||||
|
||||
/datum/dynamic_storyteller/proc/get_midround_cooldown()
|
||||
@@ -230,7 +233,7 @@ Property weights are:
|
||||
curve_width = 1.5
|
||||
weight = 2
|
||||
min_players = 30
|
||||
flags = WAROPS_ALWAYS_ALLOWED
|
||||
flags = WAROPS_ALWAYS_ALLOWED | USE_PREV_ROUND_WEIGHTS
|
||||
property_weights = list("valid" = 3, "trust" = 5)
|
||||
|
||||
/datum/dynamic_storyteller/team/get_injection_chance(dry_run = FALSE)
|
||||
@@ -268,9 +271,6 @@ Property weights are:
|
||||
/datum/dynamic_storyteller/random/get_injection_chance()
|
||||
return 50 // i would do rand(0,100) but it's actually the same thing when you do the math
|
||||
|
||||
/datum/dynamic_storyteller/random/calculate_threat()
|
||||
return 0 // what IS threat
|
||||
|
||||
/datum/dynamic_storyteller/random/roundstart_draft()
|
||||
var/list/drafted_rules = list()
|
||||
for (var/datum/dynamic_ruleset/roundstart/rule in mode.roundstart_rules)
|
||||
@@ -324,6 +324,7 @@ Property weights are:
|
||||
desc = "Antags with options for loadouts and gimmicks. Traitor, wizard, nukies. Has a buildup-climax-falling action threat curve."
|
||||
weight = 2
|
||||
curve_width = 2
|
||||
flags = USE_PREV_ROUND_WEIGHTS
|
||||
property_weights = list("story_potential" = 2)
|
||||
|
||||
|
||||
@@ -336,7 +337,7 @@ Property weights are:
|
||||
name = "Classic"
|
||||
config_tag = "classic"
|
||||
desc = "No special antagonist weights. Good variety, but not like random. Uses your chaos preference to weight."
|
||||
flags = USE_PREF_WEIGHTS
|
||||
flags = USE_PREF_WEIGHTS | USE_PREV_ROUND_WEIGHTS
|
||||
|
||||
/datum/dynamic_storyteller/suspicion
|
||||
name = "Intrigue"
|
||||
@@ -345,6 +346,7 @@ Property weights are:
|
||||
weight = 2
|
||||
curve_width = 2
|
||||
dead_player_weight = 2
|
||||
flags = USE_PREV_ROUND_WEIGHTS
|
||||
property_weights = list("trust" = -3)
|
||||
|
||||
/datum/dynamic_storyteller/liteextended
|
||||
|
||||
Reference in New Issue
Block a user