/datum/game_mode/blob name = "blob" config_tag = "blob" shuttle_available = 2 var/const/blobs_minimum = 1 var/const/blobs_possible = 2 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) var/finish_counter = 0 /datum/game_mode/blob/announce() boutput(world, "The current game mode is - Blob!") boutput(world, "A dangerous alien organism is rapidly spreading throughout the station!") boutput(world, "You must kill it all while minimizing the damage to the station.") /datum/game_mode/blob/pre_setup() ..() var/num_players = 0 for(var/mob/new_player/player in mobs) if(player.client && player.ready) num_players++ var/i = rand(-10, 0) var/num_blobs = max(1, min(round((num_players + i) / 30), blobs_possible)) var/list/possible_blobs = get_possible_blobs(num_blobs) if (!possible_blobs || !islist(possible_blobs) || !possible_blobs.len || possible_blobs.len < blobs_minimum) return 0 token_players = antag_token_list() for(var/datum/mind/tplayer in token_players) if (!token_players.len) break traitors += tplayer token_players.Remove(tplayer) logTheThing("admin", tplayer.current, null, "successfully redeems an antag token.") message_admins("[key_name(tplayer.current)] successfully redeems an antag token.") //num_blobs = max(0, num_blobs - 1) for(var/j = 0, j < num_blobs, j++) var/datum/mind/blob = pick(possible_blobs) traitors += blob possible_blobs.Remove(blob) for(var/datum/mind/blob in traitors) if(!blob || !istype(blob)) traitors.Remove(blob) continue if(istype(blob)) blob.special_role = "blob" return 1 /datum/game_mode/blob/post_setup() ..() emergency_shuttle.disabled = 0 for (var/datum/mind/blob in traitors) if (istype(blob)) bestow_objective(blob,/datum/objective/specialist/blob) spawn(0) var/newname = input(blob.current, "You are a Blob. Please choose a name for yourself, it will show in the form: the Blob", "Name change") as text if (newname) if (length(newname) >= 26) newname = copytext(newname, 1, 26) newname = replacetext(newname, ">", "'") + " the Blob" blob.current.real_name = newname blob.current.name = newname spawn (rand(waittime_l, waittime_h)) send_intercept() /datum/game_mode/blob/send_intercept() var/intercepttext = "Cent. Com. Update Requested status information:
" intercepttext += " Cent. Com has recently been contacted by the following syndicate affiliated organisations in your area, please investigate any information you may have:" var/list/possible_modes = list() possible_modes.Add("revolution", "wizard", "nuke", "traitor", "changeling") possible_modes -= "[ticker.mode]" var/number = pick(2, 3) var/i = 0 for(i = 0, i < number, i++) possible_modes.Remove(pick(possible_modes)) possible_modes.Insert(rand(possible_modes.len), "[ticker.mode]") var/datum/intercept_text/i_text = new /datum/intercept_text for(var/A in possible_modes) intercepttext += i_text.build(A, pick(ticker.minds)) for (var/obj/machinery/communications_dish/C in machines) C.add_centcom_report("Cent. Com. Status Summary", intercepttext) command_alert("Summary downloaded and printed out at all communications consoles.", "Enemy communication intercept. Security Level Elevated.") /datum/game_mode/blob/check_finished() if (..()) return 1 if (no_automatic_ending) return 0 for (var/datum/mind/M in traitors) if (!M) continue if (M.special_role != "blob") continue if (istype(M.current, /mob/living/intangible/blob_overmind)) var/mob/living/intangible/blob_overmind/O = M.current if (O.blobs.len < 500) finish_counter = 0 return 0 for (var/datum/mind/M in Agimmicks) if (!M) continue if (M.special_role != "blob") continue if (istype(M.current, /mob/living/intangible/blob_overmind)) var/mob/living/intangible/blob_overmind/O = M.current if (O.blobs.len < 500) finish_counter = 0 return 0 return 1 /datum/game_mode/blob/declare_completion() var/list/blobs = list() for (var/datum/mind/M in traitors) if (!M) continue if (istype(M.current, /mob/living/intangible/blob_overmind)) blobs += M.current for (var/datum/mind/M in Agimmicks) if (!M) continue if (istype(M.current, /mob/living/intangible/blob_overmind)) blobs += M.current if (!blobs.len) boutput(world, "Station victory! - All blobs have been exterminated!") else boutput(world, "Blob victory! - The crew has failed to stop the overmind! The station is lost to the blob!") ..() /datum/game_mode/blob/proc/get_possible_blobs(num_blobs=1) var/list/candidates = list() for(var/mob/new_player/player in mobs) if (ishellbanned(player)) continue //No treason for you if ((player.client) && (player.ready) && !(player.mind in traitors) && !(player.mind in token_players) && !candidates.Find(player.mind)) if(player.client.preferences.be_blob) candidates += player.mind if(candidates.len < num_blobs) logTheThing("debug", null, null, "Enemy Assignment: Only [candidates.len] players with be_blob set to yes were ready. We need [num_blobs], so including players who don't want to be blobstart in the pool.") for(var/mob/new_player/player in mobs) if (ishellbanned(player)) continue //No treason for you if ((player.client) && (player.ready) && !(player.mind in traitors) && !(player.mind in token_players) && !candidates.Find(player.mind)) candidates += player.mind if(candidates.len < 1) return list() else return candidates