Files
DrathekandGitHub 7c8bb85de3 Whitespace Standardization [MDB IGNORE] (#15748)
* Update settings

* Whitespace changes

* Comment out merger hooks in gitattributes

Corrupt maps would have to be resolved in repo before hooks could be updated

* Revert "Whitespace changes"

This reverts commit afbdd1d8442973f5d570c30920d9d865b5acd479.

* Whitespace again minus example

* Gitignore example changelog

* Restore changelog merge setting

* Keep older dmi hook attribute until hooks can be updated

* update vscode settings too

* Renormalize remaining

* Revert "Gitignore example changelog"

This reverts commit de22ad375d3ee4d5930c550da2fd23a29a86e616.

* Attempt to normalize example.yml (and another file I guess)

* Try again
2024-02-20 11:28:51 +01:00

81 lines
3.0 KiB
Plaintext

/atom
var/catalogue_delay = 5 SECONDS // How long it take to scan.
// List of types of /datum/category_item/catalogue that should be 'unlocked' when scanned by a Cataloguer.
// It is null by default to save memory by not having everything hold onto empty lists. Use macros like LAZYLEN() to check.
// Also you should use get_catalogue_data() to access this instead of doing so directly, so special behavior can be enabled.
var/list/catalogue_data = null
/mob
catalogue_delay = 10 SECONDS
// Tests if something can be catalogued.
// If something goes wrong and a mob was supplied, the mob will be told why they can't catalogue it.
/atom/proc/can_catalogue(mob/user)
// First check if anything is even on here.
var/list/data = get_catalogue_data()
if(!LAZYLEN(data))
to_chat(user, span("warning", "\The [src] is not interesting enough to catalogue."))
return FALSE
else
// Check if this has nothing new on it.
var/has_new_data = FALSE
for(var/t in data)
var/datum/category_item/catalogue/item = GLOB.catalogue_data.resolve_item(t)
if(!item.visible)
has_new_data = TRUE
break
if(!has_new_data)
to_chat(user, span("warning", "Scanning \the [src] would provide no new information."))
return FALSE
return TRUE
/mob/living/can_catalogue(mob/user) // Dead mobs can't be scanned.
if(stat >= DEAD)
to_chat(user, span("warning", "Entities must be alive for a comprehensive scan."))
return FALSE
return ..()
/obj/item/can_catalogue(mob/user) // Items must be identified to be scanned.
if(!is_identified())
to_chat(user, span("warning", "The properties of this object has not been determined. Identify it first."))
return FALSE
return ..()
/atom/proc/get_catalogue_delay()
return catalogue_delay
// Override for special behaviour.
// Should return a list with one or more "/datum/category_item/catalogue" types, or null.
// If overriding, it may be wise to call the super and get the results in order to merge the base result and the special result, if appropiate.
/atom/proc/get_catalogue_data()
return catalogue_data
/mob/living/carbon/human/get_catalogue_data()
var/list/data = list()
// First, handle robot-ness.
var/beep_boop = get_FBP_type()
switch(beep_boop)
if(FBP_CYBORG)
data += /datum/category_item/catalogue/technology/cyborgs
if(FBP_POSI)
data += /datum/category_item/catalogue/technology/positronics
if(FBP_DRONE)
data += /datum/category_item/catalogue/technology/drone/drones
// Now for species.
if(!(beep_boop in list(FBP_POSI, FBP_DRONE))) // Don't give the species entry if they are a posi or drone.
if(species && LAZYLEN(species.catalogue_data))
data += species.catalogue_data
return data
/mob/living/silicon/robot/get_catalogue_data()
var/list/data = list()
switch(braintype)
if(BORG_BRAINTYPE_CYBORG)
data += /datum/category_item/catalogue/technology/cyborgs
if(BORG_BRAINTYPE_POSI)
data += /datum/category_item/catalogue/technology/positronics
if(BORG_BRAINTYPE_DRONE)
data += /datum/category_item/catalogue/technology/drone/drones
return data