From 9e90a293eca4224a56fd0e66c84d7dc1503cb843 Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Mon, 3 Apr 2017 18:05:25 -0400 Subject: [PATCH 1/2] VANTAG Hud stuff --- code/__defines/misc_vr.dm | 8 ++- code/_helpers/global_lists_vr.dm | 7 +++ code/defines/procs/hud.dm | 1 + code/defines/procs/hud_vr.dm | 15 ++++++ .../client/preference_setup/vore/06_vantag.dm | 48 ++++++++++++++++++ code/modules/mob/living/carbon/human/human.dm | 1 + .../living/carbon/human/human_defines_vr.dm | 1 + code/modules/mob/living/carbon/human/life.dm | 2 - .../mob/living/carbon/human/life_vr.dm | 10 +++- code/modules/mob/mob_defines_vr.dm | 2 + icons/mob/hud_vr.dmi | Bin 995 -> 1272 bytes vorestation.dme | 2 + 12 files changed, 93 insertions(+), 4 deletions(-) create mode 100644 code/modules/client/preference_setup/vore/06_vantag.dm create mode 100644 code/modules/mob/mob_defines_vr.dm 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 b96ae9c6de2c3ba2a6f661fa8bee8b42f58dfe14..0233dd84fbaccce748a6d8a72d9320ec78e27b6e 100644 GIT binary patch delta 1178 zcmV;L1ZDf<2lxq)7k_{V0{{R3^x%>C0003RP)t-sz`(#mLqh-n0M%cPv{85l1qA{D z0uK)lGiLvZJzK(Dgz$*6^NqGQ948G02*g=~?slg1kGRHWj0gh-U@Ji7XPN40ob7a^ zjYVRjLukNEdevKt)LM$YO?o2>6>uv?kS$e+9<~007BtzbZQ+X(Vj-&tD)f0A~L)|Nk@p0GUW?0K~)qnVA60000dzO>}t_z`(#0 z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n>vKyLKGrr<`xr5(D){q3b!NmqDJSaQD?#R+U@@SDp;Sr@M-KLL;u0x9MD6<7^dAWc12Afxe9r?zpBAFpuUP> zV6G?B0EbkQ>j(yBVyvVN7%44%51x+{tF6m7R+CEbqktBLwyp=#>h|iz2}p~&okCg! z7^4N!T1{)9qD7!>lo@|;6>y6HTm{0nfS$!S&24Rst#2C<;d!**-+gX0kO1f=csk{O zx%&zYD7--h5d Date: Tue, 4 Apr 2017 20:22:09 -0400 Subject: [PATCH 2/2] Renames V-ANTAG to Event --- code/modules/client/preference_setup/vore/06_vantag.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/client/preference_setup/vore/06_vantag.dm b/code/modules/client/preference_setup/vore/06_vantag.dm index 28859092af..65bc66a495 100644 --- a/code/modules/client/preference_setup/vore/06_vantag.dm +++ b/code/modules/client/preference_setup/vore/06_vantag.dm @@ -5,7 +5,7 @@ // Definition of the stuff for Sizing /datum/category_item/player_setup_item/vore/vantag - name = "VS Antag" + name = "VS Events" sort_order = 6 /datum/category_item/player_setup_item/vore/vantag/load_character(var/savefile/S) @@ -27,8 +27,8 @@ /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]]
" + . += "Event Volunteer: [pref.vantag_volunteer ? "Yes" : "No"]
" + . += "Event 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"]) @@ -40,7 +40,7 @@ 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 + var/selection = input(user, "How do you want to be involved with VS Event Characters, ERP-wise? They will see this choice on you in a HUD. Event characters are admin-selected and spawned players, possibly with assigned objectives, 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.", "Event Preference") as null|anything in names_list if(selection && selection != "Normal") pref.vantag_preference = names_list[selection]