From a4196cb74544c21149959bee0f416dc9c21c897a Mon Sep 17 00:00:00 2001 From: Jeremy Liberman Date: Sun, 3 Aug 2014 21:27:07 -0500 Subject: [PATCH] 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 --- baystation12.dme | 1 + .../emergency_shuttle_controller.dm | 12 +- code/datums/mind.dm | 16 +-- .../gamemodes/mutiny/directives/vox_heist.dm | 111 ++++++++++++++++++ .../mutiny/emergency_authentication_device.dm | 8 ++ code/game/gamemodes/mutiny/mutiny.dm | 2 +- code/modules/mob/mob.dm | 19 +++ 7 files changed, 149 insertions(+), 20 deletions(-) create mode 100644 code/game/gamemodes/mutiny/directives/vox_heist.dm diff --git a/baystation12.dme b/baystation12.dme index fe045833b49..8b2f8b2feb2 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -249,6 +249,7 @@ #include "code\game\gamemodes\mutiny\directives\research_to_ripleys_directive.dm" #include "code\game\gamemodes\mutiny\directives\tau_ceti_needs_women_directive.dm" #include "code\game\gamemodes\mutiny\directives\terminations_directive.dm" +#include "code\game\gamemodes\mutiny\directives\vox_heist.dm" #include "code\game\gamemodes\nations\flag_pinpointer.dm" #include "code\game\gamemodes\nations\flagprocs.dm" #include "code\game\gamemodes\nations\nationdatums.dm" diff --git a/code/controllers/emergency_shuttle_controller.dm b/code/controllers/emergency_shuttle_controller.dm index af985971b6b..dcb695779c6 100644 --- a/code/controllers/emergency_shuttle_controller.dm +++ b/code/controllers/emergency_shuttle_controller.dm @@ -63,7 +63,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle //calls the shuttle for an emergency evacuation /datum/emergency_shuttle_controller/proc/call_evac() - if(!can_call()) return + if(!can_call()) return 0 //set the launch timer autopilot = 1 @@ -80,6 +80,8 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle if(istype(A, /area/hallway)) A.readyalert() + return 1 + //calls the shuttle for a routine crew transfer /datum/emergency_shuttle_controller/proc/call_transfer() if(!can_call()) return @@ -134,8 +136,10 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle return 1 /datum/emergency_shuttle_controller/proc/get_shuttle_prep_time() - // During mutiny rounds, the shuttle takes twice as long. - if(ticker && istype(ticker.mode,/datum/game_mode/mutiny)) + // During mutiny rounds, the shuttle takes longer. Unless of course the directive is finished. + if(!ticker) return SHUTTLE_PREPTIME + var/datum/game_mode/mutiny/m = ticker.mode + if(istype(m) && !m.ead.activated) return SHUTTLE_PREPTIME * 3 //15 minutes return SHUTTLE_PREPTIME @@ -261,4 +265,4 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle var/obj/effect/bgstar/S = new/obj/effect/bgstar(locate(x,y,z)) S.direction = spawndir spawn() - S.startmove() \ No newline at end of file + S.startmove() diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 234f525931d..08fedbd7c32 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -1257,18 +1257,7 @@ datum/mind brigged_since = -1 return 0 - var/is_currently_brigged = 0 - - if(istype(T.loc,/area/security/brig)) - is_currently_brigged = 1 - for(var/obj/item/weapon/card/id/card in current) - is_currently_brigged = 0 - break // if they still have ID they're not brigged - for(var/obj/item/device/pda/P in current) - if(P.id) - is_currently_brigged = 0 - break // if they still have ID they're not brigged - + var/is_currently_brigged = current.is_in_brig() if(!is_currently_brigged) brigged_since = -1 return 0 @@ -1278,9 +1267,6 @@ datum/mind return (duration <= world.time - brigged_since) - - - //Initialisation procs /mob/proc/mind_initialize() if(mind) diff --git a/code/game/gamemodes/mutiny/directives/vox_heist.dm b/code/game/gamemodes/mutiny/directives/vox_heist.dm new file mode 100644 index 00000000000..a7a7b99f7a0 --- /dev/null +++ b/code/game/gamemodes/mutiny/directives/vox_heist.dm @@ -0,0 +1,111 @@ +datum/directive/vox_heist + var/list/vox = list() + var/list/sympathizers = list() + + proc/get_vox_candidates() + var/list/candidates[0] + for(var/mob/M in player_list) + if(M.is_ready() && is_vox(M)) + candidates.Add(M) + return candidates + + proc/get_sympathizer_candidates() + var/list/candidates[0] + for(var/mob/M in player_list) + if(M.is_ready() && !is_vox(M) && !M.is_mechanical() && M.mind.assigned_role != "Captain") + candidates[M] = get_weight(M) + return candidates + + proc/is_vox(mob/M) + return M.get_species() == "Vox" + + proc/get_weight(mob/M) + // You will have a high chance of being regarded as a vox sympathizer if your + // relationship with NanoTrasen is negative. Otherwise, command and security + // staff are pretty well trusted and maltreated alien races are easy suspects. + var/relation = M.client.prefs.nanotrasen_relation + if(relation == "Opposed") + return 8 + if(relation == "Skeptical") + return 5 + if(command_positions.Find(M.mind.assigned_role)) + return 1 + var/species = M.get_species() + if(species == "Tajaran" || species == "Unathi") + return 5 + if(security_positions.Find(M.mind.assigned_role)) + return 2 + return 3 + +datum/directive/vox_heist/get_description() + return {" +

+ A vox warship has commandeered a NanoTrasen transport carrying 2,500 cubic meters of liquid plasma. + 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()]. + If the transport is not recovered, the estimated loss of profits is a threat to the solvency of the company. + Predictive analysis has identified certain members of the crew as sympathetic to the vox pariah. Detain the sympathizers to guarantee a successful exchange. + Lethal force is authorized by the High Command Department of Security. Further information is classified. +

+ "} + +datum/directive/vox_heist/initialize() + var/list/vox_candidates = get_vox_candidates() + for(var/mob/pariah in vox_candidates) + vox.Add(pariah.mind) + + special_orders = list( + "Brig or kill all Vox Pariah.") + + var/list/sympathizer_candidates = get_sympathizer_candidates() + var/list/sympathizer_names = list() + var/sympathizer_count = min(rand(2,4), sympathizer_candidates.len) + for(var/i=0, i < sympathizer_count, i++) + if(!sympathizer_candidates.len) + break + + var/mob/candidate = pickweight(sympathizer_candidates) + sympathizer_candidates.Remove(candidate) + sympathizers.Add(candidate.mind) + sympathizer_names.Add("[candidate.mind.assigned_role] [candidate.mind.name]") + + if(sympathizers.len) + special_orders.Add("Brig the following sympathizers: [list2text(sympathizer_names, ", ")]") + +datum/directive/vox_heist/meets_prerequisites() + var/list/candidates = get_vox_candidates() + return candidates.len >= 2 + +datum/directive/vox_heist/directives_complete() + if(!vox.len && !sympathizers.len) + return 1 + + for(var/datum/mind/pariah in vox) + if(!pariah.current.is_in_brig()) + return 0 + + for(var/datum/mind/sympathizer in sympathizers) + if(!sympathizer.current.is_in_brig()) + return 0 + + return 1 + +datum/directive/vox_heist/get_remaining_orders() + var/text = "" + for(var/datum/mind/pariah in vox) + if(!pariah.current.is_in_brig()) + text += "
  • Brig or Kill [pariah]
  • " + for(var/datum/mind/sympathizer in sympathizers) + if(!sympathizer.current.is_in_brig()) + text += "
  • Brig [sympathizer]
  • " + return text + +/hook/death/proc/vox_or_sympathizer_killed(mob/living/carbon/human/deceased, gibbed) + var/datum/directive/vox_heist/D = get_directive("vox_heist") + if(!D) return 1 + + var/datum/mind/M = deceased.mind + if(M in D.vox) + D.vox.Remove(M) + if(M in D.sympathizers) + D.sympathizers.Remove(M) + return 1 diff --git a/code/game/gamemodes/mutiny/emergency_authentication_device.dm b/code/game/gamemodes/mutiny/emergency_authentication_device.dm index 5bdcf27576e..80fb00d107f 100644 --- a/code/game/gamemodes/mutiny/emergency_authentication_device.dm +++ b/code/game/gamemodes/mutiny/emergency_authentication_device.dm @@ -37,6 +37,13 @@ else return "Inactive" + proc/launch_shuttle() + spawn(rand(5 SECONDS, 45 SECONDS)) + if(emergency_shuttle.call_evac()) + spawn(20 SECONDS) + var/text = "[station_name()], we have confirmed your completion of Directive X. An evacuation shuttle is en route to receive your crew for debriefing." + command_alert(text, "Emergency Transmission") + /obj/machinery/emergency_authentication_device/attack_hand(mob/user) if(activated) user << "\blue \The [src] is already active!" @@ -51,6 +58,7 @@ activated = 1 user << "\blue You activate \the [src]!" state("Command acknowledged. Initiating quantum entanglement relay to NanoTrasen High Command.") + launch_shuttle() return if(!captains_key && !secondary_key) diff --git a/code/game/gamemodes/mutiny/mutiny.dm b/code/game/gamemodes/mutiny/mutiny.dm index d091bba4147..dd0ee4bb70e 100644 --- a/code/game/gamemodes/mutiny/mutiny.dm +++ b/code/game/gamemodes/mutiny/mutiny.dm @@ -193,7 +193,7 @@ datum/game_mode/mutiny proc/unbolt_vault_door() var/obj/machinery/door/airlock/vault = locate(/obj/machinery/door/airlock/vault) - vault.lock() + vault.unlock(1) proc/make_secret_transcript() var/obj/machinery/computer/telecomms/server/S = locate(/obj/machinery/computer/telecomms/server) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 32aa6704c42..ce564b90ca4 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -812,6 +812,25 @@ var/list/slot_equipment_priority = list( \ /mob/proc/is_ready() return client && !!mind +/mob/proc/is_in_brig() + if(!loc || !loc.loc) + return 0 + + // They should be in a cell or the Brig portion of the shuttle. + var/area/A = loc.loc + if(!istype(A, /area/security/brig)) + if(!istype(A, /area/shuttle/escape) || loc.name != "Brig floor") + return 0 + + // If they still have their ID they're not brigged. + for(var/obj/item/weapon/card/id/card in src) + return 0 + for(var/obj/item/device/pda/P in src) + if(P.id) + return 0 + + return 1 + /mob/proc/get_gender() return gender