From eae94f1506c1fa3ad8515dcf68a3ccbcda2828da Mon Sep 17 00:00:00 2001
From: SkyratBot <59378654+SkyratBot@users.noreply.github.com>
Date: Thu, 24 Aug 2023 02:00:20 +0200
Subject: [PATCH] [MIRROR] Roundend reporting now has a section for
achievements earned during the round [MDB IGNORE] (#23283)
* Roundend reporting now has a section for achievements earned during the round (#77861)
## About The Pull Request
The roundend report now has a section dedicated to achievements earned.
It will report the ckey/identity of the player, the earned achievement,
and where it was earned.

## Why It's Good For The Game
Adds some more fun stuff to the roundend report, and contributes to the
recent uptick in achievement-related PRs.
## Changelog
:cl: Rhials
add: The roundend report will now read out any achievements ("cheevos"
as you may know them) earned by players over the course of the round.
/:cl:
* Roundend reporting now has a section for achievements earned during the round
---------
Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com>
---
code/__HELPERS/roundend.dm | 26 ++++++++++++++++++++++++++
code/datums/achievements/_awards.dm | 13 +++++++++++++
2 files changed, 39 insertions(+)
diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm
index 9e14c1c1212..681f525bd5e 100644
--- a/code/__HELPERS/roundend.dm
+++ b/code/__HELPERS/roundend.dm
@@ -4,6 +4,8 @@
#define PERSONAL_LAST_ROUND "personal last round"
#define SERVER_LAST_ROUND "server last round"
+GLOBAL_LIST_INIT(achievements_unlocked, list())
+
/datum/controller/subsystem/ticker/proc/gather_roundend_feedback()
gather_antag_data()
record_nuke_disk_location()
@@ -322,6 +324,8 @@
parts += goal_report()
//Economy & Money
parts += market_report()
+ //Player Achievements
+ parts += cheevo_report()
list_clear_nulls(parts)
@@ -809,3 +813,25 @@
return
qdel(query_update_everything_ranks)
qdel(query_check_everything_ranks)
+
+/datum/controller/subsystem/ticker/proc/cheevo_report()
+ var/list/parts = list()
+ if(length(GLOB.achievements_unlocked))
+ parts += "Achievement Get!
"
+ parts += "Total Achievements Earned: [length(GLOB.achievements_unlocked)]!
"
+ parts += "