Merge pull request #53702 from zxaber/kiltborg

[READY] Highlander mode now includes silicons
This commit is contained in:
nemvar
2020-10-02 17:39:16 +02:00
committed by GitHub
13 changed files with 148 additions and 20 deletions
+18 -7
View File
@@ -265,15 +265,26 @@
SSticker.emergency_reason = null
/obj/docking_port/mobile/emergency/proc/is_hijacked()
/**
* Proc that handles checking if the emergency shuttle was successfully hijacked
*
* Checks for all mobs on the shuttle, checks their status, and checks if they're
* borgs or simple animals. Depending on the args, certain mobs may be ignored,
* and the presence of other antags may or may not invalidate a hijack.
* Args:
* filter_by_human, default TRUE, tells the proc that only humans should block a hijack. Borgs and animals are ignored and will not block if this is TRUE.
* solo_hijack, default FALSE, tells the proc to fail with multiple hijackers, such as for Highlander mode.
*/
/obj/docking_port/mobile/emergency/proc/is_hijacked(filter_by_human = TRUE, solo_hijack = FALSE)
var/has_people = FALSE
var/hijacker_present = FALSE
var/hijacker_count = 0
for(var/mob/living/player in GLOB.player_list)
if(player.mind)
if(player.stat != DEAD)
if(issilicon(player)) //Borgs are technically dead anyways
if(issilicon(player) && filter_by_human) //Borgs are technically dead anyways
continue
if(isanimal(player)) //animals don't count
if(isanimal(player) && filter_by_human) //animals don't count
continue
if(isbrain(player)) //also technically dead
continue
@@ -287,7 +298,7 @@
var/prevent = FALSE
for(var/datum/antagonist/A in player.mind.antag_datums)
if(A.can_hijack == HIJACK_HIJACKER)
hijacker_present = TRUE
hijacker_count += 1
prevent = FALSE
break //If we have both prevent and hijacker antags assume we want to hijack.
else if(A.can_hijack == HIJACK_PREVENT)
@@ -295,8 +306,8 @@
if(prevent)
return FALSE
return has_people && hijacker_present
//has people AND either there's only one hijacker or there's any but solo_hijack is disabled
return has_people && ((hijacker_count == 1) || (hijacker_count && !solo_hijack))
/obj/docking_port/mobile/emergency/proc/ShuttleDBStuff()
set waitfor = FALSE