Adds bola and a crafting recipe for them. (#6185)
This commit is contained in:
@@ -6,6 +6,7 @@ using JetBrains.Annotations;
|
|||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Physics.Dynamics;
|
using Robust.Shared.Physics.Dynamics;
|
||||||
|
using Content.Shared.Throwing;
|
||||||
|
|
||||||
namespace Content.Server.Stunnable
|
namespace Content.Server.Stunnable
|
||||||
{
|
{
|
||||||
@@ -18,28 +19,37 @@ namespace Content.Server.Stunnable
|
|||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
SubscribeLocalEvent<StunOnCollideComponent, StartCollideEvent>(HandleCollide);
|
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;
|
StandingStateComponent? standingState = null;
|
||||||
AppearanceComponent? appearance = null;
|
AppearanceComponent? appearance = null;
|
||||||
|
|
||||||
// Let the actual methods log errors for these.
|
// 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);
|
status);
|
||||||
|
|
||||||
_stunSystem.TrySlowdown(otherUid, TimeSpan.FromSeconds(component.SlowdownAmount), true,
|
_stunSystem.TrySlowdown(target, TimeSpan.FromSeconds(component.SlowdownAmount), true,
|
||||||
component.WalkSpeedMultiplier, component.RunSpeedMultiplier, status);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
Resources/Audio/Effects/snap.ogg
Normal file
BIN
Resources/Audio/Effects/snap.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Weapons/bolathrow.ogg
Normal file
BIN
Resources/Audio/Weapons/bolathrow.ogg
Normal file
Binary file not shown.
@@ -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
|
||||||
@@ -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
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
- type: construction
|
- type: construction
|
||||||
name: crude spear
|
name: crude spear
|
||||||
id: spear
|
id: spear
|
||||||
graph: spear
|
graph: spear
|
||||||
@@ -8,3 +8,14 @@
|
|||||||
description: A crude spear for when you need to put holes in somebody.
|
description: A crude spear for when you need to put holes in somebody.
|
||||||
icon: Objects/Weapons/Melee/spear.rsi/spear.png
|
icon: Objects/Weapons/Melee/spear.rsi/spear.png
|
||||||
objectType: Item
|
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
|
||||||
|
|||||||
BIN
Resources/Textures/Objects/Weapons/Throwable/bola.rsi/icon.png
Normal file
BIN
Resources/Textures/Objects/Weapons/Throwable/bola.rsi/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 225 B |
@@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user