holograms now momentarily glitch out when u interact with them (#89689)

## About The Pull Request
adds a new visual effect for holograms ,such as holosigns and several
holoanimals, where they'll glitch out when walked through, attacked, or
when a thrown object passes through them


https://github.com/user-attachments/assets/5c18e48e-6ea5-4e57-a7d4-6a9323e317f5



## Why It's Good For The Game
i think its good for the sake of immersion. also, if pai players feel
like this might get annoying i have no problems excluding them from this
effect.

## Changelog
🆑
add: adds a new glitch-out effect for holograms when they're interacted
with
/🆑
This commit is contained in:
Ben10Omintrix
2025-04-29 17:53:59 -06:00
committed by Shadow-Quill
parent 995ed5dfb1
commit adea747fb0
8 changed files with 68 additions and 0 deletions
@@ -0,0 +1,55 @@
/*
* A component given to holographic objects to make them glitch out when passed through
*/
#define GLITCH_DURATION 0.45 SECONDS
#define GLITCH_REMOVAL_DURATION 0.25 SECONDS
/datum/component/holographic_nature
///cooldown before we can glitch out again
COOLDOWN_DECLARE(glitch_cooldown)
///list of signals we apply to our turf
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_entered),
)
/datum/component/holographic_nature/Initialize()
if(!ismovable(parent))
return COMPONENT_INCOMPATIBLE
/datum/component/holographic_nature/RegisterWithParent()
AddComponent(/datum/component/connect_loc_behalf, parent, loc_connections)
if(isliving(parent))
RegisterSignal(parent, COMSIG_MOB_APPLY_DAMAGE, PROC_REF(on_mob_damaged))
return
var/atom/atom_parent = parent
if(isobj(atom_parent) && atom_parent.uses_integrity)
RegisterSignal(parent, COMSIG_ATOM_TAKE_DAMAGE, PROC_REF(on_object_damaged))
/datum/component/holographic_nature/proc/on_mob_damaged(mob/living/source, damage_amount, damagetype, def_zone, blocked, wound_bonus, bare_wound_bonus, sharpness, attack_direction, attacking_item)
SIGNAL_HANDLER
if(damagetype == BURN || damagetype == BRUTE)
apply_effects()
/datum/component/holographic_nature/proc/on_object_damaged(obj/source, damage, damage_type, ...)
SIGNAL_HANDLER
if(damage_type == BURN || damage_type == BRUTE)
apply_effects()
/datum/component/holographic_nature/proc/on_entered(atom/movable/source, atom/movable/thing)
SIGNAL_HANDLER
var/atom/movable/movable_parent = parent
if(!isturf(movable_parent.loc))
return
if(isprojectile(thing) || thing.density)
apply_effects()
/datum/component/holographic_nature/proc/apply_effects()
if(!COOLDOWN_FINISHED(src, glitch_cooldown))
return
COOLDOWN_START(src, glitch_cooldown, GLITCH_DURATION + GLITCH_REMOVAL_DURATION)
apply_wibbly_filters(parent)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(remove_wibbly_filters), parent, GLITCH_REMOVAL_DURATION), GLITCH_DURATION)
#undef GLITCH_DURATION
#undef GLITCH_REMOVAL_DURATION
+4
View File
@@ -873,6 +873,10 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
var/mob/living/Impersonation
var/datum/holocall/HC
/obj/effect/overlay/holo_pad_hologram/Initialize(mapload)
. = ..()
AddComponent(/datum/component/holographic_nature)
/obj/effect/overlay/holo_pad_hologram/Destroy()
Impersonation = null
if(!QDELETED(HC))
+1
View File
@@ -21,6 +21,7 @@
/obj/structure/holosign/Initialize(mapload, source_projector)
. = ..()
AddComponent(/datum/component/holographic_nature)
create_vis_overlay()
if(source_projector)
projector = source_projector
+1
View File
@@ -31,6 +31,7 @@
/obj/structure/holopay/Initialize(mapload)
. = ..()
AddComponent(/datum/component/holographic_nature)
register_context()
/obj/structure/holopay/add_context(atom/source, list/context, obj/item/held_item, mob/user)
@@ -48,6 +48,7 @@
/mob/living/basic/orbie/Initialize(mapload)
. = ..()
AddComponent(/datum/component/holographic_nature)
var/static/list/food_types = list(/obj/item/food/virtual_chocolate)
AddComponent(/datum/component/obeys_commands, pet_commands)
AddElement(/datum/element/basic_eating, food_types = food_types)
@@ -186,6 +186,10 @@
cell_line = NONE
regenerate_colour = "#ffffff"
/mob/living/basic/carp/holographic/Initialize(mapload, mob/tamer)
. = ..()
AddComponent(/datum/component/holographic_nature)
/// Holocarp don't eat food
/mob/living/basic/carp/holographic/setup_eating()
return FALSE
+1
View File
@@ -206,6 +206,7 @@
/mob/living/silicon/pai/Initialize(mapload)
. = ..()
AddComponent(/datum/component/holographic_nature)
if(istype(loc, /obj/item/modular_computer))
give_messenger_ability()
START_PROCESSING(SSfastprocess, src)
+1
View File
@@ -1315,6 +1315,7 @@
#include "code\datums\components\hide_highest_offset.dm"
#include "code\datums\components\hide_weather_planes.dm"
#include "code\datums\components\holderloving.dm"
#include "code\datums\components\holographic_nature.dm"
#include "code\datums\components\igniter.dm"
#include "code\datums\components\infective.dm"
#include "code\datums\components\interaction_booby_trap.dm"