Files
VMSolidus a802b48e2a Psi Rework Part 2: Scenes From A Memory (#21736)
The next step in the Psi Reworks is here, this time adding all of the
remaining sources and applications of Psi-sensitivity and Psi-protection
that were on my To-Do list. Aside from a variety of tweaks and bugfixes
to powers, the most player-facing addition is the new Psi-sensitivity
related traits, which are High Psi-sensitivity, and Low Psi-sensitivity.
These traits modify the character's psi-sensitivity, which messes with
their interactions with psionics in a variety of ways.

All of these new sources and interactions with psionics are handled
entirely through components, which operate on the previously added
COMSIG_PSI signals.

Check the changelog file for more specific details on what all was
fixed. I've fixed quite a lot of bugs and issues with the various psi
powers.

I have actually tested this PR and verified that it works as advertised.
<img width="1902" height="1015" alt="image"
src="https://github.com/user-attachments/assets/e922593c-0595-4b63-bee4-36080d9cb8b4"
/>
2026-02-01 23:29:21 +00:00

43 lines
1.3 KiB
Plaintext

/**
* Component used for the Psi-Suppression power.
* Acts like a stronger Mind-shield/Mind-Blanker until toggled off.
*/
#define PSI_SUPPRESSION_COMPONENT /datum/component/psi_suppression
/datum/component/psi_suppression
/**
* The amount this component will modify its owner psi_sensitivity by when they are called by psychic phenomena to check.
* See /proc/check_psi_sensitivity() for more information.
*/
var/sensitivity_modifier = -2
/datum/component/psi_suppression/Initialize()
. = ..()
if (!parent)
return
RegisterSignal(parent, COMSIG_PSI_CHECK_SENSITIVITY, PROC_REF(modify_sensitivity), override = TRUE)
RegisterSignal(parent, COMSIG_PSI_MIND_POWER, PROC_REF(cancel_power), override = TRUE)
/datum/component/psi_suppression/Destroy()
. = ..()
if (!parent)
return
UnregisterSignal(parent, COMSIG_PSI_CHECK_SENSITIVITY)
UnregisterSignal(parent, COMSIG_PSI_MIND_POWER)
/datum/component/psi_suppression/proc/modify_sensitivity(var/parent, var/effective_sensitivity)
SIGNAL_HANDLER
*effective_sensitivity += sensitivity_modifier
/datum/component/psi_suppression/proc/cancel_power(var/parent, var/caster, var/cancelled, var/cancel_return, var/wide_field)
SIGNAL_HANDLER
*cancelled = TRUE
if (wide_field || parent == caster)
return
to_chat(parent, SPAN_DANGER("You repulse an outside thought!"))