Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@ public sealed partial class ESTraitorBugTimerEvent : ESEntityTimerEvent;

[ByRefEvent]
public readonly record struct ESTraitorBugHackedEvent(ProtoId<AccessGroupPrototype> Group);

[Serializable, NetSerializable]
public enum ESTraitorBugVisuals : byte
{
Bugged,
}
4 changes: 4 additions & 0 deletions Content.Shared/_ES/Masks/Traitor/ESTraitorBugSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public sealed partial class ESTraitorBugSystem : ESBaseObjectiveSystem<ESTraitor
[Dependency] private INetManager _net = default!;
[Dependency] private IPrototypeManager _prototype = default!;
[Dependency] private IRobustRandom _random = default!;
[Dependency] private SharedAppearanceSystem _appearance = default!;
[Dependency] private ESBreakableSystem _breakable = default!;
[Dependency] private SharedDoAfterSystem _doAfter = default!;
[Dependency] private ESEntityTimerSystem _entityTimer = default!;
Expand Down Expand Up @@ -138,6 +139,7 @@ private void OnPlantTraitorBugDoAfter(Entity<ESTraitorBuggableComponent> ent, re
_popup.PopupEntity(Loc.GetString("es-bug-popup-planted"), ent, args.User);
_sparks.DoSparks(ent, user: args.User, cooldown: false);

_appearance.SetData(ent, ESTraitorBugVisuals.Bugged, true);
ent.Comp.Timer = _entityTimer.SpawnTimer(ent, ent.Comp.BugDuration, new ESTraitorBugTimerEvent());
Dirty(ent);

Expand Down Expand Up @@ -204,6 +206,8 @@ public void CancelBug(Entity<ESTraitorBuggableComponent?> ent)
if (!Resolve(ent, ref ent.Comp, false))
return;

_appearance.SetData(ent, ESTraitorBugVisuals.Bugged, false);

PredictedDel(ent.Comp.Timer);
ent.Comp.Timer = null;
Dirty(ent);
Expand Down
7 changes: 7 additions & 0 deletions Resources/Prototypes/Entities/Structures/Power/apc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
shader: unshaded
map: ["enum.ApcVisualLayers.Environment"]
visible: false
- state: bug
map: [ "buglayer" ]
visible: false
- type: Appearance
- type: GenericVisualizer
visuals:
Expand All @@ -72,6 +75,10 @@
enum.ApcVisualLayers.ChargeState:
True: { visible: false }
False: { visible: true }
enum.ESTraitorBugVisuals.Bugged:
buglayer:
True: { visible: true }
False: { visible: false }
- type: ESGenericPointLightVisualizer
visuals:
enum.ESBreakableVisuals.Broken:
Expand Down
Binary file added Resources/Textures/Structures/Power/apc.rsi/bug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions Resources/Textures/Structures/Power/apc.rsi/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,32 @@
]
]
},
{
"name": "bug",
"directions": 4,
"delays": [
[
1.5,
0.2,
0.1
],
[
1.5,
0.2,
0.1
],
[
1.5,
0.2,
0.1
],
[
1.5,
0.2,
0.1
]
]
},
{
"name": "sparks-unlit",
"delays": [
Expand Down
Loading