mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-21 21:10:30 +01:00
a802b48e2a
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" />
43 lines
1.3 KiB
Plaintext
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!"))
|