-
Notifications
You must be signed in to change notification settings - Fork 475
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed merge conflic for adding basic machine linking to space artillery
- Loading branch information
Showing
3 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
Content.Server/SpaceArtillery/Components/SpaceArtilleryComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System.Threading; | ||
using Content.Shared.Construction.Prototypes; | ||
using Content.Shared.DeviceLinking; | ||
using Robust.Shared.GameStates; | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.Serialization; | ||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; | ||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; | ||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary; | ||
|
||
namespace Content.Server.SpaceArtillery; | ||
|
||
[RegisterComponent, NetworkedComponent] | ||
public sealed class SpaceArtilleryComponent : Component | ||
{ | ||
|
||
/// <summary> | ||
/// Signal port that makes space artillery fire. | ||
/// </summary> | ||
[DataField("firePort", customTypeSerializer: typeof(PrototypeIdSerializer<SinkPortPrototype>))] | ||
public string FirePort = "Fire"; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using Content.Server.Storage.EntitySystems; | ||
using Content.Shared.Containers.ItemSlots; | ||
using Content.Shared.Interaction; | ||
using Content.Shared.Interaction.Events; | ||
using Content.Server.PneumaticCannon; | ||
using Content.Shared.PneumaticCannon; | ||
using Content.Shared.Weapons.Ranged.Components; | ||
using Content.Shared.Weapons.Ranged.Systems; | ||
using Robust.Shared.Containers; | ||
|
||
namespace Content.Server.SpaceArtillery | ||
{ | ||
public sealed class SpaceArtillerySystem : EntitySystem | ||
{ | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<SpaceArtilleryComponent, InteractHandEvent>(OnInteractHand); | ||
//SubscribeLocalEvent<SpaceArtilleryComponent, GetVerbsEvent<Verb>>(OnGetVerb); | ||
} | ||
|
||
//Idea is that when interacted, the artillery will call attempt at firing as if it was held. Will probably need to think of better way to activate it, like with linkables | ||
private void OnInteractHand(EntityUid uid, SpaceArtilleryComponent component, InteractHandEvent args) | ||
{ | ||
if (args.Handled) | ||
return; | ||
|
||
var attemptEv = new AttemptShootEvent(uid, null); | ||
RaiseLocalEvent(uid, attemptEv); | ||
} | ||
|
||
|
||
// private void Fire(EntityUid uid, EmitterComponent component) | ||
// { | ||
// if (!TryComp<GunComponent>(uid, out var gunComponent)) | ||
// return; | ||
// | ||
// var xform = Transform(uid); | ||
// var ent = Spawn(component.BoltType, xform.Coordinates); | ||
// var proj = EnsureComp<ProjectileComponent>(ent); | ||
// _projectile.SetShooter(proj, uid); | ||
// | ||
// var targetPos = new EntityCoordinates(uid, new Vector2(0, -1)); | ||
// | ||
// _gun.Shoot(uid, gunComponent, ent, xform.Coordinates, targetPos, out _); | ||
// } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters