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:
Datraen
2017-01-22 11:44:57 -05:00
committed by Yoshax
parent 3c9698c53d
commit 3d442044d1
9 changed files with 249 additions and 9 deletions

View 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

View File

@@ -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