Skip to content

Commit

Permalink
Preds now show up on the predship tacmap (#4080)
Browse files Browse the repository at this point in the history
# About the pull request
Now makes preds (and thralls) show up on their (and only their) tacmaps.

Additionally, anyone wearing a stolen bracer (since that's what the
tracker is based from) has a custom icon on the tacmap.

# Explain why it's good for the game
Well, it makes sense that preds should be able to see each other on
their tacmap. Not sure if this was intended when preds got their tacmap,
but it's here now.

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
add: Predators and thralls are now visible on the predship tacmap.
add: Anyone wearing a stolen predator bracer is now visible on the
predship tacmap.
/:cl:

---------

Co-authored-by: John Doe <[email protected]>
  • Loading branch information
Zonespace27 and johndoe2013 authored Aug 3, 2023
1 parent 6dd2c71 commit 36b6bff
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/__DEFINES/minimap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
42 changes: 42 additions & 0 deletions code/modules/cm_preds/yaut_bracers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. = ..()
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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."
Expand Down
Binary file modified icons/ui_icons/map_blips.dmi
Binary file not shown.

0 comments on commit 36b6bff

Please sign in to comment.