Fixes & more (#548)

* - fix: Narsie not spawning, items not dropping on paralyze, cult tweaks.

* - fix: Diagonal grilles layer.

* - add: Cockroaches don't drop organs.

* - add: Magic hands now work on interact & disable context menu interaction.

* - fix: Shackles speech after doafter.

* - tweak: Reduce flashbang knockdown, check for CanLieDown.

* - tweak: Hspear limit.

* - tweak: Remove knockdown tile friction.

* - tweak: Engi belt in sus box.

* - fix: Constructs can hear cult chat.

* - fix: Desword audio.

* - fix: Context menu.

* - fix: Actually drop items on paralyze.

* - tweak: Revert range reduction.

* - add: Update thermal visibility.

* - add: NPCs can miss.

* - tweak: Update desc.

* - fix: Actually fix desword audio.

* - tweak: Secret weights & game presets.

* - fix: Cult stun.
This commit is contained in:
Aviu00
2024-08-03 15:23:46 +00:00
committed by GitHub
parent 7f7cb34c0c
commit d4525a91e6
33 changed files with 152 additions and 125 deletions

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;
}