Skip to content

Commit

Permalink
Merge pull request #277 from PyotrIgn/try_of_fix_vyleti_yobannie
Browse files Browse the repository at this point in the history
Попытка пофиксить вылеты + завершение праздников
  • Loading branch information
Schrodinger71 authored Jan 4, 2024
2 parents 0b8ece8 + 3f924d6 commit 1620899
Show file tree
Hide file tree
Showing 22 changed files with 21,265 additions and 17,010 deletions.
460 changes: 230 additions & 230 deletions Content.Client/Sirena/EntityHealthBar/EntityHealthBarOverlay.cs

Large diffs are not rendered by default.

108 changes: 54 additions & 54 deletions Content.Client/Sirena/EntityHealthBar/ShowHealthBarsSystem.cs
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
using Content.Shared.GameTicking;
using Content.Shared.Sirena.EntityHealthBar;
using Robust.Client.Graphics;
using Robust.Client.Player;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
//using Content.Shared.GameTicking;
//using Content.Shared.Sirena.EntityHealthBar;
//using Robust.Client.Graphics;
//using Robust.Client.Player;
//using Robust.Shared.Player;
//using Robust.Shared.Prototypes;

namespace Content.Client.Sirena.EntityHealthBar
{
public sealed class ShowHealthBarsSystem : EntitySystem
{
[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly IPrototypeManager _protoMan = default!;
[Dependency] private readonly IOverlayManager _overlayMan = default!;
//namespace Content.Client.Sirena.EntityHealthBar
//{
// public sealed class ShowHealthBarsSystem : EntitySystem
// {
// [Dependency] private readonly IPlayerManager _player = default!;
// [Dependency] private readonly IPrototypeManager _protoMan = default!;
// [Dependency] private readonly IOverlayManager _overlayMan = default!;

private EntityHealthBarOverlay _overlay = default!;
public override void Initialize()
{
base.Initialize();
// private EntityHealthBarOverlay _overlay = default!;
// public override void Initialize()
// {
// base.Initialize();

SubscribeLocalEvent<ShowHealthBarsComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<ShowHealthBarsComponent, ComponentRemove>(OnRemove);
SubscribeLocalEvent<ShowHealthBarsComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
SubscribeLocalEvent<ShowHealthBarsComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart);
// SubscribeLocalEvent<ShowHealthBarsComponent, ComponentInit>(OnInit);
// SubscribeLocalEvent<ShowHealthBarsComponent, ComponentRemove>(OnRemove);
// SubscribeLocalEvent<ShowHealthBarsComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
// SubscribeLocalEvent<ShowHealthBarsComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
// SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart);

_overlay = new(EntityManager, _protoMan);
}
// _overlay = new(EntityManager, _protoMan);
// }

private void OnInit(EntityUid uid, ShowHealthBarsComponent component, ComponentInit args)
{
if (_player.LocalPlayer?.ControlledEntity == uid)
{
_overlayMan.AddOverlay(_overlay);
_overlay.DamageContainer = component.DamageContainer;
}
// private void OnInit(EntityUid uid, ShowHealthBarsComponent component, ComponentInit args)
// {
// if (_player.LocalPlayer?.ControlledEntity == uid)
// {
// _overlayMan.AddOverlay(_overlay);
// _overlay.DamageContainer = component.DamageContainer;
// }


}
private void OnRemove(EntityUid uid, ShowHealthBarsComponent component, ComponentRemove args)
{
if (_player.LocalPlayer?.ControlledEntity == uid)
{
_overlayMan.RemoveOverlay(_overlay);
}
}
// }
// private void OnRemove(EntityUid uid, ShowHealthBarsComponent component, ComponentRemove args)
// {
// if (_player.LocalPlayer?.ControlledEntity == uid)
// {
// _overlayMan.RemoveOverlay(_overlay);
// }
// }

private void OnPlayerAttached(EntityUid uid, ShowHealthBarsComponent component, LocalPlayerAttachedEvent args)
{
_overlayMan.AddOverlay(_overlay);
_overlay.DamageContainer = component.DamageContainer;
}
// private void OnPlayerAttached(EntityUid uid, ShowHealthBarsComponent component, LocalPlayerAttachedEvent args)
// {
// _overlayMan.AddOverlay(_overlay);
// _overlay.DamageContainer = component.DamageContainer;
// }

private void OnPlayerDetached(EntityUid uid, ShowHealthBarsComponent component, LocalPlayerDetachedEvent args)
{
_overlayMan.RemoveOverlay(_overlay);
}
// private void OnPlayerDetached(EntityUid uid, ShowHealthBarsComponent component, LocalPlayerDetachedEvent args)
// {
// _overlayMan.RemoveOverlay(_overlay);
// }

private void OnRoundRestart(RoundRestartCleanupEvent args)
{
_overlayMan.RemoveOverlay(_overlay);
}
}
}
// private void OnRoundRestart(RoundRestartCleanupEvent args)
// {
// _overlayMan.RemoveOverlay(_overlay);
// }
// }
//}
10 changes: 5 additions & 5 deletions Content.Server/Shuttles/Components/ShuttleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public sealed partial class ShuttleComponent : Component
/// Maximum velocity assuming unupgraded, tier 1 thrusters
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float BaseMaxLinearVelocity = 40f;
public float BaseMaxLinearVelocity = 20f;

public const float MaxAngularVelocity = 8f;
public const float MaxAngularVelocity = 4f;

/// <summary>
/// The cached thrust available for each cardinal direction
Expand Down Expand Up @@ -54,7 +54,7 @@ public sealed partial class ShuttleComponent : Component
public readonly List<EntityUid> AngularThrusters = new();

[ViewVariables]
public float AngularThrust = 10f;
public float AngularThrust = 0f;

/// <summary>
/// A bitmask of all the directions we are considered thrusting.
Expand All @@ -66,9 +66,9 @@ public sealed partial class ShuttleComponent : Component
/// Damping applied to the shuttle's physics component when not in FTL.
/// </summary>
[DataField("linearDamping"), ViewVariables(VVAccess.ReadWrite)]
public float LinearDamping = 0.06f;
public float LinearDamping = 0.05f;

[DataField("angularDamping"), ViewVariables(VVAccess.ReadWrite)]
public float AngularDamping = 0.06f;
public float AngularDamping = 0.05f;
}
}
Loading

0 comments on commit 1620899

Please sign in to comment.