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

Roundstart Grappling Gun #31737

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 4 additions & 6 deletions Content.Client/Physics/JointVisualsOverlay.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System.Numerics;
using Content.Shared.Physics;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Shared.Enums;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Dynamics.Joints;

namespace Content.Client.Physics;

Expand All @@ -16,29 +15,28 @@ public sealed class JointVisualsOverlay : Overlay

private IEntityManager _entManager;

private HashSet<Joint> _drawn = new();

public JointVisualsOverlay(IEntityManager entManager)
{
_entManager = entManager;
}

protected override void Draw(in OverlayDrawArgs args)
{
_drawn.Clear();
var worldHandle = args.WorldHandle;

var spriteSystem = _entManager.System<SpriteSystem>();
var xformSystem = _entManager.System<SharedTransformSystem>();
var joints = _entManager.EntityQueryEnumerator<JointVisualsComponent, TransformComponent>();
var xformQuery = _entManager.GetEntityQuery<TransformComponent>();

args.DrawingHandle.SetTransform(Matrix3x2.Identity);

while (joints.MoveNext(out var visuals, out var xform))
{
if (xform.MapID != args.MapId)
continue;

var other = visuals.Target;
var other = _entManager.GetEntity(visuals.Target);

if (!xformQuery.TryGetComponent(other, out var otherXform))
continue;
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Physics/JointVisualsComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public sealed partial class JointVisualsComponent : Component
public SpriteSpecifier Sprite = default!;

[ViewVariables(VVAccess.ReadWrite), DataField("target"), AutoNetworkedField]
public EntityUid? Target;
public NetEntity? Target;

/// <summary>
/// Offset from Body A.
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Weapons/Misc/SharedGrapplingGunSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private void OnGrapplingShot(EntityUid uid, GrapplingGunComponent component, ref
var visuals = EnsureComp<JointVisualsComponent>(shotUid.Value);
visuals.Sprite = component.RopeSprite;
visuals.OffsetA = new Vector2(0f, 0.5f);
visuals.Target = uid;
visuals.Target = GetNetEntity(uid);
Dirty(shotUid.Value, visuals);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
FlashlightLantern: 2
HandheldGPSBasic: 2
RadioHandheld: 2
WeaponGrapplingGun: 2
WeaponProtoKineticAccelerator: 4
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@
weight: 0.5
- id: OxygenTankFilled
- id: WelderIndustrial
- id: WeaponGrapplingGun
- !type:GroupSelector
children:
- id: ClothingHeadHatWelding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@
- state: base
- state: base-unshaded
map: [ "unshaded" ]
shader: unshaded
visible: true
- type: UseDelay
delay: 1.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@
- WeaponLaserSvalinn
- WeaponProtoKineticAccelerator
- WeaponTetherGun
- WeaponGrapplingGun
- ClothingBackpackHolding
- ClothingBackpackSatchelHolding
- ClothingBackpackDuffelHolding
Expand Down
1 change: 0 additions & 1 deletion Resources/Prototypes/Research/industrial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
cost: 7500
recipeUnlocks:
- MiningDrill
- WeaponGrapplingGun
- BorgModuleMining
- BorgModuleGrapplingGun
- OreProcessorIndustrialMachineCircuitboard
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Sprited by discord emogarbage",
"copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/456cd10d94084c7c2574f628cf7ac9b67087ba26. Recolored, adjusted, and inhands created by EmoGarbage404",
"size": {
"x": 32,
"y": 32
Expand Down
Loading