Merge branch 'master' into replace-sounds-with-sound-specifier
# Conflicts: # Content.Server/Actions/Actions/DisarmAction.cs # Content.Server/Actions/Actions/ScreamAction.cs # Content.Server/Arcade/Components/SpaceVillainArcadeComponent.cs # Content.Server/Damage/Components/DamageOnHighSpeedImpactComponent.cs # Content.Server/Explosion/Components/FlashExplosiveComponent.cs # Content.Server/Physics/Controllers/MoverController.cs # Content.Server/Portal/Components/PortalComponent.cs # Content.Server/Portal/Components/TeleporterComponent.cs # Content.Server/Projectiles/Components/ProjectileComponent.cs # Content.Server/Singularity/Components/EmitterComponent.cs # Content.Server/Sound/EmitSoundSystem.cs # Content.Server/Stunnable/Components/StunbatonComponent.cs # Content.Server/Tools/Components/MultitoolComponent.cs # Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs # Content.Shared/Gravity/GravityComponent.cs # Content.Shared/Light/Component/SharedExpendableLightComponent.cs # Content.Shared/Maps/ContentTileDefinition.cs # Content.Shared/Slippery/SlipperyComponent.cs # Content.Shared/Standing/StandingStateComponent.cs # Resources/Prototypes/Entities/Objects/Fun/bike_horn.yml
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
#nullable enable
|
||||
using Content.Shared.Singularity;
|
||||
using Content.Shared.Singularity.Components;
|
||||
using Content.Shared.Sound;
|
||||
@@ -17,7 +16,7 @@ namespace Content.Server.Singularity.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(SharedSingularityComponent))]
|
||||
public class ServerSingularityComponent : SharedSingularityComponent, IStartCollide
|
||||
public class ServerSingularityComponent : SharedSingularityComponent
|
||||
{
|
||||
private SharedSingularitySystem _singularitySystem = default!;
|
||||
|
||||
@@ -102,46 +101,6 @@ namespace Content.Server.Singularity.Components
|
||||
Energy -= EnergyDrain * seconds;
|
||||
}
|
||||
|
||||
void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold)
|
||||
{
|
||||
// If we're being deleted by another singularity, this call is probably for that singularity.
|
||||
// Even if not, just don't bother.
|
||||
if (BeingDeletedByAnotherSingularity)
|
||||
return;
|
||||
|
||||
var otherEntity = otherFixture.Body.Owner;
|
||||
|
||||
if (otherEntity.TryGetComponent<IMapGridComponent>(out var mapGridComponent))
|
||||
{
|
||||
foreach (var tile in mapGridComponent.Grid.GetTilesIntersecting(ourFixture.Body.GetWorldAABB()))
|
||||
{
|
||||
mapGridComponent.Grid.SetTile(tile.GridIndices, Robust.Shared.Map.Tile.Empty);
|
||||
Energy++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (otherEntity.HasComponent<ContainmentFieldComponent>() ||
|
||||
(otherEntity.TryGetComponent<ContainmentFieldGeneratorComponent>(out var component) && component.CanRepell(Owner)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (otherEntity.IsInContainer())
|
||||
return;
|
||||
|
||||
// Singularity priority management / etc.
|
||||
if (otherEntity.TryGetComponent<ServerSingularityComponent>(out var otherSingulo))
|
||||
otherSingulo.BeingDeletedByAnotherSingularity = true;
|
||||
|
||||
otherEntity.QueueDelete();
|
||||
|
||||
if (otherEntity.TryGetComponent<SinguloFoodComponent>(out var singuloFood))
|
||||
Energy += singuloFood.Energy;
|
||||
else
|
||||
Energy++;
|
||||
}
|
||||
|
||||
protected override void OnRemove()
|
||||
{
|
||||
_playingSound?.Stop();
|
||||
|
||||
Reference in New Issue
Block a user