Yogstation 13 - Modules - TypesVar Details - Proc Details

Achievements

Vars

CEThe current guy that SSachievements believes to be the CE. See /datum/controller/subsystem/achievements/proc/fire
achievementsList of all the achievement instances, one for each achievement. Access through /datum/controller/subsystem/achievements/proc/get_achievement
achievementsEarnedDictionary of all achievements earned this round. Key is a username, value is a list of achievements that have been earnt by that username.
browsersDictionary of all achievement browsers. Key is a username, value is the given browser. See /datum/achievement_browser and /datum/controller/subsystem/achievements/get_browser
cached_achievementsDictionary of cached achievements. Key is a username, value is a dictionary where the keys are achievements and the values are booleans signifying completion. See /datum/controller/subsystem/achievements/proc/cache_achievements

Procs

InitializeSets up all the lists used by the subsystem and updates the database
cache_achievementsCreates a cache of all achievements and whether or not they're unlocked for the given ckey
fireSubsystem firing, checks solar panel achievement
get_achievementGets the achievement instance for the given achievement path
get_browserGets the achievement browser for the given client. See /datum/achievement_browser
has_achievementChecks whether the client has an achievement.
unlock_achievementUnlocks the given achievement for the given client.

Var Details

CE

The current guy that SSachievements believes to be the CE. See /datum/controller/subsystem/achievements/proc/fire

achievements

List of all the achievement instances, one for each achievement. Access through /datum/controller/subsystem/achievements/proc/get_achievement

achievementsEarned

Dictionary of all achievements earned this round. Key is a username, value is a list of achievements that have been earnt by that username.

browsers

Dictionary of all achievement browsers. Key is a username, value is the given browser. See /datum/achievement_browser and /datum/controller/subsystem/achievements/get_browser

cached_achievements

Dictionary of cached achievements. Key is a username, value is a dictionary where the keys are achievements and the values are booleans signifying completion. See /datum/controller/subsystem/achievements/proc/cache_achievements

Proc Details

Initialize

Sets up all the lists used by the subsystem and updates the database

First it creates all the achievement instances, then it updates the database to remove old achievements and add any new ones It also updates old achievement name/descriptions in the database to the new ones

Arguments:

cache_achievements

Creates a cache of all achievements and whether or not they're unlocked for the given ckey

Will likely not work if admins call this proc, since SQL calls as a result of admin calls are blocked

Arguments:

fire

Subsystem firing, checks solar panel achievement

Checks whether there's currently a CE, if there isn't, it tries to find one Otherwise, it checks to see whether /datum/achievement/engineering/scotty should be triggered. It then calls /datum/controller/subsystem/proc/fire

Arguments:

get_achievement

Gets the achievement instance for the given achievement path

Will return false if it doesn't exist, otherwise it'll get that exact achievement (subtypes aren't accepted)

Arguments:

get_browser

Gets the achievement browser for the given client. See /datum/achievement_browser

If the achievement_browser doesn't exist, it'll create it and then return it

Arguments:

has_achievement

Checks whether the client has an achievement.

Will create a cache of the given client's achievements if it doesn't already exist

Arguments:

unlock_achievement

Unlocks the given achievement for the given client.

Will log if the achievement getting unlocked doesn't exist. Will unlock the given achievement, save it to the DB and cache it for the round. This won't work if you're admin calling the proc, since SQL blocks admin-called queries

Arguments: