/datum/game_mode/mixed name = "mixed" config_tag = "mixed" latejoin_antag_compatible = 1 latejoin_antag_roles = list("traitor", "changeling", "vampire", "wrestler") var/const/traitors_possible = 8 // cogwerks - lowered from 10 var/list/traitor_types = list("traitor","changeling","vampire") var/const/waittime_l = 600 //lower bound on time before intercept arrives (in tenths of seconds) var/const/waittime_h = 1800 //upper bound on time before intercept arrives (in tenths of seconds) /datum/game_mode/mixed/announce() boutput(world, "The current game mode is - Mixed!") boutput(world, "Anything could happen! Be on your guard!") /datum/game_mode/mixed/pre_setup() var/num_players = 0 for(var/mob/new_player/player in mobs) if(player.client && player.ready) num_players++ var/i = rand(25) var/num_enemies = 1 if(traitor_scaling) num_enemies = max(1, min(round((num_players + i) / 10), traitors_possible)) // adjust divisor as needed var/num_wizards = 0 var/num_traitors = 0 var/num_changelings = 0 var/num_vampires = 0 var/num_grinches = 0 var/num_wraiths = 0 var/num_blobs = 0 #ifdef XMAS src.traitor_types += "grinch" src.latejoin_antag_roles += "grinch" #endif if ((num_enemies >= 4 && prob(20)) || debug_mixed_forced_wraith || debug_mixed_forced_blob) if (prob(50) || debug_mixed_forced_wraith) num_enemies = max(num_enemies - 4, 1) num_wraiths = 1 else num_enemies = max(num_enemies - 4, 1) num_blobs = 1 for(var/j = 0, j < num_enemies, j++) if(prob(10)) // powerful combat roles num_wizards++ // if any combat roles end up in this mode they go here ok else // more stealthy roles switch(pick(src.traitor_types)) if("traitor") num_traitors++ if("changeling") num_changelings++ if("vampire") num_vampires++ if("grinch") num_grinches++ token_players = antag_token_list() for(var/datum/mind/tplayer in token_players) if (!token_players.len) break switch(pick("wizard", "traitor", "changeling", "vampire", "wraith", "blob")) if("wizard") traitors += tplayer token_players.Remove(tplayer) tplayer.assigned_role = "MODE" tplayer.special_role = "wizard" //num_wizards = max(0, num_wizards -1) if("traitor") traitors += tplayer token_players.Remove(tplayer) tplayer.special_role = "traitor" //num_traitors = max(0, num_traitors -1) if("changeling") traitors += tplayer token_players.Remove(tplayer) tplayer.special_role = "changeling" //num_changelings = max(0, num_changelings -1) if("vampire") traitors += tplayer token_players.Remove(tplayer) tplayer.special_role = "vampire" //num_vampires = max(0, num_vampires -1) if("wraith") traitors += tplayer token_players.Remove(tplayer) tplayer.special_role = "wraith" //num_wraiths = max(0, num_wraiths -1) if("blob") traitors += tplayer token_players.Remove(tplayer) tplayer.special_role = "blob" //num_blobs = max(0, num_blobs -1) logTheThing("admin", tplayer.current, null, "successfully redeemed an antag token.") message_admins("[key_name(tplayer.current)] successfully redeemed an antag token.") if(num_wizards) var/list/possible_wizards = get_possible_enemies("wizard",num_wizards) for(var/j = 0, j < num_wizards, j++) if (!possible_wizards.len) break var/datum/mind/wizard = pick(possible_wizards) traitors += wizard possible_wizards.Remove(wizard) wizard.assigned_role = "MODE" wizard.special_role = "wizard" if(num_traitors) var/list/possible_traitors = get_possible_enemies("traitor",num_traitors) for(var/j = 0, j < num_traitors, j++) if (!possible_traitors.len) break var/datum/mind/traitor = pick(possible_traitors) traitors += traitor possible_traitors.Remove(traitor) traitor.special_role = "traitor" if(num_changelings) var/list/possible_changelings = get_possible_enemies("changeling",num_changelings) for(var/j = 0, j < num_changelings, j++) if (!possible_changelings.len) break var/datum/mind/changeling = pick(possible_changelings) traitors += changeling possible_changelings.Remove(changeling) changeling.special_role = "changeling" if(num_vampires) var/list/possible_vampires = get_possible_enemies("vampire",num_vampires) for(var/j = 0, j < num_vampires, j++) if (!possible_vampires.len) break var/datum/mind/vampire = pick(possible_vampires) traitors += vampire possible_vampires.Remove(vampire) vampire.special_role = "vampire" if(num_wraiths) var/list/possible_wraiths = get_possible_enemies("wraith",num_wraiths) for(var/j = 0, j < num_wraiths, j++) if (!possible_wraiths.len) break var/datum/mind/wraith = pick(possible_wraiths) traitors += wraith possible_wraiths.Remove(wraith) wraith.special_role = "wraith" if(num_blobs) var/list/possible_blobs = get_possible_enemies("blob",num_blobs) for(var/j = 0, j < num_blobs, j++) if (!possible_blobs.len) break var/datum/mind/blob = pick(possible_blobs) traitors += blob possible_blobs.Remove(blob) blob.special_role = "blob" if(num_grinches) var/list/possible_grinches = get_possible_enemies("grinch",num_grinches) for(var/j = 0, j < num_grinches, j++) if (!possible_grinches.len) break var/datum/mind/grinch = pick(possible_grinches) traitors += grinch possible_grinches.Remove(grinch) grinch.special_role = "grinch" if(!traitors) return 0 return 1 /datum/game_mode/mixed/post_setup() var/objective_set_path = null for (var/datum/mind/traitor in traitors) objective_set_path = null // Gotta reset this. if (traitor.assigned_role == "Chaplain" && traitor.special_role == "vampire") // vamp will burn in the chapel before he can react if (prob(50)) traitor.special_role = "traitor" else traitor.special_role = "changeling" switch (traitor.special_role) if ("traitor") var/role = traitor.current.mind.assigned_role if (role in list("Captain","Head of Personnel","Head of Security","Chief Engineer","Research Director","Medical Director")) objective_set_path = pick(typesof(/datum/objective_set/traitor/hard)) else objective_set_path = pick(typesof(/datum/objective_set/traitor/easy)) equip_traitor(traitor.current) if ("changeling") objective_set_path = /datum/objective_set/changeling traitor.current.make_changeling() if ("wizard") objective_set_path = pick(typesof(/datum/objective_set/traitor/easy)) traitor.current.unequip_all(1) if (wizardstart.len == 0) boutput(traitor.current, "A starting location for you could not be found, please report this bug!") else var/starting_loc = pick(wizardstart) traitor.current.set_loc(starting_loc) equip_wizard(traitor.current) var/randomname if (traitor.current.gender == "female") randomname = pick(wiz_female) else randomname = pick(wiz_male) spawn (0) var/newname = input(traitor.current,"You are a Wizard. Would you like to change your name to something else?", "Name change",randomname) if (length(ckey(newname)) == 0) newname = randomname if (newname) if (length(newname) >= 26) newname = copytext(newname, 1, 26) newname = replacetext(newname, ">", "'") traitor.current.real_name = newname traitor.current.name = newname if ("wraith") generate_wraith_objectives(traitor) if ("vampire") objective_set_path = /datum/objective_set/vampire traitor.current.make_vampire() if ("predator") objective_set_path = /datum/objective_set/predator traitor.current.show_text("