diff --git a/code/__defines/misc_vr.dm b/code/__defines/misc_vr.dm index dcab43baae..c61f8c3421 100644 --- a/code/__defines/misc_vr.dm +++ b/code/__defines/misc_vr.dm @@ -4,6 +4,12 @@ #define BACKUP_HUD 11 // HUD for showing whether or not they have a backup implant. #define STATUS_R_HUD 12 // HUD for showing the same STATUS_HUD info on the right side, but not for 'boring' statuses (transparent icons) #define HEALTH_VR_HUD 13 // HUD with blank 100% bar so it's hidden most of the time. +#define VANTAG_HUD 14 // HUD for showing being-an-antag-target prefs #undef TOTAL_HUDS //Undo theirs. -#define TOTAL_HUDS 13 // Total number of HUDs. \ No newline at end of file +#define TOTAL_HUDS 14 // Total number of HUDs. + +#define VANTAG_NONE "hudblank" +#define VANTAG_VORE "vantag_vore" +#define VANTAG_KIDNAP "vantag_kidnap" +#define VANTAG_KILL "vantag_kill" diff --git a/code/_helpers/global_lists_vr.dm b/code/_helpers/global_lists_vr.dm index dc78829439..7e76cee082 100644 --- a/code/_helpers/global_lists_vr.dm +++ b/code/_helpers/global_lists_vr.dm @@ -13,6 +13,13 @@ var/global/list/player_sizes_list = list( "Small" = RESIZE_SMALL, "Tiny" = RESIZE_TINY) +//stores vantag settings indexed by name +var/global/list/vantag_choices_list = list( + VANTAG_NONE = "No Involvement", + VANTAG_VORE = "Be Prey", + VANTAG_KIDNAP = "Be Kidnapped", + VANTAG_KILL = "Be Killed") + //Important items that are preserved when people are digested, etc. //On Polaris, different from Cryo list as MMIs need to be removed for FBPs to be logged out. var/global/list/important_items = list( diff --git a/code/defines/procs/hud.dm b/code/defines/procs/hud.dm index c1539074eb..7f34ea0aed 100644 --- a/code/defines/procs/hud.dm +++ b/code/defines/procs/hud.dm @@ -75,6 +75,7 @@ mob/proc/handle_regular_hud_updates() //Used in the life.dm of mobs that can use eng_hud_users -= src sci_hud_users -= src gen_hud_users -= src + if(vantag_hud) process_vantag_hud(src) //VOREStation Add - So any mob can have the vantag hud, observer or not. //VOREStation Add End mob/proc/in_view(var/turf/T) return view(T) diff --git a/code/defines/procs/hud_vr.dm b/code/defines/procs/hud_vr.dm index 53a9056ed9..248c862173 100644 --- a/code/defines/procs/hud_vr.dm +++ b/code/defines/procs/hud_vr.dm @@ -2,6 +2,8 @@ var/global/list/gen_hud_users = list() // List of all entities using var/global/list/eng_hud_users = list() // List of all entities using a engineer HUD. var/global/list/sci_hud_users = list() // List of all entities using a science HUD. +var/global/list/vantag_hud_users = list() // List of all mobs with the VANTAG hud on. + /proc/broadcast_engineering_hud_message(var/message, var/broadcast_source) broadcast_hud_message(message, broadcast_source, eng_hud_users, /obj/item/clothing/glasses/omnihud/eng) @@ -43,3 +45,16 @@ proc/process_omni_hud(var/mob/M, var/mode, var/mob/Alt) P.Client.images += guy.hud_list[WANTED_HUD] P.Client.images += guy.hud_list[STATUS_R_HUD] P.Client.images += guy.hud_list[BACKUP_HUD] + + +proc/process_vantag_hud(var/mob/M) + if(!M.vantag_hud || !can_process_hud(M)) + return + + var/datum/arranged_hud_process/P = arrange_hud_process(M, null, vantag_hud_users) + + for(var/mob/living/carbon/human/guy in P.Mob.in_view(P.Turf)) + if(P.Mob.see_invisible < guy.invisibility) + continue + + P.Client.images += guy.hud_list[VANTAG_HUD] diff --git a/code/modules/client/preference_setup/vore/06_vantag.dm b/code/modules/client/preference_setup/vore/06_vantag.dm new file mode 100644 index 0000000000..28859092af --- /dev/null +++ b/code/modules/client/preference_setup/vore/06_vantag.dm @@ -0,0 +1,48 @@ +// Define a place to save in character setup +/datum/preferences + var/vantag_volunteer = 0 // What state I want to be in, in terms of being affected by antags. + var/vantag_preference = VANTAG_NONE // Whether I'd like to volunteer to be an antag at some point. + +// Definition of the stuff for Sizing +/datum/category_item/player_setup_item/vore/vantag + name = "VS Antag" + sort_order = 6 + +/datum/category_item/player_setup_item/vore/vantag/load_character(var/savefile/S) + S["vantag_volunteer"] >> pref.vantag_volunteer + S["vantag_preference"] >> pref.vantag_preference + +/datum/category_item/player_setup_item/vore/vantag/save_character(var/savefile/S) + S["vantag_volunteer"] << pref.vantag_volunteer + S["vantag_preference"] << pref.vantag_preference + +/datum/category_item/player_setup_item/vore/vantag/sanitize_character() + pref.vantag_volunteer = sanitize_integer(pref.vantag_volunteer, 0, 1, initial(pref.vantag_volunteer)) + pref.vantag_preference = sanitize_inlist(pref.vantag_preference, vantag_choices_list, initial(pref.vantag_preference)) + +/datum/category_item/player_setup_item/vore/vantag/copy_to_mob(var/mob/living/carbon/human/character) + if(character && !istype(character,/mob/living/carbon/human/dummy)) + character.vantag_pref = pref.vantag_preference + BITSET(character.hud_updateflag, VANTAG_HUD) + +/datum/category_item/player_setup_item/vore/vantag/content(var/mob/user) + . += "
" + . += "V-Antag Volunteer: [pref.vantag_volunteer ? "Yes" : "No"]
" + . += "V-Antag Pref: [vantag_choices_list[pref.vantag_preference]]
" + +/datum/category_item/player_setup_item/vore/vantag/OnTopic(var/href, var/list/href_list, var/mob/user) + if(href_list["toggle_vantag_volunteer"]) + pref.vantag_volunteer = pref.vantag_volunteer ? 0 : 1 + return TOPIC_REFRESH + + else if(href_list["change_vantag"]) + var/list/names_list = list() + for(var/C in vantag_choices_list) + names_list[vantag_choices_list[C]] = C + + var/selection = input(user, "How do you want to be involved with VS antags? They will see this choice on you in a HUD. VS antags are admin-selected and spawned players who are obligated to respect ERP prefs and RP their actions like any other player, though it may be a slightly shorter RP if they are pressed for time or being caught.", "V-Antag Preference") as null|anything in names_list + if(selection && selection != "Normal") + pref.vantag_preference = names_list[selection] + + return TOPIC_REFRESH + return ..() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 881663e1dd..821cabb03a 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -36,6 +36,7 @@ hud_list[HEALTH_VR_HUD] = new /image/hud_overlay('icons/mob/hud_med_vr.dmi', src, "100") hud_list[STATUS_R_HUD] = new /image/hud_overlay('icons/mob/hud_vr.dmi', src, "hudhealthy") hud_list[BACKUP_HUD] = new /image/hud_overlay('icons/mob/hud_vr.dmi', src, "hudblank") + hud_list[VANTAG_HUD] = new /image/hud_overlay('icons/mob/hud_vr.dmi', src, "hudblank") //VOREStation Add End hud_list[LIFE_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudhealthy") hud_list[ID_HUD] = new /image/hud_overlay(using_map.id_hud_icons, src, "hudunknown") diff --git a/code/modules/mob/living/carbon/human/human_defines_vr.dm b/code/modules/mob/living/carbon/human/human_defines_vr.dm index c67fb3ff4e..2f3f423681 100644 --- a/code/modules/mob/living/carbon/human/human_defines_vr.dm +++ b/code/modules/mob/living/carbon/human/human_defines_vr.dm @@ -4,3 +4,4 @@ b_skin = 179 var/wagging = 0 //UGH. + var/vantag_pref = VANTAG_NONE //What's my status? diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index ecd1ef7567..26516fbb61 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1651,8 +1651,6 @@ holder1.icon_state = "hud_imp_tracking" if(istype(I,/obj/item/weapon/implant/loyalty)) holder2.icon_state = "hud_imp_loyal" - if(istype(I,/obj/item/weapon/implant/backup))//VOREStation Edit - Commandeering this for backup implants - holder2.icon_state = "hud_imp_loyal" //VOREStation Edit if(istype(I,/obj/item/weapon/implant/chem)) holder3.icon_state = "hud_imp_chem" diff --git a/code/modules/mob/living/carbon/human/life_vr.dm b/code/modules/mob/living/carbon/human/life_vr.dm index 2c0e594f7a..7fe6d77ec6 100644 --- a/code/modules/mob/living/carbon/human/life_vr.dm +++ b/code/modules/mob/living/carbon/human/life_vr.dm @@ -34,4 +34,12 @@ else if(!(mind.name in transcore.body_scans)) holder.icon_state = "hud_backup_nobody" else - holder.icon_state = "hud_backup_norm" \ No newline at end of file + holder.icon_state = "hud_backup_norm" + + //VOREStation Antag Hud + if (BITTEST(hud_updateflag, VANTAG_HUD)) + var/image/vantag = hud_list[VANTAG_HUD] + if(vantag_pref) + vantag.icon_state = vantag_pref + else + vantag.icon_state = "hudblank" diff --git a/code/modules/mob/mob_defines_vr.dm b/code/modules/mob/mob_defines_vr.dm new file mode 100644 index 0000000000..89dcd717df --- /dev/null +++ b/code/modules/mob/mob_defines_vr.dm @@ -0,0 +1,2 @@ +/mob + var/vantag_hud = 0 // Do I have the HUD enabled? \ No newline at end of file diff --git a/icons/mob/hud_vr.dmi b/icons/mob/hud_vr.dmi index b96ae9c6de..0233dd84fb 100644 Binary files a/icons/mob/hud_vr.dmi and b/icons/mob/hud_vr.dmi differ diff --git a/vorestation.dme b/vorestation.dme index 253c02bdef..a8f6069ae7 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -1273,6 +1273,7 @@ #include "code\modules\client\preference_setup\vore\02_size.dm" #include "code\modules\client\preference_setup\vore\03_egg.dm" #include "code\modules\client\preference_setup\vore\04_resleeving.dm" +#include "code\modules\client\preference_setup\vore\06_vantag.dm" #include "code\modules\clothing\chameleon.dm" #include "code\modules\clothing\clothing.dm" #include "code\modules\clothing\clothing_accessories.dm" @@ -1593,6 +1594,7 @@ #include "code\modules\mob\logout.dm" #include "code\modules\mob\mob.dm" #include "code\modules\mob\mob_defines.dm" +#include "code\modules\mob\mob_defines_vr.dm" #include "code\modules\mob\mob_grab.dm" #include "code\modules\mob\mob_grab_specials.dm" #include "code\modules\mob\mob_helpers.dm"