Cleans up calamity shuffle, makes sure antag types are selected in a random order for other game modes.

This commit is contained in:
HarpyEagle
2015-10-11 12:00:21 -04:00
parent d715e0645f
commit c7afded12d
2 changed files with 8 additions and 6 deletions

View File

@@ -12,14 +12,15 @@
/datum/game_mode/calamity/create_antagonists() /datum/game_mode/calamity/create_antagonists()
shuffle(all_antag_types) // This is probably the only instance in the game where the order will be important. //Let's not modify global lists for trivial reasons, even if it seems harmless right now.
var/i = 1 var/list/antag_candidates = all_antag_types.Copy()
var/grab_antags = round(num_players()/ANTAG_TYPE_RATIO)+1 var/grab_antags = round(num_players()/ANTAG_TYPE_RATIO)+1
for(var/antag_id in all_antag_types) while(antag_candidates.len && antag_tags.len < grab_antags)
if(i > grab_antags) var/antag_id = pick(antag_candidates)
break antag_candidates -= antag_id
antag_tags |= antag_id antag_tags |= antag_id
i++
..() ..()
/datum/game_mode/calamity/check_victory() /datum/game_mode/calamity/check_victory()

View File

@@ -572,6 +572,7 @@ var/global/list/additional_antag_types = list()
if(antag) if(antag)
antag_templates |= antag antag_templates |= antag
shuffle(antag_templates) //In the case of multiple antag types
newscaster_announcements = pick(newscaster_standard_feeds) newscaster_announcements = pick(newscaster_standard_feeds)
/datum/game_mode/proc/check_victory() /datum/game_mode/proc/check_victory()