diff --git a/code/__DEFINES/minimap.dm b/code/__DEFINES/minimap.dm index 9069ed323357..ca6d9718cd0c 100644 --- a/code/__DEFINES/minimap.dm +++ b/code/__DEFINES/minimap.dm @@ -4,7 +4,8 @@ #define MINIMAP_FLAG_PMC (1<<2) #define MINIMAP_FLAG_UPP (1<<3) #define MINIMAP_FLAG_CLF (1<<4) -#define MINIMAP_FLAG_ALL (1<<5) - 1 +#define MINIMAP_FLAG_YAUTJA (1<<5) +#define MINIMAP_FLAG_ALL (1<<6) - 1 ///Converts the overworld x and y to minimap x and y values #define MINIMAP_SCALE 2 diff --git a/code/modules/cm_preds/yaut_bracers.dm b/code/modules/cm_preds/yaut_bracers.dm index f33d5f9a5554..c506d3a47c5b 100644 --- a/code/modules/cm_preds/yaut_bracers.dm +++ b/code/modules/cm_preds/yaut_bracers.dm @@ -46,6 +46,8 @@ var/mob/living/carbon/human/owner //Pred spawned on, or thrall given to. var/obj/item/clothing/gloves/yautja/linked_bracer //Bracer linked to this one (thrall or mentor). COOLDOWN_DECLARE(bracer_recharge) + /// What minimap icon this bracer should have + var/minimap_icon = "predator" /obj/item/clothing/gloves/yautja/equipped(mob/user, slot) . = ..() @@ -54,6 +56,8 @@ if(!owner) owner = user toggle_lock_internal(user, TRUE) + RegisterSignal(user, list(COMSIG_MOB_STAT_SET_ALIVE, COMSIG_MOB_DEATH), PROC_REF(update_minimap_icon)) + INVOKE_NEXT_TICK(src, PROC_REF(update_minimap_icon), user) /obj/item/clothing/gloves/yautja/Destroy() STOP_PROCESSING(SSobj, src) @@ -65,6 +69,8 @@ /obj/item/clothing/gloves/yautja/dropped(mob/user) STOP_PROCESSING(SSobj, src) flags_item = initial(flags_item) + UnregisterSignal(user, list(COMSIG_MOB_STAT_SET_ALIVE, COMSIG_MOB_DEATH)) + SSminimaps.remove_marker(user) ..() /obj/item/clothing/gloves/yautja/pickup(mob/living/user) @@ -102,6 +108,27 @@ /obj/item/clothing/gloves/yautja/proc/decloak() return +/// Called to update the minimap icon of the predator +/obj/item/clothing/gloves/yautja/proc/update_minimap_icon() + if(!ishuman(owner)) + return + + var/mob/living/carbon/human/human_owner = owner + var/turf/wearer_turf = get_turf(owner) + SSminimaps.remove_marker(owner) + if(!isyautja(owner)) + if(owner.stat >= DEAD) + if(human_owner.undefibbable) + SSminimaps.add_marker(owner, wearer_turf.z, MINIMAP_FLAG_YAUTJA, "bracer_stolen", 'icons/ui_icons/map_blips.dmi', overlay_iconstates = list("undefibbable")) + else + SSminimaps.add_marker(owner, wearer_turf.z, MINIMAP_FLAG_YAUTJA, "bracer_stolen", 'icons/ui_icons/map_blips.dmi', overlay_iconstates = list("defibbable")) + else + SSminimaps.add_marker(owner, wearer_turf.z, MINIMAP_FLAG_YAUTJA, "bracer_stolen", 'icons/ui_icons/map_blips.dmi') + else + if(owner?.stat >= DEAD) + SSminimaps.add_marker(owner, wearer_turf.z, MINIMAP_FLAG_YAUTJA, minimap_icon, 'icons/ui_icons/map_blips.dmi', overlay_iconstates = list("undefibbable")) //defib/undefib status doesn't really matter because they're gonna explode in the end regardless + else + SSminimaps.add_marker(owner, wearer_turf.z, MINIMAP_FLAG_YAUTJA, minimap_icon, 'icons/ui_icons/map_blips.dmi') /* *This is the main proc for checking AND draining the bracer energy. It must have human passed as an argument. *It can take a negative value in amount to restore energy. @@ -193,8 +220,23 @@ desc = "A pair of strange alien bracers, adapted for human biology." color = "#b85440" + minimap_icon = "thrall" +/obj/item/clothing/gloves/yautja/thrall/update_minimap_icon() + if(!ishuman(owner)) + return + + var/mob/living/carbon/human/human_owner = owner + var/turf/wearer_turf = get_turf(owner) + if(owner.stat >= DEAD) + if(human_owner.undefibbable) + SSminimaps.add_marker(owner, wearer_turf.z, MINIMAP_FLAG_YAUTJA, minimap_icon, overlay_iconstates = list("undefibbable")) + else + SSminimaps.add_marker(owner, wearer_turf.z, MINIMAP_FLAG_YAUTJA, minimap_icon, overlay_iconstates = list("defibbable")) + else + SSminimaps.add_marker(owner, wearer_turf.z, MINIMAP_FLAG_YAUTJA, minimap_icon) + /obj/item/clothing/gloves/yautja/hunter name = "clan bracers" desc = "An extremely complex, yet simple-to-operate set of armored bracers worn by the Yautja. It has many functions, activate them to use some." diff --git a/icons/ui_icons/map_blips.dmi b/icons/ui_icons/map_blips.dmi index 829d9b8a43b0..0034b4fd6ff7 100644 Binary files a/icons/ui_icons/map_blips.dmi and b/icons/ui_icons/map_blips.dmi differ