Skip to content

Commit 8f2445e

Browse files
authored
Адское Отродье - Босс для утилей (#1525)
Signed-off-by: pacable <[email protected]>
1 parent 25da9a7 commit 8f2445e

File tree

83 files changed

+5274
-27
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+5274
-27
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
using Content.Client._Sunrise.Boss.UI;
2+
using Content.Shared._Sunrise.Boss.Systems;
3+
4+
namespace Content.Client._Sunrise.Boss.BUI;
5+
6+
public sealed class HellSpawnArenaConsoleBoundUserInterface : BoundUserInterface
7+
{
8+
private readonly IEntityManager _entManager;
9+
10+
private readonly EntityUid _owner;
11+
private HellSpawnArenaConsoleWindow? _window;
12+
13+
public HellSpawnArenaConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
14+
{
15+
_entManager = IoCManager.Resolve<IEntityManager>();
16+
_owner = owner;
17+
}
18+
19+
protected override void Open()
20+
{
21+
base.Open();
22+
_window = new HellSpawnArenaConsoleWindow();
23+
_window.OnClose += Close;
24+
25+
_window.TravelButtonPressed += OnTravelButtonPressed;
26+
27+
_window.OpenCentered();
28+
}
29+
30+
private void OnTravelButtonPressed()
31+
{
32+
if (_window == null)
33+
return;
34+
35+
var ev = new TravelButtonPressedMessage
36+
{
37+
Owner = _entManager.GetNetEntity(_owner),
38+
};
39+
SendMessage(ev);
40+
}
41+
42+
protected override void UpdateState(BoundUserInterfaceState state)
43+
{
44+
base.UpdateState(state);
45+
46+
if (_window == null)
47+
return;
48+
49+
if (state is not HellSpawnArenaConsoleUiState cast)
50+
return;
51+
52+
_window.UpdateState(cast);
53+
}
54+
55+
protected override void Dispose(bool disposing)
56+
{
57+
base.Dispose(disposing);
58+
59+
if (!disposing)
60+
return;
61+
62+
if (_window != null)
63+
_window.OnClose -= Close;
64+
65+
_window?.Dispose();
66+
}
67+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
using Content.Shared._Sunrise.Boss.Components;
2+
using Content.Shared._Sunrise.Boss.Systems;
3+
using Robust.Client.GameObjects;
4+
5+
namespace Content.Client._Sunrise.Boss.Systems;
6+
7+
/// <inheritdoc />
8+
public sealed class HellSpawnArenaSystem : SharedHellSpawnArenaSystem
9+
{
10+
[Dependency] private readonly SpriteSystem _sprite = default!;
11+
12+
/// <inheritdoc />
13+
public override void Initialize()
14+
{
15+
base.Initialize();
16+
SubscribeLocalEvent<HellSpawnArenaTransferTargetComponent, ComponentInit>(OnApplyUnshadedShader);
17+
SubscribeLocalEvent<HellSpawnArenaTransferTargetComponent, ComponentShutdown>(OnRemoveUnshadedShader);
18+
}
19+
20+
private void OnApplyUnshadedShader(EntityUid uid, HellSpawnArenaTransferTargetComponent comp, ComponentInit args)
21+
{
22+
ApplyUnshadedShader(uid);
23+
}
24+
25+
private void OnRemoveUnshadedShader(EntityUid uid,
26+
HellSpawnArenaTransferTargetComponent comp,
27+
ComponentShutdown args)
28+
{
29+
RemoveUnshadedShader(uid);
30+
}
31+
32+
public void ApplyUnshadedShader(EntityUid entity)
33+
{
34+
if (!TryComp<AppearanceComponent>(entity, out var appearanceComponent))
35+
return;
36+
if (!TryComp<SpriteComponent>(entity, out var spriteComponent))
37+
return;
38+
39+
var i = 0;
40+
foreach (var _ in spriteComponent.AllLayers)
41+
{
42+
spriteComponent.LayerSetShader(i, "unshaded");
43+
i++;
44+
}
45+
}
46+
47+
public void RemoveUnshadedShader(EntityUid entity)
48+
{
49+
if (!TryComp<AppearanceComponent>(entity, out var appearanceComponent))
50+
return;
51+
if (!TryComp<SpriteComponent>(entity, out var spriteComponent))
52+
return;
53+
54+
var i = 0;
55+
foreach (var _ in spriteComponent.AllLayers)
56+
{
57+
spriteComponent.LayerSetShader(i, null, null);
58+
i++;
59+
}
60+
}
61+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using Content.Client.DamageState;
2+
using Content.Shared._Sunrise.Boss.Components;
3+
using Content.Shared._Sunrise.Boss.Systems;
4+
using Robust.Client.GameObjects;
5+
6+
namespace Content.Client._Sunrise.Boss.Systems;
7+
8+
/// <inheritdoc />
9+
public sealed class HellSpawnInvincibilitySystem : SharedHellSpawnInvincibilitySystem
10+
{
11+
/// <inheritdoc />
12+
public override void Initialize()
13+
{
14+
base.Initialize();
15+
16+
SubscribeLocalEvent<HellSpawnInvincibilityComponent, HellSpawnInvincibilityToggledEvent>(OnToggled);
17+
}
18+
19+
private void OnToggled(Entity<HellSpawnInvincibilityComponent> ent, ref HellSpawnInvincibilityToggledEvent args)
20+
{
21+
if (!TryComp<AppearanceComponent>(ent.Owner, out var appearanceComponent))
22+
return;
23+
if (!TryComp<SpriteComponent>(ent.Owner, out var spriteComponent))
24+
return;
25+
26+
if (!spriteComponent.LayerMapTryGet(DamageStateVisualLayers.Base, out var layerIdx))
27+
return;
28+
if (args.Enabled)
29+
spriteComponent.LayerSetShader(layerIdx, "unshaded");
30+
else
31+
spriteComponent.LayerSetShader(layerIdx, null, null);
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<controls:FancyWindow
2+
xmlns="https://spacestation14.io"
3+
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
4+
MinSize="300 120"
5+
Title="{Loc 'hellspawn-arena-console-title'}">
6+
<BoxContainer Orientation="Vertical">
7+
<Button Name="TravelButton"
8+
Text="{Loc 'hellspawn-arena-console-ready'}"
9+
StyleClasses="Caution" />
10+
<BoxContainer Name="StatusBox" Orientation="Horizontal" Visible="True">
11+
<Label Text="{Loc 'hellspawn-arena-console-status-label'}" HorizontalAlignment="Left" />
12+
<Label Name="StatusLabel" Text=" " HorizontalAlignment="Right" />
13+
</BoxContainer>
14+
</BoxContainer>
15+
</controls:FancyWindow>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
using Content.Client.UserInterface.Controls;
2+
using Content.Shared._Sunrise.Boss.Systems;
3+
using Robust.Client.AutoGenerated;
4+
using Robust.Client.UserInterface.XAML;
5+
using Robust.Shared.Timing;
6+
7+
namespace Content.Client._Sunrise.Boss.UI;
8+
9+
[GenerateTypedNameReferences]
10+
public sealed partial class HellSpawnArenaConsoleWindow : FancyWindow
11+
{
12+
private readonly IGameTiming _timing;
13+
14+
public TimeSpan? ActivationTime;
15+
public HellSpawnBossStatus State = HellSpawnBossStatus.Idle;
16+
17+
public HellSpawnArenaConsoleWindow()
18+
{
19+
IoCManager.InjectDependencies(this);
20+
RobustXamlLoader.Load(this);
21+
22+
_timing = IoCManager.Resolve<IGameTiming>();
23+
24+
TravelButton.OnPressed += _ => TravelButtonPressed?.Invoke();
25+
26+
StatusLabel.Text = Loc.GetString("hellspawn-arena-console-status-idle");
27+
}
28+
29+
public event Action? TravelButtonPressed;
30+
31+
public void UpdateState(HellSpawnArenaConsoleUiState state)
32+
{
33+
// TravelButton.Disabled = state.Status == HellSpawnBossStatus.InProgress;
34+
35+
if (state.ActivationTime != null)
36+
ActivationTime = state.ActivationTime;
37+
38+
State = state.CurrentStatus;
39+
}
40+
41+
protected override void FrameUpdate(FrameEventArgs args)
42+
{
43+
base.FrameUpdate(args);
44+
StatusLabel.Text = State switch
45+
{
46+
HellSpawnBossStatus.Idle => Loc.GetString("hellspawn-arena-console-status-idle"),
47+
HellSpawnBossStatus.Cooldown => Loc.GetString("hellspawn-arena-console-status-cooldown"),
48+
HellSpawnBossStatus.InProgress => Loc.GetString("hellspawn-arena-console-status-inprogress"),
49+
_ => StatusLabel.Text,
50+
};
51+
switch (State)
52+
{
53+
case HellSpawnBossStatus.Idle:
54+
if (ActivationTime != null && ActivationTime.Value > _timing.CurTime)
55+
{
56+
TravelButton.Text = $"{(ActivationTime.Value - _timing.CurTime).TotalSeconds.ToString()}";
57+
TravelButton.Disabled = true;
58+
}
59+
else
60+
{
61+
TravelButton.Text = Loc.GetString("hellspawn-arena-console-ready");
62+
TravelButton.Disabled = false;
63+
}
64+
65+
break;
66+
case HellSpawnBossStatus.Cooldown:
67+
if (ActivationTime != null && ActivationTime.Value > _timing.CurTime)
68+
{
69+
TravelButton.Text = $"{(ActivationTime.Value - _timing.CurTime).TotalSeconds.ToString()}";
70+
TravelButton.Disabled = true;
71+
}
72+
else
73+
{
74+
TravelButton.Text = Loc.GetString("hellspawn-arena-console-ready");
75+
TravelButton.Disabled = false;
76+
}
77+
78+
break;
79+
case HellSpawnBossStatus.InProgress:
80+
break;
81+
}
82+
}
83+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace Content.Server._Sunrise.Boss.Components;
2+
3+
/// <summary>
4+
/// This is used for...
5+
/// </summary>
6+
[RegisterComponent]
7+
public sealed partial class HellSpawnArenaComponent : Component
8+
{
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace Content.Server._Sunrise.Boss.Components;
2+
3+
/// <summary>
4+
/// This is used for...
5+
/// </summary>
6+
[RegisterComponent]
7+
public sealed partial class HellSpawnComponent : Component
8+
{
9+
[DataField]
10+
public EntityUid? ConsoleUid;
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace Content.Server._Sunrise.Boss.Components;
2+
3+
/// <summary>
4+
/// This is used for...
5+
/// </summary>
6+
[RegisterComponent]
7+
public sealed partial class HellSpawnCultistComponent : Component
8+
{
9+
[DataField]
10+
public EntityUid? ConsoleUid;
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using Robust.Shared.Map;
2+
3+
namespace Content.Server._Sunrise.Boss.Components;
4+
5+
/// <summary>
6+
/// This is used for...
7+
/// </summary>
8+
[RegisterComponent]
9+
public sealed partial class HellSpawnFighterComponent : Component
10+
{
11+
[DataField]
12+
public EntityCoordinates? TeleportedFromCoordinates;
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using System.Numerics;
2+
using Content.Shared.Damage;
3+
using Content.Shared.FixedPoint;
4+
using Content.Shared.Whitelist;
5+
using Robust.Shared.Prototypes;
6+
7+
namespace Content.Server._Sunrise.Boss.Components;
8+
9+
[RegisterComponent]
10+
public sealed partial class HellSpawnRushComponent : Component
11+
{
12+
[DataField]
13+
public EntityUid? RuneUid;
14+
15+
[DataField]
16+
public Vector2 CameraKickback = new(-5f, -5f);
17+
18+
[DataField]
19+
public float CameraKickRange = 3f;
20+
21+
[DataField]
22+
public bool DoCameraKickOnLand = true;
23+
24+
[DataField]
25+
public float Range = 8f;
26+
27+
[DataField]
28+
public EntProtoId? RushAction = "ActionHellSpawnRush";
29+
30+
[DataField] public EntityUid? RushActionEntity;
31+
32+
[DataField]
33+
public DamageSpecifier ThrowHitDamageDict = new()
34+
{
35+
DamageDict = new Dictionary<string, FixedPoint2>
36+
{
37+
{ "Brute", 50 },
38+
{ "Structural", 150 }, // this ensures that structures like doors are destroyed
39+
},
40+
};
41+
42+
[DataField]
43+
public EntityWhitelist? Blacklist;
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using Robust.Shared.Prototypes;
2+
3+
namespace Content.Server._Sunrise.Boss.Components;
4+
5+
[RegisterComponent]
6+
public sealed partial class HellSpawnSpiralComponent : Component
7+
{
8+
[DataField]
9+
public int FireballCount = 4;
10+
11+
[DataField]
12+
public EntProtoId? SpiralAction = "ActionHellSpawnSpiral";
13+
14+
[DataField] public EntityUid? SpiralActionEntity;
15+
}

0 commit comments

Comments
 (0)