Merge branch 'master' into replace-sounds-with-sound-specifier
# Conflicts: # Content.Server/Actions/Actions/DisarmAction.cs # Content.Server/Actions/Actions/ScreamAction.cs # Content.Server/Arcade/Components/SpaceVillainArcadeComponent.cs # Content.Server/Damage/Components/DamageOnHighSpeedImpactComponent.cs # Content.Server/Explosion/Components/FlashExplosiveComponent.cs # Content.Server/Physics/Controllers/MoverController.cs # Content.Server/Portal/Components/PortalComponent.cs # Content.Server/Portal/Components/TeleporterComponent.cs # Content.Server/Projectiles/Components/ProjectileComponent.cs # Content.Server/Singularity/Components/EmitterComponent.cs # Content.Server/Sound/EmitSoundSystem.cs # Content.Server/Stunnable/Components/StunbatonComponent.cs # Content.Server/Tools/Components/MultitoolComponent.cs # Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs # Content.Shared/Gravity/GravityComponent.cs # Content.Shared/Light/Component/SharedExpendableLightComponent.cs # Content.Shared/Maps/ContentTileDefinition.cs # Content.Shared/Slippery/SlipperyComponent.cs # Content.Shared/Standing/StandingStateComponent.cs # Resources/Prototypes/Entities/Objects/Fun/bike_horn.yml
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
namespace Content.Server.Stunnable.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds stun when it collides with an entity
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
internal sealed class StunOnCollideComponent : Component
|
||||
{
|
||||
// TODO: Can probably predict this.
|
||||
public override string Name => "StunOnCollide";
|
||||
|
||||
// See stunnable for what these do
|
||||
[DataField("stunAmount")]
|
||||
internal int StunAmount = default;
|
||||
[DataField("knockdownAmount")]
|
||||
internal int KnockdownAmount = default;
|
||||
[DataField("slowdownAmount")]
|
||||
internal int SlowdownAmount = default;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
#nullable enable
|
||||
using Content.Shared.Sound;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#nullable enable
|
||||
using Content.Server.Act;
|
||||
using Content.Server.Notification;
|
||||
using Content.Shared.Audio;
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
using Content.Server.Projectiles.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Physics.Collision;
|
||||
using Robust.Shared.Physics.Dynamics;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
namespace Content.Server.Stunnable.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds stun when it collides with an entity
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class StunnableProjectileComponent : Component, IStartCollide
|
||||
{
|
||||
public override string Name => "StunnableProjectile";
|
||||
|
||||
// See stunnable for what these do
|
||||
[DataField("stunAmount")]
|
||||
private int _stunAmount = default;
|
||||
[DataField("knockdownAmount")]
|
||||
private int _knockdownAmount = default;
|
||||
[DataField("slowdownAmount")]
|
||||
private int _slowdownAmount = default;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
Owner.EnsureComponentWarn(out ProjectileComponent _);
|
||||
}
|
||||
|
||||
void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold)
|
||||
{
|
||||
if (otherFixture.Body.Owner.TryGetComponent(out StunnableComponent? stunnableComponent))
|
||||
{
|
||||
stunnableComponent.Stun(_stunAmount);
|
||||
stunnableComponent.Knockdown(_knockdownAmount);
|
||||
stunnableComponent.Slowdown(_slowdownAmount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user