Adds bola and a crafting recipe for them. (#6185)

This commit is contained in:
keronshb
2022-01-17 14:21:57 -05:00
committed by GitHub
parent 8f51cc3344
commit 2a70ba88f7
8 changed files with 84 additions and 8 deletions

View File

@@ -6,6 +6,7 @@ using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Physics.Dynamics;
using Content.Shared.Throwing;
namespace Content.Server.Stunnable
{
@@ -18,28 +19,37 @@ namespace Content.Server.Stunnable
{
base.Initialize();
SubscribeLocalEvent<StunOnCollideComponent, StartCollideEvent>(HandleCollide);
SubscribeLocalEvent<StunOnCollideComponent, ThrowDoHitEvent>(HandleThrow);
}
private void HandleCollide(EntityUid uid, StunOnCollideComponent component, StartCollideEvent args)
private void TryDoCollideStun(EntityUid uid, StunOnCollideComponent component, EntityUid target)
{
var otherUid = args.OtherFixture.Body.Owner;
if (EntityManager.TryGetComponent<StatusEffectsComponent>(otherUid, out var status))
if (EntityManager.TryGetComponent<StatusEffectsComponent>(target, out var status))
{
StandingStateComponent? standingState = null;
AppearanceComponent? appearance = null;
// Let the actual methods log errors for these.
Resolve(otherUid, ref standingState, ref appearance, false);
Resolve(target, ref standingState, ref appearance, false);
_stunSystem.TryStun(otherUid, TimeSpan.FromSeconds(component.StunAmount), true, status);
_stunSystem.TryStun(target, TimeSpan.FromSeconds(component.StunAmount), true, status);
_stunSystem.TryKnockdown(otherUid, TimeSpan.FromSeconds(component.KnockdownAmount), true,
_stunSystem.TryKnockdown(target, TimeSpan.FromSeconds(component.KnockdownAmount), true,
status);
_stunSystem.TrySlowdown(otherUid, TimeSpan.FromSeconds(component.SlowdownAmount), true,
_stunSystem.TrySlowdown(target, TimeSpan.FromSeconds(component.SlowdownAmount), true,
component.WalkSpeedMultiplier, component.RunSpeedMultiplier, status);
}
}
private void HandleCollide(EntityUid uid, StunOnCollideComponent component, StartCollideEvent args)
{
TryDoCollideStun(uid, component, args.OtherFixture.Body.Owner);
}
private void HandleThrow(EntityUid uid, StunOnCollideComponent component, ThrowDoHitEvent args)
{
TryDoCollideStun(uid, component, args.Target);
}
}
}

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,21 @@
- type: entity
name: bola
parent: BaseItem
id: Bola
description: Linked together with some spare cuffs and metal.
components:
- type: Item
size: 20
- type: Sprite
sprite: Objects/Weapons/Throwable/bola.rsi
state: icon
- type: EmitSoundOnThrow
sound: /Audio/Weapons/bolathrow.ogg
- type: EmitSoundOnLand
sound: /Audio/Effects/snap.ogg
- type: StunOnCollide
stunAmount: 1
knockdownAmount: 3
- type: Construction
graph: bola
node: bola

View File

@@ -0,0 +1,20 @@
- type: constructionGraph
id: bola
start: start
graph:
- node: start
edges:
- to: bola
steps:
- tag: Handcuffs
icon:
sprite: Objects/Misc/cablecuffs.rsi
state: cuff
color: red
name: cuffs
- material: Steel
amount: 6
doAfter: 2
- node: bola
entity: Bola

View File

@@ -1,4 +1,4 @@
- type: construction
- type: construction
name: crude spear
id: spear
graph: spear
@@ -8,3 +8,14 @@
description: A crude spear for when you need to put holes in somebody.
icon: Objects/Weapons/Melee/spear.rsi/spear.png
objectType: Item
- type: construction
name: makeshift bola
id: bola
graph: bola
startNode: start
targetNode: bola
category: Weapons
description: A simple weapon for tripping someone at a distance.
icon: Objects/Weapons/Throwable/bola.rsi/icon.png
objectType: Item

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

View File

@@ -0,0 +1,14 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from Citadel Station at https://github.com/Citadel-Station-13/Citadel-Station-13/commit/3cfea7eb92246d311de8b531347795bc76d6dab6",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "icon"
}
]
}