From 1be3e1da48d71822c9242bc7d7b9b22e97c60bca Mon Sep 17 00:00:00 2001 From: Fragoler Date: Mon, 23 Sep 2024 13:18:09 +0300 Subject: [PATCH] Squashed commit of the following: commit 05845152f9b04c641d89cf57eb63c2fb978fa555 Author: Fragoler Date: Wed Aug 14 19:40:20 2024 +0300 add-useByNPC commit 7aef3320600b7a0243157f0d05acd621144281d0 Author: Fragoler Date: Mon Aug 12 10:52:10 2024 +0300 Move to secrets # Conflicts: # Resources/Prototypes/Exodus/Entities/Effects/Lavaland/pandora.yml commit 5ac4a0045d044c3f10c64fbae012fcab583c1997 Author: Fragoler Date: Mon Aug 5 01:56:55 2024 +0300 Update fly commit 705e4b2c8e09508069e1bd3388b8c426651f5029 Author: Fragoler Date: Thu Aug 1 09:02:19 2024 +0300 Flying base commit 22fdb5a4f55dcd995316680e6bcbbbe90802e79b Author: Fragoler Date: Mon Jul 15 15:33:16 2024 +0300 1.7 commit 2be2e924248772c84353a8a1fd642e115b63e343 Author: Fragoler Date: Sat Jul 13 16:43:52 2024 +0300 1.7 commit 0d68f2fa35d8dc685b9b5ec41fefd05b0fc698ad Author: Fragoler Date: Sat Jul 13 14:05:59 2024 +0300 1.5 commit 731aae18e8169c69951673f1d773ba3241be2c6a Author: Fragoler Date: Sat Jul 13 13:16:13 2024 +0300 1.5 commit eea9ca42246278f671fdad650ad7b13a1b67a93c Author: Fragoler Date: Sat Jul 13 10:14:26 2024 +0300 1.4 commit 220f64955132b80d3c34caf1657348403279aa5e Author: Fragoler Date: Thu Jul 11 14:26:11 2024 +0300 1.3 commit d76b4a427f58fb41faa1862ea0556d50a8d7c0fe Author: Fragoler Date: Thu Jul 11 01:41:14 2024 +0300 1.2 commit 7168ec0538a2adf09dc6d9b0d5070bc1d556311f Author: Fragoler Date: Thu Jul 11 00:10:06 2024 +0300 1.1 --- .../NPC/Systems/NPCCombatSystrem.Ability.cs | 6 +++--- Content.Shared/Actions/BaseActionComponent.cs | 5 +++-- .../Movement/Events/FootstepsSoundAttemtEvent.cs | 7 +++++++ .../Movement/Systems/SharedMoverController.cs | 9 ++++++--- Content.Shared/Standing/StandingStateSystem.cs | 13 +++++++++++-- 5 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 Content.Shared/Movement/Events/FootstepsSoundAttemtEvent.cs diff --git a/Content.Server/NPC/Systems/NPCCombatSystrem.Ability.cs b/Content.Server/NPC/Systems/NPCCombatSystrem.Ability.cs index f1d12353ac..e99cca2396 100644 --- a/Content.Server/NPC/Systems/NPCCombatSystrem.Ability.cs +++ b/Content.Server/NPC/Systems/NPCCombatSystrem.Ability.cs @@ -45,11 +45,11 @@ private void UpdateAbility(float frameTime) while (query.MoveNext(out var uid, out var comp, out _)) { - CastAction(uid, comp, curTime, physicsQuery, xformQuery); + CastActions(uid, comp, curTime, physicsQuery, xformQuery); } } - private void CastAction(EntityUid uid, NPCAbilityCombatComponent combatComp, TimeSpan curTime, EntityQuery physicsQuery, EntityQuery xformQuery) + private void CastActions(EntityUid uid, NPCAbilityCombatComponent combatComp, TimeSpan curTime, EntityQuery physicsQuery, EntityQuery xformQuery) { combatComp.Status = AbilityCombatStatus.Normal; @@ -129,7 +129,7 @@ private bool TryUseAction(EntityUid uid, if (!_actions.TryGetActionData(actionUid, out var action)) return false; - if (!action.Enabled) + if (!action.Enabled || !action.UsableByNPC) return false; // check for action use prevention diff --git a/Content.Shared/Actions/BaseActionComponent.cs b/Content.Shared/Actions/BaseActionComponent.cs index 768524d7c2..b89315cbae 100644 --- a/Content.Shared/Actions/BaseActionComponent.cs +++ b/Content.Shared/Actions/BaseActionComponent.cs @@ -173,8 +173,9 @@ public EntityUid? EntityIcon [DataField("sound")] public SoundSpecifier? Sound; // Exodus-Lavaland-Start - [DataField("maxUseRange")] public float MaxAIUseRange = float.PositiveInfinity; - [DataField("minUseRange")] public float MinAIUseRange = 0; + [DataField("maxAIUseRange")] public float MaxAIUseRange = float.PositiveInfinity; + [DataField("minAIUseRange")] public float MinAIUseRange = 0; + [DataField("useByNPC")] public bool UsableByNPC = true; // Exodus-Lavaland-End } diff --git a/Content.Shared/Movement/Events/FootstepsSoundAttemtEvent.cs b/Content.Shared/Movement/Events/FootstepsSoundAttemtEvent.cs new file mode 100644 index 0000000000..6ecc39ba2a --- /dev/null +++ b/Content.Shared/Movement/Events/FootstepsSoundAttemtEvent.cs @@ -0,0 +1,7 @@ +namespace Content.Shared.Movement.Events +{ + public sealed class FootstepsSoundAttemtEvent(EntityUid uid) : CancellableEntityEventArgs + { + public EntityUid Uid { get; } = uid; + } +} diff --git a/Content.Shared/Movement/Systems/SharedMoverController.cs b/Content.Shared/Movement/Systems/SharedMoverController.cs index bbc00d0b86..b7af84b27a 100644 --- a/Content.Shared/Movement/Systems/SharedMoverController.cs +++ b/Content.Shared/Movement/Systems/SharedMoverController.cs @@ -405,10 +405,13 @@ private bool TryGetSound( if (!CanSound() || !_tags.HasTag(uid, "FootstepSound")) return false; - // Exodus-Crawling-Start - if (TryComp(uid, out var standing) && !standing.Standing) + // Exodus-Crawling-And-Flying-Start + var ev = new FootstepsSoundAttemtEvent(uid); + RaiseLocalEvent(uid, ev); + + if (ev.Cancelled) return false; - // Exodus-Crawling-End + // Exodus-Crawling-And-Flying-End var coordinates = xform.Coordinates; var distanceNeeded = mover.Sprinting diff --git a/Content.Shared/Standing/StandingStateSystem.cs b/Content.Shared/Standing/StandingStateSystem.cs index 8d95e126ba..cc733a580e 100644 --- a/Content.Shared/Standing/StandingStateSystem.cs +++ b/Content.Shared/Standing/StandingStateSystem.cs @@ -1,5 +1,4 @@ using Content.Shared.ActionBlocker; -using Content.Shared.Cuffs; using Content.Shared.DoAfter; using Content.Shared.Hands.Components; using Content.Shared.Movement.Components; @@ -8,7 +7,6 @@ using Content.Shared.Movement.Pulling.Systems; using Content.Shared.Movement.Systems; using Content.Shared.Physics; -using Content.Shared.Pulling; using Content.Shared.Rotation; using Robust.Shared.Audio.Systems; using Robust.Shared.Physics; @@ -34,6 +32,7 @@ public override void Initialize() { base.Initialize(); + SubscribeLocalEvent(OnFootstepsSound); SubscribeLocalEvent(OnRefreshMovementSpeedModifiersEvent); SubscribeLocalEvent(OnDownDoAfterEvent); SubscribeLocalEvent(OnStandDoAfterEvent); @@ -43,6 +42,16 @@ public override void Initialize() } // Exodus-Crawling-End + // Exodus-Crawling-Start + private void OnFootstepsSound(EntityUid uid, StandingStateComponent component, FootstepsSoundAttemtEvent ev) + { + if (!component.Standing) + return; + + ev.Cancel(); + } + // Exodus-Crawling-End + public bool IsDown(EntityUid uid, StandingStateComponent? standingState = null) { if (!Resolve(uid, ref standingState, false))