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
41 changes: 41 additions & 0 deletions code/datums/effects/xeno_strains/execute_tag.dm
Git-Nivrak marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/datum/effects/execute_tag
effect_name = "execute tag"
duration = null
flags = DEL_ON_DEATH | INF_DURATION


/datum/effects/execute_tag/New(atom/affected, mob/from = null, last_dmg_source = null, zone = "chest", ttl = 35)
. = ..()

QDEL_IN(src, ttl)
Git-Nivrak marked this conversation as resolved.
Show resolved Hide resolved

if (ishuman(affected))
var/mob/living/carbon/human/affected_human = affected
affected_human.update_execute_hud()
Git-Nivrak marked this conversation as resolved.
Show resolved Hide resolved


/datum/effects/execute_tag/validate_atom(mob/living/carbon/affected_carbon)
if (!isxeno_human(affected_carbon) || affected_carbon.stat == DEAD)
Git-Nivrak marked this conversation as resolved.
Show resolved Hide resolved
return FALSE
return ..()


/datum/effects/execute_tag/process_mob()
. = ..()

// Also checks for null atoms
if (!istype(affected_atom, /mob/living/carbon/human))
Git-Nivrak marked this conversation as resolved.
Show resolved Hide resolved
return

var/mob/living/carbon/human/affected_human = affected_atom
affected_human.update_execute_hud()
Git-Nivrak marked this conversation as resolved.
Show resolved Hide resolved


/datum/effects/execute_tag/Destroy()
if (!ishuman(affected_atom))
return ..()

var/mob/living/carbon/human/affected_human = affected_atom
addtimer(CALLBACK(affected_human, TYPE_PROC_REF(/mob/living/carbon/human, update_execute_hud)), 0.3 SECONDS)

return ..()
Git-Nivrak marked this conversation as resolved.
Show resolved Hide resolved
27 changes: 26 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,22 @@ 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()

var/execute_found = FALSE
for (var/datum/effects/execute_tag/ET in effects_list)
if (!QDELETED(ET))
execute_found = TRUE
break

if (execute_found)
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: 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
8 changes: 8 additions & 0 deletions code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,11 @@
// Remove this once effects have been ported to trait signals (blinded, dazed, etc)
if(stat != .)
handle_regular_hud_updates()

for (var/datum/effects/execute_tag/target_tag in src.effects_list)
Git-Nivrak marked this conversation as resolved.
Show resolved Hide resolved
qdel(target_tag)

if (HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || stat == UNCONSCIOUS)
new /datum/effects/execute_tag(src, src, ttl = 35)

src.update_execute_hud()
Git-Nivrak marked this conversation as resolved.
Show resolved Hide resolved
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()
1 change: 1 addition & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@
#include "code\datums\effects\stamina\stamina_human.dm"
#include "code\datums\effects\xeno_strains\boiler_trap.dm"
#include "code\datums\effects\xeno_strains\dancer_tag.dm"
#include "code\datums\effects\xeno_strains\execute_tag.dm"
#include "code\datums\effects\xeno_strains\gain_xeno_cooldown_reduction_on_slash.dm"
#include "code\datums\effects\xeno_strains\prae_acid_stacks.dm"
#include "code\datums\effects\xeno_strains\xeno_buff.dm"
Expand Down
Loading