Files
3641316ebe Fix perks not shown in roundend and also perks sprites and hud. (#87296)
## About The Pull Request

Fixes that perks not shown in wizard purchases in roundend report.
Added perks sprites: they show up when you buy them.
![Снимок экрана 2024-10-18
161649](https://github.com/user-attachments/assets/8ddadf83-1103-4cb3-9634-4862290f686d)
Ingame:
![Снимок экрана 2024-10-18
195713](https://github.com/user-attachments/assets/f85ca8bb-d17b-49a3-a29d-861e63ade3a3)

## Why It's Good For The Game

Fixes is good. 
Sprites to understand what perks you bought.

## Changelog

🆑
qol: Purchased perks now shown in hud.
fix: Perks purchased by a wizard now shown in roundend report.
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2024-11-02 12:59:17 +00:00

36 lines
1.1 KiB
Plaintext

/atom/movable/screen/perk
icon = 'icons/hud/perks.dmi'
name = "blank"
icon_state = "blank"
/atom/movable/screen/perk/more
name = "more"
icon_state = "more"
// When compact we don't show our perk huds in ui.
var/compact = FALSE
// List of all perks that we see on hud.
var/list/perks_on_hud = list()
// List to remember all perks we hide when compact it.
var/list/perks_compacted = list()
/atom/movable/screen/perk/more/Click(location, control, params)
. = ..()
if(!isliving(usr))
return
var/mob/living/usr_is_living = usr
var/datum/antagonist/wizard/wizard_datum = usr_is_living.mind.has_antag_datum(/datum/antagonist/wizard)
if(!wizard_datum)
return
compact = !compact
var/datum/hud/user_hud = usr_is_living.hud_used
if(compact)
for(var/atom/movable/screen/perk/perk_on_hud as anything in perks_on_hud)
perks_compacted += perk_on_hud
user_hud.infodisplay -= perk_on_hud
user_hud.show_hud(user_hud.hud_version)
else
for(var/atom/movable/screen/perk/perk_compacted as anything in perks_compacted)
user_hud.infodisplay += perk_compacted
perks_compacted -= perk_compacted
user_hud.show_hud(user_hud.hud_version)