Merge branch 'master' into 2020-08-31-click-attack

This commit is contained in:
Víctor Aguilera Puerto
2020-09-02 15:12:17 +02:00
committed by GitHub
299 changed files with 42728 additions and 31895 deletions

View File

@@ -23,7 +23,6 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
public class FlashComponent : MeleeWeaponComponent, IUse, IExamine
{
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly ISharedNotifyManager _notifyManager = default!;
public override string Name => "Flash";
@@ -101,7 +100,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
{
sprite.LayerSetState(0, "burnt");
_notifyManager.PopupMessage(Owner, user, Loc.GetString("The flash burns out!"));
Owner.PopupMessage(user, Loc.GetString("The flash burns out!"));
}
else if (!_flashing)
{
@@ -155,7 +154,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
if (entity != user)
{
_notifyManager.PopupMessage(user, entity, Loc.GetString("{0:TheName} blinds you with {1:theName}", user, Owner));
user.PopupMessage(entity, Loc.GetString("{0:TheName} blinds you with {1:theName}", user, Owner));
}
}

View File

@@ -27,6 +27,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
{
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IPhysicsManager _physicsManager = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
public override string Name => "MeleeWeapon";
private TimeSpan _lastAttackTime;
@@ -84,7 +85,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
{
if (!eventArgs.WideAttack) return true;
var curTime = IoCManager.Resolve<IGameTiming>().CurTime;
var curTime = _gameTiming.CurTime;
if(curTime < _cooldownEnd)
return true;
@@ -142,7 +143,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
{
if (eventArgs.WideAttack) return false;
var curTime = IoCManager.Resolve<IGameTiming>().CurTime;
var curTime = _gameTiming.CurTime;
if(curTime < _cooldownEnd || !eventArgs.Target.IsValid())
return true;

View File

@@ -31,7 +31,6 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
public class StunbatonComponent : MeleeWeaponComponent, IUse, IExamine, IMapInit, IInteractUsing
{
[Dependency] private readonly IRobustRandom _robustRandom = default!;
[Dependency] private readonly ISharedNotifyManager _notifyManager = default!;
public override string Name => "Stunbaton";
@@ -165,14 +164,14 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
{
EntitySystem.Get<AudioSystem>().PlayAtCoords("/Audio/Machines/button.ogg", Owner.Transform.GridPosition, AudioHelpers.WithVariation(0.25f));
_notifyManager.PopupMessage(Owner, user, Loc.GetString("Cell missing..."));
Owner.PopupMessage(user, Loc.GetString("Cell missing..."));
return;
}
if (cell.CurrentCharge < EnergyPerUse)
{
EntitySystem.Get<AudioSystem>().PlayAtCoords("/Audio/Machines/button.ogg", Owner.Transform.GridPosition, AudioHelpers.WithVariation(0.25f));
_notifyManager.PopupMessage(Owner, user, Loc.GetString("Dead cell..."));
Owner.PopupMessage(user, Loc.GetString("Dead cell..."));
return;
}