return old telebaton (#546)

This commit is contained in:
ThereDrD0
2024-08-03 17:02:07 +03:00
committed by GitHub
parent 53528f626d
commit 68ae47c958
3 changed files with 9 additions and 9 deletions

View File

@@ -3,4 +3,6 @@ namespace Content.Shared._White.Item.TelescopicBaton;
[RegisterComponent] [RegisterComponent]
public sealed partial class TelescopicBatonComponent : Component public sealed partial class TelescopicBatonComponent : Component
{ {
[DataField, ViewVariables(VVAccess.ReadWrite)]
public TimeSpan KnockdownTime = TimeSpan.FromSeconds(1.5f);
} }

View File

@@ -1,8 +1,6 @@
using Content.Shared.Damage.Events; using Content.Shared.Damage.Events;
using Content.Shared.Examine; using Content.Shared.Examine;
using Content.Shared.Item; using Content.Shared.Item;
using Content.Shared.Standing.Systems;
using Content.Shared.Standing;
using Content.Shared.Item.ItemToggle; using Content.Shared.Item.ItemToggle;
using Content.Shared.Item.ItemToggle.Components; using Content.Shared.Item.ItemToggle.Components;
using Content.Shared.Stunnable; using Content.Shared.Stunnable;
@@ -14,7 +12,6 @@ public sealed class TelescopicBatonSystem : EntitySystem
[Dependency] private readonly SharedItemSystem _item = default!; [Dependency] private readonly SharedItemSystem _item = default!;
[Dependency] private readonly SharedStunSystem _stun = default!; [Dependency] private readonly SharedStunSystem _stun = default!;
[Dependency] private readonly SharedItemToggleSystem _itemToggle = default!; [Dependency] private readonly SharedItemToggleSystem _itemToggle = default!;
[Dependency] private readonly SharedStandingStateSystem _standing = default!;
public override void Initialize() public override void Initialize()
{ {
@@ -28,12 +25,13 @@ public sealed class TelescopicBatonSystem : EntitySystem
private void OnHit(Entity<TelescopicBatonComponent> ent, ref StaminaMeleeHitEvent args) private void OnHit(Entity<TelescopicBatonComponent> ent, ref StaminaMeleeHitEvent args)
{ {
var time = ent.Comp.KnockdownTime;
if (time <= TimeSpan.Zero)
return;
foreach (var (uid, _) in args.HitList) foreach (var (uid, _) in args.HitList)
{ {
if (HasComp<StandingStateComponent>(uid)) _stun.TryKnockdown(uid, time, true);
{
_standing.TryLieDown(uid, null, SharedStandingStateSystem.DropHeldItemsBehavior.NoDrop);
}
} }
} }

View File

@@ -35,7 +35,7 @@
- type: MeleeWeapon - type: MeleeWeapon
canHeavyAttack: false canHeavyAttack: false
equipCooldown: 1 equipCooldown: 1
attackRate: 1.2 attackRate: 0.3
wideAnimationRotation: -135 wideAnimationRotation: -135
damage: damage:
types: types:
@@ -44,7 +44,7 @@
- type: ItemToggleMeleeWeapon - type: ItemToggleMeleeWeapon
activatedDamage: activatedDamage:
types: types:
Blunt: 2 Blunt: 9
deactivatedSecret: true deactivatedSecret: true
- type: StaminaDamageOnHit - type: StaminaDamageOnHit
damage: 16 damage: 16