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

Space artillery #101

Closed
wants to merge 53 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
8000b29
Got basic space artillery structure working
Jul 27, 2023
552c37a
WIP Attempting at allowing the space artillery to be fired without ne…
Jul 28, 2023
330ac0d
Merge branch 'new-frontiers-14:master' into space-artillery
Qulibly Jul 28, 2023
2683a43
WIP further attempts at trying to get the firing of space artillery w…
Jul 29, 2023
cebb2a1
Merge branch 'new-frontiers-14:master' into space-artillery
Qulibly Jul 29, 2023
114279a
Merge branch 'space-artillery' of https://github.com/Qulibly/frontier…
Jul 29, 2023
713c131
Merge branch 'new-frontiers-14:master' into space-artillery
Qulibly Jul 30, 2023
35728bb
Laying groundwork for machine linking of space artillery
Jul 31, 2023
b04bb05
Fixed merge conflic for adding basic machine linking to space artillery
Jul 31, 2023
de549f3
remaking the space artillery system for firing
Jul 31, 2023
57e0f14
WIP fixing small things with system and component of space artillery
Aug 9, 2023
5e1f357
Fixed issue causing space artillery to break client
Aug 11, 2023
f2584dc
Creation of space artillery system and component structure
Aug 11, 2023
0795487
Added working firing mechanism for Space Artillery
Aug 18, 2023
fac9bff
Fixed Space Artillery's firing direction
Aug 22, 2023
1a5fcac
Added to Space Artillery code for mountable weapons as well as safety…
Aug 28, 2023
881594c
Fixed issue in space artillery causing all weapons to be fired at once
Aug 28, 2023
c1dbedb
Merge branch 'new-frontiers-14:master' into space-artillery
Qulibly Aug 28, 2023
8e243de
Fixing merge conflicts with space artillery
Sep 23, 2023
247a0f5
Merge branch 'master' into space-artillery
Qulibly Sep 23, 2023
82d6245
Space Artillery Fire action fixed. Power is WIP
Oct 13, 2023
f9b21e3
Space Artillery power foundation
Oct 20, 2023
751363f
Space Artillery adding things and fixing issues with power
Oct 21, 2023
fe90b7a
Space Artillery first weapon and projectile foundations
Oct 21, 2023
a9088b0
Merge branch 'new-frontiers-14:master' into space-artillery
Qulibly Oct 21, 2023
c61a643
Merge branch 'space-artillery' of https://github.com/Qulibly/frontier…
Qulibly Nov 11, 2023
c3ecb6e
Space Artillery adding railgun and sprites
Qulibly Nov 17, 2023
d1811c9
Merge branch 'new-frontiers-14:master' into space-artillery
Qulibly Nov 17, 2023
290a576
Space Artillery first coolant system foundations
Qulibly Nov 21, 2023
3492fe7
Space Artillery basic shuttle wide recoil system added, WIP
Qulibly Nov 23, 2023
0151d7f
Space Artillery basic recoil system to armament has been added
Qulibly Nov 24, 2023
8b0ee2d
Space Artillery added working space recoil system
Qulibly Dec 4, 2023
bbc582b
Space Artillery fixing power and coolant, fixes to space recoil
Qulibly Dec 6, 2023
65c7ed2
Merge branch 'new-frontiers-14:master' into space-artillery
Qulibly Dec 14, 2023
78bd4a1
Merge branch 'new-frontiers-14:master' into space-artillery
Qulibly Dec 25, 2023
5fd3a36
Space Artillery added basic velocity limiter for space recoil
Qulibly Dec 25, 2023
c011a91
Space Artillery projectiles updated first part
Qulibly Jan 2, 2024
974b49d
Merge branch 'new-frontiers-14:master' into space-artillery
Qulibly Jan 2, 2024
80f054a
Space Artillery added advanced signals and examination
Qulibly Jan 3, 2024
b99a493
Merge branch 'space-artillery' of https://github.com/Qulibly/frontier…
Qulibly Jan 3, 2024
0e91c59
Space Artillery ammunition rebalance
Qulibly Jan 5, 2024
185f2a9
Space Artillery ammunition fixup
Qulibly Jan 5, 2024
c3469cd
Space Artillery activation system WIP
Qulibly Feb 2, 2024
35efd84
Space Artillery booster velocity limiter tweaks
Qulibly Feb 4, 2024
2ae9ab8
Merge branch 'master' into space-artillery
Qulibly Feb 8, 2024
2880572
Merge branch 'new-frontiers-14:master' into space-artillery
Qulibly Feb 9, 2024
15e087a
Space Artillery basic Activation System framework with working Safezo…
Qulibly Feb 13, 2024
289f731
Space Artillery basic booster framework
Qulibly Feb 28, 2024
bc06717
Merge branch 'master' into space-artillery
Qulibly Feb 28, 2024
796bc4f
Merge branch 'new-frontiers-14:master' into space-artillery
Qulibly Mar 15, 2024
45235e9
Merge branch 'master' into space-artillery
Qulibly Apr 26, 2024
e28d604
Merge branch 'new-frontiers-14:master' into space-artillery
Qulibly May 9, 2024
51b65fb
Merge branch 'new-frontiers-14:master' into space-artillery
Qulibly Jun 12, 2024
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
Prev Previous commit
Next Next commit
Added working firing mechanism for Space Artillery
Qulibly committed Aug 18, 2023
commit 0795487662276843eb9d87a58da44c0658fc8ff2
46 changes: 43 additions & 3 deletions Content.Server/SpaceArtillery/SpaceArtillerySystem.cs
Original file line number Diff line number Diff line change
@@ -5,6 +5,12 @@
using Content.Shared.Weapons.Ranged.Systems;
using Content.Shared.Weapons.Ranged.Components;
using Content.Shared.Weapons.Ranged.Events;
using Content.Shared.Interaction.Events;
using System.Numerics;
using Content.Shared.CombatMode;
using Content.Shared.Interaction;
using Robust.Shared.Map;
using Robust.Shared.Physics.Components;

namespace Content.Shared.SpaceArtillery;

@@ -13,20 +19,54 @@ public sealed class SpaceArtillerySystem : EntitySystem

[Dependency] private readonly ProjectileSystem _projectile = default!;
[Dependency] private readonly GunSystem _gun = default!;
[Dependency] private readonly SharedCombatModeSystem _combat = default!;
[Dependency] private readonly RotateToFaceSystem _rotate = default!;

private const float ShootSpeed = 25f;

protected ISawmill Sawmill = default!;

public override void Initialize()
{
base.Initialize();

Sawmill = Logger.GetSawmill("SpaceArtillery");
SubscribeLocalEvent<SpaceArtilleryComponent, SignalReceivedEvent>(OnSignalReceived);
}

private void OnSignalReceived(EntityUid uid, SpaceArtilleryComponent component, ref SignalReceivedEvent args)
{
Sawmill.Info($"Space Artillery has been pinged. Entity: {ToPrettyString(uid)}");
if (args.Port == component.SpaceArtilleryFirePort)
{
//var attemptEv = new AttemptShootEvent(uid, null);
RaiseLocalEvent(uid, RequestShootEvent);
Sawmill.Info($"Space Artillery has received FIRE signal. Entity: {ToPrettyString(uid)}");
//var attemptEv = new AttemptShootEvent(uid, "text", false);
//RaiseLocalEvent(uid, ref attemptEv);
//var attemptEv = new UseInHandEvent(uid);
//RaiseLocalEvent(uid, attemptEv);
var bodyQuery = GetEntityQuery<PhysicsComponent>();
var xformQuery = GetEntityQuery<TransformComponent>();
var combatQuery = GetEntityQuery<CombatModeComponent>();
var query = EntityQueryEnumerator<SpaceArtilleryComponent, TransformComponent>();
while (query.MoveNext(out uid, out var comp, out var xform))
{
if (!_gun.TryGetGun(uid, out var gunUid, out var gun))
{
continue;
}

//var (worldPos, worldRot) = _transform.GetWorldPositionRotation(xform, xformQuery);
//var (targetPos, targetRot) = _transform.GetWorldPositionRotation(targetXform, xformQuery);
//var distance = (targetPos - worldPos).Length();
//var mapVelocity = targetBody.LinearVelocity;

//var targetSpot = targetPos + mapVelocity * distance / ShootSpeed;

EntityCoordinates targetCordinates;
targetCordinates = new EntityCoordinates(xform.MapUid!.Value, new Vector2(250, 75));

_gun.AttemptShoot(uid, gunUid, gun, targetCordinates);
}

}
}
}
5 changes: 4 additions & 1 deletion Resources/Prototypes/Entities/Structures/space_artillery.yml
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@
- type: Pullable
- type: Rotatable
rotateWhilePulling: false
rotateWhileAnchored: true
- type: Appearance
- type: Storage
capacity: 120
@@ -70,4 +71,6 @@
path: /Audio/Effects/thunk.ogg
soundEmpty:
path: /Audio/Items/hiss.ogg
- type: SpaceArtillery
- type: SpaceArtillery
- type: Actions
- type: CombatMode