Merge remote-tracking branch 'upstream/master' into UPS
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Linq;
|
||||
using Content.Shared._White.StaminaProtection;
|
||||
using Content.Shared._White.StunLock;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Alert;
|
||||
using Content.Shared.CombatMode;
|
||||
@@ -8,6 +9,7 @@ using Content.Shared.Damage.Events;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Effects;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.Item.ItemToggle.Components;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Projectiles;
|
||||
using Content.Shared.Rejuvenate;
|
||||
@@ -15,6 +17,7 @@ using Content.Shared.Rounding;
|
||||
using Content.Shared.Stunnable;
|
||||
using Content.Shared.Throwing;
|
||||
using Content.Shared.Weapons.Melee.Events;
|
||||
using Content.Shared.StatusEffect;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
@@ -35,6 +38,7 @@ public sealed partial class StaminaSystem : EntitySystem
|
||||
[Dependency] private readonly SharedColorFlashEffectSystem _color = default!;
|
||||
[Dependency] private readonly SharedStunSystem _stunSystem = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!; // WD EDIT
|
||||
|
||||
/// <summary>
|
||||
/// How much of a buffer is there between the stun duration and when stuns can be re-applied.
|
||||
@@ -209,7 +213,7 @@ public sealed partial class StaminaSystem : EntitySystem
|
||||
damage = modifyEv.Damage;
|
||||
}
|
||||
|
||||
TakeStaminaDamage(target, damage, source: uid, sound: component.Sound);
|
||||
TakeStaminaDamage(target, damage, with: uid, sound: component.Sound);
|
||||
// WD EDIT END
|
||||
}
|
||||
|
||||
@@ -255,8 +259,20 @@ public sealed partial class StaminaSystem : EntitySystem
|
||||
return;
|
||||
|
||||
// Have we already reached the point of max stamina damage?
|
||||
if (component.Critical)
|
||||
return;
|
||||
if (component.Critical) // WD EDIT
|
||||
{
|
||||
if (TryComp<StunLockComponent>(with, out _))
|
||||
{
|
||||
if (TryComp<ItemToggleComponent>(with, out var toggle) && !toggle.Activated)
|
||||
return;
|
||||
_stunSystem.TryParalyze(uid, component.StunTime, true);
|
||||
if (visual)
|
||||
_color.RaiseEffect(Color.Aqua, new List<EntityUid>() { uid }, Filter.Pvs(uid, entityManager: EntityManager));
|
||||
if (_net.IsServer)
|
||||
_audio.PlayPvs(sound, uid);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var oldDamage = component.StaminaDamage;
|
||||
component.StaminaDamage = MathF.Max(0f, component.StaminaDamage + value);
|
||||
@@ -349,7 +365,7 @@ public sealed partial class StaminaSystem : EntitySystem
|
||||
continue;
|
||||
|
||||
// We were in crit so come out of it and continue.
|
||||
if (comp.Critical)
|
||||
if (!_statusEffectsSystem.HasStatusEffect(uid, "Stun") && comp.Critical) // WD EIT
|
||||
{
|
||||
ExitStamCrit(uid, comp);
|
||||
continue;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Content.Shared.Emag.Systems;
|
||||
using Content.Shared.Tag;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -17,4 +18,7 @@ public sealed partial class EmagComponent : Component
|
||||
[DataField("emagImmuneTag", customTypeSerializer: typeof(PrototypeIdSerializer<TagPrototype>)), ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoNetworkedField]
|
||||
public string EmagImmuneTag = "EmagImmune";
|
||||
|
||||
[DataField]
|
||||
public EntityWhitelist? Whitelist;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,9 @@ public sealed class EmagSystem : EntitySystem
|
||||
if (_tag.HasTag(target, comp.EmagImmuneTag))
|
||||
return false;
|
||||
|
||||
if (comp.Whitelist?.IsValid(target, EntityManager) is false)
|
||||
return false;
|
||||
|
||||
TryComp<LimitedChargesComponent>(uid, out var charges);
|
||||
if (_charges.IsEmpty(uid, charges))
|
||||
{
|
||||
|
||||
@@ -202,6 +202,9 @@ public abstract class SharedStunSystem : EntitySystem
|
||||
if (!Resolve(uid, ref status, false))
|
||||
return false;
|
||||
|
||||
if (_statusEffect.HasStatusEffect(uid, "Stun"))
|
||||
time = TimeSpan.FromSeconds(6);
|
||||
|
||||
return TryKnockdown(uid, time, refresh, status) && TryStun(uid, time, refresh, status);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using Content.Shared._White.Overlays;
|
||||
using Content.Shared.Actions;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Shared._Miracle.Systems;
|
||||
@@ -13,6 +15,7 @@ public abstract class SharedEnhancedVisionSystem<TComp, TTempComp, TEvent> : Ent
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedActionsSystem _actions = default!;
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly INetManager _net = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -52,7 +55,8 @@ public abstract class SharedEnhancedVisionSystem<TComp, TTempComp, TEvent> : Ent
|
||||
|
||||
component.IsActive = !component.IsActive;
|
||||
|
||||
_audio.PlayPredicted(component.IsActive ? component.ActivateSound : component.DeactivateSound, uid, uid);
|
||||
if (_net.IsClient)
|
||||
_audio.PlayEntity(component.IsActive ? component.ActivateSound : component.DeactivateSound, Filter.Local(), uid, false);
|
||||
|
||||
args.Handled = true;
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared._White.Overlays;
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class ThermalBlockerComponent : Component
|
||||
{
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public sealed class StaminaProtectionSystem : EntitySystem
|
||||
args.Args.Damage = MathF.Max(0f, args.Args.Damage - flat);
|
||||
|
||||
if (modifiers.Coefficients.TryGetValue("Blunt", out var coefficient))
|
||||
args.Args.Damage *= coefficient;
|
||||
args.Args.Damage *= coefficient / 1.5f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
7
Content.Shared/_White/StunLock/StunLockComponent.cs
Normal file
7
Content.Shared/_White/StunLock/StunLockComponent.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Content.Shared._White.StunLock;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class StunLockComponent : Component
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user