Skip to content

Commit a4196cb

Browse files
MrLeeboalex-gh
authored andcommitted
Add Vox Heist directive and call shuttle on completion of Directive X
Conflicts: baystation12.dme code/controllers/emergency_shuttle_controller.dm code/modules/mob/mob.dm
1 parent 415013e commit a4196cb

File tree

7 files changed

+149
-20
lines changed

7 files changed

+149
-20
lines changed

Diff for: baystation12.dme

+1
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@
249249
#include "code\game\gamemodes\mutiny\directives\research_to_ripleys_directive.dm"
250250
#include "code\game\gamemodes\mutiny\directives\tau_ceti_needs_women_directive.dm"
251251
#include "code\game\gamemodes\mutiny\directives\terminations_directive.dm"
252+
#include "code\game\gamemodes\mutiny\directives\vox_heist.dm"
252253
#include "code\game\gamemodes\nations\flag_pinpointer.dm"
253254
#include "code\game\gamemodes\nations\flagprocs.dm"
254255
#include "code\game\gamemodes\nations\nationdatums.dm"

Diff for: code/controllers/emergency_shuttle_controller.dm

+8-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
6363

6464
//calls the shuttle for an emergency evacuation
6565
/datum/emergency_shuttle_controller/proc/call_evac()
66-
if(!can_call()) return
66+
if(!can_call()) return 0
6767

6868
//set the launch timer
6969
autopilot = 1
@@ -80,6 +80,8 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
8080
if(istype(A, /area/hallway))
8181
A.readyalert()
8282

83+
return 1
84+
8385
//calls the shuttle for a routine crew transfer
8486
/datum/emergency_shuttle_controller/proc/call_transfer()
8587
if(!can_call()) return
@@ -134,8 +136,10 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
134136
return 1
135137

136138
/datum/emergency_shuttle_controller/proc/get_shuttle_prep_time()
137-
// During mutiny rounds, the shuttle takes twice as long.
138-
if(ticker && istype(ticker.mode,/datum/game_mode/mutiny))
139+
// During mutiny rounds, the shuttle takes longer. Unless of course the directive is finished.
140+
if(!ticker) return SHUTTLE_PREPTIME
141+
var/datum/game_mode/mutiny/m = ticker.mode
142+
if(istype(m) && !m.ead.activated)
139143
return SHUTTLE_PREPTIME * 3 //15 minutes
140144

141145
return SHUTTLE_PREPTIME
@@ -261,4 +265,4 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
261265
var/obj/effect/bgstar/S = new/obj/effect/bgstar(locate(x,y,z))
262266
S.direction = spawndir
263267
spawn()
264-
S.startmove()
268+
S.startmove()

Diff for: code/datums/mind.dm

+1-15
Original file line numberDiff line numberDiff line change
@@ -1257,18 +1257,7 @@ datum/mind
12571257
brigged_since = -1
12581258
return 0
12591259

1260-
var/is_currently_brigged = 0
1261-
1262-
if(istype(T.loc,/area/security/brig))
1263-
is_currently_brigged = 1
1264-
for(var/obj/item/weapon/card/id/card in current)
1265-
is_currently_brigged = 0
1266-
break // if they still have ID they're not brigged
1267-
for(var/obj/item/device/pda/P in current)
1268-
if(P.id)
1269-
is_currently_brigged = 0
1270-
break // if they still have ID they're not brigged
1271-
1260+
var/is_currently_brigged = current.is_in_brig()
12721261
if(!is_currently_brigged)
12731262
brigged_since = -1
12741263
return 0
@@ -1278,9 +1267,6 @@ datum/mind
12781267

12791268
return (duration <= world.time - brigged_since)
12801269

1281-
1282-
1283-
12841270
//Initialisation procs
12851271
/mob/proc/mind_initialize()
12861272
if(mind)

Diff for: code/game/gamemodes/mutiny/directives/vox_heist.dm

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
datum/directive/vox_heist
2+
var/list/vox = list()
3+
var/list/sympathizers = list()
4+
5+
proc/get_vox_candidates()
6+
var/list/candidates[0]
7+
for(var/mob/M in player_list)
8+
if(M.is_ready() && is_vox(M))
9+
candidates.Add(M)
10+
return candidates
11+
12+
proc/get_sympathizer_candidates()
13+
var/list/candidates[0]
14+
for(var/mob/M in player_list)
15+
if(M.is_ready() && !is_vox(M) && !M.is_mechanical() && M.mind.assigned_role != "Captain")
16+
candidates[M] = get_weight(M)
17+
return candidates
18+
19+
proc/is_vox(mob/M)
20+
return M.get_species() == "Vox"
21+
22+
proc/get_weight(mob/M)
23+
// You will have a high chance of being regarded as a vox sympathizer if your
24+
// relationship with NanoTrasen is negative. Otherwise, command and security
25+
// staff are pretty well trusted and maltreated alien races are easy suspects.
26+
var/relation = M.client.prefs.nanotrasen_relation
27+
if(relation == "Opposed")
28+
return 8
29+
if(relation == "Skeptical")
30+
return 5
31+
if(command_positions.Find(M.mind.assigned_role))
32+
return 1
33+
var/species = M.get_species()
34+
if(species == "Tajaran" || species == "Unathi")
35+
return 5
36+
if(security_positions.Find(M.mind.assigned_role))
37+
return 2
38+
return 3
39+
40+
datum/directive/vox_heist/get_description()
41+
return {"
42+
<p>
43+
A vox warship has commandeered a NanoTrasen transport carrying 2,500 cubic meters of liquid plasma.
44+
The raiders are willing to return the stolen cargo in exchange for the capture or execution of so-called "vox pariah" that are stationed aboard [station_name()].
45+
If the transport is not recovered, the estimated loss of profits is a threat to the solvency of the company.
46+
Predictive analysis has identified certain members of the crew as sympathetic to the vox pariah. Detain the sympathizers to guarantee a successful exchange.
47+
Lethal force is authorized by the High Command Department of Security. Further information is classified.
48+
</p>
49+
"}
50+
51+
datum/directive/vox_heist/initialize()
52+
var/list/vox_candidates = get_vox_candidates()
53+
for(var/mob/pariah in vox_candidates)
54+
vox.Add(pariah.mind)
55+
56+
special_orders = list(
57+
"Brig or kill all Vox Pariah.")
58+
59+
var/list/sympathizer_candidates = get_sympathizer_candidates()
60+
var/list/sympathizer_names = list()
61+
var/sympathizer_count = min(rand(2,4), sympathizer_candidates.len)
62+
for(var/i=0, i < sympathizer_count, i++)
63+
if(!sympathizer_candidates.len)
64+
break
65+
66+
var/mob/candidate = pickweight(sympathizer_candidates)
67+
sympathizer_candidates.Remove(candidate)
68+
sympathizers.Add(candidate.mind)
69+
sympathizer_names.Add("[candidate.mind.assigned_role] [candidate.mind.name]")
70+
71+
if(sympathizers.len)
72+
special_orders.Add("Brig the following sympathizers: [list2text(sympathizer_names, ", ")]")
73+
74+
datum/directive/vox_heist/meets_prerequisites()
75+
var/list/candidates = get_vox_candidates()
76+
return candidates.len >= 2
77+
78+
datum/directive/vox_heist/directives_complete()
79+
if(!vox.len && !sympathizers.len)
80+
return 1
81+
82+
for(var/datum/mind/pariah in vox)
83+
if(!pariah.current.is_in_brig())
84+
return 0
85+
86+
for(var/datum/mind/sympathizer in sympathizers)
87+
if(!sympathizer.current.is_in_brig())
88+
return 0
89+
90+
return 1
91+
92+
datum/directive/vox_heist/get_remaining_orders()
93+
var/text = ""
94+
for(var/datum/mind/pariah in vox)
95+
if(!pariah.current.is_in_brig())
96+
text += "<li>Brig or Kill [pariah]</li>"
97+
for(var/datum/mind/sympathizer in sympathizers)
98+
if(!sympathizer.current.is_in_brig())
99+
text += "<li>Brig [sympathizer]</li>"
100+
return text
101+
102+
/hook/death/proc/vox_or_sympathizer_killed(mob/living/carbon/human/deceased, gibbed)
103+
var/datum/directive/vox_heist/D = get_directive("vox_heist")
104+
if(!D) return 1
105+
106+
var/datum/mind/M = deceased.mind
107+
if(M in D.vox)
108+
D.vox.Remove(M)
109+
if(M in D.sympathizers)
110+
D.sympathizers.Remove(M)
111+
return 1

Diff for: code/game/gamemodes/mutiny/emergency_authentication_device.dm

+8
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@
3737
else
3838
return "Inactive"
3939

40+
proc/launch_shuttle()
41+
spawn(rand(5 SECONDS, 45 SECONDS))
42+
if(emergency_shuttle.call_evac())
43+
spawn(20 SECONDS)
44+
var/text = "[station_name()], we have confirmed your completion of Directive X. An evacuation shuttle is en route to receive your crew for debriefing."
45+
command_alert(text, "Emergency Transmission")
46+
4047
/obj/machinery/emergency_authentication_device/attack_hand(mob/user)
4148
if(activated)
4249
user << "\blue \The [src] is already active!"
@@ -51,6 +58,7 @@
5158
activated = 1
5259
user << "\blue You activate \the [src]!"
5360
state("Command acknowledged. Initiating quantum entanglement relay to NanoTrasen High Command.")
61+
launch_shuttle()
5462
return
5563

5664
if(!captains_key && !secondary_key)

Diff for: code/game/gamemodes/mutiny/mutiny.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ datum/game_mode/mutiny
193193

194194
proc/unbolt_vault_door()
195195
var/obj/machinery/door/airlock/vault = locate(/obj/machinery/door/airlock/vault)
196-
vault.lock()
196+
vault.unlock(1)
197197

198198
proc/make_secret_transcript()
199199
var/obj/machinery/computer/telecomms/server/S = locate(/obj/machinery/computer/telecomms/server)

Diff for: code/modules/mob/mob.dm

+19
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,25 @@ var/list/slot_equipment_priority = list( \
812812
/mob/proc/is_ready()
813813
return client && !!mind
814814

815+
/mob/proc/is_in_brig()
816+
if(!loc || !loc.loc)
817+
return 0
818+
819+
// They should be in a cell or the Brig portion of the shuttle.
820+
var/area/A = loc.loc
821+
if(!istype(A, /area/security/brig))
822+
if(!istype(A, /area/shuttle/escape) || loc.name != "Brig floor")
823+
return 0
824+
825+
// If they still have their ID they're not brigged.
826+
for(var/obj/item/weapon/card/id/card in src)
827+
return 0
828+
for(var/obj/item/device/pda/P in src)
829+
if(P.id)
830+
return 0
831+
832+
return 1
833+
815834
/mob/proc/get_gender()
816835
return gender
817836

0 commit comments

Comments
 (0)