diff --git a/Content.Server/Sprite/RandomSpriteSystem.cs b/Content.Server/Sprite/RandomSpriteSystem.cs index 035f7c6903..5d04dd2f5a 100644 --- a/Content.Server/Sprite/RandomSpriteSystem.cs +++ b/Content.Server/Sprite/RandomSpriteSystem.cs @@ -1,4 +1,5 @@ using Content.Shared.Decals; +using Content.Shared.Random.Helpers; using Content.Shared.Sprite; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; @@ -26,7 +27,7 @@ public sealed class RandomSpriteSystem: SharedRandomSpriteSystem if (component.Available.Count == 0) return; - var groups = new List>(); + var groups = new List>>(); if (component.GetAllGroups) { groups = component.Available; @@ -38,16 +39,27 @@ public sealed class RandomSpriteSystem: SharedRandomSpriteSystem component.Selected.EnsureCapacity(groups.Count); + Color? previousColor = null; + foreach (var group in groups) { foreach (var layer in group) { Color? color = null; - if (!string.IsNullOrEmpty(layer.Value.Item2)) - color = _random.Pick(_prototype.Index(layer.Value.Item2).Colors.Values); + var selectedState = _random.Pick(layer.Value); + if (!string.IsNullOrEmpty(selectedState.Value)) + { + if (selectedState.Value == $"Inherit") + color = previousColor; + else + { + color = _random.Pick(_prototype.Index(selectedState.Value).Colors.Values); + previousColor = color; + } + } - component.Selected.Add(layer.Key, (layer.Value.Item1, color)); + component.Selected.Add(layer.Key, (selectedState.Key, color)); } } diff --git a/Content.Shared/Sprite/RandomSpriteComponent.cs b/Content.Shared/Sprite/RandomSpriteComponent.cs index 4082771e93..0e9133d1c8 100644 --- a/Content.Shared/Sprite/RandomSpriteComponent.cs +++ b/Content.Shared/Sprite/RandomSpriteComponent.cs @@ -17,7 +17,7 @@ public sealed partial class RandomSpriteComponent : Component /// Stored as a list so we can have groups of random sprites (e.g. tech_base + tech_flare for holoparasite) /// [ViewVariables(VVAccess.ReadWrite), DataField("available")] - public List> Available = new(); + public List>> Available = new(); /// /// Selected colors diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index 36288b1c83..a78e61f393 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -1160,7 +1160,7 @@ name: kobold id: MobKobold parent: MobMonkey - description: Cousins to the sentient race of lizard people, kobolds blend in with industrial tiling and are as nasty as monkeys; ready to pull out your hair and stab you to death. + description: Cousins to the sentient race of lizard people, kobolds blend in with their natural habitat and are as nasty as monkeys; ready to pull out your hair and stab you to death. components: - type: LizardAccent - type: Speech # I don't know how to get it to work and i want someone to make them speak like a lizard with normal accents (or optionally another language altogether) @@ -1195,8 +1195,14 @@ drawdepth: Mobs layers: - map: ["enum.DamageStateVisualLayers.Base"] - state: kobold sprite: Mobs/Animals/kobold.rsi + state: kobold + - map: [ "outline" ] + sprite: Mobs/Animals/kobold.rsi + state: outline + - map: [ "horns" ] + sprite: Mobs/Customization/reptilian_parts.rsi + state: horns_short - map: [ "enum.HumanoidVisualLayers.Handcuffs" ] color: "#ffffff" sprite: Objects/Misc/handcuffs.rsi @@ -1210,6 +1216,22 @@ sprite: "Effects/creampie.rsi" state: "creampie_human" visible: false + - type: RandomSprite + getAllGroups: true + available: + - enum.DamageStateVisualLayers.Base: + kobold: KoboldColors + - horns: + horns_curled: KoboldHornColors + horns_ram: KoboldHornColors + horns_short: KoboldHornColors + horns_myrsore: KoboldHornColors + horns_bighorn: KoboldHornColors + horns_argali: KoboldHornColors + horns_ayrshire: KoboldHornColors + horns_floppy_kobold_ears: Inherit + horns_double: Inherit + horns_kobold_ears: Inherit - type: Butcherable butcheringType: Spike spawned: diff --git a/Resources/Prototypes/Palettes/critters.yml b/Resources/Prototypes/Palettes/critters.yml new file mode 100644 index 0000000000..2f027b4b9c --- /dev/null +++ b/Resources/Prototypes/Palettes/critters.yml @@ -0,0 +1,43 @@ +- type: palette + id: KoboldColors + name: KoboldColors + colors: + ForestA: "#71a457" + ForestB: "#536f18" + ForestC: "#1e5026" + ForestD: "#519b71" + ForestE: "#61a003" + ForestF: "#729953" + DesertA: "#999453" + DesertB: "#daa976" + DesertC: "#a4582f" + DesertD: "#af9369" + DesertE: "#c27d3b" + DesertF: "#ddc3a1" + SwampA: "#635033" + SwampB: "#455132" + SwampC: "#4a4d12" + SwampD: "#452d1d" + SwampE: "#5f544c" + SwampF: "#413b0a" + CaveA: "#4a4260" + CaveB: "#3f3330" + CaveC: "#4a4542" + CaveD: "#413d32" + CaveE: "#726f6a" + CaveF: "#d4c8bf" + TechniRed: "#b32828" + TechniOrange: "#da8929" + TechniGreen: "#28df58" + TechniBlue: "#144bb3" + TechniCyan: "#1ddfbe" + TechniPurple: "#792da9" + TechniFuchsia: "#d11a82" + +- type: palette + id: KoboldHornColors + name: KoboldHornColors + colors: + HornA: "#d4c8bf" + hornB: "#eec7ab" + hornC: "#ad9584" diff --git a/Resources/Textures/Mobs/Animals/kobold.rsi/kobold.png b/Resources/Textures/Mobs/Animals/kobold.rsi/kobold.png index 1abd0e22eb..4be7d2591e 100644 Binary files a/Resources/Textures/Mobs/Animals/kobold.rsi/kobold.png and b/Resources/Textures/Mobs/Animals/kobold.rsi/kobold.png differ diff --git a/Resources/Textures/Mobs/Animals/kobold.rsi/meta.json b/Resources/Textures/Mobs/Animals/kobold.rsi/meta.json index 33b5878391..05e21930b6 100644 --- a/Resources/Textures/Mobs/Animals/kobold.rsi/meta.json +++ b/Resources/Textures/Mobs/Animals/kobold.rsi/meta.json @@ -5,11 +5,15 @@ "y": 32 }, "license": "CC-BY-SA-3.0", - "copyright": "Drawn by Ubaser", + "copyright": "Drawn by Ubaser, modified by Bhijn and Myr", "states": [ { "name": "kobold", "directions": 4 + }, + { + "name": "outline", + "directions": 4 } ] } diff --git a/Resources/Textures/Mobs/Animals/kobold.rsi/outline.png b/Resources/Textures/Mobs/Animals/kobold.rsi/outline.png new file mode 100644 index 0000000000..c1a62aac6c Binary files /dev/null and b/Resources/Textures/Mobs/Animals/kobold.rsi/outline.png differ