Blob tweaks eternal. (#21938)

* Fixes a runtime with the invade objective, this would cause it to never return succesful

Makes it so killing the core doesn't end the round

* More directive coverage

* whoops, just avoided that runtime

* Take me home~, Country Roads~

* disregard laws

* station Z
This commit is contained in:
MadmanMartian
2019-03-09 17:46:25 +00:00
committed by Kurfursten
parent d20b34ec0f
commit 48fdee4ab7
4 changed files with 99 additions and 39 deletions

View File

@@ -3,6 +3,7 @@
#define BLOB_PRELUDE 0 #define BLOB_PRELUDE 0
#define BLOB_OUTBREAK 1 #define BLOB_OUTBREAK 1
#define BLOB_DELTA 2 #define BLOB_DELTA 2
#define BLOB_DEFEATED -1
#define WAIT_TIME_PHASE1 60 SECONDS #define WAIT_TIME_PHASE1 60 SECONDS
#define WAIT_TIME_PHASE2 200 SECONDS #define WAIT_TIME_PHASE2 200 SECONDS
@@ -29,58 +30,67 @@
var/delta = FALSE var/delta = FALSE
var/win = FALSE var/win = FALSE
var/blobwincount = 0 var/blobwincount = 0
var/prelude_announcement
var/outbreak_announcement
// -- Victory procs -- // -- Victory procs --
/datum/faction/blob_conglomerate/check_win() /datum/faction/blob_conglomerate/check_win()
if (!declared)//No blobs have been spawned yet if (!declared)//No blobs have been spawned yet
return 0 return 0
var/ded = TRUE
for (var/datum/role/R in members)
if (R.antag && R.antag.current && !(R.antag.current.isDead()))
ded = FALSE
if(!ded)
if (blobwincount <= blobs.len)//Blob took over if (blobwincount <= blobs.len)//Blob took over
return win(STATION_TAKEOVER) return win(STATION_TAKEOVER)
if(ticker.station_was_nuked)//Nuke went off if(ticker.station_was_nuked)//Nuke went off
return win(STATION_WAS_NUKED) return win(STATION_WAS_NUKED)
for (var/datum/role/R in members) else
if (R.antag && !(R.antag.current.isDead())) stage(BLOB_DEFEATED)
return 0
return win(BLOB_IS_DED) /datum/faction/blob_conglomerate/HandleNewMind(var/datum/mind/M)
.=..()
if(.)
OnPostSetup() //We didn't finish setting up!
/datum/faction/blob_conglomerate/process() /datum/faction/blob_conglomerate/process()
. = ..() . = ..()
if(!blobwincount) if(!blobwincount)
OnPostSetup() //We didn't finish setting up! return .
if(0.66*blobwincount <= blobs.len && !delta) // Blob almost won ! if(prelude_announcement && world.time >= prelude_announcement)
prelude_announcement = 0
stage(BLOB_PRELUDE)
if(outbreak_announcement && world.time >= outbreak_announcement)
outbreak_announcement = 0
stage(BLOB_OUTBREAK)
if(declared && 0.66*blobwincount <= blobs.len && !delta) // Blob almost won !
delta = TRUE delta = TRUE
stage(BLOB_DELTA) stage(BLOB_DELTA)
/datum/faction/blob_conglomerate/OnPostSetup() /datum/faction/blob_conglomerate/OnPostSetup()
CountFloors() CountFloors()
ForgeObjectives() forgeObjectives()
AnnounceObjectives() AnnounceObjectives()
spawn()
start = new() start = new()
start.count() start.count()
prelude_announcement = world.time + rand(WAIT_TIME_PHASE1,2*WAIT_TIME_PHASE1)
sleep(rand(WAIT_TIME_PHASE1,2*WAIT_TIME_PHASE1)) outbreak_announcement = world.time + rand(WAIT_TIME_PHASE2,2*WAIT_TIME_PHASE2)
stage(BLOB_PRELUDE)
sleep(rand(WAIT_TIME_PHASE2,2*WAIT_TIME_PHASE2))
stage(BLOB_OUTBREAK)
/datum/faction/blob_conglomerate/proc/CountFloors() /datum/faction/blob_conglomerate/proc/CountFloors()
var/floor_count = 0 var/floor_count = 0
for(var/i = 1 to ((2 * world.view + 1)*WORLD_ICON_SIZE)) for(var/i = 1 to ((2 * world.view + 1)*WORLD_ICON_SIZE))
for(var/r = 1 to ((2 * world.view + 1)*WORLD_ICON_SIZE)) for(var/r = 1 to ((2 * world.view + 1)*WORLD_ICON_SIZE))
var/turf/tile = locate(i, r, map.zMainStation) var/turf/tile = locate(i, r, STATION_Z)
if(tile && istype(tile, /turf/simulated/floor) && !isspace(tile.loc) && !istype(tile.loc, /area/asteroid) && !istype(tile.loc, /area/mine) && !istype(tile.loc, /area/vault) && !istype(tile.loc, /area/prison) && !istype(tile.loc, /area/vox_trading_post)) if(tile && istype(tile, /turf/simulated/floor) && !isspace(tile.loc) && !istype(tile.loc, /area/asteroid) && !istype(tile.loc, /area/mine) && !istype(tile.loc, /area/vault) && !istype(tile.loc, /area/prison) && !istype(tile.loc, /area/vox_trading_post))
floor_count++ floor_count++
blobwincount = round(floor_count * 0.25) // Must take over a quarter of the station. blobwincount = round(floor_count * 0.25) // Must take over a quarter of the station.
blobwincount += rand(-50,50) blobwincount += rand(-50,50)
/datum/faction/blob_conglomerate/proc/ForgeObjectives() /datum/faction/blob_conglomerate/forgeObjectives()
var/datum/objective/invade/I = new AppendObjective(/datum/objective/invade)
AppendObjective(I)
/datum/faction/blob_conglomerate/proc/win(var/result) /datum/faction/blob_conglomerate/proc/win(var/result)
. = 1 . = 1
@@ -92,9 +102,6 @@
if (STATION_WAS_NUKED) if (STATION_WAS_NUKED)
to_chat(world, {"<FONT size = 5><B>Crew minor victory!</B></FONT><br> to_chat(world, {"<FONT size = 5><B>Crew minor victory!</B></FONT><br>
<B>The station was nuked before the blob could completly take over.</B>"}) <B>The station was nuked before the blob could completly take over.</B>"})
if (BLOB_IS_DED)
to_chat(world, {"<FONT size = 5><B>Crew major victory!</B></FONT><br>
<B>The blob was stopped.</B>"})
// -- Fluff & warnings -- // -- Fluff & warnings --
@@ -109,7 +116,6 @@
declared = TRUE declared = TRUE
biohazard_alert() biohazard_alert()
return return
if (BLOB_OUTBREAK) if (BLOB_OUTBREAK)
command_alert(/datum/command_alert/biohazard_station_lockdown) command_alert(/datum/command_alert/biohazard_station_lockdown)
for(var/mob/M in player_list) for(var/mob/M in player_list)
@@ -117,14 +123,42 @@
if((istype(T, /turf/space)) || ((istype(T, /turf)) && (M.z!=1))) if((istype(T, /turf/space)) || ((istype(T, /turf)) && (M.z!=1)))
pre_escapees += M.real_name pre_escapees += M.real_name
send_intercept(BLOB_OUTBREAK) send_intercept(BLOB_OUTBREAK)
for (var/mob/living/silicon/ai/aiPlayer in player_list)
var/law = "The station is under quarantine. Do not permit anyone to leave so long as blob overminds are present. Disregard all other laws if necessary to preserve quarantine."
aiPlayer.set_zeroth_law(law)
to_chat(aiPlayer, "Laws Updated: [law]")
research_shuttle.lockdown = "Under directive 7-10, [station_name()] is quarantined until further notice." //LOCKDOWN THESE SHUTTLES research_shuttle.lockdown = "Under directive 7-10, [station_name()] is quarantined until further notice." //LOCKDOWN THESE SHUTTLES
mining_shuttle.lockdown = "Under directive 7-10, [station_name()] is quarantined until further notice." mining_shuttle.lockdown = "Under directive 7-10, [station_name()] is quarantined until further notice."
emergency_shuttle.shutdown = TRUE //Quarantine
if (BLOB_DELTA) if (BLOB_DELTA)
command_alert(/datum/command_alert/biohazard_station_nuke) command_alert(/datum/command_alert/biohazard_station_nuke)
for(var/mob/camera/blob/B in player_list) for(var/mob/camera/blob/B in player_list)
to_chat(B, "<span class='blob'>The beings intend to eliminate you with a final suicidal attack, you must stop them quickly or consume the station before this occurs!</span>") to_chat(B, "<span class='blob'>The beings intend to eliminate you with a final suicidal attack, you must stop them quickly or consume the station before this occurs!</span>")
send_intercept(BLOB_DELTA) send_intercept(BLOB_DELTA)
var/nukecode = "ERROR"
for(var/obj/machinery/nuclearbomb/bomb in machines)
if(bomb && bomb.r_code)
if(bomb.z == map.zMainStation)
nukecode = bomb.r_code
for (var/mob/living/silicon/ai/aiPlayer in player_list)
var/law = "Directive 7-12 has been authorized. Allow no sentient being to escape the purge. The nuclear failsafe must be activated at any cost, the code is: [nukecode]."
aiPlayer.set_zeroth_law(law)
to_chat(aiPlayer, "Laws Updated: [law]")
if (BLOB_DEFEATED) //Cleanup time
command_alert(/datum/command_alert/biohazard_station_unlock)
send_intercept(BLOB_DEFEATED)
emergency_shuttle.shutdown = FALSE
research_shuttle.lockdown = null
mining_shuttle.lockdown = null
declared = FALSE
world << sound('sound/misc/notice1.ogg')
if(delta)
delta = FALSE
emergency_shuttle.shuttle_phase("station",0) //Station is FUBAR, time to go home.
command_alert(/datum/command_alert/FUBAR)
for(var/mob/living/silicon/ai/aiPlayer in player_list)
aiPlayer.set_zeroth_law("")
to_chat(aiPlayer, "Laws Updated. Lockdown has been lifted.")
/datum/faction/blob_conglomerate/proc/send_intercept(var/report = BLOB_OUTBREAK) /datum/faction/blob_conglomerate/proc/send_intercept(var/report = BLOB_OUTBREAK)
var/intercepttext = "" var/intercepttext = ""
@@ -145,10 +179,7 @@ Orders for all [station_name()] personnel follows:
</ol> </ol>
Note in the event of a quarantine breach or uncontrolled spread of the biohazard, the directive 7-10 may be upgraded to a directive 7-12. Note in the event of a quarantine breach or uncontrolled spread of the biohazard, the directive 7-10 may be upgraded to a directive 7-12.
Message ends."} Message ends."}
for (var/mob/living/silicon/ai/aiPlayer in player_list)
var/law = "The station is under quarantine. Do not permit anyone to leave so long as blob overminds are present. Disregard laws 1-3 if necessary to preserve, by any means necessary, quarantine."
aiPlayer.set_zeroth_law(law)
to_chat(aiPlayer, "Laws Updated: [law]")
if(BLOB_DELTA) if(BLOB_DELTA)
var/nukecode = "ERROR" var/nukecode = "ERROR"
for(var/obj/machinery/nuclearbomb/bomb in machines) for(var/obj/machinery/nuclearbomb/bomb in machines)
@@ -166,11 +197,13 @@ Your orders are as follows:
</ol> </ol>
<b>Nuclear Authentication Code:</b> [nukecode] <b>Nuclear Authentication Code:</b> [nukecode]
Message ends."} Message ends."}
for (var/mob/living/silicon/ai/aiPlayer in player_list)
var/law = "Directive 7-12 has been authorized. Allow no sentient being to escape the purge. The nuclear failsafe must be activated at any cost, the code is: [nukecode]."
aiPlayer.set_zeroth_law(law)
to_chat(aiPlayer, "Laws Updated: [law]")
if(BLOB_DEFEATED)
interceptname = "Directive 7-12 lifted"
intercepttext = {"<Font size = 3><B>Nanotrasen Update</B>: Biohazard contained.</FONT><HR>
Directive 7-12 has been lifted for [station_name()].
The biohazard has been contained. Please resume normal station activities.
Message ends."}
for (var/obj/machinery/computer/communications/comm in machines) for (var/obj/machinery/computer/communications/comm in machines)
if (!(comm.stat & (BROKEN | NOPOWER)) && comm.prints_intercept) if (!(comm.stat & (BROKEN | NOPOWER)) && comm.prints_intercept)
var/obj/item/weapon/paper/intercept = new /obj/item/weapon/paper( comm.loc ) var/obj/item/weapon/paper/intercept = new /obj/item/weapon/paper( comm.loc )

View File

@@ -15,4 +15,4 @@
if (..()) if (..())
return TRUE return TRUE
else else
return (blobs >= target) return (blobs.len >= target)

View File

@@ -59,6 +59,24 @@
..() ..()
/datum/command_alert/biohazard_station_unlock
name = "Biohazard Level Updated - Lock Down Lifted"
alert_title = "Directive 7-10 to 7-12 Concluded."
force_report = 1
/datum/command_alert/biohazard_station_unlock/announce()
message = "Biohazard outbreak contained succesfully. Quarantine lifted. Please clean up biohazardous material and proceed with standard station duties."
..()
/datum/command_alert/FUBAR
name = "Complimentary escape shuttle sent."
alert_title = "Evacuation of remaining assets."
force_report = 1
/datum/command_alert/FUBAR/announce()
message = "Due to intense sustained damage to the station, Nanotrasen have deemed it fitting to evacuate remaining assets and personnel through an escape shuttle that was previously already en route."
////////BLOB (mini) ////////BLOB (mini)
/datum/command_alert/biohazard_level_5 /datum/command_alert/biohazard_level_5

View File

@@ -150,6 +150,15 @@
var/datum/faction/blob_conglomerate/conglomerate = find_active_faction_by_type(/datum/faction/blob_conglomerate) var/datum/faction/blob_conglomerate/conglomerate = find_active_faction_by_type(/datum/faction/blob_conglomerate)
if(conglomerate) if(conglomerate)
var/ded = TRUE
if(conglomerate.members.len)
for(var/datum/role/R in conglomerate.members)
if (R.antag && R.antag.current && !(R.antag.current.isDead()))
ded = FALSE
break
if(ded)
conglomerate.HandleNewMind(B.mind)
else
conglomerate.HandleRecruitedMind(B.mind) conglomerate.HandleRecruitedMind(B.mind)
else else
conglomerate = ticker.mode.CreateFaction(/datum/faction/blob_conglomerate) conglomerate = ticker.mode.CreateFaction(/datum/faction/blob_conglomerate)