Skip to content

Commit

Permalink
Done
Browse files Browse the repository at this point in the history
  • Loading branch information
FireNameFN committed Dec 26, 2024
1 parent 966ceb6 commit f7608b5
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace Content.Shared._CorvaxNext.TurretControl.Components;

[RegisterComponent]
public sealed partial class TurretControllableComponent : Component;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace Content.Shared._CorvaxNext.TurretControl.Components;

[RegisterComponent]
public sealed partial class TurretControllerComponent : Component;

This file was deleted.

12 changes: 4 additions & 8 deletions Content.Shared/_CorvaxNext/TurretControl/TurretControlSystem.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
using Content.Shared._CorvaxNext.TurretControl.Components;
using Content.Shared.NPC.Components;
using Content.Shared.NPC.Prototypes;
using Content.Shared.NPC.Systems;
using Content.Shared.Tag;
using Content.Shared.Verbs;

namespace Content.Shared._CorvaxNext.TurretControl;

public sealed class TurretControlSystem : EntitySystem
{
[Dependency] private readonly NpcFactionSystem _faction = default!;
[Dependency] private readonly TagSystem _tag = default!;

[ValidatePrototypeId<TagPrototype>]
private const string ControlTag = "StationAi";

[ValidatePrototypeId<NpcFactionPrototype>]
private const string Passive = "TurretPassive";
Expand All @@ -25,12 +21,12 @@ public sealed class TurretControlSystem : EntitySystem

public override void Initialize()
{
SubscribeLocalEvent<TurretControlComponent, GetVerbsEvent<Verb>>(OnGetVerbs);
SubscribeLocalEvent<TurretControllableComponent, GetVerbsEvent<Verb>>(OnGetVerbs);
}

private void OnGetVerbs(Entity<TurretControlComponent> entity, ref GetVerbsEvent<Verb> e)
private void OnGetVerbs(Entity<TurretControllableComponent> entity, ref GetVerbsEvent<Verb> e)
{
if (!_tag.HasTag(e.User, ControlTag))
if (!HasComp<TurretControllerComponent>(e.User))
return;

if (!TryComp<NpcFactionMemberComponent>(entity, out var factionMember))
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
- type: MovementSpeedModifier
baseWalkSpeed: 30
# Corvax-End
- type: TurretController # Corvax-Next-TurretControl

- type: entity
id: ActionAGhostShowSolar
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Entities/Mobs/Player/silicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@
- type: Speech
speechVerb: Robotic
speechSounds: Borg
- type: TurretController # Corvax-Next-TurretControl
- type: Tag
tags:
- HideContextMenu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
- type: NpcFactionMember
factions:
- TurretPeace
- type: TurretControl
- type: TurretControllable

0 comments on commit f7608b5

Please sign in to comment.