feat: add a component for rejuvenateable status effects (#39025)
* feat: add a component for rejuvenateable effects * feat: let god mode'd entities get buffs * fix: handle old status effect system Didn't realize BeforeStatusEffectAddedEvent was called by both systems, oops. * refactor: rename to RejuvenateRemovedStatusEffect * fix: make forced sleeping a debuff again Missed in rebase. * refactor: make BeforeStatusEffectAdded two events
This commit is contained in:
@@ -353,7 +353,7 @@ namespace Content.Shared.StatusEffect
|
||||
if (!Resolve(uid, ref status, false))
|
||||
return false;
|
||||
|
||||
var ev = new BeforeStatusEffectAddedEvent(key);
|
||||
var ev = new BeforeOldStatusEffectAddedEvent(key);
|
||||
RaiseLocalEvent(uid, ref ev);
|
||||
if (ev.Cancelled)
|
||||
return false;
|
||||
@@ -481,6 +481,13 @@ namespace Content.Shared.StatusEffect
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raised on an entity before a status effect is added to determine if adding it should be cancelled.
|
||||
/// Obsolete version of <see cref="BeforeStatusEffectAddedEvent" />
|
||||
/// </summary>
|
||||
[ByRefEvent, Obsolete("Migration to StatusEffectNew.StatusEffectsSystem is required")]
|
||||
public record struct BeforeOldStatusEffectAddedEvent(string EffectKey, bool Cancelled = false);
|
||||
|
||||
public readonly struct StatusEffectAddedEvent
|
||||
{
|
||||
public readonly EntityUid Uid;
|
||||
|
||||
Reference in New Issue
Block a user