Merge remote-tracking branch 'upstream/master' into ups

This commit is contained in:
Jabak
2024-08-03 22:32:36 +03:00
77 changed files with 791 additions and 341 deletions

View File

@@ -6,7 +6,9 @@ using Content.Shared.Emag.Components;
using Content.Shared.Emag.Systems;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Inventory;
using Content.Shared.NameIdentifier;
using Content.Shared.PDA;
using Content.Shared.Silicons.Borgs.Components;
using Content.Shared.StationRecords;
using Robust.Shared.Containers;
using Robust.Shared.GameStates;
@@ -393,6 +395,9 @@ public sealed class AccessReaderSystem : EntitySystem
ent.Comp.AccessLog.Dequeue();
string? name = null;
if (TryComp<NameIdentifierComponent>(accessor, out var nameIdentifier))
name = nameIdentifier.FullIdentifier;
// TODO pass the ID card on IsAllowed() instead of using this expensive method
// Set name if the accessor has a card and that card has a name and allows itself to be recorded
if (_idCardSystem.TryFindIdCard(accessor, out var idCard)

View File

@@ -7,7 +7,6 @@ using Content.Shared.Wieldable;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Network;
using Robust.Shared.Timing;
namespace Content.Shared.Item.ItemToggle;
/// <summary>
@@ -23,7 +22,6 @@ public abstract class SharedItemToggleSystem : EntitySystem
[Dependency] private readonly SharedPointLightSystem _light = default!;
[Dependency] private readonly INetManager _netManager = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly IGameTiming _timing = default!;
public override void Initialize()
{
@@ -242,17 +240,14 @@ public abstract class SharedItemToggleSystem : EntitySystem
/// </summary>
private void UpdateActiveSound(EntityUid uid, ItemToggleActiveSoundComponent activeSound, ref ItemToggledEvent args)
{
if (!_timing.IsFirstTimePredicted) // WD
if (_netManager.IsClient) // WD EDIT, FUCK THIS (desword sound broken)
return;
if (args.Activated)
{
if (activeSound.ActiveSound != null && activeSound.PlayingStream == null)
{
if (args.Predicted)
activeSound.PlayingStream = _audio.PlayPredicted(activeSound.ActiveSound, uid, args.User, AudioParams.Default.WithLoop(true)).Value.Entity;
else
activeSound.PlayingStream = _audio.PlayPvs(activeSound.ActiveSound, uid, AudioParams.Default.WithLoop(true)).Value.Entity;
activeSound.PlayingStream = _audio.PlayPvs(activeSound.ActiveSound, uid, AudioParams.Default.WithLoop(true)) .Value.Entity;
}
}
else

View File

@@ -11,7 +11,6 @@ using Content.Shared._White.Wizard.Timestop;
using Content.Shared.Buckle;
using Content.Shared.Buckle.Components;
using Content.Shared.Mobs;
using Content.Shared.Movement.Events;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Input.Binding;
using Robust.Shared.Physics;
@@ -29,10 +28,8 @@ public abstract partial class SharedStandingStateSystem : EntitySystem
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!; // WD EDIT
[Dependency] private readonly MovementSpeedModifierSystem _movement = default!; // WD EDIT
[Dependency] private readonly SharedStunSystem _stun = default!; // WD EDIT
[Dependency] private readonly MobStateSystem _mobState = default!; // WD EDIT
[Dependency] private readonly SharedBuckleSystem _buckle = default!; // WD EDIT
[Dependency] private readonly SharedTransformSystem _transform = default!; // WD EDIT
[Dependency] private readonly SharedRotationVisualsSystem _rotation = default!; // WD EDIT
// If StandingCollisionLayer value is ever changed to more than one layer, the logic needs to be edited.
@@ -53,7 +50,6 @@ public abstract partial class SharedStandingStateSystem : EntitySystem
SubscribeLocalEvent<StandingStateComponent, StandingUpDoAfterEvent>(OnStandingUpDoAfter);
SubscribeLocalEvent<StandingStateComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovementSpeed);
SubscribeLocalEvent<StandingStateComponent, TileFrictionEvent>(OnTileFriction);
SubscribeLocalEvent<StandingStateComponent, SlipAttemptEvent>(OnSlipAttempt);
InitializeColliding();
@@ -114,12 +110,6 @@ public abstract partial class SharedStandingStateSystem : EntitySystem
args.ModifySpeed(1f, 1f);
}
private void OnTileFriction(Entity<StandingStateComponent> ent, ref TileFrictionEvent args)
{
if (IsDown(ent))
args.Modifier *= SharedStunSystem.KnockDownModifier;
}
private void OnSlipAttempt(EntityUid uid, StandingStateComponent component, SlipAttemptEvent args)
{
if (IsDown(uid))
@@ -171,7 +161,7 @@ public abstract partial class SharedStandingStateSystem : EntitySystem
return true;
}
public enum DropHeldItemsBehavior
public enum DropHeldItemsBehavior : byte
{
NoDrop,
DropIfStanding,
@@ -222,9 +212,6 @@ public abstract partial class SharedStandingStateSystem : EntitySystem
if (TryComp(uid, out BuckleComponent? buckle) && buckle.Buckled && !_buckle.TryUnbuckle(uid, uid, buckleComp: buckle)) // WD EDIT
return false;
if (standingState.CurrentState is StandingState.Lying or StandingState.GettingUp)
return true;
// This is just to avoid most callers doing this manually saving boilerplate
// 99% of the time you'll want to drop items but in some scenarios (e.g. buckling) you don't want to.
// We do this BEFORE downing because something like buckle may be blocking downing but we want to drop hand items anyway
@@ -234,6 +221,9 @@ public abstract partial class SharedStandingStateSystem : EntitySystem
RaiseLocalEvent(uid, new DropHandItemsEvent());
}
if (standingState.CurrentState is StandingState.Lying or StandingState.GettingUp)
return true;
var msg = new DownAttemptEvent();
RaiseLocalEvent(uid, msg);

View File

@@ -107,7 +107,7 @@ public abstract class SharedStunSystem : EntitySystem
private void OnKnockInit(EntityUid uid, KnockedDownComponent component, ComponentInit args)
{
RaiseNetworkEvent(new CheckAutoGetUpEvent()); // WD EDIT
_standingState.Down(uid);
_standingState.TryLieDown(uid, null, SharedStandingStateSystem.DropHeldItemsBehavior.DropIfStanding);
}
private void OnKnockShutdown(EntityUid uid, KnockedDownComponent component, ComponentShutdown args)
@@ -207,6 +207,9 @@ public abstract class SharedStunSystem : EntitySystem
if (_statusEffect.HasStatusEffect(uid, "Stun"))
time = TimeSpan.FromSeconds(6);
if (_standingState.IsDown(uid)) // WD
RaiseLocalEvent(uid, new DropHandItemsEvent());
return TryKnockdown(uid, time, refresh, status) && TryStun(uid, time, refresh, status);
}

View File

@@ -129,7 +129,7 @@ public sealed partial class MeleeWeaponComponent : Component
/// Nearest edge range to hit an entity.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
public float Range = 1.2f;
public float Range = 1.5f;
/// <summary>
/// Total width of the angle for wide attacks.

View File

@@ -401,7 +401,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
if (lightTarget == null)
{
if (weapon.CanMiss)
if (weapon.CanMiss || session == null) // NPCs can miss
break;
return false;
}
@@ -512,11 +512,6 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
animation = miss && weapon.Animation == "WeaponArcThrust"
? weapon.MissAnimation
: weapon.Animation;
if (miss)
{
weapon.NextAttack -= fireRate / 2f;
weapon.NextMobAttack -= fireRate / 2f;
}
// WD EDIT END
break;
case DisarmAttackEvent disarm:

View File

@@ -1,4 +1,5 @@
using Content.Shared.Inventory;
using Content.Shared.Standing;
using Content.Shared.Stunnable;
namespace Content.Shared._White.BuffedFlashGrenade;
@@ -38,9 +39,12 @@ public sealed class FlashSoundSuppressionSystem : EntitySystem
if (distance > range)
return;
var knockdownTime = float.Lerp(knockdownDuration, 0f, distance / range);
if (knockdownTime > 0f)
_stunSystem.TryKnockdown(target, TimeSpan.FromSeconds(knockdownTime), true);
if (TryComp<StandingStateComponent>(target, out var standingState) && standingState.CanLieDown)
{
var knockdownTime = float.Lerp(knockdownDuration, 0f, distance / range);
if (knockdownTime > 0f)
_stunSystem.TryKnockdown(target, TimeSpan.FromSeconds(knockdownTime), true);
}
var stunTime = float.Lerp(stunDuration, 0f, distance / range);
if (stunTime > 0f)

View File

@@ -6,8 +6,16 @@ using Robust.Shared.Serialization;
namespace Content.Shared._White.Cult.Actions;
[Serializable, NetSerializable]
public sealed partial class ShacklesEvent : SimpleDoAfterEvent
public sealed partial class ShacklesEvent : DoAfterEvent
{
public string? Speech;
public ShacklesEvent(string? speech)
{
Speech = speech;
}
public override DoAfterEvent Clone() => this;
}
[Serializable, NetSerializable]

View File

@@ -49,7 +49,7 @@ public sealed class BloodSpearSystem : EntitySystem
if (!_holy.IsHoldingHolyWeapon(args.Target))
{
if(!_stunSystem.TryParalyze(args.Target, TimeSpan.FromSeconds(4), true, status))
if(!_stunSystem.TryParalyze(args.Target, TimeSpan.FromSeconds(5), true, status))
return;
}

View File

@@ -1,7 +1,7 @@
namespace Content.Shared._White.Item.Telebaton;
namespace Content.Shared._White.Item.TelescopicBaton;
[RegisterComponent]
public sealed partial class TelebatonComponent : Component
public sealed partial class TelescopicBatonComponent : Component
{
[DataField, ViewVariables(VVAccess.ReadWrite)]
public TimeSpan KnockdownTime = TimeSpan.FromSeconds(1.5f);

View File

@@ -5,9 +5,9 @@ using Content.Shared.Item.ItemToggle;
using Content.Shared.Item.ItemToggle.Components;
using Content.Shared.Stunnable;
namespace Content.Shared._White.Item.Telebaton;
namespace Content.Shared._White.Item.TelescopicBaton;
public sealed class TelebatonSystem : EntitySystem
public sealed class TelescopicBatonSystem : EntitySystem
{
[Dependency] private readonly SharedItemSystem _item = default!;
[Dependency] private readonly SharedStunSystem _stun = default!;
@@ -17,13 +17,13 @@ public sealed class TelebatonSystem : EntitySystem
{
base.Initialize();
SubscribeLocalEvent<TelebatonComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<TelebatonComponent, StaminaDamageOnHitAttemptEvent>(OnStaminaHitAttempt);
SubscribeLocalEvent<TelebatonComponent, ItemToggledEvent>(ToggleDone);
SubscribeLocalEvent<TelebatonComponent, StaminaMeleeHitEvent>(OnHit);
SubscribeLocalEvent<TelescopicBatonComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<TelescopicBatonComponent, StaminaDamageOnHitAttemptEvent>(OnStaminaHitAttempt);
SubscribeLocalEvent<TelescopicBatonComponent, ItemToggledEvent>(ToggleDone);
SubscribeLocalEvent<TelescopicBatonComponent, StaminaMeleeHitEvent>(OnHit);
}
private void OnHit(Entity<TelebatonComponent> ent, ref StaminaMeleeHitEvent args)
private void OnHit(Entity<TelescopicBatonComponent> ent, ref StaminaMeleeHitEvent args)
{
var time = ent.Comp.KnockdownTime;
if (time <= TimeSpan.Zero)
@@ -35,13 +35,13 @@ public sealed class TelebatonSystem : EntitySystem
}
}
private void OnStaminaHitAttempt(Entity<TelebatonComponent> entity, ref StaminaDamageOnHitAttemptEvent args)
private void OnStaminaHitAttempt(Entity<TelescopicBatonComponent> entity, ref StaminaDamageOnHitAttemptEvent args)
{
if (!_itemToggle.IsActivated(entity.Owner))
args.Cancelled = true;
}
private void OnExamined(Entity<TelebatonComponent> entity, ref ExaminedEvent args)
private void OnExamined(Entity<TelescopicBatonComponent> entity, ref ExaminedEvent args)
{
var onMsg = _itemToggle.IsActivated(entity.Owner)
? Loc.GetString("comp-telebaton-examined-on")
@@ -49,7 +49,7 @@ public sealed class TelebatonSystem : EntitySystem
args.PushMarkup(onMsg);
}
private void ToggleDone(Entity<TelebatonComponent> entity, ref ItemToggledEvent args)
private void ToggleDone(Entity<TelescopicBatonComponent> entity, ref ItemToggledEvent args)
{
_item.SetHeldPrefix(entity.Owner, args.Activated ? "on" : "off");
}

View File

@@ -138,9 +138,9 @@ public sealed class WhiteCVars
public static readonly CVarDef<string> StalinAuthUrl =
CVarDef.Create("stalin.auth_url", string.Empty, CVar.SERVERONLY | CVar.CONFIDENTIAL | CVar.ARCHIVE);
public static readonly CVarDef<bool> StalinEnabled =
CVarDef.Create("stalin.enabled", false, CVar.SERVERONLY | CVar.ARCHIVE);
CVarDef.Create("stalin.enabled", true, CVar.SERVERONLY | CVar.ARCHIVE);
public static readonly CVarDef<float> StalinDiscordMinimumAge =
CVarDef.Create("stalin.minimal_discord_age_minutes", 1440.0f, CVar.SERVERONLY | CVar.ARCHIVE);
CVarDef.Create("stalin.minimal_discord_age_minutes", 10080.0f, CVar.SERVERONLY | CVar.ARCHIVE);
/*