Merge branch 'master' into 2020-04-28-tool-component
This commit is contained in:
@@ -19,11 +19,9 @@ using Robust.Server.GameObjects.Components.Container;
|
||||
using Content.Server.GameObjects.Components.Power;
|
||||
using Robust.Server.GameObjects.Components.UserInterface;
|
||||
using Robust.Server.Interfaces.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Localization;
|
||||
using Content.Server.Interfaces;
|
||||
using Robust.Shared.Audio;
|
||||
using YamlDotNet.Serialization.NodeTypeResolvers;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Kitchen
|
||||
{
|
||||
@@ -76,7 +74,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
||||
private BoundUserInterface _userInterface;
|
||||
|
||||
private Container _storage;
|
||||
|
||||
|
||||
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
@@ -101,7 +99,6 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
||||
_audioSystem = _entitySystemManager.GetEntitySystem<AudioSystem>();
|
||||
_userInterface = Owner.GetComponent<ServerUserInterfaceComponent>()
|
||||
.GetBoundUserInterface(MicrowaveUiKey.Key);
|
||||
|
||||
_userInterface.OnReceiveMessage += UserInterfaceOnReceiveMessage;
|
||||
}
|
||||
|
||||
@@ -137,7 +134,6 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
||||
UpdateUserInterface();
|
||||
}
|
||||
break;
|
||||
|
||||
case MicrowaveVaporizeReagentIndexedMessage msg:
|
||||
if (HasContents)
|
||||
{
|
||||
@@ -146,7 +142,6 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
||||
UpdateUserInterface();
|
||||
}
|
||||
break;
|
||||
|
||||
case MicrowaveSelectCookTimeMessage msg:
|
||||
_currentCookTimerTime = msg.newCookTime;
|
||||
ClickSound();
|
||||
@@ -173,7 +168,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
||||
solidsVisualList.Add(item.Uid);
|
||||
}
|
||||
|
||||
_userInterface.SetState(new MicrowaveUpdateUserInterfaceState(_solution.Solution.Contents, solidsVisualList));
|
||||
_userInterface.SetState(new MicrowaveUpdateUserInterfaceState(_solution.Solution.Contents, solidsVisualList, _busy));
|
||||
}
|
||||
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
@@ -246,7 +241,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
_busy = true;
|
||||
// Convert storage into Dictionary of ingredients
|
||||
var solidsDict = new Dictionary<string, int>();
|
||||
@@ -279,7 +274,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
||||
(_currentCookTimerTime == (uint)recipeToCook.CookTime) ? true : false;
|
||||
|
||||
SetAppearance(MicrowaveVisualState.Cooking);
|
||||
_audioSystem.Play(_startCookingSound);
|
||||
_audioSystem.Play(_startCookingSound, AudioParams.Default);
|
||||
Timer.Spawn((int)(_currentCookTimerTime * _cookTimeMultiplier), () =>
|
||||
{
|
||||
|
||||
@@ -295,12 +290,12 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
||||
|
||||
var entityToSpawn = goodMeal ? recipeToCook.Result : _badRecipeName;
|
||||
_entityManager.SpawnEntity(entityToSpawn, Owner.Transform.GridPosition);
|
||||
_audioSystem.Play(_cookingCompleteSound);
|
||||
_audioSystem.Play(_cookingCompleteSound, AudioParams.Default);
|
||||
SetAppearance(MicrowaveVisualState.Idle);
|
||||
_busy = false;
|
||||
UpdateUserInterface();
|
||||
});
|
||||
UpdateUserInterface();
|
||||
return;
|
||||
}
|
||||
|
||||
private void VaporizeReagents()
|
||||
@@ -396,12 +391,12 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private void ClickSound()
|
||||
{
|
||||
|
||||
_audioSystem.Play("/Audio/machines/machine_switch.ogg", AudioParams.Default.WithVolume(-2f));
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Content.Server.GameObjects.Components
|
||||
|
||||
protected override void Activate(IEntity user, RotatableComponent component)
|
||||
{
|
||||
component.TryRotate(user, Angle.FromDegrees(90));
|
||||
component.TryRotate(user, Angle.FromDegrees(-90));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Content.Server.GameObjects.Components
|
||||
|
||||
protected override void Activate(IEntity user, RotatableComponent component)
|
||||
{
|
||||
component.TryRotate(user, Angle.FromDegrees(-90));
|
||||
component.TryRotate(user, Angle.FromDegrees(90));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,12 +28,12 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
||||
[Dependency] private readonly IPhysicsManager _physicsManager;
|
||||
#pragma warning restore 649
|
||||
|
||||
private int _damage = 1;
|
||||
private float _range = 1;
|
||||
private float _arcWidth = 90;
|
||||
private int _damage;
|
||||
private float _range;
|
||||
private float _arcWidth;
|
||||
private string _arc;
|
||||
private string _hitSound;
|
||||
private float _cooldownTime = 1f;
|
||||
private float _cooldownTime;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public string Arc
|
||||
@@ -122,9 +122,8 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
||||
|
||||
private HashSet<IEntity> ArcRayCast(Vector2 position, Angle angle, IEntity ignore)
|
||||
{
|
||||
// Maybe make this increment count depend on the width/length?
|
||||
const int increments = 5;
|
||||
var widthRad = Angle.FromDegrees(ArcWidth);
|
||||
var increments = 1 + (35 * (int) Math.Ceiling(widthRad / (2 * Math.PI)));
|
||||
var increment = widthRad / increments;
|
||||
var baseAngle = angle - widthRad / 2;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user