From e5b1e8663340b41cd72b3e20bb67d096fe1ee2ff Mon Sep 17 00:00:00 2001 From: Spatison <137375981+Spatison@users.noreply.github.com> Date: Sat, 31 Aug 2024 21:58:03 +0300 Subject: [PATCH] =?UTF-8?q?[Port]=20Melee=20Block=20/=20=D0=91=D0=BB=D0=BE?= =?UTF-8?q?=D0=BA=20=D0=92=20=D0=91=D0=BB=D0=B8=D0=B6=D0=BD=D0=B5=D0=BC=20?= =?UTF-8?q?=D0=91=D0=BE=D1=8E=20(#10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add: melee block * add: RU loc * test * fix * test * test --- .../EntitySystems/HypospraySystem.cs | 7 +- .../SolutionInjectOnEventSystem.cs | 7 +- .../EntitySystems/PuddleSystem.Spillable.cs | 4 +- .../Forensics/Systems/ForensicsSystem.cs | 7 +- Content.Server/Zombies/ZombieSystem.cs | 7 +- Content.Shared/Alert/AlertType.cs | 1 + .../Blocking/BlockingSystem.User.cs | 27 ++++++ .../Damage/Systems/StaminaSystem.cs | 3 + .../Weapons/Melee/MeleeThrowOnHitSystem.cs | 3 + .../Weapons/Melee/MeleeWeaponComponent.cs | 5 + .../_White/Blocking/BlockBlockerComponent.cs | 6 ++ .../_White/Blocking/MeleeBlockComponent.cs | 24 +++++ .../_White/Blocking/MeleeBlockSystem.cs | 95 +++++++++++++++++++ .../Locale/en-US/_white/alerts/alerts.ftl | 2 + .../Locale/en-US/_white/block/melee-block.ftl | 2 + .../Locale/ru-RU/_white/alerts/alerts.ftl | 2 + .../Locale/ru-RU/_white/block/melee-block.ftl | 2 + Resources/Prototypes/Alerts/alerts.yml | 8 ++ .../Consumable/Drinks/drinks-cartons.yml | 1 + .../Objects/Consumable/Drinks/drinks.yml | 1 + .../Objects/Consumable/Drinks/drinks_cans.yml | 1 + .../Objects/Consumable/Drinks/drinks_cups.yml | 1 + .../Consumable/Drinks/trash_drinks.yml | 1 + .../Objects/Consumable/Food/ingredients.yml | 1 + .../Entities/Objects/Consumable/Food/soup.yml | 1 + .../Prototypes/Entities/Objects/Fun/toys.yml | 7 ++ .../Entities/Objects/Misc/handcuffs.yml | 1 + .../Entities/Objects/Shields/shields.yml | 2 + .../Objects/Specific/Janitorial/janitor.yml | 1 + .../Objects/Specific/chemistry-bottles.yml | 1 + .../Objects/Specific/chemistry-vials.yml | 1 + .../Entities/Objects/Specific/chemistry.yml | 2 + .../Entities/Objects/Tools/bucket.yml | 1 + .../Entities/Objects/Tools/lighters.yml | 2 + .../Objects/Weapons/Melee/e_sword.yml | 10 +- .../Entities/Objects/Weapons/Melee/sword.yml | 4 + .../Entities/Objects/Weapons/security.yml | 1 + Resources/Prototypes/status_effects.yml | 6 ++ 38 files changed, 252 insertions(+), 6 deletions(-) create mode 100644 Content.Shared/_White/Blocking/BlockBlockerComponent.cs create mode 100644 Content.Shared/_White/Blocking/MeleeBlockComponent.cs create mode 100644 Content.Shared/_White/Blocking/MeleeBlockSystem.cs create mode 100644 Resources/Locale/en-US/_white/alerts/alerts.ftl create mode 100644 Resources/Locale/en-US/_white/block/melee-block.ftl create mode 100644 Resources/Locale/ru-RU/_white/alerts/alerts.ftl create mode 100644 Resources/Locale/ru-RU/_white/block/melee-block.ftl diff --git a/Content.Server/Chemistry/EntitySystems/HypospraySystem.cs b/Content.Server/Chemistry/EntitySystems/HypospraySystem.cs index dfbe45c035..ab3b46755d 100644 --- a/Content.Server/Chemistry/EntitySystems/HypospraySystem.cs +++ b/Content.Server/Chemistry/EntitySystems/HypospraySystem.cs @@ -17,6 +17,7 @@ using Robust.Shared.GameStates; using System.Diagnostics.CodeAnalysis; using System.Linq; +using Content.Shared._White.Blocking; using Robust.Server.Audio; namespace Content.Server.Chemistry.EntitySystems; @@ -32,7 +33,8 @@ public override void Initialize() base.Initialize(); SubscribeLocalEvent(OnAfterInteract); - SubscribeLocalEvent(OnAttack); + SubscribeLocalEvent(OnAttack, + after: new[] {typeof(MeleeBlockSystem)}); // WD EDIT SubscribeLocalEvent(OnUseInHand); } @@ -68,6 +70,9 @@ public void OnAfterInteract(Entity entity, ref AfterInteract public void OnAttack(Entity entity, ref MeleeHitEvent args) { + if (args.Handled) // WD EDIT + return; + if (!args.HitEntities.Any()) return; diff --git a/Content.Server/Chemistry/EntitySystems/SolutionInjectOnEventSystem.cs b/Content.Server/Chemistry/EntitySystems/SolutionInjectOnEventSystem.cs index 3c57cc31af..3cd94d1f8f 100644 --- a/Content.Server/Chemistry/EntitySystems/SolutionInjectOnEventSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/SolutionInjectOnEventSystem.cs @@ -2,6 +2,7 @@ using Content.Server.Body.Systems; using Content.Server.Chemistry.Components; using Content.Server.Chemistry.Containers.EntitySystems; +using Content.Shared._White.Blocking; using Content.Shared.Inventory; using Content.Shared.Popups; using Content.Shared.Projectiles; @@ -28,7 +29,8 @@ public override void Initialize() base.Initialize(); SubscribeLocalEvent(HandleProjectileHit); SubscribeLocalEvent(HandleEmbed); - SubscribeLocalEvent(HandleMeleeHit); + SubscribeLocalEvent(HandleMeleeHit, + after: new[] {typeof(MeleeBlockSystem)}); // WD EDIT } private void HandleProjectileHit(Entity entity, ref ProjectileHitEvent args) @@ -43,6 +45,9 @@ private void HandleEmbed(Entity entity, ref Embe private void HandleMeleeHit(Entity entity, ref MeleeHitEvent args) { + if (args.Handled) // WD EDIT + return; + // MeleeHitEvent is weird, so we have to filter to make sure we actually // hit something and aren't just examining the weapon. if (args.IsHit) diff --git a/Content.Server/Fluids/EntitySystems/PuddleSystem.Spillable.cs b/Content.Server/Fluids/EntitySystems/PuddleSystem.Spillable.cs index 7780e5d467..747e3205a7 100644 --- a/Content.Server/Fluids/EntitySystems/PuddleSystem.Spillable.cs +++ b/Content.Server/Fluids/EntitySystems/PuddleSystem.Spillable.cs @@ -1,5 +1,6 @@ using Content.Server.Chemistry.Containers.EntitySystems; using Content.Server.Fluids.Components; +using Content.Shared._White.Blocking; using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Chemistry.Reaction; @@ -28,7 +29,8 @@ protected override void InitializeSpillable() SubscribeLocalEvent(SpillOnLand); // Openable handles the event if it's closed - SubscribeLocalEvent(SplashOnMeleeHit, after: [typeof(OpenableSystem)]); + SubscribeLocalEvent( + SplashOnMeleeHit, before: new[] {typeof(MeleeBlockSystem)}, after:[typeof(OpenableSystem)]); // WD EDIT SubscribeLocalEvent(OnGotEquipped); SubscribeLocalEvent(OnGotUnequipped); SubscribeLocalEvent(OnOverflow); diff --git a/Content.Server/Forensics/Systems/ForensicsSystem.cs b/Content.Server/Forensics/Systems/ForensicsSystem.cs index dff134a511..72930748f3 100644 --- a/Content.Server/Forensics/Systems/ForensicsSystem.cs +++ b/Content.Server/Forensics/Systems/ForensicsSystem.cs @@ -3,6 +3,7 @@ using Content.Server.Fluids.EntitySystems; using Content.Server.Forensics.Components; using Content.Server.Popups; +using Content.Shared._White.Blocking; using Content.Shared.Chemistry.Components; using Content.Shared.DoAfter; using Content.Shared.Forensics; @@ -31,7 +32,8 @@ public override void Initialize() SubscribeLocalEvent(OnScentInit); SubscribeLocalEvent(OnBeingGibbed); - SubscribeLocalEvent(OnMeleeHit); + SubscribeLocalEvent(OnMeleeHit, + after: new[] {typeof(MeleeBlockSystem)}); // WD EDIT SubscribeLocalEvent(OnRehydrated); SubscribeLocalEvent(OnAfterInteract, after: new[] { typeof(AbsorbentSystem) }); SubscribeLocalEvent(OnCleanForensicsDoAfter); @@ -87,6 +89,9 @@ private void OnBeingGibbed(EntityUid uid, DnaComponent component, BeingGibbedEve private void OnMeleeHit(EntityUid uid, ForensicsComponent component, MeleeHitEvent args) { + if (args.Handled) // WD EDIT + return; + if ((args.BaseDamage.DamageDict.TryGetValue("Blunt", out var bluntDamage) && bluntDamage.Value > 0) || (args.BaseDamage.DamageDict.TryGetValue("Slash", out var slashDamage) && slashDamage.Value > 0) || (args.BaseDamage.DamageDict.TryGetValue("Piercing", out var pierceDamage) && pierceDamage.Value > 0)) diff --git a/Content.Server/Zombies/ZombieSystem.cs b/Content.Server/Zombies/ZombieSystem.cs index 09c8fa26db..16f9b2607f 100644 --- a/Content.Server/Zombies/ZombieSystem.cs +++ b/Content.Server/Zombies/ZombieSystem.cs @@ -5,6 +5,7 @@ using Content.Server.Chat.Systems; using Content.Server.Emoting.Systems; using Content.Server.Speech.EntitySystems; +using Content.Shared._White.Blocking; using Content.Shared.Bed.Sleep; using Content.Shared.Cloning; using Content.Shared.Damage; @@ -56,7 +57,8 @@ public override void Initialize() SubscribeLocalEvent(OnEmote, before: new[] { typeof(VocalSystem), typeof(BodyEmotesSystem) }); - SubscribeLocalEvent(OnMeleeHit); + SubscribeLocalEvent(OnMeleeHit, + after: new[] {typeof(MeleeBlockSystem)}); // WD EDIT SubscribeLocalEvent(OnMobState); SubscribeLocalEvent(OnZombieCloning); SubscribeLocalEvent(OnSleepAttempt); @@ -209,6 +211,9 @@ private float GetZombieInfectionChance(EntityUid uid, ZombieComponent component) private void OnMeleeHit(EntityUid uid, ZombieComponent component, MeleeHitEvent args) { + if (args.Handled) // WD EDIT + return; + if (!TryComp(args.User, out _)) return; diff --git a/Content.Shared/Alert/AlertType.cs b/Content.Shared/Alert/AlertType.cs index dc323dc64a..2744bd40ac 100644 --- a/Content.Shared/Alert/AlertType.cs +++ b/Content.Shared/Alert/AlertType.cs @@ -55,6 +55,7 @@ public enum AlertType : byte BorgCrit, BorgDead, Offer, + RecentlyBlocked, // WD EDIT } } diff --git a/Content.Shared/Blocking/BlockingSystem.User.cs b/Content.Shared/Blocking/BlockingSystem.User.cs index 2cd1db7f1f..3b88659edc 100644 --- a/Content.Shared/Blocking/BlockingSystem.User.cs +++ b/Content.Shared/Blocking/BlockingSystem.User.cs @@ -1,5 +1,7 @@ +using Content.Shared._White.Blocking; using Content.Shared.Damage; using Content.Shared.Damage.Prototypes; +using Content.Shared.Item.ItemToggle.Components; using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; @@ -20,7 +22,32 @@ private void InitializeUser() SubscribeLocalEvent(OnInsertAttempt); SubscribeLocalEvent(OnAnchorChanged); SubscribeLocalEvent(OnEntityTerminating); + + SubscribeLocalEvent(OnMeleeBlockAttempt); // WD + } + + // WD START + private void OnMeleeBlockAttempt(Entity ent, ref MeleeBlockAttemptEvent args) + { + if (args.Handled) + return; + + var uid = ent.Comp.BlockingItem; + if (!TryComp(uid, out BlockingComponent? blocking) || !blocking.IsBlocking) + return; + + if (TryComp(uid.Value, out ItemToggleComponent? toggle) && !toggle.Activated) + return; + + if (!TryComp(uid.Value, out DamageableComponent? damageable)) + return; + + _audio.PlayPredicted(blocking.BlockSound, ent, args.Attacker); + _popupSystem.PopupPredicted(Loc.GetString("melee-block-event-blocked"), ent, args.Attacker); + _damageable.TryChangeDamage(uid.Value, args.Damage, damageable: damageable); + args.Handled = true; } + // WD END private void OnParentChanged(EntityUid uid, BlockingUserComponent component, ref EntParentChangedMessage args) { diff --git a/Content.Shared/Damage/Systems/StaminaSystem.cs b/Content.Shared/Damage/Systems/StaminaSystem.cs index 54a88205b2..1fb83c2dea 100644 --- a/Content.Shared/Damage/Systems/StaminaSystem.cs +++ b/Content.Shared/Damage/Systems/StaminaSystem.cs @@ -142,6 +142,9 @@ private void OnDisarmed(EntityUid uid, StaminaComponent component, DisarmedEvent private void OnMeleeHit(EntityUid uid, StaminaDamageOnHitComponent component, MeleeHitEvent args) { + if (args.Handled) // WD EDIT + return; + if (!args.IsHit || !args.HitEntities.Any() || component.Damage <= 0f) diff --git a/Content.Shared/Weapons/Melee/MeleeThrowOnHitSystem.cs b/Content.Shared/Weapons/Melee/MeleeThrowOnHitSystem.cs index e069602260..8cf3df96e9 100644 --- a/Content.Shared/Weapons/Melee/MeleeThrowOnHitSystem.cs +++ b/Content.Shared/Weapons/Melee/MeleeThrowOnHitSystem.cs @@ -30,6 +30,9 @@ public override void Initialize() private void OnMeleeHit(Entity ent, ref MeleeHitEvent args) { + if (args.Handled) // WD EDIT + return; + var (_, comp) = ent; if (!args.IsHit) return; diff --git a/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs b/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs index 2708a07c6e..bcb5f56cba 100644 --- a/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs +++ b/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs @@ -156,6 +156,11 @@ public sealed partial class MeleeWeaponComponent : Component /// [DataField, AutoNetworkedField] public SoundSpecifier SoundNoDamage { get; set; } = new SoundCollectionSpecifier("WeakHit"); + + // WD EDIT START + [ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField] + public bool CanBeBlocked = true; + // WD EDIT END } /// diff --git a/Content.Shared/_White/Blocking/BlockBlockerComponent.cs b/Content.Shared/_White/Blocking/BlockBlockerComponent.cs new file mode 100644 index 0000000000..5801995ab6 --- /dev/null +++ b/Content.Shared/_White/Blocking/BlockBlockerComponent.cs @@ -0,0 +1,6 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared._White.Blocking; + +[RegisterComponent, NetworkedComponent] +public sealed partial class BlockBlockerComponent : Component; diff --git a/Content.Shared/_White/Blocking/MeleeBlockComponent.cs b/Content.Shared/_White/Blocking/MeleeBlockComponent.cs new file mode 100644 index 0000000000..5c9efbf0df --- /dev/null +++ b/Content.Shared/_White/Blocking/MeleeBlockComponent.cs @@ -0,0 +1,24 @@ +using Content.Shared.Damage; +using Robust.Shared.Audio; + +namespace Content.Shared._White.Blocking; + +[RegisterComponent] +public sealed partial class MeleeBlockComponent : Component +{ + [DataField, ViewVariables(VVAccess.ReadWrite)] + public TimeSpan Delay = TimeSpan.FromSeconds(3.1); + + [DataField] + public SoundSpecifier BlockSound = new SoundPathSpecifier("/Audio/Weapons/block_metal1.ogg") + { + Params = AudioParams.Default.WithVariation(0.25f) + }; +} + +public sealed class MeleeBlockAttemptEvent(EntityUid attacker, DamageSpecifier damage) : HandledEntityEventArgs +{ + public EntityUid Attacker = attacker; + + public DamageSpecifier Damage = damage; +} diff --git a/Content.Shared/_White/Blocking/MeleeBlockSystem.cs b/Content.Shared/_White/Blocking/MeleeBlockSystem.cs new file mode 100644 index 0000000000..b77639e8bc --- /dev/null +++ b/Content.Shared/_White/Blocking/MeleeBlockSystem.cs @@ -0,0 +1,95 @@ +using Content.Shared.Blocking; +using Content.Shared.Damage; +using Content.Shared.Damage.Systems; +using Content.Shared.Examine; +using Content.Shared.Hands.Components; +using Content.Shared.Item.ItemToggle.Components; +using Content.Shared.Popups; +using Content.Shared.StatusEffect; +using Content.Shared.Weapons.Melee; +using Content.Shared.Weapons.Melee.Events; +using Robust.Shared.Audio.Systems; +using Robust.Shared.Timing; + +namespace Content.Shared._White.Blocking; + +public sealed class MeleeBlockSystem : EntitySystem +{ + [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly DamageableSystem _damageable = default!; + [Dependency] private readonly SharedAudioSystem _audio = default!; + [Dependency] private readonly SharedPopupSystem _popupSystem = default!; + [Dependency] private readonly StatusEffectsSystem _statusEffect = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnBlockAttempt, + after: new[] {typeof(BlockingSystem)}); + SubscribeLocalEvent(OnHit, + before: new[] {typeof(StaminaSystem), typeof(MeleeThrowOnHitSystem)}); + SubscribeLocalEvent(OnExamine); + } + + private void OnExamine(Entity ent, ref ExaminedEvent args) + { + args.PushMarkup(Loc.GetString("melee-block-component-delay", ("delay", ent.Comp.Delay.TotalSeconds))); + } + + private void OnHit(Entity ent, ref MeleeHitEvent args) + { + if (!_timing.IsFirstTimePredicted) + return; + + if (!ent.Comp.CanBeBlocked || !args.IsHit || args.Handled) + return; + + if (args.Direction != null || args.HitEntities.Count != 1) // Heavy attacks are unblockable + return; + + var hitEntity = args.HitEntities[0]; + + if (hitEntity == args.User) + return; + + var ev = new MeleeBlockAttemptEvent(args.User, args.BaseDamage + args.BonusDamage); + RaiseLocalEvent(hitEntity, ev); + + if (ev.Handled) + args.Handled = true; + } + + private void OnBlockAttempt(Entity ent, ref MeleeBlockAttemptEvent args) + { + if (args.Handled || HasComp(ent)) + return; + + if (!TryComp(ent, out StatusEffectsComponent? statusEffects)) + return; + + var uid = ent.Comp.ActiveHandEntity; + if (!TryComp(uid, out MeleeBlockComponent? block)) + return; + + if (TryComp(uid.Value, out ItemToggleComponent? toggle) && !toggle.Activated) + return; + + _audio.PlayPredicted(block.BlockSound, ent, args.Attacker); + _popupSystem.PopupPredicted(Loc.GetString("melee-block-event-blocked"), ent, args.Attacker); + _damageable.TryChangeDamage(uid.Value, args.Damage); + TryBlockBlocking(ent, block.Delay, true, statusEffects); + args.Handled = true; + } + + public bool TryBlockBlocking(EntityUid uid, TimeSpan time, bool refresh, StatusEffectsComponent? status = null) + { + if (time <= TimeSpan.Zero) + return false; + + if (!Resolve(uid, ref status, false)) + return false; + + return _statusEffect.TryAddStatusEffect(uid, "RecentlyBlocked", time, refresh); + } +} diff --git a/Resources/Locale/en-US/_white/alerts/alerts.ftl b/Resources/Locale/en-US/_white/alerts/alerts.ftl new file mode 100644 index 0000000000..d64317cb0a --- /dev/null +++ b/Resources/Locale/en-US/_white/alerts/alerts.ftl @@ -0,0 +1,2 @@ +alerts-blocked-name = Recently blocked +alerts-blocked-desc = I can't block for a while! \ No newline at end of file diff --git a/Resources/Locale/en-US/_white/block/melee-block.ftl b/Resources/Locale/en-US/_white/block/melee-block.ftl new file mode 100644 index 0000000000..2020320f48 --- /dev/null +++ b/Resources/Locale/en-US/_white/block/melee-block.ftl @@ -0,0 +1,2 @@ +melee-block-event-blocked = blocked! +melee-block-component-delay = Can block a melee attack every {$delay} seconds. \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_white/alerts/alerts.ftl b/Resources/Locale/ru-RU/_white/alerts/alerts.ftl new file mode 100644 index 0000000000..b622781c1d --- /dev/null +++ b/Resources/Locale/ru-RU/_white/alerts/alerts.ftl @@ -0,0 +1,2 @@ +alerts-blocked-name = Атака заблокирована +alerts-blocked-desc = Невозможно блокировать некоторое время. \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_white/block/melee-block.ftl b/Resources/Locale/ru-RU/_white/block/melee-block.ftl new file mode 100644 index 0000000000..7c48276fda --- /dev/null +++ b/Resources/Locale/ru-RU/_white/block/melee-block.ftl @@ -0,0 +1,2 @@ +melee-block-event-blocked = заблокировал! +melee-block-component-delay = Может блокировать атаку ближнего боя каждые {$delay} секунд. \ No newline at end of file diff --git a/Resources/Prototypes/Alerts/alerts.yml b/Resources/Prototypes/Alerts/alerts.yml index 00b799670f..8fbeb04aa6 100644 --- a/Resources/Prototypes/Alerts/alerts.yml +++ b/Resources/Prototypes/Alerts/alerts.yml @@ -25,6 +25,7 @@ - alertType: Magboots - alertType: Pacified - alertType: Offer + - alertType: RecentlyBlocked # WD EDIT - type: entity id: AlertSpriteView @@ -449,6 +450,13 @@ minSeverity: 0 maxSeverity: 1 +# WD EDIT +- type: alert + id: RecentlyBlocked + icons: [ /Textures/Objects/Weapons/Melee/shields.rsi/buckler-icon.png ] + name: alerts-blocked-name + description: alerts-blocked-desc + - type: alert id: Debug1 icons: diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks-cartons.yml b/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks-cartons.yml index e758022710..d694b153b1 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks-cartons.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks-cartons.yml @@ -20,6 +20,7 @@ - type: Item size: Small - type: MeleeWeapon + canBeBlocked: false # WD EDIT soundNoDamage: path: "/Audio/Effects/Fluids/splat.ogg" damage: diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks.yml b/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks.yml index 93d4b957fe..545b3559f8 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks.yml @@ -16,6 +16,7 @@ - type: Sprite state: icon - type: MeleeWeapon + canBeBlocked: false # WD EDIT soundNoDamage: path: "/Audio/Effects/Fluids/splat.ogg" damage: diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cans.yml b/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cans.yml index a9ff1c784a..9d4d8447d4 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cans.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cans.yml @@ -44,6 +44,7 @@ - type: Spillable solution: drink - type: MeleeWeapon + canBeBlocked: false # WD EDIT soundNoDamage: path: "/Audio/Effects/Fluids/splat.ogg" damage: diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cups.yml b/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cups.yml index c4693c6a71..9ad51490df 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cups.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cups.yml @@ -32,6 +32,7 @@ - type: Spillable solution: drink - type: MeleeWeapon + canBeBlocked: false # WD EDIT soundNoDamage: path: "/Audio/Effects/Fluids/splat.ogg" damage: diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Drinks/trash_drinks.yml b/Resources/Prototypes/Entities/Objects/Consumable/Drinks/trash_drinks.yml index aeaa54ccf1..62823e4ce4 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Drinks/trash_drinks.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Drinks/trash_drinks.yml @@ -20,6 +20,7 @@ maxTransferAmount: 5 - type: Drink - type: MeleeWeapon + canBeBlocked: false # WD EDIT soundNoDamage: path: "/Audio/Effects/Fluids/splat.ogg" damage: diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml index c6c7e5677e..296e088692 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml @@ -59,6 +59,7 @@ acts: [ "Destruction" ] # packet contents can be splashed when open - type: MeleeWeapon + canBeBlocked: false # WD EDIT soundNoDamage: path: "/Audio/Effects/Fluids/splat.ogg" damage: diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml index 6b96f3bcb3..a0623a7d36 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/soup.yml @@ -31,6 +31,7 @@ solution: food # soup weapon! - type: MeleeWeapon + canBeBlocked: false # WD EDIT soundNoDamage: path: "/Audio/Effects/Fluids/splat.ogg" damage: diff --git a/Resources/Prototypes/Entities/Objects/Fun/toys.yml b/Resources/Prototypes/Entities/Objects/Fun/toys.yml index 1fea59a926..3d6fa15a34 100644 --- a/Resources/Prototypes/Entities/Objects/Fun/toys.yml +++ b/Resources/Prototypes/Entities/Objects/Fun/toys.yml @@ -29,6 +29,7 @@ - type: UseDelay delay: 1.0 - type: MeleeWeapon + canBeBlocked: false # WD EDIT wideAnimationRotation: 180 soundHit: collection: ToySqueak @@ -1387,6 +1388,7 @@ sprite: Objects/Fun/toys.rsi state: foamblade - type: MeleeWeapon + canBeBlocked: false # WD EDIT attackRate: 1.5 angle: 0 animation: WeaponArcThrust @@ -1629,6 +1631,7 @@ - type: StaminaDamageOnHit damage: 8 - type: MeleeWeapon + canBeBlocked: false # WD EDIT damage: types: Blunt: 0 @@ -1673,6 +1676,7 @@ sprite: Objects/Weapons/Melee/cutlass.rsi state: foam_icon - type: MeleeWeapon + canBeBlocked: false # WD EDIT attackRate: 1.5 range: 2.0 angle: 0 @@ -1731,6 +1735,7 @@ - type: DisarmMalus malus: 0 - type: MeleeWeapon + canBeBlocked: false # WD EDIT soundHit: collection: RubberHammer params: @@ -1772,6 +1777,7 @@ params: variation: 0.125 - type: MeleeWeapon + canBeBlocked: false # WD EDIT soundHit: collection: Parp params: @@ -1914,6 +1920,7 @@ - type: StaminaDamageOnHit damage: 0.8 - type: MeleeWeapon + canBeBlocked: false # WD EDIT wideAnimationRotation: -135 attackRate: 10 damage: diff --git a/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml b/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml index 527233920d..1a402713a0 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml @@ -17,6 +17,7 @@ tags: - Handcuffs - type: MeleeWeapon + canBeBlocked: false # WD EDIT wideAnimationRotation: 90 resetOnHandSelected: false animation: WeaponArcDisarm diff --git a/Resources/Prototypes/Entities/Objects/Shields/shields.yml b/Resources/Prototypes/Entities/Objects/Shields/shields.yml index b794e42ff7..3647bdf0db 100644 --- a/Resources/Prototypes/Entities/Objects/Shields/shields.yml +++ b/Resources/Prototypes/Entities/Objects/Shields/shields.yml @@ -59,6 +59,7 @@ max: 2 - type: StaticPrice price: 50 + - type: MeleeBlock # WD EDIT #Security Shields @@ -453,6 +454,7 @@ max: 1 - type: StaticPrice price: 350 + - type: MeleeBlock # WD EDIT - type: entity name: broken energy shield diff --git a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml index de5c33671a..0c65a31c4e 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml @@ -258,6 +258,7 @@ - type: Spillable solution: absorbed - type: MeleeWeapon + canBeBlocked: false # WD EDIT soundNoDamage: path: "/Audio/Effects/Fluids/splat.ogg" damage: diff --git a/Resources/Prototypes/Entities/Objects/Specific/chemistry-bottles.yml b/Resources/Prototypes/Entities/Objects/Specific/chemistry-bottles.yml index acfb65aa54..379c361be5 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/chemistry-bottles.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/chemistry-bottles.yml @@ -51,6 +51,7 @@ - type: Spillable solution: drink - type: MeleeWeapon + canBeBlocked: false # WD EDIT soundNoDamage: path: "/Audio/Effects/Fluids/splat.ogg" damage: diff --git a/Resources/Prototypes/Entities/Objects/Specific/chemistry-vials.yml b/Resources/Prototypes/Entities/Objects/Specific/chemistry-vials.yml index c5de88d690..87c591015e 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/chemistry-vials.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/chemistry-vials.yml @@ -57,6 +57,7 @@ shape: - 0,0,0,0 - type: MeleeWeapon + canBeBlocked: false # WD EDIT soundNoDamage: path: "/Audio/Effects/Fluids/splat.ogg" damage: diff --git a/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml b/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml index 9e68879fb4..98561b64c4 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml @@ -16,6 +16,7 @@ - type: Item sprite: Objects/Specific/Chemistry/beaker.rsi - type: MeleeWeapon + canBeBlocked: false # WD EDIT soundNoDamage: path: "/Audio/Effects/Fluids/splat.ogg" damage: @@ -108,6 +109,7 @@ - type: Item sprite: Objects/Specific/Chemistry/beaker.rsi - type: MeleeWeapon + canBeBlocked: false # WD EDIT soundNoDamage: path: "/Audio/Effects/Fluids/splat.ogg" damage: diff --git a/Resources/Prototypes/Entities/Objects/Tools/bucket.yml b/Resources/Prototypes/Entities/Objects/Tools/bucket.yml index 496fd231b8..d430161a3c 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/bucket.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/bucket.yml @@ -36,6 +36,7 @@ - key: enum.TransferAmountUiKey.Key type: TransferAmountBoundUserInterface - type: MeleeWeapon + canBeBlocked: false # WD EDIT soundNoDamage: path: "/Audio/Effects/Fluids/splat.ogg" damage: diff --git a/Resources/Prototypes/Entities/Objects/Tools/lighters.yml b/Resources/Prototypes/Entities/Objects/Tools/lighters.yml index d03cc725ef..c48a889232 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/lighters.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/lighters.yml @@ -74,6 +74,7 @@ Quantity: 8 maxVol: 8 #uses less fuel than a welder, so this isnt as bad as it looks - type: MeleeWeapon + canBeBlocked: false # WD EDIT wideAnimationRotation: 180 damage: types: @@ -196,6 +197,7 @@ - state: zippo-inhand-right-flame shader: unshaded - type: MeleeWeapon + canBeBlocked: false # WD EDIT wideAnimationRotation: 180 damage: types: diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Melee/e_sword.yml b/Resources/Prototypes/Entities/Objects/Weapons/Melee/e_sword.yml index 723d950835..526f8e7a9c 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Melee/e_sword.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Melee/e_sword.yml @@ -67,6 +67,10 @@ malus: 0 - type: IgnitionSource temperature: 700 + - type: MeleeBlock # WD EDIT + delay: 6.1 + blockSound: + path: /Audio/Weapons/eblade1.ogg - type: entity name: energy sword @@ -167,6 +171,8 @@ - type: Tag tags: - Write + - type: MeleeBlock # WD EDIT + delay: 12.1 - type: entity parent: BaseItem @@ -248,8 +254,10 @@ reflects: - Energy - type: ToggleableWielded # WD EDIT + - type: MeleeBlock # WD EDIT + delay: 3.1 - type: FlipOnHit # WD EDIT - type: Construction # WD EDIT deconstructionTarget: null graph: EnergyDoubleSwordGraph - node: desword + node: desword \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Melee/sword.yml b/Resources/Prototypes/Entities/Objects/Weapons/Melee/sword.yml index 82b99ce37e..df8aa1947a 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Melee/sword.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Melee/sword.yml @@ -34,6 +34,8 @@ tags: - CaptainSabre - type: DisarmMalus + - type: MeleeBlock # WD EDIT + delay: 6.1 - type: entity name: katana @@ -97,6 +99,8 @@ - Back - Belt - type: Reflect + - type: MeleeBlock # WD EDIT + delay: 6.1 - type: entity name: machete diff --git a/Resources/Prototypes/Entities/Objects/Weapons/security.yml b/Resources/Prototypes/Entities/Objects/Weapons/security.yml index a952713dd5..6ace2f9e27 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/security.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/security.yml @@ -143,6 +143,7 @@ maxCharges: 5 charges: 5 - type: MeleeWeapon + canBeBlocked: false # WD EDIT wideAnimationRotation: 180 damage: types: diff --git a/Resources/Prototypes/status_effects.yml b/Resources/Prototypes/status_effects.yml index a991bf4035..37da86f6a8 100644 --- a/Resources/Prototypes/status_effects.yml +++ b/Resources/Prototypes/status_effects.yml @@ -59,3 +59,9 @@ - type: statusEffect id: StaminaModifier + +# WD EDIT +- type: statusEffect + id: RecentlyBlocked + alwaysAllowed: true + alert: RecentlyBlocked