From 2ceee8b65e04cf0b374260c358cc697997098866 Mon Sep 17 00:00:00 2001 From: Noychik <108848870+Noychik@users.noreply.github.com> Date: Wed, 7 May 2025 03:01:41 +0700 Subject: [PATCH 01/40] =?UTF-8?q?=D0=9D=D0=B0=D1=80=D0=BE=D0=B4=D0=B0?= =?UTF-8?q?=D0=BC=20-=20=D0=BC=D0=B8=D1=80,=20=D0=97=D0=B5=D0=BC=D0=BB?= =?UTF-8?q?=D1=8F=20-=20=D0=BA=D1=80=D0=B5=D1=81=D1=82=D1=8C=D1=8F=D0=BD?= =?UTF-8?q?=D0=B0=D0=BC,=20=D0=A4=D0=B0=D0=B1=D1=80=D0=B8=D0=BA=D0=B8=20-?= =?UTF-8?q?=20=D1=80=D0=B0=D0=B1=D0=BE=D1=87=D0=B8=D0=BC,=20=D0=90=D0=BB?= =?UTF-8?q?=D0=BC=D0=B0=D0=B7=D1=8B=20=D0=BD=D0=B0=20=D0=B0=D1=81=D1=82?= =?UTF-8?q?=D0=B5=D1=80=D0=BE=D0=B8=D0=B4=D1=8B!=20(#2095)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ура товарищи! --- .../Prototypes/Procedural/Magnet/asteroid_ore_gens.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Resources/Prototypes/Procedural/Magnet/asteroid_ore_gens.yml b/Resources/Prototypes/Procedural/Magnet/asteroid_ore_gens.yml index 661350f6de..60cafdf11f 100644 --- a/Resources/Prototypes/Procedural/Magnet/asteroid_ore_gens.yml +++ b/Resources/Prototypes/Procedural/Magnet/asteroid_ore_gens.yml @@ -11,6 +11,7 @@ OreUranium: 0.20 OreArtifactFragment: 0.10 OreBananium: 0.10 + OreDiamond: 0.03 #Sunrise-Edit - type: oreDunGen id: OreIron @@ -84,6 +85,14 @@ minGroupSize: 3 maxGroupSize: 6 +- type: oreDunGen #Sunrise-Start + id: OreDiamond + replacement: AsteroidRock + entity: AsteroidRockDiamond + count: 2 + minGroupSize: 1 + maxGroupSize: 3 #Sunrise-End + - type: oreDunGen id: OreArtifactFragment replacement: AsteroidRock From 75baae8f2b9130a6e0fe43db0299f20988dbc833 Mon Sep 17 00:00:00 2001 From: Sunrise-Bot Date: Tue, 6 May 2025 23:03:23 +0300 Subject: [PATCH 02/40] Automatic changelog update --- Resources/Changelog/ChangelogSunrise.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Resources/Changelog/ChangelogSunrise.yml b/Resources/Changelog/ChangelogSunrise.yml index 7be8d29d72..32f77b6ce2 100644 --- a/Resources/Changelog/ChangelogSunrise.yml +++ b/Resources/Changelog/ChangelogSunrise.yml @@ -16072,3 +16072,12 @@ id: 1104 time: '2025-05-05T17:38:41.0000000+00:00' url: https://github.com/space-sunrise/sunrise-station/pull/2082 +- author: Noychik + changes: + - message: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D \u0448\u0430\u043D\u0441\ + \ \u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u0438 \u0430\u043B\u043C\u0430\ + \u0437\u043E\u0432 \u043D\u0430 \u043E\u0431\u043B\u043E\u043C\u043A\u0430\u0445" + type: Add + id: 1105 + time: '2025-05-06T20:01:42.0000000+00:00' + url: https://github.com/space-sunrise/sunrise-station/pull/2095 From f18fdfb9ad8c59e5d342c126d3fdc3dc9a17ecea Mon Sep 17 00:00:00 2001 From: ThereDrD <88589686+ThereDrD0@users.noreply.github.com> Date: Wed, 7 May 2025 03:26:37 +0300 Subject: [PATCH 03/40] =?UTF-8?q?=D0=9C=D0=B8=D0=BD=D0=B8-=D1=80=D0=B5?= =?UTF-8?q?=D1=84=D0=B0=D0=BA=D1=82=D0=BE=D1=80=20=D0=BE=D0=B2=D0=B5=D1=80?= =?UTF-8?q?=D0=BB=D0=B5=D1=8F=20=D1=83=D1=80=D0=BE=D0=BD=D0=B0=20(#2103)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DamageOverlay/DamageOverlaySystem.cs | 75 ++++++++----------- .../Structures/Lighting/base_lighting.yml | 5 ++ 2 files changed, 37 insertions(+), 43 deletions(-) diff --git a/Content.Server/_Sunrise/DamageOverlay/DamageOverlaySystem.cs b/Content.Server/_Sunrise/DamageOverlay/DamageOverlaySystem.cs index 36342be5bd..415f0e8851 100644 --- a/Content.Server/_Sunrise/DamageOverlay/DamageOverlaySystem.cs +++ b/Content.Server/_Sunrise/DamageOverlay/DamageOverlaySystem.cs @@ -1,9 +1,9 @@ -using System.Numerics; -using Content.Server.Mind; using Content.Server.Popups; using Content.Shared._Sunrise.DamageOverlay; +using Content.Shared._Sunrise.Helpers; using Content.Shared.Damage; using Content.Shared.FixedPoint; +using Content.Shared.GameTicking; using Robust.Shared.Map; using Robust.Shared.Player; using Robust.Shared.Random; @@ -16,12 +16,11 @@ namespace Content.Server._Sunrise.DamageOverlay; public sealed class DamageOverlaySystem : EntitySystem { [Dependency] private readonly PopupSystem _popupSystem = default!; - [Dependency] private readonly MindSystem _mindSystem = default!; [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly ISharedPlayerManager _player = default!; - private readonly List _disabledSessions = []; - private readonly Dictionary _playerSettings = new (); + private static readonly HashSet DisabledSessions = []; + private static readonly Dictionary PlayerSettings = new (); public override void Initialize() { @@ -30,16 +29,24 @@ public sealed class DamageOverlaySystem : EntitySystem SubscribeLocalEvent(OnDamageChange); SubscribeNetworkEvent(OnDamageOverlayOption); + + SubscribeLocalEvent(_ => CleanUp()); } - private async void OnDamageOverlayOption(DamageOverlayOptionEvent ev, EntitySessionEventArgs args) + private static void CleanUp() + { + DisabledSessions.Clear(); + PlayerSettings.Clear(); + } + + private static async void OnDamageOverlayOption(DamageOverlayOptionEvent ev, EntitySessionEventArgs args) { if (ev.Enabled) - _disabledSessions.Remove(args.SenderSession); + DisabledSessions.Remove(args.SenderSession); else - _disabledSessions.Add(args.SenderSession); + DisabledSessions.Add(args.SenderSession); - _playerSettings[args.SenderSession] = new DamageOverlaySettings(ev.SelfEnabled, ev.StructuresEnabled); + PlayerSettings.TryAdd(args.SenderSession, new DamageOverlaySettings(ev.SelfEnabled, ev.StructuresEnabled)); } private void OnDamageChange(Entity ent, ref DamageChangedEvent args) @@ -48,7 +55,7 @@ public sealed class DamageOverlaySystem : EntitySystem return; var damageDelta = args.DamageDelta.GetTotal(); - var coords = GenerateRandomCoordinates(Transform(ent).Coordinates, ent.Comp.Radius); + var coords = Transform(ent).Coordinates.GetRandomInRadius(ent.Comp.Radius, _random); // Идея в том, что попапы должны разделяться на две большие категории: без отправителя и с ним // В итоге должен быть только один попап, либо тот, либо этот @@ -58,10 +65,10 @@ public sealed class DamageOverlaySystem : EntitySystem // Пример: Космос, огонь и т.д. - if (_mindSystem.TryGetMind(ent, out _, out var mindTarget) && _player.TryGetSessionById(mindTarget.UserId, out var sessionTarget)) + if (_player.TryGetSessionByEntity(ent, out var targetSession)) { // Специально скрыл попапы с пассивной регенерацией, они скорее мешают - TryCreatePopup(ent, damageDelta, coords, sessionTarget); + TryCreatePopup(ent, damageDelta, coords, targetSession); return; } @@ -72,27 +79,17 @@ public sealed class DamageOverlaySystem : EntitySystem if (args.Origin == null) return; - if (!_mindSystem.TryGetMind(args.Origin.Value, out _, out var mindOrigin) || !_player.TryGetSessionById(mindOrigin.UserId, out var sessionOrigin)) + if (!_player.TryGetSessionByEntity(args.Origin.Value, out var originSession)) return; - TryCreatePopup(ent, damageDelta, coords, sessionOrigin); + TryCreatePopup(ent, damageDelta, coords, originSession); } - private EntityCoordinates GenerateRandomCoordinates(EntityCoordinates center, float radius) - { - var angle = _random.NextDouble() * 2 * Math.PI; - - var distance = _random.NextDouble() * radius; - - var offsetX = (float)(Math.Cos(angle) * distance); - var offsetY = (float)(Math.Sin(angle) * distance); - - var newPosition = new Vector2(center.Position.X + offsetX, center.Position.Y + offsetY); - - return new EntityCoordinates(center.EntityId, newPosition); - } - - private bool TryCreatePopup(Entity ent, FixedPoint2 damageDelta, EntityCoordinates coords, ICommonSession session, bool showHealPopup = true) + private bool TryCreatePopup(Entity ent, + FixedPoint2 damageDelta, + EntityCoordinates coords, + ICommonSession session, + bool showHealPopup = true) { if (IsDisabledByClient(session, ent)) return false; @@ -111,12 +108,12 @@ public sealed class DamageOverlaySystem : EntitySystem return true; } - private bool IsDisabledByClient(ICommonSession session, Entity target) + private static bool IsDisabledByClient(ICommonSession session, Entity target) { - if (_disabledSessions.Contains(session)) + if (DisabledSessions.Contains(session)) return true; - if (_playerSettings.TryGetValue(session, out var playerSettings)) + if (PlayerSettings.TryGetValue(session, out var playerSettings)) { if (target.Comp.IsStructure && !playerSettings.StructureDamage) return true; @@ -128,17 +125,9 @@ public sealed class DamageOverlaySystem : EntitySystem return false; } - private struct DamageOverlaySettings + private struct DamageOverlaySettings(bool selfEnabled, bool structuresEnabled) { - public readonly bool StructureDamage; - - public readonly bool SelfDamage; - - public DamageOverlaySettings(bool evSelfEnabled, bool evStructuresEnabled) - { - SelfDamage = evSelfEnabled; - - StructureDamage = evStructuresEnabled; - } + public readonly bool SelfDamage = selfEnabled; + public readonly bool StructureDamage = structuresEnabled; } } diff --git a/Resources/Prototypes/Entities/Structures/Lighting/base_lighting.yml b/Resources/Prototypes/Entities/Structures/Lighting/base_lighting.yml index 669bf919b6..9dfb99a981 100644 --- a/Resources/Prototypes/Entities/Structures/Lighting/base_lighting.yml +++ b/Resources/Prototypes/Entities/Structures/Lighting/base_lighting.yml @@ -10,6 +10,11 @@ description: "An always powered light." suffix: Always powered components: + # Sunrise start + - type: DamageOverlay + damagePopupType: SmallFloating + isStructure: true + # Sunrise end - type: MeleeSound soundGroups: Brute: From 4401e83d396cbb74eae66dba4c14b2431fd6a978 Mon Sep 17 00:00:00 2001 From: ZnAkI <126639261+Flesxka@users.noreply.github.com> Date: Wed, 7 May 2025 07:27:21 +0700 Subject: [PATCH 04/40] =?UTF-8?q?=D0=9E=D1=82=D0=BA=D0=B0=D1=82=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BD=D0=BE=D0=B2=D0=BE=D0=B5=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=B4=D0=BD=D1=8F=D1=82=D0=B8=D0=B5=20=D0=B6=D0=B8=D0=B2=D0=BE?= =?UTF-8?q?=D1=82=D0=BD=D1=8B=D1=85=20=D0=B4=D0=BB=D1=8F=20=D0=A1=D0=BC?= =?UTF-8?q?=D0=B0=D0=B9=D0=BB=D0=B0=20(#2101)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prototypes/Entities/Mobs/NPCs/pets.yml | 7 ++--- .../Prototypes/Entities/Mobs/NPCs/slimes.yml | 28 ++++++++++++++++--- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml b/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml index 7ca34592dc..ba097dd881 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml @@ -826,10 +826,9 @@ Blunt: 3 # Sunrise-edit Caustic: 3 # Sunrise-edit - type: MultiHandedItem - # Sunrise-Edit - #- type: Item - # sprite: Mobs/Pets/Smile/smile.rsi - # size: Huge + - type: Item + sprite: Mobs/Pets/Smile/smile.rsi + size: Huge - type: SentienceTarget flavorKind: station-event-random-sentience-flavor-slime - type: MobPrice diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml b/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml index d171320a1d..b408e212e1 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml @@ -113,10 +113,6 @@ speechSounds: Slime - type: TypingIndicator proto: slime - # Sunrise-start - - type: Carriable - - type: CanEscapeInventory - # Sunrise-end - type: entity name: basic slime @@ -161,6 +157,10 @@ Base: blue_adult_slime Dead: Base: blue_adult_slime_dead + # Sunrise-start + - type: Carriable + - type: CanEscapeInventory + # Sunrise-end - type: entity name: blue slime @@ -178,6 +178,10 @@ - MindRoleGhostRoleTeamAntagonist raffle: settings: short +# Sunrise-start + - type: Carriable + - type: CanEscapeInventory +# Sunrise-end - type: entity name: green slime @@ -201,6 +205,10 @@ Structural: 4 Caustic: 1 Poison: 4 +# Sunrise-start + - type: Carriable + - type: CanEscapeInventory +# Sunrise-end - type: entity name: green slime @@ -218,6 +226,10 @@ - MindRoleGhostRoleTeamAntagonist raffle: settings: short +# Sunrise-start + - type: Carriable + - type: CanEscapeInventory +# Sunrise-end - type: entity name: yellow slime @@ -240,6 +252,10 @@ Blunt: 6 Structural: 4 Caustic: 4 +# Sunrise-start + - type: Carriable + - type: CanEscapeInventory +# Sunrise-end - type: entity name: yellow slime @@ -257,3 +273,7 @@ - MindRoleGhostRoleTeamAntagonist raffle: settings: short +# Sunrise-start + - type: Carriable + - type: CanEscapeInventory +# Sunrise-end From 4b97741abac67a8e6c717ef0e92dce7cfe323bc7 Mon Sep 17 00:00:00 2001 From: ThereDrD <88589686+ThereDrD0@users.noreply.github.com> Date: Wed, 7 May 2025 03:27:36 +0300 Subject: [PATCH 05/40] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D0=B8=20?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA?= =?UTF-8?q?=D0=B0=20=D1=81=D0=B8=D1=81=D1=82=D0=B5=D0=BC=D1=8B=20=D1=81?= =?UTF-8?q?=D0=B5=D1=80=D0=B4=D1=86=D0=B5=D0=B1=D0=B8=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20(#2098)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Client/Options/UI/Tabs/ExtraTab.xaml | 1 + .../Options/UI/Tabs/ExtraTab.xaml.cs | 2 + .../Heartbeat/HeartbeatSystem.Settings.cs | 29 +++++++ .../CritHeartbeat/CritHeartbeatComponent.cs | 18 ---- .../CritHeartbeat/CritHeartbeatSystem.cs | 45 ---------- .../Components/ActiveHeartbeatComponent.cs | 10 +++ .../Components/CritHeartbeatComponent.cs | 4 + .../Heartbeat/Systems/HeartbeatSystem.Crit.cs | 60 +++++++++++++ .../Heartbeat/Systems/HeartbeatSystem.cs | 84 +++++++++++++++++++ .../Heartbeat/HeartbeatOptionsChangedEvent.cs | 9 ++ .../_Sunrise/SunriseCCVars/SunriseCCVars.cs | 7 ++ .../_sunrise/escape-menu/ui/options-menu.ftl | 1 + .../Prototypes/Entities/Mobs/Species/base.yml | 5 -- 13 files changed, 207 insertions(+), 68 deletions(-) create mode 100644 Content.Client/_Sunrise/Heartbeat/HeartbeatSystem.Settings.cs delete mode 100644 Content.Server/_Sunrise/CritHeartbeat/CritHeartbeatComponent.cs delete mode 100644 Content.Server/_Sunrise/CritHeartbeat/CritHeartbeatSystem.cs create mode 100644 Content.Server/_Sunrise/Heartbeat/Components/ActiveHeartbeatComponent.cs create mode 100644 Content.Server/_Sunrise/Heartbeat/Components/CritHeartbeatComponent.cs create mode 100644 Content.Server/_Sunrise/Heartbeat/Systems/HeartbeatSystem.Crit.cs create mode 100644 Content.Server/_Sunrise/Heartbeat/Systems/HeartbeatSystem.cs create mode 100644 Content.Shared/_Sunrise/Heartbeat/HeartbeatOptionsChangedEvent.cs diff --git a/Content.Client/Options/UI/Tabs/ExtraTab.xaml b/Content.Client/Options/UI/Tabs/ExtraTab.xaml index 19348d4d4f..fa995d2455 100644 --- a/Content.Client/Options/UI/Tabs/ExtraTab.xaml +++ b/Content.Client/Options/UI/Tabs/ExtraTab.xaml @@ -31,6 +31,7 @@ +