Skip to content

Commit 4183c05

Browse files
committed
Reimplement codex implant and add config option for it
1 parent 9a99142 commit 4183c05

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

code/datums/config/config_types/config_game_world.dm

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
/decl/config/toggle/roundstart_level_generation,
2424
/decl/config/toggle/lights_start_on,
2525
/decl/config/toggle/on/cisnormativity,
26-
/decl/config/enum/colored_coating_names
26+
/decl/config/enum/colored_coating_names,
27+
/decl/config/toggle/codex_requires_implant
2728
)
2829

2930
/decl/config/num/exterior_ambient_light
@@ -145,4 +146,8 @@
145146
"none" = CONFIG_COATING_COLOR_NONE,
146147
"mixture" = CONFIG_COATING_COLOR_MIXTURE,
147148
"components" = CONFIG_COATING_COLOR_COMPONENTS
148-
)
149+
)
150+
151+
/decl/config/toggle/codex_requires_implant
152+
uid = "codex_requires_implant"
153+
desc = "If true, humans require a codex implant to access the codex."

code/modules/client/preference_setup/loadout/lists/augmentations.dm

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,17 @@
3333

3434
user.add_organ(src, organ_to_implant_into)
3535
to_chat(user, SPAN_NOTICE("Your [organ_to_implant_into.name] has been replaced with \the [src]."))
36+
37+
// Codex implant, only available if the codex is set to require it in config
38+
/decl/loadout_option/augmentation/codex_implant
39+
name = "Codex Implant"
40+
uid = "gear_augmentation_codex"
41+
description = "A neural implant that provides access to the codex."
42+
path = /obj/item/implant/codex
43+
custom_setup_proc_arguments = list(BP_HEAD)
44+
cost = 0
45+
46+
/decl/loadout_option/augmentation/codex_implant/can_be_taken_by(mob/living/user)
47+
if(!get_config_value(/decl/config/toggle/codex_requires_implant))
48+
return FALSE
49+
return ..()

code/modules/codex/codex_implant.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
/obj/item/implant/codex
66
name = "codex implant"
77
desc = "It has 'DON'T PANIC' embossed on the casing in friendly letters."
8+
known = TRUE
89

910
/obj/item/implant/codex/implanted(var/mob/source)
1011
. = ..(source)

code/modules/codex/codex_mob.dm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
return TRUE
1212

1313
/mob/living/human/can_use_codex()
14-
return TRUE //has_implant(/obj/item/implant/codex, functioning = TRUE)
14+
if(get_config_value(/decl/config/toggle/codex_requires_implant))
15+
for(var/obj/item/implant/codex/codex_implant in contents)
16+
if(codex_implant.implanted && !codex_implant.malfunction)
17+
return TRUE
18+
return TRUE
1519

1620
/mob/living/human/get_codex_value()
1721
return "[lowertext(species.name)] (species)"

0 commit comments

Comments
 (0)