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

Preds now show up on the predship tacmap #4080

Merged
merged 3 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.