mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Cleans up calamity shuffle, makes sure antag types are selected in a random order for other game modes.
This commit is contained in:
@@ -12,14 +12,15 @@
|
||||
|
||||
/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.
|
||||
var/i = 1
|
||||
//Let's not modify global lists for trivial reasons, even if it seems harmless right now.
|
||||
var/list/antag_candidates = all_antag_types.Copy()
|
||||
|
||||
var/grab_antags = round(num_players()/ANTAG_TYPE_RATIO)+1
|
||||
for(var/antag_id in all_antag_types)
|
||||
if(i > grab_antags)
|
||||
break
|
||||
while(antag_candidates.len && antag_tags.len < grab_antags)
|
||||
var/antag_id = pick(antag_candidates)
|
||||
antag_candidates -= antag_id
|
||||
antag_tags |= antag_id
|
||||
i++
|
||||
|
||||
..()
|
||||
|
||||
/datum/game_mode/calamity/check_victory()
|
||||
|
||||
@@ -572,6 +572,7 @@ var/global/list/additional_antag_types = list()
|
||||
if(antag)
|
||||
antag_templates |= antag
|
||||
|
||||
shuffle(antag_templates) //In the case of multiple antag types
|
||||
newscaster_announcements = pick(newscaster_standard_feeds)
|
||||
|
||||
/datum/game_mode/proc/check_victory()
|
||||
|
||||
Reference in New Issue
Block a user