Skip to content

Commit d0d872b

Browse files
Moves a lot of exfil item granting logic to antag datum.
1 parent 4fbeaa7 commit d0d872b

File tree

8 files changed

+31
-59
lines changed

8 files changed

+31
-59
lines changed

code/modules/antagonists/_common/antag_datum.dm

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ GLOBAL_LIST_EMPTY(antagonists)
6161

6262
/// Do we have delayed objective giving?
6363
var/delayed_objectives = FALSE
64+
/// The title of the players "boss", used for exfil strings
65+
var/boss_title = "Operations"
6466

6567
/datum/antagonist/New()
6668
GLOB.antagonists += src
@@ -500,4 +502,24 @@ GLOBAL_LIST_EMPTY(antagonists)
500502
/datum/antagonist/proc/exfiltrate(mob/living/carbon/human/extractor, obj/item/radio/radio)
501503
return
502504

505+
/datum/antagonist/proc/prepare_exfiltration(mob/user, obj/item/wormhole_jaunter/extraction/extraction_type = null)
506+
// No extraction for certian steals/hijack
507+
var/denied = FALSE
508+
var/objectives = user.mind.get_all_objectives()
509+
for(var/datum/objective/goal in objectives)
510+
if(goal.restricts_exfiltration)
511+
denied = TRUE
512+
if(denied)
513+
to_chat(user, "<span class='warning'>The [boss_title] has deemed your objectives too delicate for an early extraction.</span>")
514+
return
515+
516+
if(world.time < 60 MINUTES) // 60 minutes of no exfil
517+
to_chat(user, "<span class='warning'>The [boss_title] is still preparing an exfiltration portal. Please wait another [round((36000 - world.time) / 600)] minutes before trying again.</span>")
518+
return
519+
var/mob/living/L = user
520+
if(!istype(L))
521+
return
522+
var/obj/item/wormhole_jaunter/extraction/extractor = new extraction_type()
523+
L.put_in_active_hand(extractor)
524+
503525
#undef SUCCESSFUL_DETACH

code/modules/antagonists/changeling/datum_changeling.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ RESTRICT_TYPE(/datum/antagonist/changeling)
5050
var/regenerating = FALSE
5151
blurb_text_color = COLOR_PURPLE
5252
blurb_text_outline_width = 1
53+
boss_title = "Greater Hivemind"
5354

5455
/datum/antagonist/changeling/New()
5556
..()

code/modules/antagonists/changeling/powers/exfilling.dm

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,6 @@
1010

1111
// Create extraction mass
1212
/datum/action/changeling/exfiltration/sting_action(mob/living/user)
13-
var/datum/antagonist/changeling/ling = user.mind.has_antag_datum(/datum/antagonist/changeling)
14-
// No extraction for certian steals/hijack
15-
var/denied = FALSE
16-
var/objectives = user.mind.get_all_objectives()
17-
for(var/datum/objective/goal in objectives)
18-
if(goal.restricts_exfiltration)
19-
denied = TRUE
20-
if(denied)
21-
to_chat(user, "<span class='warning'>The greater hivemind has deemed your objectives too delicate for an early extraction.</span>")
22-
ling.remove_specific_power(/datum/action/changeling/exfiltration)
23-
return
24-
25-
if(world.time < 60 MINUTES) // 60 minutes of no exfil
26-
to_chat(user, "<span class='warning'>The hivemind is still amassing an exfiltration portal. Please wait another [round((36000 - world.time) / 600)] minutes before trying again.</span>")
27-
return
28-
var/mob/living/L = user
29-
if(!istype(L))
30-
return
31-
var/obj/item/wormhole_jaunter/extraction/changeling/extractor = new /obj/item/wormhole_jaunter/extraction/changeling()
32-
L.put_in_active_hand(extractor)
33-
ling.remove_specific_power(/datum/action/changeling/exfiltration)
13+
cling.prepare_exfiltration(user, /obj/item/wormhole_jaunter/extraction/changeling)
14+
cling.remove_specific_power(/datum/action/changeling/exfiltration)
3415
return TRUE

code/modules/antagonists/mind_flayer/flayer_datum.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
var/can_pick_capstone = TRUE
2828
/// Have we notified that our victim does not give swarms from draining
2929
var/has_notified = FALSE
30+
boss_title = "Master Mindflayer"
3031

3132
/datum/antagonist/mindflayer/New()
3233
. = ..()

code/modules/antagonists/mind_flayer/powers/flayer_stealth_powers.dm

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -271,23 +271,5 @@
271271
if(used)
272272
to_chat(user, "<span class='warning'>You have already attempted to create a portal generator!</span>")
273273
return
274-
// No extraction for certian steals/hijack
275-
var/denied = FALSE
276-
var/objectives = user.mind.get_all_objectives()
277-
for(var/datum/objective/goal in objectives)
278-
if(goal.restricts_exfiltration)
279-
denied = TRUE
280-
if(denied)
281-
to_chat(user, "<span class='warning'>The master mindflayer has deemed your objectives too delicate for an early extraction.</span>")
282-
used = TRUE
283-
return
284-
285-
if(world.time < 60 MINUTES) // 60 minutes of no exfil
286-
to_chat(user, "<span class='warning'>The master mindflayer is still assembling an exfiltration portal. Please wait another [round((36000 - world.time) / 600)] minutes before trying again.</span>")
287-
return
288-
var/mob/living/L = user
289-
if(!istype(L))
290-
return
291-
var/obj/item/wormhole_jaunter/extraction/mindflayer/extractor = new /obj/item/wormhole_jaunter/extraction/mindflayer()
292-
L.put_in_active_hand(extractor)
274+
flayer.prepare_exfiltration(user, /obj/item/wormhole_jaunter/extraction/mindflayer)
293275
used = TRUE

code/modules/antagonists/traitor/datum_traitor.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ RESTRICT_TYPE(/datum/antagonist/traitor)
1818
var/give_uplink = TRUE
1919
blurb_r = 200
2020
blurb_a = 0.75
21+
boss_title = "Syndicate Operations"
2122

2223
/// Have we / are we sending a backstab message at this time. If we are, do not send another.
2324
var/sending_backstab = FALSE

code/modules/antagonists/vampire/vamp_datum.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ RESTRICT_TYPE(/datum/antagonist/vampire)
3636
blurb_g = 221
3737
blurb_b = 138
3838
blurb_a = 1
39+
boss_title = "Master Vampire"
3940

4041
/datum/antagonist/vampire/Destroy(force, ...)
4142
draining = null

code/modules/antagonists/vampire/vampire_powers/vampire_powers.dm

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -121,25 +121,8 @@
121121
if(used)
122122
to_chat(user, "<span class='warning'>You have already attempted to create a blood chalice!</span>")
123123
return
124-
// No extraction for certian steals/hijack
125-
var/denied = FALSE
126-
var/objectives = user.mind.get_all_objectives()
127-
for(var/datum/objective/goal in objectives)
128-
if(goal.restricts_exfiltration)
129-
denied = TRUE
130-
if(denied)
131-
to_chat(user, "<span class='warning'>The master vampire has deemed your objectives too delicate for an early extraction.</span>")
132-
used = TRUE
133-
return
134-
135-
if(world.time < 60 MINUTES) // 60 minutes of no exfil
136-
to_chat(user, "<span class='warning'>The master vampire is still conjuring an exfiltration portal. Please wait another [round((36000 - world.time) / 600)] minutes before trying again.</span>")
137-
return
138-
var/mob/living/L = user
139-
if(!istype(L))
140-
return
141-
var/obj/item/wormhole_jaunter/extraction/vampire/extractor = new /obj/item/wormhole_jaunter/extraction/vampire()
142-
L.put_in_active_hand(extractor)
124+
var/datum/antagonist/vampire/vamp = user.mind.has_antag_datum(/datum/antagonist/vampire)
125+
vamp.prepare_exfiltration(user, /obj/item/wormhole_jaunter/extraction/vampire)
143126
used = TRUE
144127

145128
/datum/spell/vampire/self/specialize

0 commit comments

Comments
 (0)