From 5dada0e63a287ec99d259615cd11121b9aede90b Mon Sep 17 00:00:00 2001 From: Salex08 <33989683+Salex08@users.noreply.github.com> Date: Thu, 29 Sep 2022 23:52:21 +0200 Subject: [PATCH] Removes ghost check for battlecruiser objective and fixes players being able to roll it multiple times in a row (#70194) Removes the ghost check for the battlecruiser objective Fixes the same player being able to reroll battlecruiser --- code/modules/antagonists/_common/antag_team.dm | 2 ++ code/modules/antagonists/ashwalker/ashwalker.dm | 1 - .../objectives/final_objective/battlecruiser.dm | 11 ----------- code/modules/mob_spawn/ghost_roles/space_roles.dm | 7 +++++++ code/modules/shuttle/battlecruiser_starfury.dm | 1 + 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/code/modules/antagonists/_common/antag_team.dm b/code/modules/antagonists/_common/antag_team.dm index b049ae06fad..4f6ba5737e3 100644 --- a/code/modules/antagonists/_common/antag_team.dm +++ b/code/modules/antagonists/_common/antag_team.dm @@ -13,6 +13,8 @@ GLOBAL_LIST_EMPTY(antagonist_teams) var/list/datum/mind/members = list() ///Common objectives, these won't be added or removed automatically, subtypes handle this, this is here for bookkeeping purposes. var/list/datum/objective/objectives = list() + ///List of players in a team, mainly used to make sure someone cant spawn ghost roll more then once in a row + var/list/players_spawned = list() /datum/team/New(starting_members) . = ..() diff --git a/code/modules/antagonists/ashwalker/ashwalker.dm b/code/modules/antagonists/ashwalker/ashwalker.dm index 909bf26709a..a0e33d16e59 100644 --- a/code/modules/antagonists/ashwalker/ashwalker.dm +++ b/code/modules/antagonists/ashwalker/ashwalker.dm @@ -1,7 +1,6 @@ /datum/team/ashwalkers name = "Ashwalkers" show_roundend_report = FALSE - var/list/players_spawned = new /datum/antagonist/ashwalker name = "\improper Ash Walker" diff --git a/code/modules/antagonists/traitor/objectives/final_objective/battlecruiser.dm b/code/modules/antagonists/traitor/objectives/final_objective/battlecruiser.dm index 93179a8ed9a..beade89f7ab 100644 --- a/code/modules/antagonists/traitor/objectives/final_objective/battlecruiser.dm +++ b/code/modules/antagonists/traitor/objectives/final_objective/battlecruiser.dm @@ -1,6 +1,3 @@ -/// The minimum number of ghosts and observers needed before handing out battlecruiser objectives. -#define MIN_GHOSTS_FOR_BATTLECRUISER 8 - /datum/traitor_objective/final/battlecruiser name = "Reveal Station Coordinates to nearby Syndicate Battlecruiser" description = "Use a special upload card on a communications console to send the coordinates \ @@ -18,12 +15,6 @@ // There's no empty space to load a battlecruiser in... if(!SSmapping.empty_space) return FALSE - // Check how many observers + ghosts (dead players) we have. - // If there's not a ton of observers and ghosts to populate the battlecruiser, - // We won't bother giving the objective out. - var/num_ghosts = length(GLOB.current_observers_list) + length(GLOB.dead_player_list) - if(num_ghosts < MIN_GHOSTS_FOR_BATTLECRUISER) - return FALSE return TRUE @@ -58,5 +49,3 @@ "style" = STYLE_SYNDICATE, "spawn" = emag_card, )) - -#undef MIN_GHOSTS_FOR_BATTLECRUISER diff --git a/code/modules/mob_spawn/ghost_roles/space_roles.dm b/code/modules/mob_spawn/ghost_roles/space_roles.dm index c4904cdf186..7fc64240b98 100644 --- a/code/modules/mob_spawn/ghost_roles/space_roles.dm +++ b/code/modules/mob_spawn/ghost_roles/space_roles.dm @@ -117,12 +117,19 @@ /// The antag datum to give to the player spawned var/antag_datum_to_give = /datum/antagonist/battlecruiser +/obj/effect/mob_spawn/ghost_role/human/syndicate/battlecruiser/allow_spawn(mob/user, silent = FALSE) + if(!(user.ckey in antag_team.players_spawned)) + return TRUE + to_chat(user, span_boldwarning("You have already used up your chance to roll as Battlecruiser.")) + return FALSE + /obj/effect/mob_spawn/ghost_role/human/syndicate/battlecruiser/special(mob/living/spawned_mob, mob/possesser) . = ..() if(!spawned_mob.mind) spawned_mob.mind_initialize() var/datum/mind/mob_mind = spawned_mob.mind mob_mind.add_antag_datum(antag_datum_to_give, antag_team) + antag_team.players_spawned += (spawned_mob.ckey) /datum/team/battlecruiser name = "\improper Battlecruiser Crew" diff --git a/code/modules/shuttle/battlecruiser_starfury.dm b/code/modules/shuttle/battlecruiser_starfury.dm index a513f60fbba..53f6f13cd31 100644 --- a/code/modules/shuttle/battlecruiser_starfury.dm +++ b/code/modules/shuttle/battlecruiser_starfury.dm @@ -172,6 +172,7 @@ if(candidates.len > 0) var/mob/our_candidate = candidates[1] spawner.create(our_candidate) + spawner.antag_team.players_spawned += (our_candidate.ckey) candidates.Splice(1, 2) notify_ghosts( "The battlecruiser has an object of interest: [our_candidate]!",