mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 03:55:11 +01:00
Maintenance PDA themes are added to roundstart PDAs on future rounds as well once installed (#92983)
## 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. /🆑
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
/// Station alert datum for showing alerts UI
|
||||
var/datum/station_alert/alert_control
|
||||
|
||||
/datum/computer_file/program/alarm_monitor/on_install()
|
||||
/datum/computer_file/program/alarm_monitor/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing, mob/user)
|
||||
. = ..()
|
||||
//We want to send an alarm if we're in one of the mining home areas
|
||||
//Or if we're on station. Otherwise, die.
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// Which departments this program has access to. See region defines.
|
||||
var/target_dept
|
||||
|
||||
/datum/computer_file/program/card_mod/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing)
|
||||
/datum/computer_file/program/card_mod/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing, mob/user)
|
||||
. = ..()
|
||||
ADD_TRAIT(computer_installing, TRAIT_MODPC_TWO_ID_SLOTS, REF(src))
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
///Cooldown timer between pings.
|
||||
COOLDOWN_DECLARE(ping_cooldown)
|
||||
|
||||
/datum/computer_file/program/chatclient/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing)
|
||||
/datum/computer_file/program/chatclient/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing, mob/user)
|
||||
. = ..()
|
||||
if(!username)
|
||||
username = "DefaultUser[rand(100, 999)]"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
can_run_on_flags = PROGRAM_PDA //It relies on the PDA messenger to let you know of new codes
|
||||
detomatix_resistance = DETOMATIX_RESIST_MALUS
|
||||
|
||||
/datum/computer_file/program/coupon/on_install()
|
||||
/datum/computer_file/program/coupon/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing, mob/user)
|
||||
. = ..()
|
||||
///set the discount_coupons list, which means SSmodular_computers will now begin to periodically produce new coupon codes.
|
||||
LAZYINITLIST(SSmodular_computers.discount_coupons)
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
if(!computer.can_store_file(F))
|
||||
return FALSE
|
||||
var/datum/computer_file/C = F.clone(FALSE)
|
||||
computer.store_file(C)
|
||||
computer.store_file(C, usr)
|
||||
return TRUE
|
||||
if("PRG_togglesilence")
|
||||
var/datum/computer_file/program/binary = computer.find_file_by_name(params["name"])
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/// The file under consideration.
|
||||
var/datum/computer_file/data/ordnance/selected_file
|
||||
|
||||
/datum/computer_file/program/scipaper_program/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing)
|
||||
/datum/computer_file/program/scipaper_program/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing, mob/user)
|
||||
. = ..()
|
||||
paper_to_be = new
|
||||
if(!CONFIG_GET(flag/no_default_techweb_link) && !linked_techweb)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
program_icon = "user-secret"
|
||||
alert_able = TRUE
|
||||
|
||||
/datum/computer_file/program/mafia/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing)
|
||||
/datum/computer_file/program/mafia/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing, mob/user)
|
||||
. = ..()
|
||||
RegisterSignal(SSdcs, COMSIG_MAFIA_GAME_START, PROC_REF(on_game_start))
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
desc = "Specialized internal camera protected from the hellish depths of SSWardrobe. \
|
||||
Yell at coders if you somehow manage to see this"
|
||||
|
||||
/datum/computer_file/program/maintenance/camera/on_install()
|
||||
/datum/computer_file/program/maintenance/camera/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing, mob/user)
|
||||
. = ..()
|
||||
internal_camera = new(computer)
|
||||
internal_camera.print_picture_on_snap = FALSE
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
. = ..()
|
||||
RegisterSignal(src, COMSIG_COMPUTER_FILE_DELETE, PROC_REF(on_delete))
|
||||
|
||||
/datum/computer_file/program/maintenance/cool_sword/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing)
|
||||
/datum/computer_file/program/maintenance/cool_sword/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing, mob/user)
|
||||
. = ..()
|
||||
RegisterSignal(computer_installing, COMSIG_ITEM_EQUIPPED, PROC_REF(host_equipped))
|
||||
RegisterSignal(computer_installing, COMSIG_ITEM_DROPPED, PROC_REF(host_dropped))
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
/// PDA themes that you can find in maintenance. Once installed by a player, it'll become available to them on future rounds as well.
|
||||
/datum/computer_file/program/maintenance/theme
|
||||
filename = "theme"
|
||||
filedesc = "Theme holder"
|
||||
extended_desc = "Holds a theme you can add to your Modular PC to set in the Themify application. Makes the application use more space"
|
||||
size = 2
|
||||
abstract_type = /datum/computer_file/program/maintenance/theme
|
||||
|
||||
///The type of theme we have
|
||||
var/theme_name
|
||||
///The Database ID of the theme. It's important that non-abstract types have it set.
|
||||
var/theme_id
|
||||
///The icon file for this theme
|
||||
var/icon_file = PDA_THEMES_PROGRESS_SET
|
||||
///The icon_state for this theme to show in the progress score tab
|
||||
var/icon = ""
|
||||
|
||||
/datum/computer_file/program/maintenance/theme/New()
|
||||
. = ..()
|
||||
@@ -25,29 +33,43 @@
|
||||
return TRUE
|
||||
|
||||
///Called post-installation of an application in a computer, after 'computer' var is set.
|
||||
/datum/computer_file/program/maintenance/theme/on_install()
|
||||
/datum/computer_file/program/maintenance/theme/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing, mob/user)
|
||||
SHOULD_CALL_PARENT(FALSE)
|
||||
//add the theme to the computer and increase its size to match
|
||||
var/datum/computer_file/program/themeify/theme_app = locate() in computer.stored_files
|
||||
if(theme_app)
|
||||
LAZYADD(theme_app.imported_themes, theme_name)
|
||||
theme_app.size += size
|
||||
qdel(src)
|
||||
if(!theme_app)
|
||||
return
|
||||
LAZYADD(theme_app.imported_themes, theme_name)
|
||||
theme_app.size += size
|
||||
user?.client?.give_award(/datum/award/score/progress/pda_themes, user, theme_id, theme_name)
|
||||
qdel(src)
|
||||
|
||||
/datum/computer_file/program/maintenance/theme/cat
|
||||
theme_name = PDA_THEME_CAT_NAME
|
||||
theme_id = PDA_THEME_ID_CAT
|
||||
icon = "cat"
|
||||
|
||||
/datum/computer_file/program/maintenance/theme/lightmode
|
||||
theme_name = PDA_THEME_LIGHT_MODE_NAME
|
||||
theme_id = PDA_THEME_ID_LIGHT_MODE
|
||||
icon = "light_mode"
|
||||
|
||||
/datum/computer_file/program/maintenance/theme/spooky
|
||||
theme_name = PDA_THEME_SPOOKY_NAME
|
||||
theme_id = PDA_THEME_ID_SPOOKY
|
||||
icon = "eldritch"
|
||||
|
||||
/datum/computer_file/program/maintenance/theme/hacker
|
||||
theme_name = PDA_THEME_HACKERMAN_NAME
|
||||
theme_id = PDA_THEME_ID_HACKERMAN
|
||||
icon = "hacker"
|
||||
|
||||
/datum/computer_file/program/maintenance/theme/roulette
|
||||
theme_name = PDA_THEME_ROULETTE_NAME
|
||||
theme_id = PDA_THEME_ID_ROULETTE
|
||||
icon = "roulette"
|
||||
|
||||
/datum/computer_file/program/maintenance/theme/alien
|
||||
theme_name = PDA_THEME_ABDUCTOR_NAME
|
||||
theme_id = PDA_THEME_ID_ABDUCTOR
|
||||
icon = "alien"
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
///The program currently being downloaded.
|
||||
var/datum/computer_file/program/downloaded_file
|
||||
///weak ref to the user who began the download
|
||||
var/datum/weakref/download_user
|
||||
///Boolean on whether the `downloaded_file` is being downloaded from the Syndicate store,
|
||||
///in which case it will appear as 'ENCRYPTED' in logs, rather than display file name.
|
||||
var/hacked_download = FALSE
|
||||
@@ -35,7 +37,7 @@
|
||||
ui_header = null
|
||||
. = ..()
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/proc/begin_file_download(filename)
|
||||
/datum/computer_file/program/ntnetdownload/proc/begin_file_download(filename, mob/user)
|
||||
if(downloaded_file)
|
||||
return FALSE
|
||||
|
||||
@@ -64,6 +66,7 @@
|
||||
hacked_download = FALSE
|
||||
|
||||
downloaded_file = PRG.clone()
|
||||
download_user = WEAKREF(user)
|
||||
|
||||
// If the filesize is 0 (or somehow lower), we instantly download to avoid invalid number issues with stepwise download.
|
||||
if(downloaded_file.size <= 0)
|
||||
@@ -76,17 +79,19 @@
|
||||
downloaded_file = null
|
||||
download_completion = FALSE
|
||||
ui_header = null
|
||||
download_user = null
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/proc/complete_file_download()
|
||||
if(!downloaded_file)
|
||||
return
|
||||
generate_network_log("Completed download of file [hacked_download ? "**ENCRYPTED**" : "[downloaded_file.filename].[downloaded_file.filetype]"].")
|
||||
if(!computer || !computer.store_file(downloaded_file))
|
||||
if(!computer || !computer.store_file(downloaded_file, download_user?.resolve()))
|
||||
// The download failed
|
||||
downloaderror = "I/O ERROR - Unable to save file. Check whether you have enough free space on your hard drive and whether your hard drive is properly connected. If the issue persists contact your system administrator for assistance."
|
||||
downloaded_file = null
|
||||
download_completion = FALSE
|
||||
ui_header = "downloader_finished.gif"
|
||||
download_user = null
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/process_tick(seconds_per_tick)
|
||||
if(!downloaded_file)
|
||||
@@ -117,7 +122,7 @@
|
||||
switch(action)
|
||||
if("PRG_downloadfile")
|
||||
if(!downloaded_file)
|
||||
begin_file_download(params["filename"])
|
||||
begin_file_download(params["filename"], usr)
|
||||
return TRUE
|
||||
if("PRG_reseterror")
|
||||
if(downloaderror)
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
)
|
||||
spying = TRUE
|
||||
|
||||
/datum/computer_file/program/secureye/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing)
|
||||
/datum/computer_file/program/secureye/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing, mob/user)
|
||||
. = ..()
|
||||
// Map name has to start and end with an A-Z character,
|
||||
// and definitely NOT with a square bracket or even a number.
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
/// Sequence var for the id cache
|
||||
var/id_cache_seq = 1
|
||||
|
||||
/datum/computer_file/program/science/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing)
|
||||
/datum/computer_file/program/science/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing, mob/user)
|
||||
. = ..()
|
||||
if(!CONFIG_GET(flag/no_default_techweb_link) && !stored_research)
|
||||
CONNECT_TO_RND_SERVER_ROUNDSTART(stored_research, computer)
|
||||
|
||||
@@ -121,7 +121,7 @@ GLOBAL_LIST_EMPTY(virtual_pets_list)
|
||||
///cooldown till we can alter our pet's appearance again
|
||||
COOLDOWN_DECLARE(alter_appearance_cooldown)
|
||||
|
||||
/datum/computer_file/program/virtual_pet/on_install()
|
||||
/datum/computer_file/program/virtual_pet/on_install(datum/computer_file/source, obj/item/modular_computer/computer_installing, mob/user)
|
||||
. = ..()
|
||||
profile_picture = getFlatIcon(image(icon = 'icons/ui/virtualpet/pet_state.dmi', icon_state = "pet_preview"))
|
||||
GLOB.virtual_pets_list += src
|
||||
|
||||
Reference in New Issue
Block a user