//Few global vars to track the blob GLOBAL_LIST_EMPTY(blobs) //complete list of all blobs made. GLOBAL_LIST_EMPTY(blob_cores) GLOBAL_LIST_EMPTY(overminds) GLOBAL_LIST_EMPTY(blob_nodes) /mob/camera/blob name = "Blob Overmind" real_name = "Blob Overmind" desc = "The overmind. It controls the blob." icon = 'icons/mob/blob.dmi' icon_state = "marker" mouse_opacity = MOUSE_OPACITY_ICON move_on_shuttle = 1 see_in_dark = 8 invisibility = INVISIBILITY_OBSERVER layer = FLY_LAYER pass_flags = PASSBLOB faction = list("blob") lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE var/obj/structure/blob/core/blob_core = null // The blob overmind's core var/blob_points = 0 var/max_blob_points = 100 var/last_attack = 0 var/datum/reagent/blob/blob_reagent_datum = new/datum/reagent/blob() var/list/blob_mobs = list() var/list/resource_blobs = list() var/free_chem_rerolls = 1 //one free chemical reroll var/nodes_required = 1 //if the blob needs nodes to place resource and factory blobs var/placed = 0 var/base_point_rate = 2 //for blob core placement var/manualplace_min_time = 600 //in deciseconds //a minute, to get bearings var/autoplace_max_time = 3600 //six minutes, as long as should be needed var/list/blobs_legit = list() var/max_count = 0 //The biggest it got before death var/blobwincount = 400 var/victory_in_progress = FALSE /mob/camera/blob/Initialize(mapload, starting_points = 60) validate_location() blob_points = starting_points manualplace_min_time += world.time autoplace_max_time += world.time GLOB.overminds += src var/new_name = "[initial(name)] ([rand(1, 999)])" name = new_name real_name = new_name last_attack = world.time var/datum/reagent/blob/BC = pick((subtypesof(/datum/reagent/blob))) blob_reagent_datum = new BC color = blob_reagent_datum.complementary_color if(blob_core) blob_core.update_icon() SSshuttle.registerHostileEnvironment(src) .= ..() /mob/camera/blob/proc/validate_location() var/turf/T = get_turf(src) if(!is_valid_turf(T) && LAZYLEN(GLOB.blobstart)) var/list/blobstarts = shuffle(GLOB.blobstart) for(var/_T in blobstarts) if(is_valid_turf(_T)) T = _T break if(!T) CRASH("No blobspawnpoints and blob spawned in nullspace.") forceMove(T) /mob/camera/blob/proc/is_valid_turf(turf/T) var/area/A = get_area(T) if((A && !A.blob_allowed) || !T || !is_station_level(T.z) || isspaceturf(T)) return FALSE return TRUE /mob/camera/blob/Life() if(!blob_core) if(!placed) if(manualplace_min_time && world.time >= manualplace_min_time) to_chat(src, "You may now place your blob core.") to_chat(src, "You will automatically place your blob core in [DisplayTimeText(autoplace_max_time - world.time)].") manualplace_min_time = 0 if(autoplace_max_time && world.time >= autoplace_max_time) place_blob_core(base_point_rate, 1) else qdel(src) else if(!victory_in_progress && (blobs_legit.len >= blobwincount)) victory_in_progress = TRUE priority_announce("Biohazard has reached critical mass. Station loss is imminent.", "Biohazard Alert") set_security_level("delta") max_blob_points = INFINITY blob_points = INFINITY addtimer(CALLBACK(src, .proc/victory), 450) if(!victory_in_progress && max_count < blobs_legit.len) max_count = blobs_legit.len ..() /mob/camera/blob/proc/victory() sound_to_playing_players('sound/machines/alarm.ogg') sleep(100) for(var/i in GLOB.mob_living_list) var/mob/living/L = i var/turf/T = get_turf(L) if(!T || !is_station_level(T.z)) continue if(L in GLOB.overminds || (L.pass_flags & PASSBLOB)) continue var/area/Ablob = get_area(T) if(!Ablob.blob_allowed) continue if(!("blob" in L.faction)) playsound(L, 'sound/effects/splat.ogg', 50, 1) L.death() new/mob/living/simple_animal/hostile/blob/blobspore(T) else L.fully_heal() for(var/V in GLOB.sortedAreas) var/area/A = V if(!A.blob_allowed) continue A.color = blob_reagent_datum.color A.name = "blob" A.icon = 'icons/mob/blob.dmi' A.icon_state = "blob_shield" A.layer = BELOW_MOB_LAYER A.invisibility = 0 A.blend_mode = 0 var/datum/antagonist/blob/B = mind.has_antag_datum(/datum/antagonist/blob) if(B) var/datum/objective/blob_takeover/main_objective = locate() in B.objectives if(main_objective) main_objective.completed = TRUE to_chat(world, "[real_name] consumed the station in an unstoppable tide!") SSticker.news_report = BLOB_WIN SSticker.force_ending = 1 /mob/camera/blob/Destroy() for(var/BL in GLOB.blobs) var/obj/structure/blob/B = BL if(B && B.overmind == src) B.overmind = null B.update_icon() //reset anything that was ours for(var/BLO in blob_mobs) var/mob/living/simple_animal/hostile/blob/BM = BLO if(BM) BM.overmind = null BM.update_icons() GLOB.overminds -= src SSshuttle.clearHostileEnvironment(src) return ..() /mob/camera/blob/Login() ..() to_chat(src, "You are the overmind!") blob_help() update_health_hud() add_points(0) /mob/camera/blob/examine(mob/user) ..() if(blob_reagent_datum) to_chat(user, "Its chemical is [blob_reagent_datum.name].") /mob/camera/blob/update_health_hud() if(blob_core) hud_used.healths.maptext = "