mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-14 04:02:31 +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()
|
/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()
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user