From 10d04fffe3efd5a60e49ce65cae68336dc52852c Mon Sep 17 00:00:00 2001 From: Vigers Ray Date: Wed, 25 Dec 2024 04:15:35 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=B0=D0=B6=D0=B4=D1=8B=D0=B9=20=D1=82?= =?UTF-8?q?=D1=8B=D1=81=D1=8F=D1=87=D0=BD=D1=8B=D0=B9=20=D0=BF=D1=80=D1=8B?= =?UTF-8?q?=D0=B6=D0=BE=D0=BA=20=D0=B8=D0=BB=D0=B8=20=D1=81=D0=B0=D0=BB?= =?UTF-8?q?=D1=8C=D1=82=D0=BE=20-=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BB=D0=BE?= =?UTF-8?q?=D0=BC=20=D1=88=D0=B5=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Animations/EmoteAnimationSystem.cs | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Content.Server/_Sunrise/Animations/EmoteAnimationSystem.cs b/Content.Server/_Sunrise/Animations/EmoteAnimationSystem.cs index 3f029078a6..1fceecceb3 100644 --- a/Content.Server/_Sunrise/Animations/EmoteAnimationSystem.cs +++ b/Content.Server/_Sunrise/Animations/EmoteAnimationSystem.cs @@ -1,6 +1,9 @@ using Content.Server.Chat.Systems; +using Content.Server.Popups; using Content.Shared._Sunrise.Animations; using Content.Shared.Chat.Prototypes; +using Content.Shared.Damage; +using Content.Shared.Damage.Prototypes; using Content.Shared.Damage.Systems; using Content.Shared.Gravity; using Content.Shared.Standing; @@ -9,6 +12,8 @@ using Robust.Server.Audio; using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Player; +using Robust.Shared.Prototypes; +using Robust.Shared.Random; namespace Content.Server._Sunrise.Animations; @@ -19,6 +24,10 @@ public sealed class EmoteAnimationSystem : EntitySystem [Dependency] private readonly StatusEffectsSystem _statusEffects = default!; [Dependency] private readonly StaminaSystem _staminaSystem = default!; [Dependency] private readonly AudioSystem _audioSystem = default!; + [Dependency] private readonly DamageableSystem _damageableSystem = default!; + [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly PopupSystem _popupSystem = default!; + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; public static string JumpStatusEffectKey = "Jump"; @@ -67,12 +76,29 @@ public sealed class EmoteAnimationSystem : EntitySystem // Временная ржомба _audioSystem.PlayEntity("/Audio/_Sunrise/jump_mario.ogg", Filter.Pvs(uid), uid, true, AudioParams.Default); + if (_random.Prob(0.001f)) + { + _popupSystem.PopupEntity("Неудачно приземляется на шею.", uid); + var damage = new DamageSpecifier(_prototypeManager.Index("Blunt"), 200); + _damageableSystem.TryChangeDamage(uid, damage, true, useVariance: false, useModifier: false); + } + _statusEffects.TryAddStatusEffect(uid, JumpStatusEffectKey, TimeSpan.FromMilliseconds(500), false); } + if (emoteId == "EmoteFlip") + { + if (_random.Prob(0.001f)) + { + _popupSystem.PopupEntity("Неудачно приземляется на шею.", uid); + var damage = new DamageSpecifier(_prototypeManager.Index("Blunt"), 200); + _damageableSystem.TryChangeDamage(uid, damage, true, useVariance: false, useModifier: false); + } + } + component.AnimationId = emoteId; Dirty(uid, component); }