[MIRROR] Fixes adjust config (#2723)

* Fixes adjust config

* Update configuration.dm

* Update game_options.txt

* fixes persistance
This commit is contained in:
CitadelStationBot
2017-09-22 23:02:09 -05:00
committed by Poojawa
parent e0b3e861c0
commit 3aafe338af
10 changed files with 192 additions and 112 deletions
+18 -4
View File
@@ -136,7 +136,7 @@ GLOBAL_PROTECT(config_dir)
var/list/probabilities = list() // relative probability of each mode
var/list/min_pop = list() // overrides for acceptible player counts in a mode
var/list/max_pop = list()
var/list/repeated_mode_adjust = list() // weight adjustments for recent modes
var/humans_need_surnames = 0
var/allow_ai = 0 // allow ai job
var/forbid_secborg = 0 // disallow secborg module to be chosen.
@@ -723,7 +723,14 @@ GLOBAL_PROTECT(config_dir)
WRITE_FILE(GLOB.config_error_log, "Unknown game mode probability configuration definition: [prob_name].")
else
WRITE_FILE(GLOB.config_error_log, "Incorrect probability configuration definition: [prob_name] [prob_value].")
if("repeated_mode_adjust")
if(value)
repeated_mode_adjust.Cut()
var/values = splittext(value," ")
for(var/v in values)
repeated_mode_adjust += text2num(v)
else
WRITE_FILE(GLOB.config_error_log, "Incorrect round weight adjustment configuration definition for [value].")
if("protect_roles_from_antagonist")
protect_roles_from_antagonist = 1
if("protect_assistant_from_antagonist")
@@ -976,8 +983,15 @@ GLOBAL_PROTECT(config_dir)
if(max_pop[M.config_tag])
M.maximum_players = max_pop[M.config_tag]
if(M.can_start())
runnable_modes[M] = probabilities[M.config_tag]
//to_chat(world, "DEBUG: runnable_mode\[[runnable_modes.len]\] = [M.config_tag]")
var/final_weight = probabilities[M.config_tag]
if(SSpersistence.saved_modes.len == 3 && repeated_mode_adjust.len == 3)
var/recent_round = min(SSpersistence.saved_modes.Find(M.config_tag),3)
var/adjustment = 0
while(recent_round)
adjustment += repeated_mode_adjust[recent_round]
recent_round = SSpersistence.saved_modes.Find(M.config_tag,recent_round+1,0)
final_weight *= ((100-adjustment)/100)
runnable_modes[M] = final_weight
return runnable_modes
/datum/configuration/proc/get_runnable_midround_modes(crew)