Fix stuff

This commit is contained in:
ShadowCommander
2021-08-10 16:18:57 -07:00
parent e9f358f56b
commit 0c09d4d7e2
10 changed files with 111 additions and 112 deletions

View File

@@ -116,7 +116,8 @@ namespace Content.Server.Cuffs.Components
[DataField("startCuffSound")] [DataField("startCuffSound")]
public SoundSpecifier StartCuffSound { get; set; } = new SoundPathSpecifier("/Audio/Items/Handcuffs/cuff_start.ogg"); public SoundSpecifier StartCuffSound { get; set; } = new SoundPathSpecifier("/Audio/Items/Handcuffs/cuff_start.ogg");
[DataField("endCuffSound")] public SoundSpecifier EndCuffSound { get; set; } = new SoundPathSpecifier("/Audio/Items/Handcuffs/cuff_end.ogg"); [DataField("endCuffSound")]
public SoundSpecifier EndCuffSound { get; set; } = new SoundPathSpecifier("/Audio/Items/Handcuffs/cuff_end.ogg");
[DataField("startBreakoutSound")] [DataField("startBreakoutSound")]
public SoundSpecifier StartBreakoutSound { get; set; } = new SoundPathSpecifier("/Audio/Items/Handcuffs/cuff_breakout_start.ogg"); public SoundSpecifier StartBreakoutSound { get; set; } = new SoundPathSpecifier("/Audio/Items/Handcuffs/cuff_breakout_start.ogg");

View File

@@ -15,6 +15,6 @@ namespace Content.Server.Explosion.Components
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
[DataField("sound", required: true)] [DataField("sound", required: true)]
public SoundSpecifier? Sound { get; set; } = null; public SoundSpecifier Sound { get; set; } = default!;
} }
} }

View File

@@ -21,7 +21,7 @@ namespace Content.Server.Nutrition.Components
public float ParalyzeTime { get; set; } = 1f; public float ParalyzeTime { get; set; } = 1f;
[DataField("sound")] [DataField("sound")]
private SoundSpecifier _sound = new SoundCollectionSpecifier("desacration"); private SoundSpecifier _sound = new SoundCollectionSpecifier("desecration");
public void PlaySound() public void PlaySound()
{ {

View File

@@ -104,49 +104,49 @@ namespace Content.Server.PDA
switch (message.Message) switch (message.Message)
{ {
case PDARequestUpdateInterfaceMessage _: case PDARequestUpdateInterfaceMessage _:
{ {
UpdatePDAUserInterface(); UpdatePDAUserInterface();
break; break;
} }
case PDAToggleFlashlightMessage _: case PDAToggleFlashlightMessage _:
{ {
ToggleLight(); ToggleLight();
break; break;
} }
case PDAEjectIDMessage _: case PDAEjectIDMessage _:
{ {
HandleIDEjection(message.Session.AttachedEntity!); HandleIDEjection(message.Session.AttachedEntity!);
break; break;
} }
case PDAEjectPenMessage _: case PDAEjectPenMessage _:
{ {
HandlePenEjection(message.Session.AttachedEntity!); HandlePenEjection(message.Session.AttachedEntity!);
break; break;
} }
case PDAUplinkBuyListingMessage buyMsg: case PDAUplinkBuyListingMessage buyMsg:
{
var player = message.Session.AttachedEntity;
if (player == null) break;
if (!_uplinkManager.TryPurchaseItem(_syndicateUplinkAccount, buyMsg.ItemId,
player.Transform.Coordinates, out var entity))
{ {
var player = message.Session.AttachedEntity; SendNetworkMessage(new PDAUplinkInsufficientFundsMessage(), message.Session.ConnectedClient);
if (player == null)
break;
if (!_uplinkManager.TryPurchaseItem(_syndicateUplinkAccount, buyMsg.ItemId,
player.Transform.Coordinates, out var entity))
{
SendNetworkMessage(new PDAUplinkInsufficientFundsMessage(), message.Session.ConnectedClient);
break;
}
if (!player.TryGetComponent(out HandsComponent? hands) || !entity.TryGetComponent(out ItemComponent? item))
break;
hands.PutInHandOrDrop(item);
SendNetworkMessage(new PDAUplinkBuySuccessMessage(), message.Session.ConnectedClient);
break; break;
} }
if (!player.TryGetComponent(out HandsComponent? hands) ||
!entity.TryGetComponent(out ItemComponent? item))
break;
hands.PutInHandOrDrop(item);
SendNetworkMessage(new PDAUplinkBuySuccessMessage(), message.Session.ConnectedClient);
break;
}
} }
} }

View File

@@ -226,7 +226,8 @@ namespace Content.Server.Physics.Controllers
// Walking on a tile. // Walking on a tile.
var def = (ContentTileDefinition) _tileDefinitionManager[tile.Tile.TypeId]; var def = (ContentTileDefinition) _tileDefinitionManager[tile.Tile.TypeId];
soundToPlay = def.FootstepSounds.GetSound(); soundToPlay = def.FootstepSounds.GetSound();
return; if (string.IsNullOrEmpty(soundToPlay))
return;
} }
if (string.IsNullOrWhiteSpace(soundToPlay)) if (string.IsNullOrWhiteSpace(soundToPlay))

View File

@@ -35,7 +35,7 @@ namespace Content.Server.Singularity.Components
[ViewVariables] public int FireShotCounter; [ViewVariables] public int FireShotCounter;
[ViewVariables] [DataField("fireSound")] public string FireSound = "/Audio/Weapons/emitter.ogg"; [ViewVariables] [DataField("fireSound")] public SoundSpecifier FireSound = new SoundPathSpecifier("/Audio/Weapons/emitter.ogg");
[ViewVariables] [DataField("boltType")] public string BoltType = "EmitterBolt"; [ViewVariables] [DataField("boltType")] public string BoltType = "EmitterBolt";
[ViewVariables] [DataField("powerUseActive")] public int PowerUseActive = 500; [ViewVariables] [DataField("powerUseActive")] public int PowerUseActive = 500;
[ViewVariables] [DataField("fireBurstSize")] public int FireBurstSize = 3; [ViewVariables] [DataField("fireBurstSize")] public int FireBurstSize = 3;

View File

@@ -222,7 +222,7 @@ namespace Content.Server.Singularity.EntitySystems
// TODO: Move to projectile's code. // TODO: Move to projectile's code.
Timer.Spawn(3000, () => projectile.Delete()); Timer.Spawn(3000, () => projectile.Delete());
SoundSystem.Play(Filter.Pvs(component.Owner), component.FireSound, component.Owner, SoundSystem.Play(Filter.Pvs(component.Owner), component.FireSound.GetSound(), component.Owner,
AudioHelpers.WithVariation(EmitterComponent.Variation).WithVolume(EmitterComponent.Volume).WithMaxDistance(EmitterComponent.Distance)); AudioHelpers.WithVariation(EmitterComponent.Variation).WithVolume(EmitterComponent.Volume).WithMaxDistance(EmitterComponent.Distance));
} }

View File

@@ -2,7 +2,6 @@ using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems; using Content.Server.Atmos.EntitySystems;
using Content.Server.GameTicking; using Content.Server.GameTicking;
using Content.Shared.Atmos; using Content.Shared.Atmos;
using Content.Shared.Sound;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.IoC; using Robust.Shared.IoC;

View File

@@ -1,3 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Content.Server.DoAfter; using Content.Server.DoAfter;
using Content.Server.Hands.Components; using Content.Server.Hands.Components;
using Content.Server.Items; using Content.Server.Items;
@@ -24,11 +29,6 @@ using Robust.Shared.Player;
using Robust.Shared.Players; using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Content.Server.Storage.Components namespace Content.Server.Storage.Components
{ {
@@ -387,79 +387,77 @@ namespace Content.Server.Storage.Components
switch (message) switch (message)
{ {
case RemoveEntityMessage remove: case RemoveEntityMessage remove:
{
EnsureInitialCalculated();
var player = session.AttachedEntity;
if (player == null)
{ {
EnsureInitialCalculated();
var player = session.AttachedEntity;
if (player == null)
{
break;
}
var ownerTransform = Owner.Transform;
var playerTransform = player.Transform;
if (!playerTransform.Coordinates.InRange(Owner.EntityManager, ownerTransform.Coordinates, 2) ||
!ownerTransform.IsMapTransform &&
!playerTransform.ContainsEntity(ownerTransform))
{
break;
}
var entity = Owner.EntityManager.GetEntity(remove.EntityUid);
if (entity == null || _storage?.Contains(entity) == false)
{
break;
}
var item = entity.GetComponent<ItemComponent>();
if (item == null ||
!player.TryGetComponent(out HandsComponent? hands))
{
break;
}
if (!hands.CanPutInHand(item))
{
break;
}
hands.PutInHand(item);
break; break;
} }
var ownerTransform = Owner.Transform;
var playerTransform = player.Transform;
if (!playerTransform.Coordinates.InRange(Owner.EntityManager, ownerTransform.Coordinates, 2) ||
!ownerTransform.IsMapTransform && !playerTransform.ContainsEntity(ownerTransform))
{
break;
}
var entity = Owner.EntityManager.GetEntity(remove.EntityUid);
if (entity == null || _storage?.Contains(entity) == false)
{
break;
}
var item = entity.GetComponent<ItemComponent>();
if (item == null || !player.TryGetComponent(out HandsComponent? hands))
{
break;
}
if (!hands.CanPutInHand(item))
{
break;
}
hands.PutInHand(item);
break;
}
case InsertEntityMessage _: case InsertEntityMessage _:
{
EnsureInitialCalculated();
var player = session.AttachedEntity;
if (player == null)
{ {
EnsureInitialCalculated();
var player = session.AttachedEntity;
if (player == null)
{
break;
}
if (!player.InRangeUnobstructed(Owner, popup: true))
{
break;
}
PlayerInsertHeldEntity(player);
break; break;
} }
if (!player.InRangeUnobstructed(Owner, popup: true))
{
break;
}
PlayerInsertHeldEntity(player);
break;
}
case CloseStorageUIMessage _: case CloseStorageUIMessage _:
{
if (session is not IPlayerSession playerSession)
{ {
if (session is not IPlayerSession playerSession)
{
break;
}
UnsubscribeSession(playerSession);
break; break;
} }
UnsubscribeSession(playerSession);
break;
}
} }
} }

View File

@@ -48,11 +48,11 @@ namespace Content.Server.Window
switch (message) switch (message)
{ {
case DamageChangedMessage msg: case DamageChangedMessage msg:
{ {
var current = msg.Damageable.TotalDamage; var current = msg.Damageable.TotalDamage;
UpdateVisuals(current); UpdateVisuals(current);
break; break;
} }
} }
} }