Files
Bubberstation/code/datums/elements/digitalcamo.dm
MrMelbert d7634693a8 Soft reworks changeling Darkness Adaptation (#89767)
## About The Pull Request

Soft reworks Ling's Darkness Adaptation

- No longer permanently makes you transparent when active. Transparency
scales based on how dark your area is. Darker areas = more transparent.
- No longer permanently grants dark vision. Darker areas = more dark
vision.
- Now *costs* 15 chemicals rather than just *requiring* 10 chemicals.
Disabling the effect costs 0 chemicals.
- Toggling the effect imparts a click CD. CD is lower for disabling it. 


https://github.com/user-attachments/assets/d0384a07-1e23-46f7-8362-f42caa0b9c11

Also fixes a bug with digital camo

## Why It's Good For The Game

While this mutation was designed to be used in stealth shenanigans, it
was instead primarily used for murderboning with low visibility. This is
lame.

These changes will address that. 
- Activating the power imparts a click CD and costs chemicals so it is
less wise to use it when you get jumped and more wise to use it when
you're setting up an ambush.
- Flashlights and similar bright lights will disable the power, so it
will shine less (pun intended) when used in bright areas such as space
or, well, any area with a dark floor (most of Nebula Station)

It will also open up potential with other changeling powers:
- For example, EMP screech to disable lights or Disorienting screech to
break light fixtures.

## Changelog

🆑 Melbert
balance: Reworks Changeling's Darkness Adaptation. It's strength now
scales with how dark your environment is, rather than being static
transparency.
fix: Fixes Digital Camo's examine message
/🆑
2025-03-11 18:41:59 +01:00

54 lines
1.8 KiB
Plaintext

/datum/element/digitalcamo
element_flags = ELEMENT_DETACH_ON_HOST_DESTROY
var/list/attached_mobs = list()
/datum/element/digitalcamo/New()
. = ..()
START_PROCESSING(SSdcs, src)
/datum/element/digitalcamo/Attach(datum/target)
. = ..()
if(!isliving(target) || (target in attached_mobs))
return ELEMENT_INCOMPATIBLE
RegisterSignal(target, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine))
RegisterSignal(target, COMSIG_LIVING_CAN_TRACK, PROC_REF(can_track))
var/image/img = image(loc = target)
img.override = TRUE
attached_mobs[target] = img
HideFromAIHuds(target)
/datum/element/digitalcamo/Detach(datum/target)
. = ..()
UnregisterSignal(target, list(COMSIG_ATOM_EXAMINE, COMSIG_LIVING_CAN_TRACK))
for(var/mob/living/silicon/ai/AI in GLOB.player_list)
AI.client.images -= attached_mobs[target]
attached_mobs -= target
UnhideFromAIHuds(target)
/datum/element/digitalcamo/proc/HideFromAIHuds(mob/living/target)
for(var/mob/living/silicon/ai/AI in GLOB.ai_list)
for (var/hud_type in AI.silicon_huds)
var/datum/atom_hud/silicon_hud = GLOB.huds[hud_type]
silicon_hud.hide_single_atomhud_from(AI,target)
/datum/element/digitalcamo/proc/UnhideFromAIHuds(mob/living/target)
for(var/mob/living/silicon/ai/AI in GLOB.ai_list)
for (var/hud_type in AI.silicon_huds)
var/datum/atom_hud/silicon_hud = GLOB.huds[hud_type]
silicon_hud.unhide_single_atomhud_from(AI,target)
/datum/element/digitalcamo/proc/on_examine(datum/source, mob/M, list/examine_list)
SIGNAL_HANDLER
examine_list += span_warning("[source.p_their()] skin seems to be shifting like something is moving below it.")
/datum/element/digitalcamo/proc/can_track(datum/source, mob/user)
SIGNAL_HANDLER
return COMPONENT_CANT_TRACK
/datum/element/digitalcamo/process()
for(var/mob/living/silicon/ai/AI in GLOB.player_list)
for(var/mob in attached_mobs)
AI.client.images |= attached_mobs[mob]