diff --git a/Content.Client/White/CustomGhostSpriteSystem/CustomGhostVisualizer.cs b/Content.Client/White/CustomGhostSpriteSystem/CustomGhostVisualizer.cs new file mode 100644 index 0000000000..634d80c513 --- /dev/null +++ b/Content.Client/White/CustomGhostSpriteSystem/CustomGhostVisualizer.cs @@ -0,0 +1,25 @@ +using Content.Client.Ghost; +using Content.Shared.White.CustomGhostSystem; +using Robust.Client.GameObjects; + +namespace Content.Client.White.CustomGhostSpriteSystem; + +public sealed class CustomGhostVisualizer : VisualizerSystem +{ + protected override void OnAppearanceChange(EntityUid uid, GhostComponent component, ref AppearanceChangeEvent args) + { + base.OnAppearanceChange(uid, component, ref args); + + if(args.Sprite == null) return; + + if (AppearanceSystem.TryGetData(uid, CustomGhostAppearance.Sprite, out var rsiPath, args.Component)) + { + args.Sprite.LayerSetRSI(0, rsiPath); + } + + if(AppearanceSystem.TryGetData(uid, CustomGhostAppearance.AlphaOverride, out var alpha, args.Component)) + { + args.Sprite.Color = args.Sprite.Color.WithAlpha(alpha); + } + } +} diff --git a/Content.Server/White/CustomGhostSpriteSystem/CustomGhostSpriteSystem.cs b/Content.Server/White/CustomGhostSpriteSystem/CustomGhostSpriteSystem.cs new file mode 100644 index 0000000000..3e6ae1f836 --- /dev/null +++ b/Content.Server/White/CustomGhostSpriteSystem/CustomGhostSpriteSystem.cs @@ -0,0 +1,61 @@ +using Content.Server.Ghost.Components; +using Content.Shared.White.CustomGhostSystem; +using Robust.Server.GameObjects; +using Robust.Server.Player; +using Robust.Shared.Prototypes; + +namespace Content.Server.White.CustomGhostSpriteSystem; + +public sealed class CustomGhostSpriteSystem : EntitySystem +{ + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!; + [Dependency] private readonly IPlayerManager _playerManager = default!; + + + public override void Initialize() + { + base.Initialize(); + SubscribeLocalEvent(OnShit); + } + + private void OnShit(EntityUid uid, GhostComponent component, PlayerAttachedEvent args) + { + if(!_playerManager.TryGetSessionByEntity(uid, out var session)) + return; + + TrySetCustomSprite(uid, session.Name); + } + + + public void TrySetCustomSprite(EntityUid ghostUid, string ckey) + { + var prototypes = _prototypeManager.EnumeratePrototypes(); + + foreach (var customGhostPrototype in prototypes) + { + if (string.Equals(customGhostPrototype.Ckey, ckey, StringComparison.CurrentCultureIgnoreCase)) + { + _appearanceSystem.SetData(ghostUid, CustomGhostAppearance.Sprite, customGhostPrototype.CustomSpritePath.ToString()); + + if(customGhostPrototype.AlphaOverride > 0) + { + _appearanceSystem.SetData(ghostUid, CustomGhostAppearance.AlphaOverride, customGhostPrototype.AlphaOverride); + } + + if (customGhostPrototype.GhostName != string.Empty) + { + MetaData(ghostUid).EntityName = customGhostPrototype.GhostName; + } + + if (customGhostPrototype.GhostDescription != string.Empty) + { + MetaData(ghostUid).EntityDescription = customGhostPrototype.GhostDescription; + } + + return; + } + + } + } +} diff --git a/Content.Shared/White/CustomGhostSystem/CustomGhostPrototype.cs b/Content.Shared/White/CustomGhostSystem/CustomGhostPrototype.cs new file mode 100644 index 0000000000..67921d5742 --- /dev/null +++ b/Content.Shared/White/CustomGhostSystem/CustomGhostPrototype.cs @@ -0,0 +1,38 @@ +using Robust.Shared.Prototypes; +using Robust.Shared.Serialization; +using Robust.Shared.Utility; + +namespace Content.Shared.White.CustomGhostSystem; + +/// +/// This is a prototype for... +/// +[Prototype("customGhost")] +public sealed class CustomGhostPrototype : IPrototype +{ + /// + [IdDataField] + public string ID { get; } = default!; + + [DataField("ckey", required: true)] + public string Ckey { get; } = default!; + + [DataField("sprite", required: true)] + public ResPath CustomSpritePath { get; } = default!; + + [DataField("alpha")] + public float AlphaOverride { get; } = -1; + + [DataField("ghostName")] + public string GhostName = string.Empty; + + [DataField("ghostDescription")] + public string GhostDescription = string.Empty; +} + +[Serializable, NetSerializable] +public enum CustomGhostAppearance +{ + Sprite, + AlphaOverride +} diff --git a/Content.Shared/White/Sponsors/MsgSponsorInfo.cs b/Content.Shared/White/Sponsors/MsgSponsorInfo.cs index f197b3ecc8..dd9aaa32c3 100644 --- a/Content.Shared/White/Sponsors/MsgSponsorInfo.cs +++ b/Content.Shared/White/Sponsors/MsgSponsorInfo.cs @@ -7,6 +7,15 @@ using Robust.Shared.Utility; namespace Content.Shared.White.Sponsors; +public enum WhiteSponsorTier +{ + DJ = 5, + ROBUSTER = 4, + CLOWN = 3, + PRIKOLIST = 2, + MEATYORE = 1 +} + [Serializable, NetSerializable] public sealed class SponsorInfo { diff --git a/Resources/Prototypes/White/Ghosts/custom_ghosts.yml b/Resources/Prototypes/White/Ghosts/custom_ghosts.yml new file mode 100644 index 0000000000..3d931d2285 --- /dev/null +++ b/Resources/Prototypes/White/Ghosts/custom_ghosts.yml @@ -0,0 +1,23 @@ +- type: customGhost + id: ravmorgan-ghost + ckey: ravmorgan + sprite: White/Ghosts/ravmorgan-ghost.rsi + alpha: 0.9 + ghostName: Яйцо + ghostDescription: Большое... + +- type: customGhost + id: merkkaa-ghost + ckey: merkkaa + sprite: White/Ghosts/merkkaa-ghost.rsi + alpha: 0.9 + ghostName: Мурка + ghostDescription: Ня... + +- type: customGhost + id: nairsark-ghost + ckey: nairsark + sprite: White/Ghosts/nairsark-ghost.rsi + alpha: 1 + ghostName: Maid + ghostDescription: Not a fucking fumo diff --git a/Resources/Textures/White/Ghosts/merkkaa-ghost.rsi/animated.png b/Resources/Textures/White/Ghosts/merkkaa-ghost.rsi/animated.png new file mode 100644 index 0000000000..bd8d9f4d18 Binary files /dev/null and b/Resources/Textures/White/Ghosts/merkkaa-ghost.rsi/animated.png differ diff --git a/Resources/Textures/White/Ghosts/merkkaa-ghost.rsi/meta.json b/Resources/Textures/White/Ghosts/merkkaa-ghost.rsi/meta.json new file mode 100644 index 0000000000..acf9bd3d96 --- /dev/null +++ b/Resources/Textures/White/Ghosts/merkkaa-ghost.rsi/meta.json @@ -0,0 +1,32 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Created by MOYAMAMA", + "size": { + "x": 32, + "y": 64 + }, + "states": [ + { + "name": "animated", + "delays": [ + [ + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1 + ] + ] + } + ] +} diff --git a/Resources/Textures/White/Ghosts/nairsark-ghost.rsi/animated.png b/Resources/Textures/White/Ghosts/nairsark-ghost.rsi/animated.png new file mode 100644 index 0000000000..238eb71b38 Binary files /dev/null and b/Resources/Textures/White/Ghosts/nairsark-ghost.rsi/animated.png differ diff --git a/Resources/Textures/White/Ghosts/nairsark-ghost.rsi/meta.json b/Resources/Textures/White/Ghosts/nairsark-ghost.rsi/meta.json new file mode 100644 index 0000000000..6edddc1c9c --- /dev/null +++ b/Resources/Textures/White/Ghosts/nairsark-ghost.rsi/meta.json @@ -0,0 +1,57 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", +"copyright": "Created by MOYAMAMA", + "size": { + "x": 48, + "y": 64 + }, + "states": [ + { + "name": "animated", + "directions": 4, + "delays": [ + [ + 0.1, + 0.1, + 0.1, + 0.1, + 0.3, + 0.2, + 0.1, + 0.1 + ], + [ + 0.1, + 0.1, + 0.1, + 0.1, + 0.3, + 0.2, + 0.1, + 0.1 + ], + [ + 0.1, + 0.1, + 0.1, + 0.1, + 0.3, + 0.2, + 0.1, + 0.1 + ], + [ + 0.1, + 0.1, + 0.1, + 0.1, + 0.3, + 0.2, + 0.1, + 0.1 + ] + ] + } + ] +} diff --git a/Resources/Textures/White/Ghosts/ravmorgan-ghost.rsi/animated.png b/Resources/Textures/White/Ghosts/ravmorgan-ghost.rsi/animated.png new file mode 100644 index 0000000000..433e10e718 Binary files /dev/null and b/Resources/Textures/White/Ghosts/ravmorgan-ghost.rsi/animated.png differ diff --git a/Resources/Textures/White/Ghosts/ravmorgan-ghost.rsi/meta.json b/Resources/Textures/White/Ghosts/ravmorgan-ghost.rsi/meta.json new file mode 100644 index 0000000000..8e4d655f20 --- /dev/null +++ b/Resources/Textures/White/Ghosts/ravmorgan-ghost.rsi/meta.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Created by MOYAMAMA", + "size": { + "x": 32, + "y": 40 + }, + "states": [ + { + "name": "animated" + } + ] +}