Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Spatison committed Oct 5, 2024
1 parent 7cefc75 commit 0717f11
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 16 deletions.
23 changes: 14 additions & 9 deletions Content.Server/Projectiles/ProjectileSystem.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Content.Server.Administration.Logs;
using Content.Server.Effects;
using Content.Server.Hands.Systems;
using Content.Server.UserInterface;
using Content.Server.Weapons.Ranged.Systems;
using Content.Shared._White.Penetrated;
using Content.Shared._White.Projectile;
Expand All @@ -26,20 +27,24 @@ public sealed class ProjectileSystem : SharedProjectileSystem
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly GunSystem _guns = default!;
[Dependency] private readonly SharedCameraRecoilSystem _sharedCameraRecoil = default!;
[Dependency] private readonly DamageableSystem _damageable = default!; // WD EDIT
[Dependency] private readonly HandsSystem _hands = default!; // WD EDIT
[Dependency] private readonly PhysicsSystem _physics = default!; // WD EDIT
[Dependency] private readonly SharedTransformSystem _transform = default!; // WD EDIT
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!; // WD EDIT
[Dependency] private readonly PenetratedSystem _penetrated = default!; // WD EDIT
// WD EDIT START
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly HandsSystem _hands = default!;
[Dependency] private readonly PhysicsSystem _physics = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly PenetratedSystem _penetrated = default!;
// WD EDIT END

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ProjectileComponent, StartCollideEvent>(OnStartCollide);
SubscribeLocalEvent<EmbeddableProjectileComponent, EmbedEvent>(OnEmbed); // WD EDIT
SubscribeLocalEvent<EmbeddableProjectileComponent, ActivateInWorldEvent>(OnEmbedActivate); // WD EDIT
SubscribeLocalEvent<EmbeddableProjectileComponent, RemoveEmbeddedProjectileEvent>(OnEmbedRemove); // WD EDIT
// WD EDIT START
SubscribeLocalEvent<EmbeddableProjectileComponent, EmbedEvent>(OnEmbed);
SubscribeLocalEvent<EmbeddableProjectileComponent, ActivateInWorldEvent>(OnEmbedActivate, before: new[] {typeof(ActivatableUISystem)});
SubscribeLocalEvent<EmbeddableProjectileComponent, RemoveEmbeddedProjectileEvent>(OnEmbedRemove);
// WD EDIT END
}

private void OnStartCollide(EntityUid uid, ProjectileComponent component, ref StartCollideEvent args)
Expand Down
4 changes: 1 addition & 3 deletions Content.Server/UserInterface/ActivatableUISystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Content.Server.Administration.Managers;
using Content.Server.Projectiles;
using Content.Shared.ActionBlocker;
using Content.Shared.Ghost;
using Content.Shared.Hands;
Expand All @@ -25,7 +24,7 @@ public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<ActivatableUIComponent, ActivateInWorldEvent>(OnActivate, after: new[] {typeof(ProjectileSystem)});
SubscribeLocalEvent<ActivatableUIComponent, ActivateInWorldEvent>(OnActivate);
SubscribeLocalEvent<ActivatableUIComponent, UseInHandEvent>(OnUseInHand);
SubscribeLocalEvent<ActivatableUIComponent, InteractUsingEvent>(OnInteractUsing);
SubscribeLocalEvent<ActivatableUIComponent, HandDeselectedEvent>(OnHandDeselected);
Expand Down Expand Up @@ -88,7 +87,6 @@ private void AddOpenUiVerb(EntityUid uid, ActivatableUIComponent component, GetV

private void OnActivate(EntityUid uid, ActivatableUIComponent component, ActivateInWorldEvent args)
{
Log.Error("2");
if (args.Handled)
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Content.Server.Weapons.Ranged.Systems;

public sealed partial class GunSystem
{
[Dependency] private readonly StackSystem _stack = default!;
[Dependency] private readonly StackSystem _stack = default!; // WD EDIT

protected override void Cycle(EntityUid uid, BallisticAmmoProviderComponent component, MapCoordinates coordinates)
{
Expand Down
3 changes: 2 additions & 1 deletion Content.Shared/Projectiles/SharedProjectileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public record struct ProjectileReflectAttemptEvent(EntityUid ProjUid, Projectile
[ByRefEvent]
public record struct ProjectileHitEvent(DamageSpecifier Damage, EntityUid Target, EntityUid? Shooter = null);


// WD EDIT START
[Serializable, NetSerializable]
public sealed partial class RemoveEmbeddedProjectileEvent : DoAfterEvent
{
Expand All @@ -163,3 +163,4 @@ public override DoAfterEvent Clone()
return this;
}
}
// WD EDIT END
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public void UpdateBallisticAppearance(EntityUid uid, BallisticAmmoProviderCompon

var count = GetBallisticShots(component); // WD EDIT

Appearance.SetData(uid, AmmoVisuals.AmmoCount, count, appearance);
Appearance.SetData(uid, AmmoVisuals.AmmoCount, count, appearance); // WD EDIT
Appearance.SetData(uid, AmmoVisuals.AmmoMax, component.Capacity, appearance);
Appearance.SetData(uid, AmmoVisuals.HasAmmo, count != 0, appearance); // WD EDIT
}
Expand Down
4 changes: 3 additions & 1 deletion Resources/Prototypes/Entities/Objects/Materials/parts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
- type: ShortConstruction
prototypes:
- Grille
- type: Tag # WD EDIT
# WD EDIT START
- type: Tag
tags:
- CrossbowBolt
- type: EmbeddableProjectile
Expand All @@ -90,6 +91,7 @@
damage:
types:
Piercing: 15
# WD EDIT END

- type: entity
parent: PartRodMetal
Expand Down

0 comments on commit 0717f11

Please sign in to comment.