Files
tbd-station-14/Content.Client/Polymorph/Systems/ChameleonProjectorSystem.cs
deltanedas 395c33024c prop hunt ss14 (real) (#26691)
* texture appropriation

* add code for projector

* add chameleon projector yml

* damage and actions

* prevent small props being killed round removing you (700 damage from a single shot)

* tweak default

* oop

* do appearance properly, need engine update

* fix bugs, blacklist pda

* remove status icons

* amou

* sus

* fix test + make props fast

* amouuuung

* remove funny log

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
2024-04-17 14:48:35 -07:00

34 lines
1.1 KiB
C#

using Content.Shared.Chemistry.Components;
using Content.Shared.Polymorph.Components;
using Content.Shared.Polymorph.Systems;
using Robust.Client.GameObjects;
namespace Content.Client.Polymorph.Systems;
public sealed class ChameleonProjectorSystem : SharedChameleonProjectorSystem
{
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
private EntityQuery<AppearanceComponent> _appearanceQuery;
public override void Initialize()
{
base.Initialize();
_appearanceQuery = GetEntityQuery<AppearanceComponent>();
SubscribeLocalEvent<ChameleonDisguiseComponent, AfterAutoHandleStateEvent>(OnHandleState);
}
private void OnHandleState(Entity<ChameleonDisguiseComponent> ent, ref AfterAutoHandleStateEvent args)
{
CopyComp<SpriteComponent>(ent);
CopyComp<GenericVisualizerComponent>(ent);
CopyComp<SolutionContainerVisualsComponent>(ent);
// reload appearance to hopefully prevent any invisible layers
if (_appearanceQuery.TryComp(ent, out var appearance))
_appearance.QueueUpdate(ent, appearance);
}
}