Skip to content

Commit

Permalink
Fix some AI (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
FireNameFN authored Jan 1, 2025
1 parent 19c520b commit 5418be6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
using Robust.Shared.Prototypes;

namespace Content.Shared._CorvaxNext.TurretControl.Components;

[RegisterComponent]
public sealed partial class TurretControllerComponent : Component;
public sealed partial class TurretControllerComponent : Component
{
[DataField]
public ComponentRegistry RequiredComponents = [];
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ public override void Initialize()

private void OnGetVerbs(Entity<TurretControllableComponent> entity, ref GetVerbsEvent<Verb> e)
{
if (!HasComp<TurretControllerComponent>(e.User))
if (!TryComp<TurretControllerComponent>(e.User, out var controller))
return;

foreach (var component in controller.RequiredComponents)
if (!HasComp(e.User, component.Value.Component.GetType()))
return;

if (!TryComp<NpcFactionMemberComponent>(entity, out var factionMember))
return;

Expand Down
2 changes: 2 additions & 0 deletions Resources/Prototypes/Entities/Mobs/Player/silicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@
speechVerb: Robotic
speechSounds: Borg
- type: TurretController # Corvax-Next-TurretControl
requiredComponents:
- type: StationAiHeld
- type: Tag
tags:
- HideContextMenu
Expand Down

0 comments on commit 5418be6

Please sign in to comment.