Merge pull request #14376 from Putnam3145/mode-chaos
Adds recent-chaos weighting for secret
This commit is contained in:
@@ -425,6 +425,7 @@ Example config:
|
||||
var/list/min_pop = Get(/datum/config_entry/keyed_list/min_pop)
|
||||
var/list/max_pop = Get(/datum/config_entry/keyed_list/max_pop)
|
||||
var/list/repeated_mode_adjust = Get(/datum/config_entry/number_list/repeated_mode_adjust)
|
||||
var/desired_chaos_level = 9 - SSpersistence.get_recent_chaos()
|
||||
for(var/T in gamemode_cache)
|
||||
var/datum/game_mode/M = new T()
|
||||
if(!(M.config_tag in modes))
|
||||
@@ -449,6 +450,17 @@ Example config:
|
||||
adjustment += repeated_mode_adjust[recent_round]
|
||||
recent_round = SSpersistence.saved_modes.Find(M.config_tag,recent_round+1,0)
|
||||
final_weight *= max(0,((100-adjustment)/100))
|
||||
if(Get(/datum/config_entry/flag/weigh_by_recent_chaos))
|
||||
var/chaos_level = M.get_chaos()
|
||||
var/exponent = Get(/datum/config_entry/number/chaos_exponent)
|
||||
var/delta = chaos_level - desired_chaos_level
|
||||
if(desired_chaos_level > 5)
|
||||
delta = abs(min(delta, 0))
|
||||
else if(desired_chaos_level < 5)
|
||||
delta = max(delta, 0)
|
||||
else
|
||||
delta = abs(delta)
|
||||
final_weight /= (delta + 1) ** exponent
|
||||
runnable_modes[M] = final_weight
|
||||
return runnable_modes
|
||||
|
||||
|
||||
@@ -7,6 +7,13 @@
|
||||
/datum/config_entry/keyed_list/probability/ValidateListEntry(key_name)
|
||||
return key_name in config.modes
|
||||
|
||||
/datum/config_entry/keyed_list/chaos_level
|
||||
key_mode = KEY_MODE_TEXT
|
||||
value_mode = VALUE_MODE_NUM
|
||||
|
||||
/datum/config_entry/keyed_list/chaos_level/ValidateListEntry(key_name)
|
||||
return key_name in config.modes
|
||||
|
||||
/datum/config_entry/keyed_list/max_pop
|
||||
key_mode = KEY_MODE_TEXT
|
||||
value_mode = VALUE_MODE_NUM
|
||||
@@ -596,3 +603,8 @@
|
||||
/// Dirtyness multiplier for making turfs dirty
|
||||
/datum/config_entry/number/turf_dirty_multiplier
|
||||
config_entry_value = 1
|
||||
|
||||
/datum/config_entry/flag/weigh_by_recent_chaos
|
||||
|
||||
/datum/config_entry/number/chaos_exponent
|
||||
config_entry_value = 1
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
/datum/controller/subsystem/persistence
|
||||
var/list/saved_modes = list(1,2,3)
|
||||
var/list/saved_chaos = list(5,5,5)
|
||||
var/list/saved_dynamic_rules = list(list(),list(),list())
|
||||
var/list/saved_storytellers = list("foo","bar","baz")
|
||||
var/list/average_dynamic_threat = 50
|
||||
@@ -33,6 +34,14 @@
|
||||
file_data["data"] = saved_modes
|
||||
fdel(json_file)
|
||||
WRITE_FILE(json_file, json_encode(file_data))
|
||||
saved_chaos[3] = saved_chaos[2]
|
||||
saved_chaos[2] = saved_chaos[1]
|
||||
saved_chaos[1] = SSticker.mode.get_chaos()
|
||||
json_file = file("data/RecentChaos.json")
|
||||
file_data = list()
|
||||
file_data["data"] = saved_chaos
|
||||
fdel(json_file)
|
||||
WRITE_FILE(json_file, json_encode(file_data))
|
||||
|
||||
/datum/controller/subsystem/persistence/proc/CollectStoryteller(var/datum/game_mode/dynamic/mode)
|
||||
saved_storytellers.len = 3
|
||||
@@ -105,3 +114,9 @@
|
||||
if(!json)
|
||||
return
|
||||
saved_maps = json["maps"]
|
||||
|
||||
/datum/controller/subsystem/persistence/proc/get_recent_chaos()
|
||||
var/sum = 0
|
||||
for(var/n in saved_chaos)
|
||||
sum += n
|
||||
return sum/length(saved_chaos)
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
traitor_name = "Bloodsucker"
|
||||
antag_flag = ROLE_BLOODSUCKER
|
||||
false_report_weight = 1
|
||||
chaos = 4
|
||||
restricted_jobs = list("AI","Cyborg")
|
||||
protected_jobs = list("Chaplain", "Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Head of Personnel", "Chief Engineer", "Chief Medical Officer", "Research Director", "Quartermaster")
|
||||
required_players = 20
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
name = "traitor+brothers"
|
||||
config_tag = "traitorbro"
|
||||
required_players = 25
|
||||
chaos = 5
|
||||
restricted_jobs = list("AI", "Cyborg")
|
||||
protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Head of Personnel", "Chief Engineer", "Chief Medical Officer", "Research Director", "Quartermaster")
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ GLOBAL_VAR(changeling_team_objective_type) //If this is not null, we hand our th
|
||||
config_tag = "changeling"
|
||||
antag_flag = ROLE_CHANGELING
|
||||
false_report_weight = 10
|
||||
chaos = 5
|
||||
restricted_jobs = list("AI", "Cyborg")
|
||||
protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Head of Personnel", "Chief Engineer", "Chief Medical Officer", "Research Director", "Quartermaster") //citadel change - adds HoP, CE, CMO, and RD to ling role blacklist
|
||||
required_players = 15
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
name = "traitor+changeling"
|
||||
config_tag = "traitorchan"
|
||||
false_report_weight = 10
|
||||
chaos = 6
|
||||
traitors_possible = 3 //hard limit on traitors if scaling is turned off
|
||||
restricted_jobs = list("AI", "Cyborg")
|
||||
required_players = 25
|
||||
|
||||
@@ -134,6 +134,7 @@ Credit where due:
|
||||
config_tag = "clockwork_cult"
|
||||
antag_flag = ROLE_SERVANT_OF_RATVAR
|
||||
false_report_weight = 10
|
||||
chaos = 8
|
||||
required_players = 24 //Fixing this directly for now since apparently config machine for forcing modes broke.
|
||||
required_enemies = 3
|
||||
recommended_enemies = 5
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/datum/game_mode/nuclear/clown_ops
|
||||
name = "clown ops"
|
||||
config_tag = "clownops"
|
||||
|
||||
chaos = 8
|
||||
announce_span = "danger"
|
||||
announce_text = "Clown empire forces are approaching the station in an attempt to HONK it!\n\
|
||||
<span class='danger'>Operatives</span>: Secure the nuclear authentication disk and use your bananium fission explosive to HONK the station.\n\
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
config_tag = "cult"
|
||||
antag_flag = ROLE_CULTIST
|
||||
false_report_weight = 10
|
||||
chaos = 8
|
||||
restricted_jobs = list("AI", "Cyborg")
|
||||
protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Head of Personnel", "Chief Engineer", "Chief Medical Officer", "Research Director", "Quartermaster")
|
||||
required_players = 30
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/datum/game_mode/devil/devil_agents
|
||||
name = "Devil Agents"
|
||||
config_tag = "devil_agents"
|
||||
chaos = 5
|
||||
required_players = 25
|
||||
required_enemies = 3
|
||||
recommended_enemies = 8
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
config_tag = "devil"
|
||||
antag_flag = ROLE_DEVIL
|
||||
false_report_weight = 1
|
||||
chaos = 3
|
||||
protected_jobs = list("Lawyer", "Curator", "Chaplain", "Head of Security", "Captain", "AI")
|
||||
required_players = 0
|
||||
required_enemies = 1
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
config_tag = "heresy"
|
||||
antag_flag = ROLE_HERETIC
|
||||
false_report_weight = 5
|
||||
chaos = 5
|
||||
restricted_jobs = list("AI", "Cyborg")
|
||||
protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Head of Personnel", "Chief Engineer", "Chief Medical Officer", "Research Director", "Quartermaster") //citadel change - adds HoP, CE, CMO, and RD to heretic role blacklist
|
||||
required_players = 15
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
config_tag = "secret_extended"
|
||||
false_report_weight = 5
|
||||
required_players = 0
|
||||
chaos = 0
|
||||
|
||||
announce_span = "notice"
|
||||
announce_text = "Just have fun and enjoy the game!"
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
var/config_tag = null
|
||||
var/votable = 1
|
||||
var/probability = 0
|
||||
var/chaos = 5 // 0-9, used for weighting round-to-round
|
||||
var/false_report_weight = 0 //How often will this show up incorrectly in a centcom report?
|
||||
var/station_was_nuked = 0 //see nuclearbomb.dm and malfunction.dm
|
||||
var/nuke_off_station = 0 //Used for tracking where the nuke hit
|
||||
@@ -623,3 +624,10 @@
|
||||
/// Mode specific info for ghost game_info
|
||||
/datum/game_mode/proc/ghost_info()
|
||||
return
|
||||
|
||||
/datum/game_mode/proc/get_chaos()
|
||||
var/chaos_levels = CONFIG_GET(keyed_list/chaos_level)
|
||||
if(config_tag in chaos_levels)
|
||||
return chaos_levels[config_tag]
|
||||
else
|
||||
return chaos
|
||||
|
||||
@@ -6,6 +6,7 @@ GLOBAL_LIST_EMPTY(gangs)
|
||||
name = "gang war"
|
||||
config_tag = "gang"
|
||||
antag_flag = ROLE_GANG
|
||||
chaos = 9
|
||||
restricted_jobs = list("AI", "Cyborg")
|
||||
protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Head of Personnel", "Chief Engineer", "Chief Medical Officer", "Research Director", "Quartermaster")
|
||||
required_players = 15
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
name = "meteor"
|
||||
config_tag = "meteor"
|
||||
false_report_weight = 1
|
||||
chaos = 9
|
||||
var/meteordelay = 2000
|
||||
var/nometeors = 0
|
||||
var/rampupdelta = 5
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
required_players = 20
|
||||
required_enemies = 1
|
||||
recommended_enemies = 1
|
||||
chaos = 9
|
||||
|
||||
restricted_jobs = list("Cyborg", "AI")
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
name = "nuclear emergency"
|
||||
config_tag = "nuclear"
|
||||
false_report_weight = 10
|
||||
chaos = 9
|
||||
required_players = 28 // 30 players - 3 players to be the nuke ops = 25 players remaining
|
||||
required_enemies = 2
|
||||
recommended_enemies = 5
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
name = "overthrow"
|
||||
config_tag = "overthrow"
|
||||
antag_flag = ROLE_OVERTHROW
|
||||
chaos = 5
|
||||
restricted_jobs = list("AI", "Cyborg")
|
||||
protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Head of Personnel", "Chief Engineer", "Chief Medical Officer", "Research Director", "Quartermaster")
|
||||
required_players = 20 // the core idea is of a swift, bloodless coup, so it shouldn't be as chaotic as revs.
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
config_tag = "revolution"
|
||||
antag_flag = ROLE_REV
|
||||
false_report_weight = 10
|
||||
chaos = 8
|
||||
restricted_jobs = list("AI", "Cyborg")
|
||||
protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Head of Personnel", "Chief Engineer", "Chief Medical Officer", "Research Director", "Quartermaster")
|
||||
required_players = 20
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
required_enemies = 5
|
||||
recommended_enemies = 8
|
||||
reroll_friendly = 0
|
||||
chaos = 7
|
||||
traitor_name = "Nanotrasen Internal Affairs Agent"
|
||||
antag_flag = ROLE_INTERNAL_AFFAIRS
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
recommended_enemies = 4
|
||||
reroll_friendly = 1
|
||||
enemy_minimum_age = 0
|
||||
chaos = 2
|
||||
|
||||
announce_span = "danger"
|
||||
announce_text = "There are Syndicate agents on the station!\n\
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
recommended_enemies = 1
|
||||
enemy_minimum_age = 7
|
||||
round_ends_with_antag_death = 1
|
||||
chaos = 9
|
||||
announce_span = "danger"
|
||||
announce_text = "There is a space wizard attacking the station!\n\
|
||||
<span class='danger'>Wizard</span>: Accomplish your objectives and cause mayhem on the station.\n\
|
||||
|
||||
@@ -72,6 +72,14 @@ ALERT_DELTA Destruction of the station is imminent. All crew are instructed to o
|
||||
## Uncomment to not send a roundstart intercept report. Gamemodes may override this.
|
||||
#NO_INTERCEPT_REPORT
|
||||
|
||||
## Comment to disable weighting modes by how chaotic recent mode rolls were.
|
||||
WEIGH_BY_RECENT_CHAOS
|
||||
|
||||
## The weight adjustment will be proportional to this power relative to the "ideal" weight range.
|
||||
## e.g. if we have a weight range of 0-5, and an exponent of 1, 6 will be weighted 1/2, 7 1/3 etc.
|
||||
## if exponent is 2, it'll be 1/4, 1/9 etc.
|
||||
CHAOS_EXPONENT 1
|
||||
|
||||
## Probablities for game modes chosen in 'secret' and 'random' modes.
|
||||
## Default probablity is 1, increase to make that mode more likely to be picked.
|
||||
## Set to 0 to disable that mode.
|
||||
@@ -154,6 +162,11 @@ FORCE_ANTAG_COUNT CLOCKWORK_CULT
|
||||
#FORCE_ANTAG_COUNT WIZARD
|
||||
#FORCE_ANTAG_COUNT MONKEY
|
||||
|
||||
## A config for how much each game mode's chaos level is.
|
||||
## All of them have reasonable defaults, but this can be used to adjust them.
|
||||
## 0-9, where 0 is lowest chaos (should only be extended) and 9 is highest (wizard? nukies?)
|
||||
#CHAOS_LEVEL EXTENDED 0
|
||||
|
||||
## Uncomment these for overrides of the minimum / maximum number of players in a round type.
|
||||
## If you set any of these occasionally check to see if you still need them as the modes
|
||||
## will still be actively rebalanced around the SUGGESTED populations, not your overrides.
|
||||
|
||||
Reference in New Issue
Block a user