From 1b65b7c2f8f5549b12adbab142ca1ae76c8a3942 Mon Sep 17 00:00:00 2001 From: iertis Date: Tue, 22 Jul 2025 11:02:08 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=80=D0=B0=D1=81=D1=8B=20=D1=84=D0=B5=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=B8=D0=B4=D0=BE=D0=B2=20(#2612)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: SplikZerys Co-authored-by: Vigers Ray <60344369+VigersRay@users.noreply.github.com> --- Content.Shared/Item/SharedItemSystem.cs | 5 ++ .../Felinid/FelinidPickupDoAfterEvent.cs | 9 ++++ .../_Sunrise/Felinid/SharedFelinidSystem.cs | 51 +++++++++++++++++++ .../_Sunrise/Damage/modifier_sets.yml | 10 ++-- .../Entities/Mobs/Species/felinid.yml | 33 ++++-------- 5 files changed, 81 insertions(+), 27 deletions(-) create mode 100644 Content.Shared/_Sunrise/Felinid/FelinidPickupDoAfterEvent.cs diff --git a/Content.Shared/Item/SharedItemSystem.cs b/Content.Shared/Item/SharedItemSystem.cs index c277bb7e87..578ec1c197 100644 --- a/Content.Shared/Item/SharedItemSystem.cs +++ b/Content.Shared/Item/SharedItemSystem.cs @@ -10,6 +10,7 @@ using Robust.Shared.Containers; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Utility; +using Content.Shared._Sunrise.Felinid; namespace Content.Shared.Item; @@ -115,6 +116,10 @@ public abstract class SharedItemSystem : EntitySystem private void AddPickupVerb(EntityUid uid, ItemComponent component, GetVerbsEvent args) { + // Sunrise-start. Предотвращаем появление стандартного верба подбора для фелинидов + if (HasComp(uid)) + return; + // Sunrise-end if (args.Hands == null || args.Using != null || !args.CanAccess || diff --git a/Content.Shared/_Sunrise/Felinid/FelinidPickupDoAfterEvent.cs b/Content.Shared/_Sunrise/Felinid/FelinidPickupDoAfterEvent.cs new file mode 100644 index 0000000000..efb1913c26 --- /dev/null +++ b/Content.Shared/_Sunrise/Felinid/FelinidPickupDoAfterEvent.cs @@ -0,0 +1,9 @@ +using Content.Shared.DoAfter; +using Robust.Shared.Serialization; + +namespace Content.Shared._Sunrise.Felinid; + +[Serializable, NetSerializable] +public sealed partial class FelinidPickupDoAfterEvent : SimpleDoAfterEvent +{ +} diff --git a/Content.Shared/_Sunrise/Felinid/SharedFelinidSystem.cs b/Content.Shared/_Sunrise/Felinid/SharedFelinidSystem.cs index e9ef711d71..d938d63499 100644 --- a/Content.Shared/_Sunrise/Felinid/SharedFelinidSystem.cs +++ b/Content.Shared/_Sunrise/Felinid/SharedFelinidSystem.cs @@ -1,7 +1,11 @@ +using Content.Shared.DoAfter; +using Content.Shared.Hands.Components; +using Content.Shared.Hands.EntitySystems; using Content.Shared.Interaction.Events; using Content.Shared.Inventory.Events; using Content.Shared.Item; using Content.Shared.Movement.Pulling.Events; +using Content.Shared.Popups; using Content.Shared.Throwing; using Robust.Shared.Containers; @@ -9,10 +13,14 @@ namespace Content.Shared._Sunrise.Felinid; public abstract class SharedFelinidSystem : EntitySystem { + [Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!; + [Dependency] private readonly SharedHandsSystem _hands = default!; + [Dependency] private readonly SharedPopupSystem _popup = default!; public override void Initialize() { base.Initialize(); + SubscribeLocalEvent(OnGettingPickupAttempt); SubscribeLocalEvent(OnPickupAttempt); SubscribeLocalEvent(OnBeingEquippedAttempt); SubscribeLocalEvent(OnHandEquippedAttempt); @@ -21,6 +29,7 @@ public abstract class SharedFelinidSystem : EntitySystem SubscribeLocalEvent(OnInteractAttempt); SubscribeLocalEvent(OnPullAttempt); SubscribeLocalEvent(OnAttempt); + SubscribeLocalEvent(OnDoAfter); } private void OnInteractAttempt(Entity ent, ref InteractionAttemptEvent args) @@ -62,4 +71,46 @@ public abstract class SharedFelinidSystem : EntitySystem if (HasComp(args.Item) || component.InContainer) args.Cancel(); } + private void OnGettingPickupAttempt(EntityUid uid, FelinidComponent component, ref GettingPickedUpAttemptEvent args) + { + args.Cancel(); + StartFelinidPickupDoAfter(args.User, args.Item); + } + private void StartFelinidPickupDoAfter(EntityUid user, EntityUid item) + { + var ev = new FelinidPickupDoAfterEvent(); + var args = new DoAfterArgs(EntityManager, user, 3f, ev, item, target: item) + { + BreakOnMove = true, + NeedHand = true, + MovementThreshold = 0.5f + }; + + _doAfterSystem.TryStartDoAfter(args); + } + private void OnDoAfter(Entity ent, ref FelinidPickupDoAfterEvent args) + { + if (args.Handled || args.Cancelled) + return; + + if (args.Args.Target == null) + return; + + if (!TryComp(args.Args.User, out var hands)) + return; + + if (!_hands.TryGetEmptyHand(args.Args.User, out var emptyHand, hands)) + return; + + if (TryComp(args.Args.Target.Value, out var multiHanded) + && hands.CountFreeHands() < multiHanded!.HandsNeeded) + { + _popup.PopupPredictedCursor(Loc.GetString("multi-handed-item-pick-up-fail", + ("number", multiHanded.HandsNeeded - 1), ("item", ent.Owner)), args.Args.User); + return; + } + + _hands.TryPickup(args.Args.User, args.Args.Target.Value, emptyHand, checkActionBlocker: false, handsComp: hands); + args.Handled = true; + } } diff --git a/Resources/Prototypes/_Sunrise/Damage/modifier_sets.yml b/Resources/Prototypes/_Sunrise/Damage/modifier_sets.yml index 72a9c04523..c622bdefe6 100644 --- a/Resources/Prototypes/_Sunrise/Damage/modifier_sets.yml +++ b/Resources/Prototypes/_Sunrise/Damage/modifier_sets.yml @@ -1,11 +1,11 @@ - type: damageModifierSet id: Felinid coefficients: - Blunt: 1.3 - Piercing: 1.3 - Slash: 1.3 - Cold: 1.3 - Heat: 1.3 + Blunt: 1.1 + Piercing: 1.1 + Slash: 1.1 + Cold: 1.1 + Heat: 1.1 - type: damageModifierSet id: Swine diff --git a/Resources/Prototypes/_Sunrise/Entities/Mobs/Species/felinid.yml b/Resources/Prototypes/_Sunrise/Entities/Mobs/Species/felinid.yml index 5bbe4b825e..29b15f75dd 100644 --- a/Resources/Prototypes/_Sunrise/Entities/Mobs/Species/felinid.yml +++ b/Resources/Prototypes/_Sunrise/Entities/Mobs/Species/felinid.yml @@ -5,9 +5,9 @@ id: MobFelinidBase abstract: true components: - # SUNRISE EDIT - type: Interactions - # SUNRISE EDIT + - type: MultiHandedItem + handsNeeded: 2 - type: Absorbable - type: OwOAccent - type: Speech @@ -408,7 +408,7 @@ fix1: shape: !type:PhysShapeCircle - radius: 0.20 + radius: 0.35 density: 100 restitution: 0.0 mask: @@ -446,12 +446,12 @@ - type: MobThresholds thresholds: 0: Alive - 75: Critical - 150: Dead + 80: Critical + 160: Dead - type: SlowOnDamage speedModifierThresholds: - 30: 0.7 - 40: 0.5 + 60: 0.7 + 70: 0.5 - type: MeleeWeapon hidden: true soundHit: @@ -462,15 +462,8 @@ damage: types: Slash: 3 - - type: DamageOnHighSpeedImpact - minimumSpeed: 5 - damage: - types: - Blunt: 10 - soundHit: - path: /Audio/Effects/hit_kick.ogg - type: Stamina - critThreshold: 50 + critThreshold: 100 - type: FootprintEmitter - type: Vocal sounds: @@ -506,14 +499,12 @@ showInChat: true probability: 0.35 - type: MovementSpeedModifier - baseWalkSpeed: 2.0 - baseSprintSpeed: 4.0 + baseWalkSpeed: 2.5 + baseSprintSpeed: 4.5 - type: Item size: Huge shape: - 0,0,3,3 - - type: ItemRepickupCooldown - cooldown: 5 - type: Felinid damageBonus: types: @@ -523,9 +514,7 @@ Blunt: 5 damageSound: /Audio/Effects/hit_kick.ogg - type: ScaleSprite - scale: 0.72, 0.72 - - type: ToggleableNightVision - effect: EffectNightVisioSpecies + scale: 0.80, 0.80 - type: entity save: false