diff --git a/code/_onclick/hud/_defines_vr.dm b/code/_onclick/hud/_defines_vr.dm index e72150b44c..2b4f4fb85e 100644 --- a/code/_onclick/hud/_defines_vr.dm +++ b/code/_onclick/hud/_defines_vr.dm @@ -1,2 +1,3 @@ #define ui_shadekin_dark_display "EAST-1:28,CENTER-3:15" -#define ui_shadekin_energy_display "EAST-1:28,CENTER-4:15" \ No newline at end of file +#define ui_shadekin_energy_display "EAST-1:28,CENTER-4:15" +#define ui_xenochimera_danger_display "EAST-1:28,CENTER-3:15" \ No newline at end of file diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index f1aba60b10..e31dd5e56a 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -303,6 +303,11 @@ mymob.shadekin_energy_display.screen_loc = ui_shadekin_energy_display mymob.shadekin_energy_display.icon_state = "energy0" hud_elements |= mymob.shadekin_energy_display + + mymob.xenochimera_danger_display = new /obj/screen/xenochimera/danger_level() + mymob.xenochimera_danger_display.screen_loc = ui_xenochimera_danger_display + mymob.xenochimera_danger_display.icon_state = "danger00" + hud_elements |= mymob.xenochimera_danger_display //VOREStation Addition end mymob.ling_chem_display = new /obj/screen/ling/chems() diff --git a/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm b/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm index e67a670d82..e9865bc966 100644 --- a/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm +++ b/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm @@ -118,7 +118,11 @@ //To reduce distant object references var/feral = H.feral -//Handle feral triggers and pre-feral messages + //Are we in danger of ferality? + var/danger = FALSE + var/feral_state = FALSE + + //Handle feral triggers and pre-feral messages if(!feral && (hungry || shock || jittery)) // If they're hungry, give nag messages (when not bellied) @@ -128,12 +132,15 @@ to_chat(H,"You feel rather hungry. It might be a good idea to find some some food...") if(100 to 150) to_chat(H,"You feel like you're going to snap and give in to your hunger soon... It would be for the best to find some [pick("food","prey")] to eat...") + danger = TRUE // Going feral due to hunger else if(H.nutrition < 100 && !isbelly(H.loc)) to_chat(H,"Something in your mind flips, your instincts taking over, no longer able to fully comprehend your surroundings as survival becomes your primary concern - you must feed, survive, there is nothing else. Hunt. Eat. Hide. Repeat.") log_and_message_admins("has gone feral due to hunger.", H) feral = 5 + danger = TRUE + feral_state = TRUE if(!H.stat) H.emote("twitch") @@ -146,6 +153,8 @@ to_chat(H,"The pain! It stings! Got to get away! Your instincts take over, urging you to flee, to hide, to go to ground, get away from here...") log_and_message_admins("has gone feral due to halloss.", H) feral = 5 + danger = TRUE + feral_state = TRUE if(!H.stat) H.emote("twitch") @@ -153,6 +162,8 @@ else if(prob(min(10,(0.1 * H.traumatic_shock)))) to_chat(H,"Your fight-or-flight response kicks in, your injuries too much to simply ignore - you need to flee, to hide, survive at all costs - or destroy whatever is threatening you.") feral = 5 + danger = TRUE + feral_state = TRUE log_and_message_admins("has gone feral due to injury.", H) if(!H.stat) H.emote("twitch") @@ -161,27 +172,35 @@ else if(jittery) to_chat(H,"Suddenly, something flips - everything that moves is... potential prey. A plaything. This is great! Time to hunt!") feral = 5 + danger = TRUE + feral_state = TRUE log_and_message_admins("has gone feral due to jitteriness.", H) if(!H.stat) H.emote("twitch") -// Handle being feral + // Handle being feral if(feral) + //We're feral + feral_state = TRUE //Shock due to mostly halloss. More feral. if(shock && 2.5*H.halloss >= H.traumatic_shock) + danger = TRUE feral = max(feral, H.halloss) //Shock due to mostly injury. More feral. else if(shock) + danger = TRUE feral = max(feral, H.traumatic_shock * 2) //Still jittery? More feral. if(jittery) + danger = TRUE feral = max(feral, H.jitteriness-100) //Still hungry? More feral. if(H.feral + H.nutrition < 150) + danger = TRUE feral++ else feral = max(0,--feral) @@ -191,8 +210,10 @@ //Did we just finish being feral? if(!feral) + feral_state = FALSE to_chat(H,"Your thoughts start clearing, your feral urges having passed - for the time being, at least.") log_and_message_admins("is no longer feral.", H) + update_xenochimera_hud(H, danger, feral_state) return //If they lose enough health to hit softcrit, handle_shock() will keep resetting this. Otherwise, pissed off critters will lose shock faster than they gain it. @@ -201,6 +222,7 @@ //Handle light/dark areas var/turf/T = get_turf(H) if(!T) + update_xenochimera_hud(H, danger, feral_state) return //Nullspace var/darkish = T.get_lumcount() <= 0.1 @@ -222,6 +244,7 @@ H.handle_feral() //And bail + update_xenochimera_hud(H, danger, feral_state) return // In the darkness or "hidden". No need for custom scene-protection checks as it's just an occational infomessage. @@ -268,6 +291,9 @@ else to_chat(H,"Confusing sights and sounds and smells surround you, this place is wrong, confusing, frightening. You need to hide, go to ground...") + // HUD update time + update_xenochimera_hud(H, danger, feral_state) + /datum/species/xenochimera/proc/produceCopy(var/datum/species/to_copy,var/list/traits,var/mob/living/carbon/human/H) ASSERT(to_copy) @@ -315,6 +341,19 @@ var/datum/species/real = GLOB.all_species[base_species] return real.race_key +/datum/species/xenochimera/proc/update_xenochimera_hud(var/mob/living/carbon/human/H, var/danger, var/feral) + if(H.xenochimera_danger_display) + H.xenochimera_danger_display.invisibility = 0 + if(danger && feral) + H.xenochimera_danger_display.icon_state = "danger11" + else if(danger && !feral) + H.xenochimera_danger_display.icon_state = "danger10" + else if(!danger && feral) + H.xenochimera_danger_display.icon_state = "danger01" + else + H.xenochimera_danger_display.icon_state = "danger00" + + return ///////////////////// /////SPIDER RACE///// @@ -445,3 +484,4 @@ BP_L_FOOT = list("path" = /obj/item/organ/external/foot), BP_R_FOOT = list("path" = /obj/item/organ/external/foot/right) ) + diff --git a/code/modules/mob/living/carbon/human/species/station/xenochimera_hud.dm b/code/modules/mob/living/carbon/human/species/station/xenochimera_hud.dm new file mode 100644 index 0000000000..4ef0f884b6 --- /dev/null +++ b/code/modules/mob/living/carbon/human/species/station/xenochimera_hud.dm @@ -0,0 +1,8 @@ +/obj/screen/xenochimera + icon = 'icons/mob/chimerahud.dmi' + invisibility = 101 + +/obj/screen/xenochimera/danger_level + name = "danger level" + icon_state = "danger00" //first number is bool of whether or not we're in danger, second is whether or not we're feral + alpha = 200 \ No newline at end of file diff --git a/code/modules/mob/mob_defines_vr.dm b/code/modules/mob/mob_defines_vr.dm index 70cd778e8e..48273ec211 100644 --- a/code/modules/mob/mob_defines_vr.dm +++ b/code/modules/mob/mob_defines_vr.dm @@ -6,4 +6,5 @@ var/disconnect_time = null //Time of client loss, set by Logout(), for timekeeping var/obj/screen/shadekin/darkness/shadekin_dark_display = null - var/obj/screen/shadekin/energy/shadekin_energy_display = null \ No newline at end of file + var/obj/screen/shadekin/energy/shadekin_energy_display = null + var/obj/screen/xenochimera/danger_level/xenochimera_danger_display = null \ No newline at end of file diff --git a/icons/mob/chimerahud.dmi b/icons/mob/chimerahud.dmi index 890ee10ceb..77bc745ace 100644 Binary files a/icons/mob/chimerahud.dmi and b/icons/mob/chimerahud.dmi differ diff --git a/vorestation.dme b/vorestation.dme index 40a6d8f19a..f9940626f1 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -2360,6 +2360,7 @@ #include "code\modules\mob\living\carbon\human\species\station\station_special_abilities_vr.dm" #include "code\modules\mob\living\carbon\human\species\station\station_special_vr.dm" #include "code\modules\mob\living\carbon\human\species\station\station_vr.dm" +#include "code\modules\mob\living\carbon\human\species\station\xenochimera_hud.dm" #include "code\modules\mob\living\carbon\human\species\station\protean_vr\protean_blob.dm" #include "code\modules\mob\living\carbon\human\species\station\protean_vr\protean_powers.dm" #include "code\modules\mob\living\carbon\human\species\station\protean_vr\protean_species.dm"