From 1583eb437fa2909b95bf3e31dde21edd3afc9f5e Mon Sep 17 00:00:00 2001 From: Mloc-Argent Date: Sun, 17 Nov 2013 17:28:50 +0000 Subject: [PATCH 1/6] Updated HUD Icons Was using some rather outdated icons. Copied the icons from mob.dmi and named them appropriately. --- icons/mob/hud.dmi | Bin 2660 -> 2902 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/icons/mob/hud.dmi b/icons/mob/hud.dmi index b13b296cf1075606e11bfc457faa67ca471c75b7..0502c01147dccacc311e72977314974e725be839 100644 GIT binary patch delta 2617 zcmY*ZdpHw{8{Q0azm(i%A}r@5QF6&PqS0K=aEutrE#!X5bvq`B(mHNy<^1M45h5xa z=F;3{?wm|Wn6Z>Qv7i1p=Q-zlp7(j5=lkn>pYMI&d8sjJq8iXD|1|I>(D_g^gB!%d z0|4NqEv1jyA8To80brNmmE5l&P!=mkw@)`=3M=j+?$f6$eqCH9Uj`2V2>A-R_v!M5 z@k#1S0`LHXaz$9_DdcOlEDf3&0000+pl$2{@P!E<0Dwn2(-NqN>$c}zty35(k&Bx2 z_S4yT*=*X1tfl{&W1MD_bNOJt2xRD?WWx0Nq;Y?w6PH_Fwf*trNvG(K$~kdkrwl5Z zUj)G_bJGcTgg0-7zjEcxF`3vcl$9I*Y)*>zNR!Tx>AfrS^XB4a*dSCi9!oPnZNa;a zIysvd)*}%8dM&o812;P$xRq5AT*8 zigkb*RG)fLIEXy9R5HNC6q-=q*+n!!rb3rb>-c1Zd7@>`biF^n&=%j_f>oqXMb5n} zPec`U7~1Iswoh`~g3vme_uOU>X)1o9ZQXFp`q`(Kh|}o{I8q#uW1y3`#eTK_AkF;Z z{CWOgLp#nE#U4it>Q@ES-4-l4R{9Fjg4$6HG!uxaG$F0X^}270)Vt7&d4(jrsYNpi z7KVzgH4=UgJlrPwW3r56&qWJtySfAVxg>F7K0$_I8%-+UtO>+7dou1MF=<;)YGT=q!IMP!)4QsxZW12tDHefy)i>^--Ihaxu!(hAOT*F8 z&o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~M{Za=rTKzC;Dg()Rca%NZa4vD1fx2R;cDVU|F)ygl?{>K_w5KO8t)!$ WH&IcnHN%hoyVb=3Yu|7x==wi6xMHOM From dbf24606bd87268e8f5487afcd5bb03282db5d6f Mon Sep 17 00:00:00 2001 From: Ccomp5950 Date: Sun, 17 Nov 2013 08:24:23 -0600 Subject: [PATCH 2/6] The Ghost AntagHUD Feature. Created configurations for Server Admins to be able to toggle it within default config. Modified my previous AdminVerb that allows respawns to bypass the limitations of the restrictions while also letting the admins know if the ghost has used AntagHUD Created restriction checks for various forms of joining the round and if administrators/hosts have restricted AntagHUD users from joining the round they will not be able to. To Do: Create Adminverb for toggling restrictions to also be able to toggle everyones ability to use antagHUD for a round. Create a method for "Job Banning" users from using antagHUD. --- code/controllers/configuration.dm | 8 +- code/modules/admin/verbs/randomverbs.dm | 18 +++-- code/modules/mob/dead/observer/observer.dm | 81 ++++++++++++++++++- .../mob/living/carbon/brain/posibrain.dm | 2 + .../modules/mob/living/silicon/pai/recruit.dm | 2 + code/modules/mob/mob.dm | 5 ++ config/example/config.txt | 6 ++ 7 files changed, 114 insertions(+), 8 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 42ac1cdc97f..f2b5f01ce36 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -43,7 +43,8 @@ var/Tickcomp = 0 var/socket_talk = 0 // use socket_talk to communicate with other processes var/list/resource_urls = null - + var/antag_hud_allowed = 0 // Ghosts can turn on Antagovision to see a HUD of who is the bad guys this round. + var/antag_hud_restricted = 0 // Ghosts that turn on Antagovision cannot rejoin the round. var/list/mode_names = list() var/list/modes = list() // allowed modes var/list/votable_modes = list() // votable modes @@ -385,6 +386,11 @@ if("ticklag") Ticklag = text2num(value) + if("allow_antag_hud") + config.antag_hud_allowed = 1 + if("antag_hud_restricted") + config.antag_hud_restricted = 1 + if("socket_talk") socket_talk = text2num(value) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 3447d70e677..6a5af5cf25f 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -229,7 +229,7 @@ Ccomp's first proc. /client/proc/allow_character_respawn() set category = "Special Verbs" set name = "Allow player to respawn" - set desc = "Let's the player bypass the 30 minute wait to respawn." + set desc = "Let's the player bypass the 30 minute wait to respawn or allow them to re-enter their corpse." if(!holder) src << "Only administrators may use this command." var/any = 0 @@ -252,14 +252,20 @@ Ccomp's first proc. src << "Hrm, appears you didn't select a ghost" // Sanity check, if no ghosts in the list we don't want to edit a null variable and cause a runtime error. return - var/mob/M = ghosts[target] - M.timeofdeath=-19999 /* time of death is checked in /mob/verb/abandon_mob() which is the Respawn verb. + var/mob/dead/observer/G = ghosts[target] + if(G.has_enabled_antagHUD && config.antag_hud_restricted) + var/response = alert(src, "Are you sure you wish to allow this individual to play?","Ghost has used AntagHUD","Yes","No") + if(response == "No") return + G.timeofdeath=-19999 /* time of death is checked in /mob/verb/abandon_mob() which is the Respawn verb. timeofdeath is used for bodies on autopsy but since we're messing with a ghost I'm pretty sure there won't be an autopsy. */ - M:show_message(text("\blue You may now respawn. You should roleplay as if you learned nothing about the round during your time with the dead."), 1) - log_admin("[key_name(usr)] allowed [key_name(M)] to bypass the 30 minute respawn limit") - message_admins("Admin [key_name_admin(usr)] allowed [key_name_admin(M)] to bypass the 30 minute respawn limit", 1) + G.has_enabled_antagHUD = 2 + G.can_reenter_corpse = 1 + + G:show_message(text("\blue You may now respawn. You should roleplay as if you learned nothing about the round during your time with the dead."), 1) + log_admin("[key_name(usr)] allowed [key_name(G)] to bypass the 30 minute respawn limit") + message_admins("Admin [key_name_admin(usr)] allowed [key_name_admin(G)] to bypass the 30 minute respawn limit", 1) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index ae544c43d54..9df4b8a84ca 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -16,6 +16,8 @@ var/started_as_observer //This variable is set to 1 when you enter the game as an observer. //If you died in the game and are a ghsot - this will remain as null. //Note that this is not a reliable way to determine if admins started as observers, since they change mobs a lot. + var/has_enabled_antagHUD = 0 + var/antagHUD = 0 universal_speak = 1 var/atom/movable/following = null /mob/dead/observer/New(mob/body) @@ -70,6 +72,60 @@ Transfer_mind is there to check if mob is being deleted/not going to have a body Works together with spawning an observer, noted above. */ +/mob/dead/observer/Life() + ..() + if(!loc) return + if(!client) return 0 + + + if(client.images.len) + for(var/image/hud in client.images) + if(copytext(hud.icon_state,1,4) == "hud") + client.images.Remove(hud) + if(M.antagHUD) + var/list/target_list = list() + for(var/mob/living/target in oview(M)) + if( target.mind&&(target.mind.special_role||issilicon(target)) ) + target_list += target + if(target_list.len) + M.assess_targets(target_list, M) + + + +/mob/dead/proc/assess_targets(list/target_list, mob/living/carbon/U) + var/icon/tempHud = 'icons/mob/hud.dmi' + for(var/mob/living/target in target_list) + if(iscarbon(target)) + switch(target.mind.special_role) + if("traitor","Syndicate") + U.client.images += image(tempHud,target,"hudsyndicate") + if("Revolutionary") + U.client.images += image(tempHud,target,"hudrevolutionary") + if("Head Revolutionary") + U.client.images += image(tempHud,target,"hudheadrevolutionary") + if("Cultist") + U.client.images += image(tempHud,target,"hudcultist") + if("Changeling") + U.client.images += image(tempHud,target,"hudchangeling") + if("Wizard","Fake Wizard") + U.client.images += image(tempHud,target,"hudwizard") + if("Hunter","Sentinel","Drone","Queen") + U.client.images += image(tempHud,target,"hudalien") + if("Death Commando") + U.client.images += image(tempHud,target,"huddeathsquad") + if("Ninja") + U.client.images += image(tempHud,target,"hudninja") + else//If we don't know what role they have but they have one. + U.client.images += image(tempHud,target,"hudunknown1") + else//If the silicon mob has no law datum, no inherent laws, or a law zero, add them to the hud. + var/mob/living/silicon/silicon_target = target + if(!silicon_target.laws||(silicon_target.laws&&(silicon_target.laws.zeroth||!silicon_target.laws.inherent.len))||silicon_target.mind.special_role=="traitor") + if(isrobot(silicon_target))//Different icons for robutts and AI. + U.client.images += image(tempHud,silicon_target,"hudmalborg") + else + U.client.images += image(tempHud,silicon_target,"hudmalai") + return 1 + /mob/proc/ghostize(var/can_reenter_corpse = 1) if(key) var/mob/dead/observer/ghost = new(src) //Transfer safety to observer spawning proc. @@ -153,7 +209,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(mind.current.key && copytext(mind.current.key,1,2)!="@") //makes sure we don't accidentally kick any clients usr << "Another consciousness is in your body...It is resisting you." return - if(mind.current.ajourn && mind.current.stat != DEAD) //check if the corpse is astral-journeying (it's client ghosted using a cultist rune). + if(mind.current.ajourn && mind.current.stat != DEAD) //check if the corpse is astral-journeying (it's client ghosted using a cultist rune). var/obj/effect/rune/R = locate() in mind.current.loc //whilst corpse is alive, we can only reenter the body if it's on the rune if(!(R && R.word1 == cultwords["hell"] && R.word2 == cultwords["travel"] && R.word3 == cultwords["self"])) //astral journeying rune usr << "The astral cord that ties your body and your spirit has been severed. You are likely to wander the realm beyond until your body is finally dead and thus reunited with you." @@ -162,6 +218,29 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp mind.current.key = key return 1 +/mob/dead/observer/verb/toggle_antagHUD() + set category = "Ghost" + set name = "Toggle AntagHUD" + set desc = "Toggles AntagHUD allowing you to see who is the antagonist" + if(!config.antag_hud_allowed) + src << "\red Admins have disabled this for this round." + return + if(!client) + return + var/mob/dead/observer/M = src + if(config.antag_hud_restricted && !M.has_enabled_antagHUD) + var/response = alert(src, "If you turn this on, you will not be able to take any part in the round.","Are you sure you want to turn this feature on?","Yes","No") + if(response == "No") return + M.can_reenter_corpse = 0 + if(!M.has_enabled_antagHUD) + M.has_enabled_antagHUD = 1 + if(M.antagHUD) + M.antagHUD = 0 + src << "\blue AntagHUD Disabled" + else + M.antagHUD = 1 + src << "\blue AntagHUD Enabled" + /mob/dead/observer/proc/dead_tele() set category = "Ghost" set name = "Teleport" diff --git a/code/modules/mob/living/carbon/brain/posibrain.dm b/code/modules/mob/living/carbon/brain/posibrain.dm index f8c014278c2..fa02150ab38 100644 --- a/code/modules/mob/living/carbon/brain/posibrain.dm +++ b/code/modules/mob/living/carbon/brain/posibrain.dm @@ -27,6 +27,8 @@ proc/request_player() for(var/mob/dead/observer/O in player_list) + if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted) + continue if(jobban_isbanned(O, "pAI")) continue if(O.client) diff --git a/code/modules/mob/living/silicon/pai/recruit.dm b/code/modules/mob/living/silicon/pai/recruit.dm index 93271aadaf1..270e2ba7637 100644 --- a/code/modules/mob/living/silicon/pai/recruit.dm +++ b/code/modules/mob/living/silicon/pai/recruit.dm @@ -191,6 +191,8 @@ var/datum/paiController/paiController // Global handler for pAI candidates proc/requestRecruits() for(var/mob/dead/observer/O in player_list) + if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted) + continue if(jobban_isbanned(O, "pAI")) continue if(asked.Find(O.key)) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 8f9623565f3..c82489cf35b 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -348,6 +348,10 @@ var/list/slot_equipment_priority = list( \ return else var/deathtime = world.time - src.timeofdeath + var/mob/dead/observer/G = src + if(G.has_enabled_antagHUD == 1 && config.antag_hud_restricted) + usr << "\blue Upon using the antagHUD you forfeighted the ability to join the round." + return var/deathtimeminutes = round(deathtime / 600) var/pluralcheck = "minute" if(deathtimeminutes == 0) @@ -358,6 +362,7 @@ var/list/slot_equipment_priority = list( \ pluralcheck = " [deathtimeminutes] minutes and" var/deathtimeseconds = round((deathtime - deathtimeminutes * 600) / 10,1) usr << "You have been dead for[pluralcheck] [deathtimeseconds] seconds." + if (deathtime < 18000) usr << "You must wait 30 minutes to respawn!" return diff --git a/config/example/config.txt b/config/example/config.txt index db1702b67c0..fb320da581a 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -121,6 +121,12 @@ VOTE_AUTOTRANSFER_INTERVAL 36000 ## players' votes default to "No vote" (otherwise, default to "No change") DEFAULT_NO_VOTE +## Allow ghosts to see antagonist through AntagHUD +ALLOW_ANTAG_HUD + +## If ghosts use antagHUD they are no longer allowed to join the round. +ANTAG_HUD_RESTRICTED + ## allow AI job ALLOW_AI From a56103c151310efd04d319db3e0190b132d54f9d Mon Sep 17 00:00:00 2001 From: Ccomp5950 Date: Sun, 17 Nov 2013 10:00:12 -0600 Subject: [PATCH 3/6] Added Adminverbs for turning off and on the various items needed. Also added the proc get_ghosts() with 2 versions of output, it defaults to returning a mob list but can be set to return a list for use with an input window. --- code/modules/admin/admin_verbs.dm | 2 + code/modules/admin/verbs/randomverbs.dm | 96 ++++++++++++++++++---- code/modules/mob/dead/observer/observer.dm | 19 +++-- 3 files changed, 94 insertions(+), 23 deletions(-) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 606a6e82ffc..1158633bf80 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -70,6 +70,8 @@ var/list/admin_verbs_admin = list( /client/proc/man_up, /client/proc/global_man_up, /client/proc/response_team, // Response Teams admin verb + /client/proc/toggle_antagHUD_use, + /client/proc/toggle_antagHUD_restrictions, /client/proc/allow_character_respawn /* Allows a ghost to respawn */ ) var/list/admin_verbs_ban = list( diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 6a5af5cf25f..010e99e23e4 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -226,26 +226,38 @@ Allow admins to set players to be able to respawn/bypass 30 min wait, without th Ccomp's first proc. */ +/client/proc/get_ghosts(var/notify = 0,var/what = 2) + // what = 1, return ghosts ass list. + // what = 2, return mob list + + var/list/mobs = list() + var/list/ghosts = list() + var/list/sortmob = sortAtom(mob_list) // get the mob list. + /var/any=0 + for(var/mob/dead/observer/M in sortmob) + mobs.Add(M) //filter it where it's only ghosts + any = 1 //if no ghosts show up, any will just be 0 + if(!any) + if(notify) + src << "There doesn't appear to be any ghosts for you to select." + return + + for(var/mob/M in mobs) + var/name = M.name + ghosts[name] = M //get the name of the mob for the popup list + if(what==1) + return ghosts + else + return mobs + + /client/proc/allow_character_respawn() set category = "Special Verbs" set name = "Allow player to respawn" set desc = "Let's the player bypass the 30 minute wait to respawn or allow them to re-enter their corpse." if(!holder) src << "Only administrators may use this command." - var/any = 0 - var/list/mobs = list() - var/list/ghosts = list() - var/list/sortmob = sortAtom(mob_list) // get the mob list. - for(var/mob/dead/observer/M in sortmob) - mobs.Add(M) //filter it where it's only ghosts - any = 1 //if no ghosts show up, any will just be 0 - if(!any) - src << "There doesn't appear to be any ghosts for you to select." - return - - for(var/mob/M in mobs) - var/name = M.name - ghosts[name] = M //get the name of the mob for the popup list + var/list/ghosts= get_ghosts(1) var/target = input("Please, select a ghost!", "COME BACK TO LIFE!", null, null) as null|anything in ghosts if(!target) @@ -268,6 +280,62 @@ Ccomp's first proc. message_admins("Admin [key_name_admin(usr)] allowed [key_name_admin(G)] to bypass the 30 minute respawn limit", 1) +/client/proc/toggle_antagHUD_use() + set category = "Server" + set name = "Toggle antagHUD usage" + set desc = "Toggles antagHUD usage for observers" + + if(!holder) + src << "Only administrators may use this command." + var/action="" + if(config.antag_hud_allowed) + for(var/mob/dead/observer/g in get_ghosts()) + if(g.antagHUD) + g.antagHUD = 0 // Disable it on those that have it enabled + g.has_enabled_antagHUD = 2 // We'll allow them to respawn + g << "\red TheAdministrator has disabled AntagHUD " + config.antag_hud_allowed = 0 + src << "\red AntagHUD usage has been disabled" + action = "disabled" + else + for(var/mob/dead/observer/g in get_ghosts()) + g << "\blue The Administrator has enabled AntagHUD " // Notify all observers they can now use AntagHUD + config.antag_hud_allowed = 1 + action = "enabled" + src << "\blue AntagHUD usage has been enabled" + + + log_admin("[key_name(usr)] has [action] antagHUD usage for observers") + message_admins("Admin [key_name_admin(usr)] has [action] antagHUD usage for observers", 1) + + + +/client/proc/toggle_antagHUD_restrictions() + set category = "Server" + set name = "Toggle antagHUD Restrictions" + set desc = "Restricts players that have used antagHUD from being able to join this round." + if(!holder) + src << "Only administrators may use this command." + var/action="" + if(config.antag_hud_restricted) + for(var/mob/dead/observer/g in get_ghosts()) + g << "\blue The administrator has lifted restrictions on joining the round if you use AntagHUD" + action = "lifted restrictions" + config.antag_hud_restricted = 0 + src << "\blue AntagHUD restrictions have been lifted" + else + for(var/mob/dead/observer/g in get_ghosts()) + g << "\red The administrator has placed restrictions on joining the round if you use AntagHUD" + g << "\red Your AntagHUD has been disabled, you may choose to re-enabled it but will be under restrictions " + g.antagHUD = 0 + g.has_enabled_antagHUD = 0 + action = "placed restrictions" + config.antag_hud_restricted = 1 + src << "\red AntagHUD restrictions have been enabled" + + log_admin("[key_name(usr)] has [action] on joining the round if they use AntagHUD") + message_admins("Admin [key_name_admin(usr)] has [action] on joining the round if they use AntagHUD", 1) + diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 9df4b8a84ca..7febbd4561c 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -79,16 +79,17 @@ Works together with spawning an observer, noted above. if(client.images.len) - for(var/image/hud in client.images) - if(copytext(hud.icon_state,1,4) == "hud") - client.images.Remove(hud) + for(var/image/hud in client.images) + if(copytext(hud.icon_state,1,4) == "hud") + client.images.Remove(hud) + var/mob/dead/observer/M = src if(M.antagHUD) - var/list/target_list = list() - for(var/mob/living/target in oview(M)) - if( target.mind&&(target.mind.special_role||issilicon(target)) ) - target_list += target - if(target_list.len) - M.assess_targets(target_list, M) + var/list/target_list = list() + for(var/mob/living/target in oview(M)) + if( target.mind&&(target.mind.special_role||issilicon(target)) ) + target_list += target + if(target_list.len) + M.assess_targets(target_list, M) From 59bb2357b67cf35864a6b757c685ce563595cb52 Mon Sep 17 00:00:00 2001 From: Ccomp5950 Date: Sun, 17 Nov 2013 10:41:07 -0600 Subject: [PATCH 4/6] Included JobBan menu and systems for AntagHUD --- code/modules/admin/topic.dm | 10 +++++++--- code/modules/admin/verbs/randomverbs.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index f1c911488ab..f5452830381 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -515,7 +515,7 @@ //Non-Human (Green) counter = 0 jobs += "" - jobs += "" + jobs += "" for(var/jobPos in nonhuman_positions) if(!jobPos) continue var/datum/job/job = job_master.GetJob(jobPos) @@ -533,11 +533,15 @@ counter = 0 //pAI isn't technically a job, but it goes in here. + if(jobban_isbanned(M, "pAI")) jobs += "" else jobs += "" - + if(jobban_isbanned(M, "AntagHUD")) + jobs += "" + else + jobs += "" jobs += "
Non-human Positions
Non-human Positions
pAIpAIAntagHUDAntagHUD
" //Antagonist (Orange) @@ -2594,4 +2598,4 @@ show_player_info(ckey) if("list") PlayerNotesPage(text2num(href_list["index"])) - return \ No newline at end of file + return diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 010e99e23e4..55322914ed2 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -257,7 +257,7 @@ Ccomp's first proc. set desc = "Let's the player bypass the 30 minute wait to respawn or allow them to re-enter their corpse." if(!holder) src << "Only administrators may use this command." - var/list/ghosts= get_ghosts(1) + var/list/ghosts= get_ghosts(1,1) var/target = input("Please, select a ghost!", "COME BACK TO LIFE!", null, null) as null|anything in ghosts if(!target) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 7febbd4561c..a72fe75ef98 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -229,6 +229,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(!client) return var/mob/dead/observer/M = src + if(jobban_isbanned(M, "AntagHUD")) + src << "\red You have been banned from using this feature" + return if(config.antag_hud_restricted && !M.has_enabled_antagHUD) var/response = alert(src, "If you turn this on, you will not be able to take any part in the round.","Are you sure you want to turn this feature on?","Yes","No") if(response == "No") return From 340532dc55cec30ae31dee86ff650f6ce5c202ca Mon Sep 17 00:00:00 2001 From: Ccomp5950 Date: Sun, 17 Nov 2013 13:16:55 -0600 Subject: [PATCH 5/6] String fix on adminverb Added holder checks so admins can use antagHUD regardless of restrictions. --- code/modules/admin/verbs/randomverbs.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 24 ++++++++++++---------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 55322914ed2..812a4b51d65 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -293,7 +293,7 @@ Ccomp's first proc. if(g.antagHUD) g.antagHUD = 0 // Disable it on those that have it enabled g.has_enabled_antagHUD = 2 // We'll allow them to respawn - g << "\red TheAdministrator has disabled AntagHUD " + g << "\red The Administrator has disabled AntagHUD " config.antag_hud_allowed = 0 src << "\red AntagHUD usage has been disabled" action = "disabled" diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index a72fe75ef98..29148682b41 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -10,6 +10,7 @@ blinded = 0 anchored = 1 // don't get pushed around invisibility = INVISIBILITY_OBSERVER + var/tempdir = 1 var/can_reenter_corpse var/datum/hud/living/carbon/hud = null // hud var/bootime = 0 @@ -94,26 +95,27 @@ Works together with spawning an observer, noted above. /mob/dead/proc/assess_targets(list/target_list, mob/living/carbon/U) + var/mob/dead/observer/M = src var/icon/tempHud = 'icons/mob/hud.dmi' for(var/mob/living/target in target_list) if(iscarbon(target)) switch(target.mind.special_role) if("traitor","Syndicate") - U.client.images += image(tempHud,target,"hudsyndicate") + U.client.images += image(tempHud,target,"hudsyndicate",,M.tempdir) if("Revolutionary") - U.client.images += image(tempHud,target,"hudrevolutionary") + U.client.images += image(tempHud,target,"hudrevolutionary",,M.tempdir) if("Head Revolutionary") - U.client.images += image(tempHud,target,"hudheadrevolutionary") + U.client.images += image(tempHud,target,"hudheadrevolutionary",,M.tempdir) if("Cultist") - U.client.images += image(tempHud,target,"hudcultist") + U.client.images += image(tempHud,target,"hudcultist",,M.tempdir) if("Changeling") - U.client.images += image(tempHud,target,"hudchangeling") + U.client.images += image(tempHud,target,"hudchangeling",,M.tempdir) if("Wizard","Fake Wizard") - U.client.images += image(tempHud,target,"hudwizard") + U.client.images += image(tempHud,target,"hudwizard",,M.tempdir) if("Hunter","Sentinel","Drone","Queen") - U.client.images += image(tempHud,target,"hudalien") + U.client.images += image(tempHud,target,"hudalien",,M.tempdir) if("Death Commando") - U.client.images += image(tempHud,target,"huddeathsquad") + U.client.images += image(tempHud,target,"huddeathsquad",,M.tempdir) if("Ninja") U.client.images += image(tempHud,target,"hudninja") else//If we don't know what role they have but they have one. @@ -223,7 +225,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set category = "Ghost" set name = "Toggle AntagHUD" set desc = "Toggles AntagHUD allowing you to see who is the antagonist" - if(!config.antag_hud_allowed) + if(!config.antag_hud_allowed && !client.holder) src << "\red Admins have disabled this for this round." return if(!client) @@ -232,11 +234,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(jobban_isbanned(M, "AntagHUD")) src << "\red You have been banned from using this feature" return - if(config.antag_hud_restricted && !M.has_enabled_antagHUD) + if(config.antag_hud_restricted && !M.has_enabled_antagHUD &&!client.holder) var/response = alert(src, "If you turn this on, you will not be able to take any part in the round.","Are you sure you want to turn this feature on?","Yes","No") if(response == "No") return M.can_reenter_corpse = 0 - if(!M.has_enabled_antagHUD) + if(!M.has_enabled_antagHUD && !client.holder) M.has_enabled_antagHUD = 1 if(M.antagHUD) M.antagHUD = 0 From 513953b92716f6ec71cfa0e8a6067c9b81f2e7d0 Mon Sep 17 00:00:00 2001 From: Ccomp5950 Date: Tue, 19 Nov 2013 01:10:59 -0600 Subject: [PATCH 6/6] Cleanup: Removed unneeded variables and a debug variable. --- code/modules/mob/dead/observer/observer.dm | 27 ++++++++++------------ 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 29148682b41..a54b8ad96a1 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -10,7 +10,6 @@ blinded = 0 anchored = 1 // don't get pushed around invisibility = INVISIBILITY_OBSERVER - var/tempdir = 1 var/can_reenter_corpse var/datum/hud/living/carbon/hud = null // hud var/bootime = 0 @@ -83,39 +82,37 @@ Works together with spawning an observer, noted above. for(var/image/hud in client.images) if(copytext(hud.icon_state,1,4) == "hud") client.images.Remove(hud) - var/mob/dead/observer/M = src - if(M.antagHUD) + if(antagHUD) var/list/target_list = list() - for(var/mob/living/target in oview(M)) + for(var/mob/living/target in oview(src)) if( target.mind&&(target.mind.special_role||issilicon(target)) ) target_list += target if(target_list.len) - M.assess_targets(target_list, M) + assess_targets(target_list, src) -/mob/dead/proc/assess_targets(list/target_list, mob/living/carbon/U) - var/mob/dead/observer/M = src +/mob/dead/proc/assess_targets(list/target_list, mob/dead/observer/U) var/icon/tempHud = 'icons/mob/hud.dmi' for(var/mob/living/target in target_list) if(iscarbon(target)) switch(target.mind.special_role) if("traitor","Syndicate") - U.client.images += image(tempHud,target,"hudsyndicate",,M.tempdir) + U.client.images += image(tempHud,target,"hudsyndicate") if("Revolutionary") - U.client.images += image(tempHud,target,"hudrevolutionary",,M.tempdir) + U.client.images += image(tempHud,target,"hudrevolutionary") if("Head Revolutionary") - U.client.images += image(tempHud,target,"hudheadrevolutionary",,M.tempdir) + U.client.images += image(tempHud,target,"hudheadrevolutionary") if("Cultist") - U.client.images += image(tempHud,target,"hudcultist",,M.tempdir) + U.client.images += image(tempHud,target,"hudcultist") if("Changeling") - U.client.images += image(tempHud,target,"hudchangeling",,M.tempdir) + U.client.images += image(tempHud,target,"hudchangeling") if("Wizard","Fake Wizard") - U.client.images += image(tempHud,target,"hudwizard",,M.tempdir) + U.client.images += image(tempHud,target,"hudwizard") if("Hunter","Sentinel","Drone","Queen") - U.client.images += image(tempHud,target,"hudalien",,M.tempdir) + U.client.images += image(tempHud,target,"hudalien") if("Death Commando") - U.client.images += image(tempHud,target,"huddeathsquad",,M.tempdir) + U.client.images += image(tempHud,target,"huddeathsquad") if("Ninja") U.client.images += image(tempHud,target,"hudninja") else//If we don't know what role they have but they have one.