mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Adds Gene Targetting mode to Floral Somatoray
While I was rooting around in hydroponics code, I saw that a list was being regenerated with UI interaction, so I threw the list into the plant controller. No proper sprites for the Floral Somatoray's new mode yet, but it uses the gun sprite from mutate mode, and the projectile sprite from yield mode.
This commit is contained in:
39
code/datums/repositories/decls.dm
Normal file
39
code/datums/repositories/decls.dm
Normal file
@@ -0,0 +1,39 @@
|
||||
/var/repository/decls/decls_repository = new()
|
||||
|
||||
/repository/decls
|
||||
var/list/fetched_decls
|
||||
var/list/fetched_decl_types
|
||||
var/list/fetched_decl_subtypes
|
||||
|
||||
/repository/decls/New()
|
||||
..()
|
||||
fetched_decls = list()
|
||||
fetched_decl_types = list()
|
||||
fetched_decl_subtypes = list()
|
||||
|
||||
/repository/decls/proc/decls_of_type(var/decl_prototype)
|
||||
. = fetched_decl_types[decl_prototype]
|
||||
if(!.)
|
||||
. = get_decls(typesof(decl_prototype))
|
||||
fetched_decl_types[decl_prototype] = .
|
||||
|
||||
/repository/decls/proc/decls_of_subtype(var/decl_prototype)
|
||||
. = fetched_decl_subtypes[decl_prototype]
|
||||
if(!.)
|
||||
. = get_decls(subtypesof(decl_prototype))
|
||||
fetched_decl_subtypes[decl_prototype] = .
|
||||
|
||||
/repository/decls/proc/get_decl(var/decl_type)
|
||||
. = fetched_decls[decl_type]
|
||||
if(!.)
|
||||
. = new decl_type()
|
||||
fetched_decls[decl_type] = .
|
||||
|
||||
/repository/decls/proc/get_decls(var/list/decl_types)
|
||||
. = list()
|
||||
for(var/decl_type in decl_types)
|
||||
.[decl_type] = get_decl(decl_type)
|
||||
|
||||
/decls/Destroy()
|
||||
crash_with("Prevented attempt to delete a decl instance: [log_info_line(src)]")
|
||||
return 1 // Prevents Decl destruction
|
||||
@@ -1,4 +1,19 @@
|
||||
/repository/New()
|
||||
return
|
||||
|
||||
/datum/cache_entry
|
||||
var/timestamp
|
||||
var/data
|
||||
|
||||
/datum/cache_entry/New()
|
||||
timestamp = world.time
|
||||
|
||||
/datum/cache_entry/proc/is_valid()
|
||||
return FALSE
|
||||
|
||||
/datum/cache_entry/valid_until/New(var/valid_duration)
|
||||
..()
|
||||
timestamp += valid_duration
|
||||
|
||||
/datum/cache_entry/valid_until/is_valid()
|
||||
return world.time < timestamp
|
||||
Reference in New Issue
Block a user