Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a HUD icon for crit marines for vampire lurker #6314

Merged
merged 13 commits into from
Jun 19, 2024
2 changes: 2 additions & 0 deletions code/__DEFINES/mob_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define XENO_HOSTILE_SLOW "13" // xeno-inflicted slow. used by a bunch of MOBA xenos stuff
#define XENO_HOSTILE_TAG "14" // dancer prae 'tag'
#define XENO_HOSTILE_FREEZE "15" // Any xeno-inflifcted root
#define XENO_EXECUTE "28" // Execute thershold, vampire

#define HEALTH_HUD_XENO "16" // health HUD for xenos
#define PLASMA_HUD "17" // indicates the plasma level of xenos.
Expand Down Expand Up @@ -45,6 +46,7 @@
#define MOB_HUD_FACTION_PMC 15
#define MOB_HUD_HUNTER 16
#define MOB_HUD_HUNTER_CLAN 17
#define MOB_HUD_EXECUTE 18

//for SL/FTL/LZ targeting on locator huds
#define TRACKER_SL "track_sl"
Expand Down
21 changes: 20 additions & 1 deletion code/datums/mob_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list(
MOB_HUD_FACTION_CLF = new /datum/mob_hud/faction/clf(),
MOB_HUD_FACTION_PMC = new /datum/mob_hud/faction/pmc(),
MOB_HUD_HUNTER = new /datum/mob_hud/hunter_hud(),
MOB_HUD_HUNTER_CLAN = new /datum/mob_hud/hunter_clan()
MOB_HUD_HUNTER_CLAN = new /datum/mob_hud/hunter_clan(),
MOB_HUD_EXECUTE = new /datum/mob_hud/execute_hud(),
))

/datum/mob_hud
Expand Down Expand Up @@ -167,6 +168,9 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list(
/datum/mob_hud/xeno_hostile
hud_icons = list(XENO_HOSTILE_ACID, XENO_HOSTILE_SLOW, XENO_HOSTILE_TAG, XENO_HOSTILE_FREEZE)

/datum/mob_hud/execute_hud
hud_icons = list(XENO_EXECUTE)

/datum/mob_hud/hunter_clan
hud_icons = list(HUNTER_CLAN)

Expand Down Expand Up @@ -259,6 +263,11 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list(
var/datum/mob_hud/hostile_hud = GLOB.huds[MOB_HUD_XENO_HOSTILE]
hostile_hud.remove_hud_from(src, src)

if (execute_hud)
execute_hud = FALSE
var/datum/mob_hud/execute = GLOB.huds[MOB_HUD_EXECUTE]
execute.remove_hud_from(src, src)



/mob/proc/refresh_huds(mob/source_mob)
Expand Down Expand Up @@ -772,6 +781,16 @@ GLOBAL_DATUM(hud_icon_hudfocus, /image)
var/image/holder = hud_list[HOLOCARD_HUD]
holder.icon_state = holo_card_color ? "holo_card_[holo_card_color]" : "hudblank"

// Vampire Execute HUD
/mob/living/carbon/human/proc/update_execute_hud()
var/image/execute_holder = hud_list[XENO_EXECUTE]

execute_holder.icon_state = "hudblank"
execute_holder.overlays.Cut()

if(stat == UNCONSCIOUS || (stat != DEAD && HAS_TRAIT(src, TRAIT_KNOCKEDOUT)))
execute_holder.overlays += image('icons/mob/hud/hud.dmi', src, "prae_tag")

// Xeno "hostile" HUD
/mob/living/carbon/human/proc/update_xeno_hostile_hud()
var/image/acid_holder = hud_list[XENO_HOSTILE_ACID]
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/human/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,5 @@
else if(death_data?.cause_name == "existing")
// Corpses spawn as gibbed true to avoid sfx, even though they aren't actually gibbed...
AddComponent(/datum/component/weed_food)

update_execute_hud()
15 changes: 15 additions & 0 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1704,3 +1704,18 @@
item.showoff(src)
return TRUE
return ..()

/mob/living/carbon/human/on_knockedout_trait_gain(datum/source)
. = ..()

update_execute_hud()

return .

/mob/living/carbon/human/on_knockedout_trait_loss(datum/source)
. = ..()

update_execute_hud()

return .

2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/human_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
var/last_chew = 0

//taken from human.dm
hud_possible = list(HEALTH_HUD, STATUS_HUD, STATUS_HUD_OOC, STATUS_HUD_XENO_INFECTION, STATUS_HUD_XENO_CULTIST, ID_HUD, WANTED_HUD, ORDER_HUD, XENO_HOSTILE_ACID, XENO_HOSTILE_SLOW, XENO_HOSTILE_TAG, XENO_HOSTILE_FREEZE, HUNTER_CLAN, HUNTER_HUD, FACTION_HUD, HOLOCARD_HUD)
hud_possible = list(HEALTH_HUD, STATUS_HUD, STATUS_HUD_OOC, STATUS_HUD_XENO_INFECTION, STATUS_HUD_XENO_CULTIST, ID_HUD, WANTED_HUD, ORDER_HUD, XENO_HOSTILE_ACID, XENO_HOSTILE_SLOW, XENO_HOSTILE_TAG, XENO_HOSTILE_FREEZE, XENO_EXECUTE, HUNTER_CLAN, HUNTER_HUD, FACTION_HUD, HOLOCARD_HUD)
var/embedded_flag //To check if we've need to roll for damage on movement while an item is imbedded in us.
var/allow_gun_usage = TRUE
var/melee_allowed = TRUE
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/xenomorph/Xenomorph.dm
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@
//////////////////////////////////////////////////////////////////
var/xeno_mobhud = FALSE //whether the xeno mobhud is activated or not.
var/xeno_hostile_hud = FALSE // 'Hostile' HUD - the verb Xenos use to see tags, etc on humans
var/execute_hud = FALSE // Crit HUD, only visible to vampire lurkers
var/list/plasma_types = list() //The types of plasma the caste contains
var/list/xeno_shields = list() // List of /datum/xeno_shield that holds all active shields on the Xeno.
var/acid_splash_cooldown = 5 SECONDS //Time it takes between acid splash retaliate procs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@
lurker.damage_modifier -= XENO_DAMAGE_MOD_VERY_SMALL
lurker.attack_speed_modifier -= 2

var/datum/mob_hud/execute_hud = GLOB.huds[MOB_HUD_EXECUTE]
execute_hud.add_hud_to(lurker, lurker)
lurker.execute_hud = TRUE

lurker.recalculate_everything()
Loading