Codex code improvements, recipes (#7068)

This commit is contained in:
Nadyr
2023-10-12 15:57:12 -04:00
committed by GitHub
parent 2044dd9fda
commit c81676a813
8 changed files with 333 additions and 6 deletions

View File

@@ -9,13 +9,21 @@
var/datum/codex_tree/tree = null
var/root_type = /datum/lore/codex/category/main_borealis_lore //YW EDIT
var/static/list/codex_tree_keys = list() // CHOMPedit: static list linking codexes to the correct codex_tree.
/obj/item/weapon/book/codex/Initialize()
tree = new(src, root_type)
tree = codex_tree_keys["[root_type]"] // CHOMPedit start
if(!tree)
tree = new(src, root_type)
codex_tree_keys["[root_type]"] = tree // CHOMPedit end
. = ..()
/obj/item/weapon/book/codex/attack_self(mob/user)
if(!tree)
tree = new(src, root_type)
if(!tree) // CHOMPedit start
tree = codex_tree_keys["[root_type]"]
if(!tree)
tree = new(src, root_type)
codex_tree_keys["[root_type]"] = tree // CHOMPedit end
icon_state = "[initial(icon_state)]-open"
tree.display(user)