mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-09 23:27:56 +01:00
8c534a521e
## About The Pull Request I'm making the ordeal of finding a maint disk (or buying blackmarket bootleg disk) with a theme in it a slightly more rewarding experience, while sticking to the concept that it's something you've to find, unlike default PDA themes. This PR also proves to be an opportunity to put the progress tab that I coded a year ago for the 'Fishdex' to good use. TODO: ~~Refactor preferences to allow specific choices to be shown/hidden depending on whether the player meets a defined criteria, otherwise you'll have to do it manually every round, which is lame~~ - [x] Make some simple ui icons associated with each unlockable theme to be shown in the cheevo progress tab - [x] Code to validate deserialized DB values, in the remote case that any theme is removed in the future, as well as unit test code for any non-abstract theme without ID - [x] Add sound cue and chat feedback when unlocking a theme (or when fishing a new kind of fish for the first time, like, the code's similar) - [x] Test all of this ## Why It's Good For The Game These themes are basically an end in itself, and I understand the reason behind their existence is to make for some cute, little maint loot, but relegating it to chance of finding a disk somewhere in maintenance, **every single round** really rots whatever little substance this purely cosmetic feature already has. ## Changelog 🆑 add: Once installed, special PDA themes from maintenance disks will be present on your roundstart PDA on future rounds (Sadly I couldn't figure out a way to add those to the preferences UI yet). You can check which PDA themes you've unlocked in the Progress tab of the achievements UI. /🆑
43 lines
1.9 KiB
Plaintext
43 lines
1.9 KiB
Plaintext
///Checks that all achievements have an existing icon state in the achievements icon file.
|
|
/datum/unit_test/achievements
|
|
|
|
/datum/unit_test/achievements/Run()
|
|
var/list/collected_ids = list()
|
|
for(var/datum/award/award as anything in subtypesof(/datum/award))
|
|
if(!initial(award.name)) //Skip abstract achievements types
|
|
continue
|
|
if(!award::icon_state || !icon_exists(award::icon, award::icon_state))
|
|
TEST_FAIL("[award] has a non-existent icon in [award::icon]: \"[award::icon_state || "null"]\"")
|
|
if(!(award::category in GLOB.achievement_categories))
|
|
TEST_FAIL("[award] has unsupported category: \"[award::category || "null"]\". Update GLOB.achievement_categories")
|
|
if(length(award::database_id) > 32) //sql schema limit
|
|
TEST_FAIL("[award] database id is too long")
|
|
else if(!award::database_id)
|
|
TEST_FAIL("[award] doesn't have a database id")
|
|
continue
|
|
if(collected_ids[award::database_id])
|
|
TEST_FAIL("There's already an award with same database id as [award]")
|
|
collected_ids[award::database_id] = TRUE
|
|
|
|
|
|
///Check that non-abstract maintenance themes have an id, name and icon
|
|
/datum/unit_test/unlockable_themes
|
|
|
|
/datum/unit_test/unlockable_themes/Run()
|
|
var/list/collected_ids = list()
|
|
for(var/datum/computer_file/program/maintenance/theme/theme as anything in typesof(/datum/computer_file/program/maintenance/theme))
|
|
if(theme::abstract_type == theme)
|
|
continue
|
|
if(!theme::theme_name)
|
|
TEST_FAIL("[theme] doesn't have a set name")
|
|
if(!theme::theme_id)
|
|
TEST_FAIL("[theme] doesn't have a set id")
|
|
if(length(theme::theme_id) > 32) //sql schema limit
|
|
TEST_FAIL("[theme] theme id is too long")
|
|
if(!theme::icon || !icon_exists(theme::icon_file, theme::icon))
|
|
TEST_FAIL("[theme] has a non-existent icon in [theme::icon_file]: \"[theme::icon || "null"]\"")
|
|
continue
|
|
if(collected_ids[theme::theme_id])
|
|
TEST_FAIL("There's already a theme with same id as [theme]")
|
|
collected_ids[theme::theme_id] = TRUE
|