|
|
|
@@ -11,7 +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.
|
|
|
|
|
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
|
|
|
|
@@ -22,11 +22,11 @@
|
|
|
|
|
var/datum/game_mode/dynamic/mode = null // Cached as soon as it's made, by dynamic.
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
Property weights are:
|
|
|
|
|
Property weights are:
|
|
|
|
|
"story_potential" -- essentially how many different ways the antag can be played.
|
|
|
|
|
"trust" -- How much it makes the crew trust each other. Negative values means they're suspicious. Team antags are like this.
|
|
|
|
|
"chaos" -- How chaotic it makes the round. Has some overlap with "valid" and somewhat contradicts "extended".
|
|
|
|
|
"valid" -- How likely the non-antag-enemy crew are to get involved, e.g. nukies encouraging the warden to
|
|
|
|
|
"valid" -- How likely the non-antag-enemy crew are to get involved, e.g. nukies encouraging the warden to
|
|
|
|
|
let everyone into the armory, wizard moving around and being a nuisance, nightmare busting lights.
|
|
|
|
|
"extended" -- How much the antag is conducive to a long round. Nukies and cults are bad for this; Wizard is less bad; and so on.
|
|
|
|
|
"conversion" -- Basically a bool. Conversion antags, well, convert. It's its own class for a good reason.
|
|
|
|
@@ -34,13 +34,13 @@ Property weights are:
|
|
|
|
|
|
|
|
|
|
/datum/dynamic_storyteller/proc/start_injection_cooldowns()
|
|
|
|
|
var/latejoin_injection_cooldown_middle = 0.5*(GLOB.dynamic_first_latejoin_delay_max + GLOB.dynamic_first_latejoin_delay_min)
|
|
|
|
|
mode.latejoin_injection_cooldown = round(CLAMP(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_first_latejoin_delay_min, GLOB.dynamic_first_latejoin_delay_max)) + world.time
|
|
|
|
|
mode.latejoin_injection_cooldown = round(clamp(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_first_latejoin_delay_min, GLOB.dynamic_first_latejoin_delay_max)) + world.time
|
|
|
|
|
|
|
|
|
|
var/midround_injection_cooldown_middle = 0.5*(GLOB.dynamic_first_midround_delay_min + GLOB.dynamic_first_midround_delay_max)
|
|
|
|
|
mode.midround_injection_cooldown = round(CLAMP(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_first_midround_delay_min, GLOB.dynamic_first_midround_delay_max)) + world.time
|
|
|
|
|
|
|
|
|
|
mode.midround_injection_cooldown = round(clamp(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_first_midround_delay_min, GLOB.dynamic_first_midround_delay_max)) + world.time
|
|
|
|
|
|
|
|
|
|
var/event_injection_cooldown_middle = 0.5*(GLOB.dynamic_event_delay_max + GLOB.dynamic_event_delay_min)
|
|
|
|
|
mode.event_injection_cooldown = (round(CLAMP(EXP_DISTRIBUTION(event_injection_cooldown_middle), GLOB.dynamic_event_delay_min, GLOB.dynamic_event_delay_max)) + world.time)
|
|
|
|
|
mode.event_injection_cooldown = (round(clamp(EXP_DISTRIBUTION(event_injection_cooldown_middle), GLOB.dynamic_event_delay_min, GLOB.dynamic_event_delay_max)) + world.time)
|
|
|
|
|
|
|
|
|
|
/datum/dynamic_storyteller/proc/calculate_threat()
|
|
|
|
|
var/threat = 0
|
|
|
|
@@ -99,15 +99,15 @@ Property weights are:
|
|
|
|
|
|
|
|
|
|
/datum/dynamic_storyteller/proc/get_midround_cooldown()
|
|
|
|
|
var/midround_injection_cooldown_middle = 0.5*(GLOB.dynamic_midround_delay_max + GLOB.dynamic_midround_delay_min)
|
|
|
|
|
return round(CLAMP(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_midround_delay_min, GLOB.dynamic_midround_delay_max))
|
|
|
|
|
return round(clamp(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_midround_delay_min, GLOB.dynamic_midround_delay_max))
|
|
|
|
|
|
|
|
|
|
/datum/dynamic_storyteller/proc/get_event_cooldown()
|
|
|
|
|
var/event_injection_cooldown_middle = 0.5*(GLOB.dynamic_event_delay_max + GLOB.dynamic_event_delay_min)
|
|
|
|
|
return round(CLAMP(EXP_DISTRIBUTION(event_injection_cooldown_middle), GLOB.dynamic_event_delay_min, GLOB.dynamic_event_delay_max))
|
|
|
|
|
return round(clamp(EXP_DISTRIBUTION(event_injection_cooldown_middle), GLOB.dynamic_event_delay_min, GLOB.dynamic_event_delay_max))
|
|
|
|
|
|
|
|
|
|
/datum/dynamic_storyteller/proc/get_latejoin_cooldown()
|
|
|
|
|
var/latejoin_injection_cooldown_middle = 0.5*(GLOB.dynamic_latejoin_delay_max + GLOB.dynamic_latejoin_delay_min)
|
|
|
|
|
return round(CLAMP(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_latejoin_delay_min, GLOB.dynamic_latejoin_delay_max))
|
|
|
|
|
return round(clamp(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_latejoin_delay_min, GLOB.dynamic_latejoin_delay_max))
|
|
|
|
|
|
|
|
|
|
/datum/dynamic_storyteller/proc/get_injection_chance(dry_run = FALSE)
|
|
|
|
|
if(mode.forced_injection)
|
|
|
|
@@ -144,7 +144,7 @@ Property weights are:
|
|
|
|
|
if(!(rule.flags & MINOR_RULESET)) // makes the traitor rulesets always possible anyway
|
|
|
|
|
var/cost_difference = abs(rule.cost-(mode.threat_level-mode.threat))
|
|
|
|
|
/* Basically, the closer the cost is to the current threat-level-away-from-threat, the more likely it is to
|
|
|
|
|
pick this particular ruleset.
|
|
|
|
|
pick this particular ruleset.
|
|
|
|
|
Let's use a toy example: there's 60 threat level and 10 threat spent.
|
|
|
|
|
We want to pick a ruleset that's close to that, so we run the below equation, on two rulesets.
|
|
|
|
|
Ruleset 1 has 30 cost, ruleset 2 has 5 cost.
|
|
|
|
@@ -212,7 +212,7 @@ Property weights are:
|
|
|
|
|
flags = WAROPS_ALWAYS_ALLOWED
|
|
|
|
|
min_players = 40
|
|
|
|
|
var/refund_cooldown = 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/datum/dynamic_storyteller/chaotic/do_process()
|
|
|
|
|
if(refund_cooldown < world.time)
|
|
|
|
|
mode.create_threat(20)
|
|
|
|
@@ -221,7 +221,7 @@ Property weights are:
|
|
|
|
|
|
|
|
|
|
/datum/dynamic_storyteller/chaotic/get_midround_cooldown()
|
|
|
|
|
return ..() / 4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/datum/dynamic_storyteller/chaotic/get_latejoin_cooldown()
|
|
|
|
|
return ..() / 4
|
|
|
|
|
|
|
|
|
|