Unique artifacts (#859)

* unique artifacts

* Update demiplane_keys.yml

* shadow staff

* fixes

* rename solution

* Update CP14UniqueLootSystem.cs

* try fix

* Update CP14UniqueLootSystem.cs
This commit is contained in:
Ed
2025-02-08 17:29:29 +03:00
committed by GitHub
parent 9ed582d7e4
commit 88c1569266
36 changed files with 1318 additions and 20 deletions

View File

@@ -61,17 +61,22 @@ public abstract partial class CP14SharedMagicSystem
if (!CanCastSpell(action, performer))
return;
// event may return an empty entity with id = 0, which causes bugs
var _target = target;
if (_target is not null && _target.Value.Id == 0)
_target = null;
if (_doAfter.IsRunning(action.Comp.ActiveDoAfter))
_doAfter.Cancel(action.Comp.ActiveDoAfter);
else
{
if (TryStartDelayedAction(delayedEffect, doAfter, action, target, performer))
if (TryStartDelayedAction(delayedEffect, doAfter, action, _target, performer))
{
var evStart = new CP14StartCastMagicEffectEvent(performer);
RaiseLocalEvent(action, ref evStart);
var spellArgs =
new CP14SpellEffectBaseArgs(performer, action.Comp.SpellStorage, target, worldTarget);
new CP14SpellEffectBaseArgs(performer, action.Comp.SpellStorage, _target, worldTarget);
CastTelegraphy(action, spellArgs);
}