Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024 12 06 hostile ai on grid suggestions #2524

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions Content.Server/NPC/HTN/HTNSystem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Linq;
using System.Text;
using System.Threading;
using Content.Server._NF.PacifiedZone;
using Content.Server.Administration.Managers;
using Robust.Shared.CPUJob.JobQueues;
using Robust.Shared.CPUJob.JobQueues.Queues;
Expand All @@ -16,15 +15,13 @@
using Robust.Shared.Utility;
using Content.Server.Worldgen; // Frontier
using Content.Server.Worldgen.Components; // Frontier
using Content.Server.Worldgen.Systems;
using Content.Shared.Body.Systems;
using Content.Shared.Coordinates;
using Content.Shared.Gibbing.Systems;
using Content.Shared.NPC.Components;
using Content.Shared.NPC.Systems;
using Content.Shared.Popups;
using Content.Server.Worldgen.Systems; // Frontier
using Content.Shared.Body.Systems; // Frontier
using Content.Shared.NPC.Components; // Frontier
using Content.Shared.NPC.Systems; // Frontier
using Content.Shared.Popups; // Frontier
using Content.Shared.Tiles; // Frontier
using Robust.Server.GameObjects;
using Robust.Server.GameObjects; // Frontier
using Robust.Shared.Audio.Systems; // Frontier

namespace Content.Server.NPC.HTN;
Expand Down Expand Up @@ -85,7 +82,7 @@ private void OnLoad()
// Clear all NPCs in case they're hanging onto stale tasks
var query = AllEntityQuery<HTNComponent>();

while (query.MoveNext(out var comp)) // Frontier
while (query.MoveNext(out var comp))
{
comp.PlanningToken?.Cancel();
comp.PlanningToken = null;
Expand Down Expand Up @@ -172,7 +169,7 @@ public void UpdateNPC(ref int count, int maxUpdates, float frameTime)
_planQueue.Process();
var query = EntityQueryEnumerator<ActiveNPCComponent, HTNComponent>();

while(query.MoveNext(out var uid, out var activeNpcComponent, out var comp))
while(query.MoveNext(out var uid, out _, out var comp))
{
// If we're over our max count or it's not MapInit then ignore the NPC.
if (count >= maxUpdates)
Expand All @@ -198,6 +195,7 @@ public void UpdateNPC(ref int count, int maxUpdates, float frameTime)
}
continue;
}
// End Frontier: Disable hostile AI in pacified zones

if (comp.PlanningJob != null)
{
Expand Down
6 changes: 3 additions & 3 deletions Content.Shared/Tiles/ProtectedGridComponent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Audio; // Frontier

namespace Content.Shared.Tiles;

Expand All @@ -23,10 +23,10 @@ public sealed partial class ProtectedGridComponent : Component
[DataField]
public bool PreventArtifactTriggers = false;
[DataField]
public bool KillHostileMobs = true;
public bool KillHostileMobs = false;

/// <summary>
/// The sound made when spawning a coordinates disk
/// The sound made when a hostile mob is killed when entering a protected grid.
/// </summary>
[DataField]
public SoundSpecifier HostileMobKillSound = new SoundPathSpecifier("/Audio/Effects/holy.ogg");
Expand Down
1 change: 1 addition & 0 deletions Resources/Maps/_NF/Outpost/frontier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3968,6 +3968,7 @@ entities:
preventRCDUse: True
preventFloorPlacement: True
preventFloorRemoval: True
killHostileMobs: True
- type: SpreaderGrid
- type: IFF
readOnly: True
Expand Down
Loading