From 65cded02a6ca0d11a42c6a618a62fde07dcf956d Mon Sep 17 00:00:00 2001 From: Bobbanz1 <59128051+Bobbanz1@users.noreply.github.com> Date: Thu, 9 Nov 2023 08:30:12 +0100 Subject: [PATCH] Should be showing the ghost ship now. Might have broken ghost ships as the stop observe button causes a runtime error for them. --- nsv13.dme | 2 ++ nsv13/code/controllers/subsystem/overmap_mode.dm | 2 +- nsv13/code/modules/antagonists/ghostship/ghost_ship.dm | 8 ++++++++ .../modules/antagonists/role_preference/role_midrounds.dm | 3 +++ nsv13/code/modules/overmap/ai-skynet.dm | 2 +- nsv13/code/modules/overmap/overmap_ghosts.dm | 6 +++++- 6 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 nsv13/code/modules/antagonists/ghostship/ghost_ship.dm create mode 100644 nsv13/code/modules/antagonists/role_preference/role_midrounds.dm diff --git a/nsv13.dme b/nsv13.dme index 40df31aca9e..840fd1fe536 100644 --- a/nsv13.dme +++ b/nsv13.dme @@ -3845,7 +3845,9 @@ #include "nsv13\code\modules\antagonists\simple_teamchat.dm" #include "nsv13\code\modules\antagonists\boarders\boarders.dm" #include "nsv13\code\modules\antagonists\boarders\pirate_boarders.dm" +#include "nsv13\code\modules\antagonists\ghostship\ghost_ship.dm" #include "nsv13\code\modules\antagonists\role_preference\role_antagonists.dm" +#include "nsv13\code\modules\antagonists\role_preference\role_midrounds.dm" #include "nsv13\code\modules\atmospherics\gasmixtures\reactions.dm" #include "nsv13\code\modules\atmospherics\machinery\components\binary_devices\constrictor.dm" #include "nsv13\code\modules\atmospherics\machinery\components\unary_devices\tank.dm" diff --git a/nsv13/code/controllers/subsystem/overmap_mode.dm b/nsv13/code/controllers/subsystem/overmap_mode.dm index aa9b2e5833a..b7547bebe80 100644 --- a/nsv13/code/controllers/subsystem/overmap_mode.dm +++ b/nsv13/code/controllers/subsystem/overmap_mode.dm @@ -649,7 +649,7 @@ SUBSYSTEM_DEF(overmap_mode) if("Cancel") return if("Open") - var/list/mob/dead/observer/candidates = pollGhostCandidates("Do you wish to pilot a [initial(target_ship.faction)] [initial(target_ship.name)]?", ROLE_GHOSTSHIP, null, null, 20 SECONDS, POLL_IGNORE_GHOSTSHIP) + var/list/mob/dead/observer/candidates = pollGhostCandidates("Do you wish to pilot a [initial(target_ship.faction)] [initial(target_ship.name)]?", ROLE_GHOSTSHIP, /datum/role_preference/midround_ghost/ghost_ship, 20 SECONDS, POLL_IGNORE_GHOSTSHIP) if(LAZYLEN(candidates)) var/mob/dead/observer/C = pick(candidates) target_ghost = C diff --git a/nsv13/code/modules/antagonists/ghostship/ghost_ship.dm b/nsv13/code/modules/antagonists/ghostship/ghost_ship.dm new file mode 100644 index 00000000000..000247bb89c --- /dev/null +++ b/nsv13/code/modules/antagonists/ghostship/ghost_ship.dm @@ -0,0 +1,8 @@ +/datum/antagonist/ghost_ship + name = "Ghost Ship" + show_name_in_check_antagonists = TRUE + show_in_antagpanel = FALSE + show_in_roundend = FALSE + banning_key = ROLE_GHOSTSHIP + +///Used for tracking and because the role_preferences needs an antag_datum to point at. diff --git a/nsv13/code/modules/antagonists/role_preference/role_midrounds.dm b/nsv13/code/modules/antagonists/role_preference/role_midrounds.dm new file mode 100644 index 00000000000..8f416d91b41 --- /dev/null +++ b/nsv13/code/modules/antagonists/role_preference/role_midrounds.dm @@ -0,0 +1,3 @@ +/datum/role_preference/midround_ghost/ghost_ship + name = "Ghost Ship" + antag_datum = /datum/antagonist/ghost_ship diff --git a/nsv13/code/modules/overmap/ai-skynet.dm b/nsv13/code/modules/overmap/ai-skynet.dm index bb1164370fa..ee27495730c 100644 --- a/nsv13/code/modules/overmap/ai-skynet.dm +++ b/nsv13/code/modules/overmap/ai-skynet.dm @@ -716,7 +716,7 @@ Adding tasks is easy! Just define a datum for it. var/target_location = locate(rand(round(world.maxx/2) + 10, world.maxx - 39), rand(40, world.maxy - 39), OM.z) var/obj/structure/overmap/selected_ship = pick(ship_list) var/target_ghost - var/list/mob/dead/observer/candidates = pollGhostCandidates("Do you wish to pilot a [initial(selected_ship.faction)] [initial(selected_ship.name)]?", ROLE_GHOSTSHIP, null, null, 20 SECONDS, POLL_IGNORE_GHOSTSHIP) + var/list/mob/dead/observer/candidates = pollGhostCandidates("Do you wish to pilot a [initial(selected_ship.faction)] [initial(selected_ship.name)]?", ROLE_GHOSTSHIP, /datum/role_preference/midround_ghost/ghost_ship, 20 SECONDS, POLL_IGNORE_GHOSTSHIP) if(LAZYLEN(candidates)) var/mob/dead/observer/C = pick(candidates) target_ghost = C diff --git a/nsv13/code/modules/overmap/overmap_ghosts.dm b/nsv13/code/modules/overmap/overmap_ghosts.dm index 490fc64c97f..c9bc8c763da 100644 --- a/nsv13/code/modules/overmap/overmap_ghosts.dm +++ b/nsv13/code/modules/overmap/overmap_ghosts.dm @@ -16,7 +16,7 @@ if("Cancel") return if("Open") - var/list/mob/dead/observer/candidates = pollGhostCandidates("Do you wish to pilot a [src.faction] [src.name]?", ROLE_GHOSTSHIP, null, null, 20 SECONDS, POLL_IGNORE_GHOSTSHIP) + var/list/mob/dead/observer/candidates = pollGhostCandidates("Do you wish to pilot a [src.faction] [src.name]?", ROLE_GHOSTSHIP, /datum/role_preference/midround_ghost/ghost_ship, 20 SECONDS, POLL_IGNORE_GHOSTSHIP) if(LAZYLEN(candidates)) var/mob/dead/observer/C = pick(candidates) target_ghost = C @@ -79,6 +79,10 @@ ghost.hud_type = /datum/hud //Mostly blank hud ghost.key = target.key + //More or less a modified version of how the morph antag gets the antag datum. + if(ghost.mind) + ghost.mind.add_antag_datum(/datum/antagonist/ghost_ship) + //Allows player to hear hails mobs_in_ship += ghost