Merge pull request #8455 from Aurorablade/AntagDenied

Borer antag hud check and helper proc
This commit is contained in:
tigercat2000
2017-12-23 18:11:01 -08:00
committed by GitHub
10 changed files with 26 additions and 16 deletions
+1 -1
View File
@@ -457,7 +457,7 @@ proc/pollCandidates(Question, be_special_type, antag_age_check = 0, poll_time =
if(config.use_exp_restrictions && min_hours)
if(G.client.get_exp_living_num() < min_hours * 60)
continue
if(G.has_enabled_antagHUD)
if(cannotPossess(G))
continue
spawn(0)
G << 'sound/misc/notice2.ogg'//Alerting them to their consideration
@@ -123,6 +123,9 @@
GrantBorerActions()
/mob/living/simple_animal/borer/attack_ghost(mob/user)
if(cannotPossess(user))
to_chat(user, "<span class='boldnotice'>Upon using the antagHUD you forfeited the ability to join the round.</span>")
return
if(jobban_isbanned(user, "Syndicate"))
return
if(key)
+1 -1
View File
@@ -51,7 +51,7 @@ var/ert_request_answered = 0
to_chat(src, "<span class='warning'>This role is not yet available to you. You need to wait another [player_age_check] days.</span>")
return 0
if(has_enabled_antagHUD == 1 && config.antag_hud_restricted)
if(cannotPossess(src))
to_chat(src, "<span class='boldnotice'>Upon using the antagHUD you forfeited the ability to join the round.</span>")
return 0
@@ -47,7 +47,7 @@
to_chat(O, "<span class='boldnotice'>\A [src] has been activated. (<a href='?src=[O.UID()];jump=\ref[src]'>Teleport</a> | <a href='?src=[UID()];signup=\ref[O]'>Sign Up</a>)</span>")
/obj/item/device/mmi/posibrain/proc/check_observer(var/mob/dead/observer/O)
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
if(cannotPossess(O))
return 0
if(jobban_isbanned(O, "Cyborg") || jobban_isbanned(O,"nonhumandept"))
return 0
@@ -133,7 +133,7 @@
if(!check_observer(O))
to_chat(O, "<span class='warning'>You cannot be \a [src].</span>")
return
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
if(cannotPossess(O))
to_chat(O, "<span class='warning'>Upon using the antagHUD you forfeited the ability to join the round.</span>")
return
if(jobban_isbanned(O, "Cyborg") || jobban_isbanned(O,"nonhumandept"))
@@ -360,7 +360,7 @@ var/datum/paiController/paiController // Global handler for pAI candidates
return 0
if(!player_old_enough_antag(O.client,ROLE_PAI))
return 0
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
if(cannotPossess(O))
return 0
if(!(O in respawnable_list))
return 0
@@ -263,7 +263,7 @@
/mob/living/silicon/robot/drone/proc/request_player()
for(var/mob/dead/observer/O in player_list)
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
if(cannotPossess(O))
continue
if(jobban_isbanned(O,"nonhumandept") || jobban_isbanned(O,"Drone"))
continue
@@ -118,7 +118,7 @@
var/joinedasobserver = 0
if(istype(src,/mob/dead/observer))
var/mob/dead/observer/G = src
if(G.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
if(cannotPossess(G))
to_chat(usr, "<span class='warning'>Upon using the antagHUD you forfeited the ability to join the round.</span>")
return
if(G.started_as_observer == 1)
@@ -16,7 +16,7 @@
humanize_prompt += " Role: [spider_role_summary]"
if(user.ckey in ts_ckey_blacklist)
error_on_humanize = "You are not able to control any terror spider this round."
else if(user.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
else if(cannotPossess(user))
error_on_humanize = "You have enabled antag HUD and are unable to re-enter the round."
else if(spider_awaymission)
error_on_humanize = "Terror spiders that are part of an away mission cannot be controlled by ghosts."
+14 -7
View File
@@ -51,17 +51,17 @@
return 1
return 0
proc/isLivingSSD(mob/M)
/proc/isLivingSSD(mob/M)
return istype(M) && M.player_logged && M.stat != DEAD
proc/isAntag(A)
/proc/isAntag(A)
if(istype(A, /mob/living/carbon))
var/mob/living/carbon/C = A
if(C.mind && C.mind.special_role)
return 1
return 0
proc/isNonCrewAntag(A)
/proc/isNonCrewAntag(A)
if(!isAntag(A))
return 0
@@ -85,21 +85,28 @@ proc/isNonCrewAntag(A)
return 1
proc/iscuffed(A)
/proc/cannotPossess(A)
var/mob/dead/observer/G = A
if(G.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
return 1
return 0
/proc/iscuffed(A)
if(istype(A, /mob/living/carbon))
var/mob/living/carbon/C = A
if(C.handcuffed)
return 1
return 0
proc/hassensorlevel(A, var/level)
/proc/hassensorlevel(A, var/level)
var/mob/living/carbon/human/H = A
if(istype(H) && istype(H.w_uniform, /obj/item/clothing/under))
var/obj/item/clothing/under/U = H.w_uniform
return U.sensor_mode >= level
return 0
proc/getsensorlevel(A)
/proc/getsensorlevel(A)
var/mob/living/carbon/human/H = A
if(istype(H) && istype(H.w_uniform, /obj/item/clothing/under))
var/obj/item/clothing/under/U = H.w_uniform
@@ -170,7 +177,7 @@ proc/getsensorlevel(A)
p++
return t
proc/slur(phrase, var/list/slurletters = ("'"))//use a different list as an input if you want to make robots slur with $#@%! characters
/proc/slur(phrase, var/list/slurletters = ("'"))//use a different list as an input if you want to make robots slur with $#@%! characters
phrase = html_decode(phrase)
var/leng=lentext(phrase)
var/counter=lentext(phrase)
@@ -458,7 +458,7 @@
return FALSE
if(!O.can_reenter_corpse)
return FALSE
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
if(cannotPossess(O))
return FALSE
return TRUE