Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 0584515
Author: Fragoler <e.f.oleg@mail.ru>
Date:   Wed Aug 14 19:40:20 2024 +0300

    add-useByNPC

commit 7aef332
Author: Fragoler <e.f.oleg@mail.ru>
Date:   Mon Aug 12 10:52:10 2024 +0300

    Move to secrets

    # Conflicts:
    #	Resources/Prototypes/Exodus/Entities/Effects/Lavaland/pandora.yml

commit 5ac4a00
Author: Fragoler <e.f.oleg@mail.ru>
Date:   Mon Aug 5 01:56:55 2024 +0300

    Update fly

commit 705e4b2
Author: Fragoler <e.f.oleg@mail.ru>
Date:   Thu Aug 1 09:02:19 2024 +0300

    Flying base

    commit 22fdb5a
    Author: Fragoler <e.f.oleg@mail.ru>
    Date:   Mon Jul 15 15:33:16 2024 +0300

        1.7

    commit 2be2e92
    Author: Fragoler <e.f.oleg@mail.ru>
    Date:   Sat Jul 13 16:43:52 2024 +0300

        1.7

    commit 0d68f2f
    Author: Fragoler <e.f.oleg@mail.ru>
    Date:   Sat Jul 13 14:05:59 2024 +0300

        1.5

    commit 731aae1
    Author: Fragoler <e.f.oleg@mail.ru>
    Date:   Sat Jul 13 13:16:13 2024 +0300

        1.5

    commit eea9ca4
    Author: Fragoler <e.f.oleg@mail.ru>
    Date:   Sat Jul 13 10:14:26 2024 +0300

        1.4

    commit 220f649
    Author: Fragoler <e.f.oleg@mail.ru>
    Date:   Thu Jul 11 14:26:11 2024 +0300

        1.3

    commit d76b4a4
    Author: Fragoler <e.f.oleg@mail.ru>
    Date:   Thu Jul 11 01:41:14 2024 +0300

        1.2

    commit 7168ec0
    Author: Fragoler <e.f.oleg@mail.ru>
    Date:   Thu Jul 11 00:10:06 2024 +0300

        1.1
  • Loading branch information
Fragoler committed Sep 23, 2024
1 parent 94fe076 commit 1be3e1d
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Content.Server/NPC/Systems/NPCCombatSystrem.Ability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PhysicsComponent> physicsQuery, EntityQuery<TransformComponent> xformQuery)
private void CastActions(EntityUid uid, NPCAbilityCombatComponent combatComp, TimeSpan curTime, EntityQuery<PhysicsComponent> physicsQuery, EntityQuery<TransformComponent> xformQuery)
{
combatComp.Status = AbilityCombatStatus.Normal;

Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions Content.Shared/Actions/BaseActionComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
7 changes: 7 additions & 0 deletions Content.Shared/Movement/Events/FootstepsSoundAttemtEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Content.Shared.Movement.Events
{
public sealed class FootstepsSoundAttemtEvent(EntityUid uid) : CancellableEntityEventArgs
{
public EntityUid Uid { get; } = uid;
}
}
9 changes: 6 additions & 3 deletions Content.Shared/Movement/Systems/SharedMoverController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,13 @@ private bool TryGetSound(
if (!CanSound() || !_tags.HasTag(uid, "FootstepSound"))
return false;

// Exodus-Crawling-Start
if (TryComp<StandingStateComponent>(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
Expand Down
13 changes: 11 additions & 2 deletions Content.Shared/Standing/StandingStateSystem.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand All @@ -34,6 +32,7 @@ public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<StandingStateComponent, FootstepsSoundAttemtEvent>(OnFootstepsSound);
SubscribeLocalEvent<StandingStateComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovementSpeedModifiersEvent);
SubscribeLocalEvent<StandingStateComponent, DownDoAfterEvent>(OnDownDoAfterEvent);
SubscribeLocalEvent<StandingStateComponent, StandDoAfterEvent>(OnStandDoAfterEvent);
Expand All @@ -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))
Expand Down

0 comments on commit 1be3e1d

Please sign in to comment.