Borer admin refactor (#2209)
* Refactors and clarifications Refactors borers to use objective datums instead of relying entirely on hardcoded snowflake bullshit. Also adds some FEEDBACK to the punishments, so the host isn't completely confused why they suddenly keep getting stunlocked and blinded. Also refactors syndi-borers to display their objectives along the other borers instead of as an antag, since they TECHNICALLY count as a borer for their escape objective, enabling them to cooperate. Refactors borers weakness-chemical to be a variable instead of hardcoded, allowing admin var-editing to work. Borers now inherit the objectives of their parent-borer. Normally makes no difference, but if admins were to give custom objectives to one borer, then all its children will injerit it. * Removed a line Removed a piece of text that was redundant at best and incorrect at worst. Syndicate borers makes it show up as the default 10 needed when no other borers existed and normal borers already state their own objective individually.
This commit is contained in:
@@ -16,7 +16,6 @@ obj/item/weapon/antag_spawner/syndi_borer/spawn_antag(client/C, turf/T, mob/owne
|
||||
|
||||
B.mind.assigned_role = B.name
|
||||
B.mind.special_role = B.name
|
||||
SSticker.mode.traitors += B.mind
|
||||
var/datum/objective/syndi_borer/new_objective
|
||||
new_objective = new /datum/objective/syndi_borer
|
||||
new_objective.owner = B.mind
|
||||
|
||||
@@ -83,3 +83,24 @@
|
||||
explanation_text = "Assassinate [target.name], the [!target_role_type ? target.assigned_role : target.special_role]."
|
||||
else
|
||||
explanation_text = "Stay alive until your target arrives on the station, you will be notified when the target has been identified."
|
||||
|
||||
|
||||
|
||||
//BORER STUFF
|
||||
//Because borers didn't use to have objectives
|
||||
/datum/objective/normal_borer //Default objective, should technically never be used unmodified but CAN work unmodified.
|
||||
explanation_text = "You must escape with at least one borer with host on the shuttle."
|
||||
target_amount = 1
|
||||
martyr_compatible = 0
|
||||
|
||||
/datum/objective/normal_borer/check_completion()
|
||||
var/total_borer_hosts = 0
|
||||
for(var/mob/living/carbon/C in GLOB.mob_list)
|
||||
var/mob/living/simple_animal/borer/D = C.has_brain_worms()
|
||||
var/turf/location = get_turf(C)
|
||||
if(location.z == ZLEVEL_CENTCOM && D && D.stat != DEAD)
|
||||
total_borer_hosts++
|
||||
if(target_amount <= total_borer_hosts)
|
||||
return TRUE
|
||||
else
|
||||
return FALSE
|
||||
@@ -271,17 +271,19 @@
|
||||
|
||||
|
||||
if(GLOB.borers.len)
|
||||
var/borerwin = FALSE
|
||||
var/borertext = "<br><font size=3><b>The borers were:</b></font>"
|
||||
for(var/mob/living/simple_animal/borer/B in GLOB.borers)
|
||||
if((B.key || B.controlling) && B.stat != DEAD)
|
||||
borertext += "<br>[B.controlling ? B.victim.key : B.key] was [B.truename] ("
|
||||
var/turf/location = get_turf(B)
|
||||
if(location.z == ZLEVEL_CENTCOM && B.victim)
|
||||
borertext += "escaped with host"
|
||||
else
|
||||
borertext += "failed"
|
||||
borertext += ")"
|
||||
borertext += "<br><font size=2><b>[B.controlling ? B.victim.key : B.key] was [B.truename]</b></font>"
|
||||
var/count = 1
|
||||
for(var/datum/objective/objective in B.mind.objectives)
|
||||
if(objective.check_completion())
|
||||
borertext += "<br><B>Objective #[count]</B>: [objective.explanation_text] <font color='green'><B>Success!</B></font>"
|
||||
else
|
||||
borertext += "<br><B>Objective #[count]</B>: [objective.explanation_text] <font color='red'>Fail.</font>"
|
||||
count++
|
||||
|
||||
|
||||
to_chat(world, borertext)
|
||||
|
||||
var/total_borers = 0
|
||||
@@ -295,14 +297,8 @@
|
||||
var/turf/location = get_turf(C)
|
||||
if(location.z == ZLEVEL_CENTCOM && D && D.stat != DEAD)
|
||||
total_borer_hosts++
|
||||
if(GLOB.total_borer_hosts_needed <= total_borer_hosts)
|
||||
borerwin = TRUE
|
||||
to_chat(world, "<b>There were [total_borers] borers alive at round end!</b>")
|
||||
to_chat(world, "<b>A total of [total_borer_hosts] borers with hosts escaped on the shuttle alive. The borers needed [GLOB.total_borer_hosts_needed] hosts to escape.</b>")
|
||||
if(borerwin)
|
||||
to_chat(world, "<b><font color='green'>The borers were successful!</font></b>")
|
||||
else
|
||||
to_chat(world, "<b><font color='red'>The borers have failed!</font></b>")
|
||||
to_chat(world, "<b>A total of [total_borer_hosts] borers with hosts escaped on the shuttle alive.</b>")
|
||||
|
||||
CHECK_TICK
|
||||
return 0
|
||||
|
||||
@@ -97,6 +97,9 @@ GLOBAL_VAR_INIT(total_borer_hosts_needed, 10)
|
||||
var/hiding = FALSE
|
||||
var/waketimerid = null
|
||||
|
||||
var/docile_chem = "sugar"
|
||||
var/list/wakeup_objectives = list() //Used to store objectives until the borer wakes up
|
||||
|
||||
var/datum/action/innate/borer/talk_to_host/talk_to_host_action = new
|
||||
var/datum/action/innate/borer/infest_host/infest_host_action = new
|
||||
var/datum/action/innate/borer/toggle_hide/toggle_hide_action = new
|
||||
@@ -136,8 +139,7 @@ GLOBAL_VAR_INIT(total_borer_hosts_needed, 10)
|
||||
borer_chems += /datum/borer_chem/crocin
|
||||
borer_chems += /datum/borer_chem/camphor
|
||||
|
||||
if(is_team_borer)
|
||||
GLOB.borers += src
|
||||
GLOB.borers += src
|
||||
|
||||
GrantBorerActions()
|
||||
|
||||
@@ -285,12 +287,12 @@ GLOBAL_VAR_INIT(total_borer_hosts_needed, 10)
|
||||
|
||||
if(stat != DEAD && victim.stat != DEAD)
|
||||
|
||||
if(victim.reagents.has_reagent("sugar"))
|
||||
if(victim.reagents.has_reagent(docile_chem))
|
||||
if(!docile || waketimerid)
|
||||
if(controlling)
|
||||
to_chat(victim, "<span class='warning'>You feel the soporific flow of sugar in your host's blood, lulling you into docility.</span>")
|
||||
to_chat(victim, "<span class='warning'>You feel the soporific flow of [docile_chem] in your host's blood, lulling you into docility.</span>")
|
||||
else
|
||||
to_chat(src, "<span class='warning'>You feel the soporific flow of sugar in your host's blood, lulling you into docility.</span>")
|
||||
to_chat(src, "<span class='warning'>You feel the soporific flow of [docile_chem] in your host's blood, lulling you into docility.</span>")
|
||||
if(waketimerid)
|
||||
deltimer(waketimerid)
|
||||
waketimerid = null
|
||||
@@ -298,9 +300,9 @@ GLOBAL_VAR_INIT(total_borer_hosts_needed, 10)
|
||||
else
|
||||
if(docile && !waketimerid)
|
||||
if(controlling)
|
||||
to_chat(victim, "<span class='warning'>You start shaking off your lethargy as the sugar leaves your host's blood. This will take about 10 seconds...</span>")
|
||||
to_chat(victim, "<span class='warning'>You start shaking off your lethargy as the [docile_chem] leaves your host's blood. This will take about 10 seconds...</span>")
|
||||
else
|
||||
to_chat(src, "<span class='warning'>You start shaking off your lethargy as the sugar leaves your host's blood. This will take about 10 seconds...</span>")
|
||||
to_chat(src, "<span class='warning'>You start shaking off your lethargy as the [docile_chem] leaves your host's blood. This will take about 10 seconds...</span>")
|
||||
|
||||
waketimerid = addtimer(CALLBACK(src, "wakeup"), 10, TIMER_STOPPABLE)
|
||||
if(controlling)
|
||||
@@ -775,10 +777,13 @@ GLOBAL_VAR_INIT(total_borer_hosts_needed, 10)
|
||||
switch(punishment) //Hardcoding this stuff.
|
||||
if("Blindness")
|
||||
victim.blind_eyes(4)
|
||||
to_chat(victim, "<span class='userdanger'>Your vision fades away suddenly, as your borer robs you of your sight.</span>")
|
||||
if("Deafness")
|
||||
victim.minimumDeafTicks(40)
|
||||
to_chat(victim, "<span class='userdanger'>Your hearing fades away suddenly, as your borer robs you of your hearing.</span>")
|
||||
if("Stun")
|
||||
victim.Knockdown(100)
|
||||
to_chat(victim, "<span class='userdanger'>You are wracked with unbearable pain, as your borer takes control of your pain-center!</span>")
|
||||
|
||||
log_game("[src]/([src.ckey]) punished [victim]/([victim.ckey] with [punishment]")
|
||||
|
||||
@@ -825,7 +830,10 @@ GLOBAL_VAR_INIT(total_borer_hosts_needed, 10)
|
||||
|
||||
new /obj/effect/decal/cleanable/vomit(get_turf(src))
|
||||
playsound(loc, 'sound/effects/splat.ogg', 50, 1)
|
||||
new /mob/living/simple_animal/borer(get_turf(src), B.generation + 1)
|
||||
var/mob/living/simple_animal/borer/Baby = new /mob/living/simple_animal/borer(get_turf(src), B.generation + 1)
|
||||
|
||||
Baby.wakeup_objectives = src.mind.objectives //Save them for later, since we lack a mind for them right now
|
||||
|
||||
log_game("[src]/([src.ckey]) has spawned a new borer via reproducing.")
|
||||
else
|
||||
to_chat(src, "<span class='warning'>You need 200 chemicals stored to reproduce.</span>")
|
||||
@@ -843,15 +851,26 @@ GLOBAL_VAR_INIT(total_borer_hosts_needed, 10)
|
||||
candidate.mob = src
|
||||
ckey = candidate.ckey
|
||||
|
||||
if(mind)
|
||||
mind.store_memory("You must escape with at least [GLOB.total_borer_hosts_needed] borers with hosts on the shuttle.")
|
||||
SSticker.mode.update_borer_icons_added(mind)
|
||||
|
||||
to_chat(src, "<span class='notice'>You are a cortical borer!</span>")
|
||||
to_chat(src, "You are a brain slug that worms its way into the head of its victim. Use stealth, persuasion and your powers of mind control to keep you, your host and your eventual spawn safe and warm.")
|
||||
to_chat(src, "Sugar nullifies your abilities, avoid it at all costs!")
|
||||
to_chat(src, "[docile_chem] nullifies your abilities, avoid it at all costs!")
|
||||
to_chat(src, "You can speak to your fellow borers by prefixing your messages with ';'. Check out your Borer tab to see your abilities.")
|
||||
to_chat(src, "You must escape with at least [GLOB.total_borer_hosts_needed] borers with hosts on the shuttle. To reproduce you must have 100 chemicals and be controlling a host.")
|
||||
|
||||
if(mind)
|
||||
if(!(wakeup_objectives.len)) //No objectives, use default?
|
||||
var/datum/objective/normal_borer/new_objective
|
||||
new_objective = new /datum/objective/normal_borer
|
||||
new_objective.owner = mind
|
||||
new_objective.target_amount = GLOB.total_borer_hosts_needed
|
||||
new_objective.explanation_text = "You must escape with at least [GLOB.total_borer_hosts_needed] borer[new_objective.target_amount > 1 ? "s" : ""] with host[new_objective.target_amount > 1 ? "s" : ""] on the shuttle."
|
||||
mind.objectives += new_objective
|
||||
to_chat(src, "<B>Objective #1</B>: [new_objective.explanation_text]")
|
||||
else
|
||||
mind.objectives += wakeup_objectives
|
||||
var/count = 1
|
||||
for(var/datum/objective/O in mind.objectives)
|
||||
to_chat(src, "<B>Objective #[count]</B>: [O.explanation_text]")
|
||||
count++
|
||||
|
||||
/mob/living/simple_animal/borer/proc/detatch()
|
||||
if(!victim || !controlling)
|
||||
|
||||
Reference in New Issue
Block a user