* 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>
34 lines
1.1 KiB
C#
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);
|
|
}
|
|
}
|