From ca41cddc80682efccede4026d7ab5e29335b4848 Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Mon, 20 May 2024 14:23:41 +0300 Subject: [PATCH 01/13] a --- code/__DEFINES/mob_hud.dm | 2 + .../effects/xeno_strains/execute_tag.dm | 41 +++++++++++++++++++ code/datums/mob_hud.dm | 27 +++++++++++- .../mob/living/carbon/human/human_defines.dm | 2 +- code/modules/mob/living/carbon/human/life.dm | 8 ++++ .../mob/living/carbon/xenomorph/Xenomorph.dm | 1 + .../strains/castes/lurker/vampire.dm | 4 ++ colonialmarines.dme | 1 + 8 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 code/datums/effects/xeno_strains/execute_tag.dm diff --git a/code/__DEFINES/mob_hud.dm b/code/__DEFINES/mob_hud.dm index 97fbc64a9da4..7536b7576d8d 100644 --- a/code/__DEFINES/mob_hud.dm +++ b/code/__DEFINES/mob_hud.dm @@ -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. @@ -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" diff --git a/code/datums/effects/xeno_strains/execute_tag.dm b/code/datums/effects/xeno_strains/execute_tag.dm new file mode 100644 index 000000000000..92cf326c9560 --- /dev/null +++ b/code/datums/effects/xeno_strains/execute_tag.dm @@ -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/A, mob/from = null, last_dmg_source = null, zone = "chest", ttl = 35) + . = ..(A, from, last_dmg_source, zone) + + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), src), ttl) + + if (ishuman(A)) + var/mob/living/carbon/human/H = A + H.update_xeno_hostile_hud() + + +/datum/effects/execute_tag/validate_atom(mob/living/carbon/H) + if (!isxeno_human(H) || H.stat == DEAD) + return FALSE + return ..() + + +/datum/effects/execute_tag/process_mob() + . = ..() + + // Also checks for null atoms + if (!istype(affected_atom, /mob/living/carbon/human)) + return + + var/mob/living/carbon/human/H = affected_atom + H.update_xeno_hostile_hud() + + +/datum/effects/execute_tag/Destroy() + if (!ishuman(affected_atom)) + return ..() + + var/mob/living/carbon/human/H = affected_atom + addtimer(CALLBACK(H, TYPE_PROC_REF(/mob/living/carbon/human, update_xeno_hostile_hud)), 3) + + return ..() diff --git a/code/datums/mob_hud.dm b/code/datums/mob_hud.dm index 975bd5d15cb9..666ea2fe9130 100644 --- a/code/datums/mob_hud.dm +++ b/code/datums/mob_hud.dm @@ -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 @@ -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) @@ -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) @@ -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] diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index e611452e9de7..de901f941efb 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -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 diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 1a43138421e4..71b0725e6c4a 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -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) + qdel(target_tag) + + if (HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || stat == UNCONSCIOUS) + new /datum/effects/execute_tag(src, src, , , 35) + + src.update_execute_hud() diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index adfb65169c88..78d590a29afe 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -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 diff --git a/code/modules/mob/living/carbon/xenomorph/strains/castes/lurker/vampire.dm b/code/modules/mob/living/carbon/xenomorph/strains/castes/lurker/vampire.dm index 34dfcc325943..820aa662c919 100644 --- a/code/modules/mob/living/carbon/xenomorph/strains/castes/lurker/vampire.dm +++ b/code/modules/mob/living/carbon/xenomorph/strains/castes/lurker/vampire.dm @@ -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() diff --git a/colonialmarines.dme b/colonialmarines.dme index 82a9692c251a..cea8b6244e0c 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -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" From ae59329aa6f813886d672554c8efa290bf559889 Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Fri, 24 May 2024 16:05:10 +0300 Subject: [PATCH 02/13] Apply suggestions from code review Co-authored-by: harryob <55142896+harryob@users.noreply.github.com> --- .../effects/xeno_strains/execute_tag.dm | 22 +++++++++---------- code/modules/mob/living/carbon/human/life.dm | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/code/datums/effects/xeno_strains/execute_tag.dm b/code/datums/effects/xeno_strains/execute_tag.dm index 92cf326c9560..5503b35a296c 100644 --- a/code/datums/effects/xeno_strains/execute_tag.dm +++ b/code/datums/effects/xeno_strains/execute_tag.dm @@ -4,18 +4,18 @@ flags = DEL_ON_DEATH | INF_DURATION -/datum/effects/execute_tag/New(atom/A, mob/from = null, last_dmg_source = null, zone = "chest", ttl = 35) - . = ..(A, from, last_dmg_source, zone) +/datum/effects/execute_tag/New(atom/affected, mob/from = null, last_dmg_source = null, zone = "chest", ttl = 35) + . = ..() addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), src), ttl) - if (ishuman(A)) - var/mob/living/carbon/human/H = A - H.update_xeno_hostile_hud() + if (ishuman(affected)) + var/mob/living/carbon/human/affected_human = affected + affected_human.update_xeno_hostile_hud() -/datum/effects/execute_tag/validate_atom(mob/living/carbon/H) - if (!isxeno_human(H) || H.stat == DEAD) +/datum/effects/execute_tag/validate_atom(mob/living/carbon/affected_carbon) + if (!isxeno_human(affected_carbon) || affected_carbon.stat == DEAD) return FALSE return ..() @@ -27,15 +27,15 @@ if (!istype(affected_atom, /mob/living/carbon/human)) return - var/mob/living/carbon/human/H = affected_atom - H.update_xeno_hostile_hud() + var/mob/living/carbon/human/affected_human = affected_atom + affected_human.update_xeno_hostile_hud() /datum/effects/execute_tag/Destroy() if (!ishuman(affected_atom)) return ..() - var/mob/living/carbon/human/H = affected_atom - addtimer(CALLBACK(H, TYPE_PROC_REF(/mob/living/carbon/human, update_xeno_hostile_hud)), 3) + var/mob/living/carbon/human/affected_human = affected_atom + addtimer(CALLBACK(affected_human, TYPE_PROC_REF(/mob/living/carbon/human, update_xeno_hostile_hud)), 0.3 SECONDS) return ..() diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 71b0725e6c4a..0e38c7429378 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -100,6 +100,6 @@ qdel(target_tag) if (HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || stat == UNCONSCIOUS) - new /datum/effects/execute_tag(src, src, , , 35) + new /datum/effects/execute_tag(src, src, ttl = 35) src.update_execute_hud() From f99c2b45b3fec544a33d8e46fc7652894794d69f Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Fri, 24 May 2024 16:10:55 +0300 Subject: [PATCH 03/13] Update execute_tag.dm --- code/datums/effects/xeno_strains/execute_tag.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/datums/effects/xeno_strains/execute_tag.dm b/code/datums/effects/xeno_strains/execute_tag.dm index 5503b35a296c..3f4e5da75081 100644 --- a/code/datums/effects/xeno_strains/execute_tag.dm +++ b/code/datums/effects/xeno_strains/execute_tag.dm @@ -7,11 +7,11 @@ /datum/effects/execute_tag/New(atom/affected, mob/from = null, last_dmg_source = null, zone = "chest", ttl = 35) . = ..() - addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), src), ttl) + QDEL_IN(src, ttl) if (ishuman(affected)) var/mob/living/carbon/human/affected_human = affected - affected_human.update_xeno_hostile_hud() + affected_human.update_execute_hud() /datum/effects/execute_tag/validate_atom(mob/living/carbon/affected_carbon) @@ -28,7 +28,7 @@ return var/mob/living/carbon/human/affected_human = affected_atom - affected_human.update_xeno_hostile_hud() + affected_human.update_execute_hud() /datum/effects/execute_tag/Destroy() @@ -36,6 +36,6 @@ return ..() var/mob/living/carbon/human/affected_human = affected_atom - addtimer(CALLBACK(affected_human, TYPE_PROC_REF(/mob/living/carbon/human, update_xeno_hostile_hud)), 0.3 SECONDS) + addtimer(CALLBACK(affected_human, TYPE_PROC_REF(/mob/living/carbon/human, update_execute_hud)), 0.3 SECONDS) return ..() From 01eeb789bd41ee4e5e35ddcddcbda1e1544501d3 Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Fri, 7 Jun 2024 15:49:14 +0300 Subject: [PATCH 04/13] Update code/modules/mob/living/carbon/human/life.dm Co-authored-by: harryob <55142896+harryob@users.noreply.github.com> --- code/modules/mob/living/carbon/human/life.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 0e38c7429378..29c9d43efbe1 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -102,4 +102,4 @@ if (HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || stat == UNCONSCIOUS) new /datum/effects/execute_tag(src, src, ttl = 35) - src.update_execute_hud() + update_execute_hud() From 50a336c603c62f623f7bbb9e0d6746080a519ebf Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Wed, 19 Jun 2024 21:52:15 +0300 Subject: [PATCH 05/13] review --- .../effects/xeno_strains/execute_tag.dm | 41 ------------------- code/datums/mob_hud.dm | 10 +---- code/modules/mob/living/carbon/human/human.dm | 18 ++++++++ code/modules/mob/living/carbon/human/life.dm | 11 ++--- colonialmarines.dme | 1 - 5 files changed, 24 insertions(+), 57 deletions(-) delete mode 100644 code/datums/effects/xeno_strains/execute_tag.dm diff --git a/code/datums/effects/xeno_strains/execute_tag.dm b/code/datums/effects/xeno_strains/execute_tag.dm deleted file mode 100644 index 3f4e5da75081..000000000000 --- a/code/datums/effects/xeno_strains/execute_tag.dm +++ /dev/null @@ -1,41 +0,0 @@ -/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) - - if (ishuman(affected)) - var/mob/living/carbon/human/affected_human = affected - affected_human.update_execute_hud() - - -/datum/effects/execute_tag/validate_atom(mob/living/carbon/affected_carbon) - if (!isxeno_human(affected_carbon) || affected_carbon.stat == DEAD) - return FALSE - return ..() - - -/datum/effects/execute_tag/process_mob() - . = ..() - - // Also checks for null atoms - if (!istype(affected_atom, /mob/living/carbon/human)) - return - - var/mob/living/carbon/human/affected_human = affected_atom - affected_human.update_execute_hud() - - -/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 ..() diff --git a/code/datums/mob_hud.dm b/code/datums/mob_hud.dm index 666ea2fe9130..633e53e62a05 100644 --- a/code/datums/mob_hud.dm +++ b/code/datums/mob_hud.dm @@ -782,19 +782,13 @@ GLOBAL_DATUM(hud_icon_hudfocus, /image) holder.icon_state = holo_card_color ? "holo_card_[holo_card_color]" : "hudblank" // Vampire Execute HUD -/mob/living/carbon/human/proc/update_execute_hud() +/mob/living/carbon/human/proc/update_execute_hud(show) 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) + if(show) execute_holder.overlays += image('icons/mob/hud/hud.dmi', src, "prae_tag") // Xeno "hostile" HUD diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index eb19593bde46..7cbc6f74a1b9 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1704,3 +1704,21 @@ item.showoff(src) return TRUE return ..() + +/mob/living/carbon/human/on_knockedout_trait_gain(datum/source) + SIGNAL_HANDLER + . = ..() + if(!length(hud_list[XENO_EXECUTE].overlays)) + update_execute_hud(show=TRUE) + + return . + +/mob/living/carbon/human/on_knockedout_trait_loss(datum/source) + SIGNAL_HANDLER + . = ..() + + if(stat != UNCONSCIOUS && length(hud_list[XENO_EXECUTE].overlays)) + update_execute_hud(show=FALSE) + + return . + diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 29c9d43efbe1..1468578e0d9f 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -96,10 +96,7 @@ if(stat != .) handle_regular_hud_updates() - for (var/datum/effects/execute_tag/target_tag in src.effects_list) - qdel(target_tag) - - if (HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || stat == UNCONSCIOUS) - new /datum/effects/execute_tag(src, src, ttl = 35) - - update_execute_hud() + if(stat == UNCONSCIOUS && !length(hud_list[XENO_EXECUTE].overlays)) + update_execute_hud(show=TRUE) + else if(!HAS_TRAIT(src, TRAIT_KNOCKEDOUT) && length(hud_list[XENO_EXECUTE].overlays)) + update_execute_hud(show=FALSE) diff --git a/colonialmarines.dme b/colonialmarines.dme index cea8b6244e0c..82a9692c251a 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -475,7 +475,6 @@ #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" From bb07ff63266f62ec453603c9f2e6b7f29d0705cd Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Wed, 19 Jun 2024 22:57:58 +0300 Subject: [PATCH 06/13] a --- code/datums/mob_hud.dm | 4 ++-- code/modules/mob/living/carbon/human/human.dm | 14 ++++++++++---- code/modules/mob/living/carbon/human/life.dm | 5 ----- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/code/datums/mob_hud.dm b/code/datums/mob_hud.dm index 633e53e62a05..c0303432f998 100644 --- a/code/datums/mob_hud.dm +++ b/code/datums/mob_hud.dm @@ -782,13 +782,13 @@ GLOBAL_DATUM(hud_icon_hudfocus, /image) holder.icon_state = holo_card_color ? "holo_card_[holo_card_color]" : "hudblank" // Vampire Execute HUD -/mob/living/carbon/human/proc/update_execute_hud(show) +/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(show) + if(stat == UNCONSCIOUS || HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) execute_holder.overlays += image('icons/mob/hud/hud.dmi', src, "prae_tag") // Xeno "hostile" HUD diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 7cbc6f74a1b9..c16a19be1edb 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -21,6 +21,11 @@ if(SSticker?.mode?.hardcore) hardcore = TRUE //For WO disposing of corpses + RegisterSignal(src, COMSIG_MOB_STATCHANGE, PROC_REF(on_stat_change)) + +/mob/living/carbon/human/proc/on_stat_change() + update_execute_hud() + /mob/living/carbon/human/initialize_pass_flags(datum/pass_flags_container/PF) ..() if (PF) @@ -91,6 +96,8 @@ selected_ability = null remembered_dropped_objects = null + UnregisterSignal(src, COMSIG_MOB_STATCHANGE) + /mob/living/carbon/human/get_status_tab_items() . = ..() @@ -1708,8 +1715,8 @@ /mob/living/carbon/human/on_knockedout_trait_gain(datum/source) SIGNAL_HANDLER . = ..() - if(!length(hud_list[XENO_EXECUTE].overlays)) - update_execute_hud(show=TRUE) + + update_execute_hud() return . @@ -1717,8 +1724,7 @@ SIGNAL_HANDLER . = ..() - if(stat != UNCONSCIOUS && length(hud_list[XENO_EXECUTE].overlays)) - update_execute_hud(show=FALSE) + update_execute_hud() return . diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 1468578e0d9f..1a43138421e4 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -95,8 +95,3 @@ // Remove this once effects have been ported to trait signals (blinded, dazed, etc) if(stat != .) handle_regular_hud_updates() - - if(stat == UNCONSCIOUS && !length(hud_list[XENO_EXECUTE].overlays)) - update_execute_hud(show=TRUE) - else if(!HAS_TRAIT(src, TRAIT_KNOCKEDOUT) && length(hud_list[XENO_EXECUTE].overlays)) - update_execute_hud(show=FALSE) From 4649b9eeb53caa3f29ebc3cc0f7a2753370f4dea Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Wed, 19 Jun 2024 22:58:40 +0300 Subject: [PATCH 07/13] Update human.dm --- code/modules/mob/living/carbon/human/human.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index c16a19be1edb..6ff6d83f21fa 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -24,6 +24,7 @@ RegisterSignal(src, COMSIG_MOB_STATCHANGE, PROC_REF(on_stat_change)) /mob/living/carbon/human/proc/on_stat_change() + SIGNAL_HANDLER update_execute_hud() /mob/living/carbon/human/initialize_pass_flags(datum/pass_flags_container/PF) From 2aac31d1fe717e7f61b2665cefe4d1d6697052de Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Wed, 19 Jun 2024 23:00:46 +0300 Subject: [PATCH 08/13] Update human.dm --- code/modules/mob/living/carbon/human/human.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 6ff6d83f21fa..6e405e31753c 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -21,9 +21,9 @@ if(SSticker?.mode?.hardcore) hardcore = TRUE //For WO disposing of corpses - RegisterSignal(src, COMSIG_MOB_STATCHANGE, PROC_REF(on_stat_change)) + RegisterSignal(src, COMSIG_MOB_DEATH, PROC_REF(on_stat_change)) -/mob/living/carbon/human/proc/on_stat_change() +/mob/living/carbon/human/proc/on_death() SIGNAL_HANDLER update_execute_hud() @@ -97,7 +97,7 @@ selected_ability = null remembered_dropped_objects = null - UnregisterSignal(src, COMSIG_MOB_STATCHANGE) + UnregisterSignal(src, COMSIG_MOB_DEATH) /mob/living/carbon/human/get_status_tab_items() . = ..() From f68f1173b106ad83d940ccbeb9e0204fced256fc Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Wed, 19 Jun 2024 23:01:12 +0300 Subject: [PATCH 09/13] Update human.dm --- code/modules/mob/living/carbon/human/human.dm | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 6e405e31753c..44c47cccdc6e 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1714,7 +1714,6 @@ return ..() /mob/living/carbon/human/on_knockedout_trait_gain(datum/source) - SIGNAL_HANDLER . = ..() update_execute_hud() @@ -1722,7 +1721,6 @@ return . /mob/living/carbon/human/on_knockedout_trait_loss(datum/source) - SIGNAL_HANDLER . = ..() update_execute_hud() From 5eeecd04628b69c440f9e434361d3cc554a44095 Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Wed, 19 Jun 2024 23:03:25 +0300 Subject: [PATCH 10/13] Update human.dm --- code/modules/mob/living/carbon/human/human.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 44c47cccdc6e..f75bfedcd354 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -21,7 +21,7 @@ if(SSticker?.mode?.hardcore) hardcore = TRUE //For WO disposing of corpses - RegisterSignal(src, COMSIG_MOB_DEATH, PROC_REF(on_stat_change)) + RegisterSignal(src, COMSIG_MOB_DEATH, PROC_REF(on_death)) /mob/living/carbon/human/proc/on_death() SIGNAL_HANDLER From 2550565dd17570b9ea18ec6bf467be11315f17e4 Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Wed, 19 Jun 2024 23:11:30 +0300 Subject: [PATCH 11/13] b --- code/modules/mob/living/carbon/human/death.dm | 2 ++ code/modules/mob/living/carbon/human/human.dm | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index c97e4344cabf..34582a6612d4 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -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() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index f75bfedcd354..4d97587def47 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -21,12 +21,6 @@ if(SSticker?.mode?.hardcore) hardcore = TRUE //For WO disposing of corpses - RegisterSignal(src, COMSIG_MOB_DEATH, PROC_REF(on_death)) - -/mob/living/carbon/human/proc/on_death() - SIGNAL_HANDLER - update_execute_hud() - /mob/living/carbon/human/initialize_pass_flags(datum/pass_flags_container/PF) ..() if (PF) From da9c9fbe853ecf93a8c988f3e15e1c81572090c4 Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Wed, 19 Jun 2024 23:14:04 +0300 Subject: [PATCH 12/13] Update human.dm --- code/modules/mob/living/carbon/human/human.dm | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 4d97587def47..6db31ea6451a 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -91,8 +91,6 @@ selected_ability = null remembered_dropped_objects = null - UnregisterSignal(src, COMSIG_MOB_DEATH) - /mob/living/carbon/human/get_status_tab_items() . = ..() From 79e7754851b8e67798e2f1b56aca90e62b3d2e65 Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Wed, 19 Jun 2024 23:26:03 +0300 Subject: [PATCH 13/13] Update mob_hud.dm --- code/datums/mob_hud.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/mob_hud.dm b/code/datums/mob_hud.dm index c0303432f998..603f9a05d702 100644 --- a/code/datums/mob_hud.dm +++ b/code/datums/mob_hud.dm @@ -788,7 +788,7 @@ GLOBAL_DATUM(hud_icon_hudfocus, /image) execute_holder.icon_state = "hudblank" execute_holder.overlays.Cut() - if(stat == UNCONSCIOUS || HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) + 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