From d30786097bd9ba6d7b4151d63a7acd38b877d9ef Mon Sep 17 00:00:00 2001 From: Vigers Ray Date: Thu, 20 Feb 2025 17:24:47 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=8B=D0=BD=D0=B5=D1=81=20=D1=81=D0=BF?= =?UTF-8?q?=D0=BE=D0=BD=D1=81=D0=BE=D1=80=D1=81=D0=BA=D0=B8=D0=B9=20=D0=B5?= =?UTF-8?q?=D0=BA=D0=B2=D0=B8=D0=BF=20=D0=BF=D1=80=D0=B8=20=D1=81=D0=BF?= =?UTF-8?q?=D0=B0=D0=B2=D0=BD=D0=B5=20=D0=B2=20=D0=BE=D1=82=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC?= =?UTF-8?q?=D0=B5=D1=82=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SponsorLoadout/SponsorLoadoutSystem.cs | 36 +++++----- .../_Sunrise/Catalog/Loadout/sponsor.yml | 67 +++++++++---------- .../ISharedSponsorsManager.cs | 4 ++ 3 files changed, 50 insertions(+), 57 deletions(-) diff --git a/Content.Server/_Sunrise/SponsorLoadout/SponsorLoadoutSystem.cs b/Content.Server/_Sunrise/SponsorLoadout/SponsorLoadoutSystem.cs index 9184aac8e9..43aa1c7f3b 100644 --- a/Content.Server/_Sunrise/SponsorLoadout/SponsorLoadoutSystem.cs +++ b/Content.Server/_Sunrise/SponsorLoadout/SponsorLoadoutSystem.cs @@ -23,29 +23,25 @@ public sealed class SponsorLoadoutSystem : EntitySystem if (_sponsorsManager == null) return; - if (!_sponsorsManager.TryGetPrototypes(ev.Player.UserId, out var prototypes)) + if (!_sponsorsManager.TryGetSpawnEquipment(ev.Player.UserId, out var spawnEquipment)) return; - foreach (var loadoutId in prototypes) - { - if (!_prototypeManager.TryIndex(loadoutId, out var loadout)) - continue; - var isSponsorHave = !prototypes.Contains(loadoutId); - var isWhitelisted = ev.JobId != null && - loadout.WhitelistJobs != null && - !loadout.WhitelistJobs.Contains(ev.JobId); - var isBlacklisted = ev.JobId != null && - loadout.BlacklistJobs != null && - loadout.BlacklistJobs.Contains(ev.JobId); - var isSpeciesRestricted = loadout.SpeciesRestrictions != null && - loadout.SpeciesRestrictions.Contains(ev.Profile.Species); + if (!_prototypeManager.TryIndex(spawnEquipment, out var loadout)) + return; + var isWhitelisted = ev.JobId != null && + loadout.WhitelistJobs != null && + !loadout.WhitelistJobs.Contains(ev.JobId); + var isBlacklisted = ev.JobId != null && + loadout.BlacklistJobs != null && + loadout.BlacklistJobs.Contains(ev.JobId); + var isSpeciesRestricted = loadout.SpeciesRestrictions != null && + loadout.SpeciesRestrictions.Contains(ev.Profile.Species); - if (isSponsorHave || isWhitelisted || isBlacklisted || isSpeciesRestricted) - continue; + if (isWhitelisted || isBlacklisted || isSpeciesRestricted) + return; - if (!_prototypeManager.TryIndex(loadout.Equipment, out var startingGear)) - continue; + if (!_prototypeManager.TryIndex(loadout.Equipment, out var startingGear)) + return; - _spawn.EquipStartingGear(ev.Mob, startingGear); - } + _spawn.EquipStartingGear(ev.Mob, startingGear); } } diff --git a/Resources/Prototypes/_Sunrise/Catalog/Loadout/sponsor.yml b/Resources/Prototypes/_Sunrise/Catalog/Loadout/sponsor.yml index a41961b21b..92e109b277 100644 --- a/Resources/Prototypes/_Sunrise/Catalog/Loadout/sponsor.yml +++ b/Resources/Prototypes/_Sunrise/Catalog/Loadout/sponsor.yml @@ -1,77 +1,70 @@ #Knight_of_the_Sun: - type: sponsorLoadout - id: SunriseUplink40Loadout - equipment: SunriseUplink40 + id: SunriseSponsorTier2 + equipment: SunriseSponsorTier2 - type: startingGear - id: SunriseUplink40 + id: SunriseSponsorTier2 storage: + neck: ClothingNeckSunriseBadge back: - SunriseUplink40 #Sun: - type: sponsorLoadout - id: SunriseUplink80Loadout - equipment: SunriseUplink80 + id: SunriseSponsorTier3 + equipment: SunriseSponsorTier3 - type: startingGear - id: SunriseUplink80 + id: SunriseSponsorTier3 storage: + neck: ClothingNeckSunriseBadge back: - SunriseUplink80 #Endless_Summer - type: sponsorLoadout - id: SunriseUplink100Loadout - equipment: SunriseUplink100 + id: SunriseSponsorTier4 + equipment: SunriseSponsorTier4 - type: startingGear - id: SunriseUplink100 + id: SunriseSponsorTier4 storage: + neck: ClothingNeckSunriseBadge back: - SunriseUplink100 -#Badge -- type: sponsorLoadout - id: SunriseBadgeLoadout - equipment: ClothingNeckSunriseBadge - -- type: startingGear - id: ClothingNeckSunriseBadge - equipment: - neck: ClothingNeckSunriseBadge - # FISHSTATION UPLINKS: # first level? - type: sponsorLoadout - id: FishStationUplink40Loadout - equipment: FishStationUplink40 + id: FishSponsorTier1 + equipment: FishSponsorTier1 - type: startingGear - id: FishStationUplink40 + id: FishSponsorTier1 storage: back: - FishStationUplink40 # second level? - type: sponsorLoadout - id: FishStationUplink80Loadout - equipment: FishStationUplink80 + id: FishSponsorTier2 + equipment: FishSponsorTier2 - type: startingGear - id: FishStationUplink80 + id: FishSponsorTier2 storage: back: - FishStationUplink80 # third level? - type: sponsorLoadout - id: FishStationUplink100Loadout - equipment: FishStationUplink100 + id: FishSponsorTier3 + equipment: FishSponsorTier3 - type: startingGear - id: FishStationUplink100 + id: FishSponsorTier3 storage: back: - FishStationUplink100 @@ -80,33 +73,33 @@ # first level? - type: sponsorLoadout - id: NeweraStationUplink40Loadout - equipment: NeweraStationUplink40 + id: NeweraSponsorTier1 + equipment: NeweraSponsorTier1 - type: startingGear - id: NeweraStationUplink40 + id: NeweraSponsorTier1 storage: back: - NeweraStationUplink40 # second level? - type: sponsorLoadout - id: NeweraStationUplink80Loadout - equipment: NeweraStationUplink80 + id: NeweraSponsorTier2 + equipment: NeweraSponsorTier2 - type: startingGear - id: NeweraStationUplink80 + id: NeweraSponsorTier2 storage: back: - NeweraStationUplink80 # third level? - type: sponsorLoadout - id: NeweraStationUplink100Loadout - equipment: NeweraStationUplink100 + id: NeweraSponsorTier3 + equipment: NeweraSponsorTier3 - type: startingGear - id: NeweraStationUplink100 + id: NeweraSponsorTier3 storage: back: - NeweraStationUplink100 diff --git a/Sunrise/Content.Sunrise.Interfaces.Shared/ISharedSponsorsManager.cs b/Sunrise/Content.Sunrise.Interfaces.Shared/ISharedSponsorsManager.cs index 863f689a4a..432f2d3319 100644 --- a/Sunrise/Content.Sunrise.Interfaces.Shared/ISharedSponsorsManager.cs +++ b/Sunrise/Content.Sunrise.Interfaces.Shared/ISharedSponsorsManager.cs @@ -27,6 +27,7 @@ public interface ISharedSponsorsManager public bool TryGetPrototypes(NetUserId userId, [NotNullWhen(true)] out List? prototypes); public bool TryGetOocTitle(NetUserId userId, [NotNullWhen(true)] out string? title); public bool TryGetOocColor(NetUserId userId, [NotNullWhen(true)] out Color? color); + public bool TryGetSpawnEquipment(NetUserId userId, [NotNullWhen(true)] out string? spawnEquipment); public bool TryGetGhostThemes(NetUserId userId, [NotNullWhen(true)] out List? ghostTheme); public bool TryGetBypassRoles(NetUserId userId, [NotNullWhen(true)] out List? bypassRoles); public int GetSizeFlavor(NetUserId userId); @@ -75,6 +76,9 @@ public sealed class SponsorInfo [JsonPropertyName("ghostThemes")] public string[] GhostThemes { get; set; } = []; + [JsonPropertyName("spawnEquipment")] + public string? SpawnEquipment { get; set; } + [JsonPropertyName("allowedMarkings")] public string[] AllowedMarkings { get; set; } = [];