mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
# Description I am trying to port over the AI turrets being implemented into wizden made by chromiumboy. It looks fantastic and would like to port this now and work on any issues that might show. --- # Original PRs https://github.com/space-wizards/space-station-14/issues/35223 https://github.com/space-wizards/space-station-14/pull/35025 https://github.com/space-wizards/space-station-14/pull/35031 https://github.com/space-wizards/space-station-14/pull/35058 https://github.com/space-wizards/space-station-14/pull/35123 https://github.com/space-wizards/space-station-14/pull/35149 https://github.com/space-wizards/space-station-14/pull/35235 https://github.com/space-wizards/space-station-14/pull/35236 --- # TODO - [x] Port all related PRs to EE. - [x] Patch any bugs with turrets or potential issues. - [x] Cleanup my shitcode or changes. --- # Changelog 🆑 - add: Added recharging sentry turrets, one is AI-based or the other is Sec can make. - add: The sentry turrets can be made after researching in T3 arsenal. The boards are made in the sec fab. - add: New ID permissions for borgs and minibots for higher turret options. - tweak: Turrets stop shooting after someone goes crit. --------- Co-authored-by: Nathaniel Adams <60526456+Nathaniel-Adams@users.noreply.github.com> (cherry picked from commit 209d0537401cbda448a03e910cca9a898c9d566f)
58 lines
1.6 KiB
C#
58 lines
1.6 KiB
C#
using System.Threading;
|
|
using Content.Server.NPC.Components;
|
|
|
|
namespace Content.Server.NPC.HTN;
|
|
|
|
[RegisterComponent]
|
|
public sealed partial class HTNComponent : NPCComponent
|
|
{
|
|
/// <summary>
|
|
/// The base task to use for planning
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite),
|
|
DataField("rootTask", required: true)]
|
|
public HTNCompoundTask RootTask = default!;
|
|
|
|
/// <summary>
|
|
/// Check any active services for our current plan. This is used to find new targets for example without changing our plan.
|
|
/// </summary>
|
|
[DataField("checkServices")]
|
|
public bool CheckServices = true;
|
|
|
|
/// <summary>
|
|
/// The NPC's current plan.
|
|
/// </summary>
|
|
[ViewVariables]
|
|
public HTNPlan? Plan;
|
|
|
|
/// <summary>
|
|
/// How long to wait after having planned to try planning again.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite), DataField("planCooldown")]
|
|
public float PlanCooldown = 0.45f;
|
|
|
|
/// <summary>
|
|
/// How much longer until we can try re-planning. This will happen even during update in case something changed.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
public float PlanAccumulator = 0f;
|
|
|
|
[ViewVariables]
|
|
public HTNPlanJob? PlanningJob = null;
|
|
|
|
[ViewVariables]
|
|
public CancellationTokenSource? PlanningToken = null;
|
|
|
|
/// <summary>
|
|
/// Is this NPC currently planning?
|
|
/// </summary>
|
|
[ViewVariables] public bool Planning => PlanningJob != null;
|
|
|
|
|
|
/// <summary>
|
|
/// Determines whether plans should be made / updated for this entity
|
|
/// </summary>
|
|
[DataField]
|
|
public bool Enabled = true;
|
|
}
|