Fix tests (#3707)
* First pass * Fix access and rename banananium to bananium * Fix captialization of CookTimeInfoLabel * Fix InteractUsing calls * Remove unused [Dependency] * Replace obsolete references to Anchored with BodyType * Assign default value to shoving someone in disposals * Fix naming * Replace Initialize TryGetComponents with EnsureComponent * Rework AnchorableComponent * Fix singularity component * Replace obsolete usages of Angle.South * Fix efcore warning * Fix container tests * Fix DebugPressurePump invalid PressurePump yaml * Fix getting pathfinding region of grid 0 * Fix atmos plaque missing layer and add info message when it happens * Fix AiSteeringSystem steering in an invalid grid in entity test * Make content able to choose which log level leads to test failures * Revert container test fix for Acruid * Fix sprite, pipe and saving errors Make EntityTest print all errors instead of stopping on the first * Reorder singularity visualizer * Disable pvs for container occlusion adn simple predict reconcile, they use entities other than map ones Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com> Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -1,21 +1,19 @@
|
||||
#nullable enable
|
||||
using System.Linq;
|
||||
using Content.Server.GameObjects.Components.StationEvents;
|
||||
using Content.Shared.GameObjects.Components.Singularity;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Physics.Collision;
|
||||
using Robust.Server.GameObjects;
|
||||
using Content.Shared.GameObjects.Components.Singularity;
|
||||
using Robust.Shared.Physics.Collision.Shapes;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Singularity
|
||||
{
|
||||
[RegisterComponent]
|
||||
@@ -62,8 +60,10 @@ namespace Content.Server.GameObjects.Components.Singularity
|
||||
|
||||
if(_radiationPulseComponent != null) _radiationPulseComponent.RadsPerSecond = 10 * value;
|
||||
|
||||
_spriteComponent?.LayerSetRSI(0, "Constructible/Power/Singularity/singularity_" + _level + ".rsi");
|
||||
_spriteComponent?.LayerSetState(0, "singularity_" + _level);
|
||||
if (Owner.TryGetComponent(out AppearanceComponent? appearance))
|
||||
{
|
||||
appearance.SetData(SingularityVisuals.Level, _level);
|
||||
}
|
||||
|
||||
if (_collidableComponent != null && _collidableComponent.Fixtures.Any() && _collidableComponent.Fixtures[0].Shape is PhysShapeCircle circle)
|
||||
{
|
||||
@@ -87,9 +87,9 @@ namespace Content.Server.GameObjects.Components.Singularity
|
||||
_ => 0
|
||||
};
|
||||
|
||||
private PhysicsComponent? _collidableComponent;
|
||||
private SpriteComponent? _spriteComponent;
|
||||
private RadiationPulseComponent? _radiationPulseComponent;
|
||||
private PhysicsComponent _collidableComponent = default!;
|
||||
private RadiationPulseComponent _radiationPulseComponent = default!;
|
||||
private SpriteComponent _spriteComponent = default!;
|
||||
private IPlayingAudioStream? _playingSound;
|
||||
|
||||
public override ComponentState GetComponentState(ICommonSession player)
|
||||
@@ -101,6 +101,10 @@ namespace Content.Server.GameObjects.Components.Singularity
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
Owner.EnsureComponent(out _radiationPulseComponent);
|
||||
Owner.EnsureComponent(out _collidableComponent);
|
||||
Owner.EnsureComponent(out _spriteComponent);
|
||||
|
||||
var audioParams = AudioParams.Default;
|
||||
audioParams.Loop = true;
|
||||
audioParams.MaxDistance = 20f;
|
||||
@@ -108,14 +112,7 @@ namespace Content.Server.GameObjects.Components.Singularity
|
||||
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/singularity_form.ogg", Owner);
|
||||
Timer.Spawn(5200,() => _playingSound = SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/singularity.ogg", Owner, audioParams));
|
||||
|
||||
if (!Owner.TryGetComponent(out _spriteComponent))
|
||||
Logger.Error("SingularityComponent was spawned without SpriteComponent");
|
||||
if (!Owner.TryGetComponent(out _radiationPulseComponent))
|
||||
Logger.Error("SingularityComponent was spawned without RadiationPulseComponent");
|
||||
if (!Owner.TryGetComponent(out _collidableComponent))
|
||||
Logger.Error("SingularityComponent was spawned without CollidableComponent!");
|
||||
else
|
||||
_collidableComponent.Hard = false;
|
||||
_collidableComponent!.Hard = false;
|
||||
Level = 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user