Magical vision skill (#1467)
* fix firewave error spamming * basic magic traces entities * Add magical vision system and mana trace entities Introduces the magical vision mechanic, including the CP14MagicVisionComponent, marker entities, and related systems for tracking and displaying magical traces. Adds new actions, skill integration, localization strings, and icons for magical vision and trace markers. Magic traces are now spawned on spell use and mob state changes, with directional pointers and localized descriptions. * Show time passed for magic vision markers Adds a display of the time elapsed since a magic vision marker was spawned, using a localized string. Updates English and Russian locale files with the new 'cp14-magic-vision-timed-past' entry. * aura imprints * Update critical and death messages for inclusivity Revised the 'critical' and 'dead' messages in both English and Russian locale files to use more inclusive language, replacing references to 'magical creature' with 'someone'. * Move magic vision spawn on mob state change to server Transferred the logic for spawning magic vision markers on mob state changes (Critical/Dead) from CP14SharedMagicVisionSystem to CP14AuraImprintSystem. This centralizes the event handling on the server side. Also increased the duration of magic vision markers for spell usage from 20 to 50 seconds. * Integrate magic vision with visibility mask system Added a CP14MagicVision flag to VisibilityFlags and updated the magic vision and religion systems to use the visibility mask system. Magic vision markers now use the Visibility component, and visibility is refreshed when relevant components are added or removed. Removed client-side toggling logic in favor of server-driven visibility. * drowsiness overlay * noir shader * sfx design
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Content.Shared._CP14.MagicEnergy;
|
||||
using Content.Shared._CP14.MagicEnergy.Components;
|
||||
using Content.Shared._CP14.MagicSpell.Components;
|
||||
using Content.Shared._CP14.MagicSpell.Events;
|
||||
using Content.Shared._CP14.MagicSpell.Spells;
|
||||
using Content.Shared._CP14.MagicVision;
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Actions.Components;
|
||||
using Content.Shared.Damage.Systems;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.FixedPoint;
|
||||
@@ -32,6 +33,7 @@ public abstract partial class CP14SharedMagicSystem : EntitySystem
|
||||
[Dependency] private readonly MovementSpeedModifierSystem _movement = default!;
|
||||
[Dependency] private readonly SharedStaminaSystem _stamina = default!;
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly CP14SharedMagicVisionSystem _magicVision = default!;
|
||||
|
||||
private EntityQuery<CP14MagicEnergyContainerComponent> _magicContainerQuery;
|
||||
private EntityQuery<CP14MagicEffectComponent> _magicEffectQuery;
|
||||
@@ -162,6 +164,9 @@ public abstract partial class CP14SharedMagicSystem : EntitySystem
|
||||
|
||||
private void CastTelegraphy(Entity<CP14MagicEffectComponent> ent, CP14SpellEffectBaseArgs args)
|
||||
{
|
||||
if (!_timing.IsFirstTimePredicted)
|
||||
return;
|
||||
|
||||
foreach (var effect in ent.Comp.TelegraphyEffects)
|
||||
{
|
||||
effect.Effect(EntityManager, args);
|
||||
@@ -170,6 +175,9 @@ public abstract partial class CP14SharedMagicSystem : EntitySystem
|
||||
|
||||
private void CastSpell(Entity<CP14MagicEffectComponent> ent, CP14SpellEffectBaseArgs args)
|
||||
{
|
||||
if (!_timing.IsFirstTimePredicted)
|
||||
return;
|
||||
|
||||
var ev = new CP14MagicEffectConsumeResourceEvent(args.User);
|
||||
RaiseLocalEvent(ent, ref ev);
|
||||
|
||||
@@ -177,6 +185,19 @@ public abstract partial class CP14SharedMagicSystem : EntitySystem
|
||||
{
|
||||
effect.Effect(EntityManager, args);
|
||||
}
|
||||
|
||||
if (args.User is not null
|
||||
&& TryComp<ActionComponent>(ent, out var actionComp)
|
||||
&& TryComp<CP14MagicEffectManaCostComponent>(ent, out var manaCost))
|
||||
{
|
||||
_magicVision.SpawnMagicVision(
|
||||
Transform(args.User.Value).Coordinates,
|
||||
actionComp.Icon,
|
||||
Loc.GetString("cp14-magic-vision-used-spell", ("name", MetaData(ent).EntityName)),
|
||||
TimeSpan.FromSeconds((float)manaCost.ManaCost * 50),
|
||||
args.User,
|
||||
args.Position);
|
||||
}
|
||||
}
|
||||
|
||||
protected FixedPoint2 CalculateManacost(Entity<CP14MagicEffectManaCostComponent> ent, EntityUid? caster)
|
||||
|
||||
Reference in New Issue
Block a user