Posted by: ZylonBane
« on: 02. May 2024, 18:16:06 »Just a heads up that in Beta 6, SCP will be fixing the Soma Drain psi power so it can't heal the player for more HP than the target actually has. It will also fix the drain FX object only appearing on Creature type targets (the vanilla script never teleports it to the target location).
Since healing the player will be handled by the SomaDrain script, the DrainStim receptron that heals the player will be disabled by setting its effect multiplier to 0.
Since healing the player will be handled by the SomaDrain script, the DrainStim receptron that heals the player will be disabled by setting its effect multiplier to 0.
Code: [Select]
class SomaDrain extends RootPsi {
function ActivatePsi() {
base.ActivatePsi();
doDrain();
DeactivatePsi();
}
function doDrain() {
local mod, drain, heal;
local obj = ShockGame.GetDistantSelectedObj();
if (obj && Link.AnyExist("StimSensor", obj, "DrainStim")) {
drain = GetData("Data1");
mod = GetData("PsiStat") - GetData("Data3");
if (mod > 0) {
drain += mod * GetData("Data2");
}
heal = scp.Clamp(drain, 0, Property.Get(obj, "HitPoints"));
ActReact.Stimulate(obj, "DrainStim", drain, "Player");
ShockGame.HealObj("Player", heal);
createFX(obj);
}
}
function createFX(obj) {
local fx = scp.CreateAt("Soma Drain FX", obj);
if (Property.Possessed(obj, "Creature")) {
local lnk = Link.Create("ParticleAttachement", fx, obj);
LinkTools.LinkSetData(lnk, "Type", 2);
LinkTools.LinkSetData(lnk, "Joint", 3);
}
}
}