diff --git a/code/__DEFINES/antagonists.dm b/code/__DEFINES/antagonists.dm index 97d4126e351..764e21105dd 100644 --- a/code/__DEFINES/antagonists.dm +++ b/code/__DEFINES/antagonists.dm @@ -26,4 +26,9 @@ #define ERT_ENG "eng" #define ERT_LEADER "leader" #define DEATHSQUAD "ds" -#define DEATHSQUAD_LEADER "ds_leader" \ No newline at end of file +#define DEATHSQUAD_LEADER "ds_leader" + +//Shuttle hijacking +#define HIJACK_NEUTRAL 0 //Does not stop hijacking but itself won't hijack +#define HIJACK_HIJACKER 1 //Needs to be present for shuttle to be hijacked +#define HIJACK_PREVENT 2 //Prevents hijacking same way as non-antags \ No newline at end of file diff --git a/code/modules/antagonists/_common/antag_datum.dm b/code/modules/antagonists/_common/antag_datum.dm index 50281d54b4b..aa91af1dd85 100644 --- a/code/modules/antagonists/_common/antag_datum.dm +++ b/code/modules/antagonists/_common/antag_datum.dm @@ -14,7 +14,8 @@ GLOBAL_LIST_EMPTY(antagonists) var/list/objectives = list() var/antag_memory = ""//These will be removed with antag datum var/antag_moodlet //typepath of moodlet that the mob will gain with their status - + var/can_hijack = HIJACK_NEUTRAL //If these antags are alone on shuttle hijack happens. + //Antag panel properties var/show_in_antagpanel = TRUE //This will hide adding this antag type in antag panel, use only for internal subtypes that shouldn't be added directly but still show if possessed by mind var/antagpanel_category = "Uncategorized" //Antagpanel will display these together, REQUIRED diff --git a/code/modules/antagonists/brother/brother.dm b/code/modules/antagonists/brother/brother.dm index 8527ab533c5..f63e81acbfe 100644 --- a/code/modules/antagonists/brother/brother.dm +++ b/code/modules/antagonists/brother/brother.dm @@ -5,6 +5,7 @@ var/special_role = ROLE_BROTHER var/datum/team/brother_team/team antag_moodlet = /datum/mood_event/focused + can_hijack = HIJACK_HIJACKER /datum/antagonist/brother/create_team(datum/team/brother_team/new_team) if(!new_team) diff --git a/code/modules/antagonists/ert/ert.dm b/code/modules/antagonists/ert/ert.dm index f1e1d92c9d7..53f8aa2da11 100644 --- a/code/modules/antagonists/ert/ert.dm +++ b/code/modules/antagonists/ert/ert.dm @@ -12,6 +12,7 @@ var/list/name_source show_in_antagpanel = FALSE antag_moodlet = /datum/mood_event/focused + can_hijack = HIJACK_PREVENT /datum/antagonist/ert/on_gain() update_name() diff --git a/code/modules/antagonists/highlander/highlander.dm b/code/modules/antagonists/highlander/highlander.dm index 62da2df87f5..1fa37f3a51c 100644 --- a/code/modules/antagonists/highlander/highlander.dm +++ b/code/modules/antagonists/highlander/highlander.dm @@ -3,6 +3,7 @@ var/obj/item/claymore/highlander/sword show_in_antagpanel = FALSE show_name_in_check_antagonists = TRUE + can_hijack = HIJACK_HIJACKER /datum/antagonist/highlander/apply_innate_effects(mob/living/mob_override) var/mob/living/L = owner.current || mob_override diff --git a/code/modules/antagonists/ninja/ninja.dm b/code/modules/antagonists/ninja/ninja.dm index f157bc60804..a8bce90f1ca 100644 --- a/code/modules/antagonists/ninja/ninja.dm +++ b/code/modules/antagonists/ninja/ninja.dm @@ -8,6 +8,11 @@ var/give_objectives = TRUE var/give_equipment = TRUE +/datum/antagonist/ninja/New() + if(helping_station) + can_hijack = HIJACK_PREVENT + . = ..() + /datum/antagonist/ninja/apply_innate_effects(mob/living/mob_override) var/mob/living/M = mob_override || owner.current update_ninja_icons_added(M) @@ -137,6 +142,8 @@ adj = "objectiveless" else return + if(helping_station) + can_hijack = HIJACK_PREVENT new_owner.assigned_role = ROLE_NINJA new_owner.special_role = ROLE_NINJA new_owner.add_antag_datum(src) diff --git a/code/modules/antagonists/nukeop/nukeop.dm b/code/modules/antagonists/nukeop/nukeop.dm index db25adcda44..af348dc34b6 100644 --- a/code/modules/antagonists/nukeop/nukeop.dm +++ b/code/modules/antagonists/nukeop/nukeop.dm @@ -8,6 +8,7 @@ var/always_new_team = FALSE //If not assigned a team by default ops will try to join existing ones, set this to TRUE to always create new team. var/send_to_spawnpoint = TRUE //Should the user be moved to default spawnpoint. var/nukeop_outfit = /datum/outfit/syndicate + can_hijack = HIJACK_HIJACKER //Alternative way to wipe out the station. /datum/antagonist/nukeop/proc/update_synd_icons_added(mob/living/M) var/datum/atom_hud/antag/opshud = GLOB.huds[ANTAG_HUD_OPS] diff --git a/code/modules/antagonists/official/official.dm b/code/modules/antagonists/official/official.dm index 23bf4724227..26de196cb43 100644 --- a/code/modules/antagonists/official/official.dm +++ b/code/modules/antagonists/official/official.dm @@ -4,6 +4,7 @@ show_in_antagpanel = FALSE var/datum/objective/mission var/datum/team/ert/ert_team + can_hijack = HIJACK_PREVENT /datum/antagonist/official/greet() to_chat(owner, "You are a CentCom Official.") diff --git a/code/modules/antagonists/traitor/datum_traitor.dm b/code/modules/antagonists/traitor/datum_traitor.dm index 9066759648f..47823a2dc4c 100644 --- a/code/modules/antagonists/traitor/datum_traitor.dm +++ b/code/modules/antagonists/traitor/datum_traitor.dm @@ -13,6 +13,7 @@ var/should_give_codewords = TRUE var/should_equip = TRUE var/traitor_kind = TRAITOR_HUMAN //Set on initial assignment + can_hijack = HIJACK_HIJACKER /datum/antagonist/traitor/on_gain() if(owner.current && isAI(owner.current)) diff --git a/code/modules/antagonists/wishgranter/wishgranter.dm b/code/modules/antagonists/wishgranter/wishgranter.dm index 3f7fac9d187..318de51eb4c 100644 --- a/code/modules/antagonists/wishgranter/wishgranter.dm +++ b/code/modules/antagonists/wishgranter/wishgranter.dm @@ -2,6 +2,7 @@ name = "Wishgranter Avatar" show_in_antagpanel = FALSE show_name_in_check_antagonists = TRUE + can_hijack = HIJACK_HIJACKER /datum/antagonist/wishgranter/proc/forge_objectives() var/datum/objective/hijack/hijack = new diff --git a/code/modules/antagonists/wizard/wizard.dm b/code/modules/antagonists/wizard/wizard.dm index c5bc0cc5f7c..32322d339a3 100644 --- a/code/modules/antagonists/wizard/wizard.dm +++ b/code/modules/antagonists/wizard/wizard.dm @@ -12,6 +12,7 @@ var/move_to_lair = TRUE var/outfit_type = /datum/outfit/wizard var/wiz_age = WIZARD_AGE_MIN /* Wizards by nature cannot be too young. */ + can_hijack = HIJACK_HIJACKER /datum/antagonist/wizard/on_gain() register() diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index a1b57946d84..08fd5db20e9 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -245,7 +245,7 @@ /obj/docking_port/mobile/emergency/proc/is_hijacked() var/has_people = FALSE - + var/hijacker_present = FALSE for(var/mob/living/player in GLOB.player_list) if(player.mind) if(player.stat != DEAD) @@ -258,10 +258,23 @@ if(shuttle_areas[get_area(player)]) has_people = TRUE var/location = get_turf(player.mind.current) + //Non-antag present. Can't hijack. if(!(player.mind.has_antag_datum(/datum/antagonist)) && !istype(location, /turf/open/floor/plasteel/shuttle/red) && !istype(location, /turf/open/floor/mineral/plastitanium/brig)) return FALSE + //Antag present, doesn't stop but let's see if we actually want to hijack + var/prevent = FALSE + for(var/datum/antagonist/A in player.mind.antag_datums) + if(A.can_hijack == HIJACK_HIJACKER) + hijacker_present = TRUE + prevent = FALSE + break //If we have both prevent and hijacker antags assume we want to hijack. + else if(A.can_hijack == HIJACK_PREVENT) + prevent = TRUE + if(prevent) + return FALSE - return has_people + + return has_people && hijacker_present /obj/docking_port/mobile/emergency/proc/ShuttleDBStuff() set waitfor = FALSE